[Python-checkins] r43738 - in python/branches/stdlib-cleanup: Demo/classes/Complex.py Demo/classes/bitvec.py Demo/metaclasses/Eiffel.py Demo/metaclasses/Meta.py Demo/metaclasses/Simple.py Demo/metaclasses/Synch.py Demo/metaclasses/Trace.py Demo/p
Guido van Rossum
guido at python.org
Sun Apr 9 00:18:35 CEST 2006
I think this is a waste of time -- merging things piecemeal will just
cause endless churn.
On 4/8/06, georg.brandl <python-checkins at python.org> wrote:
> Author: georg.brandl
> Date: Sat Apr 8 22:42:09 2006
> New Revision: 43738
>
> Removed:
> python/branches/stdlib-cleanup/Lib/test/crashers/infinite_rec_4.py
> Modified:
> python/branches/stdlib-cleanup/Demo/classes/Complex.py
> python/branches/stdlib-cleanup/Demo/classes/bitvec.py
> python/branches/stdlib-cleanup/Demo/metaclasses/Eiffel.py
> python/branches/stdlib-cleanup/Demo/metaclasses/Meta.py
> python/branches/stdlib-cleanup/Demo/metaclasses/Simple.py
> python/branches/stdlib-cleanup/Demo/metaclasses/Synch.py
> python/branches/stdlib-cleanup/Demo/metaclasses/Trace.py
> python/branches/stdlib-cleanup/Demo/pdist/RCSProxy.py
> python/branches/stdlib-cleanup/Demo/pdist/client.py
> python/branches/stdlib-cleanup/Demo/pdist/cmptree.py
> python/branches/stdlib-cleanup/Demo/pdist/mac.py
> python/branches/stdlib-cleanup/Demo/pdist/rcvs.py
> python/branches/stdlib-cleanup/Demo/pdist/server.py
> python/branches/stdlib-cleanup/Demo/pdist/sumtree.py
> python/branches/stdlib-cleanup/Demo/scripts/unbirthday.py
> python/branches/stdlib-cleanup/Demo/sockets/ftp.py
> python/branches/stdlib-cleanup/Demo/sockets/gopher.py
> python/branches/stdlib-cleanup/Demo/threads/Coroutine.py
> python/branches/stdlib-cleanup/Demo/threads/Generator.py
> python/branches/stdlib-cleanup/Demo/threads/find.py
> python/branches/stdlib-cleanup/Demo/tix/tixwidgets.py
> python/branches/stdlib-cleanup/Demo/tkinter/guido/AttrDialog.py
> python/branches/stdlib-cleanup/Demo/tkinter/guido/ManPage.py
> python/branches/stdlib-cleanup/Demo/tkinter/guido/ShellWindow.py
> python/branches/stdlib-cleanup/Demo/tkinter/guido/kill.py
> python/branches/stdlib-cleanup/Demo/tkinter/guido/optionmenu.py
> python/branches/stdlib-cleanup/Demo/tkinter/guido/sortvisu.py
> python/branches/stdlib-cleanup/Demo/tkinter/guido/svkill.py
> python/branches/stdlib-cleanup/Demo/tkinter/guido/wish.py
> python/branches/stdlib-cleanup/Demo/tkinter/matt/window-creation-w-location.py
> python/branches/stdlib-cleanup/Doc/api/abstract.tex
> python/branches/stdlib-cleanup/Doc/api/exceptions.tex
> python/branches/stdlib-cleanup/Doc/api/intro.tex
> python/branches/stdlib-cleanup/Doc/ext/extending.tex
> python/branches/stdlib-cleanup/Doc/lib/libbz2.tex
> python/branches/stdlib-cleanup/Doc/lib/libcmd.tex
> python/branches/stdlib-cleanup/Doc/lib/libcode.tex
> python/branches/stdlib-cleanup/Doc/lib/libcrypt.tex
> python/branches/stdlib-cleanup/Doc/lib/libdis.tex
> python/branches/stdlib-cleanup/Doc/lib/libexcs.tex
> python/branches/stdlib-cleanup/Doc/lib/libfuncs.tex
> python/branches/stdlib-cleanup/Doc/lib/libsmtplib.tex
> python/branches/stdlib-cleanup/Doc/lib/libstdtypes.tex
> python/branches/stdlib-cleanup/Doc/lib/libsys.tex
> python/branches/stdlib-cleanup/Doc/lib/libtelnetlib.tex
> python/branches/stdlib-cleanup/Doc/lib/libtermios.tex
> python/branches/stdlib-cleanup/Doc/lib/libtraceback.tex
> python/branches/stdlib-cleanup/Doc/ref/ref7.tex
> python/branches/stdlib-cleanup/Doc/ref/ref8.tex
> python/branches/stdlib-cleanup/Doc/tools/keywords.py
> python/branches/stdlib-cleanup/Doc/tools/undoc_symbols.py
> python/branches/stdlib-cleanup/Doc/tut/tut.tex
> python/branches/stdlib-cleanup/Grammar/Grammar
> python/branches/stdlib-cleanup/Include/Python.h
> python/branches/stdlib-cleanup/Include/abstract.h
> python/branches/stdlib-cleanup/Include/code.h
> python/branches/stdlib-cleanup/Include/object.h
> python/branches/stdlib-cleanup/Include/opcode.h
> python/branches/stdlib-cleanup/Include/parsetok.h
> python/branches/stdlib-cleanup/Include/patchlevel.h
> python/branches/stdlib-cleanup/Include/pydebug.h
> python/branches/stdlib-cleanup/Include/pyerrors.h
> python/branches/stdlib-cleanup/Include/pythonrun.h
> python/branches/stdlib-cleanup/Lib/SimpleXMLRPCServer.py
> python/branches/stdlib-cleanup/Lib/bsddb/dbobj.py
> python/branches/stdlib-cleanup/Lib/bsddb/dbshelve.py
> python/branches/stdlib-cleanup/Lib/bsddb/test/test_basics.py
> python/branches/stdlib-cleanup/Lib/bsddb/test/test_dbobj.py
> python/branches/stdlib-cleanup/Lib/bsddb/test/test_join.py
> python/branches/stdlib-cleanup/Lib/cmd.py
> python/branches/stdlib-cleanup/Lib/code.py
> python/branches/stdlib-cleanup/Lib/compiler/pycodegen.py
> python/branches/stdlib-cleanup/Lib/compiler/transformer.py
> python/branches/stdlib-cleanup/Lib/copy_reg.py
> python/branches/stdlib-cleanup/Lib/decimal.py
> python/branches/stdlib-cleanup/Lib/distutils/archive_util.py
> python/branches/stdlib-cleanup/Lib/distutils/command/build_ext.py
> python/branches/stdlib-cleanup/Lib/distutils/command/build_py.py
> python/branches/stdlib-cleanup/Lib/distutils/command/register.py
> python/branches/stdlib-cleanup/Lib/distutils/dir_util.py
> python/branches/stdlib-cleanup/Lib/distutils/filelist.py
> python/branches/stdlib-cleanup/Lib/distutils/util.py
> python/branches/stdlib-cleanup/Lib/getpass.py
> python/branches/stdlib-cleanup/Lib/idlelib/MultiCall.py
> python/branches/stdlib-cleanup/Lib/idlelib/PyShell.py
> python/branches/stdlib-cleanup/Lib/idlelib/WindowList.py
> python/branches/stdlib-cleanup/Lib/lib-tk/Tkinter.py
> python/branches/stdlib-cleanup/Lib/logging/__init__.py
> python/branches/stdlib-cleanup/Lib/logging/config.py
> python/branches/stdlib-cleanup/Lib/opcode.py
> python/branches/stdlib-cleanup/Lib/pdb.py
> python/branches/stdlib-cleanup/Lib/plat-mac/aetools.py
> python/branches/stdlib-cleanup/Lib/plat-mac/gensuitemodule.py
> python/branches/stdlib-cleanup/Lib/pydoc.py
> python/branches/stdlib-cleanup/Lib/rexec.py
> python/branches/stdlib-cleanup/Lib/rlcompleter.py
> python/branches/stdlib-cleanup/Lib/site.py
> python/branches/stdlib-cleanup/Lib/stringold.py
> python/branches/stdlib-cleanup/Lib/subprocess.py
> python/branches/stdlib-cleanup/Lib/test/test_augassign.py
> python/branches/stdlib-cleanup/Lib/test/test_binop.py
> python/branches/stdlib-cleanup/Lib/test/test_builtin.py
> python/branches/stdlib-cleanup/Lib/test/test_bz2.py
> python/branches/stdlib-cleanup/Lib/test/test_class.py
> python/branches/stdlib-cleanup/Lib/test/test_coercion.py
> python/branches/stdlib-cleanup/Lib/test/test_complex.py
> python/branches/stdlib-cleanup/Lib/test/test_decimal.py
> python/branches/stdlib-cleanup/Lib/test/test_descr.py
> python/branches/stdlib-cleanup/Lib/test/test_doctest.py
> python/branches/stdlib-cleanup/Lib/test/test_exceptions.py
> python/branches/stdlib-cleanup/Lib/test/test_file.py
> python/branches/stdlib-cleanup/Lib/test/test_opcodes.py
> python/branches/stdlib-cleanup/Lib/test/test_operator.py
> python/branches/stdlib-cleanup/Lib/test/test_pep352.py
> python/branches/stdlib-cleanup/Lib/traceback.py
> python/branches/stdlib-cleanup/Lib/urllib.py
> python/branches/stdlib-cleanup/Lib/xmlcore/dom/__init__.py
> python/branches/stdlib-cleanup/Lib/xmlcore/sax/__init__.py
> python/branches/stdlib-cleanup/Lib/xmlcore/sax/saxutils.py
> python/branches/stdlib-cleanup/Lib/xmlcore/sax/xmlreader.py
> python/branches/stdlib-cleanup/Mac/Demo/resources/copyres.py
> python/branches/stdlib-cleanup/Mac/Demo/sound/morse.py
> python/branches/stdlib-cleanup/Mac/Demo/sound/morselib.py
> python/branches/stdlib-cleanup/Mac/Tools/IDE/ProfileBrowser.py
> python/branches/stdlib-cleanup/Mac/Tools/IDE/PyConsole.py
> python/branches/stdlib-cleanup/Mac/Tools/IDE/PyDebugger.py
> python/branches/stdlib-cleanup/Mac/Tools/IDE/PyEdit.py
> python/branches/stdlib-cleanup/Mac/Tools/IDE/Wapplication.py
> python/branches/stdlib-cleanup/Mac/Tools/IDE/Wbase.py
> python/branches/stdlib-cleanup/Mac/Tools/macfreeze/macgen_bin.py
> python/branches/stdlib-cleanup/Mac/scripts/buildpkg.py
> python/branches/stdlib-cleanup/Misc/NEWS
> python/branches/stdlib-cleanup/Misc/Vim/python.vim
> python/branches/stdlib-cleanup/Misc/cheatsheet
> python/branches/stdlib-cleanup/Misc/python-mode.el
> python/branches/stdlib-cleanup/Misc/python.man
> python/branches/stdlib-cleanup/Modules/_bsddb.c
> python/branches/stdlib-cleanup/Modules/_csv.c
> python/branches/stdlib-cleanup/Modules/_ctypes/_ctypes.c
> python/branches/stdlib-cleanup/Modules/_elementtree.c
> python/branches/stdlib-cleanup/Modules/_lsprof.c
> python/branches/stdlib-cleanup/Modules/_sre.c
> python/branches/stdlib-cleanup/Modules/_tkinter.c
> python/branches/stdlib-cleanup/Modules/bz2module.c
> python/branches/stdlib-cleanup/Modules/cstubs
> python/branches/stdlib-cleanup/Modules/datetimemodule.c
> python/branches/stdlib-cleanup/Modules/main.c
> python/branches/stdlib-cleanup/Modules/mathmodule.c
> python/branches/stdlib-cleanup/Modules/operator.c
> python/branches/stdlib-cleanup/Objects/abstract.c
> python/branches/stdlib-cleanup/Objects/boolobject.c
> python/branches/stdlib-cleanup/Objects/classobject.c
> python/branches/stdlib-cleanup/Objects/complexobject.c
> python/branches/stdlib-cleanup/Objects/fileobject.c
> python/branches/stdlib-cleanup/Objects/floatobject.c
> python/branches/stdlib-cleanup/Objects/intobject.c
> python/branches/stdlib-cleanup/Objects/longobject.c
> python/branches/stdlib-cleanup/Objects/setobject.c
> python/branches/stdlib-cleanup/Objects/stringobject.c
> python/branches/stdlib-cleanup/Objects/typeobject.c
> python/branches/stdlib-cleanup/Objects/unicodeobject.c
> python/branches/stdlib-cleanup/Objects/weakrefobject.c
> python/branches/stdlib-cleanup/PC/_subprocess.c
> python/branches/stdlib-cleanup/PC/_winreg.c
> python/branches/stdlib-cleanup/PCbuild/readme.txt
> python/branches/stdlib-cleanup/Parser/parser.c
> python/branches/stdlib-cleanup/Parser/parsetok.c
> python/branches/stdlib-cleanup/Python/bltinmodule.c
> python/branches/stdlib-cleanup/Python/ceval.c
> python/branches/stdlib-cleanup/Python/compile.c
> python/branches/stdlib-cleanup/Python/errors.c
> python/branches/stdlib-cleanup/Python/future.c
> python/branches/stdlib-cleanup/Python/getargs.c
> python/branches/stdlib-cleanup/Python/graminit.c
> python/branches/stdlib-cleanup/Python/import.c
> python/branches/stdlib-cleanup/Python/pythonrun.c
> python/branches/stdlib-cleanup/Python/sysmodule.c
> python/branches/stdlib-cleanup/README
> python/branches/stdlib-cleanup/RISCOS/Modules/riscosmodule.c
> python/branches/stdlib-cleanup/Tools/compiler/regrtest.py
> python/branches/stdlib-cleanup/Tools/faqwiz/faqw.py
> python/branches/stdlib-cleanup/Tools/freeze/freeze.py
> python/branches/stdlib-cleanup/Tools/pynche/pyColorChooser.py
> python/branches/stdlib-cleanup/Tools/scripts/ftpmirror.py
> python/branches/stdlib-cleanup/Tools/scripts/treesync.py
> python/branches/stdlib-cleanup/Tools/scripts/xxci.py
> python/branches/stdlib-cleanup/Tools/unicode/gencodec.py
> python/branches/stdlib-cleanup/Tools/webchecker/wcmac.py
> python/branches/stdlib-cleanup/Tools/webchecker/webchecker.py
> python/branches/stdlib-cleanup/configure
> python/branches/stdlib-cleanup/configure.in
> Log:
> Merge changes from python-3000 branch.
>
>
>
> Modified: python/branches/stdlib-cleanup/Demo/classes/Complex.py
> ==============================================================================
> --- python/branches/stdlib-cleanup/Demo/classes/Complex.py (original)
> +++ python/branches/stdlib-cleanup/Demo/classes/Complex.py Sat Apr 8 22:42:09 2006
> @@ -233,7 +233,7 @@
> try:
> result = eval(expr)
> except:
> - result = sys.exc_type
> + result = sys.exc_info()[0]
> print '->', result
> if isinstance(result, str) or isinstance(value, str):
> ok = (result == value)
>
> Modified: python/branches/stdlib-cleanup/Demo/classes/bitvec.py
> ==============================================================================
> --- python/branches/stdlib-cleanup/Demo/classes/bitvec.py (original)
> +++ python/branches/stdlib-cleanup/Demo/classes/bitvec.py Sat Apr 8 22:42:09 2006
> @@ -172,7 +172,7 @@
> def __cmp__(self, other, *rest):
> #rprt('%r.__cmp__%r\n' % (self, (other,) + rest))
> if type(other) != type(self):
> - other = apply(bitvec, (other, ) + rest)
> + other = bitvec(other, *rest)
> #expensive solution... recursive binary, with slicing
> length = self._len
> if length == 0 or other._len == 0:
> @@ -237,7 +237,7 @@
> #rprt('%s.__setslice__%r\n' % (self, (i, j, sequence) + rest))
> i, j = _check_slice(self._len, i, j)
> if type(sequence) != type(self):
> - sequence = apply(bitvec, (sequence, ) + rest)
> + sequence = bitvec(sequence, *rest)
> #sequence is now of our own type
> ls_part = self[:i]
> ms_part = self[j:]
> @@ -283,7 +283,7 @@
> def __and__(self, otherseq, *rest):
> #rprt('%r.__and__%r\n' % (self, (otherseq,) + rest))
> if type(otherseq) != type(self):
> - otherseq = apply(bitvec, (otherseq, ) + rest)
> + otherseq = bitvec(otherseq, *rest)
> #sequence is now of our own type
> return BitVec(self._data & otherseq._data, \
> min(self._len, otherseq._len))
> @@ -292,7 +292,7 @@
> def __xor__(self, otherseq, *rest):
> #rprt('%r.__xor__%r\n' % (self, (otherseq,) + rest))
> if type(otherseq) != type(self):
> - otherseq = apply(bitvec, (otherseq, ) + rest)
> + otherseq = bitvec(otherseq, *rest)
> #sequence is now of our own type
> return BitVec(self._data ^ otherseq._data, \
> max(self._len, otherseq._len))
> @@ -301,7 +301,7 @@
> def __or__(self, otherseq, *rest):
> #rprt('%r.__or__%r\n' % (self, (otherseq,) + rest))
> if type(otherseq) != type(self):
> - otherseq = apply(bitvec, (otherseq, ) + rest)
> + otherseq = bitvec(otherseq, *rest)
> #sequence is now of our own type
> return BitVec(self._data | otherseq._data, \
> max(self._len, otherseq._len))
> @@ -316,7 +316,7 @@
> #needed for *some* of the arithmetic operations
> #rprt('%r.__coerce__%r\n' % (self, (otherseq,) + rest))
> if type(otherseq) != type(self):
> - otherseq = apply(bitvec, (otherseq, ) + rest)
> + otherseq = bitvec(otherseq, *rest)
> return self, otherseq
>
> def __int__(self):
>
> Modified: python/branches/stdlib-cleanup/Demo/metaclasses/Eiffel.py
> ==============================================================================
> --- python/branches/stdlib-cleanup/Demo/metaclasses/Eiffel.py (original)
> +++ python/branches/stdlib-cleanup/Demo/metaclasses/Eiffel.py Sat Apr 8 22:42:09 2006
> @@ -82,10 +82,10 @@
>
> def __call__(self, *args, **kw):
> if self.pre:
> - apply(self.pre, args, kw)
> - Result = apply(self.func, (self.inst,) + args, kw)
> + self.pre(*args, **kw)
> + Result = self.func(self.inst, *args, **kw)
> if self.post:
> - apply(self.post, (Result,) + args, kw)
> + self.post(Result, *args, **kw)
> return Result
>
> class EiffelHelper(MetaHelper):
>
> Modified: python/branches/stdlib-cleanup/Demo/metaclasses/Meta.py
> ==============================================================================
> --- python/branches/stdlib-cleanup/Demo/metaclasses/Meta.py (original)
> +++ python/branches/stdlib-cleanup/Demo/metaclasses/Meta.py Sat Apr 8 22:42:09 2006
> @@ -14,7 +14,7 @@
> self.__name__ = self.func.__name__
>
> def __call__(self, *args, **kw):
> - return apply(self.func, (self.inst,) + args, kw)
> + return self.func(self.inst, *args, **kw)
>
> class MetaHelper:
>
> @@ -86,7 +86,7 @@
> init = inst.__getattr__('__init__')
> except AttributeError:
> init = lambda: None
> - apply(init, args, kw)
> + init(*args, **kw)
> return inst
>
>
>
> Modified: python/branches/stdlib-cleanup/Demo/metaclasses/Simple.py
> ==============================================================================
> --- python/branches/stdlib-cleanup/Demo/metaclasses/Simple.py (original)
> +++ python/branches/stdlib-cleanup/Demo/metaclasses/Simple.py Sat Apr 8 22:42:09 2006
> @@ -28,7 +28,7 @@
> self.instance = instance
> def __call__(self, *args):
> print "calling", self.function, "for", self.instance, "with", args
> - return apply(self.function, (self.instance,) + args)
> + return self.function(self.instance, *args)
>
> Trace = Tracing('Trace', (), {})
>
>
> Modified: python/branches/stdlib-cleanup/Demo/metaclasses/Synch.py
> ==============================================================================
> --- python/branches/stdlib-cleanup/Demo/metaclasses/Synch.py (original)
> +++ python/branches/stdlib-cleanup/Demo/metaclasses/Synch.py Sat Apr 8 22:42:09 2006
> @@ -148,10 +148,10 @@
> class LockingMethodWrapper(MetaMethodWrapper):
> def __call__(self, *args, **kw):
> if self.__name__[:1] == '_' and self.__name__[1:] != '_':
> - return apply(self.func, (self.inst,) + args, kw)
> + return self.func(self.inst, *args, **kw)
> self.inst.__lock__.acquire()
> try:
> - return apply(self.func, (self.inst,) + args, kw)
> + return self.func(self.inst, *args, **kw)
> finally:
> self.inst.__lock__.release()
>
>
> Modified: python/branches/stdlib-cleanup/Demo/metaclasses/Trace.py
> ==============================================================================
> --- python/branches/stdlib-cleanup/Demo/metaclasses/Trace.py (original)
> +++ python/branches/stdlib-cleanup/Demo/metaclasses/Trace.py Sat Apr 8 22:42:09 2006
> @@ -50,7 +50,7 @@
> init = inst.__getattr__('__init__')
> except AttributeError:
> init = lambda: None
> - apply(init, args, kw)
> + init(*args, **kw)
> return inst
>
> __trace_output__ = None
> @@ -85,7 +85,7 @@
> self.func = func
> self.inst = inst
> def __call__(self, *args, **kw):
> - return apply(self.func, (self.inst,) + args, kw)
> + return self.func(self.inst, *args, **kw)
>
> class TracingWrapper(NotTracingWrapper):
> def __call__(self, *args, **kw):
> @@ -93,7 +93,7 @@
> "calling %s, inst=%s, args=%s, kw=%s",
> self.__name__, self.inst, args, kw)
> try:
> - rv = apply(self.func, (self.inst,) + args, kw)
> + rv = self.func(self.inst, *args, **kw)
> except:
> t, v, tb = sys.exc_info()
> self.inst.__trace_call__(self.inst.__trace_output__,
>
> Modified: python/branches/stdlib-cleanup/Demo/pdist/RCSProxy.py
> ==============================================================================
> --- python/branches/stdlib-cleanup/Demo/pdist/RCSProxy.py (original)
> +++ python/branches/stdlib-cleanup/Demo/pdist/RCSProxy.py Sat Apr 8 22:42:09 2006
> @@ -186,7 +186,7 @@
> if hasattr(proxy, what):
> attr = getattr(proxy, what)
> if callable(attr):
> - print apply(attr, tuple(sys.argv[2:]))
> + print attr(*sys.argv[2:])
> else:
> print repr(attr)
> else:
>
> Modified: python/branches/stdlib-cleanup/Demo/pdist/client.py
> ==============================================================================
> --- python/branches/stdlib-cleanup/Demo/pdist/client.py (original)
> +++ python/branches/stdlib-cleanup/Demo/pdist/client.py Sat Apr 8 22:42:09 2006
> @@ -132,12 +132,11 @@
> class SecureClient(Client, Security):
>
> def __init__(self, *args):
> - import string
> - apply(self._pre_init, args)
> + self._pre_init(*args)
> Security.__init__(self)
> self._wf.flush()
> line = self._rf.readline()
> - challenge = string.atoi(string.strip(line))
> + challenge = int(line.strip())
> response = self._encode_challenge(challenge)
> line = repr(long(response))
> if line[-1] in 'Ll': line = line[:-1]
>
> Modified: python/branches/stdlib-cleanup/Demo/pdist/cmptree.py
> ==============================================================================
> --- python/branches/stdlib-cleanup/Demo/pdist/cmptree.py (original)
> +++ python/branches/stdlib-cleanup/Demo/pdist/cmptree.py Sat Apr 8 22:42:09 2006
> @@ -6,6 +6,11 @@
> import time
> import os
>
> +def raw_input(prompt):
> + sys.stdout.write(prompt)
> + sys.stdout.flush()
> + return sys.stdin.readline()
> +
> def main():
> pwd = os.getcwd()
> s = raw_input("chdir [%s] " % pwd)
>
> Modified: python/branches/stdlib-cleanup/Demo/pdist/mac.py
> ==============================================================================
> --- python/branches/stdlib-cleanup/Demo/pdist/mac.py (original)
> +++ python/branches/stdlib-cleanup/Demo/pdist/mac.py Sat Apr 8 22:42:09 2006
> @@ -1,14 +1,18 @@
> import sys
> -import string
> import rcvs
>
> +def raw_input(prompt):
> + sys.stdout.write(prompt)
> + sys.stdout.flush()
> + return sys.stdin.readline()
> +
> def main():
> while 1:
> try:
> line = raw_input('$ ')
> except EOFError:
> break
> - words = string.split(line)
> + words = line.split()
> if not words:
> continue
> if words[0] != 'rcvs':
> @@ -16,4 +20,5 @@
> sys.argv = words
> rcvs.main()
>
> -main()
> +if __name__ == '__main__':
> + main()
>
> Modified: python/branches/stdlib-cleanup/Demo/pdist/rcvs.py
> ==============================================================================
> --- python/branches/stdlib-cleanup/Demo/pdist/rcvs.py (original)
> +++ python/branches/stdlib-cleanup/Demo/pdist/rcvs.py Sat Apr 8 22:42:09 2006
> @@ -35,7 +35,6 @@
> from cvslib import CVS, File
> import md5
> import os
> -import string
> import sys
> from cmdfw import CommandFrameWork
>
> @@ -269,13 +268,13 @@
>
> def mailinfo(self, files, message = ""):
> towhom = "sjoerd at cwi.nl, jack at cwi.nl" # XXX
> - mailtext = MAILFORM % (towhom, string.join(files),
> - string.join(files), message)
> + mailtext = MAILFORM % (towhom, ' '.join(files),
> + ' '.join(files), message)
> print '-'*70
> print mailtext
> print '-'*70
> ok = raw_input("OK to mail to %s? " % towhom)
> - if string.lower(string.strip(ok)) in ('y', 'ye', 'yes'):
> + if ok.lower().strip() in ('y', 'ye', 'yes'):
> p = os.popen(SENDMAIL, "w")
> p.write(mailtext)
> sts = p.close()
>
> Modified: python/branches/stdlib-cleanup/Demo/pdist/server.py
> ==============================================================================
> --- python/branches/stdlib-cleanup/Demo/pdist/server.py (original)
> +++ python/branches/stdlib-cleanup/Demo/pdist/server.py Sat Apr 8 22:42:09 2006
> @@ -81,9 +81,9 @@
> raise NameError, "illegal method name %s" % repr(methodname)
> else:
> method = getattr(self, methodname)
> - reply = (None, apply(method, args), id)
> + reply = (None, method(*args), id)
> except:
> - reply = (sys.exc_type, sys.exc_value, id)
> + reply = (sys.exc_info()[:2], id)
> if id < 0 and reply[:2] == (None, None):
> if self._verbose > 1: print "Suppress reply"
> return 1
> @@ -117,7 +117,7 @@
> class SecureServer(Server, Security):
>
> def __init__(self, *args):
> - apply(Server.__init__, (self,) + args)
> + Server.__init__(self, *args)
> Security.__init__(self)
>
> def _verify(self, conn, address):
>
> Modified: python/branches/stdlib-cleanup/Demo/pdist/sumtree.py
> ==============================================================================
> --- python/branches/stdlib-cleanup/Demo/pdist/sumtree.py (original)
> +++ python/branches/stdlib-cleanup/Demo/pdist/sumtree.py Sat Apr 8 22:42:09 2006
> @@ -1,4 +1,5 @@
> import time
> +import sys
> import FSProxy
>
> def main():
> @@ -9,7 +10,9 @@
> proxy._close()
> t2 = time.time()
> print t2-t1, "seconds"
> - raw_input("[Return to exit] ")
> + sys.stdout.write("[Return to exit] ")
> + sys.stdout.flush()
> + sys.stdin.readline()
>
> def sumtree(proxy):
> print "PWD =", proxy.pwd()
>
> Modified: python/branches/stdlib-cleanup/Demo/scripts/unbirthday.py
> ==============================================================================
> --- python/branches/stdlib-cleanup/Demo/scripts/unbirthday.py (original)
> +++ python/branches/stdlib-cleanup/Demo/scripts/unbirthday.py Sat Apr 8 22:42:09 2006
> @@ -9,6 +9,11 @@
> import time
> import calendar
>
> +def raw_input(prompt):
> + sys.stdout.write(prompt)
> + sys.stdout.flush()
> + return sys.stdin.readline()
> +
> def main():
> # Note that the range checks below also check for bad types,
> # e.g. 3.14 or (). However syntactically invalid replies
>
> Modified: python/branches/stdlib-cleanup/Demo/sockets/ftp.py
> ==============================================================================
> --- python/branches/stdlib-cleanup/Demo/sockets/ftp.py (original)
> +++ python/branches/stdlib-cleanup/Demo/sockets/ftp.py Sat Apr 8 22:42:09 2006
> @@ -130,6 +130,11 @@
> sys.stdout.write(data)
> print '(end of data connection)'
>
> +def raw_input(prompt):
> + sys.stdout.write(prompt)
> + sys.stdout.flush()
> + return sys.stdin.readline()
> +
> # Get a command from the user.
> #
> def getcommand():
> @@ -143,4 +148,5 @@
>
> # Call the main program.
> #
> -main()
> +if __name__ == '__main__':
> + main()
>
> Modified: python/branches/stdlib-cleanup/Demo/sockets/gopher.py
> ==============================================================================
> --- python/branches/stdlib-cleanup/Demo/sockets/gopher.py (original)
> +++ python/branches/stdlib-cleanup/Demo/sockets/gopher.py Sat Apr 8 22:42:09 2006
> @@ -4,7 +4,6 @@
> #
> # Usage: gopher [ [selector] host [port] ]
>
> -import string
> import sys
> import os
> import socket
> @@ -42,7 +41,7 @@
> if not port:
> port = DEF_PORT
> elif type(port) == type(''):
> - port = string.atoi(port)
> + port = int(port)
> s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
> s.connect((host, port))
> return s
> @@ -73,7 +72,7 @@
> print '(Empty line from server)'
> continue
> typechar = line[0]
> - parts = string.splitfields(line[1:], TAB)
> + parts = line[1:].split(TAB)
> if len(parts) < 4:
> print '(Bad line from server: %r)' % (line,)
> continue
> @@ -160,7 +159,7 @@
> for i in range(len(list)):
> item = list[i]
> typechar, description = item[0], item[1]
> - print string.rjust(repr(i+1), 3) + ':', description,
> + print repr(i+1).rjust(3) + ':', description,
> if typename.has_key(typechar):
> print typename[typechar]
> else:
> @@ -175,8 +174,8 @@
> if not str:
> return
> try:
> - choice = string.atoi(str)
> - except string.atoi_error:
> + choice = int(str)
> + except ValueError:
> print 'Choice must be a number; try again:'
> continue
> if not 0 < choice <= len(list):
> @@ -191,7 +190,8 @@
> try:
> browserfunc(i_selector, i_host, i_port)
> except (IOError, socket.error):
> - print '***', sys.exc_type, ':', sys.exc_value
> + t, v, tb = sys.exc_info()
> + print '***', t, ':', v
> else:
> print 'Unsupported object type'
>
> @@ -217,6 +217,11 @@
> print 'IOError:', msg
> x.close()
>
> +def raw_input(prompt):
> + sys.stdout.write(prompt)
> + sys.stdout.flush()
> + return sys.stdin.readline()
> +
> # Browse a search index
> def browse_search(selector, host, port):
> while 1:
> @@ -229,7 +234,7 @@
> except EOFError:
> print
> break
> - query = string.strip(query)
> + query = query.strip()
> if not query:
> break
> if '\t' in query:
> @@ -299,11 +304,11 @@
> except EOFError:
> print
> return None
> - savefile = string.strip(savefile)
> + savefile = savefile.strip()
> if not savefile:
> return None
> if savefile[0] == '|':
> - cmd = string.strip(savefile[1:])
> + cmd = savefile[1:].strip()
> try:
> p = os.popen(cmd, 'w')
> except IOError, msg:
> @@ -330,10 +335,10 @@
> browser(sys.argv[1], sys.argv[2], sys.argv[3])
> elif sys.argv[2:]:
> try:
> - port = string.atoi(sys.argv[2])
> + port = int(sys.argv[2])
> selector = ''
> host = sys.argv[1]
> - except string.atoi_error:
> + except ValueError:
> selector = sys.argv[1]
> host = sys.argv[2]
> port = ''
>
> Modified: python/branches/stdlib-cleanup/Demo/threads/Coroutine.py
> ==============================================================================
> --- python/branches/stdlib-cleanup/Demo/threads/Coroutine.py (original)
> +++ python/branches/stdlib-cleanup/Demo/threads/Coroutine.py Sat Apr 8 22:42:09 2006
> @@ -115,7 +115,7 @@
> if not self.killed:
> try:
> try:
> - apply(me.f, args)
> + me.f(*args)
> except Killed:
> pass
> finally:
>
> Modified: python/branches/stdlib-cleanup/Demo/threads/Generator.py
> ==============================================================================
> --- python/branches/stdlib-cleanup/Demo/threads/Generator.py (original)
> +++ python/branches/stdlib-cleanup/Demo/threads/Generator.py Sat Apr 8 22:42:09 2006
> @@ -22,7 +22,7 @@
> self.putlock.acquire()
> if not self.killed:
> try:
> - apply(self.func, (self,) + self.args)
> + self.func(self, *self.args)
> except Killed:
> pass
> finally:
>
> Modified: python/branches/stdlib-cleanup/Demo/threads/find.py
> ==============================================================================
> --- python/branches/stdlib-cleanup/Demo/threads/find.py (original)
> +++ python/branches/stdlib-cleanup/Demo/threads/find.py Sat Apr 8 22:42:09 2006
> @@ -17,7 +17,6 @@
>
> import sys
> import getopt
> -import string
> import time
> import os
> from stat import *
> @@ -85,7 +84,7 @@
> if not job:
> break
> func, args = job
> - apply(func, args)
> + func(*args)
> self._donework()
>
> def run(self, nworkers):
> @@ -104,7 +103,7 @@
> opts, args = getopt.getopt(sys.argv[1:], '-w:')
> for opt, arg in opts:
> if opt == '-w':
> - nworkers = string.atoi(arg)
> + nworkers = int(arg)
> if not args:
> args = [os.curdir]
>
>
> Modified: python/branches/stdlib-cleanup/Demo/tix/tixwidgets.py
> ==============================================================================
> --- python/branches/stdlib-cleanup/Demo/tix/tixwidgets.py (original)
> +++ python/branches/stdlib-cleanup/Demo/tix/tixwidgets.py Sat Apr 8 22:42:09 2006
> @@ -71,8 +71,7 @@
> hm.add_checkbutton(label='BalloonHelp', underline=0, command=ToggleHelp,
> variable=self.useBalloons)
> # The trace variable option doesn't seem to work, instead I use 'command'
> - #apply(w.tk.call, ('trace', 'variable', self.useBalloons, 'w',
> - # ToggleHelp))
> + #w.tk.call('trace', 'variable', self.useBalloons, 'w', ToggleHelp))
>
> return w
>
>
> Modified: python/branches/stdlib-cleanup/Demo/tkinter/guido/AttrDialog.py
> ==============================================================================
> --- python/branches/stdlib-cleanup/Demo/tkinter/guido/AttrDialog.py (original)
> +++ python/branches/stdlib-cleanup/Demo/tkinter/guido/AttrDialog.py Sat Apr 8 22:42:09 2006
> @@ -155,8 +155,7 @@
> def set(self, e=None):
> self.current = self.var.get()
> try:
> - apply(self.dialog.widget.pack, (),
> - {self.option: self.current})
> + self.dialog.widget.pack(**{self.option: self.current})
> except TclError, msg:
> print msg
> self.refresh()
>
> Modified: python/branches/stdlib-cleanup/Demo/tkinter/guido/ManPage.py
> ==============================================================================
> --- python/branches/stdlib-cleanup/Demo/tkinter/guido/ManPage.py (original)
> +++ python/branches/stdlib-cleanup/Demo/tkinter/guido/ManPage.py Sat Apr 8 22:42:09 2006
> @@ -22,7 +22,7 @@
> # Initialize instance
> def __init__(self, master=None, **cnf):
> # Initialize base class
> - apply(ScrolledText.__init__, (self, master), cnf)
> + ScrolledText.__init__(self, master, **cnf)
>
> # Define tags for formatting styles
> self.tag_config('X', underline=1)
> @@ -178,7 +178,7 @@
> # Initialize instance
> def __init__(self, master=None, **cnf):
> cnf['state'] = DISABLED
> - apply(EditableManPage.__init__, (self, master), cnf)
> + EditableManPage.__init__(self, master, **cnf)
>
> # Alias
> ManPage = ReadonlyManPage
>
> Modified: python/branches/stdlib-cleanup/Demo/tkinter/guido/ShellWindow.py
> ==============================================================================
> --- python/branches/stdlib-cleanup/Demo/tkinter/guido/ShellWindow.py (original)
> +++ python/branches/stdlib-cleanup/Demo/tkinter/guido/ShellWindow.py Sat Apr 8 22:42:09 2006
> @@ -20,7 +20,7 @@
> args = string.split(shell)
> shell = args[0]
>
> - apply(ScrolledText.__init__, (self, master), cnf)
> + ScrolledText.__init__(self, master, **cnf)
> self.pos = '1.0'
> self.bind('<Return>', self.inputhandler)
> self.bind('<Control-c>', self.sigint)
>
> Modified: python/branches/stdlib-cleanup/Demo/tkinter/guido/kill.py
> ==============================================================================
> --- python/branches/stdlib-cleanup/Demo/tkinter/guido/kill.py (original)
> +++ python/branches/stdlib-cleanup/Demo/tkinter/guido/kill.py Sat Apr 8 22:42:09 2006
> @@ -9,7 +9,7 @@
>
> class BarButton(Menubutton):
> def __init__(self, master=None, **cnf):
> - apply(Menubutton.__init__, (self, master), cnf)
> + Menubutton.__init__(self, master, **cnf)
> self.pack(side=LEFT)
> self.menu = Menu(self, name='menu')
> self['menu'] = self.menu
>
> Modified: python/branches/stdlib-cleanup/Demo/tkinter/guido/optionmenu.py
> ==============================================================================
> --- python/branches/stdlib-cleanup/Demo/tkinter/guido/optionmenu.py (original)
> +++ python/branches/stdlib-cleanup/Demo/tkinter/guido/optionmenu.py Sat Apr 8 22:42:09 2006
> @@ -21,7 +21,7 @@
> var2 = StringVar()
> var2.set(CHOICES[0])
>
> -menu2 = apply(OptionMenu, (root, var2) + tuple(CHOICES))
> +menu2 = OptionMenu(root, var2, *CHOICES)
> menu2.pack()
>
> root.mainloop()
>
> Modified: python/branches/stdlib-cleanup/Demo/tkinter/guido/sortvisu.py
> ==============================================================================
> --- python/branches/stdlib-cleanup/Demo/tkinter/guido/sortvisu.py (original)
> +++ python/branches/stdlib-cleanup/Demo/tkinter/guido/sortvisu.py Sat Apr 8 22:42:09 2006
> @@ -523,8 +523,7 @@
> if self.size not in sizes:
> sizes.append(self.size)
> sizes.sort()
> - self.m_size = apply(OptionMenu,
> - (self.botleftframe, self.v_size) + tuple(sizes))
> + self.m_size = OptionMenu(self.botleftframe, self.v_size, *sizes)
> self.m_size.pack(fill=X)
>
> self.v_speed = StringVar(self.master)
>
> Modified: python/branches/stdlib-cleanup/Demo/tkinter/guido/svkill.py
> ==============================================================================
> --- python/branches/stdlib-cleanup/Demo/tkinter/guido/svkill.py (original)
> +++ python/branches/stdlib-cleanup/Demo/tkinter/guido/svkill.py Sat Apr 8 22:42:09 2006
> @@ -16,7 +16,7 @@
>
> class BarButton(Menubutton):
> def __init__(self, master=None, **cnf):
> - apply(Menubutton.__init__, (self, master), cnf)
> + Menubutton.__init__(self, master, **cnf)
> self.pack(side=LEFT)
> self.menu = Menu(self, name='menu')
> self['menu'] = self.menu
> @@ -61,7 +61,7 @@
> def do_1(self, e):
> self.kill(e.widget.get(e.widget.nearest(e.y)))
> def __init__(self, master=None, **cnf):
> - apply(Frame.__init__, (self, master), cnf)
> + Frame.__init__(self, master, **cnf)
> self.pack(expand=1, fill=BOTH)
> self.bar = Frame(self, name='bar', relief=RAISED,
> borderwidth=2)
>
> Modified: python/branches/stdlib-cleanup/Demo/tkinter/guido/wish.py
> ==============================================================================
> --- python/branches/stdlib-cleanup/Demo/tkinter/guido/wish.py (original)
> +++ python/branches/stdlib-cleanup/Demo/tkinter/guido/wish.py Sat Apr 8 22:42:09 2006
> @@ -2,6 +2,7 @@
>
> import _tkinter
> import os
> +import sys
>
> tk = _tkinter.create(os.environ['DISPLAY'], 'wish', 'Tk', 1)
> tk.call('update')
> @@ -12,7 +13,9 @@
> if cmd: prompt = ''
> else: prompt = '% '
> try:
> - line = raw_input(prompt)
> + sys.stdout.write(prompt)
> + sys.stdout.flush()
> + line = sys.stdin.readline()
> except EOFError:
> break
> cmd = cmd + (line + '\n')
>
> Modified: python/branches/stdlib-cleanup/Demo/tkinter/matt/window-creation-w-location.py
> ==============================================================================
> --- python/branches/stdlib-cleanup/Demo/tkinter/matt/window-creation-w-location.py (original)
> +++ python/branches/stdlib-cleanup/Demo/tkinter/matt/window-creation-w-location.py Sat Apr 8 22:42:09 2006
> @@ -13,7 +13,7 @@
> kwargs["text"] = "QUIT"
> if not kwargs.has_key("command"):
> kwargs["command"] = master.quit
> - apply(Button.__init__, (self, master) + args, kwargs)
> + Button.__init__(self, master, *args, **kwargs)
>
> class Test(Frame):
> def makeWindow(self, *args):
>
> Modified: python/branches/stdlib-cleanup/Doc/api/abstract.tex
> ==============================================================================
> --- python/branches/stdlib-cleanup/Doc/api/abstract.tex (original)
> +++ python/branches/stdlib-cleanup/Doc/api/abstract.tex Sat Apr 8 22:42:09 2006
> @@ -233,9 +233,7 @@
> be \NULL{}. \var{args} must not be \NULL{}, use an empty tuple if
> no arguments are needed. Returns the result of the call on success,
> or \NULL{} on failure. This is the equivalent of the Python
> - expression \samp{apply(\var{callable_object}, \var{args}, \var{kw})}
> - or \samp{\var{callable_object}(*\var{args}, **\var{kw})}.
> - \bifuncindex{apply}
> + expression \samp{\var{callable_object}(*\var{args}, **\var{kw})}.
> \versionadded{2.2}
> \end{cfuncdesc}
>
> @@ -246,9 +244,7 @@
> given by the tuple \var{args}. If no arguments are needed, then
> \var{args} may be \NULL. Returns the result of the call on
> success, or \NULL{} on failure. This is the equivalent of the
> - Python expression \samp{apply(\var{callable_object}, \var{args})} or
> - \samp{\var{callable_object}(*\var{args})}.
> - \bifuncindex{apply}
> + Python expression \samp{\var{callable_object}(*\var{args})}.
> \end{cfuncdesc}
>
> \begin{cfuncdesc}{PyObject*}{PyObject_CallFunction}{PyObject *callable,
> @@ -258,9 +254,7 @@
> \cfunction{Py_BuildValue()} style format string. The format may be
> \NULL, indicating that no arguments are provided. Returns the
> result of the call on success, or \NULL{} on failure. This is the
> - equivalent of the Python expression \samp{apply(\var{callable},
> - \var{args})} or \samp{\var{callable}(*\var{args})}.
> - \bifuncindex{apply}
> + equivalent of the Python expression \samp{\var{callable}(*\var{args})}.
> \end{cfuncdesc}
>
>
>
> Modified: python/branches/stdlib-cleanup/Doc/api/exceptions.tex
> ==============================================================================
> --- python/branches/stdlib-cleanup/Doc/api/exceptions.tex (original)
> +++ python/branches/stdlib-cleanup/Doc/api/exceptions.tex Sat Apr 8 22:42:09 2006
> @@ -23,12 +23,9 @@
> behave as intended and may fail in mysterious ways.
>
> The error indicator consists of three Python objects corresponding to
> -\withsubitem{(in module sys)}{
> - \ttindex{exc_type}\ttindex{exc_value}\ttindex{exc_traceback}}
> -the Python variables \code{sys.exc_type}, \code{sys.exc_value} and
> -\code{sys.exc_traceback}. API functions exist to interact with the
> -error indicator in various ways. There is a separate error indicator
> -for each thread.
> +the result of \code{sys.exc_info()}. API functions exist to interact
> +with the error indicator in various ways. There is a separate
> +error indicator for each thread.
>
> % XXX Order of these should be more thoughtful.
> % Either alphabetical or some kind of structure.
>
> Modified: python/branches/stdlib-cleanup/Doc/api/intro.tex
> ==============================================================================
> --- python/branches/stdlib-cleanup/Doc/api/intro.tex (original)
> +++ python/branches/stdlib-cleanup/Doc/api/intro.tex Sat Apr 8 22:42:09 2006
> @@ -400,15 +400,12 @@
> The full exception state consists of three objects (all of which can
> be \NULL): the exception type, the corresponding exception
> value, and the traceback. These have the same meanings as the Python
> -\withsubitem{(in module sys)}{
> - \ttindex{exc_type}\ttindex{exc_value}\ttindex{exc_traceback}}
> -objects \code{sys.exc_type}, \code{sys.exc_value}, and
> -\code{sys.exc_traceback}; however, they are not the same: the Python
> +result of \code{sys.exc_info()}; however, they are not the same: the Python
> objects represent the last exception being handled by a Python
> \keyword{try} \ldots\ \keyword{except} statement, while the C level
> exception state only exists while an exception is being passed on
> between C functions until it reaches the Python bytecode interpreter's
> -main loop, which takes care of transferring it to \code{sys.exc_type}
> +main loop, which takes care of transferring it to \code{sys.exc_info()}
> and friends.
>
> Note that starting with Python 1.5, the preferred, thread-safe way to
>
> Modified: python/branches/stdlib-cleanup/Doc/ext/extending.tex
> ==============================================================================
> --- python/branches/stdlib-cleanup/Doc/ext/extending.tex (original)
> +++ python/branches/stdlib-cleanup/Doc/ext/extending.tex Sat Apr 8 22:42:09 2006
> @@ -120,9 +120,8 @@
> variable stores the ``associated value'' of the exception (the second
> argument to \keyword{raise}). A third variable contains the stack
> traceback in case the error originated in Python code. These three
> -variables are the C equivalents of the Python variables
> -\code{sys.exc_type}, \code{sys.exc_value} and \code{sys.exc_traceback} (see
> -the section on module \module{sys} in the
> +variables are the C equivalents of the result in Python of
> +\method{sys.exc_info()} (see the section on module \module{sys} in the
> \citetitle[../lib/lib.html]{Python Library Reference}). It is
> important to know about them to understand how errors are passed
> around.
>
> Modified: python/branches/stdlib-cleanup/Doc/lib/libbz2.tex
> ==============================================================================
> --- python/branches/stdlib-cleanup/Doc/lib/libbz2.tex (original)
> +++ python/branches/stdlib-cleanup/Doc/lib/libbz2.tex Sat Apr 8 22:42:09 2006
> @@ -79,15 +79,6 @@
> is an approximate bound on the total number of bytes in the lines returned.
> \end{methoddesc}
>
> -\begin{methoddesc}[BZ2File]{xreadlines}{}
> -For backward compatibility. \class{BZ2File} objects now include the
> -performance optimizations previously implemented in the
> -\module{xreadlines} module.
> -\deprecated{2.3}{This exists only for compatibility with the method by
> - this name on \class{file} objects, which is
> - deprecated. Use \code{for line in file} instead.}
> -\end{methoddesc}
> -
> \begin{methoddesc}[BZ2File]{seek}{offset\optional{, whence}}
> Move to new file position. Argument \var{offset} is a byte count. Optional
> argument \var{whence} defaults to \code{0} (offset from start of file,
>
> Modified: python/branches/stdlib-cleanup/Doc/lib/libcmd.tex
> ==============================================================================
> --- python/branches/stdlib-cleanup/Doc/lib/libcmd.tex (original)
> +++ python/branches/stdlib-cleanup/Doc/lib/libcmd.tex Sat Apr 8 22:42:09 2006
> @@ -186,13 +186,3 @@
> headers. If empty, no ruler line is drawn. It defaults to
> \character{=}.
> \end{memberdesc}
> -
> -\begin{memberdesc}{use_rawinput}
> -A flag, defaulting to true. If true, \method{cmdloop()} uses
> -\function{raw_input()} to display a prompt and read the next command;
> -if false, \method{sys.stdout.write()} and
> -\method{sys.stdin.readline()} are used. (This means that by
> -importing \refmodule{readline}, on systems that support it, the
> -interpreter will automatically support \program{Emacs}-like line editing
> -and command-history keystrokes.)
> -\end{memberdesc}
>
> Modified: python/branches/stdlib-cleanup/Doc/lib/libcode.tex
> ==============================================================================
> --- python/branches/stdlib-cleanup/Doc/lib/libcode.tex (original)
> +++ python/branches/stdlib-cleanup/Doc/lib/libcode.tex Sat Apr 8 22:42:09 2006
> @@ -167,7 +167,7 @@
> \begin{methoddesc}{raw_input}{\optional{prompt}}
> Write a prompt and read a line. The returned line does not include
> the trailing newline. When the user enters the \EOF{} key sequence,
> -\exception{EOFError} is raised. The base implementation uses the
> -built-in function \function{raw_input()}; a subclass may replace this
> +\exception{EOFError} is raised. The base implementation reads from
> +\code{sys.stdin}; a subclass may replace this
> with a different implementation.
> \end{methoddesc}
>
> Modified: python/branches/stdlib-cleanup/Doc/lib/libcrypt.tex
> ==============================================================================
> --- python/branches/stdlib-cleanup/Doc/lib/libcrypt.tex (original)
> +++ python/branches/stdlib-cleanup/Doc/lib/libcrypt.tex Sat Apr 8 22:42:09 2006
> @@ -41,6 +41,12 @@
> \begin{verbatim}
> import crypt, getpass, pwd
>
> +def raw_input(prompt):
> + import sys
> + sys.stdout.write(prompt)
> + sys.stdout.flush()
> + return sys.stdin.readline()
> +
> def login():
> username = raw_input('Python login:')
> cryptedpasswd = pwd.getpwnam(username)[1]
>
> Modified: python/branches/stdlib-cleanup/Doc/lib/libdis.tex
> ==============================================================================
> --- python/branches/stdlib-cleanup/Doc/lib/libdis.tex (original)
> +++ python/branches/stdlib-cleanup/Doc/lib/libdis.tex Sat Apr 8 22:42:09 2006
> @@ -189,11 +189,6 @@
> Implements \code{TOS = TOS1 * TOS}.
> \end{opcodedesc}
>
> -\begin{opcodedesc}{BINARY_DIVIDE}{}
> -Implements \code{TOS = TOS1 / TOS} when
> -\code{from __future__ import division} is not in effect.
> -\end{opcodedesc}
> -
> \begin{opcodedesc}{BINARY_FLOOR_DIVIDE}{}
> Implements \code{TOS = TOS1 // TOS}.
> \end{opcodedesc}
> @@ -252,11 +247,6 @@
> Implements in-place \code{TOS = TOS1 * TOS}.
> \end{opcodedesc}
>
> -\begin{opcodedesc}{INPLACE_DIVIDE}{}
> -Implements in-place \code{TOS = TOS1 / TOS} when
> -\code{from __future__ import division} is not in effect.
> -\end{opcodedesc}
> -
> \begin{opcodedesc}{INPLACE_FLOOR_DIVIDE}{}
> Implements in-place \code{TOS = TOS1 // TOS}.
> \end{opcodedesc}
>
> Modified: python/branches/stdlib-cleanup/Doc/lib/libexcs.tex
> ==============================================================================
> --- python/branches/stdlib-cleanup/Doc/lib/libexcs.tex (original)
> +++ python/branches/stdlib-cleanup/Doc/lib/libexcs.tex Sat Apr 8 22:42:09 2006
> @@ -153,9 +153,7 @@
>
> \begin{excdesc}{EOFError}
> % XXXJH xrefs here
> - Raised when one of the built-in functions (\function{input()} or
> - \function{raw_input()}) hits an end-of-file condition (\EOF) without
> - reading any data.
> + Raised when attempting to read beyond the end of a file.
> % XXXJH xrefs here
> (N.B.: the \method{read()} and \method{readline()} methods of file
> objects return an empty string when they hit \EOF.)
> @@ -213,9 +211,6 @@
> \kbd{Control-C} or \kbd{Delete}). During execution, a check for
> interrupts is made regularly.
> % XXX(hylton) xrefs here
> - Interrupts typed when a built-in function \function{input()} or
> - \function{raw_input()} is waiting for input also raise this
> - exception.
> The exception inherits from \exception{BaseException} so as to not be
> accidentally caught by code that catches \exception{Exception} and thus
> prevent the interpreter from exiting.
>
> Modified: python/branches/stdlib-cleanup/Doc/lib/libfuncs.tex
> ==============================================================================
> --- python/branches/stdlib-cleanup/Doc/lib/libfuncs.tex (original)
> +++ python/branches/stdlib-cleanup/Doc/lib/libfuncs.tex Sat Apr 8 22:42:09 2006
> @@ -560,23 +560,6 @@
> note: this is the address of the object.)
> \end{funcdesc}
>
> -\begin{funcdesc}{input}{\optional{prompt}}
> - Equivalent to \code{eval(raw_input(\var{prompt}))}.
> - \warning{This function is not safe from user errors! It
> - expects a valid Python expression as input; if the input is not
> - syntactically valid, a \exception{SyntaxError} will be raised.
> - Other exceptions may be raised if there is an error during
> - evaluation. (On the other hand, sometimes this is exactly what you
> - need when writing a quick script for expert use.)}
> -
> - If the \refmodule{readline} module was loaded, then
> - \function{input()} will use it to provide elaborate line editing and
> - history features.
> -
> - Consider using the \function{raw_input()} function for general input
> - from users.
> -\end{funcdesc}
> -
> \begin{funcdesc}{int}{\optional{x\optional{, radix}}}
> Convert a string or number to a plain integer. If the argument is a
> string, it must contain a possibly signed decimal number
> @@ -823,24 +806,6 @@
> \end{verbatim}
> \end{funcdesc}
>
> -\begin{funcdesc}{raw_input}{\optional{prompt}}
> - If the \var{prompt} argument is present, it is written to standard output
> - without a trailing newline. The function then reads a line from input,
> - converts it to a string (stripping a trailing newline), and returns that.
> - When \EOF{} is read, \exception{EOFError} is raised. Example:
> -
> -\begin{verbatim}
> ->>> s = raw_input('--> ')
> ---> Monty Python's Flying Circus
> ->>> s
> -"Monty Python's Flying Circus"
> -\end{verbatim}
> -
> - If the \refmodule{readline} module was loaded, then
> - \function{raw_input()} will use it to provide elaborate
> - line editing and history features.
> -\end{funcdesc}
> -
> \begin{funcdesc}{reduce}{function, sequence\optional{, initializer}}
> Apply \var{function} of two arguments cumulatively to the items of
> \var{sequence}, from left to right, so as to reduce the sequence to
> @@ -1216,26 +1181,6 @@
>
> \setindexsubitem{(non-essential built-in functions)}
>
> -\begin{funcdesc}{apply}{function, args\optional{, keywords}}
> - The \var{function} argument must be a callable object (a
> - user-defined or built-in function or method, or a class object) and
> - the \var{args} argument must be a sequence. The \var{function} is
> - called with \var{args} as the argument list; the number of arguments
> - is the length of the tuple.
> - If the optional \var{keywords} argument is present, it must be a
> - dictionary whose keys are strings. It specifies keyword arguments
> - to be added to the end of the argument list.
> - Calling \function{apply()} is different from just calling
> - \code{\var{function}(\var{args})}, since in that case there is always
> - exactly one argument. The use of \function{apply()} is equivalent
> - to \code{\var{function}(*\var{args}, **\var{keywords})}.
> - Use of \function{apply()} is not necessary since the ``extended call
> - syntax,'' as used in the last example, is completely equivalent.
> -
> - \deprecated{2.3}{Use the extended call syntax instead, as described
> - above.}
> -\end{funcdesc}
> -
> \begin{funcdesc}{buffer}{object\optional{, offset\optional{, size}}}
> The \var{object} argument must be an object that supports the buffer
> call interface (such as strings, arrays, and buffers). A new buffer
>
> Modified: python/branches/stdlib-cleanup/Doc/lib/libsmtplib.tex
> ==============================================================================
> --- python/branches/stdlib-cleanup/Doc/lib/libsmtplib.tex (original)
> +++ python/branches/stdlib-cleanup/Doc/lib/libsmtplib.tex Sat Apr 8 22:42:09 2006
> @@ -267,6 +267,12 @@
> \begin{verbatim}
> import smtplib
>
> +def raw_input(prompt):
> + import sys
> + sys.stdout.write(prompt)
> + sys.stdout.flush()
> + return sys.stdin.readline()
> +
> def prompt(prompt):
> return raw_input(prompt).strip()
>
>
> Modified: python/branches/stdlib-cleanup/Doc/lib/libstdtypes.tex
> ==============================================================================
> --- python/branches/stdlib-cleanup/Doc/lib/libstdtypes.tex (original)
> +++ python/branches/stdlib-cleanup/Doc/lib/libstdtypes.tex Sat Apr 8 22:42:09 2006
> @@ -1622,12 +1622,6 @@
> implemented, or cannot be implemented efficiently.
> \end{methoddesc}
>
> -\begin{methoddesc}[file]{xreadlines}{}
> - This method returns the same thing as \code{iter(f)}.
> - \versionadded{2.1}
> - \deprecated{2.3}{Use \samp{for \var{line} in \var{file}} instead.}
> -\end{methoddesc}
> -
> \begin{methoddesc}[file]{seek}{offset\optional{, whence}}
> Set the file's current position, like \code{stdio}'s \cfunction{fseek()}.
> The \var{whence} argument is optional and defaults to \code{0}
>
> Modified: python/branches/stdlib-cleanup/Doc/lib/libsys.tex
> ==============================================================================
> --- python/branches/stdlib-cleanup/Doc/lib/libsys.tex (original)
> +++ python/branches/stdlib-cleanup/Doc/lib/libsys.tex Sat Apr 8 22:42:09 2006
> @@ -511,11 +511,8 @@
> \dataline{stderr}
> File objects corresponding to the interpreter's standard input,
> output and error streams. \code{stdin} is used for all interpreter
> - input except for scripts but including calls to
> - \function{input()}\bifuncindex{input} and
> - \function{raw_input()}\bifuncindex{raw_input}. \code{stdout} is
> - used for the output of \keyword{print} and expression statements and
> - for the prompts of \function{input()} and \function{raw_input()}.
> + input except for scripts. \code{stdout} is
> + used for the output of \keyword{print} and expression statements.
> The interpreter's own prompts and (almost all of) its error messages
> go to \code{stderr}. \code{stdout} and \code{stderr} needn't be
> built-in file objects: any object is acceptable as long as it has a
>
> Modified: python/branches/stdlib-cleanup/Doc/lib/libtelnetlib.tex
> ==============================================================================
> --- python/branches/stdlib-cleanup/Doc/lib/libtelnetlib.tex (original)
> +++ python/branches/stdlib-cleanup/Doc/lib/libtelnetlib.tex Sat Apr 8 22:42:09 2006
> @@ -196,6 +196,11 @@
> import sys
> import telnetlib
>
> +def raw_input(prompt):
> + sys.stdout.write(prompt)
> + sys.stdout.flush()
> + return sys.stdin.readline()
> +
> HOST = "localhost"
> user = raw_input("Enter your remote account: ")
> password = getpass.getpass()
>
> Modified: python/branches/stdlib-cleanup/Doc/lib/libtermios.tex
> ==============================================================================
> --- python/branches/stdlib-cleanup/Doc/lib/libtermios.tex (original)
> +++ python/branches/stdlib-cleanup/Doc/lib/libtermios.tex Sat Apr 8 22:42:09 2006
> @@ -91,6 +91,12 @@
> old tty attributes are restored exactly no matter what happens:
>
> \begin{verbatim}
> +def raw_input(prompt):
> + import sys
> + sys.stdout.write(prompt)
> + sys.stdout.flush()
> + return sys.stdin.readline()
> +
> def getpass(prompt = "Password: "):
> import termios, sys
> fd = sys.stdin.fileno()
>
> Modified: python/branches/stdlib-cleanup/Doc/lib/libtraceback.tex
> ==============================================================================
> --- python/branches/stdlib-cleanup/Doc/lib/libtraceback.tex (original)
> +++ python/branches/stdlib-cleanup/Doc/lib/libtraceback.tex Sat Apr 8 22:42:09 2006
> @@ -12,9 +12,8 @@
> ``wrapper'' around the interpreter.
>
> The module uses traceback objects --- this is the object type that is
> -stored in the variables \code{sys.exc_traceback} (deprecated) and
> -\code{sys.last_traceback} and returned as the third item from
> -\function{sys.exc_info()}.
> +stored in the \code{sys.last_traceback} variable and returned
> +as the third item from \function{sys.exc_info()}.
> \obindex{traceback}
>
> The module defines the following functions:
> @@ -41,11 +40,7 @@
> \end{funcdesc}
>
> \begin{funcdesc}{print_exc}{\optional{limit\optional{, file}}}
> -This is a shorthand for \code{print_exception(sys.exc_type,
> -sys.exc_value, sys.exc_traceback, \var{limit}, \var{file})}. (In
> -fact, it uses \function{sys.exc_info()} to retrieve the same
> -information in a thread-safe way instead of using the deprecated
> -variables.)
> +This is a shorthand for \code{print_exception(*\function{sys.exc_info()}}.
> \end{funcdesc}
>
> \begin{funcdesc}{format_exc}{\optional{limit}}
>
> Modified: python/branches/stdlib-cleanup/Doc/ref/ref7.tex
> ==============================================================================
> --- python/branches/stdlib-cleanup/Doc/ref/ref7.tex (original)
> +++ python/branches/stdlib-cleanup/Doc/ref/ref7.tex Sat Apr 8 22:42:09 2006
> @@ -251,21 +251,15 @@
> not handle the exception.)
>
> Before an except clause's suite is executed, details about the
> -exception are assigned to three variables in the
> -\module{sys}\refbimodindex{sys} module: \code{sys.exc_type} receives
> -the object identifying the exception; \code{sys.exc_value} receives
> -the exception's parameter; \code{sys.exc_traceback} receives a
> +exception are stored in the \module{sys}\refbimodindex{sys} module
> +and can be access via \function{sys.exc_info()}. \function{sys.exc_info()}
> +returns a 3-tuple consisting of: \code{exc_type} receives
> +the object identifying the exception; \code{exc_value} receives
> +the exception's parameter; \code{exc_traceback} receives a
> traceback object\obindex{traceback} (see section~\ref{traceback})
> identifying the point in the program where the exception occurred.
> -These details are also available through the \function{sys.exc_info()}
> -function, which returns a tuple \code{(\var{exc_type}, \var{exc_value},
> -\var{exc_traceback})}. Use of the corresponding variables is
> -deprecated in favor of this function, since their use is unsafe in a
> -threaded program. As of Python 1.5, the variables are restored to
> -their previous values (before the call) when returning from a function
> -that handled an exception.
> -\withsubitem{(in module sys)}{\ttindex{exc_type}
> - \ttindex{exc_value}\ttindex{exc_traceback}}
> +\function{sys.exc_info()} values are restored to their previous values
> +(before the call) when returning from a function that handled an exception.
>
> The optional \keyword{else} clause is executed if and when control
> flows off the end of the \keyword{try} clause.\footnote{
>
> Modified: python/branches/stdlib-cleanup/Doc/ref/ref8.tex
> ==============================================================================
> --- python/branches/stdlib-cleanup/Doc/ref/ref8.tex (original)
> +++ python/branches/stdlib-cleanup/Doc/ref/ref8.tex Sat Apr 8 22:42:09 2006
> @@ -103,10 +103,7 @@
> \end{productionlist}
>
> Note: to read `raw' input line without interpretation, you can use the
> -built-in function \function{raw_input()} or the \method{readline()} method
> -of file objects.
> +the \method{readline()} method of file objects, including \code{sys.stdin}.
> \obindex{file}
> \index{input!raw}
> -\index{raw input}
> -\bifuncindex{raw_input}
> \withsubitem{(file method)}{\ttindex{readline()}}
>
> Modified: python/branches/stdlib-cleanup/Doc/tools/keywords.py
> ==============================================================================
> --- python/branches/stdlib-cleanup/Doc/tools/keywords.py (original)
> +++ python/branches/stdlib-cleanup/Doc/tools/keywords.py Sat Apr 8 22:42:09 2006
> @@ -2,6 +2,12 @@
>
> # This Python program sorts and reformats the table of keywords in ref2.tex
>
> +def raw_input(prompt):
> + import sys
> + sys.stdout.write(prompt)
> + sys.stdout.flush()
> + return sys.stdin.readline()
> +
> l = []
> try:
> while 1:
>
> Modified: python/branches/stdlib-cleanup/Doc/tools/undoc_symbols.py
> ==============================================================================
> --- python/branches/stdlib-cleanup/Doc/tools/undoc_symbols.py (original)
> +++ python/branches/stdlib-cleanup/Doc/tools/undoc_symbols.py Sat Apr 8 22:42:09 2006
> @@ -50,7 +50,7 @@
>
> def findnames(file, prefixes=()):
> names = {}
> - for line in file.xreadlines():
> + for line in file:
> if line[0] == '!':
> continue
> fields = line.split()
>
> Modified: python/branches/stdlib-cleanup/Doc/tut/tut.tex
> ==============================================================================
> --- python/branches/stdlib-cleanup/Doc/tut/tut.tex (original)
> +++ python/branches/stdlib-cleanup/Doc/tut/tut.tex Sat Apr 8 22:42:09 2006
> @@ -231,7 +231,7 @@
>
> Note that there is a difference between \samp{python file} and
> \samp{python <file}. In the latter case, input requests from the
> -program, such as calls to \function{input()} and \function{raw_input()}, are
> +program, such as calling \code{sys.stdin.read()}, are
> satisfied from \emph{file}. Since this file has already been read
> until the end by the parser before the program starts executing, the
> program will encounter end-of-file immediately. In the former case
> @@ -1161,6 +1161,12 @@
> \keyword{if} statement. For example:
>
> \begin{verbatim}
> +>>> def raw_input(prompt):
> +... import sys
> +... sys.stdout.write(prompt)
> +... sys.stdout.flush()
> +... return sys.stdin.readline()
> +...
> >>> x = int(raw_input("Please enter an integer: "))
> >>> if x < 0:
> ... x = 0
> @@ -1453,6 +1459,12 @@
> arguments than it is defined to allow. For example:
>
> \begin{verbatim}
> +def raw_input(prompt):
> + import sys
> + sys.stdout.write(prompt)
> + sys.stdout.flush()
> + return sys.stdin.readline()
> +
> def ask_ok(prompt, retries=4, complaint='Yes or no, please!'):
> while True:
> ok = raw_input(prompt)
> @@ -2711,15 +2723,15 @@
> 'UnicodeEncodeError', 'UnicodeError', 'UnicodeTranslateError',
> 'UserWarning', 'ValueError', 'Warning', 'WindowsError',
> 'ZeroDivisionError', '_', '__debug__', '__doc__', '__import__',
> - '__name__', 'abs', 'apply', 'basestring', 'bool', 'buffer',
> + '__name__', 'abs', 'basestring', 'bool', 'buffer',
> 'callable', 'chr', 'classmethod', 'cmp', 'coerce', 'compile',
> 'complex', 'copyright', 'credits', 'delattr', 'dict', 'dir', 'divmod',
> 'enumerate', 'eval', 'execfile', 'exit', 'file', 'filter', 'float',
> 'frozenset', 'getattr', 'globals', 'hasattr', 'hash', 'help', 'hex',
> - 'id', 'input', 'int', 'intern', 'isinstance', 'issubclass', 'iter',
> + 'id', 'int', 'intern', 'isinstance', 'issubclass', 'iter',
> 'len', 'license', 'list', 'locals', 'long', 'map', 'max', 'min',
> 'object', 'oct', 'open', 'ord', 'pow', 'property', 'quit', 'range',
> - 'raw_input', 'reduce', 'reload', 'repr', 'reversed', 'round', 'set',
> + 'reduce', 'reload', 'repr', 'reversed', 'round', 'set',
> 'setattr', 'slice', 'sorted', 'staticmethod', 'str', 'sum', 'super',
> 'tuple', 'type', 'unichr', 'unicode', 'vars', 'xrange', 'zip']
> \end{verbatim}
> @@ -3412,6 +3424,12 @@
> raising the \exception{KeyboardInterrupt} exception.
>
> \begin{verbatim}
> +>>> def raw_input(prompt):
> +... import sys
> +... sys.stdout.write(prompt)
> +... sys.stdout.flush()
> +... return sys.stdin.readline()
> +...
> >>> while True:
> ... try:
> ... x = int(raw_input("Please enter a number: "))
> @@ -5013,7 +5031,12 @@
> placeholders such as the current date, image sequence number, or file format:
>
> \begin{verbatim}
> ->>> import time, os.path
> +>>> import time, os.path, sys
> +>>> def raw_input(prompt):
> +... sys.stdout.write(prompt)
> +... sys.stdout.flush()
> +... return sys.stdin.readline()
> +...
> >>> photofiles = ['img_1074.jpg', 'img_1076.jpg', 'img_1077.jpg']
> >>> class BatchRename(Template):
> ... delimiter = '%'
>
> Modified: python/branches/stdlib-cleanup/Grammar/Grammar
> ==============================================================================
> --- python/branches/stdlib-cleanup/Grammar/Grammar (original)
> +++ python/branches/stdlib-cleanup/Grammar/Grammar Sat Apr 8 22:42:09 2006
> @@ -7,18 +7,6 @@
> # with someone who can; ask around on python-dev for help. Fred
> # Drake <fdrake at acm.org> will probably be listening there.
>
> -# Commands for Kees Blom's railroad program
> -#diagram:token NAME
> -#diagram:token NUMBER
> -#diagram:token STRING
> -#diagram:token NEWLINE
> -#diagram:token ENDMARKER
> -#diagram:token INDENT
> -#diagram:output\input python.bla
> -#diagram:token DEDENT
> -#diagram:output\textwidth 20.04cm\oddsidemargin 0.0cm\evensidemargin 0.0cm
> -#diagram:rules
> -
> # Start symbols for the grammar:
> # single_input is a single interactive statement;
> # file_input is a module or sequence of commands read from an input file;
> @@ -61,8 +49,8 @@
> import_name: 'import' dotted_as_names
> import_from: ('from' ('.'* dotted_name | '.')
> 'import' ('*' | '(' import_as_names ')' | import_as_names))
> -import_as_name: NAME [('as' | NAME) NAME]
> -dotted_as_name: dotted_name [('as' | NAME) NAME]
> +import_as_name: NAME ['as' NAME]
> +dotted_as_name: dotted_name ['as' NAME]
> import_as_names: import_as_name (',' import_as_name)* [',']
> dotted_as_names: dotted_as_name (',' dotted_as_name)*
> dotted_name: NAME ('.' NAME)*
> @@ -80,7 +68,7 @@
> ['finally' ':' suite] |
> 'finally' ':' suite))
> with_stmt: 'with' test [ with_var ] ':' suite
> -with_var: ('as' | NAME) expr
> +with_var: 'as' expr
> # NB compile.c makes sure that the default except clause is last
> except_clause: 'except' [test [',' test]]
> suite: simple_stmt | NEWLINE INDENT stmt+ DEDENT
>
> Modified: python/branches/stdlib-cleanup/Include/Python.h
> ==============================================================================
> --- python/branches/stdlib-cleanup/Include/Python.h (original)
> +++ python/branches/stdlib-cleanup/Include/Python.h Sat Apr 8 22:42:09 2006
> @@ -131,13 +131,6 @@
> /* _Py_Mangle is defined in compile.c */
> PyAPI_FUNC(PyObject*) _Py_Mangle(PyObject *p, PyObject *name);
>
> -/* PyArg_GetInt is deprecated and should not be used, use PyArg_Parse(). */
> -#define PyArg_GetInt(v, a) PyArg_Parse((v), "i", (a))
> -
> -/* PyArg_NoArgs should not be necessary.
> - Set ml_flags in the PyMethodDef to METH_NOARGS. */
> -#define PyArg_NoArgs(v) PyArg_Parse(v, "")
> -
> /* Convert a possibly signed character to a nonnegative int */
> /* XXX This assumes characters are 8 bits wide */
> #ifdef __CHAR_UNSIGNED__
>
> Modified: python/branches/stdlib-cleanup/Include/abstract.h
> ==============================================================================
> --- python/branches/stdlib-cleanup/Include/abstract.h (original)
> +++ python/branches/stdlib-cleanup/Include/abstract.h Sat Apr 8 22:42:09 2006
> @@ -290,35 +290,30 @@
> object is callable and 0 otherwise.
>
> This function always succeeds.
> -
> */
>
> -
> -
> PyAPI_FUNC(PyObject *) PyObject_Call(PyObject *callable_object,
> - PyObject *args, PyObject *kw);
> + PyObject *args, PyObject *kw);
>
> /*
> Call a callable Python object, callable_object, with
> arguments and keywords arguments. The 'args' argument can not be
> NULL, but the 'kw' argument can be NULL.
> -
> */
>
> PyAPI_FUNC(PyObject *) PyObject_CallObject(PyObject *callable_object,
> - PyObject *args);
> + PyObject *args);
>
> /*
> Call a callable Python object, callable_object, with
> arguments given by the tuple, args. If no arguments are
> needed, then args may be NULL. Returns the result of the
> call on success, or NULL on failure. This is the equivalent
> - of the Python expression: apply(o,args).
> -
> + of the Python expression: o(*args).
> */
>
> PyAPI_FUNC(PyObject *) PyObject_CallFunction(PyObject *callable_object,
> - char *format, ...);
> + char *format, ...);
>
> /*
> Call a callable Python object, callable_object, with a
> @@ -326,13 +321,12 @@
> using a mkvalue-style format string. The format may be NULL,
> indicating that no arguments are provided. Returns the
> result of the call on success, or NULL on failure. This is
> - the equivalent of the Python expression: apply(o,args).
> -
> + the equivalent of the Python expression: o(*args).
> */
>
>
> - PyAPI_FUNC(PyObject *) PyObject_CallMethod(PyObject *o, char *m,
> - char *format, ...);
> + PyAPI_FUNC(PyObject *) PyObject_CallMethod(PyObject *o, char *method,
> + char *format, ...);
>
> /*
> Call the method named m of object o with a variable number of
> @@ -345,19 +339,19 @@
>
>
> PyAPI_FUNC(PyObject *) PyObject_CallFunctionObjArgs(PyObject *callable,
> - ...);
> + ...);
>
> /*
> Call a callable Python object, callable_object, with a
> variable number of C arguments. The C arguments are provided
> as PyObject * values, terminated by a NULL. Returns the
> result of the call on success, or NULL on failure. This is
> - the equivalent of the Python expression: apply(o,args).
> + the equivalent of the Python expression: o(*args).
> */
>
>
> PyAPI_FUNC(PyObject *) PyObject_CallMethodObjArgs(PyObject *o,
> - PyObject *m, ...);
> + PyObject *method, ...);
>
> /*
> Call the method named m of object o with a variable number of
> @@ -375,7 +369,6 @@
> Compute and return the hash, hash_value, of an object, o. On
> failure, return -1. This is the equivalent of the Python
> expression: hash(o).
> -
> */
>
>
> @@ -386,7 +379,6 @@
> Returns 1 if the object, o, is considered to be true, 0 if o is
> considered to be false and -1 on failure. This is equivalent to the
> Python expression: not not o
> -
> */
>
> /* Implemented elsewhere:
> @@ -396,7 +388,6 @@
> Returns 0 if the object, o, is considered to be true, 1 if o is
> considered to be false and -1 on failure. This is equivalent to the
> Python expression: not o
> -
> */
>
> PyAPI_FUNC(PyObject *) PyObject_Type(PyObject *o);
> @@ -414,7 +405,6 @@
> both sequence and mapping protocols, the sequence size is
> returned. On error, -1 is returned. This is the equivalent
> to the Python expression: len(o).
> -
> */
>
> /* For DLL compatibility */
> @@ -449,7 +439,6 @@
> Return element of o corresponding to the object, key, or NULL
> on failure. This is the equivalent of the Python expression:
> o[key].
> -
> */
>
> PyAPI_FUNC(int) PyObject_SetItem(PyObject *o, PyObject *key, PyObject *v);
> @@ -476,8 +465,8 @@
> */
>
> PyAPI_FUNC(int) PyObject_AsCharBuffer(PyObject *obj,
> - const char **buffer,
> - Py_ssize_t *buffer_len);
> + const char **buffer,
> + Py_ssize_t *buffer_len);
>
> /*
> Takes an arbitrary object which must support the (character,
> @@ -488,7 +477,6 @@
> 0 is returned on success. buffer and buffer_len are only
> set in case no error occurs. Otherwise, -1 is returned and
> an exception set.
> -
> */
>
> PyAPI_FUNC(int) PyObject_CheckReadBuffer(PyObject *obj);
> @@ -497,12 +485,11 @@
> Checks whether an arbitrary object supports the (character,
> single segment) buffer interface. Returns 1 on success, 0
> on failure.
> -
> */
>
> PyAPI_FUNC(int) PyObject_AsReadBuffer(PyObject *obj,
> - const void **buffer,
> - Py_ssize_t *buffer_len);
> + const void **buffer,
> + Py_ssize_t *buffer_len);
>
> /*
> Same as PyObject_AsCharBuffer() except that this API expects
> @@ -513,12 +500,11 @@
> 0 is returned on success. buffer and buffer_len are only
> set in case no error occurrs. Otherwise, -1 is returned and
> an exception set.
> -
> */
>
> PyAPI_FUNC(int) PyObject_AsWriteBuffer(PyObject *obj,
> - void **buffer,
> - Py_ssize_t *buffer_len);
> + void **buffer,
> + Py_ssize_t *buffer_len);
>
> /*
> Takes an arbitrary object which must support the (writeable,
> @@ -528,7 +514,6 @@
> 0 is returned on success. buffer and buffer_len are only
> set in case no error occurrs. Otherwise, -1 is returned and
> an exception set.
> -
> */
>
> /* Iterators */
> @@ -557,7 +542,6 @@
> false otherwise.
>
> This function always succeeds.
> -
> */
>
> PyAPI_FUNC(PyObject *) PyNumber_Add(PyObject *o1, PyObject *o2);
> @@ -565,8 +549,6 @@
> /*
> Returns the result of adding o1 and o2, or null on failure.
> This is the equivalent of the Python expression: o1+o2.
> -
> -
> */
>
> PyAPI_FUNC(PyObject *) PyNumber_Subtract(PyObject *o1, PyObject *o2);
> @@ -575,7 +557,6 @@
> Returns the result of subtracting o2 from o1, or null on
> failure. This is the equivalent of the Python expression:
> o1-o2.
> -
> */
>
> PyAPI_FUNC(PyObject *) PyNumber_Multiply(PyObject *o1, PyObject *o2);
> @@ -584,8 +565,6 @@
> Returns the result of multiplying o1 and o2, or null on
> failure. This is the equivalent of the Python expression:
> o1*o2.
> -
> -
> */
>
> PyAPI_FUNC(PyObject *) PyNumber_Divide(PyObject *o1, PyObject *o2);
> @@ -593,8 +572,6 @@
> /*
> Returns the result of dividing o1 by o2, or null on failure.
> This is the equivalent of the Python expression: o1/o2.
> -
> -
> */
>
> PyAPI_FUNC(PyObject *) PyNumber_FloorDivide(PyObject *o1, PyObject *o2);
> @@ -603,8 +580,6 @@
> Returns the result of dividing o1 by o2 giving an integral result,
> or null on failure.
> This is the equivalent of the Python expression: o1//o2.
> -
> -
> */
>
> PyAPI_FUNC(PyObject *) PyNumber_TrueDivide(PyObject *o1, PyObject *o2);
> @@ -613,8 +588,6 @@
> Returns the result of dividing o1 by o2 giving a float result,
> or null on failure.
> This is the equivalent of the Python expression: o1/o2.
> -
> -
> */
>
> PyAPI_FUNC(PyObject *) PyNumber_Remainder(PyObject *o1, PyObject *o2);
> @@ -623,8 +596,6 @@
> Returns the remainder of dividing o1 by o2, or null on
> failure. This is the equivalent of the Python expression:
> o1%o2.
> -
> -
> */
>
> PyAPI_FUNC(PyObject *) PyNumber_Divmod(PyObject *o1, PyObject *o2);
> @@ -633,18 +604,15 @@
> See the built-in function divmod. Returns NULL on failure.
> This is the equivalent of the Python expression:
> divmod(o1,o2).
> -
> -
> */
>
> PyAPI_FUNC(PyObject *) PyNumber_Power(PyObject *o1, PyObject *o2,
> - PyObject *o3);
> + PyObject *o3);
>
> /*
> See the built-in function pow. Returns NULL on failure.
> This is the equivalent of the Python expression:
> pow(o1,o2,o3), where o3 is optional.
> -
> */
>
> PyAPI_FUNC(PyObject *) PyNumber_Negative(PyObject *o);
> @@ -652,7 +620,6 @@
> /*
> Returns the negation of o on success, or null on failure.
> This is the equivalent of the Python expression: -o.
> -
> */
>
> PyAPI_FUNC(PyObject *) PyNumber_Positive(PyObject *o);
> @@ -660,7 +627,6 @@
> /*
> Returns the (what?) of o on success, or NULL on failure.
> This is the equivalent of the Python expression: +o.
> -
> */
>
> PyAPI_FUNC(PyObject *) PyNumber_Absolute(PyObject *o);
> @@ -668,7 +634,6 @@
> /*
> Returns the absolute value of o, or null on failure. This is
> the equivalent of the Python expression: abs(o).
> -
> */
>
> PyAPI_FUNC(PyObject *) PyNumber_Invert(PyObject *o);
> @@ -677,8 +642,6 @@
> Returns the bitwise negation of o on success, or NULL on
> failure. This is the equivalent of the Python expression:
> ~o.
> -
> -
> */
>
> PyAPI_FUNC(PyObject *) PyNumber_Lshift(PyObject *o1, PyObject *o2);
> @@ -687,8 +650,6 @@
> Returns the result of left shifting o1 by o2 on success, or
> NULL on failure. This is the equivalent of the Python
> expression: o1 << o2.
> -
> -
> */
>
> PyAPI_FUNC(PyObject *) PyNumber_Rshift(PyObject *o1, PyObject *o2);
> @@ -697,7 +658,6 @@
> Returns the result of right shifting o1 by o2 on success, or
> NULL on failure. This is the equivalent of the Python
> expression: o1 >> o2.
> -
> */
>
> PyAPI_FUNC(PyObject *) PyNumber_And(PyObject *o1, PyObject *o2);
> @@ -707,7 +667,6 @@
> NULL on failure. This is the equivalent of the Python
> expression: o1&o2.
>
> -
> */
>
> PyAPI_FUNC(PyObject *) PyNumber_Xor(PyObject *o1, PyObject *o2);
> @@ -716,8 +675,6 @@
> Returns the bitwise exclusive or of o1 by o2 on success, or
> NULL on failure. This is the equivalent of the Python
> expression: o1^o2.
> -
> -
> */
>
> PyAPI_FUNC(PyObject *) PyNumber_Or(PyObject *o1, PyObject *o2);
> @@ -726,7 +683,6 @@
> Returns the result of bitwise or on o1 and o2 on success, or
> NULL on failure. This is the equivalent of the Python
> expression: o1|o2.
> -
> */
>
> /* Implemented elsewhere:
> @@ -745,7 +701,6 @@
> return -1 (failure) and don't increment the reference counts.
> The call PyNumber_Coerce(&o1, &o2) is equivalent to the Python
> statement o1, o2 = coerce(o1, o2).
> -
> */
>
> PyAPI_FUNC(Py_ssize_t) PyNumber_Index(PyObject *);
> @@ -762,7 +717,6 @@
> Returns the o converted to an integer object on success, or
> NULL on failure. This is the equivalent of the Python
> expression: int(o).
> -
> */
>
> PyAPI_FUNC(PyObject *) PyNumber_Long(PyObject *o);
> @@ -771,7 +725,6 @@
> Returns the o converted to a long integer object on success,
> or NULL on failure. This is the equivalent of the Python
> expression: long(o).
> -
> */
>
> PyAPI_FUNC(PyObject *) PyNumber_Float(PyObject *o);
> @@ -790,7 +743,6 @@
> Returns the result of adding o2 to o1, possibly in-place, or null
> on failure. This is the equivalent of the Python expression:
> o1 += o2.
> -
> */
>
> PyAPI_FUNC(PyObject *) PyNumber_InPlaceSubtract(PyObject *o1, PyObject *o2);
> @@ -799,7 +751,6 @@
> Returns the result of subtracting o2 from o1, possibly in-place or
> null on failure. This is the equivalent of the Python expression:
> o1 -= o2.
> -
> */
>
> PyAPI_FUNC(PyObject *) PyNumber_InPlaceMultiply(PyObject *o1, PyObject *o2);
> @@ -808,7 +759,6 @@
> Returns the result of multiplying o1 by o2, possibly in-place, or
> null on failure. This is the equivalent of the Python expression:
> o1 *= o2.
> -
> */
>
> PyAPI_FUNC(PyObject *) PyNumber_InPlaceDivide(PyObject *o1, PyObject *o2);
> @@ -817,29 +767,26 @@
> Returns the result of dividing o1 by o2, possibly in-place, or null
> on failure. This is the equivalent of the Python expression:
> o1 /= o2.
> -
> */
>
> PyAPI_FUNC(PyObject *) PyNumber_InPlaceFloorDivide(PyObject *o1,
> - PyObject *o2);
> + PyObject *o2);
>
> /*
> Returns the result of dividing o1 by o2 giving an integral result,
> possibly in-place, or null on failure.
> This is the equivalent of the Python expression:
> o1 /= o2.
> -
> */
>
> PyAPI_FUNC(PyObject *) PyNumber_InPlaceTrueDivide(PyObject *o1,
> - PyObject *o2);
> + PyObject *o2);
>
> /*
> Returns the result of dividing o1 by o2 giving a float result,
> possibly in-place, or null on failure.
> This is the equivalent of the Python expression:
> o1 /= o2.
> -
> */
>
> PyAPI_FUNC(PyObject *) PyNumber_InPlaceRemainder(PyObject *o1, PyObject *o2);
> @@ -848,17 +795,15 @@
> Returns the remainder of dividing o1 by o2, possibly in-place, or
> null on failure. This is the equivalent of the Python expression:
> o1 %= o2.
> -
> */
>
> PyAPI_FUNC(PyObject *) PyNumber_InPlacePower(PyObject *o1, PyObject *o2,
> - PyObject *o3);
> + PyObject *o3);
>
> /*
> Returns the result of raising o1 to the power of o2, possibly
> in-place, or null on failure. This is the equivalent of the Python
> expression: o1 **= o2, or pow(o1, o2, o3) if o3 is present.
> -
> */
>
> PyAPI_FUNC(PyObject *) PyNumber_InPlaceLshift(PyObject *o1, PyObject *o2);
> @@ -867,7 +812,6 @@
> Returns the result of left shifting o1 by o2, possibly in-place, or
> null on failure. This is the equivalent of the Python expression:
> o1 <<= o2.
> -
> */
>
> PyAPI_FUNC(PyObject *) PyNumber_InPlaceRshift(PyObject *o1, PyObject *o2);
> @@ -876,7 +820,6 @@
> Returns the result of right shifting o1 by o2, possibly in-place or
> null on failure. This is the equivalent of the Python expression:
> o1 >>= o2.
> -
> */
>
> PyAPI_FUNC(PyObject *) PyNumber_InPlaceAnd(PyObject *o1, PyObject *o2);
> @@ -885,7 +828,6 @@
> Returns the result of bitwise and of o1 and o2, possibly in-place,
> or null on failure. This is the equivalent of the Python
> expression: o1 &= o2.
> -
> */
>
> PyAPI_FUNC(PyObject *) PyNumber_InPlaceXor(PyObject *o1, PyObject *o2);
> @@ -894,7 +836,6 @@
> Returns the bitwise exclusive or of o1 by o2, possibly in-place, or
> null on failure. This is the equivalent of the Python expression:
> o1 ^= o2.
> -
> */
>
> PyAPI_FUNC(PyObject *) PyNumber_InPlaceOr(PyObject *o1, PyObject *o2);
> @@ -903,7 +844,6 @@
> Returns the result of bitwise or of o1 and o2, possibly in-place,
> or null on failure. This is the equivalent of the Python
> expression: o1 |= o2.
> -
> */
>
>
> @@ -916,14 +856,12 @@
> otherwise.
>
> This function always succeeds.
> -
> */
>
> PyAPI_FUNC(Py_ssize_t) PySequence_Size(PyObject *o);
>
> /*
> Return the size of sequence object o, or -1 on failure.
> -
> */
>
> /* For DLL compatibility */
> @@ -938,7 +876,6 @@
> Return the concatenation of o1 and o2 on success, and NULL on
> failure. This is the equivalent of the Python
> expression: o1+o2.
> -
> */
>
> PyAPI_FUNC(PyObject *) PySequence_Repeat(PyObject *o, Py_ssize_t count);
> @@ -947,7 +884,6 @@
> Return the result of repeating sequence object o count times,
> or NULL on failure. This is the equivalent of the Python
> expression: o1*count.
> -
> */
>
> PyAPI_FUNC(PyObject *) PySequence_GetItem(PyObject *o, Py_ssize_t i);
> @@ -963,7 +899,6 @@
> Return the slice of sequence object o between i1 and i2, or
> NULL on failure. This is the equivalent of the Python
> expression: o[i1:i2].
> -
> */
>
> PyAPI_FUNC(int) PySequence_SetItem(PyObject *o, Py_ssize_t i, PyObject *v);
> @@ -972,7 +907,6 @@
> Assign object v to the ith element of o. Returns
> -1 on failure. This is the equivalent of the Python
> statement: o[i]=v.
> -
> */
>
> PyAPI_FUNC(int) PySequence_DelItem(PyObject *o, Py_ssize_t i);
> @@ -984,7 +918,7 @@
> */
>
> PyAPI_FUNC(int) PySequence_SetSlice(PyObject *o, Py_ssize_t i1, Py_ssize_t i2,
> - PyObject *v);
> + PyObject *v);
>
> /*
> Assign the sequence object, v, to the slice in sequence
>
> Modified: python/branches/stdlib-cleanup/Include/code.h
> ==============================================================================
> --- python/branches/stdlib-cleanup/Include/code.h (original)
> +++ python/branches/stdlib-cleanup/Include/code.h Sat Apr 8 22:42:09 2006
> @@ -41,17 +41,17 @@
> #define CO_NOFREE 0x0040
>
> #if 0
> -/* This is no longer used. Stopped defining in 2.5, do not re-use. */
> +/* These are no longer used. */
> #define CO_GENERATOR_ALLOWED 0x1000
> -#endif
> #define CO_FUTURE_DIVISION 0x2000
> #define CO_FUTURE_ABSOLUTE_IMPORT 0x4000 /* do absolute imports by default */
> #define CO_FUTURE_WITH_STATEMENT 0x8000
> +#endif
>
> /* This should be defined if a future statement modifies the syntax.
> For example, when a keyword is added.
> */
> -#define PY_PARSER_REQUIRES_FUTURE_KEYWORD
> +/* #define PY_PARSER_REQUIRES_FUTURE_KEYWORD */
>
> #define CO_MAXBLOCKS 20 /* Max static block nesting within a function */
>
>
> Modified: python/branches/stdlib-cleanup/Include/object.h
> ==============================================================================
> --- python/branches/stdlib-cleanup/Include/object.h (original)
> +++ python/branches/stdlib-cleanup/Include/object.h Sat Apr 8 22:42:09 2006
> @@ -130,21 +130,12 @@
> typedef int (*inquiry)(PyObject *);
> typedef Py_ssize_t (*lenfunc)(PyObject *);
> typedef int (*coercion)(PyObject **, PyObject **);
> -typedef PyObject *(*intargfunc)(PyObject *, int) Py_DEPRECATED(2.5);
> -typedef PyObject *(*intintargfunc)(PyObject *, int, int) Py_DEPRECATED(2.5);
> typedef PyObject *(*ssizeargfunc)(PyObject *, Py_ssize_t);
> typedef PyObject *(*ssizessizeargfunc)(PyObject *, Py_ssize_t, Py_ssize_t);
> -typedef int(*intobjargproc)(PyObject *, int, PyObject *);
> -typedef int(*intintobjargproc)(PyObject *, int, int, PyObject *);
> typedef int(*ssizeobjargproc)(PyObject *, Py_ssize_t, PyObject *);
> typedef int(*ssizessizeobjargproc)(PyObject *, Py_ssize_t, Py_ssize_t, PyObject *);
> typedef int(*objobjargproc)(PyObject *, PyObject *, PyObject *);
>
> -/* int-based buffer interface */
> -typedef int (*getreadbufferproc)(PyObject *, int, void **);
> -typedef int (*getwritebufferproc)(PyObject *, int, void **);
> -typedef int (*getsegcountproc)(PyObject *, int *);
> -typedef int (*getcharbufferproc)(PyObject *, int, char **);
> /* ssize_t-based buffer interface */
> typedef Py_ssize_t (*readbufferproc)(PyObject *, Py_ssize_t, void **);
> typedef Py_ssize_t (*writebufferproc)(PyObject *, Py_ssize_t, void **);
> @@ -167,7 +158,6 @@
> binaryfunc nb_add;
> binaryfunc nb_subtract;
> binaryfunc nb_multiply;
> - binaryfunc nb_divide;
> binaryfunc nb_remainder;
> binaryfunc nb_divmod;
> ternaryfunc nb_power;
> @@ -191,7 +181,6 @@
> binaryfunc nb_inplace_add;
> binaryfunc nb_inplace_subtract;
> binaryfunc nb_inplace_multiply;
> - binaryfunc nb_inplace_divide;
> binaryfunc nb_inplace_remainder;
> ternaryfunc nb_inplace_power;
> binaryfunc nb_inplace_lshift;
> @@ -201,7 +190,6 @@
> binaryfunc nb_inplace_or;
>
> /* Added in release 2.2 */
> - /* The following require the Py_TPFLAGS_HAVE_CLASS flag */
> binaryfunc nb_floor_divide;
> binaryfunc nb_true_divide;
> binaryfunc nb_inplace_floor_divide;
> @@ -694,21 +682,6 @@
> */
> PyAPI_DATA(int) _Py_SwappedOp[];
>
> -/*
> -Define staticforward and statichere for source compatibility with old
> -C extensions.
> -
> -The staticforward define was needed to support certain broken C
> -compilers (notably SCO ODT 3.0, perhaps early AIX as well) botched the
> -static keyword when it was used with a forward declaration of a static
> -initialized structure. Standard C allows the forward declaration with
> -static, and we've decided to stop catering to broken C compilers.
> -(In fact, we expect that the compilers are all fixed eight years later.)
> -*/
> -
> -#define staticforward static
> -#define statichere static
> -
>
> /*
> More conventions
>
> Modified: python/branches/stdlib-cleanup/Include/opcode.h
> ==============================================================================
> --- python/branches/stdlib-cleanup/Include/opcode.h (original)
> +++ python/branches/stdlib-cleanup/Include/opcode.h Sat Apr 8 22:42:09 2006
> @@ -26,7 +26,7 @@
> #define BINARY_POWER 19
>
> #define BINARY_MULTIPLY 20
> -#define BINARY_DIVIDE 21
> +
> #define BINARY_MODULO 22
> #define BINARY_ADD 23
> #define BINARY_SUBTRACT 24
> @@ -48,7 +48,7 @@
> #define INPLACE_ADD 55
> #define INPLACE_SUBTRACT 56
> #define INPLACE_MULTIPLY 57
> -#define INPLACE_DIVIDE 58
> +
> #define INPLACE_MODULO 59
> #define STORE_SUBSCR 60
> #define DELETE_SUBSCR 61
>
> Modified: python/branches/stdlib-cleanup/Include/parsetok.h
> ==============================================================================
> --- python/branches/stdlib-cleanup/Include/parsetok.h (original)
> +++ python/branches/stdlib-cleanup/Include/parsetok.h Sat Apr 8 22:42:09 2006
> @@ -23,7 +23,9 @@
>
> #define PyPARSE_DONT_IMPLY_DEDENT 0x0002
>
> +#if 0
> #define PyPARSE_WITH_IS_KEYWORD 0x0003
> +#endif
>
> PyAPI_FUNC(node *) PyParser_ParseString(const char *, grammar *, int,
> perrdetail *);
>
> Modified: python/branches/stdlib-cleanup/Include/patchlevel.h
> ==============================================================================
> --- python/branches/stdlib-cleanup/Include/patchlevel.h (original)
> +++ python/branches/stdlib-cleanup/Include/patchlevel.h Sat Apr 8 22:42:09 2006
> @@ -1,9 +1,5 @@
>
> -/* Newfangled version identification scheme.
> -
> - This scheme was added in Python 1.5.2b2; before that time, only PATCHLEVEL
> - was available. To test for presence of the scheme, test for
> - defined(PY_MAJOR_VERSION).
> +/* Python version identification scheme.
>
> When the major or minor version changes, the VERSION variable in
> configure.in must also be changed.
> @@ -19,14 +15,14 @@
> /* Higher for patch releases */
>
> /* Version parsed out into numeric values */
> -#define PY_MAJOR_VERSION 2
> -#define PY_MINOR_VERSION 5
> +#define PY_MAJOR_VERSION 3
> +#define PY_MINOR_VERSION 0
> #define PY_MICRO_VERSION 0
> #define PY_RELEASE_LEVEL PY_RELEASE_LEVEL_ALPHA
> #define PY_RELEASE_SERIAL 1
>
> /* Version as a string */
> -#define PY_VERSION "2.5a1"
> +#define PY_VERSION "3.0x"
>
> /* Subversion Revision number of this file (not of the repository) */
> #define PY_PATCHLEVEL_REVISION "$Revision$"
>
> Modified: python/branches/stdlib-cleanup/Include/pydebug.h
> ==============================================================================
> --- python/branches/stdlib-cleanup/Include/pydebug.h (original)
> +++ python/branches/stdlib-cleanup/Include/pydebug.h Sat Apr 8 22:42:09 2006
> @@ -16,10 +16,6 @@
> PyAPI_DATA(int) Py_UnicodeFlag;
> PyAPI_DATA(int) Py_IgnoreEnvironmentFlag;
> PyAPI_DATA(int) Py_DivisionWarningFlag;
> -/* _XXX Py_QnewFlag should go away in 3.0. It's true iff -Qnew is passed,
> - on the command line, and is used in 2.2 by ceval.c to make all "/" divisions
> - true divisions (which they will be in 3.0). */
> -PyAPI_DATA(int) _Py_QnewFlag;
>
> /* this is a wrapper around getenv() that pays attention to
> Py_IgnoreEnvironmentFlag. It should be used for getting variables like
>
> Modified: python/branches/stdlib-cleanup/Include/pyerrors.h
> ==============================================================================
> --- python/branches/stdlib-cleanup/Include/pyerrors.h (original)
> +++ python/branches/stdlib-cleanup/Include/pyerrors.h Sat Apr 8 22:42:09 2006
> @@ -28,25 +28,18 @@
>
> /* */
>
> -#define PyExceptionClass_Check(x) \
> - (PyClass_Check((x)) \
> - || (PyType_Check((x)) && PyType_IsSubtype( \
> - (PyTypeObject*)(x), (PyTypeObject*)PyExc_BaseException)))
> -
> -
> -#define PyExceptionInstance_Check(x) \
> - (PyInstance_Check((x)) || \
> - (PyType_IsSubtype((x)->ob_type, (PyTypeObject*)PyExc_BaseException)))
> -
> -#define PyExceptionClass_Name(x) \
> - (PyClass_Check((x)) \
> - ? PyString_AS_STRING(((PyClassObject*)(x))->cl_name) \
> - : (char *)(((PyTypeObject*)(x))->tp_name))
> -
> -#define PyExceptionInstance_Class(x) \
> - ((PyInstance_Check((x)) \
> - ? (PyObject*)((PyInstanceObject*)(x))->in_class \
> - : (PyObject*)((x)->ob_type)))
> +#define PyExceptionClass_Check(x) \
> + (PyType_Check((x)) && PyType_IsSubtype( \
> + (PyTypeObject*)(x), (PyTypeObject*)PyExc_BaseException))
> +
> +
> +#define PyExceptionInstance_Check(x) \
> + (PyType_IsSubtype((x)->ob_type, (PyTypeObject*)PyExc_BaseException))
> +
> +#define PyExceptionClass_Name(x) \
> + ((char *)(((PyTypeObject*)(x))->tp_name))
> +
> +#define PyExceptionInstance_Class(x) ((PyObject*)((x)->ob_type))
>
>
> /* Predefined exceptions */
>
> Modified: python/branches/stdlib-cleanup/Include/pythonrun.h
> ==============================================================================
> --- python/branches/stdlib-cleanup/Include/pythonrun.h (original)
> +++ python/branches/stdlib-cleanup/Include/pythonrun.h Sat Apr 8 22:42:09 2006
> @@ -7,9 +7,8 @@
> extern "C" {
> #endif
>
> -#define PyCF_MASK (CO_FUTURE_DIVISION | CO_FUTURE_ABSOLUTE_IMPORT | \
> - CO_FUTURE_WITH_STATEMENT)
> -#define PyCF_MASK_OBSOLETE (CO_NESTED)
> +#define PyCF_MASK 0
> +#define PyCF_MASK_OBSOLETE 0
> #define PyCF_SOURCE_IS_UTF8 0x0100
> #define PyCF_DONT_IMPLY_DEDENT 0x0200
> #define PyCF_ONLY_AST 0x0400
>
> Modified: python/branches/stdlib-cleanup/Lib/SimpleXMLRPCServer.py
> ==============================================================================
> --- python/branches/stdlib-cleanup/Lib/SimpleXMLRPCServer.py (original)
> +++ python/branches/stdlib-cleanup/Lib/SimpleXMLRPCServer.py Sat Apr 8 22:42:09 2006
> @@ -261,7 +261,7 @@
> except:
> # report exception back to server
> response = xmlrpclib.dumps(
> - xmlrpclib.Fault(1, "%s:%s" % (sys.exc_type, sys.exc_value)),
> + xmlrpclib.Fault(1, "%s:%s" % sys.exc_info()[:2]),
> encoding=self.encoding, allow_none=self.allow_none,
> )
>
> @@ -362,7 +362,7 @@
> except:
> results.append(
> {'faultCode' : 1,
> - 'faultString' : "%s:%s" % (sys.exc_type, sys.exc_value)}
> + 'faultString' : "%s:%s" % sys.exc_info()[:2]}
> )
> return results
>
>
> Modified: python/branches/stdlib-cleanup/Lib/bsddb/dbobj.py
> ==============================================================================
> --- python/branches/stdlib-cleanup/Lib/bsddb/dbobj.py (original)
> +++ python/branches/stdlib-cleanup/Lib/bsddb/dbobj.py Sat Apr 8 22:42:09 2006
> @@ -31,82 +31,82 @@
>
> class DBEnv:
> def __init__(self, *args, **kwargs):
> - self._cobj = apply(db.DBEnv, args, kwargs)
> + self._cobj = db.DBEnv(*args, **kwargs)
>
> def close(self, *args, **kwargs):
> - return apply(self._cobj.close, args, kwargs)
> + return self._cobj.close(*args, **kwargs)
> def open(self, *args, **kwargs):
> - return apply(self._cobj.open, args, kwargs)
> + return self._cobj.open(*args, **kwargs)
> def remove(self, *args, **kwargs):
> - return apply(self._cobj.remove, args, kwargs)
> + return self._cobj.remove(*args, **kwargs)
> def set_shm_key(self, *args, **kwargs):
> - return apply(self._cobj.set_shm_key, args, kwargs)
> + return self._cobj.set_shm_key(*args, **kwargs)
> def set_cachesize(self, *args, **kwargs):
> - return apply(self._cobj.set_cachesize, args, kwargs)
> + return self._cobj.set_cachesize(*args, **kwargs)
> def set_data_dir(self, *args, **kwargs):
> - return apply(self._cobj.set_data_dir, args, kwargs)
> + return self._cobj.set_data_dir(*args, **kwargs)
> def set_flags(self, *args, **kwargs):
> - return apply(self._cobj.set_flags, args, kwargs)
> + return self._cobj.set_flags(*args, **kwargs)
> def set_lg_bsize(self, *args, **kwargs):
> - return apply(self._cobj.set_lg_bsize, args, kwargs)
> + return self._cobj.set_lg_bsize(*args, **kwargs)
> def set_lg_dir(self, *args, **kwargs):
> - return apply(self._cobj.set_lg_dir, args, kwargs)
> + return self._cobj.set_lg_dir(*args, **kwargs)
> def set_lg_max(self, *args, **kwargs):
> - return apply(self._cobj.set_lg_max, args, kwargs)
> + return self._cobj.set_lg_max(*args, **kwargs)
> def set_lk_detect(self, *args, **kwargs):
> - return apply(self._cobj.set_lk_detect, args, kwargs)
> + return self._cobj.set_lk_detect(*args, **kwargs)
> def set_lk_max(self, *args, **kwargs):
> - return apply(self._cobj.set_lk_max, args, kwargs)
> + return self._cobj.set_lk_max(*args, **kwargs)
> def set_lk_max_locks(self, *args, **kwargs):
> - return apply(self._cobj.set_lk_max_locks, args, kwargs)
> + return self._cobj.set_lk_max_locks(*args, **kwargs)
> def set_lk_max_lockers(self, *args, **kwargs):
> - return apply(self._cobj.set_lk_max_lockers, args, kwargs)
> + return self._cobj.set_lk_max_lockers(*args, **kwargs)
> def set_lk_max_objects(self, *args, **kwargs):
> - return apply(self._cobj.set_lk_max_objects, args, kwargs)
> + return self._cobj.set_lk_max_objects(*args, **kwargs)
> def set_mp_mmapsize(self, *args, **kwargs):
> - return apply(self._cobj.set_mp_mmapsize, args, kwargs)
> + return self._cobj.set_mp_mmapsize(*args, **kwargs)
> def set_timeout(self, *args, **kwargs):
> - return apply(self._cobj.set_timeout, args, kwargs)
> + return self._cobj.set_timeout(*args, **kwargs)
> def set_tmp_dir(self, *args, **kwargs):
> - return apply(self._cobj.set_tmp_dir, args, kwargs)
> + return self._cobj.set_tmp_dir(*args, **kwargs)
> def txn_begin(self, *args, **kwargs):
> - return apply(self._cobj.txn_begin, args, kwargs)
> + return self._cobj.txn_begin(*args, **kwargs)
> def txn_checkpoint(self, *args, **kwargs):
> - return apply(self._cobj.txn_checkpoint, args, kwargs)
> + return self._cobj.txn_checkpoint(*args, **kwargs)
> def txn_stat(self, *args, **kwargs):
> - return apply(self._cobj.txn_stat, args, kwargs)
> + return self._cobj.txn_stat(*args, **kwargs)
> def set_tx_max(self, *args, **kwargs):
> - return apply(self._cobj.set_tx_max, args, kwargs)
> + return self._cobj.set_tx_max(*args, **kwargs)
> def set_tx_timestamp(self, *args, **kwargs):
> - return apply(self._cobj.set_tx_timestamp, args, kwargs)
> + return self._cobj.set_tx_timestamp(*args, **kwargs)
> def lock_detect(self, *args, **kwargs):
> - return apply(self._cobj.lock_detect, args, kwargs)
> + return self._cobj.lock_detect(*args, **kwargs)
> def lock_get(self, *args, **kwargs):
> - return apply(self._cobj.lock_get, args, kwargs)
> + return self._cobj.lock_get(*args, **kwargs)
> def lock_id(self, *args, **kwargs):
> - return apply(self._cobj.lock_id, args, kwargs)
> + return self._cobj.lock_id(*args, **kwargs)
> def lock_put(self, *args, **kwargs):
> - return apply(self._cobj.lock_put, args, kwargs)
> + return self._cobj.lock_put(*args, **kwargs)
> def lock_stat(self, *args, **kwargs):
> - return apply(self._cobj.lock_stat, args, kwargs)
> + return self._cobj.lock_stat(*args, **kwargs)
> def log_archive(self, *args, **kwargs):
> - return apply(self._cobj.log_archive, args, kwargs)
> + return self._cobj.log_archive(*args, **kwargs)
> def set_get_returns_none(self, *args, **kwargs):
> - return apply(self._cobj.set_get_returns_none, args, kwargs)
> + return self._cobj.set_get_returns_none(*args, **kwargs)
>
> if db.version() >= (4,1):
> def dbremove(self, *args, **kwargs):
> - return apply(self._cobj.dbremove, args, kwargs)
> + return self._cobj.dbremove(*args, **kwargs)
> def dbrename(self, *args, **kwargs):
> - return apply(self._cobj.dbrename, args, kwargs)
> + return self._cobj.dbrename(*args, **kwargs)
> def set_encrypt(self, *args, **kwargs):
> - return apply(self._cobj.set_encrypt, args, kwargs)
> + return self._cobj.set_encrypt(*args, **kwargs)
>
>
> class DB(DictMixin):
> def __init__(self, dbenv, *args, **kwargs):
> # give it the proper DBEnv C object that its expecting
> - self._cobj = apply(db.DB, (dbenv._cobj,) + args, kwargs)
> + self._cobj = db.DB(dbenv._cobj, *args, **kwargs)
>
> # TODO are there other dict methods that need to be overridden?
> def __len__(self):
> @@ -119,92 +119,92 @@
> del self._cobj[arg]
>
> def append(self, *args, **kwargs):
> - return apply(self._cobj.append, args, kwargs)
> + return self._cobj.append(*args, **kwargs)
> def associate(self, *args, **kwargs):
> - return apply(self._cobj.associate, args, kwargs)
> + return self._cobj.associate(*args, **kwargs)
> def close(self, *args, **kwargs):
> - return apply(self._cobj.close, args, kwargs)
> + return self._cobj.close(*args, **kwargs)
> def consume(self, *args, **kwargs):
> - return apply(self._cobj.consume, args, kwargs)
> + return self._cobj.consume(*args, **kwargs)
> def consume_wait(self, *args, **kwargs):
> - return apply(self._cobj.consume_wait, args, kwargs)
> + return self._cobj.consume_wait(*args, **kwargs)
> def cursor(self, *args, **kwargs):
> - return apply(self._cobj.cursor, args, kwargs)
> + return self._cobj.cursor(*args, **kwargs)
> def delete(self, *args, **kwargs):
> - return apply(self._cobj.delete, args, kwargs)
> + return self._cobj.delete(*args, **kwargs)
> def fd(self, *args, **kwargs):
> - return apply(self._cobj.fd, args, kwargs)
> + return self._cobj.fd(*args, **kwargs)
> def get(self, *args, **kwargs):
> - return apply(self._cobj.get, args, kwargs)
> + return self._cobj.get(*args, **kwargs)
> def pget(self, *args, **kwargs):
> - return apply(self._cobj.pget, args, kwargs)
> + return self._cobj.pget(*args, **kwargs)
> def get_both(self, *args, **kwargs):
> - return apply(self._cobj.get_both, args, kwargs)
> + return self._cobj.get_both(*args, **kwargs)
> def get_byteswapped(self, *args, **kwargs):
> - return apply(self._cobj.get_byteswapped, args, kwargs)
> + return self._cobj.get_byteswapped(*args, **kwargs)
> def get_size(self, *args, **kwargs):
> - return apply(self._cobj.get_size, args, kwargs)
> + return self._cobj.get_size(*args, **kwargs)
> def get_type(self, *args, **kwargs):
> - return apply(self._cobj.get_type, args, kwargs)
> + return self._cobj.get_type(*args, **kwargs)
> def join(self, *args, **kwargs):
> - return apply(self._cobj.join, args, kwargs)
> + return self._cobj.join(*args, **kwargs)
> def key_range(self, *args, **kwargs):
> - return apply(self._cobj.key_range, args, kwargs)
> + return self._cobj.key_range(*args, **kwargs)
> def has_key(self, *args, **kwargs):
> - return apply(self._cobj.has_key, args, kwargs)
> + return self._cobj.has_key(*args, **kwargs)
> def items(self, *args, **kwargs):
> - return apply(self._cobj.items, args, kwargs)
> + return self._cobj.items(*args, **kwargs)
> def keys(self, *args, **kwargs):
> - return apply(self._cobj.keys, args, kwargs)
> + return self._cobj.keys(*args, **kwargs)
> def open(self, *args, **kwargs):
> - return apply(self._cobj.open, args, kwargs)
> + return self._cobj.open(*args, **kwargs)
> def put(self, *args, **kwargs):
> ...
>
> [Message clipped]
> _______________________________________________
> Python-checkins mailing list
> Python-checkins at python.org
> http://mail.python.org/mailman/listinfo/python-checkins
>
>
>
--
--Guido van Rossum (home page: http://www.python.org/~guido/)
More information about the Python-checkins
mailing list