Slide 2Copyright 2002 Zope Corporation All rights reserved ID: 413220
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.
guido@python.org Slide 2Copyright 2002 Zope Corporation. All rights reserved.Stuff thats already being phased outstring exceptionssys.exc_type etc. (use sys.exc_info())int/int returning intapply() (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: statementput statement on next linetabs?require all spacesor very restricted use of tabs (not mixed) Slide 4Copyright 2002 Zope Corporation. All rights reserved.I've never liked lambdacrippled (only one expression)confusing (no argument list parentheses)can use a local function insteadmap(), filter()using a Python function here is slowlist comprehensions do the same thing betterreduce()nobody uses it, few understand ita 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 fontspublication process turns 's' into sdo we really need both str() and repr()?mostly intended to be able to special-casestill not enough; need nice() that's a bybridprint should've been a functionwrite(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 sysxrange(): make range() return an iteratorbuffer(): must die (use bytes, PEP 296)raw_input(): use sys.stdin.readline()input(): use eval(sys.stdin.readline())callable(): just call it, alreadyexecfile(), reload(): use exec()compile(): put in sys Slide 7Copyright 2002 Zope Corporation. All rights reserved.exec as a statement is not worth itmake it a function (again :-)perhaps shouldn't have locals(), globals(), Slide 8Copyright 2002 Zope Corporation. All rights reserved.Too many bugs to be trusteddidn't get enough review, and never willConfusion 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