/
guido@python.org guido@python.org

guido@python.org - PDF document

liane-varnes
liane-varnes . @liane-varnes
Follow
397 views
Uploaded On 2016-07-21

guido@python.org - PPT Presentation

Slide 2Copyright 2002 Zope Corporation All rights reserved ID: 413220

Slide 2Copyright 2002 Zope Corporation.

Share:

Link:

Embed:

Download Presentation from below link

Download Pdf The PPT/PDF document "guido@python.org" is the property of its rightful owner. Permission is granted to download and print the materials on this web site for personal, non-commercial use only, and to display it on your personal computer provided you do not modify the materials and that you retain all copyright notices contained in the materials. By downloading content from our website, you accept the terms of this agreement.


Presentation Transcript

guido@python.org Slide 2Copyright 2002 Zope Corporation. All rights reserved.•Stuff that’s already being phased out•string exceptions•sys.exc_type etc. (use sys.exc_info())•int/int returning int•apply() (use f(*args, **kwds))•coerce() (no longer needed)•3-way compare? (but... comparing lists) Slide 3Copyright 2002 Zope Corporation. All rights reserved.•continued lines or strings with \–use (...) continuation and/or string literal •if expression: statement–put statement on next line•tabs?–require all spaces–or very restricted use of tabs (not mixed) Slide 4Copyright 2002 Zope Corporation. All rights reserved.•I've never liked lambda–crippled (only one expression)–confusing (no argument list parentheses)–can use a local function instead•map(), filter()–using a Python function here is slow–list comprehensions do the same thing better•reduce()–nobody uses it, few understand it–a for loop is clearer & (usually) faster Slide 5Copyright 2002 Zope Corporation. All rights reserved.•drop `x` for repr(x)–` is hard to read in many fonts–publication process turns 's' into ‘s’•do we really need both str() and repr()?–mostly intended to be able to special-case–still not enough; need nice() that's a bybrid•print should've been a function–write(x, y, z)–writeln(x, y, z)–spaces between items controlled by keyword arg Slide 6Copyright 2002 Zope Corporation. All rights reserved.•intern(), id(): put in sys•xrange(): make range() return an iterator•buffer(): must die (use bytes, PEP 296)•raw_input(): use sys.stdin.readline()•input(): use eval(sys.stdin.readline())•callable(): just call it, already•execfile(), reload(): use exec()•compile(): put in sys Slide 7Copyright 2002 Zope Corporation. All rights reserved.•exec as a statement is not worth it–make it a function (again :-)•perhaps shouldn't have locals(), globals(), Slide 8Copyright 2002 Zope Corporation. All rights reserved.•Too many bugs to be trusted–didn't get enough review, and never will•Confusion btw. __builtins__, __builtin__•But there's a useful idea somewhere...–Zope uses this Slide 9Copyright 2002 Zope Corporation. All rights reserved.•need more ways to convert float to int •need differentiate to __int__ which truncates and __int__ which doesn't