Upgrade to Pro — share decks privately, control downloads, hide ads and more …

What may be new in Python 3.4

What may be new in Python 3.4

Slides from PyCon.DE 2013, Cologne

Christian Heimes

October 16, 2013
Tweet

More Decks by Christian Heimes

Other Decks in Programming

Transcript

  1. What's new What may be new in Python 3.4 PyCon.DE

    2013, Köln Christian Heimes <[email protected]> @ChristianHeimes
  2. PEP 435 enum >>> from enum import Enum >>> class

    Color(Enum): ... red = 1 ... green = 2 ... blue = 3 (Barry Warsaw, Eli Bendersky, Ethan Furman)
  3. PEP 427 Wheel Binary Package Format Installationsformat (nicht importierbar, kein

    egg-Ersatz) Multiversion / Multiplattform Signed Packages (Daniel Holth)
  4. PEP 428 pathlib module (?) >>> p = Path('docs') >>>

    for child in p: child ... PosixPath('docs/conf.py') PosixPath('docs/_templates') ... >>> p.isfile() True (Antoine Pitrou)
  5. PEP 431 time zone support pytz für stdlib Updates über

    tzdata-update verschoben :( (Lennart Regebro)
  6. PEP 451 ModuleSpec Type for the Import System module finder

    ↓ module spec ↓ module loader (Eric Snow)
  7. PEP 452 API for Crypto Hash Function v2.0 digest.name digest.block_size

    naming scheme bytes (Christian Heimes, AM Kuchling)
  8. PEP 3156 Async IO support aka „Tulip“ Twisted / Tornado

    pluggable event loop + protocol abstraction selector schon in 3.4 (Guido van Rossum, et. al.)
  9. PEP 456 Secure and interchangeable hash algorithm Dan Bernsteins SipHash24

    als Hash-Algorithmus für str, bytes, memoryview (Christian Heimes)
  10. PEP 447 Add __locallookup__ method to metaclass def lookup(mro_list, name):

    for cls in mro_list: if name in cls.__dict__: return cls.__dict__ return NotFound def lookup(mro_list, name): for cls in mro_list: try: return cls.__locallookup__(name) except AttributeError: pass return NotFound (Ronald Oussoren)
  11. Python Startup tip compared to v3.4.0a3: ### normal_startup ### Min:

    0.506533 -> 0.313627: 1.62x faster Avg: 0.582504 -> 0.441796: 1.32x faster Significant (t=19.98) Stddev: 0.02397 -> 0.04366: 1.8213x larger (Antoine Pitrou, Victor Stinner, Christian Heimes)