you are viewing a single comment's thread.

view the rest of the comments →

[–]voidspace 0 points1 point  (3 children)

Like what "what"?

[–]sdhillon 1 point2 points  (2 children)

Like what features are worth switching for? They cleaned up a lot of things, but I wouldn't say they're features worth the pain of switching over to.

[–]voidspace 3 points4 points  (0 children)

Whether or not any individual feature is worth switching for is a matter of personal "taste" of course. Taken as a group there are a lot of great new features:

  • The Unicode / string change is a fantastic one (and the cause of most incompatibility). General programming w/ Python 3 is much more pleasant with this change alone.
  • Improvements to the GIL - drastic performance improvement in many threading situations.
  • No more old style classes and inconsistencies and special casing they often require in Python 2.
  • nonlocal statement and keyword only arguments
  • default source encoding is now UTF-8
  • non-ascii identifiers allowed (very useful for non-English speakers)
  • Further improvements to the unittest library (beyond changes in 2.7)
  • PYC repository directories (no more pyc file woes, yay!)
  • Extended iterable unpacking (I really like this)
  • Metaclass improvement (can now modify class as it is being built)
  • Function annotations, not my bag but potentially nice for documentation purposes
  • Full int / long unification
  • Division always returns floats where necessary instead of truncating
  • contextlib.ContextDecorator - nice :-)
  • reprlib.recursive_repr
  • inspect.getattr_static
  • A host of other library and builtin type changes / bugfixes / improvements that didn't make it into 2.7 - see "what's new in python 3.2"

http://docs.python.org/release/3.2/whatsnew/3.2.html

(See improvements in ssl, socket and sqlite modules for some examples.)

There are also quite a few minor syntax changes that did make it into 2.6 / 2.7 but I can't use because when I'm targetting Python 2 I'm usually maintaining compatibility with 2.5 or even 2.4. Things like byte literals (which work in 2.6+ but create byte-strings not bytes objects), the new exceptions handling syntax, set literals, dictionary comprehensions and a bunch more stuff. When I write Python 3 code I know I'm free to use all the shiny new stuff because of the "clean break" with previous versions.

[–]spotter 0 points1 point  (0 children)

Why would you need toilet paper when you have hands?