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

Python 3.0: Where we break all your code

Sponsored · SiteGround - Reliable hosting with speed, security, and support you can count on.

Python 3.0: Where we break all your code

Avatar for Abhinav Sarkar

Abhinav Sarkar

September 13, 2008
Tweet

More Decks by Abhinav Sarkar

Other Decks in Programming

Transcript

  1. 3.0

  2. !!

  3. def fun(arg1, arg2, *, flag=False): pass >>> fun(1,2,3) Traceback (most

    recent call last): File “<stdin>”, line 1, in <module> TypeError: fun() takes exactly 2 positional arguments (3 given)
  4. documentation def doEvil(plan: “a plan”) -> “evil results”: .... types

    def foo(a: float, b: int, c:list) -> dict: .... more complex def processFiles(*files: “one or more of filenames”, delete: “delete when done” = False) -> “a boolean”: ....
  5. take 2.5 code get working on 2.6 turn -3 flag

    while True: run through 2to3 run unit tests under 3.0 fix 2.x code
  6. python 2.6 interim release -3 flag: turns on warnings from

    __future__ from future_builtins import enables some backports