| >it was actually a bit worse than Python 2 when it was out It still has a few things that really suck! The thing that bothers me the most is the removal of in-argument tuple unpacking.
For example, in python 2.x you could write: dist = lambda (x1,y1),(x2,y2) : math.sqrt((x1-x2)2 + (y1-y2)2) Whereas in python 3.x you must write dist = lambda p1,p2 : math.sqrt((p1[0]-p2[0])2 + (p1[1]-p2[1])2) Which is just awful to read. It gets much worse when you're trying to program in a functional style and you are using triples or quadruples. Imagine using "x[1], x[2], x[3], x[4]" instead of something like "length, width, height, color". PEP 3113 attempts to rationalize this change, but it's kind of an awful PEP. It claims "no loss of abilities removed", which is clearly false, and the proposed benefits are highly specious. The entire tuple-unpacking system could just be reduced to the insertion of an unpack instruction at the start of the function. That would actually make a lot of sense with Python's policy of "ask forgiveness rather than permission", since trying this with the wrong tuple length would throw a ValueError explaining what went wrong. I also miss (but it's not really an important language feature like in-argument tuple unpacking) the ability to do encoding directly on strings. For example, "hello".encode('hex') or "aGVsbG8=".decode('base64') That was much more convenient than having to import some library and use library methods. |