3 ms·
Let me think. These are for 2.x line, I still haven't tried Python 3.x as it doesn't seem to be significantly leaner and more modern than Python 2.x. I'll go fo
by yason 16y ago
Let me think. These are for 2.x line, I still haven't tried Python 3.x as it doesn't seem to be significantly leaner and more modern than Python 2.x. I'll go for Python 3 no later than when I absolutely have to.
1) Scoping: there's no nested lexical scoping but only function and global scope. Makes many unnecessary workarounds necessary. 2) Read-only closures: you have to use the list hack, you can't just assign to any closed-over vars. 3) No do-while. Surprisingly often needed and thus irritating. 4) Some shortcomings aren't inherent in Python: while I would always like to prefer generators over lists and list comprehensions, and consider iterators elegant, I started considering iterators and itertools as cumbersome and old-fashioned right after I saw lazy sequences in action in Clojure. 5) Various function and method names that I just never, ever recall without first rethinking it again. Like dict.setdefault() which is actually dict.get() but with a default value. There's probably a dozen of these, and each time I just wonder: why is it so difficult to properly rename a few functions and gradually deprecate the old ones. 6) Last, the classical "there are no proper anonymous functions": lambda doesn't cut it and having to specifically name "anonymous" functions is cumbersome. Combined with scoping limitations, even using a generic name like "_" for local functions to be passed as arguments can cause trouble.
There used to be more but I have done less and less with Python recently and much more with Clojure, so the irks are fading.