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

Michael Foord: State of the Pythons (Keynote)

Michael Foord: State of the Pythons (Keynote)

= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
Michael Foord:
State of the Pythons
= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
@ Kiwi PyCon 2013 - Saturday, 07 Sep 2013 - Keynote
http://nz.pycon.org/

**YouTube**

http://www.youtube.com/watch?v=IWB_pQacuw4

New Zealand Python User Group

September 07, 2013
Tweet

More Decks by New Zealand Python User Group

Other Decks in Programming

Transcript

  1. How to become a Python core developer (and why you

    probably don't want to) Why you might want to become a core developer: • Fame • Fortune • Sweet speaking gigs in New Zealand
  2. Seriously though • Contributing to a major open source project

    is good on your CV • It's a great experience to be involved in collaborative world-wide development • You get to give back to Python • You get to help make the future • People use your code - you're building something people use
  3. Who cares? open(some_file, 'w').write('foo') initial = '' for fragment in

    some_horribly_large_data_set: initial += fragment
  4. CPython • The reference implementation • Statistically almost certainly what

    you use • Python 2.7 most widely used version • Python 3.4 alpha 1 is now out • Python 3 is a nicer language than Python 2 and it keeps getting better
  5. IronPython • Still on Python 2.7 • Python 2.7.4 release

    due shortly • Some partial Python 3 compatibility • No GIL!
  6. Jython • Jython 2.7 is at beta • also a

    small team hindering development • After 2.7 comes Python 3 support • No GIL!
  7. PyPy • The most exciting Python implementation • Arm support

    (including Raspberry Pi) • Python 3 now in beta! • Software transactional memory! • Numpypy! • Has a GIL
  8. The PEPs • PEP 435: the "enum" module • PEP

    442: improved semantics for object finalization • PEP 443: single-dispatch generic functions • PEP 445: Configurable memory allocators • PEP 446: Make newly created file descriptors non-inheritable • PEP 447: add type.__locallookup__ • PEP 448: additional unpacking generalizations
  9. It's Complicated • PEP 446: Make newly created file descriptors

    non-inheritable. • PEP 447: add type.__locallookup__ (dynamic behaviour for metaclasses) • PEP 442: improved semantics for object finalization
  10. Not a big deal but nice anyway • PEP 443:

    single-dispatch generic functions • PEP 445: Configurable memory allocators
  11. PEP 435: Enums >>> from enum import Enum >>> class

    Color(Enum): ... red = 1 ... green = 2 ... blue = 3 >>> Animal = Enum('Animal', 'ant bee cat dog')
  12. PEP 448: additional unpacking >>> print(*[1], *[2], 3) 1 2

    3 >>> *range(4), 4 (0, 1, 2, 3, 4) # Flattening generator expression g = (*x for x in iterables)
  13. Subtests class NumbersTest(unittest.TestCase): def test_even(self): for i in range(0, 6):

    with self.subTest(i=i): self.assertEqual(i % 2, 0) ====================================================================== FAIL: test_even (__main__.NumbersTest) (i=1) ---------------------------------------------------------------------- Traceback (most recent call last): File "subtests.py", line 32, in test_even self.assertEqual(i % 2, 0) AssertionError: 1 != 0
  14. Still to come • PEP 436: The Argument Clinic DSL

    • PEP 450: Adding A Statistics Module To The Standard Library • PEP 451: A ModuleSpec Type for the Import System • PEP 452: API for Cryptographic Hash Functions v2 • PEP 453: Explicit bootstrapping of pip in Python • Tulip?
  15. Interesting optimisations • New GIL • Flexible string representation (PEP

    393) • Key sharing dictionary (PEP 412) • yield from (PEP 380) • A C implementation of decimal
  16. Major frickin changes • Death to .pyc files (sort of)

    • Death to __init__.py files (sort of) • virtualenv built-in to Python (sort of) • All exceptions changed! (sort of) • Python launcher for Windows (PEP 397)
  17. __qualname__ >>> class Foo(object): ... def bar(self): pass ... >>>

    Foo.bar.__qualname__ 'Foo.bar' >>> Foo.bar.__module__ '__main__'
  18. Packaging changes • disutils2 is dead • setuptools / distribute

    merge back • CDN for PyPI replacing mirrors • wheels! (binary installer format) • PEP 426: metadata for packages • bundling get-pip
  19. So where next? Major changes in computing that Python hasn't

    really adapted to: • mobile • multiple processors • async