What's new in Python 3.x?

http://docs.python.org/3.0/whatsnew/3.0.html says that it lists what's new, but in my opinion it only contains differences, so that anyone knows about a completely new Python Feature, introduced in version 3.x?

To avoid confusion, I will define a completely new function as something that has never been used in any other code before embarking on you and going “Oh shine!”. For example. function for alien invasion, etc.

+5
source share
2 answers

The New Syntax section lists, well, the new syntax in Python 3.x. I think it is debatable whether sometimes new or changed things. For example. exception chain ( PEP 3134 ): is it a new feature or is it a change to the exception mechanism?

In general, I recommend looking at all the PEPs listed in the document. These are major changes / new features.

+4
source

Many of the completely new features introduced in version 3.0 have also been addressed to 2.6, a deliberate choice. However, in all cases this was practically impossible, so some of the new features were left only to Python 3.

How metaclasses work is probably the biggest single new feature. The syntax is clearly better than the 2.* __metaclass__assignment ...:

class X(abase, metaclass=Y):

, , , , , , , , , - 2.*. , metaclass __prepare__ , , dict ( , def) . , , , , , / , , . , 2.*.

biggie - . PEP, . Python , - , , - , , , , Python.

, , ( "", , dict .keys & c in 3.*, , , nonlocal ,...), , .

+9
source

All Articles