#Python has batteries included in its stdlib, but when those batteries aren't enough people have to resort to installing pip + virtualenv + pyenv, alongside the OS's native packager, which they still need for native dependencies.
In #Scala, for writing all kinds of scripts, with all sorts of dependencies, all you need now is Scala CLI; which can also help with distributing your script as a JAR, or as a native executable:
@alexelcu the #python stdlib includes venv module that creates a virtual environment and installs pip in it from a bootstrap. So, in a sense, all you need is Python interpreter itself.
In praise of Reverse Polish Notation (RPN) with Python or C
For whatever reason, RPN didn’t really succeed in the general marketplace, and you might wonder why it was ever a thing. The biggest reason is that RPN is very easy to implement compared to working through proper algebraic, or infix, notation. In addition, in ...continues
@danie10 There is also a #LISP/ #clojure way to not treat math operations as anything special but regular functions. So, there is also no infix magic, no unexpected order of operations, no magic. But in addition to all these benefits it shares with RPN, it's also consistent with the rest of the language, and so doesn't require learning anything new. I think it's neat. Sometimes, less is more.
Reminder that the only safe dummy domains to use are:
example.com
example.net
example.org
And nowadays there's also a safe dummy TLD: .example
These are safe because they are reserved by IANA as as special-use domain names for documentation purposes on direction of IETF in RFC 2606 and RFC 6761.
Any other domain can be registered and as such should never be used as a dummy domain for documentation or as eg. an example in default configs.
@treyhunner What's interesting, #Python built-ins have one real singleton: None. It has NoneType type but you can't create new instances of it. And you can't copy it. And overall, I tried hard, out of curiosity, to make another None, nothing worked. Maybe, only if to copy it somewhere on C-level.
I've always thought that knowledge of tuples, lists, dicts, and sets was part of the lingua franca of Python, but I've increasingly had doubts. Maybe they've never been that. I don't know. Just a fleeting thought of the morning
@_KevinTrainor@faassen@dabeaz For me, using sets and operations on sets is natural. And then when I do, co-workers are surprised: "Wow, can Python do that O.o". And indeed, I've recently seen a Python introductory book that doesn't cover sets at all.
4 years ago, I got into lambda calculus by watching 1 and implementing 2 on #python the Lambda Calculus workshop by @dabeaz, and I still think this is the most mind-blowing thing I know (on par with category theory). Learning #Rust was an excellent excuse to dive into it again.
@bitprophet there are many bad things to say about Python docs, but they are certainly versioned. When you look docs for 3.10, it won't include any docs for 3.11. It might mention some upcoming PEPs, but for a reason. In particular, typing docs do that because with lazy annotations and typing_extensions you can use any typing features on any Python versions.
Started to measure the performance of threads vs async/await (with asyncio and uvloop) on TCP with expectation that async will win by far. I'm almost a week in it and at this point I'm not sure about anything.
It's too early to draw conclusions, but looks like with a fast enough network, threads and async are about the same.