[Python-checkins] r53363 - in python/branches/p3yk-noslice: Doc/README Doc/api/newtypes.tex Doc/howto/functional.rst Doc/html/style.css Doc/lib/libbsddb.tex Doc/lib/libbz2.tex Doc/lib/libctypes.tex Doc/lib/libfuncs.tex Doc/lib/liblogging.tex Doc/lib/libmmap.tex Doc/lib/libsimplexmlrpc.tex Doc/lib/libsocket.tex Doc/lib/libsqlite3.tex Doc/lib/libstdtypes.tex Doc/lib/libsys.tex Doc/lib/libtarfile.tex Doc/lib/libtest.tex Doc/lib/liburlparse.tex Doc/mac/toolbox.tex Doc/perl/python.perl Doc/tut/tut.tex Doc/whatsnew/whatsnew25.tex Grammar/Grammar Include/Python-ast.h Include/Python.h Include/floatobject.h Include/funcobject.h Include/graminit.h Include/pyport.h Include/stringobject.h Include/token.h LICENSE Lib/CGIHTTPServer.py Lib/SimpleHTTPServer.py Lib/StringIO.py Lib/bsddb/dbobj.py Lib/bsddb/test/test_1413192.py Lib/bsddb/test/test_associate.py Lib/bsddb/test/test_basics.py Lib/bsddb/test/test_dbobj.py Lib/bsddb/test/test_dbshelve.py Lib/bsddb/test/test_dbtables.py Lib/bsddb/test/test_env_close.py Lib/bsddb/test/test_join.py Lib/bsddb/test/test_lock.py Lib/bsddb/test/test_misc.py Lib/bsddb/test/test_recno.py Lib/bsddb/test/test_thread.py Lib/compiler/ast.py Lib/compiler/pyassem.py Lib/compiler/pycodegen.py Lib/compiler/symbols.py Lib/compiler/transformer.py Lib/cookielib.py Lib/difflib.py Lib/dumbdbm.py Lib/heapq.py Lib/hmac.py Lib/idlelib/AutoCompleteWindow.py Lib/idlelib/NEWS.txt Lib/logging/__init__.py Lib/logging/handlers.py Lib/mailbox.py Lib/pty.py Lib/pydoc.py Lib/random.py Lib/subprocess.py Lib/symbol.py Lib/tarfile.py Lib/test/output/test_tokenize Lib/test/test_ast.py Lib/test/test_builtin.py Lib/test/test_compile.py Lib/test/test_compiler.py Lib/test/test_deque.py Lib/test/test_dumbdbm.py Lib/test/test_exceptions.py Lib/test/test_grammar.py Lib/test/test_heapq.py Lib/test/test_import.py Lib/test/test_pty.py Lib/test/test_random.py Lib/test/test_repr.py Lib/test/test_set.py Lib/test/test_struct.py Lib/test/test_support.py Lib/test/test_sys.py Lib/test/test_tarfile.py Lib/test/test_tokenize.py Lib/test/test_uu.py Lib/test/test_weakref.py Lib/test/tokenize_tests.txt Lib/threading.py Lib/token.py Lib/tokenize.py Lib/urllib.py Misc/ACKS Misc/NEWS Misc/developers.txt Misc/python-mode.el Modules/_bsddb.c Modules/_ctypes/_ctypes_test.c Modules/_elementtree.c Modules/addrinfo.h Modules/bz2module.c Modules/collectionsmodule.c Modules/main.c Modules/parsermodule.c Modules/socketmodule.c Modules/timemodule.c Objects/bytesobject.c Objects/dictnotes.txt Objects/floatobject.c Objects/funcobject.c Objects/object.c Objects/setobject.c PC/python_nt.rc PCbuild/python20.wse PCbuild/pythoncore.vcproj PCbuild8/python20.wse Parser/Python.asdl Parser/asdl.py Parser/spark.py Parser/tokenizer.c Python/Python-ast.c Python/ast.c Python/bltinmodule.c Python/ceval.c Python/compile.c Python/errors.c Python/getcopyright.c Python/graminit.c Python/import.c Python/marshal.c Python/symtable.c Python/sysmodule.c README Tools/compiler/ast.txt Tools/compiler/astgen.py Tools/pybench/Strings.py Tools/scripts/fixdiv.py setup.py

thomas.wouters python-checkins at python.org
Thu Jan 11 00:21:50 CET 2007


Author: thomas.wouters
Date: Thu Jan 11 00:21:28 2007
New Revision: 53363

Modified:
   python/branches/p3yk-noslice/   (props changed)
   python/branches/p3yk-noslice/Doc/README
   python/branches/p3yk-noslice/Doc/api/newtypes.tex
   python/branches/p3yk-noslice/Doc/howto/functional.rst
   python/branches/p3yk-noslice/Doc/html/style.css
   python/branches/p3yk-noslice/Doc/lib/libbsddb.tex
   python/branches/p3yk-noslice/Doc/lib/libbz2.tex
   python/branches/p3yk-noslice/Doc/lib/libctypes.tex
   python/branches/p3yk-noslice/Doc/lib/libfuncs.tex
   python/branches/p3yk-noslice/Doc/lib/liblogging.tex
   python/branches/p3yk-noslice/Doc/lib/libmmap.tex
   python/branches/p3yk-noslice/Doc/lib/libsimplexmlrpc.tex
   python/branches/p3yk-noslice/Doc/lib/libsocket.tex
   python/branches/p3yk-noslice/Doc/lib/libsqlite3.tex
   python/branches/p3yk-noslice/Doc/lib/libstdtypes.tex
   python/branches/p3yk-noslice/Doc/lib/libsys.tex
   python/branches/p3yk-noslice/Doc/lib/libtarfile.tex
   python/branches/p3yk-noslice/Doc/lib/libtest.tex
   python/branches/p3yk-noslice/Doc/lib/liburlparse.tex
   python/branches/p3yk-noslice/Doc/mac/toolbox.tex
   python/branches/p3yk-noslice/Doc/perl/python.perl
   python/branches/p3yk-noslice/Doc/tut/tut.tex
   python/branches/p3yk-noslice/Doc/whatsnew/whatsnew25.tex
   python/branches/p3yk-noslice/Grammar/Grammar
   python/branches/p3yk-noslice/Include/Python-ast.h
   python/branches/p3yk-noslice/Include/Python.h
   python/branches/p3yk-noslice/Include/floatobject.h
   python/branches/p3yk-noslice/Include/funcobject.h
   python/branches/p3yk-noslice/Include/graminit.h
   python/branches/p3yk-noslice/Include/pyport.h
   python/branches/p3yk-noslice/Include/stringobject.h
   python/branches/p3yk-noslice/Include/token.h
   python/branches/p3yk-noslice/LICENSE
   python/branches/p3yk-noslice/Lib/CGIHTTPServer.py
   python/branches/p3yk-noslice/Lib/SimpleHTTPServer.py
   python/branches/p3yk-noslice/Lib/StringIO.py
   python/branches/p3yk-noslice/Lib/bsddb/dbobj.py
   python/branches/p3yk-noslice/Lib/bsddb/test/test_1413192.py
   python/branches/p3yk-noslice/Lib/bsddb/test/test_associate.py
   python/branches/p3yk-noslice/Lib/bsddb/test/test_basics.py
   python/branches/p3yk-noslice/Lib/bsddb/test/test_dbobj.py
   python/branches/p3yk-noslice/Lib/bsddb/test/test_dbshelve.py
   python/branches/p3yk-noslice/Lib/bsddb/test/test_dbtables.py
   python/branches/p3yk-noslice/Lib/bsddb/test/test_env_close.py
   python/branches/p3yk-noslice/Lib/bsddb/test/test_join.py
   python/branches/p3yk-noslice/Lib/bsddb/test/test_lock.py
   python/branches/p3yk-noslice/Lib/bsddb/test/test_misc.py
   python/branches/p3yk-noslice/Lib/bsddb/test/test_recno.py
   python/branches/p3yk-noslice/Lib/bsddb/test/test_thread.py
   python/branches/p3yk-noslice/Lib/compiler/ast.py
   python/branches/p3yk-noslice/Lib/compiler/pyassem.py
   python/branches/p3yk-noslice/Lib/compiler/pycodegen.py
   python/branches/p3yk-noslice/Lib/compiler/symbols.py
   python/branches/p3yk-noslice/Lib/compiler/transformer.py
   python/branches/p3yk-noslice/Lib/cookielib.py
   python/branches/p3yk-noslice/Lib/difflib.py
   python/branches/p3yk-noslice/Lib/dumbdbm.py
   python/branches/p3yk-noslice/Lib/heapq.py
   python/branches/p3yk-noslice/Lib/hmac.py
   python/branches/p3yk-noslice/Lib/idlelib/AutoCompleteWindow.py
   python/branches/p3yk-noslice/Lib/idlelib/NEWS.txt
   python/branches/p3yk-noslice/Lib/logging/__init__.py
   python/branches/p3yk-noslice/Lib/logging/handlers.py
   python/branches/p3yk-noslice/Lib/mailbox.py
   python/branches/p3yk-noslice/Lib/pty.py
   python/branches/p3yk-noslice/Lib/pydoc.py
   python/branches/p3yk-noslice/Lib/random.py
   python/branches/p3yk-noslice/Lib/subprocess.py
   python/branches/p3yk-noslice/Lib/symbol.py
   python/branches/p3yk-noslice/Lib/tarfile.py
   python/branches/p3yk-noslice/Lib/test/output/test_tokenize
   python/branches/p3yk-noslice/Lib/test/test_ast.py
   python/branches/p3yk-noslice/Lib/test/test_builtin.py
   python/branches/p3yk-noslice/Lib/test/test_compile.py
   python/branches/p3yk-noslice/Lib/test/test_compiler.py
   python/branches/p3yk-noslice/Lib/test/test_deque.py
   python/branches/p3yk-noslice/Lib/test/test_dumbdbm.py
   python/branches/p3yk-noslice/Lib/test/test_exceptions.py
   python/branches/p3yk-noslice/Lib/test/test_grammar.py
   python/branches/p3yk-noslice/Lib/test/test_heapq.py
   python/branches/p3yk-noslice/Lib/test/test_import.py
   python/branches/p3yk-noslice/Lib/test/test_pty.py
   python/branches/p3yk-noslice/Lib/test/test_random.py
   python/branches/p3yk-noslice/Lib/test/test_repr.py
   python/branches/p3yk-noslice/Lib/test/test_set.py
   python/branches/p3yk-noslice/Lib/test/test_struct.py
   python/branches/p3yk-noslice/Lib/test/test_support.py
   python/branches/p3yk-noslice/Lib/test/test_sys.py
   python/branches/p3yk-noslice/Lib/test/test_tarfile.py
   python/branches/p3yk-noslice/Lib/test/test_tokenize.py
   python/branches/p3yk-noslice/Lib/test/test_uu.py
   python/branches/p3yk-noslice/Lib/test/test_weakref.py
   python/branches/p3yk-noslice/Lib/test/tokenize_tests.txt
   python/branches/p3yk-noslice/Lib/threading.py
   python/branches/p3yk-noslice/Lib/token.py
   python/branches/p3yk-noslice/Lib/tokenize.py
   python/branches/p3yk-noslice/Lib/urllib.py
   python/branches/p3yk-noslice/Misc/ACKS
   python/branches/p3yk-noslice/Misc/NEWS
   python/branches/p3yk-noslice/Misc/developers.txt
   python/branches/p3yk-noslice/Misc/python-mode.el
   python/branches/p3yk-noslice/Modules/_bsddb.c
   python/branches/p3yk-noslice/Modules/_ctypes/_ctypes_test.c
   python/branches/p3yk-noslice/Modules/_elementtree.c
   python/branches/p3yk-noslice/Modules/addrinfo.h
   python/branches/p3yk-noslice/Modules/bz2module.c
   python/branches/p3yk-noslice/Modules/collectionsmodule.c
   python/branches/p3yk-noslice/Modules/main.c
   python/branches/p3yk-noslice/Modules/parsermodule.c
   python/branches/p3yk-noslice/Modules/socketmodule.c
   python/branches/p3yk-noslice/Modules/timemodule.c
   python/branches/p3yk-noslice/Objects/bytesobject.c
   python/branches/p3yk-noslice/Objects/dictnotes.txt
   python/branches/p3yk-noslice/Objects/floatobject.c
   python/branches/p3yk-noslice/Objects/funcobject.c
   python/branches/p3yk-noslice/Objects/object.c
   python/branches/p3yk-noslice/Objects/setobject.c
   python/branches/p3yk-noslice/PC/python_nt.rc
   python/branches/p3yk-noslice/PCbuild/python20.wse
   python/branches/p3yk-noslice/PCbuild/pythoncore.vcproj
   python/branches/p3yk-noslice/PCbuild8/python20.wse
   python/branches/p3yk-noslice/Parser/Python.asdl
   python/branches/p3yk-noslice/Parser/asdl.py
   python/branches/p3yk-noslice/Parser/spark.py
   python/branches/p3yk-noslice/Parser/tokenizer.c
   python/branches/p3yk-noslice/Python/Python-ast.c
   python/branches/p3yk-noslice/Python/ast.c
   python/branches/p3yk-noslice/Python/bltinmodule.c
   python/branches/p3yk-noslice/Python/ceval.c
   python/branches/p3yk-noslice/Python/compile.c
   python/branches/p3yk-noslice/Python/errors.c
   python/branches/p3yk-noslice/Python/getcopyright.c
   python/branches/p3yk-noslice/Python/graminit.c
   python/branches/p3yk-noslice/Python/import.c
   python/branches/p3yk-noslice/Python/marshal.c
   python/branches/p3yk-noslice/Python/symtable.c
   python/branches/p3yk-noslice/Python/sysmodule.c
   python/branches/p3yk-noslice/README
   python/branches/p3yk-noslice/Tools/compiler/ast.txt
   python/branches/p3yk-noslice/Tools/compiler/astgen.py
   python/branches/p3yk-noslice/Tools/pybench/Strings.py
   python/branches/p3yk-noslice/Tools/scripts/fixdiv.py
   python/branches/p3yk-noslice/setup.py
Log:

Merge noslice branch with p3yk branch.

Merged revisions 53040-53333 via svnmerge from 
svn+ssh://pythondev@svn.python.org/python/branches/p3yk

................
  r53064 | thomas.wouters | 2006-12-19 09:30:14 +0100 (Tue, 19 Dec 2006) | 4 lines
  
  
  Implement extended slicing in bytes objects.
................
  r53080 | georg.brandl | 2006-12-19 21:50:34 +0100 (Tue, 19 Dec 2006) | 3 lines
  
  Patch #1601678: move intern() to sys.intern().
................
  r53087 | guido.van.rossum | 2006-12-19 22:35:46 +0100 (Tue, 19 Dec 2006) | 2 lines
  
  The opstrings table was backwards.  Add an XXX comment.
................
  r53089 | fred.drake | 2006-12-19 23:06:09 +0100 (Tue, 19 Dec 2006) | 1 line
  
  hide version notes for 1.x and 2.x from the HTML version
................
  r53167 | neal.norwitz | 2006-12-28 05:45:06 +0100 (Thu, 28 Dec 2006) | 3 lines
  
  Remove PyFloat_AsReprString() and PyFloat_AsString() which should not
  have been public due to passing buffers without lengths.
................
  r53168 | neal.norwitz | 2006-12-28 05:47:50 +0100 (Thu, 28 Dec 2006) | 5 lines
  
  Cruft removal:
   * DL_IMPORT/DL_EXPORT
   * #if 0'd code
   * Py_PROTO which was obsolete, but still used in one place in addrinfo.h
................
  r53170 | neal.norwitz | 2006-12-28 07:47:50 +0100 (Thu, 28 Dec 2006) | 1 line
  
  PEP 3107 - Function Annotations thanks to Tony Lownds
................
  r53171 | guido.van.rossum | 2006-12-28 22:03:31 +0100 (Thu, 28 Dec 2006) | 2 lines
  
  Update the magic number now that signature annotations were added.
................
  r53189 | fred.drake | 2006-12-29 05:42:48 +0100 (Fri, 29 Dec 2006) | 3 lines
  
  avoid dict.has_key, since this might get used by a Py3K built in the
  working copy
................
  r53288 | martin.v.loewis | 2007-01-06 14:29:14 +0100 (Sat, 06 Jan 2007) | 2 lines
  
  Commit __version__ change.
................
  r53289 | martin.v.loewis | 2007-01-06 14:49:08 +0100 (Sat, 06 Jan 2007) | 2 lines
  
  Add the bytes type to the build process.
................
  r53332 | thomas.wouters | 2007-01-10 00:18:33 +0100 (Wed, 10 Jan 2007) | 377 lines
  
  
  Merged revisions 53005-53303 via svnmerge from 
  svn+ssh://pythondev@svn.python.org/python/trunk
  
  ........
    r53012 | walter.doerwald | 2006-12-12 22:55:31 +0100 (Tue, 12 Dec 2006) | 2 lines
    
    Fix typo.
  ........
    r53023 | brett.cannon | 2006-12-13 23:31:37 +0100 (Wed, 13 Dec 2006) | 2 lines
    
    Remove an unneeded import of 'warnings'.
  ........
    r53025 | brett.cannon | 2006-12-14 00:02:38 +0100 (Thu, 14 Dec 2006) | 2 lines
    
    Remove unneeded imports of 'warnings'.
  ........
    r53026 | brett.cannon | 2006-12-14 00:09:53 +0100 (Thu, 14 Dec 2006) | 4 lines
    
    Add test.test_support.guard_warnings_filter .  This function returns a context
    manager that protects warnings.filter from being modified once the context is
    exited.
  ........
    r53029 | george.yoshida | 2006-12-14 03:22:44 +0100 (Thu, 14 Dec 2006) | 2 lines
    
    Note that guard_warnings_filter was added in 2.6
  ........
    r53031 | vinay.sajip | 2006-12-14 09:53:55 +0100 (Thu, 14 Dec 2006) | 1 line
    
    Added news on recent changes to logging
  ........
    r53032 | andrew.kuchling | 2006-12-14 19:57:53 +0100 (Thu, 14 Dec 2006) | 1 line
    
    [Patch #1599256 from David Watson] check that os.fsync is available before using it
  ........
    r53042 | kurt.kaiser | 2006-12-15 06:13:11 +0100 (Fri, 15 Dec 2006) | 6 lines
    
    1. Avoid hang when encountering a duplicate in a completion list. Bug 1571112.
    2. Duplicate some old entries from Python's NEWS to IDLE's NEWS.txt
    
    M    AutoCompleteWindow.py
    M    NEWS.txt
  ........
    r53048 | andrew.kuchling | 2006-12-18 18:12:31 +0100 (Mon, 18 Dec 2006) | 1 line
    
    [Bug #1618083] Add missing word; make a few grammar fixes
  ........
    r53050 | andrew.kuchling | 2006-12-18 18:16:05 +0100 (Mon, 18 Dec 2006) | 1 line
    
    Bump version
  ........
    r53051 | andrew.kuchling | 2006-12-18 18:22:07 +0100 (Mon, 18 Dec 2006) | 1 line
    
    [Bug #1616726] Fix description of generator.close(); if you raise some random exception, the exception is raised and doesn't trigger a RuntimeError
  ........
    r53052 | andrew.kuchling | 2006-12-18 18:38:14 +0100 (Mon, 18 Dec 2006) | 1 line
    
    Describe new methods in Queue module
  ........
    r53053 | andrew.kuchling | 2006-12-18 20:22:24 +0100 (Mon, 18 Dec 2006) | 1 line
    
    [Patch #1615868 by Lars Gustaebel] Use Py_off_t to fix BZ2File.seek() for offsets > 2Gb
  ........
    r53057 | andrew.kuchling | 2006-12-18 22:29:07 +0100 (Mon, 18 Dec 2006) | 1 line
    
    Fix markup
  ........
    r53063 | thomas.wouters | 2006-12-19 09:17:50 +0100 (Tue, 19 Dec 2006) | 5 lines
    
    
    Make sre's SubPattern objects accept slice objects like it already accepts
    simple slices.
  ........
    r53065 | andrew.kuchling | 2006-12-19 15:13:05 +0100 (Tue, 19 Dec 2006) | 6 lines
    
    [Patch #1618455 by Ben Maurer] Improve speed of HMAC by using str.translate()
       instead of a more general XOR that has to construct a list.
    
    Slightly modified from Maurer's patch: the _strxor() function is no longer
    necessary at all.
  ........
    r53066 | andrew.kuchling | 2006-12-19 15:28:23 +0100 (Tue, 19 Dec 2006) | 9 lines
    
    [Bug #1613651] Document socket.recv_into, socket.recvfrom_into
    
    Also, the text for recvfrom told you to read recv() for an explanation of the
    'flags' argument, but recv() just pointed you at the man page.  Copied the 
    man-page text to recvfrom(), recvfrom_into, recv_into to avoid the pointless
    redirection.
    
    I don't have LaTeX on this machine; hope my markup is OK.
  ........
    r53067 | andrew.kuchling | 2006-12-19 15:29:04 +0100 (Tue, 19 Dec 2006) | 1 line
    
    Comment typo
  ........
    r53068 | andrew.kuchling | 2006-12-19 16:11:41 +0100 (Tue, 19 Dec 2006) | 1 line
    
    [Patch #1617413 from Dug Song] Fix HTTP Basic authentication via HTTPS
  ........
    r53071 | andrew.kuchling | 2006-12-19 16:18:12 +0100 (Tue, 19 Dec 2006) | 1 line
    
    [Patch #1600491 from Jim Jewett] Describe how to build help files on Windows
  ........
    r53073 | andrew.kuchling | 2006-12-19 16:43:10 +0100 (Tue, 19 Dec 2006) | 6 lines
    
    [Patch #1587139 by kxroberto] Protect lock acquisition/release with
    try...finally to ensure the lock is always released.  This could use
    the 'with' statement, but the patch uses 'finally'.
    
    2.5 backport candidate.
  ........
    r53074 | vinay.sajip | 2006-12-19 19:29:11 +0100 (Tue, 19 Dec 2006) | 1 line
    
    Updated documentation for findCaller() to indicate that a 3-tuple is now returned, rather than a 2-tuple.
  ........
    r53090 | georg.brandl | 2006-12-19 23:06:46 +0100 (Tue, 19 Dec 2006) | 3 lines
    
    Patch #1484695: The tarfile module now raises a HeaderError exception
    if a buffer given to frombuf() is invalid.
  ........
    r53099 | raymond.hettinger | 2006-12-20 07:42:06 +0100 (Wed, 20 Dec 2006) | 5 lines
    
    Bug #1590891:   random.randrange don't return correct value for big number
    
    Needs to be backported.
  ........
    r53106 | georg.brandl | 2006-12-20 12:55:16 +0100 (Wed, 20 Dec 2006) | 3 lines
    
    Testcase for patch #1484695.
  ........
    r53110 | andrew.kuchling | 2006-12-20 20:48:20 +0100 (Wed, 20 Dec 2006) | 17 lines
    
    [Apply length-checking.diff from bug #1599254] 
    
    Add length checking to single-file mailbox formats: before doing a
    flush() on a mailbox, seek to the end and verify its length is
    unchanged, raising ExternalClashError if the file's length has
    changed.  
    
    This fix avoids potential data loss if some other process appends to
    the mailbox file after the table of contents has been generated;
    instead of overwriting the modified file, you'll get the exception.
    
    I also noticed that the self._lookup() call in self.flush() wasn't
    necessary (everything that sets self._pending to True also calls
    self.lookup()), and replaced it by an assertion.
    
    2.5 backport candidate.
  ........
    r53112 | andrew.kuchling | 2006-12-20 20:57:10 +0100 (Wed, 20 Dec 2006) | 1 line
    
    [Bug #1619674] Make sum() use the term iterable, not sequence
  ........
    r53113 | andrew.kuchling | 2006-12-20 20:58:11 +0100 (Wed, 20 Dec 2006) | 1 line
    
    Two grammar fixes
  ........
    r53115 | andrew.kuchling | 2006-12-20 21:11:12 +0100 (Wed, 20 Dec 2006) | 5 lines
    
    Some other built-in functions are described with 'sequence' arguments 
    that should really be 'iterable'; this commit changes them.
    
    Did I miss any?  Did I introduce any errors?
  ........
    r53117 | andrew.kuchling | 2006-12-20 21:20:42 +0100 (Wed, 20 Dec 2006) | 1 line
    
    [Bug #1619680] in_dll() arguments are documented in the wrong order
  ........
    r53120 | neal.norwitz | 2006-12-21 05:38:00 +0100 (Thu, 21 Dec 2006) | 1 line
    
    Lars asked for permission on on python-dev for work on tarfile.py
  ........
    r53125 | andrew.kuchling | 2006-12-21 14:40:29 +0100 (Thu, 21 Dec 2006) | 1 line
    
    Mention the os.SEEK_* constants
  ........
    r53129 | walter.doerwald | 2006-12-21 19:06:30 +0100 (Thu, 21 Dec 2006) | 2 lines
    
    Fix typo.
  ........
    r53131 | thomas.heller | 2006-12-21 19:30:56 +0100 (Thu, 21 Dec 2006) | 3 lines
    
    Fix wrong markup of an argument in a method signature.
    Will backport.
  ........
    r53137 | andrew.kuchling | 2006-12-22 01:50:56 +0100 (Fri, 22 Dec 2006) | 1 line
    
    Typo fix
  ........
    r53139 | andrew.kuchling | 2006-12-22 14:25:02 +0100 (Fri, 22 Dec 2006) | 1 line
    
    [Bug #737202; fix from Titus Brown] Make CGIHTTPServer work for scripts in sub-directories
  ........
    r53141 | andrew.kuchling | 2006-12-22 16:04:45 +0100 (Fri, 22 Dec 2006) | 6 lines
    
    [Bug #802128] Make the mode argument of dumbdbm actually work the way it's
    described, and add a test for it.
    
    2.5 bugfix candidate, maybe; arguably this patch changes the API of 
    dumbdbm and shouldn't be added in a point-release.
  ........
    r53142 | andrew.kuchling | 2006-12-22 16:16:58 +0100 (Fri, 22 Dec 2006) | 6 lines
    
    [Bug #802128 continued] Modify mode depending on the process umask.
    
    Is there really no other way to read the umask than to set it?
    
    Hope this works on Windows...
  ........
    r53145 | andrew.kuchling | 2006-12-22 17:43:26 +0100 (Fri, 22 Dec 2006) | 1 line
    
    [Bug #776202] Apply Walter Doerwald's patch to use text mode for encoded files
  ........
    r53146 | andrew.kuchling | 2006-12-22 19:41:42 +0100 (Fri, 22 Dec 2006) | 9 lines
    
    [Patch #783050 from Patrick Lynch] The emulation of forkpty() is incorrect;
    the master should close the slave fd.
    
    Added a test to test_pty.py that reads from the master_fd after doing
    a pty.fork(); without the fix it hangs forever instead of raising an
    exception.  (<crossing fingers for the buildbots>)
    
    2.5 backport candidate.
  ........
    r53147 | andrew.kuchling | 2006-12-22 20:06:16 +0100 (Fri, 22 Dec 2006) | 1 line
    
    [Patch #827559 from Chris Gonnerman] Make SimpleHTTPServer redirect when a directory URL is missing the trailing slash; this lets relative links work.
  ........
    r53149 | andrew.kuchling | 2006-12-22 20:21:27 +0100 (Fri, 22 Dec 2006) | 1 line
    
    Darn; this test works when you run test_pty.py directly, but fails when regrtest runs it (the os.read() raises os.error).  I can't figure out the cause, so am commenting out the test.
  ........
    r53150 | andrew.kuchling | 2006-12-22 22:48:19 +0100 (Fri, 22 Dec 2006) | 1 line
    
    Frak; this test also fails
  ........
    r53153 | lars.gustaebel | 2006-12-23 17:40:13 +0100 (Sat, 23 Dec 2006) | 5 lines
    
    Patch #1230446: tarfile.py: fix ExFileObject so that read() and tell()
    work correctly together with readline().
    
    Will backport to 2.5.
  ........
    r53155 | lars.gustaebel | 2006-12-23 18:57:23 +0100 (Sat, 23 Dec 2006) | 5 lines
    
    Patch #1262036: Prevent TarFiles from being added to themselves under
    certain conditions.
    
    Will backport to 2.5.
  ........
    r53159 | andrew.kuchling | 2006-12-27 04:25:31 +0100 (Wed, 27 Dec 2006) | 4 lines
    
    [Part of patch #1182394] Move the HMAC blocksize to be a class-level 
    constant; this allows changing it in a subclass.  To accommodate this,
    copy() now uses __class__.  Also add some text to a comment.
  ........
    r53160 | andrew.kuchling | 2006-12-27 04:31:24 +0100 (Wed, 27 Dec 2006) | 1 line
    
    [Rest of patch #1182394] Add ._current() method so that we can use the written-in-C .hexdigest() method
  ........
    r53161 | lars.gustaebel | 2006-12-27 11:30:46 +0100 (Wed, 27 Dec 2006) | 4 lines
    
    Patch #1504073: Fix tarfile.open() for mode "r" with a fileobj argument.
    
    Will backport to 2.5.
  ........
    r53165 | neal.norwitz | 2006-12-28 05:39:20 +0100 (Thu, 28 Dec 2006) | 1 line
    
    Remove a stray (old) macro name left around (I guess)
  ........
    r53188 | neal.norwitz | 2006-12-29 04:01:53 +0100 (Fri, 29 Dec 2006) | 1 line
    
    SF bug #1623890, fix argument name in docstring
  ........
    r53200 | raymond.hettinger | 2006-12-30 05:01:17 +0100 (Sat, 30 Dec 2006) | 1 line
    
    For sets with cyclical reprs, emit an ellipsis instead of infinitely recursing.
  ........
    r53232 | brett.cannon | 2007-01-04 01:23:49 +0100 (Thu, 04 Jan 2007) | 3 lines
    
    Add EnvironmentVarGuard to test.test_support.  Provides a context manager to
    temporarily set or unset environment variables.
  ........
    r53235 | neal.norwitz | 2007-01-04 07:25:31 +0100 (Thu, 04 Jan 2007) | 1 line
    
    SF #1627373, fix typo in CarbonEvt.
  ........
    r53244 | raymond.hettinger | 2007-01-04 18:53:34 +0100 (Thu, 04 Jan 2007) | 1 line
    
    Fix stability of heapq's nlargest() and nsmallest().
  ........
    r53249 | martin.v.loewis | 2007-01-04 22:06:12 +0100 (Thu, 04 Jan 2007) | 3 lines
    
    Bug #1566280: Explicitly invoke threading._shutdown from Py_Main,
    to avoid relying on atexit.
    Will backport to 2.5.
  ........
    r53252 | gregory.p.smith | 2007-01-05 02:59:42 +0100 (Fri, 05 Jan 2007) | 3 lines
    
    Support linking of the bsddb module against BerkeleyDB 4.5.x
    (will backport to 2.5)
  ........
    r53253 | gregory.p.smith | 2007-01-05 03:06:17 +0100 (Fri, 05 Jan 2007) | 2 lines
    
    bump module version to match supported berkeleydb version
  ........
    r53255 | neal.norwitz | 2007-01-05 06:25:22 +0100 (Fri, 05 Jan 2007) | 6 lines
    
    Prevent crash on shutdown which can occur if we are finalizing
    and the module dict has been cleared already and some object
    raises a warning (like in a __del__).
    
    Will backport.
  ........
    r53258 | gregory.p.smith | 2007-01-05 08:21:35 +0100 (Fri, 05 Jan 2007) | 2 lines
    
    typo fix
  ........
    r53260 | neal.norwitz | 2007-01-05 09:06:43 +0100 (Fri, 05 Jan 2007) | 1 line
    
    Add Collin Winter for access to update PEP 3107
  ........
    r53262 | andrew.kuchling | 2007-01-05 15:22:17 +0100 (Fri, 05 Jan 2007) | 1 line
    
    [Bug #1622533] Make docstrings raw strings because they contain control characters (\0, \1)
  ........
    r53264 | andrew.kuchling | 2007-01-05 16:51:24 +0100 (Fri, 05 Jan 2007) | 1 line
    
    [Patch #1520904] Fix bsddb tests to write to the temp directory instead of the Lib/bsddb/test directory
  ........
    r53279 | brett.cannon | 2007-01-05 22:45:09 +0100 (Fri, 05 Jan 2007) | 3 lines
    
    Silence a warning from gcc 4.0.1 by specifying a function's parameter list is
    'void' instead of just a set of empty parentheses.
  ........
    r53285 | raymond.hettinger | 2007-01-06 02:14:41 +0100 (Sat, 06 Jan 2007) | 2 lines
    
    SF# 1409443:  Expand comment to cover the interaction between f->f_lasti and the PREDICT macros.
  ........
    r53286 | anthony.baxter | 2007-01-06 05:45:54 +0100 (Sat, 06 Jan 2007) | 1 line
    
    update to (c) years to include 2007
  ........
    r53291 | neal.norwitz | 2007-01-06 22:24:35 +0100 (Sat, 06 Jan 2007) | 1 line
    
    Add Josiah to SF for maintaining asyncore/asynchat
  ........
    r53293 | peter.astrand | 2007-01-07 09:53:46 +0100 (Sun, 07 Jan 2007) | 1 line
    
    Re-implemented fix for #1531862 once again, in a way that works with Python 2.2. Fixes bug #1603424.
  ........
    r53295 | peter.astrand | 2007-01-07 15:34:16 +0100 (Sun, 07 Jan 2007) | 1 line
    
    Avoid O(N**2) bottleneck in _communicate_(). Fixes #1598181.
  ........
    r53300 | raymond.hettinger | 2007-01-08 19:09:20 +0100 (Mon, 08 Jan 2007) | 1 line
    
    Fix zero-length corner case for iterating over a mutating deque.
  ........
    r53301 | vinay.sajip | 2007-01-08 19:50:32 +0100 (Mon, 08 Jan 2007) | 4 lines
    
    Bare except clause removed from SMTPHandler.emit(). Now, only ImportError is trapped.
    Bare except clause removed from SocketHandler.createSocket(). Now, only socket.error is trapped.
    (SF #411881)
  ........
    r53302 | vinay.sajip | 2007-01-08 19:51:46 +0100 (Mon, 08 Jan 2007) | 2 lines
    
    Bare except clause removed from LogRecord.__init__. Now, only ValueError, TypeError and AttributeError are trapped.
    (SF #411881)
  ........
    r53303 | vinay.sajip | 2007-01-08 19:52:36 +0100 (Mon, 08 Jan 2007) | 1 line
    
    Added entries about removal of some bare except clauses from logging.
  ........
................




Modified: python/branches/p3yk-noslice/Doc/README
==============================================================================
--- python/branches/p3yk-noslice/Doc/README	(original)
+++ python/branches/p3yk-noslice/Doc/README	Thu Jan 11 00:21:28 2007
@@ -229,7 +229,7 @@
 as long as you don't change or remove the copyright notice:
 
 ----------------------------------------------------------------------
-Copyright (c) 2000-2006 Python Software Foundation.
+Copyright (c) 2000-2007 Python Software Foundation.
 All rights reserved.
 
 Copyright (c) 2000 BeOpen.com.

Modified: python/branches/p3yk-noslice/Doc/api/newtypes.tex
==============================================================================
--- python/branches/p3yk-noslice/Doc/api/newtypes.tex	(original)
+++ python/branches/p3yk-noslice/Doc/api/newtypes.tex	Thu Jan 11 00:21:28 2007
@@ -103,8 +103,6 @@
                   the value for the \var{methods} argument]{2.3}
 \end{cfuncdesc}
 
-DL_IMPORT
-
 \begin{cvardesc}{PyObject}{_Py_NoneStruct}
   Object which is visible in Python as \code{None}.  This should only
   be accessed using the \code{Py_None} macro, which evaluates to a

Modified: python/branches/p3yk-noslice/Doc/howto/functional.rst
==============================================================================
--- python/branches/p3yk-noslice/Doc/howto/functional.rst	(original)
+++ python/branches/p3yk-noslice/Doc/howto/functional.rst	Thu Jan 11 00:21:28 2007
@@ -1398,10 +1398,10 @@
 '''''''''''''''''''''''''''
 
 http://docs.python.org/lib/module-itertools.html:
-Documentation ``for the itertools`` module.
+Documentation for the ``itertools`` module.
 
 http://docs.python.org/lib/module-operator.html:
-Documentation ``for the operator`` module.
+Documentation for the ``operator`` module.
 
 http://www.python.org/dev/peps/pep-0289/:
 PEP 289: "Generator Expressions"

Modified: python/branches/p3yk-noslice/Doc/html/style.css
==============================================================================
--- python/branches/p3yk-noslice/Doc/html/style.css	(original)
+++ python/branches/p3yk-noslice/Doc/html/style.css	Thu Jan 11 00:21:28 2007
@@ -99,6 +99,9 @@
 div.note .label         { margin-right: 0.5em;
                           font-family: sans-serif; }
 
+.versionnote1           { display: none; }
+.versionnote2           { display: none; }
+
 address                 { font-size: 80%; }
 .release-info           { font-style: italic;
                           font-size: 80%; }

Modified: python/branches/p3yk-noslice/Doc/lib/libbsddb.tex
==============================================================================
--- python/branches/p3yk-noslice/Doc/lib/libbsddb.tex	(original)
+++ python/branches/p3yk-noslice/Doc/lib/libbsddb.tex	Thu Jan 11 00:21:28 2007
@@ -16,7 +16,7 @@
 \function{pickle.dumps()}.
 
 The \module{bsddb} module requires a Berkeley DB library version from
-3.3 thru 4.4.
+3.3 thru 4.5.
 
 \begin{seealso}
   \seeurl{http://pybsddb.sourceforge.net/}

Modified: python/branches/p3yk-noslice/Doc/lib/libbz2.tex
==============================================================================
--- python/branches/p3yk-noslice/Doc/lib/libbz2.tex	(original)
+++ python/branches/p3yk-noslice/Doc/lib/libbz2.tex	Thu Jan 11 00:21:28 2007
@@ -81,10 +81,10 @@
 
 \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,
-offset should be \code{>= 0}); other values are \code{1} (move relative to
-current position, positive or negative), and \code{2} (move relative to end
-of file, usually negative, although many platforms allow seeking beyond
+argument \var{whence} defaults to \code{os.SEEK_SET} or \code{0} (offset from start of file;
+offset should be \code{>= 0}); other values are \code{os.SEEK_CUR} or \code{1} (move relative to
+current position; offset can be positive or negative), and \code{os.SEEK_END} or \code{2} (move relative to end
+of file; offset is usually negative, although many platforms allow seeking beyond
 the end of a file).
 
 Note that seeking of bz2 files is emulated, and depending on the parameters

Modified: python/branches/p3yk-noslice/Doc/lib/libctypes.tex
==============================================================================
--- python/branches/p3yk-noslice/Doc/lib/libctypes.tex	(original)
+++ python/branches/p3yk-noslice/Doc/lib/libctypes.tex	Thu Jan 11 00:21:28 2007
@@ -2085,10 +2085,10 @@
 the type.  Some types accept other objects as well.
 \end{methoddesc}
 
-\begin{methoddesc}{in_dll}{name, library}
+\begin{methoddesc}{in_dll}{library, name}
 This method returns a ctypes type instance exported by a shared
 library. \var{name} is the name of the symbol that exports the data,
-\code{library} is the loaded shared library.
+\var{library} is the loaded shared library.
 \end{methoddesc}
 
 Common instance variables of ctypes data types:

Modified: python/branches/p3yk-noslice/Doc/lib/libfuncs.tex
==============================================================================
--- python/branches/p3yk-noslice/Doc/lib/libfuncs.tex	(original)
+++ python/branches/p3yk-noslice/Doc/lib/libfuncs.tex	Thu Jan 11 00:21:28 2007
@@ -237,11 +237,11 @@
   \code{del \var{x}.\var{foobar}}.
 \end{funcdesc}
 
-\begin{funcdesc}{dict}{\optional{mapping-or-sequence}}
+\begin{funcdesc}{dict}{\optional{arg}}
   Return a new dictionary initialized from an optional positional
   argument or from a set of keyword arguments.
   If no arguments are given, return a new empty dictionary.
-  If the positional argument is a mapping object, return a dictionary
+  If the positional argument \var{arg} is a mapping object, return a dictionary
   mapping the same keys to the same values as does the mapping object.
   Otherwise the positional argument must be a sequence, a container that
   supports iteration, or an iterator object.  The elements of the argument
@@ -448,18 +448,18 @@
   \versionadded{2.2}
 \end{funcdesc}
 
-\begin{funcdesc}{filter}{function, list}
-  Construct a list from those elements of \var{list} for which
-  \var{function} returns true.  \var{list} may be either a sequence, a
-  container which supports iteration, or an iterator,  If \var{list}
+\begin{funcdesc}{filter}{function, iterable}
+  Construct a list from those elements of \var{iterable} for which
+  \var{function} returns true.  \var{iterable} may be either a sequence, a
+  container which supports iteration, or an iterator,  If \var{iterable}
   is a string or a tuple, the result
   also has that type; otherwise it is always a list.  If \var{function} is
   \code{None}, the identity function is assumed, that is, all elements of
-  \var{list} that are false are removed.
+  \var{iterable} that are false are removed.
 
-  Note that \code{filter(function, \var{list})} is equivalent to
-  \code{[item for item in \var{list} if function(item)]} if function is
-  not \code{None} and \code{[item for item in \var{list} if item]} if
+  Note that \code{filter(function, \var{iterable})} is equivalent to
+  \code{[item for item in \var{iterable} if function(item)]} if function is
+  not \code{None} and \code{[item for item in \var{iterable} if item]} if
   function is \code{None}.
 \end{funcdesc}
 
@@ -608,12 +608,12 @@
   may be a sequence (string, tuple or list) or a mapping (dictionary).
 \end{funcdesc}
 
-\begin{funcdesc}{list}{\optional{sequence}}
+\begin{funcdesc}{list}{\optional{iterable}}
   Return a list whose items are the same and in the same order as
-  \var{sequence}'s items.  \var{sequence} may be either a sequence, a
+  \var{iterable}'s items.  \var{iterable} may be either a sequence, a
   container that supports iteration, or an iterator object.  If
-  \var{sequence} is already a list, a copy is made and returned,
-  similar to \code{\var{sequence}[:]}.  For instance,
+  \var{iterable} is already a list, a copy is made and returned,
+  similar to \code{\var{iterable}[:]}.  For instance,
   \code{list('abc')} returns \code{['a', 'b', 'c']} and \code{list(
   (1, 2, 3) )} returns \code{[1, 2, 3]}.  If no argument is given,
   returns a new empty list, \code{[]}.
@@ -639,22 +639,22 @@
   are given, returns \code{0L}.
 \end{funcdesc}
 
-\begin{funcdesc}{map}{function, list, ...}
-  Apply \var{function} to every item of \var{list} and return a list
-  of the results.  If additional \var{list} arguments are passed,
+\begin{funcdesc}{map}{function, iterable, ...}
+  Apply \var{function} to every item of \var{iterable} and return a list
+  of the results.  If additional \var{iterable} arguments are passed,
   \var{function} must take that many arguments and is applied to the
-  items of all lists in parallel; if a list is shorter than another it
+  items from all iterables in parallel.  If one iterable is shorter than another it
   is assumed to be extended with \code{None} items.  If \var{function}
   is \code{None}, the identity function is assumed; if there are
-  multiple list arguments, \function{map()} returns a list consisting
-  of tuples containing the corresponding items from all lists (a kind
-  of transpose operation).  The \var{list} arguments may be any kind
-  of sequence; the result is always a list.
+  multiple arguments, \function{map()} returns a list consisting
+  of tuples containing the corresponding items from all iterables (a kind
+  of transpose operation).  The \var{iterable} arguments may be a sequence 
+  or any iterable object; the result is always a list.
 \end{funcdesc}
 
-\begin{funcdesc}{max}{s\optional{, args...}\optional{key}}
-  With a single argument \var{s}, return the largest item of a
-  non-empty sequence (such as a string, tuple or list).  With more
+\begin{funcdesc}{max}{iterable\optional{, args...}\optional{key}}
+  With a single argument \var{iterable}, return the largest item of a
+  non-empty iterable (such as a string, tuple or list).  With more
   than one argument, return the largest of the arguments.
 
   The optional \var{key} argument specifies a one-argument ordering
@@ -664,16 +664,16 @@
   \versionchanged[Added support for the optional \var{key} argument]{2.5}
 \end{funcdesc}
 
-\begin{funcdesc}{min}{s\optional{, args...}\optional{key}}
-  With a single argument \var{s}, return the smallest item of a
-  non-empty sequence (such as a string, tuple or list).  With more
+\begin{funcdesc}{min}{iterable\optional{, args...}\optional{key}}
+  With a single argument \var{iterable}, return the smallest item of a
+  non-empty iterable (such as a string, tuple or list).  With more
   than one argument, return the smallest of the arguments.
 
   The optional \var{key} argument specifies a one-argument ordering
   function like that used for \method{list.sort()}.  The \var{key}
   argument, if supplied, must be in keyword form (for example,
   \samp{min(a,b,c,key=func)}).
-  \versionchanged[Added support for the optional \var{key} argument]{2.5}           
+  \versionchanged[Added support for the optional \var{key} argument]{2.5}
 \end{funcdesc}
 
 \begin{funcdesc}{object}{}
@@ -1073,11 +1073,11 @@
   string, \code{''}.
 \end{funcdesc}
 
-\begin{funcdesc}{sum}{sequence\optional{, start}}
-  Sums \var{start} and the items of a \var{sequence}, from left to
-  right, and returns the total.  \var{start} defaults to \code{0}.
-  The \var{sequence}'s items are normally numbers, and are not allowed
-  to be strings.  The fast, correct way to concatenate sequence of
+\begin{funcdesc}{sum}{iterable\optional{, start}}
+  Sums \var{start} and the items of an \var{iterable} from left to
+  right and returns the total.  \var{start} defaults to \code{0}.
+  The \var{iterable}'s items are normally numbers, and are not allowed
+  to be strings.  The fast, correct way to concatenate a sequence of
   strings is by calling \code{''.join(\var{sequence})}.
   \versionadded{2.3}
 \end{funcdesc}
@@ -1105,11 +1105,11 @@
 \versionadded{2.2}
 \end{funcdesc}
 
-\begin{funcdesc}{tuple}{\optional{sequence}}
+\begin{funcdesc}{tuple}{\optional{iterable}}
   Return a tuple whose items are the same and in the same order as
-  \var{sequence}'s items.  \var{sequence} may be a sequence, a
+  \var{iterable}'s items.  \var{iterable} may be a sequence, a
   container that supports iteration, or an iterator object.
-  If \var{sequence} is already a tuple, it
+  If \var{iterable} is already a tuple, it
   is returned unchanged.  For instance, \code{tuple('abc')} returns
   \code{('a', 'b', 'c')} and \code{tuple([1, 2, 3])} returns
   \code{(1, 2, 3)}.  If no argument is given, returns a new empty
@@ -1262,17 +1262,3 @@
   argument).
 \end{funcdesc}
 
-\begin{funcdesc}{intern}{string}
-  Enter \var{string} in the table of ``interned'' strings and return
-  the interned string -- which is \var{string} itself or a copy.
-  Interning strings is useful to gain a little performance on
-  dictionary lookup -- if the keys in a dictionary are interned, and
-  the lookup key is interned, the key comparisons (after hashing) can
-  be done by a pointer compare instead of a string compare.  Normally,
-  the names used in Python programs are automatically interned, and
-  the dictionaries used to hold module, class or instance attributes
-  have interned keys.  \versionchanged[Interned strings are not
-  immortal (like they used to be in Python 2.2 and before);
-  you must keep a reference to the return value of \function{intern()}
-  around to benefit from it]{2.3}
-\end{funcdesc}

Modified: python/branches/p3yk-noslice/Doc/lib/liblogging.tex
==============================================================================
--- python/branches/p3yk-noslice/Doc/lib/liblogging.tex	(original)
+++ python/branches/p3yk-noslice/Doc/lib/liblogging.tex	Thu Jan 11 00:21:28 2007
@@ -516,8 +516,10 @@
 \end{methoddesc}
 
 \begin{methoddesc}{findCaller}{}
-Finds the caller's source filename and line number. Returns the filename
-and line number as a 2-element tuple.
+Finds the caller's source filename and line number. Returns the filename,
+line number and function name as a 3-element tuple.
+\versionchanged[The function name was added. In earlier versions, the
+filename and line number were returned as a 2-element tuple.]{2.5}
 \end{methoddesc}
 
 \begin{methoddesc}{handle}{record}

Modified: python/branches/p3yk-noslice/Doc/lib/libmmap.tex
==============================================================================
--- python/branches/p3yk-noslice/Doc/lib/libmmap.tex	(original)
+++ python/branches/p3yk-noslice/Doc/lib/libmmap.tex	Thu Jan 11 00:21:28 2007
@@ -140,8 +140,9 @@
 
 \begin{methoddesc}{seek}{pos\optional{, whence}}
   Set the file's current position.  \var{whence} argument is optional
-  and defaults to \code{0} (absolute file positioning); other values
-  are \code{1} (seek relative to the current position) and \code{2}
+  and defaults to \code{os.SEEK_SET} or \code{0} (absolute file
+  positioning); other values are \code{os.SEEK_CUR} or \code{1} (seek
+  relative to the current position) and \code{os.SEEK_END} or \code{2}
   (seek relative to the file's end).
 \end{methoddesc}
 

Modified: python/branches/p3yk-noslice/Doc/lib/libsimplexmlrpc.tex
==============================================================================
--- python/branches/p3yk-noslice/Doc/lib/libsimplexmlrpc.tex	(original)
+++ python/branches/p3yk-noslice/Doc/lib/libsimplexmlrpc.tex	Thu Jan 11 00:21:28 2007
@@ -15,7 +15,7 @@
 
 \begin{classdesc}{SimpleXMLRPCServer}{addr\optional{,
                                       requestHandler\optional{,
-					logRequests\optional{allow_none\optional{, encoding}}}}}
+					logRequests\optional{, allow_none\optional{, encoding}}}}}
 
   Create a new server instance.  This class
   provides methods for registration of functions that can be called by

Modified: python/branches/p3yk-noslice/Doc/lib/libsocket.tex
==============================================================================
--- python/branches/p3yk-noslice/Doc/lib/libsocket.tex	(original)
+++ python/branches/p3yk-noslice/Doc/lib/libsocket.tex	Thu Jan 11 00:21:28 2007
@@ -569,11 +569,32 @@
 Receive data from the socket.  The return value is a pair
 \code{(\var{string}, \var{address})} where \var{string} is a string
 representing the data received and \var{address} is the address of the
-socket sending the data.  The optional \var{flags} argument has the
-same meaning as for \method{recv()} above.
+socket sending the data.  See the \UNIX{} manual page
+\manpage{recv}{2} for the meaning of the optional argument
+\var{flags}; it defaults to zero.
 (The format of \var{address} depends on the address family --- see above.)
 \end{methoddesc}
 
+\begin{methoddesc}[socket]{recvfrom_into}{buffer\optional{, nbytes\optional{, flags}}}
+Receive data from the socket, writing it into \var{buffer} instead of 
+creating a new string.  The return value is a pair
+\code{(\var{nbytes}, \var{address})} where \var{nbytes} is the number
+of bytes received and \var{address} is the address of the socket
+sending the data.  See the \UNIX{} manual page
+\manpage{recv}{2} for the meaning of the optional argument
+\var{flags}; it defaults to zero.  (The format of \var{address}
+depends on the address family --- see above.)
+\end{methoddesc}
+
+\begin{methoddesc}[socket]{recv_into}{buffer\optional{, nbytes\optional{, flags}}}
+Receive up to \var{nbytes} bytes from the socket,
+storing the data into a buffer rather than creating a new string.    
+If \var{nbytes} is not specified (or 0), 
+receive up to the size available in the given buffer.
+See the \UNIX{} manual page \manpage{recv}{2} for the meaning of the
+optional argument \var{flags}; it defaults to zero.
+\end{methoddesc}
+
 \begin{methoddesc}[socket]{send}{string\optional{, flags}}
 Send data to the socket.  The socket must be connected to a remote
 socket.  The optional \var{flags} argument has the same meaning as for

Modified: python/branches/p3yk-noslice/Doc/lib/libsqlite3.tex
==============================================================================
--- python/branches/p3yk-noslice/Doc/lib/libsqlite3.tex	(original)
+++ python/branches/p3yk-noslice/Doc/lib/libsqlite3.tex	Thu Jan 11 00:21:28 2007
@@ -187,12 +187,12 @@
 \end{funcdesc}
 
 \begin{funcdesc}{complete_statement}{sql}
-Returns \constant{True} if the string \var{sql} one or more complete SQL
-statements terminated by semicolons. It does not verify if the SQL is
-syntactically correct, only if there are no unclosed string literals and if the
+Returns \constant{True} if the string \var{sql} contains one or more complete SQL
+statements terminated by semicolons. It does not verify that the SQL is
+syntactically correct, only that there are no unclosed string literals and the
 statement is terminated by a semicolon.
 
-This can be used to build a shell for SQLite, like in the following example:
+This can be used to build a shell for SQLite, as in the following example:
 
     \verbatiminput{sqlite3/complete_statement.py}
 \end{funcdesc}

Modified: python/branches/p3yk-noslice/Doc/lib/libstdtypes.tex
==============================================================================
--- python/branches/p3yk-noslice/Doc/lib/libstdtypes.tex	(original)
+++ python/branches/p3yk-noslice/Doc/lib/libstdtypes.tex	Thu Jan 11 00:21:28 2007
@@ -1660,9 +1660,12 @@
 
 \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}
-  (absolute file positioning); other values are \code{1} (seek
-  relative to the current position) and \code{2} (seek relative to the
+  The \var{whence} argument is optional and defaults to 
+  \code{os.SEEK_SET} or \code{0}
+  (absolute file positioning); other values are \code{os.SEEK_CUR} or \code{1}
+  (seek
+  relative to the current position) and \code{os.SEEK_END} or \code{2} 
+  (seek relative to the
   file's end).  There is no return value.  Note that if the file is
   opened for appending (mode \code{'a'} or \code{'a+'}), any
   \method{seek()} operations will be undone at the next write.  If the

Modified: python/branches/p3yk-noslice/Doc/lib/libsys.tex
==============================================================================
--- python/branches/p3yk-noslice/Doc/lib/libsys.tex	(original)
+++ python/branches/p3yk-noslice/Doc/lib/libsys.tex	Thu Jan 11 00:21:28 2007
@@ -340,6 +340,21 @@
   \versionadded{1.5.2}
 \end{datadesc}
 
+\begin{funcdesc}{intern}{string}
+  Enter \var{string} in the table of ``interned'' strings and return
+  the interned string -- which is \var{string} itself or a copy.
+  Interning strings is useful to gain a little performance on
+  dictionary lookup -- if the keys in a dictionary are interned, and
+  the lookup key is interned, the key comparisons (after hashing) can
+  be done by a pointer compare instead of a string compare.  Normally,
+  the names used in Python programs are automatically interned, and
+  the dictionaries used to hold module, class or instance attributes
+  have interned keys.  \versionchanged[Interned strings are not
+  immortal (like they used to be in Python 2.2 and before);
+  you must keep a reference to the return value of \function{intern()}
+  around to benefit from it]{2.3}
+\end{funcdesc}
+
 \begin{datadesc}{last_type}
 \dataline{last_value}
 \dataline{last_traceback}

Modified: python/branches/p3yk-noslice/Doc/lib/libtarfile.tex
==============================================================================
--- python/branches/p3yk-noslice/Doc/lib/libtarfile.tex	(original)
+++ python/branches/p3yk-noslice/Doc/lib/libtarfile.tex	Thu Jan 11 00:21:28 2007
@@ -124,6 +124,11 @@
     only if \member{TarFile.errorlevel}\code{ == 2}.
 \end{excdesc}
 
+\begin{excdesc}{HeaderError}
+    Is raised by \method{frombuf()} if the buffer it gets is invalid.
+    \versionadded{2.6}
+\end{excdesc}
+
 \begin{seealso}
     \seemodule{zipfile}{Documentation of the \refmodule{zipfile}
     standard module.}
@@ -332,6 +337,8 @@
 
 \begin{methoddesc}{frombuf}{}
     Create and return a \class{TarInfo} object from a string buffer.
+    \versionadded[Raises \exception{HeaderError} if the buffer is
+    invalid.]{2.6}
 \end{methoddesc}
 
 \begin{methoddesc}{tobuf}{posix}

Modified: python/branches/p3yk-noslice/Doc/lib/libtest.tex
==============================================================================
--- python/branches/p3yk-noslice/Doc/lib/libtest.tex	(original)
+++ python/branches/p3yk-noslice/Doc/lib/libtest.tex	Thu Jan 11 00:21:28 2007
@@ -263,6 +263,12 @@
 This does not equal a failure since it could be the path to the file.
 \end{funcdesc}
 
+\begin{funcdesc}{guard_warnings_filter}{}
+Returns a context manager that guards the \module{warnings} module's
+filter settings.
+\versionadded{2.6}
+\end{funcdesc}
+
 \begin{funcdesc}{run_unittest}{*classes}
 Execute \class{unittest.TestCase} subclasses passed to the function.
 The function scans the classes for methods starting with the prefix
@@ -275,4 +281,22 @@
 The optional argument \var{testclass} accepts one of the test classes in the
 suite so as to print out more detailed information on where the testing suite
 originated from.
+
+The \module{test.test_support} module defines the following classes:
+
+\begin{classdesc}{EnvironmentVarGuard}{}
+Class used to temporarily set or unset environment variables.  Instances can be
+used as a context manager.
+\versionadded{2.6}
+\end{classdesc}
+
+\begin{methoddesc}{set}{envvar, value}
+Temporarily set the environment variable \code{envvar} to the value of
+\code{value}.
+\end{methoddesc}
+
+\begin{methoddesc}{unset}{envvar}
+Temporarily unset the environment variable \code{envvar}.
+\end{methoddesc}
+
 \end{funcdesc}

Modified: python/branches/p3yk-noslice/Doc/lib/liburlparse.tex
==============================================================================
--- python/branches/p3yk-noslice/Doc/lib/liburlparse.tex	(original)
+++ python/branches/p3yk-noslice/Doc/lib/liburlparse.tex	Thu Jan 11 00:21:28 2007
@@ -89,7 +89,7 @@
 
 \begin{funcdesc}{urlunparse}{parts}
 Construct a URL from a tuple as returned by \code{urlparse()}.
-The \var{parts} argument be any six-item iterable.
+The \var{parts} argument can be any six-item iterable.
 This may result in a slightly different, but equivalent URL, if the
 URL that was parsed originally had unnecessary delimiters (for example,
 a ? with an empty query; the RFC states that these are equivalent).
@@ -133,7 +133,7 @@
 \begin{funcdesc}{urlunsplit}{parts}
 Combine the elements of a tuple as returned by \function{urlsplit()}
 into a complete URL as a string.
-The \var{parts} argument be any five-item iterable.
+The \var{parts} argument can be any five-item iterable.
 This may result in a slightly different, but equivalent URL, if the
 URL that was parsed originally had unnecessary delimiters (for example,
 a ? with an empty query; the RFC states that these are equivalent).

Modified: python/branches/p3yk-noslice/Doc/mac/toolbox.tex
==============================================================================
--- python/branches/p3yk-noslice/Doc/mac/toolbox.tex	(original)
+++ python/branches/p3yk-noslice/Doc/mac/toolbox.tex	Thu Jan 11 00:21:28 2007
@@ -65,7 +65,7 @@
 \modulesynopsis{Interface to the Component Manager.}
 
 \section{\module{Carbon.CarbonEvt} --- Carbon Event Manager}
-\declaremodule{standard}{Carbon.CaronEvt}
+\declaremodule{standard}{Carbon.CarbonEvt}
   \platform{Mac}
 \modulesynopsis{Interface to the Carbon Event Manager.}
 

Modified: python/branches/p3yk-noslice/Doc/perl/python.perl
==============================================================================
--- python/branches/p3yk-noslice/Doc/perl/python.perl	(original)
+++ python/branches/p3yk-noslice/Doc/perl/python.perl	Thu Jan 11 00:21:28 2007
@@ -422,11 +422,15 @@
     local $_ = $_[1];
     my $explanation = next_optional_argument();
     my $release = next_argument();
+    my $classes = "versionnote";
+    if ($release =~ /^(\d+)\./) {
+        $classes .= " versionnote$1";
+    }
     my $text = "$type in version $release.";
     if ($explanation) {
         $text = "$type in version $release:\n$explanation.";
     }
-    return "\n<span class=\"versionnote\">$text</span>\n" . $_;
+    return "\n<span class=\"$classes\"  \n>$text</span>\n" . $_;
 }
 
 sub do_cmd_versionadded{

Modified: python/branches/p3yk-noslice/Doc/tut/tut.tex
==============================================================================
--- python/branches/p3yk-noslice/Doc/tut/tut.tex	(original)
+++ python/branches/p3yk-noslice/Doc/tut/tut.tex	Thu Jan 11 00:21:28 2007
@@ -2700,7 +2700,7 @@
  'complex', 'copyright', 'credits', 'delattr', 'dict', 'dir', 'divmod',
  'enumerate', 'eval', 'exec', 'execfile', 'exit', 'file', 'filter', 'float',
  'frozenset', 'getattr', 'globals', 'hasattr', 'hash', 'help', 'hex',
- 'id', 'int', 'intern', 'isinstance', 'issubclass', 'iter',
+ 'id', 'int', 'isinstance', 'issubclass', 'iter',
  'len', 'license', 'list', 'locals', 'long', 'map', 'max', 'min',
  'object', 'oct', 'open', 'ord', 'pow', 'property', 'quit', 'range',
  'reload', 'repr', 'reversed', 'round', 'set',

Modified: python/branches/p3yk-noslice/Doc/whatsnew/whatsnew25.tex
==============================================================================
--- python/branches/p3yk-noslice/Doc/whatsnew/whatsnew25.tex	(original)
+++ python/branches/p3yk-noslice/Doc/whatsnew/whatsnew25.tex	Thu Jan 11 00:21:28 2007
@@ -5,7 +5,7 @@
 % Fix XXX comments
 
 \title{What's New in Python 2.5}
-\release{1.0}
+\release{1.01}
 \author{A.M. Kuchling}
 \authoraddress{\email{amk at amk.ca}}
 
@@ -556,13 +556,14 @@
   where the generator's execution is paused.
 
   \item \method{close()} raises a new \exception{GeneratorExit}
-  exception inside the generator to terminate the iteration.  
-  On receiving this
-  exception, the generator's code must either raise
-  \exception{GeneratorExit} or \exception{StopIteration}; catching the 
-  exception and doing anything else is illegal and will trigger
-  a \exception{RuntimeError}.  \method{close()} will also be called by 
-  Python's garbage collector when the generator is garbage-collected.
+  exception inside the generator to terminate the iteration.  On
+  receiving this exception, the generator's code must either raise
+  \exception{GeneratorExit} or \exception{StopIteration}.  Catching
+  the \exception{GeneratorExit} exception and returning a value is
+  illegal and will trigger a \exception{RuntimeError}; if the function
+  raises some other exception, that exception is propagated to the
+  caller.  \method{close()} will also be called by Python's garbage
+  collector when the generator is garbage-collected.
 
   If you need to run cleanup code when a \exception{GeneratorExit} occurs,
   I suggest using a \code{try: ... finally:} suite instead of 
@@ -1663,6 +1664,13 @@
 \item The \module{pyexpat} module now uses version 2.0 of the Expat parser.
 (Contributed by Trent Mick.)
 
+\item The \class{Queue} class provided by the \module{Queue} module
+gained two new methods.  \method{join()} blocks until all items in
+the queue have been retrieved and all processing work on the items 
+have been completed.  Worker threads call the other new method, 
+\method{task_done()}, to signal that processing for an item has been
+completed.  (Contributed by Raymond Hettinger.)
+
 \item The old \module{regex} and \module{regsub} modules, which have been 
 deprecated ever since Python 2.0, have finally been deleted.  
 Other deleted modules: \module{statcache}, \module{tzparse},

Modified: python/branches/p3yk-noslice/Grammar/Grammar
==============================================================================
--- python/branches/p3yk-noslice/Grammar/Grammar	(original)
+++ python/branches/p3yk-noslice/Grammar/Grammar	Thu Jan 11 00:21:28 2007
@@ -21,13 +21,20 @@
 
 decorator: '@' dotted_name [ '(' [arglist] ')' ] NEWLINE
 decorators: decorator+
-funcdef: [decorators] 'def' NAME parameters ':' suite
-parameters: '(' [varargslist] ')'
-varargslist: ((fpdef ['=' test] ',')*
-              ('*' [NAME] (',' NAME ['=' test])*  [',' '**' NAME] | '**' NAME) |
-              fpdef ['=' test] (',' fpdef ['=' test])* [','])
-fpdef: NAME | '(' fplist ')'
-fplist: fpdef (',' fpdef)* [',']
+funcdef: [decorators] 'def' NAME parameters ['->' test] ':' suite
+parameters: '(' [typedargslist] ')'
+typedargslist: ((tfpdef ['=' test] ',')*
+                ('*' [tname] (',' tname ['=' test])* [',' '**' tname] | '**' tname)
+                | tfpdef ['=' test] (',' tfpdef ['=' test])* [','])
+tname: NAME [':' test]
+tfpdef: tname | '(' tfplist ')'
+tfplist: tfpdef (',' tfpdef)* [',']
+varargslist: ((vfpdef ['=' test] ',')*
+              ('*' [vname] (',' vname ['=' test])*  [',' '**' vname] | '**' vname)
+              | vfpdef ['=' test] (',' vfpdef ['=' test])* [','])
+vname: NAME
+vfpdef: vname | '(' vfplist ')'
+vfplist: vfpdef (',' vfpdef)* [',']
 
 stmt: simple_stmt | compound_stmt
 simple_stmt: small_stmt (';' small_stmt)* [';'] NEWLINE

Modified: python/branches/p3yk-noslice/Include/Python-ast.h
==============================================================================
--- python/branches/p3yk-noslice/Include/Python-ast.h	(original)
+++ python/branches/p3yk-noslice/Include/Python-ast.h	Thu Jan 11 00:21:28 2007
@@ -30,6 +30,8 @@
 
 typedef struct _arguments *arguments_ty;
 
+typedef struct _arg *arg_ty;
+
 typedef struct _keyword *keyword_ty;
 
 typedef struct _alias *alias_ty;
@@ -74,6 +76,7 @@
                         arguments_ty args;
                         asdl_seq *body;
                         asdl_seq *decorators;
+                        expr_ty returns;
                 } FunctionDef;
                 
                 struct {
@@ -328,12 +331,30 @@
 struct _arguments {
         asdl_seq *args;
         identifier vararg;
+        expr_ty varargannotation;
         asdl_seq *kwonlyargs;
         identifier kwarg;
+        expr_ty kwargannotation;
         asdl_seq *defaults;
         asdl_seq *kw_defaults;
 };
 
+enum _arg_kind {SimpleArg_kind=1, NestedArgs_kind=2};
+struct _arg {
+        enum _arg_kind kind;
+        union {
+                struct {
+                        identifier arg;
+                        expr_ty annotation;
+                } SimpleArg;
+                
+                struct {
+                        asdl_seq *args;
+                } NestedArgs;
+                
+        } v;
+};
+
 struct _keyword {
         identifier arg;
         expr_ty value;
@@ -350,8 +371,8 @@
 mod_ty Expression(expr_ty body, PyArena *arena);
 mod_ty Suite(asdl_seq * body, PyArena *arena);
 stmt_ty FunctionDef(identifier name, arguments_ty args, asdl_seq * body,
-                    asdl_seq * decorators, int lineno, int col_offset, PyArena
-                    *arena);
+                    asdl_seq * decorators, expr_ty returns, int lineno, int
+                    col_offset, PyArena *arena);
 stmt_ty ClassDef(identifier name, asdl_seq * bases, asdl_seq * body, int
                  lineno, int col_offset, PyArena *arena);
 stmt_ty Return(expr_ty value, int lineno, int col_offset, PyArena *arena);
@@ -429,9 +450,12 @@
                                PyArena *arena);
 excepthandler_ty excepthandler(expr_ty type, expr_ty name, asdl_seq * body, int
                                lineno, int col_offset, PyArena *arena);
-arguments_ty arguments(asdl_seq * args, identifier vararg, asdl_seq *
-                       kwonlyargs, identifier kwarg, asdl_seq * defaults,
+arguments_ty arguments(asdl_seq * args, identifier vararg, expr_ty
+                       varargannotation, asdl_seq * kwonlyargs, identifier
+                       kwarg, expr_ty kwargannotation, asdl_seq * defaults,
                        asdl_seq * kw_defaults, PyArena *arena);
+arg_ty SimpleArg(identifier arg, expr_ty annotation, PyArena *arena);
+arg_ty NestedArgs(asdl_seq * args, PyArena *arena);
 keyword_ty keyword(identifier arg, expr_ty value, PyArena *arena);
 alias_ty alias(identifier name, identifier asname, PyArena *arena);
 

Modified: python/branches/p3yk-noslice/Include/Python.h
==============================================================================
--- python/branches/p3yk-noslice/Include/Python.h	(original)
+++ python/branches/p3yk-noslice/Include/Python.h	Thu Jan 11 00:21:28 2007
@@ -48,14 +48,6 @@
 
 #include "pyport.h"
 
-/* pyconfig.h or pyport.h may or may not define DL_IMPORT */
-#ifndef DL_IMPORT	/* declarations for DLL import/export */
-#define DL_IMPORT(RTYPE) RTYPE
-#endif
-#ifndef DL_EXPORT	/* declarations for DLL import/export */
-#define DL_EXPORT(RTYPE) RTYPE
-#endif
-
 /* Debug-mode build with pymalloc implies PYMALLOC_DEBUG.
  *  PYMALLOC_DEBUG is in error if pymalloc is not in use.
  */

Modified: python/branches/p3yk-noslice/Include/floatobject.h
==============================================================================
--- python/branches/p3yk-noslice/Include/floatobject.h	(original)
+++ python/branches/p3yk-noslice/Include/floatobject.h	Thu Jan 11 00:21:28 2007
@@ -34,19 +34,6 @@
 PyAPI_FUNC(double) PyFloat_AsDouble(PyObject *);
 #define PyFloat_AS_DOUBLE(op) (((PyFloatObject *)(op))->ob_fval)
 
-/* Write repr(v) into the char buffer argument, followed by null byte.  The
-   buffer must be "big enough"; >= 100 is very safe.
-   PyFloat_AsReprString(buf, x) strives to print enough digits so that
-   PyFloat_FromString(buf) then reproduces x exactly. */
-PyAPI_FUNC(void) PyFloat_AsReprString(char*, PyFloatObject *v);
-
-/* Write str(v) into the char buffer argument, followed by null byte.  The
-   buffer must be "big enough"; >= 100 is very safe.  Note that it's
-   unusual to be able to get back the float you started with from
-   PyFloat_AsString's result -- use PyFloat_AsReprString() if you want to
-   preserve precision across conversions. */
-PyAPI_FUNC(void) PyFloat_AsString(char*, PyFloatObject *v);
-
 /* _PyFloat_{Pack,Unpack}{4,8}
  *
  * The struct and pickle (at least) modules need an efficient platform-
@@ -82,6 +69,11 @@
 PyAPI_FUNC(int) _PyFloat_Pack4(double x, unsigned char *p, int le);
 PyAPI_FUNC(int) _PyFloat_Pack8(double x, unsigned char *p, int le);
 
+/* Needed for the old way for marshal to store a floating point number.
+   Returns the string length copied into p, -1 on error.
+ */
+PyAPI_FUNC(int) _PyFloat_Repr(double x, char *p, size_t len);
+
 /* The unpack routines read 4 or 8 bytes, starting at p.  le is a bool
  * argument, true if the string is in little-endian format (exponent
  * last, at p+3 or p+7), false if big-endian (exponent first, at p).
@@ -93,7 +85,6 @@
 PyAPI_FUNC(double) _PyFloat_Unpack4(const unsigned char *p, int le);
 PyAPI_FUNC(double) _PyFloat_Unpack8(const unsigned char *p, int le);
 
-
 #ifdef __cplusplus
 }
 #endif

Modified: python/branches/p3yk-noslice/Include/funcobject.h
==============================================================================
--- python/branches/p3yk-noslice/Include/funcobject.h	(original)
+++ python/branches/p3yk-noslice/Include/funcobject.h	Thu Jan 11 00:21:28 2007
@@ -30,6 +30,7 @@
     PyObject *func_dict;	/* The __dict__ attribute, a dict or NULL */
     PyObject *func_weakreflist;	/* List of weak references */
     PyObject *func_module;	/* The __module__ attribute, can be anything */
+    PyObject *func_annotations;	/* Annotations, a dict or NULL */
 
     /* Invariant:
      *     func_closure contains the bindings for func_code->co_freevars, so
@@ -52,6 +53,8 @@
 PyAPI_FUNC(int) PyFunction_SetKwDefaults(PyObject *, PyObject *);
 PyAPI_FUNC(PyObject *) PyFunction_GetClosure(PyObject *);
 PyAPI_FUNC(int) PyFunction_SetClosure(PyObject *, PyObject *);
+PyAPI_FUNC(PyObject *) PyFunction_GetAnnotations(PyObject *);
+PyAPI_FUNC(int) PyFunction_SetAnnotations(PyObject *, PyObject *);
 
 /* Macros for direct access to these values. Type checks are *not*
    done, so use with care. */
@@ -67,6 +70,8 @@
 	(((PyFunctionObject *)func) -> func_kwdefaults)
 #define PyFunction_GET_CLOSURE(func) \
 	(((PyFunctionObject *)func) -> func_closure)
+#define PyFunction_GET_ANNOTATIONS(func) \
+	(((PyFunctionObject *)func) -> func_annotations)
 
 /* The classmethod and staticmethod types lives here, too */
 PyAPI_DATA(PyTypeObject) PyClassMethod_Type;

Modified: python/branches/p3yk-noslice/Include/graminit.h
==============================================================================
--- python/branches/p3yk-noslice/Include/graminit.h	(original)
+++ python/branches/p3yk-noslice/Include/graminit.h	Thu Jan 11 00:21:28 2007
@@ -5,79 +5,84 @@
 #define decorators 260
 #define funcdef 261
 #define parameters 262
-#define varargslist 263
-#define fpdef 264
-#define fplist 265
-#define stmt 266
-#define simple_stmt 267
-#define small_stmt 268
-#define expr_stmt 269
-#define augassign 270
-#define print_stmt 271
-#define del_stmt 272
-#define pass_stmt 273
-#define flow_stmt 274
-#define break_stmt 275
-#define continue_stmt 276
-#define return_stmt 277
-#define yield_stmt 278
-#define raise_stmt 279
-#define import_stmt 280
-#define import_name 281
-#define import_from 282
-#define import_as_name 283
-#define dotted_as_name 284
-#define import_as_names 285
-#define dotted_as_names 286
-#define dotted_name 287
-#define global_stmt 288
-#define assert_stmt 289
-#define compound_stmt 290
-#define if_stmt 291
-#define while_stmt 292
-#define for_stmt 293
-#define try_stmt 294
-#define with_stmt 295
-#define with_var 296
-#define except_clause 297
-#define suite 298
-#define testlist_safe 299
-#define old_test 300
-#define old_lambdef 301
-#define test 302
-#define or_test 303
-#define and_test 304
-#define not_test 305
-#define comparison 306
-#define comp_op 307
-#define expr 308
-#define xor_expr 309
-#define and_expr 310
-#define shift_expr 311
-#define arith_expr 312
-#define term 313
-#define factor 314
-#define power 315
-#define atom 316
-#define listmaker 317
-#define testlist_gexp 318
-#define lambdef 319
-#define trailer 320
-#define subscriptlist 321
-#define subscript 322
-#define sliceop 323
-#define exprlist 324
-#define testlist 325
-#define dictsetmaker 326
-#define classdef 327
-#define arglist 328
-#define argument 329
-#define list_iter 330
-#define list_for 331
-#define list_if 332
-#define gen_iter 333
-#define gen_for 334
-#define gen_if 335
-#define testlist1 336
-#define encoding_decl 337
-#define yield_expr 338
+#define typedargslist 263
+#define tname 264
+#define tfpdef 265
+#define tfplist 266
+#define varargslist 267
+#define vname 268
+#define vfpdef 269
+#define vfplist 270
+#define stmt 271
+#define simple_stmt 272
+#define small_stmt 273
+#define expr_stmt 274
+#define augassign 275
+#define print_stmt 276
+#define del_stmt 277
+#define pass_stmt 278
+#define flow_stmt 279
+#define break_stmt 280
+#define continue_stmt 281
+#define return_stmt 282
+#define yield_stmt 283
+#define raise_stmt 284
+#define import_stmt 285
+#define import_name 286
+#define import_from 287
+#define import_as_name 288
+#define dotted_as_name 289
+#define import_as_names 290
+#define dotted_as_names 291
+#define dotted_name 292
+#define global_stmt 293
+#define assert_stmt 294
+#define compound_stmt 295
+#define if_stmt 296
+#define while_stmt 297
+#define for_stmt 298
+#define try_stmt 299
+#define with_stmt 300
+#define with_var 301
+#define except_clause 302
+#define suite 303
+#define testlist_safe 304
+#define old_test 305
+#define old_lambdef 306
+#define test 307
+#define or_test 308
+#define and_test 309
+#define not_test 310
+#define comparison 311
+#define comp_op 312
+#define expr 313
+#define xor_expr 314
+#define and_expr 315
+#define shift_expr 316
+#define arith_expr 317
+#define term 318
+#define factor 319
+#define power 320
+#define atom 321
+#define listmaker 322
+#define testlist_gexp 323
+#define lambdef 324
+#define trailer 325
+#define subscriptlist 326
+#define subscript 327
+#define sliceop 328
+#define exprlist 329
+#define testlist 330
+#define dictsetmaker 331
+#define classdef 332
+#define arglist 333
+#define argument 334
+#define list_iter 335
+#define list_for 336
+#define list_if 337
+#define gen_iter 338
+#define gen_for 339
+#define gen_if 340
+#define testlist1 341
+#define encoding_decl 342
+#define yield_expr 343

Modified: python/branches/p3yk-noslice/Include/pyport.h
==============================================================================
--- python/branches/p3yk-noslice/Include/pyport.h	(original)
+++ python/branches/p3yk-noslice/Include/pyport.h	Thu Jan 11 00:21:28 2007
@@ -35,17 +35,6 @@
 
 **************************************************************************/
 
-
-/* For backward compatibility only. Obsolete, do not use. */
-#ifdef HAVE_PROTOTYPES
-#define Py_PROTO(x) x
-#else
-#define Py_PROTO(x) ()
-#endif
-#ifndef Py_FPROTO
-#define Py_FPROTO(x) Py_PROTO(x)
-#endif
-
 /* typedefs for some C9X-defined synonyms for integral types.
  *
  * The names in Python are exactly the same as the C9X names, except with a
@@ -226,9 +215,7 @@
 /* NB caller must include <sys/types.h> */
 
 #ifdef HAVE_SYS_SELECT_H
-
 #include <sys/select.h>
-
 #endif /* !HAVE_SYS_SELECT_H */
 
 /*******************************
@@ -504,7 +491,7 @@
 #ifdef __BEOS__
 /* Unchecked */
 /* It's in the libs, but not the headers... - [cjh] */
-int shutdown( int, int );
+int shutdown(int, int);
 #endif
 
 #ifdef HAVE__GETPTY
@@ -523,25 +510,6 @@
 #endif /* defined(HAVE_OPENPTY) || defined(HAVE_FORKPTY) */
 
 
-/* These are pulled from various places. It isn't obvious on what platforms
-   they are necessary, nor what the exact prototype should look like (which
-   is likely to vary between platforms!) If you find you need one of these
-   declarations, please move them to a platform-specific block and include
-   proper prototypes. */
-#if 0
-
-/* From Modules/resource.c */
-extern int getrusage();
-extern int getpagesize();
-
-/* From Python/sysmodule.c and Modules/posixmodule.c */
-extern int fclose(FILE *);
-
-/* From Modules/posixmodule.c */
-extern int fdatasync(int);
-#endif /* 0 */
-
-
 /************************
  * WRAPPER FOR <math.h> *
  ************************/
@@ -651,56 +619,6 @@
 #	endif /* __cplusplus */
 #endif
 
-/* Deprecated DL_IMPORT and DL_EXPORT macros */
-#if defined(Py_ENABLE_SHARED) && defined (HAVE_DECLSPEC_DLL)
-#	if defined(Py_BUILD_CORE)
-#		define DL_IMPORT(RTYPE) __declspec(dllexport) RTYPE
-#		define DL_EXPORT(RTYPE) __declspec(dllexport) RTYPE
-#	else
-#		define DL_IMPORT(RTYPE) __declspec(dllimport) RTYPE
-#		define DL_EXPORT(RTYPE) __declspec(dllexport) RTYPE
-#	endif
-#endif
-#ifndef DL_EXPORT
-#	define DL_EXPORT(RTYPE) RTYPE
-#endif
-#ifndef DL_IMPORT
-#	define DL_IMPORT(RTYPE) RTYPE
-#endif
-/* End of deprecated DL_* macros */
-
-/* If the fd manipulation macros aren't defined,
-   here is a set that should do the job */
-
-#if 0 /* disabled and probably obsolete */
-
-#ifndef	FD_SETSIZE
-#define	FD_SETSIZE	256
-#endif
-
-#ifndef FD_SET
-
-typedef long fd_mask;
-
-#define NFDBITS	(sizeof(fd_mask) * NBBY)	/* bits per mask */
-#ifndef howmany
-#define	howmany(x, y)	(((x)+((y)-1))/(y))
-#endif /* howmany */
-
-typedef	struct fd_set {
-	fd_mask	fds_bits[howmany(FD_SETSIZE, NFDBITS)];
-} fd_set;
-
-#define	FD_SET(n, p)	((p)->fds_bits[(n)/NFDBITS] |= (1 << ((n) % NFDBITS)))
-#define	FD_CLR(n, p)	((p)->fds_bits[(n)/NFDBITS] &= ~(1 << ((n) % NFDBITS)))
-#define	FD_ISSET(n, p)	((p)->fds_bits[(n)/NFDBITS] & (1 << ((n) % NFDBITS)))
-#define FD_ZERO(p)	memset((char *)(p), '\0', sizeof(*(p)))
-
-#endif /* FD_SET */
-
-#endif /* fd manipulation macros */
-
-
 /* limits.h constants that may be missing */
 
 #ifndef INT_MAX

Modified: python/branches/p3yk-noslice/Include/stringobject.h
==============================================================================
--- python/branches/p3yk-noslice/Include/stringobject.h	(original)
+++ python/branches/p3yk-noslice/Include/stringobject.h	Thu Jan 11 00:21:28 2007
@@ -28,7 +28,7 @@
    Interning strings (ob_sstate) tries to ensure that only one string
    object with a given value exists, so equality tests can be one pointer
    comparison.  This is generally restricted to strings that "look like"
-   Python identifiers, although the intern() builtin can be used to force
+   Python identifiers, although the sys.intern() function can be used to force
    interning of any string.
    Together, these sped the interpreter by up to 20%. */
 

Modified: python/branches/p3yk-noslice/Include/token.h
==============================================================================
--- python/branches/p3yk-noslice/Include/token.h	(original)
+++ python/branches/p3yk-noslice/Include/token.h	Thu Jan 11 00:21:28 2007
@@ -58,10 +58,11 @@
 #define DOUBLESLASH	48
 #define DOUBLESLASHEQUAL 49
 #define AT              50	
+#define RARROW          51
 /* Don't forget to update the table _PyParser_TokenNames in tokenizer.c! */
-#define OP		51
-#define ERRORTOKEN	52
-#define N_TOKENS	53
+#define OP		52
+#define ERRORTOKEN	53
+#define N_TOKENS	54
 
 /* Special definitions for cooperation with parser */
 

Modified: python/branches/p3yk-noslice/LICENSE
==============================================================================
--- python/branches/p3yk-noslice/LICENSE	(original)
+++ python/branches/p3yk-noslice/LICENSE	Thu Jan 11 00:21:28 2007
@@ -88,9 +88,9 @@
 prepare derivative works, distribute, and otherwise use Python
 alone or in any derivative version, provided, however, that PSF's
 License Agreement and PSF's notice of copyright, i.e., "Copyright (c)
-2001, 2002, 2003, 2004, 2005, 2006 Python Software Foundation; All Rights
-Reserved" are retained in Python alone or in any derivative version 
-prepared by Licensee.
+2001, 2002, 2003, 2004, 2005, 2006, 2007 Python Software Foundation; 
+All Rights Reserved" are retained in Python alone or in any derivative 
+version prepared by Licensee.
 
 3. In the event Licensee prepares a derivative work that is based on
 or incorporates Python or any part thereof, and wants to make

Modified: python/branches/p3yk-noslice/Lib/CGIHTTPServer.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/CGIHTTPServer.py	(original)
+++ python/branches/p3yk-noslice/Lib/CGIHTTPServer.py	Thu Jan 11 00:21:28 2007
@@ -105,17 +105,36 @@
 
     def run_cgi(self):
         """Execute a CGI script."""
+        path = self.path
         dir, rest = self.cgi_info
+        
+        i = path.find('/', len(dir) + 1)
+        while i >= 0:
+            nextdir = path[:i]
+            nextrest = path[i+1:]
+
+            scriptdir = self.translate_path(nextdir)
+            if os.path.isdir(scriptdir):
+                dir, rest = nextdir, nextrest
+                i = path.find('/', len(dir) + 1)
+            else:
+                break
+
+        # find an explicit query string, if present.
         i = rest.rfind('?')
         if i >= 0:
             rest, query = rest[:i], rest[i+1:]
         else:
             query = ''
+
+        # dissect the part after the directory name into a script name &
+        # a possible additional path, to be stored in PATH_INFO.
         i = rest.find('/')
         if i >= 0:
             script, rest = rest[:i], rest[i:]
         else:
             script, rest = rest, ''
+
         scriptname = dir + '/' + script
         scriptfile = self.translate_path(scriptname)
         if not os.path.exists(scriptfile):

Modified: python/branches/p3yk-noslice/Lib/SimpleHTTPServer.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/SimpleHTTPServer.py	(original)
+++ python/branches/p3yk-noslice/Lib/SimpleHTTPServer.py	Thu Jan 11 00:21:28 2007
@@ -66,6 +66,12 @@
         path = self.translate_path(self.path)
         f = None
         if os.path.isdir(path):
+            if not self.path.endswith('/'):
+                # redirect browser - doing basically what apache does
+                self.send_response(301)
+                self.send_header("Location", self.path + "/")
+                self.end_headers()
+                return None
             for index in "index.html", "index.htm":
                 index = os.path.join(path, index)
                 if os.path.exists(index):

Modified: python/branches/p3yk-noslice/Lib/StringIO.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/StringIO.py	(original)
+++ python/branches/p3yk-noslice/Lib/StringIO.py	Thu Jan 11 00:21:28 2007
@@ -139,7 +139,7 @@
         return r
 
     def readline(self, length=None):
-        """Read one entire line from the file.
+        r"""Read one entire line from the file.
 
         A trailing newline character is kept in the string (but may be absent
         when a file ends with an incomplete line). If the size argument is

Modified: python/branches/p3yk-noslice/Lib/bsddb/dbobj.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/bsddb/dbobj.py	(original)
+++ python/branches/p3yk-noslice/Lib/bsddb/dbobj.py	Thu Jan 11 00:21:28 2007
@@ -55,8 +55,9 @@
         return self._cobj.set_lg_max(*args, **kwargs)
     def set_lk_detect(self, *args, **kwargs):
         return self._cobj.set_lk_detect(*args, **kwargs)
-    def set_lk_max(self, *args, **kwargs):
-        return self._cobj.set_lk_max(*args, **kwargs)
+    if db.version() < (4,5):
+        def set_lk_max(self, *args, **kwargs):
+            return self._cobj.set_lk_max(*args, **kwargs)
     def set_lk_max_locks(self, *args, **kwargs):
         return self._cobj.set_lk_max_locks(*args, **kwargs)
     def set_lk_max_lockers(self, *args, **kwargs):

Modified: python/branches/p3yk-noslice/Lib/bsddb/test/test_1413192.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/bsddb/test/test_1413192.py	(original)
+++ python/branches/p3yk-noslice/Lib/bsddb/test/test_1413192.py	Thu Jan 11 00:21:28 2007
@@ -14,7 +14,7 @@
 env_name = '.'
 
 env = db.DBEnv()
-env.open(env_name, db.DB_CREATE | db.DB_INIT_TXN)
+env.open(env_name, db.DB_CREATE | db.DB_INIT_TXN | db.DB_INIT_MPOOL)
 the_txn = env.txn_begin()
 
 map = db.DB(env)

Modified: python/branches/p3yk-noslice/Lib/bsddb/test/test_associate.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/bsddb/test/test_associate.py	(original)
+++ python/branches/p3yk-noslice/Lib/bsddb/test/test_associate.py	Thu Jan 11 00:21:28 2007
@@ -91,7 +91,7 @@
 class AssociateErrorTestCase(unittest.TestCase):
     def setUp(self):
         self.filename = self.__class__.__name__ + '.db'
-        homeDir = os.path.join(os.path.dirname(sys.argv[0]), 'db_home')
+        homeDir = os.path.join(tempfile.gettempdir(), 'db_home')
         self.homeDir = homeDir
         try:
             os.mkdir(homeDir)

Modified: python/branches/p3yk-noslice/Lib/bsddb/test/test_basics.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/bsddb/test/test_basics.py	(original)
+++ python/branches/p3yk-noslice/Lib/bsddb/test/test_basics.py	Thu Jan 11 00:21:28 2007
@@ -54,7 +54,7 @@
 
     def setUp(self):
         if self.useEnv:
-            homeDir = os.path.join(os.path.dirname(sys.argv[0]), 'db_home')
+            homeDir = os.path.join(tempfile.gettempdir(), 'db_home')
             self.homeDir = homeDir
             try:
                 shutil.rmtree(homeDir)

Modified: python/branches/p3yk-noslice/Lib/bsddb/test/test_dbobj.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/bsddb/test/test_dbobj.py	(original)
+++ python/branches/p3yk-noslice/Lib/bsddb/test/test_dbobj.py	Thu Jan 11 00:21:28 2007
@@ -2,6 +2,7 @@
 import sys, os, string
 import unittest
 import glob
+import tempfile
 
 try:
     # For Pythons w/distutils pybsddb
@@ -19,7 +20,7 @@
     db_name = 'test-dbobj.db'
 
     def setUp(self):
-        homeDir = os.path.join(os.path.dirname(sys.argv[0]), 'db_home')
+        homeDir = os.path.join(tempfile.gettempdir(), 'db_home')
         self.homeDir = homeDir
         try: os.mkdir(homeDir)
         except os.error: pass

Modified: python/branches/p3yk-noslice/Lib/bsddb/test/test_dbshelve.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/bsddb/test/test_dbshelve.py	(original)
+++ python/branches/p3yk-noslice/Lib/bsddb/test/test_dbshelve.py	Thu Jan 11 00:21:28 2007
@@ -242,7 +242,7 @@
 class BasicEnvShelveTestCase(DBShelveTestCase):
     def do_open(self):
         self.homeDir = homeDir = os.path.join(
-            os.path.dirname(sys.argv[0]), 'db_home')
+            tempfile.gettempdir(), 'db_home')
         try: os.mkdir(homeDir)
         except os.error: pass
         self.env = db.DBEnv()

Modified: python/branches/p3yk-noslice/Lib/bsddb/test/test_dbtables.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/bsddb/test/test_dbtables.py	(original)
+++ python/branches/p3yk-noslice/Lib/bsddb/test/test_dbtables.py	Thu Jan 11 00:21:28 2007
@@ -26,6 +26,7 @@
     pickle = cPickle
 except ImportError:
     import pickle
+import tempfile
 
 import unittest
 from .test_all import verbose
@@ -46,7 +47,7 @@
     db_name = 'test-table.db'
 
     def setUp(self):
-        homeDir = os.path.join(os.path.dirname(sys.argv[0]), 'db_home')
+        homeDir = os.path.join(tempfile.gettempdir(), 'db_home')
         self.homeDir = homeDir
         try: os.mkdir(homeDir)
         except os.error: pass

Modified: python/branches/p3yk-noslice/Lib/bsddb/test/test_env_close.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/bsddb/test/test_env_close.py	(original)
+++ python/branches/p3yk-noslice/Lib/bsddb/test/test_env_close.py	Thu Jan 11 00:21:28 2007
@@ -33,7 +33,7 @@
 
 class DBEnvClosedEarlyCrash(unittest.TestCase):
     def setUp(self):
-        self.homeDir = os.path.join(os.path.dirname(sys.argv[0]), 'db_home')
+        self.homeDir = os.path.join(tempfile.gettempdir(), 'db_home')
         try: os.mkdir(self.homeDir)
         except os.error: pass
         tempfile.tempdir = self.homeDir

Modified: python/branches/p3yk-noslice/Lib/bsddb/test/test_join.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/bsddb/test/test_join.py	(original)
+++ python/branches/p3yk-noslice/Lib/bsddb/test/test_join.py	Thu Jan 11 00:21:28 2007
@@ -49,7 +49,7 @@
 
     def setUp(self):
         self.filename = self.__class__.__name__ + '.db'
-        homeDir = os.path.join(os.path.dirname(sys.argv[0]), 'db_home')
+        homeDir = os.path.join(tempfile.gettempdir(), 'db_home')
         self.homeDir = homeDir
         try: os.mkdir(homeDir)
         except os.error: pass

Modified: python/branches/p3yk-noslice/Lib/bsddb/test/test_lock.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/bsddb/test/test_lock.py	(original)
+++ python/branches/p3yk-noslice/Lib/bsddb/test/test_lock.py	Thu Jan 11 00:21:28 2007
@@ -30,7 +30,7 @@
 class LockingTestCase(unittest.TestCase):
 
     def setUp(self):
-        homeDir = os.path.join(os.path.dirname(sys.argv[0]), 'db_home')
+        homeDir = os.path.join(tempfile.gettempdir(), 'db_home')
         self.homeDir = homeDir
         try: os.mkdir(homeDir)
         except os.error: pass

Modified: python/branches/p3yk-noslice/Lib/bsddb/test/test_misc.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/bsddb/test/test_misc.py	(original)
+++ python/branches/p3yk-noslice/Lib/bsddb/test/test_misc.py	Thu Jan 11 00:21:28 2007
@@ -4,6 +4,7 @@
 import os
 import sys
 import unittest
+import tempfile
 
 try:
     # For Pythons w/distutils pybsddb
@@ -17,7 +18,7 @@
 class MiscTestCase(unittest.TestCase):
     def setUp(self):
         self.filename = self.__class__.__name__ + '.db'
-        homeDir = os.path.join(os.path.dirname(sys.argv[0]), 'db_home')
+        homeDir = os.path.join(tempfile.gettempdir(), 'db_home')
         self.homeDir = homeDir
         try:
             os.mkdir(homeDir)

Modified: python/branches/p3yk-noslice/Lib/bsddb/test/test_recno.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/bsddb/test/test_recno.py	(original)
+++ python/branches/p3yk-noslice/Lib/bsddb/test/test_recno.py	Thu Jan 11 00:21:28 2007
@@ -203,10 +203,10 @@
         just a line in the file, but you can set a different record delimiter
         if needed.
         """
-        source = os.path.join(os.path.dirname(sys.argv[0]),
-                              'db_home/test_recno.txt')
-        if not os.path.isdir('db_home'):
-            os.mkdir('db_home')
+        homeDir = os.path.join(tempfile.gettempdir(), 'db_home')
+        source = os.path.join(homeDir, 'test_recno.txt')
+        if not os.path.isdir(homeDir):
+            os.mkdir(homeDir)
         f = open(source, 'w') # create the file
         f.close()
 

Modified: python/branches/p3yk-noslice/Lib/bsddb/test/test_thread.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/bsddb/test/test_thread.py	(original)
+++ python/branches/p3yk-noslice/Lib/bsddb/test/test_thread.py	Thu Jan 11 00:21:28 2007
@@ -53,7 +53,7 @@
         if verbose:
             dbutils._deadlock_VerboseFile = sys.stdout
 
-        homeDir = os.path.join(os.path.dirname(sys.argv[0]), 'db_home')
+        homeDir = os.path.join(tempfile.gettempdir(), 'db_home')
         self.homeDir = homeDir
         try:
             os.mkdir(homeDir)

Modified: python/branches/p3yk-noslice/Lib/compiler/ast.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/compiler/ast.py	(original)
+++ python/branches/p3yk-noslice/Lib/compiler/ast.py	Thu Jan 11 00:21:28 2007
@@ -33,7 +33,10 @@
         pass # implemented by subclasses
 
 class EmptyNode(Node):
-    pass
+    def getChildNodes(self):
+        return ()
+    def getChildren(self):
+        return ()
 
 class Expression(Node):
     # Expression is an artificial node class to support "eval"
@@ -487,12 +490,13 @@
         return "From(%s, %s, %s)" % (repr(self.modname), repr(self.names), repr(self.level))
 
 class Function(Node):
-    def __init__(self, decorators, name, argnames, defaults, kwonlyargs, flags, doc, code, lineno=None):
+    def __init__(self, decorators, name, arguments, defaults, kwonlyargs, returns, flags, doc, code, lineno=None):
         self.decorators = decorators
         self.name = name
-        self.argnames = argnames
+        self.arguments = arguments
         self.defaults = defaults
         self.kwonlyargs = kwonlyargs
+        self.returns = returns
         self.flags = flags
         self.doc = doc
         self.code = code
@@ -508,9 +512,10 @@
         children = []
         children.append(self.decorators)
         children.append(self.name)
-        children.append(self.argnames)
+        children.extend(flatten(self.arguments))
         children.extend(flatten(self.defaults))
-        children.append(self.kwonlyargs)
+        children.extend(flatten(self.kwonlyargs))
+        children.append(self.returns)
         children.append(self.flags)
         children.append(self.doc)
         children.append(self.code)
@@ -520,18 +525,22 @@
         nodelist = []
         if self.decorators is not None:
             nodelist.append(self.decorators)
+        nodelist.extend(flatten_nodes(self.arguments))
         nodelist.extend(flatten_nodes(self.defaults))
+        nodelist.extend(flatten_nodes(self.kwonlyargs))
+        if self.returns is not None:
+            nodelist.append(self.returns)
         nodelist.append(self.code)
         return tuple(nodelist)
 
     def __repr__(self):
-        return "Function(%s, %s, %s, %s, %s, %s, %s, %s)" % (repr(self.decorators), repr(self.name), repr(self.argnames), repr(self.defaults), repr(self.kwonlyargs), repr(self.flags), repr(self.doc), repr(self.code))
+        return "Function(%s, %s, %s, %s, %s, %s, %s, %s, %s)" % (repr(self.decorators), repr(self.name), repr(self.arguments), repr(self.defaults), repr(self.kwonlyargs), repr(self.returns), repr(self.flags), repr(self.doc), repr(self.code))
 
 class GenExpr(Node):
     def __init__(self, code, lineno=None):
         self.code = code
         self.lineno = lineno
-        self.argnames = ['.0']
+        self.arguments = [SimpleArg('.0', None)]
         self.varargs = self.kwargs = None
         self.kwonlyargs = ()
 
@@ -715,9 +724,24 @@
     def __repr__(self):
         return "Keyword(%s, %s)" % (repr(self.name), repr(self.expr))
 
+class Kwarg(Node):
+    def __init__(self, arg, expr, lineno=None):
+        self.arg = arg
+        self.expr = expr
+        self.lineno = lineno
+
+    def getChildren(self):
+        return self.arg, self.expr
+
+    def getChildNodes(self):
+        return self.arg, self.expr
+
+    def __repr__(self):
+        return "Kwarg(%s, %s)" % (repr(self.arg), repr(self.expr))
+
 class Lambda(Node):
-    def __init__(self, argnames, defaults, kwonlyargs, flags, code, lineno=None):
-        self.argnames = argnames
+    def __init__(self, arguments, defaults, kwonlyargs, flags, code, lineno=None):
+        self.arguments = arguments
         self.defaults = defaults
         self.kwonlyargs = kwonlyargs
         self.flags = flags
@@ -728,25 +752,28 @@
             self.varargs = 1
         if flags & CO_VARKEYWORDS:
             self.kwargs = 1
+        self.returns = None
 
 
     def getChildren(self):
         children = []
-        children.append(self.argnames)
+        children.extend(flatten(self.arguments))
         children.extend(flatten(self.defaults))
-        children.append(self.kwonlyargs)
+        children.extend(flatten(self.kwonlyargs))
         children.append(self.flags)
         children.append(self.code)
         return tuple(children)
 
     def getChildNodes(self):
         nodelist = []
+        nodelist.extend(flatten_nodes(self.arguments))
         nodelist.extend(flatten_nodes(self.defaults))
+        nodelist.extend(flatten_nodes(self.kwonlyargs))
         nodelist.append(self.code)
         return tuple(nodelist)
 
     def __repr__(self):
-        return "Lambda(%s, %s, %s, %s, %s)" % (repr(self.argnames), repr(self.defaults), repr(self.kwonlyargs), repr(self.flags), repr(self.code))
+        return "Lambda(%s, %s, %s, %s, %s)" % (repr(self.arguments), repr(self.defaults), repr(self.kwonlyargs), repr(self.flags), repr(self.code))
 
 class LeftShift(Node):
     def __init__(self, (left, right), lineno=None):
@@ -897,6 +924,22 @@
     def __repr__(self):
         return "Name(%s)" % (repr(self.name),)
 
+class NestedArgs(Node):
+    def __init__(self, args, lineno=None):
+        self.args = args
+        self.lineno = lineno
+
+    def getChildren(self):
+        return tuple(flatten(self.args))
+
+    def getChildNodes(self):
+        nodelist = []
+        nodelist.extend(flatten_nodes(self.args))
+        return tuple(nodelist)
+
+    def __repr__(self):
+        return "NestedArgs(%s)" % (repr(self.args),)
+
 class Not(Node):
     def __init__(self, expr, lineno=None):
         self.expr = expr
@@ -1071,6 +1114,27 @@
     def __repr__(self):
         return "Set(%s)" % (repr(self.items),)
 
+class SimpleArg(Node):
+    def __init__(self, name, annotation, lineno=None):
+        self.name = name
+        self.annotation = annotation
+        self.lineno = lineno
+
+    def getChildren(self):
+        children = []
+        children.append(self.name)
+        children.append(self.annotation)
+        return tuple(children)
+
+    def getChildNodes(self):
+        nodelist = []
+        if self.annotation is not None:
+            nodelist.append(self.annotation)
+        return tuple(nodelist)
+
+    def __repr__(self):
+        return "SimpleArg(%s, %s)" % (repr(self.name), repr(self.annotation))
+
 class Slice(Node):
     def __init__(self, expr, flags, lower, upper, lineno=None):
         self.expr = expr

Modified: python/branches/p3yk-noslice/Lib/compiler/pyassem.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/compiler/pyassem.py	(original)
+++ python/branches/p3yk-noslice/Lib/compiler/pyassem.py	Thu Jan 11 00:21:28 2007
@@ -314,7 +314,7 @@
     super_init = FlowGraph.__init__
 
     def __init__(self, name, filename,
-                 args=(), kwonlyargs={}, optimized=0, klass=None):
+                 args=(), kwonlyargs=(), optimized=0, klass=None):
         self.super_init()
         self.name = name
         self.filename = filename
@@ -338,24 +338,40 @@
         # The offsets used by LOAD_CLOSURE/LOAD_DEREF refer to both
         # kinds of variables.
         self.closure = []
-        self.varnames = list(args) or []
-        for i in range(len(self.varnames)):
+        # The varnames list needs to be computed after flags have been set
+        self.varnames = []
+        self.stage = RAW
+
+    def computeVarnames(self):
+        # self.args is positional, vararg, kwarg, kwonly, unpacked. This
+        # order is due to the visit order in symbol module and could change.
+        # argcount is # len(self.args) - len(unpacked). We want
+        # self.varnames to be positional, kwonly, vararg, kwarg, unpacked
+        # and argcount to be len(positional).
+
+        # determine starting index of unpacked, kwonly, vararg
+        u = self.argcount    # starting index of unpacked
+        k = u - len(self.kwonlyargs)  # starting index of kwonly
+        v = k - self.checkFlag(CO_VARARGS) - self.checkFlag(CO_VARKEYWORDS)
+
+        vars = list(self.args)
+        self.varnames = vars[:v] + vars[k:u] + vars[v:k] + vars[u:]
+        self.argcount = v
+
+        # replace TupleArgs with calculated var name
+        for i in range(self.argcount):
             var = self.varnames[i]
             if isinstance(var, TupleArg):
                 self.varnames[i] = var.getName()
-        self.stage = RAW
 
     def setDocstring(self, doc):
         self.docstring = doc
 
     def setFlag(self, flag):
         self.flags = self.flags | flag
-        if flag == CO_VARARGS:
-            self.argcount = self.argcount - 1
 
     def checkFlag(self, flag):
-        if self.flags & flag:
-            return 1
+        return (self.flags & flag) == flag
 
     def setFreeVars(self, names):
         self.freevars = list(names)
@@ -366,6 +382,7 @@
     def getCode(self):
         """Get a Python code object"""
         assert self.stage == RAW
+        self.computeVarnames()
         self.computeStackDepth()
         self.flattenGraph()
         assert self.stage == FLAT
@@ -575,6 +592,12 @@
                     lnotab.nextLine(oparg)
                     continue
                 hi, lo = twobyte(oparg)
+
+                extended, hi = twobyte(hi)
+                if extended:
+                  ehi, elo = twobyte(extended)
+                  lnotab.addCode(self.opnum['EXTENDED_ARG'], elo, ehi)
+
                 try:
                     lnotab.addCode(self.opnum[opname], lo, hi)
                 except ValueError:
@@ -595,8 +618,6 @@
         else:
             nlocals = len(self.varnames)
         argcount = self.argcount
-        if self.flags & CO_VARKEYWORDS:
-            argcount = argcount - 1
         kwonlyargcount = len(self.kwonlyargs)
         return new.code(argcount, kwonlyargcount,
                         nlocals, self.stacksize, self.flags,
@@ -798,7 +819,8 @@
         return self.CALL_FUNCTION(argc)-2
     def MAKE_FUNCTION(self, argc):
         hi, lo = divmod(argc, 256)
-        return -(lo + hi * 2)
+        ehi, hi = divmod(hi, 256)
+        return -(lo + hi * 2 + ehi)
     def MAKE_CLOSURE(self, argc):
         # XXX need to account for free variables too!
         return -argc

Modified: python/branches/p3yk-noslice/Lib/compiler/pycodegen.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/compiler/pycodegen.py	(original)
+++ python/branches/p3yk-noslice/Lib/compiler/pycodegen.py	Thu Jan 11 00:21:28 2007
@@ -378,18 +378,57 @@
         walk(node.code, gen)
         gen.finish()
         self.set_lineno(node)
+        num_kwargs = 0
         for keyword in node.kwonlyargs:
             default = keyword.expr
             if isinstance(default, ast.EmptyNode):
                 continue
-            self.emit('LOAD_CONST', keyword.name)
+            self.emit('LOAD_CONST', keyword.arg.name)
             self.visit(default)
+            num_kwargs += 1
         for default in node.defaults:
             self.visit(default)
-        self._makeClosure(gen, len(node.defaults))
+
+        num_annotations = self._visit_annotations(node)
+
+        oparg = len(node.defaults)
+        oparg |= num_kwargs << 8
+        oparg |= num_annotations << 16
+
+        self._makeClosure(gen, oparg)
         for i in range(ndecorators):
             self.emit('CALL_FUNCTION', 1)
 
+    def _visit_annotations(self, node):
+        # emit code, return num_annotations
+        annotations = []
+        annotations.extend(self._visit_argument_annotations(node.arguments))
+        annotations.extend(self._visit_kwarg_annotations(node.kwonlyargs))
+        if node.returns:
+            self.visit(node.returns)
+            annotations.append('return')
+        if not annotations:
+            return 0
+        self.emit('LOAD_CONST', tuple(annotations))
+        return len(annotations) + 1
+
+    def _visit_argument_annotations(self, arguments):
+        for arg in arguments:
+            if isinstance(arg, ast.SimpleArg):
+                if arg.annotation:
+                    self.visit(arg.annotation)
+                    yield arg.name
+            else:
+                for name in self._visit_argument_annotations(arg.args):
+                    yield name
+
+    def _visit_kwarg_annotations(self, kwargs):
+        for kwarg in kwargs:
+            arg = kwarg.arg
+            if arg.annotation:
+                self.visit(arg.annotation)
+                yield arg.name
+
     def visitClass(self, node):
         gen = self.ClassGen(node, self.scopes,
                             self.get_module())
@@ -1279,7 +1318,7 @@
         else:
             name = func.name
 
-        args, hasTupleArg = generateArgList(func.argnames)
+        args, hasTupleArg = generateArgList(func.arguments)
         kwonlyargs = generateKwonlyArgList(func.kwonlyargs)
         self.graph = pyassem.PyFlowGraph(name, func.filename, args,
                                          kwonlyargs=kwonlyargs,
@@ -1290,7 +1329,7 @@
         if not isLambda and func.doc:
             self.setDocstring(func.doc)
 
-        lnf = walk(func.code, self.NameFinder(args), verbose=0)
+        lnf = walk(func.code, self.NameFinder(args+kwonlyargs), verbose=0)
         self.locals.push(lnf.getLocals())
         if func.varargs:
             self.graph.setFlag(CO_VARARGS)
@@ -1298,7 +1337,7 @@
             self.graph.setFlag(CO_VARKEYWORDS)
         self.set_lineno(func)
         if hasTupleArg:
-            self.generateArgUnpack(func.argnames)
+            self.generateArgUnpack(func.arguments)
 
     def get_module(self):
         return self.module
@@ -1312,9 +1351,9 @@
     def generateArgUnpack(self, args):
         for i in range(len(args)):
             arg = args[i]
-            if isinstance(arg, tuple):
+            if isinstance(arg, ast.NestedArgs):
                 self.emit('LOAD_FAST', '.%d' % (i * 2))
-                self.unpackSequence(arg)
+                self.unpackSequence(tuple(_nested_names(arg)))
 
     def unpackSequence(self, tup):
         if VERSION > 1:
@@ -1408,21 +1447,29 @@
     count = 0
     for i in range(len(arglist)):
         elt = arglist[i]
-        if isinstance(elt, str):
-            args.append(elt)
-        elif isinstance(elt, tuple):
-            args.append(TupleArg(i * 2, elt))
-            extra.extend(misc.flatten(elt))
+        if isinstance(elt, ast.SimpleArg):
+            args.append(elt.name)
+        elif isinstance(elt, ast.NestedArgs):
+            t = tuple(_nested_names(elt))
+            args.append(TupleArg(i * 2, t))
+            extra.extend(misc.flatten(t))
             count = count + 1
         else:
             raise ValueError, "unexpect argument type:", elt
     return args + extra, count
 
+def _nested_names(elt):
+  for arg in elt.args:
+    if isinstance(arg, ast.SimpleArg):
+      yield arg.name
+    elif isinstance(arg, ast.NestedArgs):
+      yield tuple(_nested_names(arg))
+
 def generateKwonlyArgList(keywordOnlyArgs):
-    kwonlyargs = {}
+    kwonlyargs = []
     for elt in keywordOnlyArgs:
-        assert isinstance(elt, ast.Keyword)
-        kwonlyargs[elt.name] = elt.expr
+        assert isinstance(elt, ast.Kwarg)
+        kwonlyargs.append(elt.arg.name)
     return kwonlyargs
     
 def findOp(node):

Modified: python/branches/p3yk-noslice/Lib/compiler/symbols.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/compiler/symbols.py	(original)
+++ python/branches/p3yk-noslice/Lib/compiler/symbols.py	Thu Jan 11 00:21:28 2007
@@ -233,7 +233,12 @@
         if parent.nested or isinstance(parent, FunctionScope):
             scope.nested = 1
         self.scopes[node] = scope
-        self._do_args(scope, node.argnames)
+
+        args = node.arguments
+        for kwonly in node.kwonlyargs:
+            args.append(kwonly.arg)
+        self._do_arguments(scope, args)
+
         self.visit(node.code, scope)
         self.handle_free_vars(scope, parent)
 
@@ -275,16 +280,18 @@
         if parent.nested or isinstance(parent, FunctionScope):
             scope.nested = 1
         self.scopes[node] = scope
-        self._do_args(scope, node.argnames)
+        self._do_arguments(scope, node.arguments)
         self.visit(node.code, scope)
         self.handle_free_vars(scope, parent)
 
-    def _do_args(self, scope, args):
-        for name in args:
-            if type(name) == types.TupleType:
-                self._do_args(scope, name)
+    def _do_arguments(self, scope, arguments):
+        for node in arguments:
+            if isinstance(node, ast.SimpleArg):
+                scope.add_param(node.name)
+                if node.annotation:
+                    self.visit(node.annotation, scope)
             else:
-                scope.add_param(name)
+                self._do_arguments(scope, node.args)
 
     def handle_free_vars(self, scope, parent):
         parent.add_child(scope)

Modified: python/branches/p3yk-noslice/Lib/compiler/transformer.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/compiler/transformer.py	(original)
+++ python/branches/p3yk-noslice/Lib/compiler/transformer.py	Thu Jan 11 00:21:28 2007
@@ -234,25 +234,24 @@
         return Decorators(items)
 
     def funcdef(self, nodelist):
-        #                    -6   -5    -4         -3  -2    -1
-        # funcdef: [decorators] 'def' NAME parameters ':' suite
-        # parameters: '(' [varargslist] ')'
-
-        if len(nodelist) == 6:
-            assert nodelist[0][0] == symbol.decorators
+        #                         0    1    2                4         -1
+        # funcdef: [decorators] 'def' NAME parameters ['->' test] ':' suite
+        # parameters: '(' [typedargslist] ')'
+        if nodelist[0][0] == symbol.decorators:
             decorators = self.decorators(nodelist[0][1:])
+            nodelist = nodelist[1:]
         else:
-            assert len(nodelist) == 5
             decorators = None
+        assert len(nodelist) in (5, 7)
 
-        lineno = nodelist[-4][2]
-        name = nodelist[-4][1]
-        args = nodelist[-3][2]
+        lineno = nodelist[0][2]
+        name = nodelist[1][1]
+        args = nodelist[2][2]
 
-        if args[0] == symbol.varargslist:
-            names, defaults, kwonlyargs, flags = self.com_arglist(args[1:])
+        if args[0] == symbol.varargslist or args[0] == symbol.typedargslist:
+            arguments, defaults, kwonly, flags = self.com_arglist(args[1:])
         else:
-            names = defaults = kwonlyargs = ()
+            arguments = defaults = kwonly = ()
             flags = 0
         doc = self.get_docstring(nodelist[-1])
 
@@ -263,22 +262,28 @@
             assert isinstance(code, Stmt)
             assert isinstance(code.nodes[0], Discard)
             del code.nodes[0]
-        return Function(decorators, name, names, defaults,
-                        kwonlyargs, flags, doc, code, lineno=lineno)
+
+        if len(nodelist) == 7:
+            returns = self.com_node(nodelist[4])
+        else:
+            returns = None
+
+        return Function(decorators, name, arguments, defaults,
+                        kwonly, returns, flags, doc, code, lineno=lineno)
 
     def lambdef(self, nodelist):
         # lambdef: 'lambda' [varargslist] ':' test
         if nodelist[2][0] == symbol.varargslist:
-            names, defaults, kwonlyargs, flags = \
+            arguments, defaults, kwonlyargs, flags = \
                                 self.com_arglist(nodelist[2][1:])
         else:
-            names = defaults = kwonlyargs = ()
+            arguments = defaults = kwonlyargs = ()
             flags = 0
 
         # code for lambda
         code = self.com_node(nodelist[-1])
 
-        return Lambda(names, defaults, kwonlyargs,
+        return Lambda(arguments, defaults, kwonlyargs,
                       flags, code, lineno=nodelist[1][2])
     old_lambdef = lambdef
 
@@ -324,10 +329,25 @@
     def varargslist(self, nodelist):
         raise WalkerError
 
-    def fpdef(self, nodelist):
+    def vfpdef(self, nodelist):
         raise WalkerError
 
-    def fplist(self, nodelist):
+    def vfplist(self, nodelist):
+        raise WalkerError
+
+    def vname(self, nodelist):
+        raise WalkerError
+
+    def typedargslist(self, nodelist):
+        raise WalkerError
+
+    def tfpdef(self, nodelist):
+        raise WalkerError
+
+    def tfplist(self, nodelist):
+        raise WalkerError
+
+    def tname(self, nodelist):
         raise WalkerError
 
     def dotted_name(self, nodelist):
@@ -786,9 +806,10 @@
         return Discard(Const(None))
 
     def keywordonlyargs(self, nodelist):
-        # (',' NAME ['=' test])*
+        # (',' tname ['=' test])*
         #      ^^^
         # ------+
+        # tname and vname are handled.
         kwonlyargs = []
         i = 0
         while i < len(nodelist):
@@ -802,10 +823,25 @@
                 i += 2
             if node[0] == token.DOUBLESTAR:
                 return kwonlyargs, i
-            elif node[0] == token.NAME:
-                kwonlyargs.append(Keyword(node[1], default, lineno=node[2]))
+            elif node[0] in (symbol.vname, symbol.tname):
+                lineno = extractLineNo(node)
+                kwarg = Kwarg(self._simplearg(node), default, lineno=lineno)
+                kwonlyargs.append(kwarg)
                 i += 2
         return kwonlyargs, i
+
+    def _simplearg(self, node):
+        # tname: NAME [':' test]
+        # vname: NAME
+        assert node[0] == symbol.vname or node[0] == symbol.tname
+        name = node[1][1]
+        lineno = node[1][2]
+        assert isinstance(name, str)
+        if len(node) > 2:
+            annotation = self.com_node(node[3])
+        else:
+            annotation = None
+        return SimpleArg(name, annotation, lineno)
         
     def com_arglist(self, nodelist):
         # varargslist:
@@ -814,7 +850,7 @@
         #      | fpdef ['=' test] (',' fpdef ['=' test])* [',']
         # fpdef: NAME | '(' fplist ')'
         # fplist: fpdef (',' fpdef)* [',']
-        names = []
+        arguments = []
         kwonlyargs = []
         defaults = []
         flags = 0
@@ -825,14 +861,15 @@
             if node[0] == token.STAR or node[0] == token.DOUBLESTAR:
                 if node[0] == token.STAR:
                     node = nodelist[i+1]
-                    if node[0] == token.NAME: # vararg
-                        names.append(node[1])
+                    if node[0] in (symbol.tname, symbol.vname): # vararg
+                        arguments.append(self._simplearg(node))
                         flags = flags | CO_VARARGS
                         i = i + 3
                     else: # no vararg
                         assert node[0] == token.COMMA
                         i += 2
-                    if i < len(nodelist) and nodelist[i][0] == token.NAME:
+                    if i < len(nodelist) and \
+                       nodelist[i][0] in (symbol.tname, symbol.vname):
                         kwonlyargs, skip = self.keywordonlyargs(nodelist[i:])
                         i += skip
 
@@ -843,13 +880,13 @@
                         node = nodelist[i+1]
                     else:
                         raise ValueError, "unexpected token: %s" % t
-                    names.append(node[1])
+                    arguments.append(self._simplearg(node))
                     flags = flags | CO_VARKEYWORDS
 
                 break
 
-            # fpdef: NAME | '(' fplist ')'
-            names.append(self.com_fpdef(node))
+            # tfpdef: tname | '(' tfplist ')'
+            arguments.append(self.com_tfpdef(node))
 
             i = i + 1
             if i < len(nodelist) and nodelist[i][0] == token.EQUAL:
@@ -863,21 +900,24 @@
             # skip the comma
             i = i + 1
 
-        return names, defaults, kwonlyargs, flags
+        return arguments, defaults, kwonlyargs, flags
 
-    def com_fpdef(self, node):
-        # fpdef: NAME | '(' fplist ')'
+    def com_tfpdef(self, node):
+        # tfpdef: tname | '(' tfplist ')'
+        # def f((x)): -- x is not nested
+        while node[1][0] == token.LPAR and len(node[2]) == 2:
+            node = node[2][1]
         if node[1][0] == token.LPAR:
-            return self.com_fplist(node[2])
-        return node[1][1]
+            return NestedArgs(self.com_tfplist(node[2]))
+        return self._simplearg(node[1])
 
-    def com_fplist(self, node):
-        # fplist: fpdef (',' fpdef)* [',']
+    def com_tfplist(self, node):
+        # tfplist: tfpdef (',' tfpdef)* [',']
         if len(node) == 2:
-            return self.com_fpdef(node[1])
+            return self.com_tfpdef(node[1]),
         list = []
         for i in range(1, len(node), 2):
-            list.append(self.com_fpdef(node[i]))
+            list.append(self.com_tfpdef(node[i]))
         return tuple(list)
 
     def com_dotted_name(self, node):

Modified: python/branches/p3yk-noslice/Lib/cookielib.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/cookielib.py	(original)
+++ python/branches/p3yk-noslice/Lib/cookielib.py	Thu Jan 11 00:21:28 2007
@@ -1316,26 +1316,28 @@
         """
         _debug("add_cookie_header")
         self._cookies_lock.acquire()
+        try:
 
-        self._policy._now = self._now = int(time.time())
-
-        cookies = self._cookies_for_request(request)
+           self._policy._now = self._now = int(time.time())
 
-        attrs = self._cookie_attrs(cookies)
-        if attrs:
-            if not request.has_header("Cookie"):
-                request.add_unredirected_header(
-                    "Cookie", "; ".join(attrs))
-
-        # if necessary, advertise that we know RFC 2965
-        if (self._policy.rfc2965 and not self._policy.hide_cookie2 and
-            not request.has_header("Cookie2")):
-            for cookie in cookies:
-                if cookie.version != 1:
-                    request.add_unredirected_header("Cookie2", '$Version="1"')
-                    break
+           cookies = self._cookies_for_request(request)
 
-        self._cookies_lock.release()
+           attrs = self._cookie_attrs(cookies)
+           if attrs:
+               if not request.has_header("Cookie"):
+                   request.add_unredirected_header(
+                       "Cookie", "; ".join(attrs))
+
+           # if necessary, advertise that we know RFC 2965
+           if (self._policy.rfc2965 and not self._policy.hide_cookie2 and
+               not request.has_header("Cookie2")):
+               for cookie in cookies:
+                   if cookie.version != 1:
+                       request.add_unredirected_header("Cookie2", '$Version="1"')
+                       break
+   
+        finally:
+           self._cookies_lock.release()
 
         self.clear_expired_cookies()
 
@@ -1602,12 +1604,15 @@
     def set_cookie_if_ok(self, cookie, request):
         """Set a cookie if policy says it's OK to do so."""
         self._cookies_lock.acquire()
-        self._policy._now = self._now = int(time.time())
+        try:
+            self._policy._now = self._now = int(time.time())
 
-        if self._policy.set_ok(cookie, request):
-            self.set_cookie(cookie)
+            if self._policy.set_ok(cookie, request):
+                self.set_cookie(cookie)
+         
 
-        self._cookies_lock.release()
+        finally:
+            self._cookies_lock.release()
 
     def set_cookie(self, cookie):
         """Set a cookie, without checking whether or not it should be set."""
@@ -1626,13 +1631,15 @@
         """Extract cookies from response, where allowable given the request."""
         _debug("extract_cookies: %s", response.info())
         self._cookies_lock.acquire()
-        self._policy._now = self._now = int(time.time())
+        try:
+           self._policy._now = self._now = int(time.time())
 
-        for cookie in self.make_cookies(response, request):
-            if self._policy.set_ok(cookie, request):
-                _debug(" setting cookie: %s", cookie)
-                self.set_cookie(cookie)
-        self._cookies_lock.release()
+           for cookie in self.make_cookies(response, request):
+               if self._policy.set_ok(cookie, request):
+                   _debug(" setting cookie: %s", cookie)
+                   self.set_cookie(cookie)
+        finally:
+           self._cookies_lock.release()
 
     def clear(self, domain=None, path=None, name=None):
         """Clear some cookies.
@@ -1669,10 +1676,12 @@
 
         """
         self._cookies_lock.acquire()
-        for cookie in self:
-            if cookie.discard:
-                self.clear(cookie.domain, cookie.path, cookie.name)
-        self._cookies_lock.release()
+        try:
+           for cookie in self:
+               if cookie.discard:
+                   self.clear(cookie.domain, cookie.path, cookie.name)
+        finally:
+           self._cookies_lock.release()
 
     def clear_expired_cookies(self):
         """Discard all expired cookies.
@@ -1685,11 +1694,13 @@
 
         """
         self._cookies_lock.acquire()
-        now = time.time()
-        for cookie in self:
-            if cookie.is_expired(now):
-                self.clear(cookie.domain, cookie.path, cookie.name)
-        self._cookies_lock.release()
+        try:
+           now = time.time()
+           for cookie in self:
+               if cookie.is_expired(now):
+                   self.clear(cookie.domain, cookie.path, cookie.name)
+        finally:
+           self._cookies_lock.release()
 
     def __iter__(self):
         return deepvalues(self._cookies)
@@ -1761,16 +1772,18 @@
             else: raise ValueError(MISSING_FILENAME_TEXT)
 
         self._cookies_lock.acquire()
-
-        old_state = copy.deepcopy(self._cookies)
-        self._cookies = {}
         try:
-            self.load(filename, ignore_discard, ignore_expires)
-        except (LoadError, IOError):
-            self._cookies = old_state
-            raise
 
-        self._cookies_lock.release()
+           old_state = copy.deepcopy(self._cookies)
+           self._cookies = {}
+           try:
+               self.load(filename, ignore_discard, ignore_expires)
+           except (LoadError, IOError):
+               self._cookies = old_state
+               raise
+
+        finally:
+           self._cookies_lock.release()
 
 from _LWPCookieJar import LWPCookieJar, lwp_cookie_str
 from _MozillaCookieJar import MozillaCookieJar

Modified: python/branches/p3yk-noslice/Lib/difflib.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/difflib.py	(original)
+++ python/branches/p3yk-noslice/Lib/difflib.py	Thu Jan 11 00:21:28 2007
@@ -1310,7 +1310,7 @@
 
 def _mdiff(fromlines, tolines, context=None, linejunk=None,
            charjunk=IS_CHARACTER_JUNK):
-    """Returns generator yielding marked up from/to side by side differences.
+    r"""Returns generator yielding marked up from/to side by side differences.
 
     Arguments:
     fromlines -- list of text lines to compared to tolines

Modified: python/branches/p3yk-noslice/Lib/dumbdbm.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/dumbdbm.py	(original)
+++ python/branches/p3yk-noslice/Lib/dumbdbm.py	Thu Jan 11 00:21:28 2007
@@ -68,7 +68,8 @@
         try:
             f = _open(self._datfile, 'r')
         except IOError:
-            f = _open(self._datfile, 'w', self._mode)
+            f = _open(self._datfile, 'w')
+            self._chmod(self._datfile)
         f.close()
         self._update()
 
@@ -106,7 +107,8 @@
         except self._os.error:
             pass
 
-        f = self._open(self._dirfile, 'w', self._mode)
+        f = self._open(self._dirfile, 'w')
+        self._chmod(self._dirfile)
         for key, pos_and_siz_pair in self._index.iteritems():
             f.write("%r, %r\n" % (key, pos_and_siz_pair))
         f.close()
@@ -152,7 +154,8 @@
     # the in-memory index dict, and append one to the directory file.
     def _addkey(self, key, pos_and_siz_pair):
         self._index[key] = pos_and_siz_pair
-        f = _open(self._dirfile, 'a', self._mode)
+        f = _open(self._dirfile, 'a')
+        self._chmod(self._dirfile)
         f.write("%r, %r\n" % (key, pos_and_siz_pair))
         f.close()
 
@@ -211,6 +214,9 @@
 
     __del__ = close
 
+    def _chmod (self, file):
+        if hasattr(self._os, 'chmod'):
+            self._os.chmod(file, self._mode)
 
 
 def open(file, flag=None, mode=0666):
@@ -227,4 +233,15 @@
 
     """
     # flag argument is currently ignored
+
+    # Modify mode depending on the umask
+    try:
+        um = _os.umask(0)
+        _os.umask(um)
+    except AttributeError:
+        pass
+    else:
+        # Turn off any bits that are set in the umask
+        mode = mode & (~um)
+        
     return _Database(file, mode)

Modified: python/branches/p3yk-noslice/Lib/heapq.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/heapq.py	(original)
+++ python/branches/p3yk-noslice/Lib/heapq.py	Thu Jan 11 00:21:28 2007
@@ -130,7 +130,7 @@
            'nsmallest']
 
 from itertools import islice, repeat, count, imap, izip, tee
-from operator import itemgetter
+from operator import itemgetter, neg
 import bisect
 
 def heappush(heap, item):
@@ -315,8 +315,6 @@
 
     Equivalent to:  sorted(iterable, key=key)[:n]
     """
-    if key is None:
-        return _nsmallest(n, iterable)
     in1, in2 = tee(iterable)
     it = izip(imap(key, in1), count(), in2)                 # decorate
     result = _nsmallest(n, it)
@@ -328,10 +326,8 @@
 
     Equivalent to:  sorted(iterable, key=key, reverse=True)[:n]
     """
-    if key is None:
-        return _nlargest(n, iterable)
     in1, in2 = tee(iterable)
-    it = izip(imap(key, in1), count(), in2)                 # decorate
+    it = izip(imap(key, in1), imap(neg, count()), in2)      # decorate
     result = _nlargest(n, it)
     return map(itemgetter(2), result)                       # undecorate
 

Modified: python/branches/p3yk-noslice/Lib/hmac.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/hmac.py	(original)
+++ python/branches/p3yk-noslice/Lib/hmac.py	Thu Jan 11 00:21:28 2007
@@ -3,13 +3,11 @@
 Implements the HMAC algorithm as described by RFC 2104.
 """
 
-def _strxor(s1, s2):
-    """Utility method. XOR the two strings s1 and s2 (must have same length).
-    """
-    return "".join(map(lambda x, y: chr(ord(x) ^ ord(y)), s1, s2))
+trans_5C = "".join ([chr (x ^ 0x5C) for x in xrange(256)])
+trans_36 = "".join ([chr (x ^ 0x36) for x in xrange(256)])
 
 # The size of the digests returned by HMAC depends on the underlying
-# hashing module used.
+# hashing module used.  Use digest_size from the instance of HMAC instead.
 digest_size = None
 
 # A unique object passed by HMAC.copy() to the HMAC constructor, in order
@@ -22,6 +20,7 @@
 
     This supports the API for Cryptographic Hash Functions (PEP 247).
     """
+    blocksize = 64  # 512-bit HMAC; can be changed in subclasses.
 
     def __init__(self, key, msg = None, digestmod = None):
         """Create a new HMAC object.
@@ -49,16 +48,13 @@
         self.inner = self.digest_cons()
         self.digest_size = self.inner.digest_size
 
-        blocksize = 64
-        ipad = "\x36" * blocksize
-        opad = "\x5C" * blocksize
-
+        blocksize = self.blocksize
         if len(key) > blocksize:
             key = self.digest_cons(key).digest()
 
         key = key + chr(0) * (blocksize - len(key))
-        self.outer.update(_strxor(key, opad))
-        self.inner.update(_strxor(key, ipad))
+        self.outer.update(key.translate(trans_5C))
+        self.inner.update(key.translate(trans_36))
         if msg is not None:
             self.update(msg)
 
@@ -75,13 +71,22 @@
 
         An update to this copy won't affect the original object.
         """
-        other = HMAC(_secret_backdoor_key)
+        other = self.__class__(_secret_backdoor_key)
         other.digest_cons = self.digest_cons
         other.digest_size = self.digest_size
         other.inner = self.inner.copy()
         other.outer = self.outer.copy()
         return other
 
+    def _current(self):
+        """Return a hash object for the current state.
+
+        To be used only internally with digest() and hexdigest().
+        """
+        h = self.outer.copy()
+        h.update(self.inner.digest())
+        return h
+
     def digest(self):
         """Return the hash value of this hashing object.
 
@@ -89,15 +94,14 @@
         not altered in any way by this function; you can continue
         updating the object after calling this function.
         """
-        h = self.outer.copy()
-        h.update(self.inner.digest())
+        h = self._current()
         return h.digest()
 
     def hexdigest(self):
         """Like digest(), but returns a string of hexadecimal digits instead.
         """
-        return "".join([hex(ord(x))[2:].zfill(2)
-                        for x in tuple(self.digest())])
+        h = self._current()
+        return h.hexdigest()
 
 def new(key, msg = None, digestmod = None):
     """Create a new hashing object and return it.

Modified: python/branches/p3yk-noslice/Lib/idlelib/AutoCompleteWindow.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/idlelib/AutoCompleteWindow.py	(original)
+++ python/branches/p3yk-noslice/Lib/idlelib/AutoCompleteWindow.py	Thu Jan 11 00:21:28 2007
@@ -118,8 +118,11 @@
             i = 0
             while i < len(lts) and i < len(selstart) and lts[i] == selstart[i]:
                 i += 1
-            while cursel > 0 and selstart[:i] <= self.completions[cursel-1]:
+            previous_completion = self.completions[cursel - 1]
+            while cursel > 0 and selstart[:i] <= previous_completion:
                 i += 1
+                if selstart == previous_completion:
+                    break  # maybe we have a duplicate?
             newstart = selstart[:i]
         self._change_start(newstart)
 

Modified: python/branches/p3yk-noslice/Lib/idlelib/NEWS.txt
==============================================================================
--- python/branches/p3yk-noslice/Lib/idlelib/NEWS.txt	(original)
+++ python/branches/p3yk-noslice/Lib/idlelib/NEWS.txt	Thu Jan 11 00:21:28 2007
@@ -3,9 +3,14 @@
 
 *Release date: XX-XXX-200X*
 
+- Avoid hang when encountering a duplicate in a completion list. Bug 1571112.
+
 - Patch #1362975: Rework CodeContext indentation algorithm to
   avoid hard-coding pixel widths.
 
+- Bug #813342: Start the IDLE subprocess with -Qnew if the parent
+  is started with that option.
+
 - Some syntax errors were being caught by tokenize during the tabnanny
   check, resulting in obscure error messages.  Do the syntax check
   first.  Bug 1562716, 1562719
@@ -14,6 +19,12 @@
   the Python release of which it's a part.
 
 
+What's New in IDLE 1.2?
+=======================
+
+*Release date: 19-SEP-2006*
+
+
 What's New in IDLE 1.2c1?
 =========================
 
@@ -44,6 +55,13 @@
 
 *Release date: 03-AUG-2006*
 
+- Bug #1525817: Don't truncate short lines in IDLE's tool tips.
+
+- Bug #1517990: IDLE keybindings on MacOS X now work correctly
+
+- Bug #1517996: IDLE now longer shows the default Tk menu when a
+  path browser, class browser or debugger is the frontmost window on MacOS X
+
 - EditorWindow.test() was failing.  Bug 1417598
 
 - EditorWindow failed when used stand-alone if sys.ps1 not set.
@@ -80,6 +98,8 @@
 
 *Release date: 05-APR-2006*
 
+- Patch #1162825: Support non-ASCII characters in IDLE window titles.
+
 - Source file f.flush() after writing; trying to avoid lossage if user
   kills GUI.
 

Modified: python/branches/p3yk-noslice/Lib/logging/__init__.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/logging/__init__.py	(original)
+++ python/branches/p3yk-noslice/Lib/logging/__init__.py	Thu Jan 11 00:21:28 2007
@@ -41,8 +41,8 @@
 
 __author__  = "Vinay Sajip <vinay_sajip at red-dove.com>"
 __status__  = "production"
-__version__ = "0.4.9.9"
-__date__    = "06 February 2006"
+__version__ = "0.5.0.0"
+__date__    = "08 January 2007"
 
 #---------------------------------------------------------------------------
 #   Miscellaneous module data
@@ -243,7 +243,7 @@
         try:
             self.filename = os.path.basename(pathname)
             self.module = os.path.splitext(self.filename)[0]
-        except:
+        except (TypeError, ValueError, AttributeError):
             self.filename = pathname
             self.module = "Unknown module"
         self.exc_info = exc_info

Modified: python/branches/p3yk-noslice/Lib/logging/handlers.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/logging/handlers.py	(original)
+++ python/branches/p3yk-noslice/Lib/logging/handlers.py	Thu Jan 11 00:21:28 2007
@@ -347,7 +347,7 @@
             try:
                 self.sock = self.makeSocket()
                 self.retryTime = None # next time, no delay before trying
-            except:
+            except socket.error:
                 #Creation failed, so set the retry time and return.
                 if self.retryTime is None:
                     self.retryPeriod = self.retryStart
@@ -738,7 +738,7 @@
             import smtplib
             try:
                 from email.Utils import formatdate
-            except:
+            except ImportError:
                 formatdate = self.date_time
             port = self.mailport
             if not port:

Modified: python/branches/p3yk-noslice/Lib/mailbox.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/mailbox.py	(original)
+++ python/branches/p3yk-noslice/Lib/mailbox.py	Thu Jan 11 00:21:28 2007
@@ -510,6 +510,7 @@
         self._next_key = 0
         self._pending = False   # No changes require rewriting the file.
         self._locked = False
+        self._file_length = None        # Used to record mailbox size
 
     def add(self, message):
         """Add message and return assigned key."""
@@ -563,7 +564,21 @@
         """Write any pending changes to disk."""
         if not self._pending:
             return
-        self._lookup()
+
+        # In order to be writing anything out at all, self._toc must
+        # already have been generated (and presumably has been modified
+        # by adding or deleting an item).
+        assert self._toc is not None
+        
+        # Check length of self._file; if it's changed, some other process
+        # has modified the mailbox since we scanned it.
+        self._file.seek(0, 2)
+        cur_len = self._file.tell()
+        if cur_len != self._file_length:
+            raise ExternalClashError('Size of mailbox file changed '
+                                     '(expected %i, found %i)' %
+                                     (self._file_length, cur_len))
+        
         new_file = _create_temporary(self._path)
         try:
             new_toc = {}
@@ -639,6 +654,7 @@
         offsets = self._install_message(message)
         self._post_message_hook(self._file)
         self._file.flush()
+        self._file_length = self._file.tell()  # Record current length of mailbox
         return offsets
 
 
@@ -730,6 +746,7 @@
                 break
         self._toc = dict(enumerate(zip(starts, stops)))
         self._next_key = len(self._toc)
+        self._file_length = self._file.tell()
 
 
 class MMDF(_mboxMMDF):
@@ -773,6 +790,8 @@
                 break
         self._toc = dict(enumerate(zip(starts, stops)))
         self._next_key = len(self._toc)
+        self._file.seek(0, 2)
+        self._file_length = self._file.tell()
 
 
 class MH(Mailbox):
@@ -1198,7 +1217,9 @@
         self._toc = dict(enumerate(zip(starts, stops)))
         self._labels = dict(enumerate(label_lists))
         self._next_key = len(self._toc)
-
+        self._file.seek(0, 2)
+        self._file_length = self._file.tell()
+        
     def _pre_mailbox_hook(self, f):
         """Called before writing the mailbox to file f."""
         f.write('BABYL OPTIONS:%sVersion: 5%sLabels:%s%s\037' %
@@ -1884,7 +1905,8 @@
 def _sync_flush(f):
     """Ensure changes to file f are physically on disk."""
     f.flush()
-    os.fsync(f.fileno())
+    if hasattr(os, 'fsync'):
+        os.fsync(f.fileno())
 
 def _sync_close(f):
     """Close file f, ensuring all changes are physically on disk."""

Modified: python/branches/p3yk-noslice/Lib/pty.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/pty.py	(original)
+++ python/branches/p3yk-noslice/Lib/pty.py	Thu Jan 11 00:21:28 2007
@@ -121,7 +121,9 @@
         # Explicitly open the tty to make it become a controlling tty.
         tmp_fd = os.open(os.ttyname(STDOUT_FILENO), os.O_RDWR)
         os.close(tmp_fd)
-
+    else:
+        os.close(slave_fd)
+        
     # Parent and child process.
     return pid, master_fd
 

Modified: python/branches/p3yk-noslice/Lib/pydoc.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/pydoc.py	(original)
+++ python/branches/p3yk-noslice/Lib/pydoc.py	Thu Jan 11 00:21:28 2007
@@ -1741,6 +1741,9 @@
 Sorry, topic and keyword documentation is not available because the Python
 HTML documentation files could not be found.  If you have installed them,
 please set the environment variable PYTHONDOCS to indicate their location.
+
+On the Microsoft Windows operating system, the files can be built by
+running "hh -decompile . PythonNN.chm" in the C:\PythonNN\Doc> directory.
 ''')
             return
         target = self.topics.get(topic, self.keywords.get(topic))

Modified: python/branches/p3yk-noslice/Lib/random.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/random.py	(original)
+++ python/branches/p3yk-noslice/Lib/random.py	Thu Jan 11 00:21:28 2007
@@ -205,7 +205,7 @@
             raise ValueError, "empty range for randrange()"
 
         if n >= maxwidth:
-            return istart + self._randbelow(n)
+            return istart + istep*self._randbelow(n)
         return istart + istep*int(self.random() * n)
 
     def randint(self, a, b):

Modified: python/branches/p3yk-noslice/Lib/subprocess.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/subprocess.py	(original)
+++ python/branches/p3yk-noslice/Lib/subprocess.py	Thu Jan 11 00:21:28 2007
@@ -166,7 +166,7 @@
 communicate(input=None)
     Interact with process: Send data to stdin.  Read data from stdout
     and stderr, until end-of-file is reached.  Wait for process to
-    terminate.  The optional stdin argument should be a string to be
+    terminate.  The optional input argument should be a string to be
     sent to the child process, or None, if no data should be sent to
     the child.
 
@@ -1005,8 +1005,12 @@
 
                     # Close pipe fds.  Make sure we don't close the same
                     # fd more than once, or standard fds.
-                    for fd in set((p2cread, c2pwrite, errwrite))-set((0,1,2)):
-                        if fd: os.close(fd)
+                    if p2cread and p2cread not in (0,):
+                        os.close(p2cread)
+                    if c2pwrite and c2pwrite not in (p2cread, 1):
+                        os.close(c2pwrite)
+                    if errwrite and errwrite not in (p2cread, c2pwrite, 2):
+                        os.close(errwrite)
 
                     # Close all other fds, if asked for
                     if close_fds:
@@ -1108,6 +1112,7 @@
                 read_set.append(self.stderr)
                 stderr = []
 
+            input_offset = 0
             while read_set or write_set:
                 rlist, wlist, xlist = select.select(read_set, write_set, [])
 
@@ -1115,9 +1120,9 @@
                     # When select has indicated that the file is writable,
                     # we can write up to PIPE_BUF bytes without risk
                     # blocking.  POSIX defines PIPE_BUF >= 512
-                    bytes_written = os.write(self.stdin.fileno(), input[:512])
-                    input = input[bytes_written:]
-                    if not input:
+                    bytes_written = os.write(self.stdin.fileno(), buffer(input, input_offset, 512))
+                    input_offset += bytes_written 
+                    if input_offset >= len(input):
                         self.stdin.close()
                         write_set.remove(self.stdin)
 

Modified: python/branches/p3yk-noslice/Lib/symbol.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/symbol.py	(original)
+++ python/branches/p3yk-noslice/Lib/symbol.py	Thu Jan 11 00:21:28 2007
@@ -17,82 +17,87 @@
 decorators = 260
 funcdef = 261
 parameters = 262
-varargslist = 263
-fpdef = 264
-fplist = 265
-stmt = 266
-simple_stmt = 267
-small_stmt = 268
-expr_stmt = 269
-augassign = 270
-print_stmt = 271
-del_stmt = 272
-pass_stmt = 273
-flow_stmt = 274
-break_stmt = 275
-continue_stmt = 276
-return_stmt = 277
-yield_stmt = 278
-raise_stmt = 279
-import_stmt = 280
-import_name = 281
-import_from = 282
-import_as_name = 283
-dotted_as_name = 284
-import_as_names = 285
-dotted_as_names = 286
-dotted_name = 287
-global_stmt = 288
-assert_stmt = 289
-compound_stmt = 290
-if_stmt = 291
-while_stmt = 292
-for_stmt = 293
-try_stmt = 294
-with_stmt = 295
-with_var = 296
-except_clause = 297
-suite = 298
-testlist_safe = 299
-old_test = 300
-old_lambdef = 301
-test = 302
-or_test = 303
-and_test = 304
-not_test = 305
-comparison = 306
-comp_op = 307
-expr = 308
-xor_expr = 309
-and_expr = 310
-shift_expr = 311
-arith_expr = 312
-term = 313
-factor = 314
-power = 315
-atom = 316
-listmaker = 317
-testlist_gexp = 318
-lambdef = 319
-trailer = 320
-subscriptlist = 321
-subscript = 322
-sliceop = 323
-exprlist = 324
-testlist = 325
-dictsetmaker = 326
-classdef = 327
-arglist = 328
-argument = 329
-list_iter = 330
-list_for = 331
-list_if = 332
-gen_iter = 333
-gen_for = 334
-gen_if = 335
-testlist1 = 336
-encoding_decl = 337
-yield_expr = 338
+typedargslist = 263
+tname = 264
+tfpdef = 265
+tfplist = 266
+varargslist = 267
+vname = 268
+vfpdef = 269
+vfplist = 270
+stmt = 271
+simple_stmt = 272
+small_stmt = 273
+expr_stmt = 274
+augassign = 275
+print_stmt = 276
+del_stmt = 277
+pass_stmt = 278
+flow_stmt = 279
+break_stmt = 280
+continue_stmt = 281
+return_stmt = 282
+yield_stmt = 283
+raise_stmt = 284
+import_stmt = 285
+import_name = 286
+import_from = 287
+import_as_name = 288
+dotted_as_name = 289
+import_as_names = 290
+dotted_as_names = 291
+dotted_name = 292
+global_stmt = 293
+assert_stmt = 294
+compound_stmt = 295
+if_stmt = 296
+while_stmt = 297
+for_stmt = 298
+try_stmt = 299
+with_stmt = 300
+with_var = 301
+except_clause = 302
+suite = 303
+testlist_safe = 304
+old_test = 305
+old_lambdef = 306
+test = 307
+or_test = 308
+and_test = 309
+not_test = 310
+comparison = 311
+comp_op = 312
+expr = 313
+xor_expr = 314
+and_expr = 315
+shift_expr = 316
+arith_expr = 317
+term = 318
+factor = 319
+power = 320
+atom = 321
+listmaker = 322
+testlist_gexp = 323
+lambdef = 324
+trailer = 325
+subscriptlist = 326
+subscript = 327
+sliceop = 328
+exprlist = 329
+testlist = 330
+dictsetmaker = 331
+classdef = 332
+arglist = 333
+argument = 334
+list_iter = 335
+list_for = 336
+list_if = 337
+gen_iter = 338
+gen_for = 339
+gen_if = 340
+testlist1 = 341
+encoding_decl = 342
+yield_expr = 343
 #--end constants--
 
 sym_name = {}

Modified: python/branches/p3yk-noslice/Lib/tarfile.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/tarfile.py	(original)
+++ python/branches/p3yk-noslice/Lib/tarfile.py	Thu Jan 11 00:21:28 2007
@@ -147,7 +147,10 @@
     # There are two possible encodings for a number field, see
     # itn() below.
     if s[0] != chr(0200):
-        n = int(s.rstrip(NUL + " ") or "0", 8)
+        try:
+            n = int(s.rstrip(NUL + " ") or "0", 8)
+        except ValueError:
+            raise HeaderError("invalid header")
     else:
         n = 0L
         for i in xrange(len(s) - 1):
@@ -282,6 +285,9 @@
 class StreamError(TarError):
     """Exception for unsupported operations on stream-like TarFiles."""
     pass
+class HeaderError(TarError):
+    """Exception for invalid headers."""
+    pass
 
 #---------------------------
 # internal stream interface
@@ -624,140 +630,194 @@
 #------------------------
 # Extraction file object
 #------------------------
-class ExFileObject(object):
-    """File-like object for reading an archive member.
-       Is returned by TarFile.extractfile(). Support for
-       sparse files included.
+class _FileInFile(object):
+    """A thin wrapper around an existing file object that
+       provides a part of its data as an individual file
+       object.
     """
 
-    def __init__(self, tarfile, tarinfo):
-        self.fileobj = tarfile.fileobj
-        self.name    = tarinfo.name
-        self.mode    = "r"
-        self.closed  = False
-        self.offset  = tarinfo.offset_data
-        self.size    = tarinfo.size
-        self.pos     = 0L
-        self.linebuffer = ""
-        if tarinfo.issparse():
-            self.sparse = tarinfo.sparse
-            self.read = self._readsparse
-        else:
-            self.read = self._readnormal
+    def __init__(self, fileobj, offset, size, sparse=None):
+        self.fileobj = fileobj
+        self.offset = offset
+        self.size = size
+        self.sparse = sparse
+        self.position = 0
 
-    def __read(self, size):
-        """Overloadable read method.
+    def tell(self):
+        """Return the current file position.
         """
-        return self.fileobj.read(size)
+        return self.position
 
-    def readline(self, size=-1):
-        """Read a line with approx. size. If size is negative,
-           read a whole line. readline() and read() must not
-           be mixed up (!).
-        """
-        if size < 0:
-            size = sys.maxint
-
-        nl = self.linebuffer.find("\n")
-        if nl >= 0:
-            nl = min(nl, size)
-        else:
-            size -= len(self.linebuffer)
-            while (nl < 0 and size > 0):
-                buf = self.read(min(size, 100))
-                if not buf:
-                    break
-                self.linebuffer += buf
-                size -= len(buf)
-                nl = self.linebuffer.find("\n")
-            if nl == -1:
-                s = self.linebuffer
-                self.linebuffer = ""
-                return s
-        buf = self.linebuffer[:nl]
-        self.linebuffer = self.linebuffer[nl + 1:]
-        while buf[-1:] == "\r":
-            buf = buf[:-1]
-        return buf + "\n"
-
-    def readlines(self):
-        """Return a list with all (following) lines.
+    def seek(self, position):
+        """Seek to a position in the file.
         """
-        result = []
-        while True:
-            line = self.readline()
-            if not line: break
-            result.append(line)
-        return result
+        self.position = position
 
-    def _readnormal(self, size=None):
-        """Read operation for regular files.
+    def read(self, size=None):
+        """Read data from the file.
         """
-        if self.closed:
-            raise ValueError("file is closed")
-        self.fileobj.seek(self.offset + self.pos)
-        bytesleft = self.size - self.pos
         if size is None:
-            bytestoread = bytesleft
+            size = self.size - self.position
         else:
-            bytestoread = min(size, bytesleft)
-        self.pos += bytestoread
-        return self.__read(bytestoread)
+            size = min(size, self.size - self.position)
 
-    def _readsparse(self, size=None):
-        """Read operation for sparse files.
-        """
-        if self.closed:
-            raise ValueError("file is closed")
+        if self.sparse is None:
+            return self.readnormal(size)
+        else:
+            return self.readsparse(size)
 
-        if size is None:
-            size = self.size - self.pos
+    def readnormal(self, size):
+        """Read operation for regular files.
+        """
+        self.fileobj.seek(self.offset + self.position)
+        self.position += size
+        return self.fileobj.read(size)
 
+    def readsparse(self, size):
+        """Read operation for sparse files.
+        """
         data = []
         while size > 0:
-            buf = self._readsparsesection(size)
+            buf = self.readsparsesection(size)
             if not buf:
                 break
             size -= len(buf)
             data.append(buf)
         return "".join(data)
 
-    def _readsparsesection(self, size):
+    def readsparsesection(self, size):
         """Read a single section of a sparse file.
         """
-        section = self.sparse.find(self.pos)
+        section = self.sparse.find(self.position)
 
         if section is None:
             return ""
 
-        toread = min(size, section.offset + section.size - self.pos)
+        size = min(size, section.offset + section.size - self.position)
+
         if isinstance(section, _data):
-            realpos = section.realpos + self.pos - section.offset
-            self.pos += toread
+            realpos = section.realpos + self.position - section.offset
             self.fileobj.seek(self.offset + realpos)
-            return self.__read(toread)
+            self.position += size
+            return self.fileobj.read(size)
+        else:
+            self.position += size
+            return NUL * size
+#class _FileInFile
+
+
+class ExFileObject(object):
+    """File-like object for reading an archive member.
+       Is returned by TarFile.extractfile().
+    """
+    blocksize = 1024
+
+    def __init__(self, tarfile, tarinfo):
+        self.fileobj = _FileInFile(tarfile.fileobj,
+                                   tarinfo.offset_data,
+                                   tarinfo.size,
+                                   getattr(tarinfo, "sparse", None))
+        self.name = tarinfo.name
+        self.mode = "r"
+        self.closed = False
+        self.size = tarinfo.size
+
+        self.position = 0
+        self.buffer = ""
+
+    def read(self, size=None):
+        """Read at most size bytes from the file. If size is not
+           present or None, read all data until EOF is reached.
+        """
+        if self.closed:
+            raise ValueError("I/O operation on closed file")
+
+        buf = ""
+        if self.buffer:
+            if size is None:
+                buf = self.buffer
+                self.buffer = ""
+            else:
+                buf = self.buffer[:size]
+                self.buffer = self.buffer[size:]
+
+        if size is None:
+            buf += self.fileobj.read()
         else:
-            self.pos += toread
-            return NUL * toread
+            buf += self.fileobj.read(size - len(buf))
+
+        self.position += len(buf)
+        return buf
+
+    def readline(self, size=-1):
+        """Read one entire line from the file. If size is present
+           and non-negative, return a string with at most that
+           size, which may be an incomplete line.
+        """
+        if self.closed:
+            raise ValueError("I/O operation on closed file")
+
+        if "\n" in self.buffer:
+            pos = self.buffer.find("\n") + 1
+        else:
+            buffers = [self.buffer]
+            while True:
+                buf = self.fileobj.read(self.blocksize)
+                buffers.append(buf)
+                if not buf or "\n" in buf:
+                    self.buffer = "".join(buffers)
+                    pos = self.buffer.find("\n") + 1
+                    if pos == 0:
+                        # no newline found.
+                        pos = len(self.buffer)
+                    break
+
+        if size != -1:
+            pos = min(size, pos)
+
+        buf = self.buffer[:pos]
+        self.buffer = self.buffer[pos:]
+        self.position += len(buf)
+        return buf
+
+    def readlines(self):
+        """Return a list with all remaining lines.
+        """
+        result = []
+        while True:
+            line = self.readline()
+            if not line: break
+            result.append(line)
+        return result
 
     def tell(self):
         """Return the current file position.
         """
-        return self.pos
+        if self.closed:
+            raise ValueError("I/O operation on closed file")
+
+        return self.position
 
-    def seek(self, pos, whence=0):
+    def seek(self, pos, whence=os.SEEK_SET):
         """Seek to a position in the file.
         """
-        self.linebuffer = ""
-        if whence == 0:
-            self.pos = min(max(pos, 0), self.size)
-        if whence == 1:
+        if self.closed:
+            raise ValueError("I/O operation on closed file")
+
+        if whence == os.SEEK_SET:
+            self.position = min(max(pos, 0), self.size)
+        elif whence == os.SEEK_CUR:
             if pos < 0:
-                self.pos = max(self.pos + pos, 0)
+                self.position = max(self.position + pos, 0)
             else:
-                self.pos = min(self.pos + pos, self.size)
-        if whence == 2:
-            self.pos = max(min(self.size + pos, self.size), 0)
+                self.position = min(self.position + pos, self.size)
+        elif whence == os.SEEK_END:
+            self.position = max(min(self.size + pos, self.size), 0)
+        else:
+            raise ValueError("Invalid argument")
+
+        self.buffer = ""
+        self.fileobj.seek(self.position)
 
     def close(self):
         """Close the file object.
@@ -765,20 +825,13 @@
         self.closed = True
 
     def __iter__(self):
-        """Get an iterator over the file object.
-        """
-        if self.closed:
-            raise ValueError("I/O operation on closed file")
-        return self
-
-    def next(self):
-        """Get the next item from the file iterator.
+        """Get an iterator over the file's lines.
         """
-        result = self.readline()
-        if not result:
-            raise StopIteration
-        return result
-
+        while True:
+            line = self.readline()
+            if not line:
+                break
+            yield line
 #class ExFileObject
 
 #------------------
@@ -821,9 +874,13 @@
         """Construct a TarInfo object from a 512 byte string buffer.
         """
         if len(buf) != BLOCKSIZE:
-            raise ValueError("truncated header")
+            raise HeaderError("truncated header")
         if buf.count(NUL) == BLOCKSIZE:
-            raise ValueError("empty header")
+            raise HeaderError("empty header")
+
+        chksum = nti(buf[148:156])
+        if chksum not in calc_chksums(buf):
+            raise HeaderError("bad checksum")
 
         tarinfo = cls()
         tarinfo.buf = buf
@@ -833,7 +890,7 @@
         tarinfo.gid = nti(buf[116:124])
         tarinfo.size = nti(buf[124:136])
         tarinfo.mtime = nti(buf[136:148])
-        tarinfo.chksum = nti(buf[148:156])
+        tarinfo.chksum = chksum
         tarinfo.type = buf[156:157]
         tarinfo.linkname = buf[157:257].rstrip(NUL)
         tarinfo.uname = buf[265:297].rstrip(NUL)
@@ -845,8 +902,6 @@
         if prefix and not tarinfo.issparse():
             tarinfo.name = prefix + "/" + tarinfo.name
 
-        if tarinfo.chksum not in calc_chksums(buf):
-            raise ValueError("invalid header")
         return tarinfo
 
     def tobuf(self, posix=False):
@@ -999,7 +1054,7 @@
            can be determined, `mode' is overridden by `fileobj's mode.
            `fileobj' is not closed, when TarFile is closed.
         """
-        self.name = name
+        self.name = os.path.abspath(name)
 
         if len(mode) > 1 or mode not in "raw":
             raise ValueError("mode must be 'r', 'a' or 'w'")
@@ -1011,7 +1066,7 @@
             self._extfileobj = False
         else:
             if self.name is None and hasattr(fileobj, "name"):
-                self.name = fileobj.name
+                self.name = os.path.abspath(fileobj.name)
             if hasattr(fileobj, "mode"):
                 self.mode = fileobj.mode
             self._extfileobj = True
@@ -1088,9 +1143,13 @@
             # Find out which *open() is appropriate for opening the file.
             for comptype in cls.OPEN_METH:
                 func = getattr(cls, cls.OPEN_METH[comptype])
+                if fileobj is not None:
+                    saved_pos = fileobj.tell()
                 try:
                     return func(name, "r", fileobj)
                 except (ReadError, CompressionError):
+                    if fileobj is not None:
+                        fileobj.seek(saved_pos)
                     continue
             raise ReadError("file could not be opened successfully")
 
@@ -1147,24 +1206,12 @@
         except (ImportError, AttributeError):
             raise CompressionError("gzip module is not available")
 
-        pre, ext = os.path.splitext(name)
-        pre = os.path.basename(pre)
-        if ext == ".tgz":
-            ext = ".tar"
-        if ext == ".gz":
-            ext = ""
-        tarname = pre + ext
-
         if fileobj is None:
             fileobj = _open(name, mode + "b")
 
-        if mode != "r":
-            name = tarname
-
         try:
-            t = cls.taropen(tarname, mode,
-                gzip.GzipFile(name, mode, compresslevel, fileobj)
-            )
+            t = cls.taropen(name, mode,
+                gzip.GzipFile(name, mode, compresslevel, fileobj))
         except IOError:
             raise ReadError("not a gzip file")
         t._extfileobj = False
@@ -1183,21 +1230,13 @@
         except ImportError:
             raise CompressionError("bz2 module is not available")
 
-        pre, ext = os.path.splitext(name)
-        pre = os.path.basename(pre)
-        if ext == ".tbz2":
-            ext = ".tar"
-        if ext == ".bz2":
-            ext = ""
-        tarname = pre + ext
-
         if fileobj is not None:
             fileobj = _BZ2Proxy(fileobj, mode)
         else:
             fileobj = bz2.BZ2File(name, mode, compresslevel=compresslevel)
 
         try:
-            t = cls.taropen(tarname, mode, fileobj)
+            t = cls.taropen(name, mode, fileobj)
         except IOError:
             raise ReadError("not a bzip2 file")
         t._extfileobj = False
@@ -1402,8 +1441,7 @@
             arcname = name
 
         # Skip if somebody tries to archive the archive...
-        if self.name is not None \
-            and os.path.abspath(name) == os.path.abspath(self.name):
+        if self.name is not None and os.path.abspath(name) == self.name:
             self._dbg(2, "tarfile: Skipped %r" % name)
             return
 
@@ -1795,16 +1833,14 @@
 
                 tarinfo = self.proc_member(tarinfo)
 
-            except ValueError, e:
+            except HeaderError, e:
                 if self.ignore_zeros:
-                    self._dbg(2, "0x%X: empty or invalid block: %s" %
-                              (self.offset, e))
+                    self._dbg(2, "0x%X: %s" % (self.offset, e))
                     self.offset += BLOCKSIZE
                     continue
                 else:
                     if self.offset == 0:
-                        raise ReadError("empty, unreadable or compressed "
-                                        "file: %s" % e)
+                        raise ReadError(str(e))
                     return None
             break
 

Modified: python/branches/p3yk-noslice/Lib/test/output/test_tokenize
==============================================================================
--- python/branches/p3yk-noslice/Lib/test/output/test_tokenize	(original)
+++ python/branches/p3yk-noslice/Lib/test/output/test_tokenize	Thu Jan 11 00:21:28 2007
@@ -682,4 +682,20 @@
 177,11-177,15:	NAME	'pass'
 177,15-177,16:	NEWLINE	'\n'
 178,0-178,1:	NL	'\n'
-179,0-179,0:	ENDMARKER	''
+179,0-179,1:	OP	'@'
+179,1-179,13:	NAME	'staticmethod'
+179,13-179,14:	NEWLINE	'\n'
+180,0-180,3:	NAME	'def'
+180,4-180,7:	NAME	'foo'
+180,7-180,8:	OP	'('
+180,8-180,9:	NAME	'x'
+180,9-180,10:	OP	':'
+180,10-180,11:	NUMBER	'1'
+180,11-180,12:	OP	')'
+180,12-180,14:	OP	'->'
+180,14-180,15:	NUMBER	'1'
+180,15-180,16:	OP	':'
+180,17-180,21:	NAME	'pass'
+180,21-180,22:	NEWLINE	'\n'
+181,0-181,1:	NL	'\n'
+182,0-182,0:	ENDMARKER	''

Modified: python/branches/p3yk-noslice/Lib/test/test_ast.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/test/test_ast.py	(original)
+++ python/branches/p3yk-noslice/Lib/test/test_ast.py	Thu Jan 11 00:21:28 2007
@@ -151,9 +151,9 @@
 
 #### EVERYTHING BELOW IS GENERATED #####
 exec_results = [
-('Module', [('FunctionDef', (1, 0), 'f', ('arguments', [], None, [], None, [], []), [('Pass', (1, 9))], [])]),
+('Module', [('FunctionDef', (1, 0), 'f', ('arguments', [], None, None, [], None, None, [], []), [('Pass', (1, 9))], [], None)]),
 ('Module', [('ClassDef', (1, 0), 'C', [], [('Pass', (1, 8))])]),
-('Module', [('FunctionDef', (1, 0), 'f', ('arguments', [], None, [], None, [], []), [('Return', (1, 8), ('Num', (1, 15), 1))], [])]),
+('Module', [('FunctionDef', (1, 0), 'f', ('arguments', [], None, None, [], None, None, [], []), [('Return', (1, 8), ('Num', (1, 15), 1))], [], None)]),
 ('Module', [('Delete', (1, 0), [('Name', (1, 4), 'v', ('Del',))])]),
 ('Module', [('Assign', (1, 0), [('Name', (1, 0), 'v', ('Store',))], ('Num', (1, 4), 1))]),
 ('Module', [('AugAssign', (1, 0), ('Name', (1, 0), 'v', ('Store',)), ('Add',), ('Num', (1, 5), 1))]),
@@ -180,13 +180,13 @@
 ('Expression', ('BoolOp', (1, 0), ('And',), [('Name', (1, 0), 'a', ('Load',)), ('Name', (1, 6), 'b', ('Load',))])),
 ('Expression', ('BinOp', (1, 0), ('Name', (1, 0), 'a', ('Load',)), ('Add',), ('Name', (1, 4), 'b', ('Load',)))),
 ('Expression', ('UnaryOp', (1, 0), ('Not',), ('Name', (1, 4), 'v', ('Load',)))),
-('Expression', ('Lambda', (1, 0), ('arguments', [], None, [], None, [], []), ('Name', (1, 7), 'None', ('Load',)))),
+('Expression', ('Lambda', (1, 0), ('arguments', [], None, None, [], None, None, [], []), ('Name', (1, 7), 'None', ('Load',)))),
 ('Expression', ('Dict', (1, 0), [('Num', (1, 2), 1)], [('Num', (1, 4), 2)])),
 ('Expression', ('ListComp', (1, 1), ('Name', (1, 1), 'a', ('Load',)), [('comprehension', ('Name', (1, 7), 'b', ('Store',)), ('Name', (1, 12), 'c', ('Load',)), [('Name', (1, 17), 'd', ('Load',))])])),
 ('Expression', ('GeneratorExp', (1, 1), ('Name', (1, 1), 'a', ('Load',)), [('comprehension', ('Name', (1, 7), 'b', ('Store',)), ('Name', (1, 12), 'c', ('Load',)), [('Name', (1, 17), 'd', ('Load',))])])),
 ('Expression', ('Compare', (1, 0), ('Num', (1, 0), 1), [('Lt',), ('Lt',)], [('Num', (1, 4), 2), ('Num', (1, 8), 3)])),
 ('Expression', ('Call', (1, 0), ('Name', (1, 0), 'f', ('Load',)), [('Num', (1, 2), 1), ('Num', (1, 4), 2)], [('keyword', 'c', ('Num', (1, 8), 3))], ('Name', (1, 11), 'd', ('Load',)), ('Name', (1, 15), 'e', ('Load',)))),
-('Expression', ('Num', (1, 0), 10L)),
+('Expression', ('Num', (1, 0), 10)),
 ('Expression', ('Str', (1, 0), 'string')),
 ('Expression', ('Attribute', (1, 0), ('Name', (1, 0), 'a', ('Load',)), 'b', ('Load',))),
 ('Expression', ('Subscript', (1, 0), ('Name', (1, 0), 'a', ('Load',)), ('Slice', ('Name', (1, 2), 'b', ('Load',)), ('Name', (1, 4), 'c', ('Load',)), None), ('Load',))),

Modified: python/branches/p3yk-noslice/Lib/test/test_builtin.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/test/test_builtin.py	(original)
+++ python/branches/p3yk-noslice/Lib/test/test_builtin.py	Thu Jan 11 00:21:28 2007
@@ -845,30 +845,6 @@
         self.assertEqual(int(Foo4()), 42L)
         self.assertRaises(TypeError, int, Foo5())
 
-    def test_intern(self):
-        self.assertRaises(TypeError, intern)
-        s = "never interned before"
-        self.assert_(intern(s) is s)
-        s2 = s.swapcase().swapcase()
-        self.assert_(intern(s2) is s)
-
-        # Subclasses of string can't be interned, because they
-        # provide too much opportunity for insane things to happen.
-        # We don't want them in the interned dict and if they aren't
-        # actually interned, we don't want to create the appearance
-        # that they are by allowing intern() to succeeed.
-        class S(str):
-            def __hash__(self):
-                return 123
-
-        self.assertRaises(TypeError, intern, S("abc"))
-
-        # It's still safe to pass these strings to routines that
-        # call intern internally, e.g. PyObject_SetAttr().
-        s = S("abc")
-        setattr(s, s, s)
-        self.assertEqual(getattr(s, s), s)
-
     def test_iter(self):
         self.assertRaises(TypeError, iter)
         self.assertRaises(TypeError, iter, 42, 42)

Modified: python/branches/p3yk-noslice/Lib/test/test_compile.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/test/test_compile.py	(original)
+++ python/branches/p3yk-noslice/Lib/test/test_compile.py	Thu Jan 11 00:21:28 2007
@@ -1,5 +1,4 @@
 import unittest
-import warnings
 import sys
 from test import test_support
 

Modified: python/branches/p3yk-noslice/Lib/test/test_compiler.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/test/test_compiler.py	(original)
+++ python/branches/p3yk-noslice/Lib/test/test_compiler.py	Thu Jan 11 00:21:28 2007
@@ -115,6 +115,24 @@
         dct = {}
         exec(c, dct)
         self.assertEquals(dct.get('result'), 3)
+        c = compiler.compile('def g(a):\n'
+                             '    def f(): return a + 2\n'
+                             '    return f()\n'
+                             'result = g(1)',
+                             '<string>',
+                             'exec')
+        dct = {}
+        exec(c, dct)
+        self.assertEquals(dct.get('result'), 3)
+        c = compiler.compile('def g((a, b)):\n'
+                             '    def f(): return a + b\n'
+                             '    return f()\n'
+                             'result = g((1, 2))',
+                             '<string>',
+                             'exec')
+        dct = {}
+        exec(c, dct)
+        self.assertEquals(dct.get('result'), 3)
 
     def testGenExp(self):
         c = compiler.compile('list((i,j) for i in range(3) if i < 3'
@@ -123,6 +141,22 @@
                              'eval')
         self.assertEquals(eval(c), [(0, 3), (1, 3), (2, 3)])
 
+    def testFuncAnnotations(self):
+        testdata = [
+            ('def f(a: 1): pass', {'a': 1}),
+            ('''def f(a, (b:1, c:2, d), e:3=4, f=5,
+                    *g:6, h:7, i=8, j:9=10, **k:11) -> 12: pass
+             ''', {'b': 1, 'c': 2, 'e': 3, 'g': 6, 'h': 7, 'j': 9,
+                   'k': 11, 'return': 12}),
+        ]
+        for sourcecode, expected in testdata:
+            # avoid IndentationError: unexpected indent from trailing lines
+            sourcecode = sourcecode.rstrip()+'\n'
+            c = compiler.compile(sourcecode, '<string>', 'exec')
+            dct = {}
+            exec(c, dct)
+            self.assertEquals(dct['f'].func_annotations, expected)
+
 
 NOLINENO = (compiler.ast.Module, compiler.ast.Stmt, compiler.ast.Discard,
             compiler.ast.Const)
@@ -168,10 +202,11 @@
 
 ###############################################################################
 
-def test_main():
+def test_main(all=False):
     global TEST_ALL
-    TEST_ALL = test.test_support.is_resource_enabled("compiler")
+    TEST_ALL = all or test.test_support.is_resource_enabled("compiler")
     test.test_support.run_unittest(CompilerTest)
 
 if __name__ == "__main__":
-    test_main()
+    import sys
+    test_main('all' in sys.argv)

Modified: python/branches/p3yk-noslice/Lib/test/test_deque.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/test/test_deque.py	(original)
+++ python/branches/p3yk-noslice/Lib/test/test_deque.py	Thu Jan 11 00:21:28 2007
@@ -396,6 +396,12 @@
         d.pop()
         self.assertRaises(RuntimeError, it.next)
 
+    def test_runtime_error_on_empty_deque(self):
+        d = deque()
+        it = iter(d)
+        d.append(10)
+        self.assertRaises(RuntimeError, it.next)
+
 class Deque(deque):
     pass
 

Modified: python/branches/p3yk-noslice/Lib/test/test_dumbdbm.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/test/test_dumbdbm.py	(original)
+++ python/branches/p3yk-noslice/Lib/test/test_dumbdbm.py	Thu Jan 11 00:21:28 2007
@@ -38,6 +38,24 @@
         self.read_helper(f)
         f.close()
 
+    def test_dumbdbm_creation_mode(self):
+        # On platforms without chmod, don't do anything.
+        if not (hasattr(os, 'chmod') and hasattr(os, 'umask')):
+            return
+
+        try:
+            old_umask = os.umask(0002)
+            f = dumbdbm.open(_fname, 'c', 0637)
+            f.close()
+        finally:
+            os.umask(old_umask)
+            
+        import stat
+        st = os.stat(_fname + '.dat')
+        self.assertEqual(stat.S_IMODE(st.st_mode), 0635)
+        st = os.stat(_fname + '.dir')
+        self.assertEqual(stat.S_IMODE(st.st_mode), 0635)
+        
     def test_close_twice(self):
         f = dumbdbm.open(_fname)
         f['a'] = 'b'

Modified: python/branches/p3yk-noslice/Lib/test/test_exceptions.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/test/test_exceptions.py	(original)
+++ python/branches/p3yk-noslice/Lib/test/test_exceptions.py	Thu Jan 11 00:21:28 2007
@@ -3,7 +3,6 @@
 import os
 import sys
 import unittest
-import warnings
 import pickle
 try:
     import cPickle

Modified: python/branches/p3yk-noslice/Lib/test/test_grammar.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/test/test_grammar.py	(original)
+++ python/branches/p3yk-noslice/Lib/test/test_grammar.py	Thu Jan 11 00:21:28 2007
@@ -138,16 +138,22 @@
         x = eval('1, 0 or 1')
 
     def testFuncdef(self):
-        ### 'def' NAME parameters ':' suite
-        ### parameters: '(' [varargslist] ')'
-        ### varargslist: (fpdef ['=' test] ',')*
-        ###           ('*' (NAME|',' fpdef ['=' test]) [',' ('**'|'*' '*') NAME]
-        ###            | ('**'|'*' '*') NAME)
-        ###            | fpdef ['=' test] (',' fpdef ['=' test])* [',']
-        ### fpdef: NAME | '(' fplist ')'
-        ### fplist: fpdef (',' fpdef)* [',']
-        ### arglist: (argument ',')* (argument | *' test [',' '**' test] | '**' test)
-        ### argument: [test '='] test   # Really [keyword '='] test
+        ### [decorators] 'def' NAME parameters ['->' test] ':' suite
+        ### decorator: '@' dotted_name [ '(' [arglist] ')' ] NEWLINE
+        ### decorators: decorator+
+        ### parameters: '(' [typedargslist] ')'
+        ### typedargslist: ((tfpdef ['=' test] ',')*
+        ###                ('*' [tname] (',' tname ['=' test])* [',' '**' tname] | '**' tname)
+        ###                | tfpdef ['=' test] (',' tfpdef ['=' test])* [','])
+        ### tname: NAME [':' test]
+        ### tfpdef: tname | '(' tfplist ')'
+        ### tfplist: tfpdef (',' tfpdef)* [',']
+        ### varargslist: ((vfpdef ['=' test] ',')*
+        ###              ('*' [vname] (',' vname ['=' test])*  [',' '**' vname] | '**' vname)
+        ###              | vfpdef ['=' test] (',' vfpdef ['=' test])* [','])
+        ### vname: NAME
+        ### vfpdef: vname | '(' vfplist ')'
+        ### vfplist: vfpdef (',' vfpdef)* [',']
         def f1(): pass
         f1()
         f1(*())
@@ -294,6 +300,28 @@
         pos2key2dict(1,2,k2=100,tokwarg1=100,tokwarg2=200)
         pos2key2dict(1,2,tokwarg1=100,tokwarg2=200, k2=100)
 
+        # argument annotation tests
+        def f(x) -> list: pass
+        self.assertEquals(f.func_annotations, {'return': list})
+        def f(x:int): pass
+        self.assertEquals(f.func_annotations, {'x': int})
+        def f(*x:str): pass
+        self.assertEquals(f.func_annotations, {'x': str})
+        def f(**x:float): pass
+        self.assertEquals(f.func_annotations, {'x': float})
+        def f(x, y:1+2): pass
+        self.assertEquals(f.func_annotations, {'y': 3})
+        def f(a, (b:1, c:2, d)): pass
+        self.assertEquals(f.func_annotations, {'b': 1, 'c': 2})
+        def f(a, (b:1, c:2, d), e:3=4, f=5, *g:6): pass
+        self.assertEquals(f.func_annotations,
+                          {'b': 1, 'c': 2, 'e': 3, 'g': 6})
+        def f(a, (b:1, c:2, d), e:3=4, f=5, *g:6, h:7, i=8, j:9=10,
+              **k:11) -> 12: pass
+        self.assertEquals(f.func_annotations,
+                          {'b': 1, 'c': 2, 'e': 3, 'g': 6, 'h': 7, 'j': 9,
+                           'k': 11, 'return': 12})
+
     def testLambdef(self):
         ### lambdef: 'lambda' [varargslist] ':' test
         l1 = lambda : 0

Modified: python/branches/p3yk-noslice/Lib/test/test_heapq.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/test/test_heapq.py	(original)
+++ python/branches/p3yk-noslice/Lib/test/test_heapq.py	Thu Jan 11 00:21:28 2007
@@ -104,20 +104,20 @@
             self.assertEqual(heap_sorted, sorted(data))
 
     def test_nsmallest(self):
-        data = [random.randrange(2000) for i in range(1000)]
-        f = lambda x:  x * 547 % 2000
-        for n in (0, 1, 2, 10, 100, 400, 999, 1000, 1100):
-            self.assertEqual(nsmallest(n, data), sorted(data)[:n])
-            self.assertEqual(nsmallest(n, data, key=f),
-                             sorted(data, key=f)[:n])
+        data = [(random.randrange(2000), i) for i in range(1000)]
+        for f in (None, lambda x:  x[0] * 547 % 2000):
+            for n in (0, 1, 2, 10, 100, 400, 999, 1000, 1100):
+                self.assertEqual(nsmallest(n, data), sorted(data)[:n])
+                self.assertEqual(nsmallest(n, data, key=f),
+                                 sorted(data, key=f)[:n])
 
     def test_nlargest(self):
-        data = [random.randrange(2000) for i in range(1000)]
-        f = lambda x:  x * 547 % 2000
-        for n in (0, 1, 2, 10, 100, 400, 999, 1000, 1100):
-            self.assertEqual(nlargest(n, data), sorted(data, reverse=True)[:n])
-            self.assertEqual(nlargest(n, data, key=f),
-                             sorted(data, key=f, reverse=True)[:n])
+        data = [(random.randrange(2000), i) for i in range(1000)]
+        for f in (None, lambda x:  x[0] * 547 % 2000):
+            for n in (0, 1, 2, 10, 100, 400, 999, 1000, 1100):
+                self.assertEqual(nlargest(n, data), sorted(data, reverse=True)[:n])
+                self.assertEqual(nlargest(n, data, key=f),
+                                 sorted(data, key=f, reverse=True)[:n])
 
 
 #==============================================================================

Modified: python/branches/p3yk-noslice/Lib/test/test_import.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/test/test_import.py	(original)
+++ python/branches/p3yk-noslice/Lib/test/test_import.py	Thu Jan 11 00:21:28 2007
@@ -1,10 +1,11 @@
-from test.test_support import TESTFN, run_unittest
+from test.test_support import TESTFN, run_unittest, guard_warnings_filter
 
 import unittest
 import os
 import random
 import sys
 import py_compile
+import warnings
 
 
 def remove_files(name):
@@ -204,15 +205,11 @@
         self.assert_(y is test.test_support, y.__name__)
 
     def test_import_initless_directory_warning(self):
-        import warnings
-        oldfilters = warnings.filters[:]
-        warnings.simplefilter('error', ImportWarning);
-        try:
+        with guard_warnings_filter():
             # Just a random non-package directory we always expect to be
             # somewhere in sys.path...
+            warnings.simplefilter('error', ImportWarning)
             self.assertRaises(ImportWarning, __import__, "site-packages")
-        finally:
-            warnings.filters = oldfilters
 
 def test_main(verbose=None):
     run_unittest(ImportTest)

Modified: python/branches/p3yk-noslice/Lib/test/test_pty.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/test/test_pty.py	(original)
+++ python/branches/p3yk-noslice/Lib/test/test_pty.py	Thu Jan 11 00:21:28 2007
@@ -115,6 +115,12 @@
     os._exit(4)
 else:
     debug("Waiting for child (%d) to finish."%pid)
+    ##line = os.read(master_fd, 80)
+    ##lines = line.replace('\r\n', '\n').split('\n')
+    ##if False and lines != ['In child, calling os.setsid()',
+    ##             'Good: OSError was raised.', '']:
+    ##    raise TestFailed("Unexpected output from child: %r" % line)
+            
     (pid, status) = os.waitpid(pid, 0)
     res = status >> 8
     debug("Child (%d) exited with status %d (%d)."%(pid, res, status))
@@ -127,6 +133,15 @@
     elif res != 4:
         raise TestFailed, "pty.fork() failed for unknown reasons."
 
+    ##debug("Reading from master_fd now that the child has exited")
+    ##try:
+    ##    s1 = os.read(master_fd, 1024)
+    ##except os.error:
+    ##    pass
+    ##else:
+    ##    raise TestFailed("Read from master_fd did not raise exception")
+    
+    
 os.close(master_fd)
 
 # pty.fork() passed.

Modified: python/branches/p3yk-noslice/Lib/test/test_random.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/test/test_random.py	(original)
+++ python/branches/p3yk-noslice/Lib/test/test_random.py	Thu Jan 11 00:21:28 2007
@@ -180,10 +180,9 @@
 
     def test_bigrand(self):
         # Verify warnings are raised when randrange is too large for random()
-        oldfilters = warnings.filters[:]
-        warnings.filterwarnings("error", "Underlying random")
-        self.assertRaises(UserWarning, self.gen.randrange, 2**60)
-        warnings.filters[:] = oldfilters
+        with test_support.guard_warnings_filter():
+            warnings.filterwarnings("error", "Underlying random")
+            self.assertRaises(UserWarning, self.gen.randrange, 2**60)
 
 class SystemRandom_TestBasicOps(TestBasicOps):
     gen = random.SystemRandom()
@@ -441,6 +440,14 @@
             self.assertEqual(k, numbits)        # note the stronger assertion
             self.assert_(2**k > n > 2**(k-1))   # note the stronger assertion
 
+    def test_randrange_bug_1590891(self):
+        start = 1000000000000
+        stop = -100000000000000000000
+        step = -200
+        x = self.gen.randrange(start, stop, step)
+        self.assert_(stop < x <= start)
+        self.assertEqual((x+stop)%step, 0)
+
 _gammacoeff = (0.9999999999995183, 676.5203681218835, -1259.139216722289,
               771.3234287757674,  -176.6150291498386, 12.50734324009056,
               -0.1385710331296526, 0.9934937113930748e-05, 0.1659470187408462e-06)

Modified: python/branches/p3yk-noslice/Lib/test/test_repr.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/test/test_repr.py	(original)
+++ python/branches/p3yk-noslice/Lib/test/test_repr.py	Thu Jan 11 00:21:28 2007
@@ -136,7 +136,6 @@
             '<built-in method split of str object at 0x'))
 
     def test_xrange(self):
-        import warnings
         eq = self.assertEquals
         eq(repr(xrange(1)), 'xrange(1)')
         eq(repr(xrange(1, 2)), 'xrange(1, 2)')

Modified: python/branches/p3yk-noslice/Lib/test/test_set.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/test/test_set.py	(original)
+++ python/branches/p3yk-noslice/Lib/test/test_set.py	Thu Jan 11 00:21:28 2007
@@ -21,6 +21,11 @@
     def __eq__(self, other):
         raise RuntimeError
 
+class ReprWrapper:
+    'Used to test self-referential repr() calls'
+    def __repr__(self):
+        return repr(self.value)
+
 class TestJointOps(unittest.TestCase):
     # Tests common to both set and frozenset
 
@@ -244,6 +249,30 @@
             self.assertRaises(RuntimeError, s.discard, BadCmp())
             self.assertRaises(RuntimeError, s.remove, BadCmp())
 
+    def test_cyclical_repr(self):
+        w = ReprWrapper()
+        s = self.thetype([w])
+        w.value = s
+        if self.thetype == set:
+            self.assertEqual(repr(s), '{set(...)}')
+        else:
+            name = repr(s).partition('(')[0]    # strip class name
+            self.assertEqual(repr(s), '%s([%s(...)])' % (name, name))
+
+    def test_cyclical_print(self):
+        w = ReprWrapper()
+        s = self.thetype([w])
+        w.value = s
+        try:
+            fo = open(test_support.TESTFN, "wb")
+            print >> fo, s,
+            fo.close()
+            fo = open(test_support.TESTFN, "rb")
+            self.assertEqual(fo.read(), repr(s))
+        finally:
+            fo.close()
+            os.remove(test_support.TESTFN)
+
 class TestSet(TestJointOps):
     thetype = set
 

Modified: python/branches/p3yk-noslice/Lib/test/test_struct.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/test/test_struct.py	(original)
+++ python/branches/p3yk-noslice/Lib/test/test_struct.py	Thu Jan 11 00:21:28 2007
@@ -50,22 +50,17 @@
 
 def with_warning_restore(func):
     def _with_warning_restore(*args, **kw):
-        # The `warnings` module doesn't have an advertised way to restore
-        # its filter list.  Cheat.
-        save_warnings_filters = warnings.filters[:]
-        # Grrr, we need this function to warn every time.  Without removing
-        # the warningregistry, running test_tarfile then test_struct would fail
-        # on 64-bit platforms.
-        globals = func.func_globals
-        if '__warningregistry__' in globals:
-            del globals['__warningregistry__']
-        warnings.filterwarnings("error", r"""^struct.*""", DeprecationWarning)
-        warnings.filterwarnings("error", r""".*format requires.*""",
-                                DeprecationWarning)
-        try:
+        with test.test_support.guard_warnings_filter():
+            # Grrr, we need this function to warn every time.  Without removing
+            # the warningregistry, running test_tarfile then test_struct would fail
+            # on 64-bit platforms.
+            globals = func.func_globals
+            if '__warningregistry__' in globals:
+                del globals['__warningregistry__']
+            warnings.filterwarnings("error", r"""^struct.*""", DeprecationWarning)
+            warnings.filterwarnings("error", r""".*format requires.*""",
+                                    DeprecationWarning)
             return func(*args, **kw)
-        finally:
-            warnings.filters[:] = save_warnings_filters[:]
     return _with_warning_restore
 
 def deprecated_err(func, *args):

Modified: python/branches/p3yk-noslice/Lib/test/test_support.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/test/test_support.py	(original)
+++ python/branches/p3yk-noslice/Lib/test/test_support.py	Thu Jan 11 00:21:28 2007
@@ -3,7 +3,9 @@
 if __name__ != 'test.test_support':
     raise ImportError, 'test_support must be imported from the test package'
 
+from contextlib import contextmanager
 import sys
+import warnings
 
 class Error(Exception):
     """Base class for regression test exceptions."""
@@ -267,6 +269,48 @@
     print >> get_original_stdout(), '\tfetching %s ...' % url
     fn, _ = urllib.urlretrieve(url, filename)
     return open(fn)
+    
+ at contextmanager
+def guard_warnings_filter():
+    """Guard the warnings filter from being permanently changed."""
+    original_filters = warnings.filters[:]
+    try:
+        yield
+    finally:
+        warnings.filters = original_filters
+
+class EnvironmentVarGuard(object):
+
+    """Class to help protect the environment variable properly.  Can be used as
+    a context manager."""
+
+    def __init__(self):
+        from os import environ
+        self._environ = environ
+        self._unset = set()
+        self._reset = dict()
+
+    def set(self, envvar, value):
+        if envvar not in self._environ:
+            self._unset.add(envvar)
+        else:
+            self._reset[envvar] = self._environ[envvar]
+        self._environ[envvar] = value
+
+    def unset(self, envvar):
+        if envvar in self._environ:
+            self._reset[envvar] = self._environ[envvar]
+            del self._environ[envvar]
+
+    def __enter__(self):
+        return self
+
+    def __exit__(self, *ignore_exc):
+        for envvar, value in self._reset.iteritems():
+            self._environ[envvar] = value
+        for unset in self._unset:
+            del self._environ[unset]
+
 
 #=======================================================================
 # Decorator for running a function in a different locale, correctly resetting

Modified: python/branches/p3yk-noslice/Lib/test/test_sys.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/test/test_sys.py	(original)
+++ python/branches/p3yk-noslice/Lib/test/test_sys.py	Thu Jan 11 00:21:28 2007
@@ -350,6 +350,31 @@
         # the test runs under regrtest.
         self.assert_(sys.__stdout__.encoding == sys.__stderr__.encoding)
 
+    def test_intern(self):
+        self.assertRaises(TypeError, sys.intern)
+        s = "never interned before"
+        self.assert_(sys.intern(s) is s)
+        s2 = s.swapcase().swapcase()
+        self.assert_(sys.intern(s2) is s)
+
+        # Subclasses of string can't be interned, because they
+        # provide too much opportunity for insane things to happen.
+        # We don't want them in the interned dict and if they aren't
+        # actually interned, we don't want to create the appearance
+        # that they are by allowing intern() to succeeed.
+        class S(str):
+            def __hash__(self):
+                return 123
+
+        self.assertRaises(TypeError, sys.intern, S("abc"))
+
+        # It's still safe to pass these strings to routines that
+        # call intern internally, e.g. PyObject_SetAttr().
+        s = S("abc")
+        setattr(s, s, s)
+        self.assertEqual(getattr(s, s), s)
+
+
 def test_main():
     test.test_support.run_unittest(SysModuleTest)
 

Modified: python/branches/p3yk-noslice/Lib/test/test_tarfile.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/test/test_tarfile.py	(original)
+++ python/branches/p3yk-noslice/Lib/test/test_tarfile.py	Thu Jan 11 00:21:28 2007
@@ -110,7 +110,7 @@
         """Test seek() method of _FileObject, incl. random reading.
         """
         if self.sep != "|":
-            filename = "0-REGTYPE"
+            filename = "0-REGTYPE-TEXT"
             self.tar.extract(filename, dirname())
             f = open(os.path.join(dirname(), filename), "rb")
             data = f.read()
@@ -149,6 +149,16 @@
             s2 = fobj.readlines()
             self.assert_(s1 == s2,
                          "readlines() after seek failed")
+            fobj.seek(0)
+            self.assert_(len(fobj.readline()) == fobj.tell(),
+                         "tell() after readline() failed")
+            fobj.seek(512)
+            self.assert_(len(fobj.readline()) + 512 == fobj.tell(),
+                         "tell() after seek() and readline() failed")
+            fobj.seek(0)
+            line = fobj.readline()
+            self.assert_(fobj.read() == data[len(line):],
+                         "read() after readline() failed")
             fobj.close()
 
     def test_old_dirtype(self):
@@ -280,6 +290,20 @@
             else:
                 self.dst.addfile(tarinfo, f)
 
+    def test_add_self(self):
+        dstname = os.path.abspath(self.dstname)
+
+        self.assertEqual(self.dst.name, dstname, "archive name must be absolute")
+
+        self.dst.add(dstname)
+        self.assertEqual(self.dst.getnames(), [], "added the archive to itself")
+
+        cwd = os.getcwd()
+        os.chdir(dirname())
+        self.dst.add(dstname)
+        os.chdir(cwd)
+        self.assertEqual(self.dst.getnames(), [], "added the archive to itself")
+
 
 class Write100Test(BaseTest):
     # The name field in a tar header stores strings of at most 100 chars.
@@ -601,6 +625,38 @@
         self.assertEqual(tarfile.filemode(0755), '-rwxr-xr-x')
         self.assertEqual(tarfile.filemode(07111), '---s--s--t')
 
+class HeaderErrorTest(unittest.TestCase):
+
+    def test_truncated_header(self):
+        self.assertRaises(tarfile.HeaderError, tarfile.TarInfo.frombuf, "")
+        self.assertRaises(tarfile.HeaderError, tarfile.TarInfo.frombuf, "filename\0")
+        self.assertRaises(tarfile.HeaderError, tarfile.TarInfo.frombuf, "\0" * 511)
+        self.assertRaises(tarfile.HeaderError, tarfile.TarInfo.frombuf, "\0" * 513)
+
+    def test_empty_header(self):
+        self.assertRaises(tarfile.HeaderError, tarfile.TarInfo.frombuf, "\0" * 512)
+
+    def test_invalid_header(self):
+        buf = tarfile.TarInfo("filename").tobuf()
+        buf = buf[:148] + "foo\0\0\0\0\0" + buf[156:] # invalid number field.
+        self.assertRaises(tarfile.HeaderError, tarfile.TarInfo.frombuf, buf)
+
+    def test_bad_checksum(self):
+        buf = tarfile.TarInfo("filename").tobuf()
+        b = buf[:148] + "        " + buf[156:] # clear the checksum field.
+        self.assertRaises(tarfile.HeaderError, tarfile.TarInfo.frombuf, b)
+        b = "a" + buf[1:] # manipulate the buffer, so checksum won't match.
+        self.assertRaises(tarfile.HeaderError, tarfile.TarInfo.frombuf, b)
+
+class OpenFileobjTest(BaseTest):
+    # Test for SF bug #1496501.
+
+    def test_opener(self):
+        fobj = StringIO.StringIO("foo\n")
+        try:
+            tarfile.open("", "r", fileobj=fobj)
+        except tarfile.ReadError:
+            self.assertEqual(fobj.tell(), 0, "fileobj's position has moved")
 
 if bz2:
     # Bzip2 TestCases
@@ -646,6 +702,8 @@
 
     tests = [
         FileModeTest,
+        HeaderErrorTest,
+        OpenFileobjTest,
         ReadTest,
         ReadStreamTest,
         ReadDetectTest,

Modified: python/branches/p3yk-noslice/Lib/test/test_tokenize.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/test/test_tokenize.py	(original)
+++ python/branches/p3yk-noslice/Lib/test/test_tokenize.py	Thu Jan 11 00:21:28 2007
@@ -219,5 +219,15 @@
     if verbose:
         print 'finished'
 
+def test_rarrow():
+    """
+    This function exists solely to test the tokenization of the RARROW
+    operator.
+
+    >>> tokenize(iter(['->']).next)   #doctest: +NORMALIZE_WHITESPACE
+    1,0-1,2:\tOP\t'->'
+    2,0-2,0:\tENDMARKER\t''
+    """
+
 if __name__ == "__main__":
     test_main()

Modified: python/branches/p3yk-noslice/Lib/test/test_uu.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/test/test_uu.py	(original)
+++ python/branches/p3yk-noslice/Lib/test/test_uu.py	Thu Jan 11 00:21:28 2007
@@ -114,11 +114,11 @@
 
     def test_encode(self):
         try:
-            fin = open(self.tmpin, 'wb')
+            fin = open(self.tmpin, 'w')
             fin.write(plaintext)
             fin.close()
 
-            fin = open(self.tmpin, 'rb')
+            fin = open(self.tmpin, 'r')
             fout = open(self.tmpout, 'w')
             uu.encode(fin, fout, self.tmpin, mode=0644)
             fin.close()
@@ -130,7 +130,7 @@
             self.assertEqual(s, encodedtextwrapped % (0644, self.tmpin))
 
             # in_file and out_file as filenames
-            uu.encode(self.tmpin, self.tmpout, mode=0644)
+            uu.encode(self.tmpin, self.tmpout, self.tmpin, mode=0644)
             fout = open(self.tmpout, 'r')
             s = fout.read()
             fout.close()
@@ -142,11 +142,11 @@
 
     def test_decode(self):
         try:
-            f = open(self.tmpin, 'wb')
+            f = open(self.tmpin, 'w')
             f.write(encodedtextwrapped % (0644, self.tmpout))
             f.close()
 
-            f = open(self.tmpin, 'rb')
+            f = open(self.tmpin, 'r')
             uu.decode(f)
             f.close()
 
@@ -163,11 +163,11 @@
         try:
             f = cStringIO.StringIO(encodedtextwrapped % (0644, self.tmpout))
 
-            f = open(self.tmpin, 'rb')
+            f = open(self.tmpin, 'r')
             uu.decode(f)
             f.close()
 
-            f = open(self.tmpin, 'rb')
+            f = open(self.tmpin, 'r')
             self.assertRaises(uu.Error, uu.decode, f)
             f.close()
         finally:

Modified: python/branches/p3yk-noslice/Lib/test/test_weakref.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/test/test_weakref.py	(original)
+++ python/branches/p3yk-noslice/Lib/test/test_weakref.py	Thu Jan 11 00:21:28 2007
@@ -189,7 +189,7 @@
     # None as the value for the callback, where either means "no
     # callback".  The "no callback" ref and proxy objects are supposed
     # to be shared so long as they exist by all callers so long as
-    # they are active.  In Python 2.3.3 and earlier, this guaranttee
+    # they are active.  In Python 2.3.3 and earlier, this guarantee
     # was not honored, and was broken in different ways for
     # PyWeakref_NewRef() and PyWeakref_NewProxy().  (Two tests.)
 

Modified: python/branches/p3yk-noslice/Lib/test/tokenize_tests.txt
==============================================================================
--- python/branches/p3yk-noslice/Lib/test/tokenize_tests.txt	(original)
+++ python/branches/p3yk-noslice/Lib/test/tokenize_tests.txt	Thu Jan 11 00:21:28 2007
@@ -176,3 +176,6 @@
 @staticmethod
 def foo(): pass
 
+ at staticmethod
+def foo(x:1)->1: pass
+

Modified: python/branches/p3yk-noslice/Lib/threading.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/threading.py	(original)
+++ python/branches/p3yk-noslice/Lib/threading.py	Thu Jan 11 00:21:28 2007
@@ -636,13 +636,11 @@
         _active_limbo_lock.acquire()
         _active[_get_ident()] = self
         _active_limbo_lock.release()
-        import atexit
-        atexit.register(self.__exitfunc)
 
     def _set_daemon(self):
         return False
 
-    def __exitfunc(self):
+    def _exitfunc(self):
         self._Thread__stop()
         t = _pickSomeNonDaemonThread()
         if t:
@@ -715,9 +713,11 @@
 
 from thread import stack_size
 
-# Create the main thread object
+# Create the main thread object,
+# and make it available for the interpreter
+# (Py_Main) as threading._shutdown.
 
-_MainThread()
+_shutdown = _MainThread()._exitfunc
 
 # get thread-local implementation, either from the thread
 # module, or from the python fallback

Modified: python/branches/p3yk-noslice/Lib/token.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/token.py	(original)
+++ python/branches/p3yk-noslice/Lib/token.py	Thu Jan 11 00:21:28 2007
@@ -60,9 +60,10 @@
 DOUBLESLASH = 48
 DOUBLESLASHEQUAL = 49
 AT = 50
-OP = 51
-ERRORTOKEN = 52
-N_TOKENS = 53
+RARROW = 51
+OP = 52
+ERRORTOKEN = 53
+N_TOKENS = 54
 NT_OFFSET = 256
 #--end constants--
 

Modified: python/branches/p3yk-noslice/Lib/tokenize.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/tokenize.py	(original)
+++ python/branches/p3yk-noslice/Lib/tokenize.py	Thu Jan 11 00:21:28 2007
@@ -78,7 +78,7 @@
 # longest operators first (e.g., if = came before ==, == would get
 # recognized as two instances of =).
 Operator = group(r"\*\*=?", r">>=?", r"<<=?", r"!=",
-                 r"//=?",
+                 r"//=?", r"->",
                  r"[+\-*/%&|^=<>]=?",
                  r"~")
 

Modified: python/branches/p3yk-noslice/Lib/urllib.py
==============================================================================
--- python/branches/p3yk-noslice/Lib/urllib.py	(original)
+++ python/branches/p3yk-noslice/Lib/urllib.py	Thu Jan 11 00:21:28 2007
@@ -405,8 +405,8 @@
                 h.putheader('Content-Length', '%d' % len(data))
             else:
                 h.putrequest('GET', selector)
-            if proxy_auth: h.putheader('Proxy-Authorization: Basic %s' % proxy_auth)
-            if auth: h.putheader('Authorization: Basic %s' % auth)
+            if proxy_auth: h.putheader('Proxy-Authorization', 'Basic %s' % proxy_auth)
+            if auth: h.putheader('Authorization', 'Basic %s' % auth)
             if realhost: h.putheader('Host', realhost)
             for args in self.addheaders: h.putheader(*args)
             h.endheaders()

Modified: python/branches/p3yk-noslice/Misc/ACKS
==============================================================================
--- python/branches/p3yk-noslice/Misc/ACKS	(original)
+++ python/branches/p3yk-noslice/Misc/ACKS	Thu Jan 11 00:21:28 2007
@@ -285,6 +285,7 @@
 Albert Hofkamp
 Jonathan Hogg
 Gerrit Holl
+Shane Holloway
 Rune Holm
 Philip Homburg
 Naofumi Honda

Modified: python/branches/p3yk-noslice/Misc/NEWS
==============================================================================
--- python/branches/p3yk-noslice/Misc/NEWS	(original)
+++ python/branches/p3yk-noslice/Misc/NEWS	Thu Jan 11 00:21:28 2007
@@ -12,7 +12,7 @@
 TO DO
 -----
 
-- See PEP 3000.
+- See PEP 3000, 3100.
 
 - Test merging certain changes from the 2.5 HEAD code.
 
@@ -36,7 +36,13 @@
 Core and Builtins
 -----------------
 
-- Renamed nb_nonzero to nb_bool and __nonzero__ to __bool__
+- Added function annotations per PEP 3107.
+
+- Moved intern() to sys.intern().
+
+- exec is now a function.
+
+- Renamed nb_nonzero to nb_bool and __nonzero__ to __bool__.
 
 - Classic classes are a thing of the past.  All classes are new style.
 
@@ -90,7 +96,7 @@
 - zip returns an iterator
 
 - Additions:
-  set literals
+  set literals, ellipsis literal
 
 
 Extension Modules

Modified: python/branches/p3yk-noslice/Misc/developers.txt
==============================================================================
--- python/branches/p3yk-noslice/Misc/developers.txt	(original)
+++ python/branches/p3yk-noslice/Misc/developers.txt	Thu Jan 11 00:21:28 2007
@@ -17,6 +17,15 @@
 Permissions History
 -------------------
 
+- Josiah Carlson (SF name "josiahcarlson") added to the SourceForge Python
+  project 06 Jan 2007, by NCN, as a tracker tech.  He will maintain asyncore.
+
+- Collin Winter was given SVN access on 05 Jan 2007 by NCN, for PEP
+  update access.
+
+- Lars Gustaebel was given SVN access on 20 Dec 2006 by NCN, for tarfile.py
+  related work.
+
 - 2006 Summer of Code entries: SoC developers are expected to work
   primarily in nondist/sandbox or on a branch of their own, and will
   have their work reviewed before changes are accepted into the trunk.

Modified: python/branches/p3yk-noslice/Misc/python-mode.el
==============================================================================
--- python/branches/p3yk-noslice/Misc/python-mode.el	(original)
+++ python/branches/p3yk-noslice/Misc/python-mode.el	Thu Jan 11 00:21:28 2007
@@ -382,7 +382,7 @@
 			  "delattr" "dict" "dir" "divmod"
 			  "enumerate" "eval" "execfile" "exit" "file"
 			  "filter" "float" "getattr" "globals" "hasattr"
-			  "hash" "hex" "id" "int" "intern"
+			  "hash" "hex" "id" "int"
 			  "isinstance" "issubclass" "iter" "len" "license"
 			  "list" "locals" "long" "map" "max" "min" "object"
 			  "oct" "open" "ord" "pow" "property" "range"

Modified: python/branches/p3yk-noslice/Modules/_bsddb.c
==============================================================================
--- python/branches/p3yk-noslice/Modules/_bsddb.c	(original)
+++ python/branches/p3yk-noslice/Modules/_bsddb.c	Thu Jan 11 00:21:28 2007
@@ -98,7 +98,7 @@
 #error "eek! DBVER can't handle minor versions > 9"
 #endif
 
-#define PY_BSDDB_VERSION "4.4.6"
+#define PY_BSDDB_VERSION "4.5.0"
 static char *rcs_id = "$Id$";
 
 
@@ -4127,6 +4127,7 @@
 }
 
 
+#if (DBVER < 45)
 static PyObject*
 DBEnv_set_lk_max(DBEnvObject* self, PyObject* args)
 {
@@ -4142,6 +4143,7 @@
     RETURN_IF_ERR();
     RETURN_NONE();
 }
+#endif
 
 
 #if (DBVER >= 32)
@@ -5231,7 +5233,9 @@
     {"set_lg_regionmax",(PyCFunction)DBEnv_set_lg_regionmax, METH_VARARGS},
 #endif
     {"set_lk_detect",   (PyCFunction)DBEnv_set_lk_detect,    METH_VARARGS},
+#if (DBVER < 45)
     {"set_lk_max",      (PyCFunction)DBEnv_set_lk_max,       METH_VARARGS},
+#endif
 #if (DBVER >= 32)
     {"set_lk_max_locks", (PyCFunction)DBEnv_set_lk_max_locks, METH_VARARGS},
     {"set_lk_max_lockers", (PyCFunction)DBEnv_set_lk_max_lockers, METH_VARARGS},
@@ -5627,7 +5631,7 @@
 #define MODULE_NAME_MAX_LEN     11
 static char _bsddbModuleName[MODULE_NAME_MAX_LEN+1] = "_bsddb";
 
-DL_EXPORT(void) init_bsddb(void)
+PyMODINIT_FUNC init_bsddb(void)
 {
     PyObject* m;
     PyObject* d;
@@ -5833,7 +5837,9 @@
     ADD_INT(d, DB_AFTER);
     ADD_INT(d, DB_APPEND);
     ADD_INT(d, DB_BEFORE);
+#if (DBVER < 45)
     ADD_INT(d, DB_CACHED_COUNTS);
+#endif
 #if (DBVER >= 41)
     _addIntToDict(d, "DB_CHECKPOINT", 0);
 #else
@@ -5868,7 +5874,9 @@
     ADD_INT(d, DB_POSITION);
     ADD_INT(d, DB_PREV);
     ADD_INT(d, DB_PREV_NODUP);
+#if (DBVER < 45)
     ADD_INT(d, DB_RECORDCOUNT);
+#endif
     ADD_INT(d, DB_SET);
     ADD_INT(d, DB_SET_RANGE);
     ADD_INT(d, DB_SET_RECNO);
@@ -6032,7 +6040,7 @@
 /* allow this module to be named _pybsddb so that it can be installed
  * and imported on top of python >= 2.3 that includes its own older
  * copy of the library named _bsddb without importing the old version. */
-DL_EXPORT(void) init_pybsddb(void)
+PyMODINIT_FUNC init_pybsddb(void)
 {
     strncpy(_bsddbModuleName, "_pybsddb", MODULE_NAME_MAX_LEN);
     init_bsddb();

Modified: python/branches/p3yk-noslice/Modules/_ctypes/_ctypes_test.c
==============================================================================
--- python/branches/p3yk-noslice/Modules/_ctypes/_ctypes_test.c	(original)
+++ python/branches/p3yk-noslice/Modules/_ctypes/_ctypes_test.c	Thu Jan 11 00:21:28 2007
@@ -330,7 +330,7 @@
 	short M: 1, N: 2, O: 3, P: 4, Q: 5, R: 6, S: 7;
 };
 
-DL_EXPORT(void) set_bitfields(struct BITS *bits, char name, int value)
+PyAPI_FUNC(void) set_bitfields(struct BITS *bits, char name, int value)
 {
 	switch (name) {
 	case 'A': bits->A = value; break;
@@ -353,7 +353,7 @@
 	}
 }
 
-DL_EXPORT(int) unpack_bitfields(struct BITS *bits, char name)
+PyAPI_FUNC(int) unpack_bitfields(struct BITS *bits, char name)
 {
 	switch (name) {
 	case 'A': return bits->A;
@@ -547,7 +547,7 @@
 
 #endif
 
-DL_EXPORT(void)
+PyMODINIT_FUNC
 init_ctypes_test(void)
 {
 	Py_InitModule("_ctypes_test", module_methods);

Modified: python/branches/p3yk-noslice/Modules/_elementtree.c
==============================================================================
--- python/branches/p3yk-noslice/Modules/_elementtree.c	(original)
+++ python/branches/p3yk-noslice/Modules/_elementtree.c	Thu Jan 11 00:21:28 2007
@@ -2612,7 +2612,7 @@
     {NULL, NULL}
 };
 
-DL_EXPORT(void)
+PyMODINIT_FUNC
 init_elementtree(void)
 {
     PyObject* m;

Modified: python/branches/p3yk-noslice/Modules/addrinfo.h
==============================================================================
--- python/branches/p3yk-noslice/Modules/addrinfo.h	(original)
+++ python/branches/p3yk-noslice/Modules/addrinfo.h	Thu Jan 11 00:21:28 2007
@@ -170,7 +170,7 @@
 #ifdef __cplusplus
 extern "C" {
 #endif
-extern void freehostent Py_PROTO((struct hostent *));
+extern void freehostent(struct hostent *);
 #ifdef __cplusplus
 }
 #endif

Modified: python/branches/p3yk-noslice/Modules/bz2module.c
==============================================================================
--- python/branches/p3yk-noslice/Modules/bz2module.c	(original)
+++ python/branches/p3yk-noslice/Modules/bz2module.c	Thu Jan 11 00:21:28 2007
@@ -989,7 +989,7 @@
 	char small_buffer[SMALLCHUNK];
 	char *buffer = small_buffer;
 	size_t buffersize = SMALLCHUNK;
-	int bytesread = 0;
+	Py_off_t bytesread = 0;
 	size_t readsize;
 	int chunksize;
 	int bzerror;

Modified: python/branches/p3yk-noslice/Modules/collectionsmodule.c
==============================================================================
--- python/branches/p3yk-noslice/Modules/collectionsmodule.c	(original)
+++ python/branches/p3yk-noslice/Modules/collectionsmodule.c	Thu Jan 11 00:21:28 2007
@@ -911,15 +911,14 @@
 {
 	PyObject *item;
 
-	if (it->counter == 0)
-		return NULL;
-
 	if (it->deque->state != it->state) {
 		it->counter = 0;
 		PyErr_SetString(PyExc_RuntimeError,
 				"deque mutated during iteration");
 		return NULL;
 	}
+	if (it->counter == 0)
+		return NULL;        
 	assert (!(it->b == it->deque->rightblock &&
 		  it->index > it->deque->rightindex));
 

Modified: python/branches/p3yk-noslice/Modules/main.c
==============================================================================
--- python/branches/p3yk-noslice/Modules/main.c	(original)
+++ python/branches/p3yk-noslice/Modules/main.c	Thu Jan 11 00:21:28 2007
@@ -175,6 +175,33 @@
 	return 0;
 }
 
+/* Wait until threading._shutdown completes, provided
+   the threading module was imported in the first place.
+   The shutdown routine will wait until all non-daemon
+   "threading" threads have completed. */
+#include "abstract.h"
+static void
+WaitForThreadShutdown(void)
+{
+#ifdef WITH_THREAD
+	PyObject *result;
+	PyThreadState *tstate = PyThreadState_GET();
+	PyObject *threading = PyMapping_GetItemString(tstate->interp->modules,
+						      "threading");
+	if (threading == NULL) {
+		/* threading not imported */
+		PyErr_Clear();
+		return;
+	}
+	result = PyObject_CallMethod(threading, "_shutdown", "");
+	if (result == NULL)
+		PyErr_WriteUnraisable(threading);
+	else
+		Py_DECREF(result);
+	Py_DECREF(threading);
+#endif
+}
+
 /* Main program */
 
 int
@@ -483,6 +510,8 @@
 		/* XXX */
 		sts = PyRun_AnyFileFlags(stdin, "<stdin>", &cf) != 0;
 
+	WaitForThreadShutdown();
+
 	Py_Finalize();
 #ifdef RISCOS
 	if (Py_RISCOSWimpFlag)

Modified: python/branches/p3yk-noslice/Modules/parsermodule.c
==============================================================================
--- python/branches/p3yk-noslice/Modules/parsermodule.c	(original)
+++ python/branches/p3yk-noslice/Modules/parsermodule.c	Thu Jan 11 00:21:28 2007
@@ -854,7 +854,7 @@
 VALIDATER(class);               VALIDATER(node);
 VALIDATER(parameters);          VALIDATER(suite);
 VALIDATER(testlist);            VALIDATER(varargslist);
-VALIDATER(fpdef);               VALIDATER(fplist);
+VALIDATER(vfpdef);              VALIDATER(vfplist);
 VALIDATER(stmt);                VALIDATER(simple_stmt);
 VALIDATER(expr_stmt);           VALIDATER(power);
 VALIDATER(print_stmt);          VALIDATER(del_stmt);
@@ -863,7 +863,7 @@
 VALIDATER(import_name);         VALIDATER(import_from);
 VALIDATER(global_stmt);         VALIDATER(list_if);
 VALIDATER(assert_stmt);         VALIDATER(list_for);
-VALIDATER(compound_stmt);
+VALIDATER(compound_stmt);       VALIDATER(vname);
 VALIDATER(while);               VALIDATER(for);
 VALIDATER(try);                 VALIDATER(except_clause);
 VALIDATER(test);                VALIDATER(and_test);
@@ -1120,7 +1120,32 @@
 }
 
 
-/* '*' [NAME] (',' NAME ['=' test])* [',' '**' NAME] | '**' NAME
+/* validate either vname or tname.
+ * vname: NAME
+ * tname: NAME [':' test]
+ */
+static int
+validate_vname(node *tree)
+{
+    int nch = NCH(tree);
+    if (TYPE(tree) == vname) {
+        return nch == 1 && validate_name(CHILD(tree, 0), NULL);
+    }
+    else if (TYPE(tree) == tname) {
+        if (nch == 1) {
+            return validate_name(CHILD(tree, 0), NULL);
+        }
+        else if (nch == 3) {
+            return validate_name(CHILD(tree, 0), NULL) &&
+                   validate_colon(CHILD(tree, 1)) &&
+                   validate_test(CHILD(tree, 2));
+        }
+    }
+    return 0;
+}
+
+/* '*' vname (',' vname ['=' test])* [',' '**' vname] | '**' vname
+ * ..or tname in place of vname. vname: NAME; tname: NAME [':' test]
  */
 static int
 validate_varargslist_trailer(node *tree, int start)
@@ -1136,26 +1161,27 @@
     sym = TYPE(CHILD(tree, start));
     if (sym == STAR) {
         /*
-         * '*' [NAME] (',' NAME ['=' test])* [',' '**' NAME] | '**' NAME
+         * '*' vname (',' vname ['=' test])* [',' '**' vname] | '**' vname
          */
         if (nch-start == 2)
-            res = validate_name(CHILD(tree, start+1), NULL);
+            res = validate_vname(CHILD(tree, start+1));
         else if (nch-start == 5 && TYPE(CHILD(tree, start+2)) == COMMA)
-            res = (validate_name(CHILD(tree, start+1), NULL)
+            res = (validate_vname(CHILD(tree, start+1))
                    && validate_comma(CHILD(tree, start+2))
                    && validate_doublestar(CHILD(tree, start+3))
-                   && validate_name(CHILD(tree, start+4), NULL));
+                   && validate_vname(CHILD(tree, start+4)));
         else {
-            /* skip over [NAME] (',' NAME ['=' test])*  */
+            /* skip over vname (',' vname ['=' test])*  */
             i = start + 1;
-	    if (TYPE(CHILD(tree, i)) == NAME) { /* skip over [NAME] */
+	    if (TYPE(CHILD(tree, i)) == vname ||
+	        TYPE(CHILD(tree, i)) == tname) { /* skip over vname or tname */
 		i += 1;
 	    }
-            while (res && i+1 < nch) { /* validate  (',' NAME ['=' test])* */
+            while (res && i+1 < nch) { /* validate  (',' vname ['=' test])* */
                 res = validate_comma(CHILD(tree, i));
                 if (TYPE(CHILD(tree, i+1)) == DOUBLESTAR) 
                     break;
-                res = res && validate_name(CHILD(tree, i+1), NULL);
+                res = res && validate_vname(CHILD(tree, i+1));
                 if (res && i+2 < nch && TYPE(CHILD(tree, i+2)) == EQUAL) {
                     res = res && (i+3 < nch) 
                           && validate_test(CHILD(tree, i+3));
@@ -1165,9 +1191,9 @@
                     i += 2;
                 }
             }
-            /* [',' '**' NAME] */
+            /* [',' '**' vname] */
             if (res && i+1 < nch && TYPE(CHILD(tree, i+1)) == DOUBLESTAR) {
-                res = validate_name(CHILD(tree, i+2), NULL);
+                res = validate_vname(CHILD(tree, i+2));
             }
         }
     }
@@ -1176,7 +1202,7 @@
          *  '**' NAME
          */
         if (nch-start == 2)
-            res = validate_name(CHILD(tree, start+1), NULL);
+            res = validate_vname(CHILD(tree, start+1));
     }
     if (!res)
         err_string("illegal variable argument trailer for varargslist");
@@ -1184,21 +1210,34 @@
 }
 
 
-/*  validate_varargslist()
+/* validate_varargslist()
  *
- *  varargslist:
- *      (fpdef ['=' test] ',')*
- *      ('*' [NAME] (',' NAME ['=' test])* [',' '**' NAME] | '**' NAME)
- *      | fpdef ['=' test] (',' fpdef ['=' test])* [',']
+ * Validate typedargslist or varargslist.
+ *
+ * typedargslist: ((tfpdef ['=' test] ',')*
+ *                 ('*' [tname] (',' tname ['=' test])* [',' '**' tname] |
+ *                  '**' tname)
+ *                 | tfpdef ['=' test] (',' tfpdef ['=' test])* [','])
+ * tname: NAME [':' test]
+ * tfpdef: tname | '(' tfplist ')'
+ * tfplist: tfpdef (',' tfpdef)* [',']
+ * varargslist: ((vfpdef ['=' test] ',')*
+ *               ('*' [vname] (',' vname ['=' test])*  [',' '**' vname] |
+ *                '**' vname)
+ *               | vfpdef ['=' test] (',' vfpdef ['=' test])* [','])
+ * vname: NAME
+ * vfpdef: vname | '(' vfplist ')'
+ * vfplist: vfpdef (',' vfpdef)* [',']
  *
  */
 static int
 validate_varargslist(node *tree)
 {
     int nch = NCH(tree);
-    int res = validate_ntype(tree, varargslist) && (nch != 0);
+    int res = (TYPE(tree) == varargslist ||
+               TYPE(tree) == typedargslist) &&
+              (nch != 0);
     int sym;
-
     if (!res)
         return 0;
     if (nch < 1) {
@@ -1211,19 +1250,19 @@
          *    '*' [NAME] (',' NAME ['=' test])* [',' '**' NAME] | '**' NAME
          */
         res = validate_varargslist_trailer(tree, 0);
-    else if (sym == fpdef) {
+    else if (sym == vfpdef || sym == tfpdef) {
         int i = 0;
 
         sym = TYPE(CHILD(tree, nch-1));
-        if (sym == NAME) {
+        if (sym == vname || sym == tname) {
             /*
-             *   (fpdef ['=' test] ',')+
-             *       ('*' NAME [',' '**' NAME]
-             *     | '**' NAME)
+             *   (vfpdef ['=' test] ',')+
+             *       ('*' vname [',' '**' vname]
+             *     | '**' vname)
              */
-            /* skip over (fpdef ['=' test] ',')+ */
+            /* skip over (vfpdef ['=' test] ',')+ */
             while (res && (i+2 <= nch)) {
-                res = validate_fpdef(CHILD(tree, i));
+                res = validate_vfpdef(CHILD(tree, i));
                 ++i;
                 if (res && TYPE(CHILD(tree, i)) == EQUAL && (i+2 <= nch)) {
                     res = (validate_equal(CHILD(tree, i))
@@ -1248,7 +1287,7 @@
         }
         else {
             /*
-             *  fpdef ['=' test] (',' fpdef ['=' test])* [',']
+             *  vfpdef ['=' test] (',' vfpdef ['=' test])* [',']
              */
             /* strip trailing comma node */
             if (sym == COMMA) {
@@ -1258,9 +1297,9 @@
                 --nch;
             }
             /*
-             *  fpdef ['=' test] (',' fpdef ['=' test])*
+             *  vfpdef ['=' test] (',' vfpdef ['=' test])*
              */
-            res = validate_fpdef(CHILD(tree, 0));
+            res = validate_vfpdef(CHILD(tree, 0));
             ++i;
             if (res && (i+2 <= nch) && TYPE(CHILD(tree, i)) == EQUAL) {
                 res = (validate_equal(CHILD(tree, i))
@@ -1268,12 +1307,12 @@
                 i += 2;
             }
             /*
-             *  ... (',' fpdef ['=' test])*
+             *  ... (',' vfpdef ['=' test])*
              *  i ---^^^
              */
             while (res && (nch - i) >= 2) {
                 res = (validate_comma(CHILD(tree, i))
-                       && validate_fpdef(CHILD(tree, i+1)));
+                       && validate_vfpdef(CHILD(tree, i+1)));
                 i += 2;
                 if (res && (nch - i) >= 2 && TYPE(CHILD(tree, i)) == EQUAL) {
                     res = (validate_equal(CHILD(tree, i))
@@ -1405,24 +1444,32 @@
     return res;
 }
 
-/*  validate_fpdef()
+/* validate_vfpdef()
+ *
+ * Validate vfpdef or tfpdef.
+ *
+ * vname: NAME
+ * vfpdef: vname | '(' vfplist ')'
+ * vfplist: vfpdef (',' vfpdef)* [',']
+ *
+ * tname: NAME [':' test]
+ * tfpdef: tname | '(' tfplist ')'
+ * tfplist: tfpdef (',' tfpdef)* [',']
  *
- *  fpdef:
- *      NAME
- *    | '(' fplist ')'
  */
 static int
-validate_fpdef(node *tree)
+validate_vfpdef(node *tree)
 {
     int nch = NCH(tree);
-    int res = validate_ntype(tree, fpdef);
+    int typ = TYPE(tree);
+    int res = typ == vfpdef || typ == tfpdef;
 
     if (res) {
         if (nch == 1)
-            res = validate_ntype(CHILD(tree, 0), NAME);
+            res = validate_vname(CHILD(tree, 0));
         else if (nch == 3)
             res = (validate_lparen(CHILD(tree, 0))
-                   && validate_fplist(CHILD(tree, 1))
+                   && validate_vfplist(CHILD(tree, 1))
                    && validate_rparen(CHILD(tree, 2)));
         else
             res = validate_numnodes(tree, 1, "fpdef");
@@ -1432,10 +1479,10 @@
 
 
 static int
-validate_fplist(node *tree)
+validate_vfplist(node *tree)
 {
-    return (validate_repeating_list(tree, fplist,
-                                    validate_fpdef, "fplist"));
+    return (validate_repeating_list(tree, vfplist,
+                                    validate_vfpdef, "vfplist"));
 }
 
 

Modified: python/branches/p3yk-noslice/Modules/socketmodule.c
==============================================================================
--- python/branches/p3yk-noslice/Modules/socketmodule.c	(original)
+++ python/branches/p3yk-noslice/Modules/socketmodule.c	Thu Jan 11 00:21:28 2007
@@ -2210,7 +2210,7 @@
 
 /*
  * This is the guts of the recv() and recv_into() methods, which reads into a
- * char buffer.  If you have any inc/def ref to do to the objects that contain
+ * char buffer.  If you have any inc/dec ref to do to the objects that contain
  * the buffer, do it in the caller.  This function returns the number of bytes
  * succesfully read.  If there was an error, it returns -1.  Note that it is
  * also possible that we return a number of bytes smaller than the request

Modified: python/branches/p3yk-noslice/Modules/timemodule.c
==============================================================================
--- python/branches/p3yk-noslice/Modules/timemodule.c	(original)
+++ python/branches/p3yk-noslice/Modules/timemodule.c	Thu Jan 11 00:21:28 2007
@@ -659,7 +659,7 @@
 	time_tzset. In the future, some parts of it can be moved back
 	(for platforms that don't HAVE_WORKING_TZSET, when we know what they
 	are), and the extranious calls to tzset(3) should be removed.
-	I havn't done this yet, as I don't want to change this code as
+	I haven't done this yet, as I don't want to change this code as
 	little as possible when introducing the time.tzset and time.tzsetwall
 	methods. This should simply be a method of doing the following once,
 	at the top of this function and removing the call to tzset() from

Modified: python/branches/p3yk-noslice/Objects/bytesobject.c
==============================================================================
--- python/branches/p3yk-noslice/Objects/bytesobject.c	(original)
+++ python/branches/p3yk-noslice/Objects/bytesobject.c	Thu Jan 11 00:21:28 2007
@@ -324,7 +324,7 @@
 }
  
 static int
-bytes_setslice(PyBytesObject *self, Py_ssize_t lo, Py_ssize_t hi, 
+bytes_setslice(PyBytesObject *self, Py_ssize_t lo, Py_ssize_t hi,
                PyObject *values)
 {
     int avail;
@@ -373,7 +373,7 @@
             memmove(self->ob_bytes + lo + needed, self->ob_bytes + hi,
                     self->ob_size - hi);
         }
-        if (PyBytes_Resize((PyObject *)self, 
+        if (PyBytes_Resize((PyObject *)self,
                            self->ob_size + needed - avail) < 0)
             return -1;
         if (avail < needed) {
@@ -510,7 +510,7 @@
                 memmove(self->ob_bytes + start + needed, self->ob_bytes + stop,
                         self->ob_size - stop);
             }
-            if (PyBytes_Resize((PyObject *)self, 
+            if (PyBytes_Resize((PyObject *)self,
                                self->ob_size + needed - slicelen) < 0)
                 return -1;
             if (slicelen < needed) {
@@ -557,7 +557,7 @@
                         self->ob_bytes + cur,
                         PyBytes_GET_SIZE(self) - cur);
             }
-            if (PyBytes_Resize((PyObject *)self, 
+            if (PyBytes_Resize((PyObject *)self,
                                PyBytes_GET_SIZE(self) - slicelen) < 0)
                 return -1;
 
@@ -1034,7 +1034,7 @@
     PyObject_GenericGetAttr,            /* tp_getattro */
     0,                                  /* tp_setattro */
     &bytes_as_buffer,                   /* tp_as_buffer */
-    Py_TPFLAGS_DEFAULT,			/* tp_flags */ 
+    Py_TPFLAGS_DEFAULT,			/* tp_flags */
                                         /* bytes is 'final' or 'sealed' */
     bytes_doc,                          /* tp_doc */
     0,                                  /* tp_traverse */

Modified: python/branches/p3yk-noslice/Objects/dictnotes.txt
==============================================================================
--- python/branches/p3yk-noslice/Objects/dictnotes.txt	(original)
+++ python/branches/p3yk-noslice/Objects/dictnotes.txt	Thu Jan 11 00:21:28 2007
@@ -44,7 +44,7 @@
             d.setdefault(word, []).append(pagenumber)
 
     Note, the second example is a use case characterized by a get and set
-    to the same key.  There are similar used cases with a __contains__
+    to the same key.  There are similar use cases with a __contains__
     followed by a get, set, or del to the same key.  Part of the
     justification for d.setdefault is combining the two lookups into one.
 

Modified: python/branches/p3yk-noslice/Objects/floatobject.c
==============================================================================
--- python/branches/p3yk-noslice/Objects/floatobject.c	(original)
+++ python/branches/p3yk-noslice/Objects/floatobject.c	Thu Jan 11 00:21:28 2007
@@ -220,19 +220,18 @@
 /* Methods */
 
 static void
-format_float(char *buf, size_t buflen, PyFloatObject *v, int precision)
+format_double(char *buf, size_t buflen, double ob_fval, int precision)
 {
 	register char *cp;
 	char format[32];
-	/* Subroutine for float_repr and float_print.
+	/* Subroutine for float_repr, float_str, float_print and others.
 	   We want float numbers to be recognizable as such,
 	   i.e., they should contain a decimal point or an exponent.
 	   However, %g may print the number as an integer;
 	   in such cases, we append ".0" to the string. */
 
-	assert(PyFloat_Check(v));
 	PyOS_snprintf(format, 32, "%%.%ig", precision);
-	PyOS_ascii_formatd(buf, buflen, format, v->ob_fval);
+	PyOS_ascii_formatd(buf, buflen, format, ob_fval);
 	cp = buf;
 	if (*cp == '-')
 		cp++;
@@ -249,14 +248,11 @@
 	}
 }
 
-/* XXX PyFloat_AsStringEx should not be a public API function (for one
-   XXX thing, its signature passes a buffer without a length; for another,
-   XXX it isn't useful outside this file).
-*/
-void
-PyFloat_AsStringEx(char *buf, PyFloatObject *v, int precision)
+static void
+format_float(char *buf, size_t buflen, PyFloatObject *v, int precision)
 {
-	format_float(buf, 100, v, precision);
+	assert(PyFloat_Check(v));
+	format_double(buf, buflen, PyFloat_AS_DOUBLE(v), precision);
 }
 
 /* Macro and helper that convert PyObject obj to a C double and store
@@ -312,21 +308,6 @@
 #define PREC_REPR	17
 #define PREC_STR	12
 
-/* XXX PyFloat_AsString and PyFloat_AsReprString should be deprecated:
-   XXX they pass a char buffer without passing a length.
-*/
-void
-PyFloat_AsString(char *buf, PyFloatObject *v)
-{
-	format_float(buf, 100, v, PREC_STR);
-}
-
-void
-PyFloat_AsReprString(char *buf, PyFloatObject *v)
-{
-	format_float(buf, 100, v, PREC_REPR);
-}
-
 /* ARGSUSED */
 static int
 float_print(PyFloatObject *v, FILE *fp, int flags)
@@ -1275,7 +1256,7 @@
 				if (PyFloat_CheckExact(p) &&
 				    p->ob_refcnt != 0) {
 					char buf[100];
-					PyFloat_AsString(buf, p);
+					format_float(buf, sizeof(buf), p, PREC_STR);
 					/* XXX(twouters) cast refcount to
 					   long until %zd is universally
 					   available
@@ -1527,6 +1508,14 @@
 	}
 }
 
+/* Should only be used by marshal. */
+int
+_PyFloat_Repr(double x, char *p, size_t len)
+{
+	format_double(p, len, x, PREC_REPR);
+	return (int)strlen(p);
+}
+
 double
 _PyFloat_Unpack4(const unsigned char *p, int le)
 {

Modified: python/branches/p3yk-noslice/Objects/funcobject.c
==============================================================================
--- python/branches/p3yk-noslice/Objects/funcobject.c	(original)
+++ python/branches/p3yk-noslice/Objects/funcobject.c	Thu Jan 11 00:21:28 2007
@@ -38,6 +38,7 @@
 		op->func_doc = doc;
 		op->func_dict = NULL;
 		op->func_module = NULL;
+		op->func_annotations = NULL;
 
 		/* __module__: If module name is in globals, use it.
 		   Otherwise, use None.
@@ -187,6 +188,38 @@
 	return 0;
 }
 
+PyObject *
+PyFunction_GetAnnotations(PyObject *op)
+{
+	if (!PyFunction_Check(op)) {
+		PyErr_BadInternalCall();
+		return NULL;
+	}
+	return ((PyFunctionObject *) op) -> func_annotations;
+}
+
+int
+PyFunction_SetAnnotations(PyObject *op, PyObject *annotations)
+{
+	if (!PyFunction_Check(op)) {
+		PyErr_BadInternalCall();
+		return -1;
+	}
+	if (annotations == Py_None)
+		annotations = NULL;
+	else if (annotations && PyDict_Check(annotations)) {
+		Py_INCREF(annotations);
+	}
+	else {
+		PyErr_SetString(PyExc_SystemError,
+				"non-dict annotations");
+		return -1;
+	}
+	Py_XDECREF(((PyFunctionObject *)op) -> func_annotations);
+	((PyFunctionObject *) op) -> func_annotations = annotations;
+	return 0;
+}
+
 /* Methods */
 
 #define OFF(x) offsetof(PyFunctionObject, x)
@@ -395,12 +428,48 @@
 	return 0;
 }
 
+static PyObject *
+func_get_annotations(PyFunctionObject *op)
+{
+	if (op->func_annotations == NULL) {
+		op->func_annotations = PyDict_New();
+		if (op->func_annotations == NULL)
+			return NULL;
+	}
+	Py_INCREF(op->func_annotations);
+	return op->func_annotations;
+}
+
+static int
+func_set_annotations(PyFunctionObject *op, PyObject *value)
+{
+	PyObject *tmp;
+
+	if (value == Py_None)
+		value = NULL;
+	/* Legal to del f.func_annotations.
+	 * Can only set func_annotations to NULL (through C api)
+	 * or a dict. */
+	if (value != NULL && !PyDict_Check(value)) {
+		PyErr_SetString(PyExc_TypeError,
+			"func_annotations must be set to a dict object");
+		return -1;
+	}
+	tmp = op->func_annotations;
+	Py_XINCREF(value);
+	op->func_annotations = value;
+	Py_XDECREF(tmp);
+	return 0;
+}
+
 static PyGetSetDef func_getsetlist[] = {
         {"func_code", (getter)func_get_code, (setter)func_set_code},
         {"func_defaults", (getter)func_get_defaults,
 	 (setter)func_set_defaults},
 	{"func_kwdefaults", (getter)func_get_kwdefaults,
 	 (setter)func_set_kwdefaults},
+	{"func_annotations", (getter)func_get_annotations,
+	 (setter)func_set_annotations},
 	{"func_dict", (getter)func_get_dict, (setter)func_set_dict},
 	{"__dict__", (getter)func_get_dict, (setter)func_set_dict},
 	{"func_name", (getter)func_get_name, (setter)func_set_name},
@@ -524,6 +593,7 @@
 	Py_XDECREF(op->func_doc);
 	Py_XDECREF(op->func_dict);
 	Py_XDECREF(op->func_closure);
+	Py_XDECREF(op->func_annotations);
 	PyObject_GC_Del(op);
 }
 
@@ -546,6 +616,7 @@
 	Py_VISIT(f->func_name);
 	Py_VISIT(f->func_dict);
 	Py_VISIT(f->func_closure);
+	Py_VISIT(f->func_annotations);
 	return 0;
 }
 

Modified: python/branches/p3yk-noslice/Objects/object.c
==============================================================================
--- python/branches/p3yk-noslice/Objects/object.c	(original)
+++ python/branches/p3yk-noslice/Objects/object.c	Thu Jan 11 00:21:28 2007
@@ -619,7 +619,7 @@
 /* Map rich comparison operators to their swapped version, e.g. LT <--> GT */
 int _Py_SwappedOp[] = {Py_GT, Py_GE, Py_EQ, Py_NE, Py_LT, Py_LE};
 
-static char *opstrings[] = {">", ">=", "==", "!=", "<", "<="};
+static char *opstrings[] = {"<", "<=", "==", "!=", ">", ">="};
 
 /* Perform a rich comparison, raising TypeError when the requested comparison
    operator is not supported. */
@@ -659,6 +659,7 @@
 		res = (v != w) ? Py_True : Py_False;
 		break;
 	default:
+		/* XXX Special-case None so it doesn't show as NoneType() */
 		PyErr_Format(PyExc_TypeError,
 			     "unorderable types: %.100s() %s %.100s()",
 			     v->ob_type->tp_name,

Modified: python/branches/p3yk-noslice/Objects/setobject.c
==============================================================================
--- python/branches/p3yk-noslice/Objects/setobject.c	(original)
+++ python/branches/p3yk-noslice/Objects/setobject.c	Thu Jan 11 00:21:28 2007
@@ -573,8 +573,17 @@
 	char *emit = "";	/* No separator emitted on first pass */
 	char *separator = ", ";
 	int literalform = 0;
+	int status = Py_ReprEnter((PyObject*)so);
+
+	if (status != 0) {
+		if (status < 0)
+			return status;
+		fprintf(fp, "%s(...)", so->ob_type->tp_name);
+		return 0;
+	}        
 
 	if (!so->used) {
+		Py_ReprLeave((PyObject*)so);
 		fprintf(fp, "%s()", so->ob_type->tp_name);
 		return 0;
 	}
@@ -587,32 +596,44 @@
 	while (set_next(so, &pos, &entry)) {
 		fputs(emit, fp);
 		emit = separator;
-		if (PyObject_Print(entry->key, fp, 0) != 0)
+		if (PyObject_Print(entry->key, fp, 0) != 0) {
+			Py_ReprLeave((PyObject*)so);
 			return -1;
+		}
 	}
 	if (literalform)
 		fputs("}", fp);
 	else
 		fputs("])", fp);
+	Py_ReprLeave((PyObject*)so);
 	return 0;
 }
 
 static PyObject *
 set_repr(PySetObject *so)
 {
-	PyObject *keys, *result, *listrepr;
+	PyObject *keys, *result=NULL, *listrepr;
+	int status = Py_ReprEnter((PyObject*)so);
+
+	if (status != 0) {
+		if (status < 0)
+			return NULL;
+		return PyString_FromFormat("%s(...)", so->ob_type->tp_name);
+	}
 
 	/* shortcut for the empty set */
-	if (!so->used)
+	if (!so->used) {
+		Py_ReprLeave((PyObject*)so);
 		return PyString_FromFormat("%s()", so->ob_type->tp_name);
+	}
 
 	keys = PySequence_List((PyObject *)so);
 	if (keys == NULL)
-		return NULL;
+		goto done;
 	listrepr = PyObject_Repr(keys);
 	Py_DECREF(keys);
 	if (listrepr == NULL)
-		return NULL;
+		goto done;
 
 	if (so->ob_type == &PySet_Type) {
 		char *s = PyString_AS_STRING(listrepr);
@@ -624,6 +645,8 @@
 			 	PyString_AS_STRING(listrepr));
 	}
 	Py_DECREF(listrepr);
+done:
+	Py_ReprLeave((PyObject*)so);
 	return result;
 }
 

Modified: python/branches/p3yk-noslice/PC/python_nt.rc
==============================================================================
--- python/branches/p3yk-noslice/PC/python_nt.rc	(original)
+++ python/branches/p3yk-noslice/PC/python_nt.rc	Thu Jan 11 00:21:28 2007
@@ -61,7 +61,7 @@
             VALUE "FileDescription", "Python Core\0"
             VALUE "FileVersion", PYTHON_VERSION
             VALUE "InternalName", "Python DLL\0"
-            VALUE "LegalCopyright", "Copyright © 2001-2006 Python Software Foundation. Copyright © 2000 BeOpen.com. Copyright © 1995-2001 CNRI. Copyright © 1991-1995 SMC.\0"
+            VALUE "LegalCopyright", "Copyright © 2001-2007 Python Software Foundation. Copyright © 2000 BeOpen.com. Copyright © 1995-2001 CNRI. Copyright © 1991-1995 SMC.\0"
             VALUE "OriginalFilename", PYTHON_DLL_NAME "\0"
             VALUE "ProductName", "Python\0"
             VALUE "ProductVersion", PYTHON_VERSION

Modified: python/branches/p3yk-noslice/PCbuild/python20.wse
==============================================================================
--- python/branches/p3yk-noslice/PCbuild/python20.wse	(original)
+++ python/branches/p3yk-noslice/PCbuild/python20.wse	Thu Jan 11 00:21:28 2007
@@ -24,8 +24,8 @@
   Dialogs Version=8
   Version File=2.4a1
   Version Description=Python Programming Language
-  Version Copyright=©2001-2006 Python Software Foundation
-  Version Company=PythonLabs at Zope Corporation
+  Version Copyright=©2001-2007 Python Software Foundation
+  Version Company=Python Software Foundation
   Crystal Format=10111100101100000010001001001001
   Step View=&All
   Variable Name1=_WISE_

Modified: python/branches/p3yk-noslice/PCbuild/pythoncore.vcproj
==============================================================================
--- python/branches/p3yk-noslice/PCbuild/pythoncore.vcproj	(original)
+++ python/branches/p3yk-noslice/PCbuild/pythoncore.vcproj	Thu Jan 11 00:21:28 2007
@@ -437,6 +437,9 @@
 			RelativePath="..\Objects\bufferobject.c">
 		</File>
 		<File
+			RelativePath="..\Objects\bytesobject.c">
+		</File>
+		<File
 			RelativePath="..\Objects\cellobject.c">
 		</File>
 		<File

Modified: python/branches/p3yk-noslice/PCbuild8/python20.wse
==============================================================================
--- python/branches/p3yk-noslice/PCbuild8/python20.wse	(original)
+++ python/branches/p3yk-noslice/PCbuild8/python20.wse	Thu Jan 11 00:21:28 2007
@@ -24,8 +24,8 @@
   Dialogs Version=8
   Version File=2.4a1
   Version Description=Python Programming Language
-  Version Copyright=©2001-2006 Python Software Foundation
-  Version Company=PythonLabs at Zope Corporation
+  Version Copyright=©2001-2007 Python Software Foundation
+  Version Company=Python Software Foundation
   Crystal Format=10111100101100000010001001001001
   Step View=&All
   Variable Name1=_WISE_

Modified: python/branches/p3yk-noslice/Parser/Python.asdl
==============================================================================
--- python/branches/p3yk-noslice/Parser/Python.asdl	(original)
+++ python/branches/p3yk-noslice/Parser/Python.asdl	Thu Jan 11 00:21:28 2007
@@ -10,7 +10,7 @@
 	    | Suite(stmt* body)
 
 	stmt = FunctionDef(identifier name, arguments args, 
-                           stmt* body, expr* decorators)
+                           stmt* body, expr* decorators, expr? returns)
 	      | ClassDef(identifier name, expr* bases, stmt* body)
 	      | Return(expr? value)
 
@@ -100,8 +100,12 @@
 	excepthandler = (expr? type, expr? name, stmt* body, int lineno,
 	                 int col_offset)
 
-	arguments = (expr* args, identifier? vararg, expr* kwonlyargs,
-		         identifier? kwarg, expr* defaults, expr* kw_defaults)
+	arguments = (arg* args, identifier? vararg, expr? varargannotation,
+                     arg* kwonlyargs, identifier? kwarg,
+                     expr? kwargannotation, expr* defaults,
+                     expr* kw_defaults)
+	arg = SimpleArg(identifier arg, expr? annotation)
+            | NestedArgs(arg* args)
 
         -- keyword arguments supplied to call
         keyword = (identifier arg, expr value)

Modified: python/branches/p3yk-noslice/Parser/asdl.py
==============================================================================
--- python/branches/p3yk-noslice/Parser/asdl.py	(original)
+++ python/branches/p3yk-noslice/Parser/asdl.py	Thu Jan 11 00:21:28 2007
@@ -373,7 +373,7 @@
     v.visit(mod)
 
     for t in v.types:
-        if not mod.types.has_key(t) and not t in builtin_types:
+        if t not in mod.types and not t in builtin_types:
             v.errors += 1
             uses = ", ".join(v.types[t])
             print "Undefined type %s, used in %s" % (t, uses)

Modified: python/branches/p3yk-noslice/Parser/spark.py
==============================================================================
--- python/branches/p3yk-noslice/Parser/spark.py	(original)
+++ python/branches/p3yk-noslice/Parser/spark.py	Thu Jan 11 00:21:28 2007
@@ -31,7 +31,7 @@
         for b in c.__bases__:
             classlist.append(b)
         for name in c.__dict__.keys():
-            if not namedict.has_key(name):
+            if name not in namedict:
                 namelist.append(name)
                 namedict[name] = 1
     return namelist
@@ -73,7 +73,7 @@
 
             groups = m.groups()
             for i in range(len(groups)):
-                if groups[i] and self.index2func.has_key(i):
+                if groups[i] and i in self.index2func:
                     self.index2func[i](groups[i])
             pos = m.end()
 
@@ -141,7 +141,7 @@
             for k, v in self.edges.items():
                 if v is None:
                     state, sym = k
-                    if self.states.has_key(state):
+                    if state in self.states:
                         self.goto(state, sym)
                         changes = 1
         rv = self.__dict__.copy()
@@ -188,7 +188,7 @@
             if _preprocess:
                 rule, fn = self.preprocess(rule, func)
 
-            if self.rules.has_key(lhs):
+            if lhs in self.rules:
                 self.rules[lhs].append(rule)
             else:
                 self.rules[lhs] = [ rule ]
@@ -226,7 +226,7 @@
                 #  grammars.
                 #
                 for sym in rhs:
-                    if not self.rules.has_key(sym):
+                    if sym not in self.rules:
                         break
                 else:
                     tbd.append(rule)
@@ -269,7 +269,7 @@
             n = len(rhs)
             while i < n:
                 sym = rhs[i]
-                if not self.rules.has_key(sym) or \
+                if sym not in self.rules or \
                    not self.nullable[sym]:
                     candidate = 0
                     i = i + 1
@@ -286,7 +286,7 @@
                 if candidate:
                     lhs = self._NULLABLE+lhs
                     rule = (lhs, rhs)
-                if self.newrules.has_key(lhs):
+                if lhs in self.newrules:
                     self.newrules[lhs].append(rule)
                 else:
                     self.newrules[lhs] = [ rule ]
@@ -365,7 +365,7 @@
 
         core.sort()
         tcore = tuple(core)
-        if self.cores.has_key(tcore):
+        if tcore in self.cores:
             return self.cores[tcore]
         #
         #  Nope, doesn't exist.  Compute it and the associated
@@ -389,13 +389,13 @@
 
                 nextSym = rhs[pos]
                 key = (X.stateno, nextSym)
-                if not rules.has_key(nextSym):
-                    if not edges.has_key(key):
+                if nextSym not in rules:
+                    if key not in edges:
                         edges[key] = None
                         X.T.append(nextSym)
                 else:
                     edges[key] = None
-                    if not predicted.has_key(nextSym):
+                    if nextSym not in predicted:
                         predicted[nextSym] = 1
                         for prule in rules[nextSym]:
                             ppos = self.skip(prule)
@@ -422,7 +422,7 @@
         core = predicted.keys()
         core.sort()
         tcore = tuple(core)
-        if self.cores.has_key(tcore):
+        if tcore in self.cores:
             self.edges[(k, None)] = self.cores[tcore]
             return k
 
@@ -433,7 +433,7 @@
 
     def goto(self, state, sym):
         key = (state, sym)
-        if not self.edges.has_key(key):
+        if key not in self.edges:
             #
             #  No transitions from state on sym.
             #
@@ -631,7 +631,7 @@
 
         for i in range(len(rhs)-1, -1, -1):
             sym = rhs[i]
-            if not self.newrules.has_key(sym):
+            if sym not in self.newrules:
                 if sym != self._BOF:
                     attr[i] = tokens[k-1]
                     key = (item, k)

Modified: python/branches/p3yk-noslice/Parser/tokenizer.c
==============================================================================
--- python/branches/p3yk-noslice/Parser/tokenizer.c	(original)
+++ python/branches/p3yk-noslice/Parser/tokenizer.c	Thu Jan 11 00:21:28 2007
@@ -92,6 +92,7 @@
 	"DOUBLESLASH",
 	"DOUBLESLASHEQUAL",
 	"AT",
+	"RARROW",
 	/* This table must match the #defines in token.h! */
 	"OP",
 	"<ERRORTOKEN>",
@@ -998,6 +999,7 @@
 	case '-':
 		switch (c2) {
 		case '=':	return MINEQUAL;
+		case '>':	return RARROW;
 		}
 		break;
 	case '*':

Modified: python/branches/p3yk-noslice/Python/Python-ast.c
==============================================================================
--- python/branches/p3yk-noslice/Python/Python-ast.c	(original)
+++ python/branches/p3yk-noslice/Python/Python-ast.c	Thu Jan 11 00:21:28 2007
@@ -34,6 +34,7 @@
         "args",
         "body",
         "decorators",
+        "returns",
 };
 static PyTypeObject *ClassDef_type;
 static char *ClassDef_fields[]={
@@ -333,11 +334,24 @@
 static char *arguments_fields[]={
         "args",
         "vararg",
+        "varargannotation",
         "kwonlyargs",
         "kwarg",
+        "kwargannotation",
         "defaults",
         "kw_defaults",
 };
+static PyTypeObject *arg_type;
+static PyObject* ast2obj_arg(void*);
+static PyTypeObject *SimpleArg_type;
+static char *SimpleArg_fields[]={
+        "arg",
+        "annotation",
+};
+static PyTypeObject *NestedArgs_type;
+static char *NestedArgs_fields[]={
+        "args",
+};
 static PyTypeObject *keyword_type;
 static PyObject* ast2obj_keyword(void*);
 static char *keyword_fields[]={
@@ -454,7 +468,7 @@
         if (!stmt_type) return 0;
         if (!add_attributes(stmt_type, stmt_attributes, 2)) return 0;
         FunctionDef_type = make_type("FunctionDef", stmt_type,
-                                     FunctionDef_fields, 4);
+                                     FunctionDef_fields, 5);
         if (!FunctionDef_type) return 0;
         ClassDef_type = make_type("ClassDef", stmt_type, ClassDef_fields, 3);
         if (!ClassDef_type) return 0;
@@ -710,8 +724,16 @@
         excepthandler_type = make_type("excepthandler", AST_type,
                                        excepthandler_fields, 5);
         if (!excepthandler_type) return 0;
-        arguments_type = make_type("arguments", AST_type, arguments_fields, 6);
+        arguments_type = make_type("arguments", AST_type, arguments_fields, 8);
         if (!arguments_type) return 0;
+        arg_type = make_type("arg", AST_type, NULL, 0);
+        if (!arg_type) return 0;
+        if (!add_attributes(arg_type, NULL, 0)) return 0;
+        SimpleArg_type = make_type("SimpleArg", arg_type, SimpleArg_fields, 2);
+        if (!SimpleArg_type) return 0;
+        NestedArgs_type = make_type("NestedArgs", arg_type, NestedArgs_fields,
+                                    1);
+        if (!NestedArgs_type) return 0;
         keyword_type = make_type("keyword", AST_type, keyword_fields, 2);
         if (!keyword_type) return 0;
         alias_type = make_type("alias", AST_type, alias_fields, 2);
@@ -783,7 +805,8 @@
 
 stmt_ty
 FunctionDef(identifier name, arguments_ty args, asdl_seq * body, asdl_seq *
-            decorators, int lineno, int col_offset, PyArena *arena)
+            decorators, expr_ty returns, int lineno, int col_offset, PyArena
+            *arena)
 {
         stmt_ty p;
         if (!name) {
@@ -806,6 +829,7 @@
         p->v.FunctionDef.args = args;
         p->v.FunctionDef.body = body;
         p->v.FunctionDef.decorators = decorators;
+        p->v.FunctionDef.returns = returns;
         p->lineno = lineno;
         p->col_offset = col_offset;
         return p;
@@ -1830,8 +1854,9 @@
 }
 
 arguments_ty
-arguments(asdl_seq * args, identifier vararg, asdl_seq * kwonlyargs, identifier
-          kwarg, asdl_seq * defaults, asdl_seq * kw_defaults, PyArena *arena)
+arguments(asdl_seq * args, identifier vararg, expr_ty varargannotation,
+          asdl_seq * kwonlyargs, identifier kwarg, expr_ty kwargannotation,
+          asdl_seq * defaults, asdl_seq * kw_defaults, PyArena *arena)
 {
         arguments_ty p;
         p = (arguments_ty)PyArena_Malloc(arena, sizeof(*p));
@@ -1841,13 +1866,49 @@
         }
         p->args = args;
         p->vararg = vararg;
+        p->varargannotation = varargannotation;
         p->kwonlyargs = kwonlyargs;
         p->kwarg = kwarg;
+        p->kwargannotation = kwargannotation;
         p->defaults = defaults;
         p->kw_defaults = kw_defaults;
         return p;
 }
 
+arg_ty
+SimpleArg(identifier arg, expr_ty annotation, PyArena *arena)
+{
+        arg_ty p;
+        if (!arg) {
+                PyErr_SetString(PyExc_ValueError,
+                                "field arg is required for SimpleArg");
+                return NULL;
+        }
+        p = (arg_ty)PyArena_Malloc(arena, sizeof(*p));
+        if (!p) {
+                PyErr_NoMemory();
+                return NULL;
+        }
+        p->kind = SimpleArg_kind;
+        p->v.SimpleArg.arg = arg;
+        p->v.SimpleArg.annotation = annotation;
+        return p;
+}
+
+arg_ty
+NestedArgs(asdl_seq * args, PyArena *arena)
+{
+        arg_ty p;
+        p = (arg_ty)PyArena_Malloc(arena, sizeof(*p));
+        if (!p) {
+                PyErr_NoMemory();
+                return NULL;
+        }
+        p->kind = NestedArgs_kind;
+        p->v.NestedArgs.args = args;
+        return p;
+}
+
 keyword_ty
 keyword(identifier arg, expr_ty value, PyArena *arena)
 {
@@ -1981,6 +2042,11 @@
                 if (PyObject_SetAttrString(result, "decorators", value) == -1)
                         goto failed;
                 Py_DECREF(value);
+                value = ast2obj_expr(o->v.FunctionDef.returns);
+                if (!value) goto failed;
+                if (PyObject_SetAttrString(result, "returns", value) == -1)
+                        goto failed;
+                Py_DECREF(value);
                 break;
         case ClassDef_kind:
                 result = PyType_GenericNew(ClassDef_type, NULL, NULL);
@@ -2901,7 +2967,7 @@
 
         result = PyType_GenericNew(arguments_type, NULL, NULL);
         if (!result) return NULL;
-        value = ast2obj_list(o->args, ast2obj_expr);
+        value = ast2obj_list(o->args, ast2obj_arg);
         if (!value) goto failed;
         if (PyObject_SetAttrString(result, "args", value) == -1)
                 goto failed;
@@ -2911,7 +2977,12 @@
         if (PyObject_SetAttrString(result, "vararg", value) == -1)
                 goto failed;
         Py_DECREF(value);
-        value = ast2obj_list(o->kwonlyargs, ast2obj_expr);
+        value = ast2obj_expr(o->varargannotation);
+        if (!value) goto failed;
+        if (PyObject_SetAttrString(result, "varargannotation", value) == -1)
+                goto failed;
+        Py_DECREF(value);
+        value = ast2obj_list(o->kwonlyargs, ast2obj_arg);
         if (!value) goto failed;
         if (PyObject_SetAttrString(result, "kwonlyargs", value) == -1)
                 goto failed;
@@ -2921,6 +2992,11 @@
         if (PyObject_SetAttrString(result, "kwarg", value) == -1)
                 goto failed;
         Py_DECREF(value);
+        value = ast2obj_expr(o->kwargannotation);
+        if (!value) goto failed;
+        if (PyObject_SetAttrString(result, "kwargannotation", value) == -1)
+                goto failed;
+        Py_DECREF(value);
         value = ast2obj_list(o->defaults, ast2obj_expr);
         if (!value) goto failed;
         if (PyObject_SetAttrString(result, "defaults", value) == -1)
@@ -2939,6 +3015,48 @@
 }
 
 PyObject*
+ast2obj_arg(void* _o)
+{
+        arg_ty o = (arg_ty)_o;
+        PyObject *result = NULL, *value = NULL;
+        if (!o) {
+                Py_INCREF(Py_None);
+                return Py_None;
+        }
+
+        switch (o->kind) {
+        case SimpleArg_kind:
+                result = PyType_GenericNew(SimpleArg_type, NULL, NULL);
+                if (!result) goto failed;
+                value = ast2obj_identifier(o->v.SimpleArg.arg);
+                if (!value) goto failed;
+                if (PyObject_SetAttrString(result, "arg", value) == -1)
+                        goto failed;
+                Py_DECREF(value);
+                value = ast2obj_expr(o->v.SimpleArg.annotation);
+                if (!value) goto failed;
+                if (PyObject_SetAttrString(result, "annotation", value) == -1)
+                        goto failed;
+                Py_DECREF(value);
+                break;
+        case NestedArgs_kind:
+                result = PyType_GenericNew(NestedArgs_type, NULL, NULL);
+                if (!result) goto failed;
+                value = ast2obj_list(o->v.NestedArgs.args, ast2obj_arg);
+                if (!value) goto failed;
+                if (PyObject_SetAttrString(result, "args", value) == -1)
+                        goto failed;
+                Py_DECREF(value);
+                break;
+        }
+        return result;
+failed:
+        Py_XDECREF(value);
+        Py_XDECREF(result);
+        return NULL;
+}
+
+PyObject*
 ast2obj_keyword(void* _o)
 {
         keyword_ty o = (keyword_ty)_o;
@@ -3008,7 +3126,7 @@
         if (PyDict_SetItemString(d, "AST", (PyObject*)AST_type) < 0) return;
         if (PyModule_AddIntConstant(m, "PyCF_ONLY_AST", PyCF_ONLY_AST) < 0)
                 return;
-        if (PyModule_AddStringConstant(m, "__version__", "53040") < 0)
+        if (PyModule_AddStringConstant(m, "__version__", "53170") < 0)
                 return;
         if (PyDict_SetItemString(d, "mod", (PyObject*)mod_type) < 0) return;
         if (PyDict_SetItemString(d, "Module", (PyObject*)Module_type) < 0)
@@ -3146,6 +3264,11 @@
             (PyObject*)excepthandler_type) < 0) return;
         if (PyDict_SetItemString(d, "arguments", (PyObject*)arguments_type) <
             0) return;
+        if (PyDict_SetItemString(d, "arg", (PyObject*)arg_type) < 0) return;
+        if (PyDict_SetItemString(d, "SimpleArg", (PyObject*)SimpleArg_type) <
+            0) return;
+        if (PyDict_SetItemString(d, "NestedArgs", (PyObject*)NestedArgs_type) <
+            0) return;
         if (PyDict_SetItemString(d, "keyword", (PyObject*)keyword_type) < 0)
             return;
         if (PyDict_SetItemString(d, "alias", (PyObject*)alias_type) < 0) return;

Modified: python/branches/p3yk-noslice/Python/ast.c
==============================================================================
--- python/branches/p3yk-noslice/Python/ast.c	(original)
+++ python/branches/p3yk-noslice/Python/ast.c	Thu Jan 11 00:21:28 2007
@@ -388,14 +388,14 @@
             expr_name = "list comprehension";
             break;
         case Dict_kind:
-	case Set_kind:
+        case Set_kind:
         case Num_kind:
         case Str_kind:
             expr_name = "literal";
             break;
-	case Ellipsis_kind:
-	    expr_name = "Ellipsis";
-	    break;
+        case Ellipsis_kind:
+            expr_name = "Ellipsis";
+            break;
         case Compare_kind:
             expr_name = "comparison";
             break;
@@ -553,59 +553,74 @@
     return seq;
 }
 
-static expr_ty
+static arg_ty
+compiler_simple_arg(struct compiling *c, const node *n)
+{
+    identifier name;
+    expr_ty annotation = NULL;
+    node *ch;
+
+    assert(TYPE(n) == tname || TYPE(n) == vname);
+    ch = CHILD(n, 0);
+    if (!strcmp(STR(ch), "None")) {
+        ast_error(ch, "assignment to None");
+        return NULL;
+    }
+    name = NEW_IDENTIFIER(ch);
+    if (!name)
+        return NULL;
+
+    if (NCH(n) == 3 && TYPE(CHILD(n, 1)) == COLON) {
+        annotation = ast_for_expr(c, CHILD(n, 2));
+        if (!annotation)
+            return NULL;
+    }
+
+    return SimpleArg(name, annotation, c->c_arena);
+}
+
+static arg_ty
 compiler_complex_args(struct compiling *c, const node *n)
 {
     int i, len = (NCH(n) + 1) / 2;
-    expr_ty result;
+    arg_ty arg;
     asdl_seq *args = asdl_seq_new(len, c->c_arena);
     if (!args)
         return NULL;
 
-    /* fpdef: NAME | '(' fplist ')'
-       fplist: fpdef (',' fpdef)* [',']
-    */
-    REQ(n, fplist);
+    assert(TYPE(n) == tfplist || TYPE(n) == vfplist);
     for (i = 0; i < len; i++) {
-        const node *fpdef_node = CHILD(n, 2*i);
-        const node *child;
-        expr_ty arg;
-set_name:
-        /* fpdef_node is either a NAME or an fplist */
-        child = CHILD(fpdef_node, 0);
-        if (TYPE(child) == NAME) {
-                if (!strcmp(STR(child), "None")) {
-                        ast_error(child, "assignment to None");
-                        return NULL;
-                    }   
-            arg = Name(NEW_IDENTIFIER(child), Store, LINENO(child),
-                       child->n_col_offset, c->c_arena);
-            }
-        else {
-            assert(TYPE(fpdef_node) == fpdef);
-            /* fpdef_node[0] is not a name, so it must be a '(', get CHILD[1] */
-            child = CHILD(fpdef_node, 1);
-            assert(TYPE(child) == fplist);
-            /* NCH == 1 means we have (x), we need to elide the extra parens */
-            if (NCH(child) == 1) {
-                fpdef_node = CHILD(child, 0);
-                assert(TYPE(fpdef_node) == fpdef);
-                goto set_name;
-            }
-            arg = compiler_complex_args(c, child);
+        const node *child = CHILD(n, 2*i);
+        /* def foo(((x), y)): -- x is not nested complex, special case. */
+        while (NCH(child) == 3 && NCH(CHILD(child, 1)) == 1)
+            child = CHILD(CHILD(child, 1), 0);
+
+        /* child either holds a tname or '(', a tfplist, ')' */
+        switch (TYPE(CHILD(child, 0))) {
+        case tname:
+        case vname:
+            arg = compiler_simple_arg(c, CHILD(child, 0));
+            break;
+        case LPAR:
+            arg = compiler_complex_args(c, CHILD(child, 1));
+            break;
+        default:
+            PyErr_Format(PyExc_SystemError,
+                             "unexpected node in args: %d @ %d",
+                             TYPE(CHILD(child, 0)), i);
+            arg = NULL;
         }
+        if (!arg)
+            return NULL;
         asdl_seq_SET(args, i, arg);
     }
 
-    result = Tuple(args, Store, LINENO(n), n->n_col_offset, c->c_arena);
-    if (!set_context(result, Store, n))
-        return NULL;
-    return result;
+    return NestedArgs(args, c->c_arena);
 }
 
 /* returns -1 if failed to handle keyword only arguments
    returns new position to keep processing if successful
-               (',' NAME ['=' test])* 
+               (',' tname ['=' test])*
                      ^^^
    start pointing here
  */
@@ -614,7 +629,8 @@
                         asdl_seq *kwonlyargs, asdl_seq *kwdefaults)
 {
     node *ch;
-    expr_ty name;
+    expr_ty expression, annotation;
+    arg_ty arg;
     int i = start;
     int j = 0; /* index for kwdefaults and kwonlyargs */
     assert(kwonlyargs != NULL);
@@ -622,9 +638,10 @@
     while (i < NCH(n)) {
         ch = CHILD(n, i);
         switch (TYPE(ch)) {
-            case NAME:
+            case vname:
+            case tname:
                 if (i + 1 < NCH(n) && TYPE(CHILD(n, i + 1)) == EQUAL) {
-                    expr_ty expression = ast_for_expr(c, CHILD(n, i + 2));
+                    expression = ast_for_expr(c, CHILD(n, i + 2));
                     if (!expression) {
                         ast_error(ch, "assignment to None");
                         goto error;
@@ -635,18 +652,28 @@
                 else { /* setting NULL if no default value exists */
                     asdl_seq_SET(kwdefaults, j, NULL);
                 }
+                if (NCH(ch) == 3) {
+                    /* ch is NAME ':' test */
+                    annotation = ast_for_expr(c, CHILD(ch, 2));
+                    if (!annotation) {
+                        ast_error(ch, "expected expression");
+                        goto error;
+                    }
+                }
+                else {
+                    annotation = NULL;
+                }
+                ch = CHILD(ch, 0);
                 if (!strcmp(STR(ch), "None")) {
                     ast_error(ch, "assignment to None");
                     goto error;
                 }
-                name = Name(NEW_IDENTIFIER(ch),
-                            Param, LINENO(ch), ch->n_col_offset,
-                            c->c_arena);
-                if (!name) {
+                arg = SimpleArg(NEW_IDENTIFIER(ch), annotation, c->c_arena);
+                if (!arg) {
                     ast_error(ch, "expecting name");
                     goto error;
                 }
-                asdl_seq_SET(kwonlyargs, j++, name);
+                asdl_seq_SET(kwonlyargs, j++, arg);
                 i += 2; /* the name and the comma */
                 break;
             case DOUBLESTAR:
@@ -666,29 +693,41 @@
 static arguments_ty
 ast_for_arguments(struct compiling *c, const node *n)
 {
-    /* parameters: '(' [varargslist] ')'
-       varargslist: (fpdef ['=' test] ',')* 
-             ('*' [NAME] (',' fpdef ['=' test])* [',' '**' NAME] | '**' NAME)
-             | fpdef ['=' test] (',' fpdef ['=' test])* [',']
+    /* This function handles both typedargslist (function definition)
+       and varargslist (lambda definition).
+
+       parameters: '(' [typedargslist] ')'
+       typedargslist: ((tfpdef ['=' test] ',')*
+           ('*' [tname] (',' tname ['=' test])* [',' '**' tname]
+           | '**' tname)
+           | tfpdef ['=' test] (',' tfpdef ['=' test])* [','])
+       varargslist: ((vfpdef ['=' test] ',')*
+           ('*' [vname] (',' vname ['=' test])*  [',' '**' vname]
+           | '**' vname)
+           | vfpdef ['=' test] (',' vfpdef ['=' test])* [','])
     */
     int i, j, k, nposargs = 0, nkwonlyargs = 0;
     int nposdefaults = 0, found_default = 0;
     asdl_seq *posargs, *posdefaults, *kwonlyargs, *kwdefaults;
     identifier vararg = NULL, kwarg = NULL;
+    arg_ty arg;
+    expr_ty varargannotation = NULL, kwargannotation = NULL;
     node *ch;
 
     if (TYPE(n) == parameters) {
         if (NCH(n) == 2) /* () as argument list */
-            return arguments(NULL, NULL, NULL, NULL, NULL, NULL, c->c_arena);
+            return arguments(NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+                             NULL, c->c_arena);
         n = CHILD(n, 1);
     }
-    REQ(n, varargslist);
+    assert(TYPE(n) == typedargslist || TYPE(n) == varargslist);
 
     /* first count the number of positional args & defaults */
     for (i = 0; i < NCH(n); i++) {
         ch = CHILD(n, i);
         if (TYPE(ch) == STAR) {
-            if (TYPE(CHILD(n, i+1)) == NAME) {
+            if (TYPE(CHILD(n, i+1)) == tname
+                || TYPE(CHILD(n, i+1)) == vname) {
             /* skip NAME of vararg */
             /* so that following can count only keyword only args */
                 i += 2;
@@ -698,7 +737,7 @@
             }
             break; 
         }
-        if (TYPE(ch) == fpdef) nposargs++;
+        if (TYPE(ch) == vfpdef || TYPE(ch) == tfpdef) nposargs++;
         if (TYPE(ch) == EQUAL) nposdefaults++;
     }
     /* count the number of keyword only args & 
@@ -706,35 +745,39 @@
     for ( ; i < NCH(n); ++i) {
         ch = CHILD(n, i);
         if (TYPE(ch) == DOUBLESTAR) break;
-        if (TYPE(ch) == NAME) nkwonlyargs++;
+        if (TYPE(ch) == tname || TYPE(ch) == vname) nkwonlyargs++;
     }
 
     posargs = (nposargs ? asdl_seq_new(nposargs, c->c_arena) : NULL);
     if (!posargs && nposargs)
-            return NULL; /* Don't need to goto error; no objects allocated */
+        goto error;
     kwonlyargs = (nkwonlyargs ?
                    asdl_seq_new(nkwonlyargs, c->c_arena) : NULL);
     if (!kwonlyargs && nkwonlyargs)
-            return NULL; /* Don't need to goto error; no objects allocated */
+        goto error;
     posdefaults = (nposdefaults ? 
                     asdl_seq_new(nposdefaults, c->c_arena) : NULL);
     if (!posdefaults && nposdefaults)
-            return NULL; /* Don't need to goto error; no objects allocated */
+        goto error;
     /* The length of kwonlyargs and kwdefaults are same 
        since we set NULL as default for keyword only argument w/o default
        - we have sequence data structure, but no dictionary */
-    kwdefaults = (nkwonlyargs ? 
+    kwdefaults = (nkwonlyargs ?
                    asdl_seq_new(nkwonlyargs, c->c_arena) : NULL);
     if (!kwdefaults && nkwonlyargs)
-            return NULL; /* Don't need to goto error; no objects allocated */
+        goto error;
 
     if (nposargs + nkwonlyargs > 255) {
-		ast_error(n, "more than 255 arguments");
-		return NULL;
+        ast_error(n, "more than 255 arguments");
+        return NULL;
     }
 
-    /* fpdef: NAME | '(' fplist ')'
-       fplist: fpdef (',' fpdef)* [',']
+    /* tname: NAME [':' test]
+       tfpdef: tname | '(' tfplist ')'
+       tfplist: tfpdef (',' tfpdef)* [',']
+       vname: NAME
+       vfpdef: NAME | '(' vfplist ')'
+       vfplist: vfpdef (',' vfpdef)* [',']
     */
     i = 0;
     j = 0;  /* index for defaults */
@@ -742,8 +785,8 @@
     while (i < NCH(n)) {
         ch = CHILD(n, i);
         switch (TYPE(ch)) {
-            case fpdef:
-            handle_fpdef:
+            case tfpdef:
+            case vfpdef:
                 /* XXX Need to worry about checking if TYPE(CHILD(n, i+1)) is
                    anything other than EQUAL or a comma? */
                 /* XXX Should NCH(n) check be made a separate check? */
@@ -753,7 +796,6 @@
                         goto error;
                     assert(posdefaults != NULL);
                     asdl_seq_SET(posdefaults, j++, expression);
-
                     i += 2;
                     found_default = 1;
                 }
@@ -762,59 +804,47 @@
                              "non-default argument follows default argument");
                     goto error;
                 }
-                if (NCH(ch) == 3) {
-                    ch = CHILD(ch, 1);
-                    /* def foo((x)): is not complex, special case. */
-                    if (NCH(ch) != 1) {
-                        /* We have complex arguments, setup for unpacking. */
-                        asdl_seq_SET(posargs, k++,
-                                     compiler_complex_args(c, ch));
-                    } else {
-                        /* def foo((x)): setup for checking NAME below. */
-                        /* Loop because there can be many parens and tuple
-                           unpacking mixed in. */
-                        ch = CHILD(ch, 0);
-                        assert(TYPE(ch) == fpdef);
-                        goto handle_fpdef;
-                    }
-                }
-                if (TYPE(CHILD(ch, 0)) == NAME) {
-                    expr_ty name;
-                    if (!strcmp(STR(CHILD(ch, 0)), "None")) {
-                            ast_error(CHILD(ch, 0), "assignment to None");
-                            goto error;
-                    }
-                    name = Name(NEW_IDENTIFIER(CHILD(ch, 0)),
-                                Param, LINENO(ch), ch->n_col_offset,
-                                c->c_arena);
-                    if (!name)
-                        goto error;
-                    asdl_seq_SET(posargs, k++, name);
+                /* def foo((x)): is not complex, special case. */
+                while (NCH(ch) == 3 && NCH(CHILD(ch, 1)) == 1)
+                    ch = CHILD(CHILD(ch, 1), 0);
+
+                if (NCH(ch) != 1)
+                    arg = compiler_complex_args(c, CHILD(ch, 1));
+                else
+                    arg = compiler_simple_arg(c, CHILD(ch, 0));
+                if (!arg)
+                    goto error;
+                asdl_seq_SET(posargs, k++, arg);
 
-                }
                 i += 2; /* the name and the comma */
                 break;
             case STAR:
                 if (i+1 >= NCH(n)) {
                     ast_error(CHILD(n, i), "no name for vararg");
-		    goto error;
-                }
-                if (!strcmp(STR(CHILD(n, i+1)), "None")) {
-                        ast_error(CHILD(n, i+1), "assignment to None");
-                        goto error;
+                    goto error;
                 }
-                if (TYPE(CHILD(n, i+1)) == COMMA) {
-                    int res = 0;    
+                ch = CHILD(n, i+1);  /* tname or COMMA */
+                if (TYPE(ch) == COMMA) {
+                    int res = 0;
                     i += 2; /* now follows keyword only arguments */
                     res = handle_keywordonly_args(c, n, i,
                                                   kwonlyargs, kwdefaults);
                     if (res == -1) goto error;
                     i = res; /* res has new position to process */
                 }
+                else if (!strcmp(STR(CHILD(ch, 0)), "None")) {
+                    ast_error(CHILD(ch, 0), "assignment to None");
+                    goto error;
+                }
                 else {
-                    vararg = NEW_IDENTIFIER(CHILD(n, i+1));
+                    vararg = NEW_IDENTIFIER(CHILD(ch, 0));
+                    if (NCH(ch) > 1) {
+                            /* there is an annotation on the vararg */
+                            varargannotation = ast_for_expr(c, CHILD(ch, 2));
+                    }
                     i += 3;
-                    if (i < NCH(n) && TYPE(CHILD(n, i)) == NAME) {
+                    if (i < NCH(n) && (TYPE(CHILD(n, i)) == tname
+                                    || TYPE(CHILD(n, i)) == vname)) {
                         int res = 0;
                         res = handle_keywordonly_args(c, n, i,
                                                       kwonlyargs, kwdefaults);
@@ -824,11 +854,17 @@
                 }
                 break;
             case DOUBLESTAR:
-                if (!strcmp(STR(CHILD(n, i+1)), "None")) {
-                        ast_error(CHILD(n, i+1), "assignment to None");
+                ch = CHILD(n, i+1);  /* tname */
+                assert(TYPE(ch) == tname || TYPE(ch) == vname);
+                if (!strcmp(STR(CHILD(ch, 0)), "None")) {
+                        ast_error(CHILD(ch, 0), "assignment to None");
                         goto error;
                 }
-                kwarg = NEW_IDENTIFIER(CHILD(n, i+1));
+                kwarg = NEW_IDENTIFIER(CHILD(ch, 0));
+                if (NCH(ch) > 1) {
+                    /* there is an annotation on the kwarg */
+                    kwargannotation = ast_for_expr(c, CHILD(ch, 2));
+                }
                 i += 3;
                 break;
             default:
@@ -838,8 +874,8 @@
                 goto error;
         }
     }
-    return arguments(posargs, vararg, kwonlyargs, kwarg, 
-                     posdefaults, kwdefaults, c->c_arena);
+    return arguments(posargs, vararg, varargannotation, kwonlyargs, kwarg,
+                    kwargannotation, posdefaults, kwdefaults, c->c_arena);
  error:
     Py_XDECREF(vararg);
     Py_XDECREF(kwarg);
@@ -938,11 +974,12 @@
 static stmt_ty
 ast_for_funcdef(struct compiling *c, const node *n)
 {
-    /* funcdef: 'def' [decorators] NAME parameters ':' suite */
+    /* funcdef: 'def' [decorators] NAME parameters ['->' test] ':' suite */
     identifier name;
     arguments_ty args;
     asdl_seq *body;
     asdl_seq *decorator_seq = NULL;
+    expr_ty returns = NULL;
     int name_i;
 
     REQ(n, funcdef);
@@ -967,11 +1004,17 @@
     args = ast_for_arguments(c, CHILD(n, name_i + 1));
     if (!args)
         return NULL;
+    if (TYPE(CHILD(n, name_i+2)) == RARROW) {
+        returns = ast_for_expr(c, CHILD(n, name_i + 3));
+        if (!returns)
+                return NULL;
+        name_i += 2;
+    }
     body = ast_for_suite(c, CHILD(n, name_i + 3));
     if (!body)
         return NULL;
 
-    return FunctionDef(name, args, body, decorator_seq, LINENO(n),
+    return FunctionDef(name, args, body, decorator_seq, returns, LINENO(n),
                        n->n_col_offset, c->c_arena);
 }
 
@@ -983,7 +1026,8 @@
     expr_ty expression;
 
     if (NCH(n) == 3) {
-        args = arguments(NULL, NULL, NULL, NULL, NULL, NULL, c->c_arena);
+        args = arguments(NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+                         NULL, c->c_arena);
         if (!args)
             return NULL;
         expression = ast_for_expr(c, CHILD(n, 2));
@@ -1361,9 +1405,8 @@
         PyArena_AddPyObject(c->c_arena, pynum);
         return Num(pynum, LINENO(n), n->n_col_offset, c->c_arena);
     }
-    case DOT:
-    	/* Ellipsis */
-	return Ellipsis(LINENO(n), n->n_col_offset, c->c_arena);
+    case DOT: /* Ellipsis */
+        return Ellipsis(LINENO(n), n->n_col_offset, c->c_arena);
     case LPAR: /* some parenthesized expressions */
         ch = CHILD(n, 1);
         
@@ -1394,13 +1437,13 @@
         else
             return ast_for_listcomp(c, ch);
     case LBRACE: {
-	/* dictsetmaker: test ':' test (',' test ':' test)* [','] |
-	 *               test (',' test)* [',']  */
-	int i, size;
-	asdl_seq *keys, *values;
-	
-	ch = CHILD(n, 1);
-	if (NCH(ch) == 1 || (NCH(ch) > 0 && STR(CHILD(ch, 1))[0] == ',')) {
+        /* dictsetmaker: test ':' test (',' test ':' test)* [','] |
+         *               test (',' test)* [',']  */
+        int i, size;
+        asdl_seq *keys, *values;
+
+        ch = CHILD(n, 1);
+        if (NCH(ch) == 1 || (NCH(ch) > 0 && STR(CHILD(ch, 1))[0] == ',')) {
             /* it's a set */
             size = (NCH(ch) + 1) / 2; /* +1 in case no trailing comma */
             keys = asdl_seq_new(size, c->c_arena);
@@ -3046,10 +3089,10 @@
         n = CHILD(n, 0);
     }
     if (TYPE(n) == small_stmt) {
-	REQ(n, small_stmt);
-	n = CHILD(n, 0);
-	/* small_stmt: expr_stmt | print_stmt  | del_stmt | pass_stmt
-	             | flow_stmt | import_stmt | global_stmt | assert_stmt
+        REQ(n, small_stmt);
+        n = CHILD(n, 0);
+        /* small_stmt: expr_stmt | print_stmt  | del_stmt | pass_stmt
+                     | flow_stmt | import_stmt | global_stmt | assert_stmt
         */
         switch (TYPE(n)) {
             case expr_stmt:

Modified: python/branches/p3yk-noslice/Python/bltinmodule.c
==============================================================================
--- python/branches/p3yk-noslice/Python/bltinmodule.c	(original)
+++ python/branches/p3yk-noslice/Python/bltinmodule.c	Thu Jan 11 00:21:28 2007
@@ -1119,31 +1119,6 @@
 
 
 static PyObject *
-builtin_intern(PyObject *self, PyObject *args)
-{
-	PyObject *s;
-	if (!PyArg_ParseTuple(args, "S:intern", &s))
-		return NULL;
-	if (!PyString_CheckExact(s)) {
-		PyErr_SetString(PyExc_TypeError,
-				"can't intern subclass of string");
-		return NULL;
-	}
-	Py_INCREF(s);
-	PyString_InternInPlace(&s);
-	return s;
-}
-
-PyDoc_STRVAR(intern_doc,
-"intern(string) -> string\n\
-\n\
-``Intern'' the given string.  This enters the string in the (global)\n\
-table of interned strings whose purpose is to speed up dictionary lookups.\n\
-Return the string itself or the previously interned string object with the\n\
-same value.");
-
-
-static PyObject *
 builtin_iter(PyObject *self, PyObject *args)
 {
 	PyObject *v, *w = NULL;
@@ -2069,7 +2044,6 @@
  	{"hash",	builtin_hash,       METH_O, hash_doc},
  	{"hex",		builtin_hex,        METH_O, hex_doc},
  	{"id",		builtin_id,         METH_O, id_doc},
- 	{"intern",	builtin_intern,     METH_VARARGS, intern_doc},
  	{"isinstance",  builtin_isinstance, METH_VARARGS, isinstance_doc},
  	{"issubclass",  builtin_issubclass, METH_VARARGS, issubclass_doc},
  	{"iter",	builtin_iter,       METH_VARARGS, iter_doc},

Modified: python/branches/p3yk-noslice/Python/ceval.c
==============================================================================
--- python/branches/p3yk-noslice/Python/ceval.c	(original)
+++ python/branches/p3yk-noslice/Python/ceval.c	Thu Jan 11 00:21:28 2007
@@ -734,7 +734,16 @@
 	   this wasn't always true before 2.3!  PyFrame_New now sets
 	   f->f_lasti to -1 (i.e. the index *before* the first instruction)
 	   and YIELD_VALUE doesn't fiddle with f_lasti any more.  So this
-	   does work.  Promise. */
+	   does work.  Promise. 
+
+	   When the PREDICT() macros are enabled, some opcode pairs follow in
+           direct succession without updating f->f_lasti.  A successful 
+           prediction effectively links the two codes together as if they
+           were a single new opcode; accordingly,f->f_lasti will point to
+           the first code in the pair (for instance, GET_ITER followed by
+           FOR_ITER is effectively a single opcode and f->f_lasti will point
+           at to the beginning of the combined pair.)
+	*/
 	next_instr = first_instr + f->f_lasti + 1;
 	stack_pointer = f->f_stacktop;
 	assert(stack_pointer != NULL);
@@ -2225,10 +2234,38 @@
 		{
 		    int posdefaults = oparg & 0xff;
 		    int kwdefaults = (oparg>>8) & 0xff;
+		    int num_annotations = (oparg >> 16) & 0x7fff;
+		    PyObject *t;
 
 			v = POP(); /* code object */
 			x = PyFunction_New(v, f->f_globals);
 			Py_DECREF(v);
+
+			if (x != NULL && num_annotations > 0) {
+				Py_ssize_t name_ix;
+				u = POP(); /* names of args with annotations */
+				v = PyDict_New();
+				if (v == NULL) {
+					Py_DECREF(x);
+					x = NULL;
+					break;
+				}
+				name_ix = PyTuple_Size(u);
+				assert(num_annotations == name_ix+1);
+				while (name_ix > 0) {
+					--name_ix;
+					t = PyTuple_GET_ITEM(u, name_ix);
+					w = POP();
+					/* XXX(nnorwitz): check for errors */
+					PyDict_SetItem(v, t, w);
+					Py_DECREF(w);
+				}
+
+				err = PyFunction_SetAnnotations(x, v);
+				Py_DECREF(v);
+				Py_DECREF(u);
+			}
+
 			/* XXX Maybe this should be a separate opcode? */
 			if (x != NULL && posdefaults > 0) {
 				v = PyTuple_New(posdefaults);
@@ -2254,6 +2291,7 @@
 				while (--kwdefaults >= 0) {
 					w = POP(); /* default value */
 					u = POP(); /* kw only arg name */
+					/* XXX(nnorwitz): check for errors */
 					PyDict_SetItem(v, u, w);
 				}
 				err = PyFunction_SetKwDefaults(x, v);

Modified: python/branches/p3yk-noslice/Python/compile.c
==============================================================================
--- python/branches/p3yk-noslice/Python/compile.c	(original)
+++ python/branches/p3yk-noslice/Python/compile.c	Thu Jan 11 00:21:28 2007
@@ -805,7 +805,7 @@
 
 		case RAISE_VARARGS:
 			return -oparg;
-#define NARGS(o) (((o) % 256) + 2*((o) / 256))
+#define NARGS(o) (((o) % 256) + 2*(((o) / 256) % 256))
 		case CALL_FUNCTION:
 			return -NARGS(oparg);
 		case CALL_FUNCTION_VAR:
@@ -814,7 +814,7 @@
 		case CALL_FUNCTION_VAR_KW:
 			return -NARGS(oparg)-2;
 		case MAKE_FUNCTION:
-			return -NARGS(oparg);
+			return -NARGS(oparg) - ((oparg >> 16) & 0xffff);
 #undef NARGS
 		case BUILD_SLICE:
 			if (oparg == 3)
@@ -1240,14 +1240,37 @@
 }
 
 static int
+compiler_unpack_nested(struct compiler *c, asdl_seq *args) {
+	int i, len;
+	len = asdl_seq_LEN(args);
+	ADDOP_I(c, UNPACK_SEQUENCE, len);
+	for (i = 0; i < len; i++) {
+		arg_ty elt = (arg_ty)asdl_seq_GET(args, i);
+		switch (elt->kind) {
+		case SimpleArg_kind:
+			if (!compiler_nameop(c, elt->v.SimpleArg.arg, Store))
+				return 0;
+			break;
+		case NestedArgs_kind:
+			if (!compiler_unpack_nested(c, elt->v.NestedArgs.args))
+				return 0;
+			break;
+		default:
+			return 0;
+		}
+    }
+    return 1;
+}
+
+static int
 compiler_arguments(struct compiler *c, arguments_ty args)
 {
 	int i;
 	int n = asdl_seq_LEN(args->args);
-	/* Correctly handle nested argument lists */
+
 	for (i = 0; i < n; i++) {
-		expr_ty arg = (expr_ty)asdl_seq_GET(args->args, i);
-		if (arg->kind == Tuple_kind) {
+		arg_ty arg = (arg_ty)asdl_seq_GET(args->args, i);
+		if (arg->kind == NestedArgs_kind) {
 			PyObject *id = PyString_FromFormat(".%d", i);
 			if (id == NULL) {
 				return 0;
@@ -1257,7 +1280,8 @@
 				return 0;
 			}
 			Py_DECREF(id);
-			VISIT(c, expr, arg);
+			if (!compiler_unpack_nested(c, arg->v.NestedArgs.args))
+				return 0;
 		}
 	}
 	return 1;
@@ -1269,10 +1293,10 @@
 {
 	int i, default_count = 0;
 	for (i = 0; i < asdl_seq_LEN(kwonlyargs); i++) {
-		expr_ty arg = asdl_seq_GET(kwonlyargs, i);
+		arg_ty arg = asdl_seq_GET(kwonlyargs, i);
 		expr_ty default_ = asdl_seq_GET(kw_defaults, i);
 		if (default_) {
-			ADDOP_O(c, LOAD_CONST, arg->v.Name.id, consts);
+			ADDOP_O(c, LOAD_CONST, arg->v.SimpleArg.arg, consts);
 			if (!compiler_visit_expr(c, default_)) {
 			    return -1;
 			}
@@ -1283,14 +1307,112 @@
 }
 
 static int
+compiler_visit_argannotation(struct compiler *c, identifier id,
+    expr_ty annotation, PyObject *names)
+{
+	if (annotation) {
+		VISIT(c, expr, annotation);
+		if (PyList_Append(names, id))
+			return -1;
+	}
+	return 0;
+}
+
+static int
+compiler_visit_argannotations(struct compiler *c, asdl_seq* args,
+                              PyObject *names)
+{
+	int i, error;
+	for (i = 0; i < asdl_seq_LEN(args); i++) {
+		arg_ty arg = (arg_ty)asdl_seq_GET(args, i);
+		if (arg->kind == NestedArgs_kind)
+			error = compiler_visit_argannotations(
+			           c,
+			           arg->v.NestedArgs.args,
+			           names);
+		else
+			error = compiler_visit_argannotation(
+			           c,
+			           arg->v.SimpleArg.arg,
+			           arg->v.SimpleArg.annotation,
+			           names);
+		if (error)
+			return error;
+	}
+	return 0;
+}
+
+static int
+compiler_visit_annotations(struct compiler *c, arguments_ty args,
+                           expr_ty returns)
+{
+	/* push arg annotations and a list of the argument names. return the #
+	   of items pushed. this is out-of-order wrt the source code. */
+	static identifier return_str;
+	PyObject *names;
+	int len;
+	names = PyList_New(0);
+	if (!names)
+		return -1;
+
+	if (compiler_visit_argannotations(c, args->args, names))
+		goto error;
+	if (args->varargannotation &&
+	    compiler_visit_argannotation(c, args->vararg,
+	                                 args->varargannotation, names))
+		goto error;
+	if (compiler_visit_argannotations(c, args->kwonlyargs, names))
+		goto error;
+	if (args->kwargannotation &&
+	    compiler_visit_argannotation(c, args->kwarg,
+	                                 args->kwargannotation, names))
+		goto error;
+
+	if (!return_str) {
+		return_str = PyString_InternFromString("return");
+		if (!return_str)
+			goto error;
+	}
+	if (compiler_visit_argannotation(c, return_str, returns, names)) {
+		goto error;
+	}
+
+	len = PyList_GET_SIZE(names);
+	if (len) {
+		/* convert names to a tuple and place on stack */
+		PyObject *elt;
+		int i;
+		PyObject *s = PyTuple_New(len);
+		if (!s)
+			goto error;
+		for (i = 0; i < len; i++) {
+			elt = PyList_GET_ITEM(names, i);
+			Py_INCREF(elt);
+			PyTuple_SET_ITEM(s, i, elt);
+		}
+		ADDOP_O(c, LOAD_CONST, s, consts);
+		Py_DECREF(s);
+		len++; /* include the just-pushed tuple */
+	}
+	Py_DECREF(names);
+	return len;
+
+error:
+	Py_DECREF(names);
+	return -1;
+}
+
+static int
 compiler_function(struct compiler *c, stmt_ty s)
 {
 	PyCodeObject *co;
 	PyObject *first_const = Py_None;
 	arguments_ty args = s->v.FunctionDef.args;
+	expr_ty returns = s->v.FunctionDef.returns;
 	asdl_seq* decos = s->v.FunctionDef.decorators;
 	stmt_ty st;
 	int i, n, docstring, kw_default_count = 0, arglength;
+	int num_annotations;
 
 	assert(s->kind == FunctionDef_kind);
 
@@ -1305,6 +1427,7 @@
 	}
 	if (args->defaults)
 		VISIT_SEQ(c, expr, args->defaults);
+	num_annotations = compiler_visit_annotations(c, args, returns);
 
 	if (!compiler_enter_scope(c, s->v.FunctionDef.name, (void *)s,
 				  s->lineno))
@@ -1337,9 +1460,11 @@
 
 	arglength = asdl_seq_LEN(args->defaults);
 	arglength |= kw_default_count << 8;
+	arglength |= num_annotations << 16;
 	compiler_make_closure(c, co, arglength);
 	Py_DECREF(co);
 
+        /* decorators */
 	for (i = 0; i < asdl_seq_LEN(decos); i++) {
 		ADDOP_I(c, CALL_FUNCTION, 1);
 	}

Modified: python/branches/p3yk-noslice/Python/errors.c
==============================================================================
--- python/branches/p3yk-noslice/Python/errors.c	(original)
+++ python/branches/p3yk-noslice/Python/errors.c	Thu Jan 11 00:21:28 2007
@@ -649,7 +649,8 @@
 
 	if (warnings_module != NULL) {
 		dict = PyModule_GetDict(warnings_module);
-		func = PyDict_GetItemString(dict, "warn");
+		if (dict != NULL)
+			func = PyDict_GetItemString(dict, "warn");
 	}
 	if (func == NULL) {
 		PySys_WriteStderr("warning: %s\n", message);

Modified: python/branches/p3yk-noslice/Python/getcopyright.c
==============================================================================
--- python/branches/p3yk-noslice/Python/getcopyright.c	(original)
+++ python/branches/p3yk-noslice/Python/getcopyright.c	Thu Jan 11 00:21:28 2007
@@ -4,7 +4,7 @@
 
 static char cprt[] = 
 "\
-Copyright (c) 2001-2006 Python Software Foundation.\n\
+Copyright (c) 2001-2007 Python Software Foundation.\n\
 All Rights Reserved.\n\
 \n\
 Copyright (c) 2000 BeOpen.com.\n\

Modified: python/branches/p3yk-noslice/Python/graminit.c
==============================================================================
--- python/branches/p3yk-noslice/Python/graminit.c	(original)
+++ python/branches/p3yk-noslice/Python/graminit.c	Thu Jan 11 00:21:28 2007
@@ -99,29 +99,38 @@
 static arc arcs_5_3[1] = {
 	{20, 4},
 };
-static arc arcs_5_4[1] = {
+static arc arcs_5_4[2] = {
 	{21, 5},
+	{23, 6},
 };
 static arc arcs_5_5[1] = {
-	{22, 6},
+	{22, 7},
 };
 static arc arcs_5_6[1] = {
-	{0, 6},
+	{24, 8},
+};
+static arc arcs_5_7[1] = {
+	{23, 6},
 };
-static state states_5[7] = {
+static arc arcs_5_8[1] = {
+	{0, 8},
+};
+static state states_5[9] = {
 	{2, arcs_5_0},
 	{1, arcs_5_1},
 	{1, arcs_5_2},
 	{1, arcs_5_3},
-	{1, arcs_5_4},
+	{2, arcs_5_4},
 	{1, arcs_5_5},
 	{1, arcs_5_6},
+	{1, arcs_5_7},
+	{1, arcs_5_8},
 };
 static arc arcs_6_0[1] = {
 	{13, 1},
 };
 static arc arcs_6_1[2] = {
-	{23, 2},
+	{25, 2},
 	{15, 3},
 };
 static arc arcs_6_2[1] = {
@@ -137,54 +146,54 @@
 	{1, arcs_6_3},
 };
 static arc arcs_7_0[3] = {
-	{24, 1},
-	{28, 2},
-	{29, 3},
+	{26, 1},
+	{29, 2},
+	{31, 3},
 };
 static arc arcs_7_1[3] = {
-	{25, 4},
-	{27, 5},
+	{27, 4},
+	{28, 5},
 	{0, 1},
 };
 static arc arcs_7_2[3] = {
-	{19, 6},
-	{27, 7},
+	{30, 6},
+	{28, 7},
 	{0, 2},
 };
 static arc arcs_7_3[1] = {
-	{19, 8},
+	{30, 8},
 };
 static arc arcs_7_4[1] = {
-	{26, 9},
+	{22, 9},
 };
 static arc arcs_7_5[4] = {
-	{24, 1},
-	{28, 2},
-	{29, 3},
+	{26, 1},
+	{29, 2},
+	{31, 3},
 	{0, 5},
 };
 static arc arcs_7_6[2] = {
-	{27, 7},
+	{28, 7},
 	{0, 6},
 };
 static arc arcs_7_7[2] = {
-	{19, 10},
-	{29, 3},
+	{30, 10},
+	{31, 3},
 };
 static arc arcs_7_8[1] = {
 	{0, 8},
 };
 static arc arcs_7_9[2] = {
-	{27, 5},
+	{28, 5},
 	{0, 9},
 };
 static arc arcs_7_10[3] = {
-	{27, 7},
-	{25, 11},
+	{28, 7},
+	{27, 11},
 	{0, 10},
 };
 static arc arcs_7_11[1] = {
-	{26, 6},
+	{22, 6},
 };
 static state states_7[12] = {
 	{3, arcs_7_0},
@@ -200,261 +209,330 @@
 	{3, arcs_7_10},
 	{1, arcs_7_11},
 };
-static arc arcs_8_0[2] = {
+static arc arcs_8_0[1] = {
 	{19, 1},
-	{13, 2},
 };
-static arc arcs_8_1[1] = {
+static arc arcs_8_1[2] = {
+	{23, 2},
 	{0, 1},
 };
 static arc arcs_8_2[1] = {
-	{30, 3},
+	{22, 3},
 };
 static arc arcs_8_3[1] = {
-	{15, 1},
+	{0, 3},
 };
 static state states_8[4] = {
-	{2, arcs_8_0},
-	{1, arcs_8_1},
+	{1, arcs_8_0},
+	{2, arcs_8_1},
 	{1, arcs_8_2},
 	{1, arcs_8_3},
 };
-static arc arcs_9_0[1] = {
-	{24, 1},
+static arc arcs_9_0[2] = {
+	{30, 1},
+	{13, 2},
 };
-static arc arcs_9_1[2] = {
-	{27, 2},
+static arc arcs_9_1[1] = {
 	{0, 1},
 };
-static arc arcs_9_2[2] = {
-	{24, 1},
-	{0, 2},
+static arc arcs_9_2[1] = {
+	{32, 3},
 };
-static state states_9[3] = {
-	{1, arcs_9_0},
-	{2, arcs_9_1},
-	{2, arcs_9_2},
+static arc arcs_9_3[1] = {
+	{15, 1},
 };
-static arc arcs_10_0[2] = {
-	{3, 1},
-	{4, 1},
+static state states_9[4] = {
+	{2, arcs_9_0},
+	{1, arcs_9_1},
+	{1, arcs_9_2},
+	{1, arcs_9_3},
 };
-static arc arcs_10_1[1] = {
+static arc arcs_10_0[1] = {
+	{26, 1},
+};
+static arc arcs_10_1[2] = {
+	{28, 2},
 	{0, 1},
 };
-static state states_10[2] = {
-	{2, arcs_10_0},
-	{1, arcs_10_1},
+static arc arcs_10_2[2] = {
+	{26, 1},
+	{0, 2},
+};
+static state states_10[3] = {
+	{1, arcs_10_0},
+	{2, arcs_10_1},
+	{2, arcs_10_2},
 };
-static arc arcs_11_0[1] = {
-	{31, 1},
+static arc arcs_11_0[3] = {
+	{34, 1},
+	{29, 2},
+	{31, 3},
 };
-static arc arcs_11_1[2] = {
-	{32, 2},
-	{2, 3},
+static arc arcs_11_1[3] = {
+	{27, 4},
+	{28, 5},
+	{0, 1},
 };
-static arc arcs_11_2[2] = {
-	{31, 1},
-	{2, 3},
+static arc arcs_11_2[3] = {
+	{35, 6},
+	{28, 7},
+	{0, 2},
 };
 static arc arcs_11_3[1] = {
-	{0, 3},
+	{35, 8},
 };
-static state states_11[4] = {
-	{1, arcs_11_0},
-	{2, arcs_11_1},
-	{2, arcs_11_2},
-	{1, arcs_11_3},
+static arc arcs_11_4[1] = {
+	{22, 9},
 };
-static arc arcs_12_0[8] = {
-	{33, 1},
+static arc arcs_11_5[4] = {
 	{34, 1},
-	{35, 1},
-	{36, 1},
-	{37, 1},
-	{38, 1},
-	{39, 1},
-	{40, 1},
-};
-static arc arcs_12_1[1] = {
-	{0, 1},
-};
-static state states_12[2] = {
-	{8, arcs_12_0},
-	{1, arcs_12_1},
+	{29, 2},
+	{31, 3},
+	{0, 5},
 };
-static arc arcs_13_0[1] = {
-	{9, 1},
+static arc arcs_11_6[2] = {
+	{28, 7},
+	{0, 6},
 };
-static arc arcs_13_1[3] = {
-	{41, 2},
-	{25, 3},
-	{0, 1},
+static arc arcs_11_7[2] = {
+	{35, 10},
+	{31, 3},
 };
-static arc arcs_13_2[2] = {
-	{42, 4},
-	{9, 4},
+static arc arcs_11_8[1] = {
+	{0, 8},
 };
-static arc arcs_13_3[2] = {
-	{42, 5},
-	{9, 5},
+static arc arcs_11_9[2] = {
+	{28, 5},
+	{0, 9},
 };
-static arc arcs_13_4[1] = {
-	{0, 4},
+static arc arcs_11_10[3] = {
+	{28, 7},
+	{27, 11},
+	{0, 10},
 };
-static arc arcs_13_5[2] = {
-	{25, 3},
-	{0, 5},
+static arc arcs_11_11[1] = {
+	{22, 6},
 };
-static state states_13[6] = {
-	{1, arcs_13_0},
-	{3, arcs_13_1},
-	{2, arcs_13_2},
-	{2, arcs_13_3},
-	{1, arcs_13_4},
-	{2, arcs_13_5},
+static state states_11[12] = {
+	{3, arcs_11_0},
+	{3, arcs_11_1},
+	{3, arcs_11_2},
+	{1, arcs_11_3},
+	{1, arcs_11_4},
+	{4, arcs_11_5},
+	{2, arcs_11_6},
+	{2, arcs_11_7},
+	{1, arcs_11_8},
+	{2, arcs_11_9},
+	{3, arcs_11_10},
+	{1, arcs_11_11},
 };
-static arc arcs_14_0[12] = {
-	{43, 1},
-	{44, 1},
-	{45, 1},
-	{46, 1},
-	{47, 1},
-	{48, 1},
-	{49, 1},
-	{50, 1},
-	{51, 1},
-	{52, 1},
-	{53, 1},
-	{54, 1},
+static arc arcs_12_0[1] = {
+	{19, 1},
 };
-static arc arcs_14_1[1] = {
+static arc arcs_12_1[1] = {
 	{0, 1},
 };
-static state states_14[2] = {
-	{12, arcs_14_0},
-	{1, arcs_14_1},
+static state states_12[2] = {
+	{1, arcs_12_0},
+	{1, arcs_12_1},
 };
-static arc arcs_15_0[1] = {
-	{55, 1},
+static arc arcs_13_0[2] = {
+	{35, 1},
+	{13, 2},
 };
-static arc arcs_15_1[3] = {
-	{26, 2},
-	{56, 3},
+static arc arcs_13_1[1] = {
 	{0, 1},
 };
-static arc arcs_15_2[2] = {
-	{27, 4},
-	{0, 2},
+static arc arcs_13_2[1] = {
+	{36, 3},
 };
-static arc arcs_15_3[1] = {
-	{26, 5},
+static arc arcs_13_3[1] = {
+	{15, 1},
 };
-static arc arcs_15_4[2] = {
-	{26, 2},
-	{0, 4},
+static state states_13[4] = {
+	{2, arcs_13_0},
+	{1, arcs_13_1},
+	{1, arcs_13_2},
+	{1, arcs_13_3},
 };
-static arc arcs_15_5[2] = {
-	{27, 6},
-	{0, 5},
+static arc arcs_14_0[1] = {
+	{34, 1},
+};
+static arc arcs_14_1[2] = {
+	{28, 2},
+	{0, 1},
 };
-static arc arcs_15_6[1] = {
-	{26, 7},
+static arc arcs_14_2[2] = {
+	{34, 1},
+	{0, 2},
 };
-static arc arcs_15_7[2] = {
-	{27, 8},
-	{0, 7},
+static state states_14[3] = {
+	{1, arcs_14_0},
+	{2, arcs_14_1},
+	{2, arcs_14_2},
 };
-static arc arcs_15_8[2] = {
-	{26, 7},
-	{0, 8},
+static arc arcs_15_0[2] = {
+	{3, 1},
+	{4, 1},
+};
+static arc arcs_15_1[1] = {
+	{0, 1},
 };
-static state states_15[9] = {
-	{1, arcs_15_0},
-	{3, arcs_15_1},
-	{2, arcs_15_2},
-	{1, arcs_15_3},
-	{2, arcs_15_4},
-	{2, arcs_15_5},
-	{1, arcs_15_6},
-	{2, arcs_15_7},
-	{2, arcs_15_8},
+static state states_15[2] = {
+	{2, arcs_15_0},
+	{1, arcs_15_1},
 };
 static arc arcs_16_0[1] = {
-	{57, 1},
+	{37, 1},
+};
+static arc arcs_16_1[2] = {
+	{38, 2},
+	{2, 3},
 };
-static arc arcs_16_1[1] = {
-	{58, 2},
+static arc arcs_16_2[2] = {
+	{37, 1},
+	{2, 3},
 };
-static arc arcs_16_2[1] = {
-	{0, 2},
+static arc arcs_16_3[1] = {
+	{0, 3},
 };
-static state states_16[3] = {
+static state states_16[4] = {
 	{1, arcs_16_0},
-	{1, arcs_16_1},
-	{1, arcs_16_2},
+	{2, arcs_16_1},
+	{2, arcs_16_2},
+	{1, arcs_16_3},
 };
-static arc arcs_17_0[1] = {
-	{59, 1},
+static arc arcs_17_0[8] = {
+	{39, 1},
+	{40, 1},
+	{41, 1},
+	{42, 1},
+	{43, 1},
+	{44, 1},
+	{45, 1},
+	{46, 1},
 };
 static arc arcs_17_1[1] = {
 	{0, 1},
 };
 static state states_17[2] = {
-	{1, arcs_17_0},
+	{8, arcs_17_0},
 	{1, arcs_17_1},
 };
-static arc arcs_18_0[5] = {
-	{60, 1},
-	{61, 1},
-	{62, 1},
-	{63, 1},
-	{64, 1},
+static arc arcs_18_0[1] = {
+	{9, 1},
 };
-static arc arcs_18_1[1] = {
+static arc arcs_18_1[3] = {
+	{47, 2},
+	{27, 3},
 	{0, 1},
 };
-static state states_18[2] = {
-	{5, arcs_18_0},
-	{1, arcs_18_1},
+static arc arcs_18_2[2] = {
+	{48, 4},
+	{9, 4},
 };
-static arc arcs_19_0[1] = {
-	{65, 1},
+static arc arcs_18_3[2] = {
+	{48, 5},
+	{9, 5},
+};
+static arc arcs_18_4[1] = {
+	{0, 4},
+};
+static arc arcs_18_5[2] = {
+	{27, 3},
+	{0, 5},
+};
+static state states_18[6] = {
+	{1, arcs_18_0},
+	{3, arcs_18_1},
+	{2, arcs_18_2},
+	{2, arcs_18_3},
+	{1, arcs_18_4},
+	{2, arcs_18_5},
+};
+static arc arcs_19_0[12] = {
+	{49, 1},
+	{50, 1},
+	{51, 1},
+	{52, 1},
+	{53, 1},
+	{54, 1},
+	{55, 1},
+	{56, 1},
+	{57, 1},
+	{58, 1},
+	{59, 1},
+	{60, 1},
 };
 static arc arcs_19_1[1] = {
 	{0, 1},
 };
 static state states_19[2] = {
-	{1, arcs_19_0},
+	{12, arcs_19_0},
 	{1, arcs_19_1},
 };
 static arc arcs_20_0[1] = {
-	{66, 1},
+	{61, 1},
 };
-static arc arcs_20_1[1] = {
+static arc arcs_20_1[3] = {
+	{22, 2},
+	{62, 3},
 	{0, 1},
 };
-static state states_20[2] = {
+static arc arcs_20_2[2] = {
+	{28, 4},
+	{0, 2},
+};
+static arc arcs_20_3[1] = {
+	{22, 5},
+};
+static arc arcs_20_4[2] = {
+	{22, 2},
+	{0, 4},
+};
+static arc arcs_20_5[2] = {
+	{28, 6},
+	{0, 5},
+};
+static arc arcs_20_6[1] = {
+	{22, 7},
+};
+static arc arcs_20_7[2] = {
+	{28, 8},
+	{0, 7},
+};
+static arc arcs_20_8[2] = {
+	{22, 7},
+	{0, 8},
+};
+static state states_20[9] = {
 	{1, arcs_20_0},
-	{1, arcs_20_1},
+	{3, arcs_20_1},
+	{2, arcs_20_2},
+	{1, arcs_20_3},
+	{2, arcs_20_4},
+	{2, arcs_20_5},
+	{1, arcs_20_6},
+	{2, arcs_20_7},
+	{2, arcs_20_8},
 };
 static arc arcs_21_0[1] = {
-	{67, 1},
+	{63, 1},
 };
-static arc arcs_21_1[2] = {
-	{9, 2},
-	{0, 1},
+static arc arcs_21_1[1] = {
+	{64, 2},
 };
 static arc arcs_21_2[1] = {
 	{0, 2},
 };
 static state states_21[3] = {
 	{1, arcs_21_0},
-	{2, arcs_21_1},
+	{1, arcs_21_1},
 	{1, arcs_21_2},
 };
 static arc arcs_22_0[1] = {
-	{42, 1},
+	{65, 1},
 };
 static arc arcs_22_1[1] = {
 	{0, 1},
@@ -463,662 +541,646 @@
 	{1, arcs_22_0},
 	{1, arcs_22_1},
 };
-static arc arcs_23_0[1] = {
+static arc arcs_23_0[5] = {
+	{66, 1},
+	{67, 1},
 	{68, 1},
+	{69, 1},
+	{70, 1},
 };
-static arc arcs_23_1[2] = {
-	{26, 2},
+static arc arcs_23_1[1] = {
 	{0, 1},
 };
-static arc arcs_23_2[2] = {
-	{27, 3},
-	{0, 2},
-};
-static arc arcs_23_3[1] = {
-	{26, 4},
+static state states_23[2] = {
+	{5, arcs_23_0},
+	{1, arcs_23_1},
 };
-static arc arcs_23_4[2] = {
-	{27, 5},
-	{0, 4},
-};
-static arc arcs_23_5[1] = {
-	{26, 6},
-};
-static arc arcs_23_6[1] = {
-	{0, 6},
-};
-static state states_23[7] = {
-	{1, arcs_23_0},
-	{2, arcs_23_1},
-	{2, arcs_23_2},
-	{1, arcs_23_3},
-	{2, arcs_23_4},
-	{1, arcs_23_5},
-	{1, arcs_23_6},
-};
-static arc arcs_24_0[2] = {
-	{69, 1},
-	{70, 1},
+static arc arcs_24_0[1] = {
+	{71, 1},
 };
 static arc arcs_24_1[1] = {
 	{0, 1},
 };
 static state states_24[2] = {
-	{2, arcs_24_0},
+	{1, arcs_24_0},
 	{1, arcs_24_1},
 };
 static arc arcs_25_0[1] = {
-	{71, 1},
+	{72, 1},
 };
 static arc arcs_25_1[1] = {
-	{72, 2},
-};
-static arc arcs_25_2[1] = {
-	{0, 2},
+	{0, 1},
 };
-static state states_25[3] = {
+static state states_25[2] = {
 	{1, arcs_25_0},
 	{1, arcs_25_1},
-	{1, arcs_25_2},
 };
 static arc arcs_26_0[1] = {
 	{73, 1},
 };
 static arc arcs_26_1[2] = {
-	{74, 2},
-	{12, 3},
-};
-static arc arcs_26_2[3] = {
-	{74, 2},
-	{12, 3},
-	{71, 4},
-};
-static arc arcs_26_3[1] = {
-	{71, 4},
-};
-static arc arcs_26_4[3] = {
-	{28, 5},
-	{13, 6},
-	{75, 5},
-};
-static arc arcs_26_5[1] = {
-	{0, 5},
-};
-static arc arcs_26_6[1] = {
-	{75, 7},
+	{9, 2},
+	{0, 1},
 };
-static arc arcs_26_7[1] = {
-	{15, 5},
+static arc arcs_26_2[1] = {
+	{0, 2},
 };
-static state states_26[8] = {
+static state states_26[3] = {
 	{1, arcs_26_0},
 	{2, arcs_26_1},
-	{3, arcs_26_2},
-	{1, arcs_26_3},
-	{3, arcs_26_4},
-	{1, arcs_26_5},
-	{1, arcs_26_6},
-	{1, arcs_26_7},
+	{1, arcs_26_2},
 };
 static arc arcs_27_0[1] = {
-	{19, 1},
+	{48, 1},
 };
-static arc arcs_27_1[2] = {
-	{77, 2},
+static arc arcs_27_1[1] = {
 	{0, 1},
 };
-static arc arcs_27_2[1] = {
-	{19, 3},
-};
-static arc arcs_27_3[1] = {
-	{0, 3},
-};
-static state states_27[4] = {
+static state states_27[2] = {
 	{1, arcs_27_0},
-	{2, arcs_27_1},
-	{1, arcs_27_2},
-	{1, arcs_27_3},
+	{1, arcs_27_1},
 };
 static arc arcs_28_0[1] = {
-	{12, 1},
+	{74, 1},
 };
 static arc arcs_28_1[2] = {
-	{77, 2},
+	{22, 2},
 	{0, 1},
 };
-static arc arcs_28_2[1] = {
-	{19, 3},
+static arc arcs_28_2[2] = {
+	{28, 3},
+	{0, 2},
 };
 static arc arcs_28_3[1] = {
-	{0, 3},
+	{22, 4},
+};
+static arc arcs_28_4[2] = {
+	{28, 5},
+	{0, 4},
+};
+static arc arcs_28_5[1] = {
+	{22, 6},
+};
+static arc arcs_28_6[1] = {
+	{0, 6},
 };
-static state states_28[4] = {
+static state states_28[7] = {
 	{1, arcs_28_0},
 	{2, arcs_28_1},
-	{1, arcs_28_2},
+	{2, arcs_28_2},
 	{1, arcs_28_3},
+	{2, arcs_28_4},
+	{1, arcs_28_5},
+	{1, arcs_28_6},
 };
-static arc arcs_29_0[1] = {
+static arc arcs_29_0[2] = {
+	{75, 1},
 	{76, 1},
 };
-static arc arcs_29_1[2] = {
-	{27, 2},
+static arc arcs_29_1[1] = {
 	{0, 1},
 };
-static arc arcs_29_2[2] = {
-	{76, 1},
-	{0, 2},
-};
-static state states_29[3] = {
-	{1, arcs_29_0},
-	{2, arcs_29_1},
-	{2, arcs_29_2},
+static state states_29[2] = {
+	{2, arcs_29_0},
+	{1, arcs_29_1},
 };
 static arc arcs_30_0[1] = {
-	{78, 1},
+	{77, 1},
 };
-static arc arcs_30_1[2] = {
-	{27, 0},
-	{0, 1},
+static arc arcs_30_1[1] = {
+	{78, 2},
+};
+static arc arcs_30_2[1] = {
+	{0, 2},
 };
-static state states_30[2] = {
+static state states_30[3] = {
 	{1, arcs_30_0},
-	{2, arcs_30_1},
+	{1, arcs_30_1},
+	{1, arcs_30_2},
 };
 static arc arcs_31_0[1] = {
-	{19, 1},
+	{79, 1},
 };
 static arc arcs_31_1[2] = {
-	{74, 0},
-	{0, 1},
+	{80, 2},
+	{12, 3},
+};
+static arc arcs_31_2[3] = {
+	{80, 2},
+	{12, 3},
+	{77, 4},
+};
+static arc arcs_31_3[1] = {
+	{77, 4},
+};
+static arc arcs_31_4[3] = {
+	{29, 5},
+	{13, 6},
+	{81, 5},
+};
+static arc arcs_31_5[1] = {
+	{0, 5},
 };
-static state states_31[2] = {
+static arc arcs_31_6[1] = {
+	{81, 7},
+};
+static arc arcs_31_7[1] = {
+	{15, 5},
+};
+static state states_31[8] = {
 	{1, arcs_31_0},
 	{2, arcs_31_1},
+	{3, arcs_31_2},
+	{1, arcs_31_3},
+	{3, arcs_31_4},
+	{1, arcs_31_5},
+	{1, arcs_31_6},
+	{1, arcs_31_7},
 };
 static arc arcs_32_0[1] = {
-	{79, 1},
+	{19, 1},
 };
-static arc arcs_32_1[1] = {
-	{19, 2},
+static arc arcs_32_1[2] = {
+	{83, 2},
+	{0, 1},
 };
-static arc arcs_32_2[2] = {
-	{27, 1},
-	{0, 2},
+static arc arcs_32_2[1] = {
+	{19, 3},
+};
+static arc arcs_32_3[1] = {
+	{0, 3},
 };
-static state states_32[3] = {
+static state states_32[4] = {
 	{1, arcs_32_0},
-	{1, arcs_32_1},
-	{2, arcs_32_2},
+	{2, arcs_32_1},
+	{1, arcs_32_2},
+	{1, arcs_32_3},
 };
 static arc arcs_33_0[1] = {
-	{80, 1},
+	{12, 1},
 };
-static arc arcs_33_1[1] = {
-	{26, 2},
+static arc arcs_33_1[2] = {
+	{83, 2},
+	{0, 1},
 };
-static arc arcs_33_2[2] = {
-	{27, 3},
-	{0, 2},
+static arc arcs_33_2[1] = {
+	{19, 3},
 };
 static arc arcs_33_3[1] = {
-	{26, 4},
-};
-static arc arcs_33_4[1] = {
-	{0, 4},
+	{0, 3},
 };
-static state states_33[5] = {
+static state states_33[4] = {
 	{1, arcs_33_0},
-	{1, arcs_33_1},
-	{2, arcs_33_2},
+	{2, arcs_33_1},
+	{1, arcs_33_2},
 	{1, arcs_33_3},
-	{1, arcs_33_4},
 };
-static arc arcs_34_0[7] = {
-	{81, 1},
+static arc arcs_34_0[1] = {
 	{82, 1},
-	{83, 1},
-	{84, 1},
-	{85, 1},
-	{17, 1},
-	{86, 1},
 };
-static arc arcs_34_1[1] = {
+static arc arcs_34_1[2] = {
+	{28, 2},
 	{0, 1},
 };
-static state states_34[2] = {
-	{7, arcs_34_0},
-	{1, arcs_34_1},
-};
-static arc arcs_35_0[1] = {
-	{87, 1},
-};
-static arc arcs_35_1[1] = {
-	{26, 2},
-};
-static arc arcs_35_2[1] = {
-	{21, 3},
-};
-static arc arcs_35_3[1] = {
-	{22, 4},
-};
-static arc arcs_35_4[3] = {
-	{88, 1},
-	{89, 5},
-	{0, 4},
+static arc arcs_34_2[2] = {
+	{82, 1},
+	{0, 2},
 };
-static arc arcs_35_5[1] = {
-	{21, 6},
+static state states_34[3] = {
+	{1, arcs_34_0},
+	{2, arcs_34_1},
+	{2, arcs_34_2},
 };
-static arc arcs_35_6[1] = {
-	{22, 7},
+static arc arcs_35_0[1] = {
+	{84, 1},
 };
-static arc arcs_35_7[1] = {
-	{0, 7},
+static arc arcs_35_1[2] = {
+	{28, 0},
+	{0, 1},
 };
-static state states_35[8] = {
+static state states_35[2] = {
 	{1, arcs_35_0},
-	{1, arcs_35_1},
-	{1, arcs_35_2},
-	{1, arcs_35_3},
-	{3, arcs_35_4},
-	{1, arcs_35_5},
-	{1, arcs_35_6},
-	{1, arcs_35_7},
+	{2, arcs_35_1},
 };
 static arc arcs_36_0[1] = {
-	{90, 1},
-};
-static arc arcs_36_1[1] = {
-	{26, 2},
-};
-static arc arcs_36_2[1] = {
-	{21, 3},
-};
-static arc arcs_36_3[1] = {
-	{22, 4},
-};
-static arc arcs_36_4[2] = {
-	{89, 5},
-	{0, 4},
-};
-static arc arcs_36_5[1] = {
-	{21, 6},
-};
-static arc arcs_36_6[1] = {
-	{22, 7},
+	{19, 1},
 };
-static arc arcs_36_7[1] = {
-	{0, 7},
+static arc arcs_36_1[2] = {
+	{80, 0},
+	{0, 1},
 };
-static state states_36[8] = {
+static state states_36[2] = {
 	{1, arcs_36_0},
-	{1, arcs_36_1},
-	{1, arcs_36_2},
-	{1, arcs_36_3},
-	{2, arcs_36_4},
-	{1, arcs_36_5},
-	{1, arcs_36_6},
-	{1, arcs_36_7},
+	{2, arcs_36_1},
 };
 static arc arcs_37_0[1] = {
-	{91, 1},
+	{85, 1},
 };
 static arc arcs_37_1[1] = {
-	{58, 2},
-};
-static arc arcs_37_2[1] = {
-	{92, 3},
-};
-static arc arcs_37_3[1] = {
-	{9, 4},
-};
-static arc arcs_37_4[1] = {
-	{21, 5},
-};
-static arc arcs_37_5[1] = {
-	{22, 6},
-};
-static arc arcs_37_6[2] = {
-	{89, 7},
-	{0, 6},
-};
-static arc arcs_37_7[1] = {
-	{21, 8},
-};
-static arc arcs_37_8[1] = {
-	{22, 9},
+	{19, 2},
 };
-static arc arcs_37_9[1] = {
-	{0, 9},
+static arc arcs_37_2[2] = {
+	{28, 1},
+	{0, 2},
 };
-static state states_37[10] = {
+static state states_37[3] = {
 	{1, arcs_37_0},
 	{1, arcs_37_1},
-	{1, arcs_37_2},
-	{1, arcs_37_3},
-	{1, arcs_37_4},
-	{1, arcs_37_5},
-	{2, arcs_37_6},
-	{1, arcs_37_7},
-	{1, arcs_37_8},
-	{1, arcs_37_9},
+	{2, arcs_37_2},
 };
 static arc arcs_38_0[1] = {
-	{93, 1},
+	{86, 1},
 };
 static arc arcs_38_1[1] = {
-	{21, 2},
+	{22, 2},
 };
-static arc arcs_38_2[1] = {
-	{22, 3},
+static arc arcs_38_2[2] = {
+	{28, 3},
+	{0, 2},
 };
-static arc arcs_38_3[2] = {
-	{94, 4},
-	{95, 5},
+static arc arcs_38_3[1] = {
+	{22, 4},
 };
 static arc arcs_38_4[1] = {
-	{21, 6},
-};
-static arc arcs_38_5[1] = {
-	{21, 7},
-};
-static arc arcs_38_6[1] = {
-	{22, 8},
-};
-static arc arcs_38_7[1] = {
-	{22, 9},
-};
-static arc arcs_38_8[4] = {
-	{94, 4},
-	{89, 10},
-	{95, 5},
-	{0, 8},
-};
-static arc arcs_38_9[1] = {
-	{0, 9},
-};
-static arc arcs_38_10[1] = {
-	{21, 11},
-};
-static arc arcs_38_11[1] = {
-	{22, 12},
-};
-static arc arcs_38_12[2] = {
-	{95, 5},
-	{0, 12},
+	{0, 4},
 };
-static state states_38[13] = {
+static state states_38[5] = {
 	{1, arcs_38_0},
 	{1, arcs_38_1},
-	{1, arcs_38_2},
-	{2, arcs_38_3},
+	{2, arcs_38_2},
+	{1, arcs_38_3},
 	{1, arcs_38_4},
-	{1, arcs_38_5},
-	{1, arcs_38_6},
-	{1, arcs_38_7},
-	{4, arcs_38_8},
-	{1, arcs_38_9},
-	{1, arcs_38_10},
-	{1, arcs_38_11},
-	{2, arcs_38_12},
 };
-static arc arcs_39_0[1] = {
-	{96, 1},
+static arc arcs_39_0[7] = {
+	{87, 1},
+	{88, 1},
+	{89, 1},
+	{90, 1},
+	{91, 1},
+	{17, 1},
+	{92, 1},
 };
 static arc arcs_39_1[1] = {
-	{26, 2},
-};
-static arc arcs_39_2[2] = {
-	{97, 3},
-	{21, 4},
-};
-static arc arcs_39_3[1] = {
-	{21, 4},
-};
-static arc arcs_39_4[1] = {
-	{22, 5},
-};
-static arc arcs_39_5[1] = {
-	{0, 5},
+	{0, 1},
 };
-static state states_39[6] = {
-	{1, arcs_39_0},
+static state states_39[2] = {
+	{7, arcs_39_0},
 	{1, arcs_39_1},
-	{2, arcs_39_2},
-	{1, arcs_39_3},
-	{1, arcs_39_4},
-	{1, arcs_39_5},
 };
 static arc arcs_40_0[1] = {
-	{77, 1},
+	{93, 1},
 };
 static arc arcs_40_1[1] = {
-	{98, 2},
+	{22, 2},
 };
 static arc arcs_40_2[1] = {
-	{0, 2},
+	{23, 3},
+};
+static arc arcs_40_3[1] = {
+	{24, 4},
 };
-static state states_40[3] = {
+static arc arcs_40_4[3] = {
+	{94, 1},
+	{95, 5},
+	{0, 4},
+};
+static arc arcs_40_5[1] = {
+	{23, 6},
+};
+static arc arcs_40_6[1] = {
+	{24, 7},
+};
+static arc arcs_40_7[1] = {
+	{0, 7},
+};
+static state states_40[8] = {
 	{1, arcs_40_0},
 	{1, arcs_40_1},
 	{1, arcs_40_2},
+	{1, arcs_40_3},
+	{3, arcs_40_4},
+	{1, arcs_40_5},
+	{1, arcs_40_6},
+	{1, arcs_40_7},
 };
 static arc arcs_41_0[1] = {
-	{99, 1},
+	{96, 1},
 };
-static arc arcs_41_1[2] = {
-	{26, 2},
-	{0, 1},
+static arc arcs_41_1[1] = {
+	{22, 2},
 };
-static arc arcs_41_2[2] = {
-	{27, 3},
-	{0, 2},
+static arc arcs_41_2[1] = {
+	{23, 3},
 };
 static arc arcs_41_3[1] = {
-	{26, 4},
+	{24, 4},
 };
-static arc arcs_41_4[1] = {
+static arc arcs_41_4[2] = {
+	{95, 5},
 	{0, 4},
 };
-static state states_41[5] = {
+static arc arcs_41_5[1] = {
+	{23, 6},
+};
+static arc arcs_41_6[1] = {
+	{24, 7},
+};
+static arc arcs_41_7[1] = {
+	{0, 7},
+};
+static state states_41[8] = {
 	{1, arcs_41_0},
-	{2, arcs_41_1},
-	{2, arcs_41_2},
+	{1, arcs_41_1},
+	{1, arcs_41_2},
 	{1, arcs_41_3},
-	{1, arcs_41_4},
+	{2, arcs_41_4},
+	{1, arcs_41_5},
+	{1, arcs_41_6},
+	{1, arcs_41_7},
 };
-static arc arcs_42_0[2] = {
-	{3, 1},
-	{2, 2},
+static arc arcs_42_0[1] = {
+	{97, 1},
 };
 static arc arcs_42_1[1] = {
-	{0, 1},
+	{64, 2},
 };
 static arc arcs_42_2[1] = {
-	{100, 3},
+	{98, 3},
 };
 static arc arcs_42_3[1] = {
-	{6, 4},
+	{9, 4},
 };
-static arc arcs_42_4[2] = {
-	{6, 4},
-	{101, 1},
+static arc arcs_42_4[1] = {
+	{23, 5},
+};
+static arc arcs_42_5[1] = {
+	{24, 6},
+};
+static arc arcs_42_6[2] = {
+	{95, 7},
+	{0, 6},
+};
+static arc arcs_42_7[1] = {
+	{23, 8},
 };
-static state states_42[5] = {
-	{2, arcs_42_0},
+static arc arcs_42_8[1] = {
+	{24, 9},
+};
+static arc arcs_42_9[1] = {
+	{0, 9},
+};
+static state states_42[10] = {
+	{1, arcs_42_0},
 	{1, arcs_42_1},
 	{1, arcs_42_2},
 	{1, arcs_42_3},
-	{2, arcs_42_4},
+	{1, arcs_42_4},
+	{1, arcs_42_5},
+	{2, arcs_42_6},
+	{1, arcs_42_7},
+	{1, arcs_42_8},
+	{1, arcs_42_9},
 };
 static arc arcs_43_0[1] = {
-	{103, 1},
+	{99, 1},
 };
-static arc arcs_43_1[2] = {
-	{27, 2},
-	{0, 1},
+static arc arcs_43_1[1] = {
+	{23, 2},
 };
 static arc arcs_43_2[1] = {
-	{103, 3},
+	{24, 3},
 };
 static arc arcs_43_3[2] = {
-	{27, 4},
-	{0, 3},
+	{100, 4},
+	{101, 5},
 };
-static arc arcs_43_4[2] = {
-	{103, 3},
-	{0, 4},
+static arc arcs_43_4[1] = {
+	{23, 6},
+};
+static arc arcs_43_5[1] = {
+	{23, 7},
+};
+static arc arcs_43_6[1] = {
+	{24, 8},
+};
+static arc arcs_43_7[1] = {
+	{24, 9},
+};
+static arc arcs_43_8[4] = {
+	{100, 4},
+	{95, 10},
+	{101, 5},
+	{0, 8},
 };
-static state states_43[5] = {
+static arc arcs_43_9[1] = {
+	{0, 9},
+};
+static arc arcs_43_10[1] = {
+	{23, 11},
+};
+static arc arcs_43_11[1] = {
+	{24, 12},
+};
+static arc arcs_43_12[2] = {
+	{101, 5},
+	{0, 12},
+};
+static state states_43[13] = {
 	{1, arcs_43_0},
-	{2, arcs_43_1},
+	{1, arcs_43_1},
 	{1, arcs_43_2},
 	{2, arcs_43_3},
-	{2, arcs_43_4},
+	{1, arcs_43_4},
+	{1, arcs_43_5},
+	{1, arcs_43_6},
+	{1, arcs_43_7},
+	{4, arcs_43_8},
+	{1, arcs_43_9},
+	{1, arcs_43_10},
+	{1, arcs_43_11},
+	{2, arcs_43_12},
 };
-static arc arcs_44_0[2] = {
-	{104, 1},
-	{105, 1},
+static arc arcs_44_0[1] = {
+	{102, 1},
 };
 static arc arcs_44_1[1] = {
-	{0, 1},
+	{22, 2},
+};
+static arc arcs_44_2[2] = {
+	{103, 3},
+	{23, 4},
+};
+static arc arcs_44_3[1] = {
+	{23, 4},
+};
+static arc arcs_44_4[1] = {
+	{24, 5},
 };
-static state states_44[2] = {
-	{2, arcs_44_0},
+static arc arcs_44_5[1] = {
+	{0, 5},
+};
+static state states_44[6] = {
+	{1, arcs_44_0},
 	{1, arcs_44_1},
+	{2, arcs_44_2},
+	{1, arcs_44_3},
+	{1, arcs_44_4},
+	{1, arcs_44_5},
 };
 static arc arcs_45_0[1] = {
-	{106, 1},
+	{83, 1},
 };
-static arc arcs_45_1[2] = {
-	{23, 2},
-	{21, 3},
+static arc arcs_45_1[1] = {
+	{104, 2},
 };
 static arc arcs_45_2[1] = {
-	{21, 3},
-};
-static arc arcs_45_3[1] = {
-	{103, 4},
-};
-static arc arcs_45_4[1] = {
-	{0, 4},
+	{0, 2},
 };
-static state states_45[5] = {
+static state states_45[3] = {
 	{1, arcs_45_0},
-	{2, arcs_45_1},
+	{1, arcs_45_1},
 	{1, arcs_45_2},
-	{1, arcs_45_3},
-	{1, arcs_45_4},
 };
-static arc arcs_46_0[2] = {
-	{104, 1},
-	{107, 2},
+static arc arcs_46_0[1] = {
+	{105, 1},
 };
 static arc arcs_46_1[2] = {
-	{87, 3},
+	{22, 2},
 	{0, 1},
 };
-static arc arcs_46_2[1] = {
+static arc arcs_46_2[2] = {
+	{28, 3},
 	{0, 2},
 };
 static arc arcs_46_3[1] = {
-	{104, 4},
+	{22, 4},
 };
 static arc arcs_46_4[1] = {
-	{89, 5},
-};
-static arc arcs_46_5[1] = {
-	{26, 2},
+	{0, 4},
 };
-static state states_46[6] = {
-	{2, arcs_46_0},
+static state states_46[5] = {
+	{1, arcs_46_0},
 	{2, arcs_46_1},
-	{1, arcs_46_2},
+	{2, arcs_46_2},
 	{1, arcs_46_3},
 	{1, arcs_46_4},
-	{1, arcs_46_5},
 };
-static arc arcs_47_0[1] = {
-	{108, 1},
+static arc arcs_47_0[2] = {
+	{3, 1},
+	{2, 2},
 };
-static arc arcs_47_1[2] = {
-	{109, 0},
+static arc arcs_47_1[1] = {
 	{0, 1},
 };
-static state states_47[2] = {
-	{1, arcs_47_0},
-	{2, arcs_47_1},
+static arc arcs_47_2[1] = {
+	{106, 3},
+};
+static arc arcs_47_3[1] = {
+	{6, 4},
+};
+static arc arcs_47_4[2] = {
+	{6, 4},
+	{107, 1},
+};
+static state states_47[5] = {
+	{2, arcs_47_0},
+	{1, arcs_47_1},
+	{1, arcs_47_2},
+	{1, arcs_47_3},
+	{2, arcs_47_4},
 };
 static arc arcs_48_0[1] = {
-	{110, 1},
+	{109, 1},
 };
 static arc arcs_48_1[2] = {
-	{111, 0},
+	{28, 2},
 	{0, 1},
 };
-static state states_48[2] = {
+static arc arcs_48_2[1] = {
+	{109, 3},
+};
+static arc arcs_48_3[2] = {
+	{28, 4},
+	{0, 3},
+};
+static arc arcs_48_4[2] = {
+	{109, 3},
+	{0, 4},
+};
+static state states_48[5] = {
 	{1, arcs_48_0},
 	{2, arcs_48_1},
+	{1, arcs_48_2},
+	{2, arcs_48_3},
+	{2, arcs_48_4},
 };
 static arc arcs_49_0[2] = {
-	{112, 1},
-	{113, 2},
+	{110, 1},
+	{111, 1},
 };
 static arc arcs_49_1[1] = {
-	{110, 2},
-};
-static arc arcs_49_2[1] = {
-	{0, 2},
+	{0, 1},
 };
-static state states_49[3] = {
+static state states_49[2] = {
 	{2, arcs_49_0},
 	{1, arcs_49_1},
-	{1, arcs_49_2},
 };
 static arc arcs_50_0[1] = {
-	{98, 1},
+	{112, 1},
 };
 static arc arcs_50_1[2] = {
-	{114, 0},
-	{0, 1},
+	{33, 2},
+	{23, 3},
+};
+static arc arcs_50_2[1] = {
+	{23, 3},
+};
+static arc arcs_50_3[1] = {
+	{109, 4},
+};
+static arc arcs_50_4[1] = {
+	{0, 4},
 };
-static state states_50[2] = {
+static state states_50[5] = {
 	{1, arcs_50_0},
 	{2, arcs_50_1},
+	{1, arcs_50_2},
+	{1, arcs_50_3},
+	{1, arcs_50_4},
 };
-static arc arcs_51_0[9] = {
-	{115, 1},
-	{116, 1},
-	{117, 1},
-	{118, 1},
-	{119, 1},
-	{120, 1},
-	{92, 1},
-	{112, 2},
-	{121, 3},
+static arc arcs_51_0[2] = {
+	{110, 1},
+	{113, 2},
 };
-static arc arcs_51_1[1] = {
+static arc arcs_51_1[2] = {
+	{93, 3},
 	{0, 1},
 };
 static arc arcs_51_2[1] = {
-	{92, 1},
+	{0, 2},
 };
-static arc arcs_51_3[2] = {
-	{112, 1},
-	{0, 3},
+static arc arcs_51_3[1] = {
+	{110, 4},
+};
+static arc arcs_51_4[1] = {
+	{95, 5},
 };
-static state states_51[4] = {
-	{9, arcs_51_0},
-	{1, arcs_51_1},
+static arc arcs_51_5[1] = {
+	{22, 2},
+};
+static state states_51[6] = {
+	{2, arcs_51_0},
+	{2, arcs_51_1},
 	{1, arcs_51_2},
-	{2, arcs_51_3},
+	{1, arcs_51_3},
+	{1, arcs_51_4},
+	{1, arcs_51_5},
 };
 static arc arcs_52_0[1] = {
-	{122, 1},
+	{114, 1},
 };
 static arc arcs_52_1[2] = {
-	{123, 0},
+	{115, 0},
 	{0, 1},
 };
 static state states_52[2] = {
@@ -1126,856 +1188,947 @@
 	{2, arcs_52_1},
 };
 static arc arcs_53_0[1] = {
-	{124, 1},
+	{116, 1},
 };
 static arc arcs_53_1[2] = {
-	{125, 0},
+	{117, 0},
 	{0, 1},
 };
 static state states_53[2] = {
 	{1, arcs_53_0},
 	{2, arcs_53_1},
 };
-static arc arcs_54_0[1] = {
-	{126, 1},
+static arc arcs_54_0[2] = {
+	{118, 1},
+	{119, 2},
 };
-static arc arcs_54_1[2] = {
-	{127, 0},
-	{0, 1},
+static arc arcs_54_1[1] = {
+	{116, 2},
 };
-static state states_54[2] = {
-	{1, arcs_54_0},
-	{2, arcs_54_1},
+static arc arcs_54_2[1] = {
+	{0, 2},
+};
+static state states_54[3] = {
+	{2, arcs_54_0},
+	{1, arcs_54_1},
+	{1, arcs_54_2},
 };
 static arc arcs_55_0[1] = {
-	{128, 1},
+	{104, 1},
 };
-static arc arcs_55_1[3] = {
-	{129, 0},
-	{56, 0},
+static arc arcs_55_1[2] = {
+	{120, 0},
 	{0, 1},
 };
 static state states_55[2] = {
 	{1, arcs_55_0},
-	{3, arcs_55_1},
+	{2, arcs_55_1},
 };
-static arc arcs_56_0[1] = {
-	{130, 1},
+static arc arcs_56_0[9] = {
+	{121, 1},
+	{122, 1},
+	{123, 1},
+	{124, 1},
+	{125, 1},
+	{126, 1},
+	{98, 1},
+	{118, 2},
+	{127, 3},
 };
-static arc arcs_56_1[3] = {
-	{131, 0},
-	{132, 0},
+static arc arcs_56_1[1] = {
 	{0, 1},
 };
-static state states_56[2] = {
-	{1, arcs_56_0},
-	{3, arcs_56_1},
+static arc arcs_56_2[1] = {
+	{98, 1},
+};
+static arc arcs_56_3[2] = {
+	{118, 1},
+	{0, 3},
+};
+static state states_56[4] = {
+	{9, arcs_56_0},
+	{1, arcs_56_1},
+	{1, arcs_56_2},
+	{2, arcs_56_3},
 };
 static arc arcs_57_0[1] = {
-	{133, 1},
+	{128, 1},
 };
-static arc arcs_57_1[5] = {
-	{28, 0},
-	{134, 0},
-	{135, 0},
-	{136, 0},
+static arc arcs_57_1[2] = {
+	{129, 0},
 	{0, 1},
 };
 static state states_57[2] = {
 	{1, arcs_57_0},
-	{5, arcs_57_1},
+	{2, arcs_57_1},
+};
+static arc arcs_58_0[1] = {
+	{130, 1},
+};
+static arc arcs_58_1[2] = {
+	{131, 0},
+	{0, 1},
+};
+static state states_58[2] = {
+	{1, arcs_58_0},
+	{2, arcs_58_1},
 };
-static arc arcs_58_0[4] = {
-	{131, 1},
+static arc arcs_59_0[1] = {
 	{132, 1},
+};
+static arc arcs_59_1[2] = {
+	{133, 0},
+	{0, 1},
+};
+static state states_59[2] = {
+	{1, arcs_59_0},
+	{2, arcs_59_1},
+};
+static arc arcs_60_0[1] = {
+	{134, 1},
+};
+static arc arcs_60_1[3] = {
+	{135, 0},
+	{62, 0},
+	{0, 1},
+};
+static state states_60[2] = {
+	{1, arcs_60_0},
+	{3, arcs_60_1},
+};
+static arc arcs_61_0[1] = {
+	{136, 1},
+};
+static arc arcs_61_1[3] = {
+	{137, 0},
+	{138, 0},
+	{0, 1},
+};
+static state states_61[2] = {
+	{1, arcs_61_0},
+	{3, arcs_61_1},
+};
+static arc arcs_62_0[1] = {
+	{139, 1},
+};
+static arc arcs_62_1[5] = {
+	{29, 0},
+	{140, 0},
+	{141, 0},
+	{142, 0},
+	{0, 1},
+};
+static state states_62[2] = {
+	{1, arcs_62_0},
+	{5, arcs_62_1},
+};
+static arc arcs_63_0[4] = {
 	{137, 1},
-	{138, 2},
+	{138, 1},
+	{143, 1},
+	{144, 2},
 };
-static arc arcs_58_1[1] = {
-	{133, 2},
+static arc arcs_63_1[1] = {
+	{139, 2},
 };
-static arc arcs_58_2[1] = {
+static arc arcs_63_2[1] = {
 	{0, 2},
 };
-static state states_58[3] = {
-	{4, arcs_58_0},
-	{1, arcs_58_1},
-	{1, arcs_58_2},
+static state states_63[3] = {
+	{4, arcs_63_0},
+	{1, arcs_63_1},
+	{1, arcs_63_2},
 };
-static arc arcs_59_0[1] = {
-	{139, 1},
+static arc arcs_64_0[1] = {
+	{145, 1},
 };
-static arc arcs_59_1[3] = {
-	{140, 1},
-	{29, 2},
+static arc arcs_64_1[3] = {
+	{146, 1},
+	{31, 2},
 	{0, 1},
 };
-static arc arcs_59_2[1] = {
-	{133, 3},
+static arc arcs_64_2[1] = {
+	{139, 3},
 };
-static arc arcs_59_3[1] = {
+static arc arcs_64_3[1] = {
 	{0, 3},
 };
-static state states_59[4] = {
-	{1, arcs_59_0},
-	{3, arcs_59_1},
-	{1, arcs_59_2},
-	{1, arcs_59_3},
+static state states_64[4] = {
+	{1, arcs_64_0},
+	{3, arcs_64_1},
+	{1, arcs_64_2},
+	{1, arcs_64_3},
 };
-static arc arcs_60_0[7] = {
+static arc arcs_65_0[7] = {
 	{13, 1},
-	{142, 2},
-	{145, 3},
+	{148, 2},
+	{151, 3},
 	{19, 4},
-	{148, 4},
-	{149, 5},
-	{74, 6},
+	{154, 4},
+	{155, 5},
+	{80, 6},
 };
-static arc arcs_60_1[3] = {
-	{42, 7},
-	{141, 7},
+static arc arcs_65_1[3] = {
+	{48, 7},
+	{147, 7},
 	{15, 4},
 };
-static arc arcs_60_2[2] = {
-	{143, 8},
-	{144, 4},
-};
-static arc arcs_60_3[2] = {
-	{146, 9},
-	{147, 4},
+static arc arcs_65_2[2] = {
+	{149, 8},
+	{150, 4},
+};
+static arc arcs_65_3[2] = {
+	{152, 9},
+	{153, 4},
 };
-static arc arcs_60_4[1] = {
+static arc arcs_65_4[1] = {
 	{0, 4},
 };
-static arc arcs_60_5[2] = {
-	{149, 5},
+static arc arcs_65_5[2] = {
+	{155, 5},
 	{0, 5},
 };
-static arc arcs_60_6[1] = {
-	{74, 10},
+static arc arcs_65_6[1] = {
+	{80, 10},
 };
-static arc arcs_60_7[1] = {
+static arc arcs_65_7[1] = {
 	{15, 4},
 };
-static arc arcs_60_8[1] = {
-	{144, 4},
+static arc arcs_65_8[1] = {
+	{150, 4},
 };
-static arc arcs_60_9[1] = {
-	{147, 4},
+static arc arcs_65_9[1] = {
+	{153, 4},
 };
-static arc arcs_60_10[1] = {
-	{74, 4},
+static arc arcs_65_10[1] = {
+	{80, 4},
 };
-static state states_60[11] = {
-	{7, arcs_60_0},
-	{3, arcs_60_1},
-	{2, arcs_60_2},
-	{2, arcs_60_3},
-	{1, arcs_60_4},
-	{2, arcs_60_5},
-	{1, arcs_60_6},
-	{1, arcs_60_7},
-	{1, arcs_60_8},
-	{1, arcs_60_9},
-	{1, arcs_60_10},
-};
-static arc arcs_61_0[1] = {
-	{26, 1},
-};
-static arc arcs_61_1[3] = {
-	{150, 2},
-	{27, 3},
+static state states_65[11] = {
+	{7, arcs_65_0},
+	{3, arcs_65_1},
+	{2, arcs_65_2},
+	{2, arcs_65_3},
+	{1, arcs_65_4},
+	{2, arcs_65_5},
+	{1, arcs_65_6},
+	{1, arcs_65_7},
+	{1, arcs_65_8},
+	{1, arcs_65_9},
+	{1, arcs_65_10},
+};
+static arc arcs_66_0[1] = {
+	{22, 1},
+};
+static arc arcs_66_1[3] = {
+	{156, 2},
+	{28, 3},
 	{0, 1},
 };
-static arc arcs_61_2[1] = {
+static arc arcs_66_2[1] = {
 	{0, 2},
 };
-static arc arcs_61_3[2] = {
-	{26, 4},
+static arc arcs_66_3[2] = {
+	{22, 4},
 	{0, 3},
 };
-static arc arcs_61_4[2] = {
-	{27, 3},
+static arc arcs_66_4[2] = {
+	{28, 3},
 	{0, 4},
 };
-static state states_61[5] = {
-	{1, arcs_61_0},
-	{3, arcs_61_1},
-	{1, arcs_61_2},
-	{2, arcs_61_3},
-	{2, arcs_61_4},
+static state states_66[5] = {
+	{1, arcs_66_0},
+	{3, arcs_66_1},
+	{1, arcs_66_2},
+	{2, arcs_66_3},
+	{2, arcs_66_4},
 };
-static arc arcs_62_0[1] = {
-	{26, 1},
+static arc arcs_67_0[1] = {
+	{22, 1},
 };
-static arc arcs_62_1[3] = {
-	{151, 2},
-	{27, 3},
+static arc arcs_67_1[3] = {
+	{157, 2},
+	{28, 3},
 	{0, 1},
 };
-static arc arcs_62_2[1] = {
+static arc arcs_67_2[1] = {
 	{0, 2},
 };
-static arc arcs_62_3[2] = {
-	{26, 4},
+static arc arcs_67_3[2] = {
+	{22, 4},
 	{0, 3},
 };
-static arc arcs_62_4[2] = {
-	{27, 3},
+static arc arcs_67_4[2] = {
+	{28, 3},
 	{0, 4},
 };
-static state states_62[5] = {
-	{1, arcs_62_0},
-	{3, arcs_62_1},
-	{1, arcs_62_2},
-	{2, arcs_62_3},
-	{2, arcs_62_4},
+static state states_67[5] = {
+	{1, arcs_67_0},
+	{3, arcs_67_1},
+	{1, arcs_67_2},
+	{2, arcs_67_3},
+	{2, arcs_67_4},
 };
-static arc arcs_63_0[1] = {
-	{106, 1},
+static arc arcs_68_0[1] = {
+	{112, 1},
 };
-static arc arcs_63_1[2] = {
-	{23, 2},
-	{21, 3},
+static arc arcs_68_1[2] = {
+	{33, 2},
+	{23, 3},
 };
-static arc arcs_63_2[1] = {
-	{21, 3},
+static arc arcs_68_2[1] = {
+	{23, 3},
 };
-static arc arcs_63_3[1] = {
-	{26, 4},
+static arc arcs_68_3[1] = {
+	{22, 4},
 };
-static arc arcs_63_4[1] = {
+static arc arcs_68_4[1] = {
 	{0, 4},
 };
-static state states_63[5] = {
-	{1, arcs_63_0},
-	{2, arcs_63_1},
-	{1, arcs_63_2},
-	{1, arcs_63_3},
-	{1, arcs_63_4},
+static state states_68[5] = {
+	{1, arcs_68_0},
+	{2, arcs_68_1},
+	{1, arcs_68_2},
+	{1, arcs_68_3},
+	{1, arcs_68_4},
 };
-static arc arcs_64_0[3] = {
+static arc arcs_69_0[3] = {
 	{13, 1},
-	{142, 2},
-	{74, 3},
+	{148, 2},
+	{80, 3},
 };
-static arc arcs_64_1[2] = {
+static arc arcs_69_1[2] = {
 	{14, 4},
 	{15, 5},
 };
-static arc arcs_64_2[1] = {
-	{152, 6},
+static arc arcs_69_2[1] = {
+	{158, 6},
 };
-static arc arcs_64_3[1] = {
+static arc arcs_69_3[1] = {
 	{19, 5},
 };
-static arc arcs_64_4[1] = {
+static arc arcs_69_4[1] = {
 	{15, 5},
 };
-static arc arcs_64_5[1] = {
+static arc arcs_69_5[1] = {
 	{0, 5},
 };
-static arc arcs_64_6[1] = {
-	{144, 5},
+static arc arcs_69_6[1] = {
+	{150, 5},
 };
-static state states_64[7] = {
-	{3, arcs_64_0},
-	{2, arcs_64_1},
-	{1, arcs_64_2},
-	{1, arcs_64_3},
-	{1, arcs_64_4},
-	{1, arcs_64_5},
-	{1, arcs_64_6},
+static state states_69[7] = {
+	{3, arcs_69_0},
+	{2, arcs_69_1},
+	{1, arcs_69_2},
+	{1, arcs_69_3},
+	{1, arcs_69_4},
+	{1, arcs_69_5},
+	{1, arcs_69_6},
 };
-static arc arcs_65_0[1] = {
-	{153, 1},
+static arc arcs_70_0[1] = {
+	{159, 1},
 };
-static arc arcs_65_1[2] = {
-	{27, 2},
+static arc arcs_70_1[2] = {
+	{28, 2},
 	{0, 1},
 };
-static arc arcs_65_2[2] = {
-	{153, 1},
+static arc arcs_70_2[2] = {
+	{159, 1},
 	{0, 2},
 };
-static state states_65[3] = {
-	{1, arcs_65_0},
-	{2, arcs_65_1},
-	{2, arcs_65_2},
+static state states_70[3] = {
+	{1, arcs_70_0},
+	{2, arcs_70_1},
+	{2, arcs_70_2},
 };
-static arc arcs_66_0[2] = {
-	{26, 1},
-	{21, 2},
+static arc arcs_71_0[2] = {
+	{22, 1},
+	{23, 2},
 };
-static arc arcs_66_1[2] = {
-	{21, 2},
+static arc arcs_71_1[2] = {
+	{23, 2},
 	{0, 1},
 };
-static arc arcs_66_2[3] = {
-	{26, 3},
-	{154, 4},
+static arc arcs_71_2[3] = {
+	{22, 3},
+	{160, 4},
 	{0, 2},
 };
-static arc arcs_66_3[2] = {
-	{154, 4},
+static arc arcs_71_3[2] = {
+	{160, 4},
 	{0, 3},
 };
-static arc arcs_66_4[1] = {
+static arc arcs_71_4[1] = {
 	{0, 4},
 };
-static state states_66[5] = {
-	{2, arcs_66_0},
-	{2, arcs_66_1},
-	{3, arcs_66_2},
-	{2, arcs_66_3},
-	{1, arcs_66_4},
+static state states_71[5] = {
+	{2, arcs_71_0},
+	{2, arcs_71_1},
+	{3, arcs_71_2},
+	{2, arcs_71_3},
+	{1, arcs_71_4},
 };
-static arc arcs_67_0[1] = {
-	{21, 1},
+static arc arcs_72_0[1] = {
+	{23, 1},
 };
-static arc arcs_67_1[2] = {
-	{26, 2},
+static arc arcs_72_1[2] = {
+	{22, 2},
 	{0, 1},
 };
-static arc arcs_67_2[1] = {
+static arc arcs_72_2[1] = {
 	{0, 2},
 };
-static state states_67[3] = {
-	{1, arcs_67_0},
-	{2, arcs_67_1},
-	{1, arcs_67_2},
+static state states_72[3] = {
+	{1, arcs_72_0},
+	{2, arcs_72_1},
+	{1, arcs_72_2},
 };
-static arc arcs_68_0[1] = {
-	{98, 1},
+static arc arcs_73_0[1] = {
+	{104, 1},
 };
-static arc arcs_68_1[2] = {
-	{27, 2},
+static arc arcs_73_1[2] = {
+	{28, 2},
 	{0, 1},
 };
-static arc arcs_68_2[2] = {
-	{98, 1},
+static arc arcs_73_2[2] = {
+	{104, 1},
 	{0, 2},
 };
-static state states_68[3] = {
-	{1, arcs_68_0},
-	{2, arcs_68_1},
-	{2, arcs_68_2},
+static state states_73[3] = {
+	{1, arcs_73_0},
+	{2, arcs_73_1},
+	{2, arcs_73_2},
 };
-static arc arcs_69_0[1] = {
-	{26, 1},
+static arc arcs_74_0[1] = {
+	{22, 1},
 };
-static arc arcs_69_1[2] = {
-	{27, 2},
+static arc arcs_74_1[2] = {
+	{28, 2},
 	{0, 1},
 };
-static arc arcs_69_2[2] = {
-	{26, 1},
+static arc arcs_74_2[2] = {
+	{22, 1},
 	{0, 2},
 };
-static state states_69[3] = {
-	{1, arcs_69_0},
-	{2, arcs_69_1},
-	{2, arcs_69_2},
+static state states_74[3] = {
+	{1, arcs_74_0},
+	{2, arcs_74_1},
+	{2, arcs_74_2},
 };
-static arc arcs_70_0[1] = {
-	{26, 1},
+static arc arcs_75_0[1] = {
+	{22, 1},
 };
-static arc arcs_70_1[3] = {
-	{21, 2},
-	{27, 3},
+static arc arcs_75_1[3] = {
+	{23, 2},
+	{28, 3},
 	{0, 1},
 };
-static arc arcs_70_2[1] = {
-	{26, 4},
+static arc arcs_75_2[1] = {
+	{22, 4},
 };
-static arc arcs_70_3[2] = {
-	{26, 5},
+static arc arcs_75_3[2] = {
+	{22, 5},
 	{0, 3},
 };
-static arc arcs_70_4[2] = {
-	{27, 6},
+static arc arcs_75_4[2] = {
+	{28, 6},
 	{0, 4},
 };
-static arc arcs_70_5[2] = {
-	{27, 3},
+static arc arcs_75_5[2] = {
+	{28, 3},
 	{0, 5},
 };
-static arc arcs_70_6[2] = {
-	{26, 7},
+static arc arcs_75_6[2] = {
+	{22, 7},
 	{0, 6},
 };
-static arc arcs_70_7[1] = {
-	{21, 2},
+static arc arcs_75_7[1] = {
+	{23, 2},
 };
-static state states_70[8] = {
-	{1, arcs_70_0},
-	{3, arcs_70_1},
-	{1, arcs_70_2},
-	{2, arcs_70_3},
-	{2, arcs_70_4},
-	{2, arcs_70_5},
-	{2, arcs_70_6},
-	{1, arcs_70_7},
+static state states_75[8] = {
+	{1, arcs_75_0},
+	{3, arcs_75_1},
+	{1, arcs_75_2},
+	{2, arcs_75_3},
+	{2, arcs_75_4},
+	{2, arcs_75_5},
+	{2, arcs_75_6},
+	{1, arcs_75_7},
 };
-static arc arcs_71_0[1] = {
-	{155, 1},
+static arc arcs_76_0[1] = {
+	{161, 1},
 };
-static arc arcs_71_1[1] = {
+static arc arcs_76_1[1] = {
 	{19, 2},
 };
-static arc arcs_71_2[2] = {
+static arc arcs_76_2[2] = {
 	{13, 3},
-	{21, 4},
+	{23, 4},
 };
-static arc arcs_71_3[2] = {
+static arc arcs_76_3[2] = {
 	{9, 5},
 	{15, 6},
 };
-static arc arcs_71_4[1] = {
-	{22, 7},
+static arc arcs_76_4[1] = {
+	{24, 7},
 };
-static arc arcs_71_5[1] = {
+static arc arcs_76_5[1] = {
 	{15, 6},
 };
-static arc arcs_71_6[1] = {
-	{21, 4},
+static arc arcs_76_6[1] = {
+	{23, 4},
 };
-static arc arcs_71_7[1] = {
+static arc arcs_76_7[1] = {
 	{0, 7},
 };
-static state states_71[8] = {
-	{1, arcs_71_0},
-	{1, arcs_71_1},
-	{2, arcs_71_2},
-	{2, arcs_71_3},
-	{1, arcs_71_4},
-	{1, arcs_71_5},
-	{1, arcs_71_6},
-	{1, arcs_71_7},
+static state states_76[8] = {
+	{1, arcs_76_0},
+	{1, arcs_76_1},
+	{2, arcs_76_2},
+	{2, arcs_76_3},
+	{1, arcs_76_4},
+	{1, arcs_76_5},
+	{1, arcs_76_6},
+	{1, arcs_76_7},
 };
-static arc arcs_72_0[3] = {
-	{156, 1},
-	{28, 2},
-	{29, 3},
+static arc arcs_77_0[3] = {
+	{162, 1},
+	{29, 2},
+	{31, 3},
 };
-static arc arcs_72_1[2] = {
-	{27, 4},
+static arc arcs_77_1[2] = {
+	{28, 4},
 	{0, 1},
 };
-static arc arcs_72_2[1] = {
-	{26, 5},
+static arc arcs_77_2[1] = {
+	{22, 5},
 };
-static arc arcs_72_3[1] = {
-	{26, 6},
+static arc arcs_77_3[1] = {
+	{22, 6},
 };
-static arc arcs_72_4[4] = {
-	{156, 1},
-	{28, 2},
-	{29, 3},
+static arc arcs_77_4[4] = {
+	{162, 1},
+	{29, 2},
+	{31, 3},
 	{0, 4},
 };
-static arc arcs_72_5[2] = {
-	{27, 7},
+static arc arcs_77_5[2] = {
+	{28, 7},
 	{0, 5},
 };
-static arc arcs_72_6[1] = {
+static arc arcs_77_6[1] = {
 	{0, 6},
 };
-static arc arcs_72_7[1] = {
-	{29, 3},
+static arc arcs_77_7[1] = {
+	{31, 3},
 };
-static state states_72[8] = {
-	{3, arcs_72_0},
-	{2, arcs_72_1},
-	{1, arcs_72_2},
-	{1, arcs_72_3},
-	{4, arcs_72_4},
-	{2, arcs_72_5},
-	{1, arcs_72_6},
-	{1, arcs_72_7},
+static state states_77[8] = {
+	{3, arcs_77_0},
+	{2, arcs_77_1},
+	{1, arcs_77_2},
+	{1, arcs_77_3},
+	{4, arcs_77_4},
+	{2, arcs_77_5},
+	{1, arcs_77_6},
+	{1, arcs_77_7},
 };
-static arc arcs_73_0[1] = {
-	{26, 1},
+static arc arcs_78_0[1] = {
+	{22, 1},
 };
-static arc arcs_73_1[3] = {
-	{151, 2},
-	{25, 3},
+static arc arcs_78_1[3] = {
+	{157, 2},
+	{27, 3},
 	{0, 1},
 };
-static arc arcs_73_2[1] = {
+static arc arcs_78_2[1] = {
 	{0, 2},
 };
-static arc arcs_73_3[1] = {
-	{26, 2},
+static arc arcs_78_3[1] = {
+	{22, 2},
 };
-static state states_73[4] = {
-	{1, arcs_73_0},
-	{3, arcs_73_1},
-	{1, arcs_73_2},
-	{1, arcs_73_3},
+static state states_78[4] = {
+	{1, arcs_78_0},
+	{3, arcs_78_1},
+	{1, arcs_78_2},
+	{1, arcs_78_3},
 };
-static arc arcs_74_0[2] = {
-	{150, 1},
-	{158, 1},
+static arc arcs_79_0[2] = {
+	{156, 1},
+	{164, 1},
 };
-static arc arcs_74_1[1] = {
+static arc arcs_79_1[1] = {
 	{0, 1},
 };
-static state states_74[2] = {
-	{2, arcs_74_0},
-	{1, arcs_74_1},
+static state states_79[2] = {
+	{2, arcs_79_0},
+	{1, arcs_79_1},
 };
-static arc arcs_75_0[1] = {
-	{91, 1},
+static arc arcs_80_0[1] = {
+	{97, 1},
 };
-static arc arcs_75_1[1] = {
-	{58, 2},
+static arc arcs_80_1[1] = {
+	{64, 2},
 };
-static arc arcs_75_2[1] = {
-	{92, 3},
+static arc arcs_80_2[1] = {
+	{98, 3},
 };
-static arc arcs_75_3[1] = {
-	{102, 4},
+static arc arcs_80_3[1] = {
+	{108, 4},
 };
-static arc arcs_75_4[2] = {
-	{157, 5},
+static arc arcs_80_4[2] = {
+	{163, 5},
 	{0, 4},
 };
-static arc arcs_75_5[1] = {
+static arc arcs_80_5[1] = {
 	{0, 5},
 };
-static state states_75[6] = {
-	{1, arcs_75_0},
-	{1, arcs_75_1},
-	{1, arcs_75_2},
-	{1, arcs_75_3},
-	{2, arcs_75_4},
-	{1, arcs_75_5},
+static state states_80[6] = {
+	{1, arcs_80_0},
+	{1, arcs_80_1},
+	{1, arcs_80_2},
+	{1, arcs_80_3},
+	{2, arcs_80_4},
+	{1, arcs_80_5},
 };
-static arc arcs_76_0[1] = {
-	{87, 1},
+static arc arcs_81_0[1] = {
+	{93, 1},
 };
-static arc arcs_76_1[1] = {
-	{103, 2},
+static arc arcs_81_1[1] = {
+	{109, 2},
 };
-static arc arcs_76_2[2] = {
-	{157, 3},
+static arc arcs_81_2[2] = {
+	{163, 3},
 	{0, 2},
 };
-static arc arcs_76_3[1] = {
+static arc arcs_81_3[1] = {
 	{0, 3},
 };
-static state states_76[4] = {
-	{1, arcs_76_0},
-	{1, arcs_76_1},
-	{2, arcs_76_2},
-	{1, arcs_76_3},
+static state states_81[4] = {
+	{1, arcs_81_0},
+	{1, arcs_81_1},
+	{2, arcs_81_2},
+	{1, arcs_81_3},
 };
-static arc arcs_77_0[2] = {
-	{151, 1},
-	{160, 1},
+static arc arcs_82_0[2] = {
+	{157, 1},
+	{166, 1},
 };
-static arc arcs_77_1[1] = {
+static arc arcs_82_1[1] = {
 	{0, 1},
 };
-static state states_77[2] = {
-	{2, arcs_77_0},
-	{1, arcs_77_1},
+static state states_82[2] = {
+	{2, arcs_82_0},
+	{1, arcs_82_1},
 };
-static arc arcs_78_0[1] = {
-	{91, 1},
+static arc arcs_83_0[1] = {
+	{97, 1},
 };
-static arc arcs_78_1[1] = {
-	{58, 2},
+static arc arcs_83_1[1] = {
+	{64, 2},
 };
-static arc arcs_78_2[1] = {
-	{92, 3},
+static arc arcs_83_2[1] = {
+	{98, 3},
 };
-static arc arcs_78_3[1] = {
-	{104, 4},
+static arc arcs_83_3[1] = {
+	{110, 4},
 };
-static arc arcs_78_4[2] = {
-	{159, 5},
+static arc arcs_83_4[2] = {
+	{165, 5},
 	{0, 4},
 };
-static arc arcs_78_5[1] = {
+static arc arcs_83_5[1] = {
 	{0, 5},
 };
-static state states_78[6] = {
-	{1, arcs_78_0},
-	{1, arcs_78_1},
-	{1, arcs_78_2},
-	{1, arcs_78_3},
-	{2, arcs_78_4},
-	{1, arcs_78_5},
+static state states_83[6] = {
+	{1, arcs_83_0},
+	{1, arcs_83_1},
+	{1, arcs_83_2},
+	{1, arcs_83_3},
+	{2, arcs_83_4},
+	{1, arcs_83_5},
 };
-static arc arcs_79_0[1] = {
-	{87, 1},
+static arc arcs_84_0[1] = {
+	{93, 1},
 };
-static arc arcs_79_1[1] = {
-	{103, 2},
+static arc arcs_84_1[1] = {
+	{109, 2},
 };
-static arc arcs_79_2[2] = {
-	{159, 3},
+static arc arcs_84_2[2] = {
+	{165, 3},
 	{0, 2},
 };
-static arc arcs_79_3[1] = {
+static arc arcs_84_3[1] = {
 	{0, 3},
 };
-static state states_79[4] = {
-	{1, arcs_79_0},
-	{1, arcs_79_1},
-	{2, arcs_79_2},
-	{1, arcs_79_3},
+static state states_84[4] = {
+	{1, arcs_84_0},
+	{1, arcs_84_1},
+	{2, arcs_84_2},
+	{1, arcs_84_3},
 };
-static arc arcs_80_0[1] = {
-	{26, 1},
+static arc arcs_85_0[1] = {
+	{22, 1},
 };
-static arc arcs_80_1[2] = {
-	{27, 0},
+static arc arcs_85_1[2] = {
+	{28, 0},
 	{0, 1},
 };
-static state states_80[2] = {
-	{1, arcs_80_0},
-	{2, arcs_80_1},
+static state states_85[2] = {
+	{1, arcs_85_0},
+	{2, arcs_85_1},
 };
-static arc arcs_81_0[1] = {
+static arc arcs_86_0[1] = {
 	{19, 1},
 };
-static arc arcs_81_1[1] = {
+static arc arcs_86_1[1] = {
 	{0, 1},
 };
-static state states_81[2] = {
-	{1, arcs_81_0},
-	{1, arcs_81_1},
+static state states_86[2] = {
+	{1, arcs_86_0},
+	{1, arcs_86_1},
 };
-static arc arcs_82_0[1] = {
-	{163, 1},
+static arc arcs_87_0[1] = {
+	{169, 1},
 };
-static arc arcs_82_1[2] = {
+static arc arcs_87_1[2] = {
 	{9, 2},
 	{0, 1},
 };
-static arc arcs_82_2[1] = {
+static arc arcs_87_2[1] = {
 	{0, 2},
 };
-static state states_82[3] = {
-	{1, arcs_82_0},
-	{2, arcs_82_1},
-	{1, arcs_82_2},
+static state states_87[3] = {
+	{1, arcs_87_0},
+	{2, arcs_87_1},
+	{1, arcs_87_2},
 };
-static dfa dfas[83] = {
+static dfa dfas[88] = {
 	{256, "single_input", 0, 3, states_0,
-	 "\004\050\014\000\000\000\200\012\236\206\201\054\001\004\001\000\030\102\062\010\010"},
+	 "\004\050\014\000\000\000\000\240\202\247\141\040\113\000\101\000\000\206\220\014\002\002"},
 	{257, "file_input", 0, 2, states_1,
-	 "\204\050\014\000\000\000\200\012\236\206\201\054\001\004\001\000\030\102\062\010\010"},
+	 "\204\050\014\000\000\000\000\240\202\247\141\040\113\000\101\000\000\206\220\014\002\002"},
 	{258, "eval_input", 0, 3, states_2,
-	 "\000\040\010\000\000\000\000\000\000\004\000\000\000\004\001\000\030\102\062\000\000"},
+	 "\000\040\010\000\000\000\000\000\000\000\001\000\000\000\101\000\000\206\220\014\000\000"},
 	{259, "decorator", 0, 7, states_3,
-	 "\000\010\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"},
+	 "\000\010\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"},
 	{260, "decorators", 0, 2, states_4,
-	 "\000\010\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"},
-	{261, "funcdef", 0, 7, states_5,
-	 "\000\010\004\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"},
+	 "\000\010\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"},
+	{261, "funcdef", 0, 9, states_5,
+	 "\000\010\004\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"},
 	{262, "parameters", 0, 4, states_6,
-	 "\000\040\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"},
-	{263, "varargslist", 0, 12, states_7,
-	 "\000\040\010\060\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"},
-	{264, "fpdef", 0, 4, states_8,
-	 "\000\040\010\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"},
-	{265, "fplist", 0, 3, states_9,
-	 "\000\040\010\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"},
-	{266, "stmt", 0, 2, states_10,
-	 "\000\050\014\000\000\000\200\012\236\206\201\054\001\004\001\000\030\102\062\010\010"},
-	{267, "simple_stmt", 0, 4, states_11,
-	 "\000\040\010\000\000\000\200\012\236\206\001\000\000\004\001\000\030\102\062\000\010"},
-	{268, "small_stmt", 0, 2, states_12,
-	 "\000\040\010\000\000\000\200\012\236\206\001\000\000\004\001\000\030\102\062\000\010"},
-	{269, "expr_stmt", 0, 6, states_13,
-	 "\000\040\010\000\000\000\000\000\000\004\000\000\000\004\001\000\030\102\062\000\000"},
-	{270, "augassign", 0, 2, states_14,
-	 "\000\000\000\000\000\370\177\000\000\000\000\000\000\000\000\000\000\000\000\000\000"},
-	{271, "print_stmt", 0, 9, states_15,
-	 "\000\000\000\000\000\000\200\000\000\000\000\000\000\000\000\000\000\000\000\000\000"},
-	{272, "del_stmt", 0, 3, states_16,
-	 "\000\000\000\000\000\000\000\002\000\000\000\000\000\000\000\000\000\000\000\000\000"},
-	{273, "pass_stmt", 0, 2, states_17,
-	 "\000\000\000\000\000\000\000\010\000\000\000\000\000\000\000\000\000\000\000\000\000"},
-	{274, "flow_stmt", 0, 2, states_18,
-	 "\000\000\000\000\000\000\000\000\036\000\000\000\000\000\000\000\000\000\000\000\010"},
-	{275, "break_stmt", 0, 2, states_19,
-	 "\000\000\000\000\000\000\000\000\002\000\000\000\000\000\000\000\000\000\000\000\000"},
-	{276, "continue_stmt", 0, 2, states_20,
-	 "\000\000\000\000\000\000\000\000\004\000\000\000\000\000\000\000\000\000\000\000\000"},
-	{277, "return_stmt", 0, 3, states_21,
-	 "\000\000\000\000\000\000\000\000\010\000\000\000\000\000\000\000\000\000\000\000\000"},
-	{278, "yield_stmt", 0, 2, states_22,
-	 "\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\010"},
-	{279, "raise_stmt", 0, 7, states_23,
-	 "\000\000\000\000\000\000\000\000\020\000\000\000\000\000\000\000\000\000\000\000\000"},
-	{280, "import_stmt", 0, 2, states_24,
-	 "\000\000\000\000\000\000\000\000\200\002\000\000\000\000\000\000\000\000\000\000\000"},
-	{281, "import_name", 0, 3, states_25,
-	 "\000\000\000\000\000\000\000\000\200\000\000\000\000\000\000\000\000\000\000\000\000"},
-	{282, "import_from", 0, 8, states_26,
-	 "\000\000\000\000\000\000\000\000\000\002\000\000\000\000\000\000\000\000\000\000\000"},
-	{283, "import_as_name", 0, 4, states_27,
-	 "\000\000\010\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"},
-	{284, "dotted_as_name", 0, 4, states_28,
-	 "\000\000\010\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"},
-	{285, "import_as_names", 0, 3, states_29,
-	 "\000\000\010\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"},
-	{286, "dotted_as_names", 0, 2, states_30,
-	 "\000\000\010\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"},
-	{287, "dotted_name", 0, 2, states_31,
-	 "\000\000\010\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"},
-	{288, "global_stmt", 0, 3, states_32,
-	 "\000\000\000\000\000\000\000\000\000\200\000\000\000\000\000\000\000\000\000\000\000"},
-	{289, "assert_stmt", 0, 5, states_33,
-	 "\000\000\000\000\000\000\000\000\000\000\001\000\000\000\000\000\000\000\000\000\000"},
-	{290, "compound_stmt", 0, 2, states_34,
-	 "\000\010\004\000\000\000\000\000\000\000\200\054\001\000\000\000\000\000\000\010\000"},
-	{291, "if_stmt", 0, 8, states_35,
-	 "\000\000\000\000\000\000\000\000\000\000\200\000\000\000\000\000\000\000\000\000\000"},
-	{292, "while_stmt", 0, 8, states_36,
-	 "\000\000\000\000\000\000\000\000\000\000\000\004\000\000\000\000\000\000\000\000\000"},
-	{293, "for_stmt", 0, 10, states_37,
-	 "\000\000\000\000\000\000\000\000\000\000\000\010\000\000\000\000\000\000\000\000\000"},
-	{294, "try_stmt", 0, 13, states_38,
-	 "\000\000\000\000\000\000\000\000\000\000\000\040\000\000\000\000\000\000\000\000\000"},
-	{295, "with_stmt", 0, 6, states_39,
-	 "\000\000\000\000\000\000\000\000\000\000\000\000\001\000\000\000\000\000\000\000\000"},
-	{296, "with_var", 0, 3, states_40,
-	 "\000\000\000\000\000\000\000\000\000\040\000\000\000\000\000\000\000\000\000\000\000"},
-	{297, "except_clause", 0, 5, states_41,
-	 "\000\000\000\000\000\000\000\000\000\000\000\000\010\000\000\000\000\000\000\000\000"},
-	{298, "suite", 0, 5, states_42,
-	 "\004\040\010\000\000\000\200\012\236\206\001\000\000\004\001\000\030\102\062\000\010"},
-	{299, "testlist_safe", 0, 5, states_43,
-	 "\000\040\010\000\000\000\000\000\000\004\000\000\000\004\001\000\030\102\062\000\000"},
-	{300, "old_test", 0, 2, states_44,
-	 "\000\040\010\000\000\000\000\000\000\004\000\000\000\004\001\000\030\102\062\000\000"},
-	{301, "old_lambdef", 0, 5, states_45,
-	 "\000\000\000\000\000\000\000\000\000\000\000\000\000\004\000\000\000\000\000\000\000"},
-	{302, "test", 0, 6, states_46,
-	 "\000\040\010\000\000\000\000\000\000\004\000\000\000\004\001\000\030\102\062\000\000"},
-	{303, "or_test", 0, 2, states_47,
-	 "\000\040\010\000\000\000\000\000\000\004\000\000\000\000\001\000\030\102\062\000\000"},
-	{304, "and_test", 0, 2, states_48,
-	 "\000\040\010\000\000\000\000\000\000\004\000\000\000\000\001\000\030\102\062\000\000"},
-	{305, "not_test", 0, 3, states_49,
-	 "\000\040\010\000\000\000\000\000\000\004\000\000\000\000\001\000\030\102\062\000\000"},
-	{306, "comparison", 0, 2, states_50,
-	 "\000\040\010\000\000\000\000\000\000\004\000\000\000\000\000\000\030\102\062\000\000"},
-	{307, "comp_op", 0, 4, states_51,
-	 "\000\000\000\000\000\000\000\000\000\000\000\020\000\000\371\003\000\000\000\000\000"},
-	{308, "expr", 0, 2, states_52,
-	 "\000\040\010\000\000\000\000\000\000\004\000\000\000\000\000\000\030\102\062\000\000"},
-	{309, "xor_expr", 0, 2, states_53,
-	 "\000\040\010\000\000\000\000\000\000\004\000\000\000\000\000\000\030\102\062\000\000"},
-	{310, "and_expr", 0, 2, states_54,
-	 "\000\040\010\000\000\000\000\000\000\004\000\000\000\000\000\000\030\102\062\000\000"},
-	{311, "shift_expr", 0, 2, states_55,
-	 "\000\040\010\000\000\000\000\000\000\004\000\000\000\000\000\000\030\102\062\000\000"},
-	{312, "arith_expr", 0, 2, states_56,
-	 "\000\040\010\000\000\000\000\000\000\004\000\000\000\000\000\000\030\102\062\000\000"},
-	{313, "term", 0, 2, states_57,
-	 "\000\040\010\000\000\000\000\000\000\004\000\000\000\000\000\000\030\102\062\000\000"},
-	{314, "factor", 0, 3, states_58,
-	 "\000\040\010\000\000\000\000\000\000\004\000\000\000\000\000\000\030\102\062\000\000"},
-	{315, "power", 0, 4, states_59,
-	 "\000\040\010\000\000\000\000\000\000\004\000\000\000\000\000\000\000\100\062\000\000"},
-	{316, "atom", 0, 11, states_60,
-	 "\000\040\010\000\000\000\000\000\000\004\000\000\000\000\000\000\000\100\062\000\000"},
-	{317, "listmaker", 0, 5, states_61,
-	 "\000\040\010\000\000\000\000\000\000\004\000\000\000\004\001\000\030\102\062\000\000"},
-	{318, "testlist_gexp", 0, 5, states_62,
-	 "\000\040\010\000\000\000\000\000\000\004\000\000\000\004\001\000\030\102\062\000\000"},
-	{319, "lambdef", 0, 5, states_63,
-	 "\000\000\000\000\000\000\000\000\000\000\000\000\000\004\000\000\000\000\000\000\000"},
-	{320, "trailer", 0, 7, states_64,
-	 "\000\040\000\000\000\000\000\000\000\004\000\000\000\000\000\000\000\100\000\000\000"},
-	{321, "subscriptlist", 0, 3, states_65,
-	 "\000\040\050\000\000\000\000\000\000\004\000\000\000\004\001\000\030\102\062\000\000"},
-	{322, "subscript", 0, 5, states_66,
-	 "\000\040\050\000\000\000\000\000\000\004\000\000\000\004\001\000\030\102\062\000\000"},
-	{323, "sliceop", 0, 3, states_67,
-	 "\000\000\040\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"},
-	{324, "exprlist", 0, 3, states_68,
-	 "\000\040\010\000\000\000\000\000\000\004\000\000\000\000\000\000\030\102\062\000\000"},
-	{325, "testlist", 0, 3, states_69,
-	 "\000\040\010\000\000\000\000\000\000\004\000\000\000\004\001\000\030\102\062\000\000"},
-	{326, "dictsetmaker", 0, 8, states_70,
-	 "\000\040\010\000\000\000\000\000\000\004\000\000\000\004\001\000\030\102\062\000\000"},
-	{327, "classdef", 0, 8, states_71,
-	 "\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\010\000"},
-	{328, "arglist", 0, 8, states_72,
-	 "\000\040\010\060\000\000\000\000\000\004\000\000\000\004\001\000\030\102\062\000\000"},
-	{329, "argument", 0, 4, states_73,
-	 "\000\040\010\000\000\000\000\000\000\004\000\000\000\004\001\000\030\102\062\000\000"},
-	{330, "list_iter", 0, 2, states_74,
-	 "\000\000\000\000\000\000\000\000\000\000\200\010\000\000\000\000\000\000\000\000\000"},
-	{331, "list_for", 0, 6, states_75,
-	 "\000\000\000\000\000\000\000\000\000\000\000\010\000\000\000\000\000\000\000\000\000"},
-	{332, "list_if", 0, 4, states_76,
-	 "\000\000\000\000\000\000\000\000\000\000\200\000\000\000\000\000\000\000\000\000\000"},
-	{333, "gen_iter", 0, 2, states_77,
-	 "\000\000\000\000\000\000\000\000\000\000\200\010\000\000\000\000\000\000\000\000\000"},
-	{334, "gen_for", 0, 6, states_78,
-	 "\000\000\000\000\000\000\000\000\000\000\000\010\000\000\000\000\000\000\000\000\000"},
-	{335, "gen_if", 0, 4, states_79,
-	 "\000\000\000\000\000\000\000\000\000\000\200\000\000\000\000\000\000\000\000\000\000"},
-	{336, "testlist1", 0, 2, states_80,
-	 "\000\040\010\000\000\000\000\000\000\004\000\000\000\004\001\000\030\102\062\000\000"},
-	{337, "encoding_decl", 0, 2, states_81,
-	 "\000\000\010\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"},
-	{338, "yield_expr", 0, 3, states_82,
-	 "\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\010"},
+	 "\000\040\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"},
+	{263, "typedargslist", 0, 12, states_7,
+	 "\000\040\010\240\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"},
+	{264, "tname", 0, 4, states_8,
+	 "\000\000\010\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"},
+	{265, "tfpdef", 0, 4, states_9,
+	 "\000\040\010\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"},
+	{266, "tfplist", 0, 3, states_10,
+	 "\000\040\010\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"},
+	{267, "varargslist", 0, 12, states_11,
+	 "\000\040\010\240\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"},
+	{268, "vname", 0, 2, states_12,
+	 "\000\000\010\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"},
+	{269, "vfpdef", 0, 4, states_13,
+	 "\000\040\010\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"},
+	{270, "vfplist", 0, 3, states_14,
+	 "\000\040\010\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"},
+	{271, "stmt", 0, 2, states_15,
+	 "\000\050\014\000\000\000\000\240\202\247\141\040\113\000\101\000\000\206\220\014\002\002"},
+	{272, "simple_stmt", 0, 4, states_16,
+	 "\000\040\010\000\000\000\000\240\202\247\141\000\000\000\101\000\000\206\220\014\000\002"},
+	{273, "small_stmt", 0, 2, states_17,
+	 "\000\040\010\000\000\000\000\240\202\247\141\000\000\000\101\000\000\206\220\014\000\002"},
+	{274, "expr_stmt", 0, 6, states_18,
+	 "\000\040\010\000\000\000\000\000\000\000\001\000\000\000\101\000\000\206\220\014\000\000"},
+	{275, "augassign", 0, 2, states_19,
+	 "\000\000\000\000\000\000\376\037\000\000\000\000\000\000\000\000\000\000\000\000\000\000"},
+	{276, "print_stmt", 0, 9, states_20,
+	 "\000\000\000\000\000\000\000\040\000\000\000\000\000\000\000\000\000\000\000\000\000\000"},
+	{277, "del_stmt", 0, 3, states_21,
+	 "\000\000\000\000\000\000\000\200\000\000\000\000\000\000\000\000\000\000\000\000\000\000"},
+	{278, "pass_stmt", 0, 2, states_22,
+	 "\000\000\000\000\000\000\000\000\002\000\000\000\000\000\000\000\000\000\000\000\000\000"},
+	{279, "flow_stmt", 0, 2, states_23,
+	 "\000\000\000\000\000\000\000\000\200\007\000\000\000\000\000\000\000\000\000\000\000\002"},
+	{280, "break_stmt", 0, 2, states_24,
+	 "\000\000\000\000\000\000\000\000\200\000\000\000\000\000\000\000\000\000\000\000\000\000"},
+	{281, "continue_stmt", 0, 2, states_25,
+	 "\000\000\000\000\000\000\000\000\000\001\000\000\000\000\000\000\000\000\000\000\000\000"},
+	{282, "return_stmt", 0, 3, states_26,
+	 "\000\000\000\000\000\000\000\000\000\002\000\000\000\000\000\000\000\000\000\000\000\000"},
+	{283, "yield_stmt", 0, 2, states_27,
+	 "\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\002"},
+	{284, "raise_stmt", 0, 7, states_28,
+	 "\000\000\000\000\000\000\000\000\000\004\000\000\000\000\000\000\000\000\000\000\000\000"},
+	{285, "import_stmt", 0, 2, states_29,
+	 "\000\000\000\000\000\000\000\000\000\240\000\000\000\000\000\000\000\000\000\000\000\000"},
+	{286, "import_name", 0, 3, states_30,
+	 "\000\000\000\000\000\000\000\000\000\040\000\000\000\000\000\000\000\000\000\000\000\000"},
+	{287, "import_from", 0, 8, states_31,
+	 "\000\000\000\000\000\000\000\000\000\200\000\000\000\000\000\000\000\000\000\000\000\000"},
+	{288, "import_as_name", 0, 4, states_32,
+	 "\000\000\010\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"},
+	{289, "dotted_as_name", 0, 4, states_33,
+	 "\000\000\010\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"},
+	{290, "import_as_names", 0, 3, states_34,
+	 "\000\000\010\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"},
+	{291, "dotted_as_names", 0, 2, states_35,
+	 "\000\000\010\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"},
+	{292, "dotted_name", 0, 2, states_36,
+	 "\000\000\010\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"},
+	{293, "global_stmt", 0, 3, states_37,
+	 "\000\000\000\000\000\000\000\000\000\000\040\000\000\000\000\000\000\000\000\000\000\000"},
+	{294, "assert_stmt", 0, 5, states_38,
+	 "\000\000\000\000\000\000\000\000\000\000\100\000\000\000\000\000\000\000\000\000\000\000"},
+	{295, "compound_stmt", 0, 2, states_39,
+	 "\000\010\004\000\000\000\000\000\000\000\000\040\113\000\000\000\000\000\000\000\002\000"},
+	{296, "if_stmt", 0, 8, states_40,
+	 "\000\000\000\000\000\000\000\000\000\000\000\040\000\000\000\000\000\000\000\000\000\000"},
+	{297, "while_stmt", 0, 8, states_41,
+	 "\000\000\000\000\000\000\000\000\000\000\000\000\001\000\000\000\000\000\000\000\000\000"},
+	{298, "for_stmt", 0, 10, states_42,
+	 "\000\000\000\000\000\000\000\000\000\000\000\000\002\000\000\000\000\000\000\000\000\000"},
+	{299, "try_stmt", 0, 13, states_43,
+	 "\000\000\000\000\000\000\000\000\000\000\000\000\010\000\000\000\000\000\000\000\000\000"},
+	{300, "with_stmt", 0, 6, states_44,
+	 "\000\000\000\000\000\000\000\000\000\000\000\000\100\000\000\000\000\000\000\000\000\000"},
+	{301, "with_var", 0, 3, states_45,
+	 "\000\000\000\000\000\000\000\000\000\000\010\000\000\000\000\000\000\000\000\000\000\000"},
+	{302, "except_clause", 0, 5, states_46,
+	 "\000\000\000\000\000\000\000\000\000\000\000\000\000\002\000\000\000\000\000\000\000\000"},
+	{303, "suite", 0, 5, states_47,
+	 "\004\040\010\000\000\000\000\240\202\247\141\000\000\000\101\000\000\206\220\014\000\002"},
+	{304, "testlist_safe", 0, 5, states_48,
+	 "\000\040\010\000\000\000\000\000\000\000\001\000\000\000\101\000\000\206\220\014\000\000"},
+	{305, "old_test", 0, 2, states_49,
+	 "\000\040\010\000\000\000\000\000\000\000\001\000\000\000\101\000\000\206\220\014\000\000"},
+	{306, "old_lambdef", 0, 5, states_50,
+	 "\000\000\000\000\000\000\000\000\000\000\000\000\000\000\001\000\000\000\000\000\000\000"},
+	{307, "test", 0, 6, states_51,
+	 "\000\040\010\000\000\000\000\000\000\000\001\000\000\000\101\000\000\206\220\014\000\000"},
+	{308, "or_test", 0, 2, states_52,
+	 "\000\040\010\000\000\000\000\000\000\000\001\000\000\000\100\000\000\206\220\014\000\000"},
+	{309, "and_test", 0, 2, states_53,
+	 "\000\040\010\000\000\000\000\000\000\000\001\000\000\000\100\000\000\206\220\014\000\000"},
+	{310, "not_test", 0, 3, states_54,
+	 "\000\040\010\000\000\000\000\000\000\000\001\000\000\000\100\000\000\206\220\014\000\000"},
+	{311, "comparison", 0, 2, states_55,
+	 "\000\040\010\000\000\000\000\000\000\000\001\000\000\000\000\000\000\206\220\014\000\000"},
+	{312, "comp_op", 0, 4, states_56,
+	 "\000\000\000\000\000\000\000\000\000\000\000\000\004\000\100\376\000\000\000\000\000\000"},
+	{313, "expr", 0, 2, states_57,
+	 "\000\040\010\000\000\000\000\000\000\000\001\000\000\000\000\000\000\206\220\014\000\000"},
+	{314, "xor_expr", 0, 2, states_58,
+	 "\000\040\010\000\000\000\000\000\000\000\001\000\000\000\000\000\000\206\220\014\000\000"},
+	{315, "and_expr", 0, 2, states_59,
+	 "\000\040\010\000\000\000\000\000\000\000\001\000\000\000\000\000\000\206\220\014\000\000"},
+	{316, "shift_expr", 0, 2, states_60,
+	 "\000\040\010\000\000\000\000\000\000\000\001\000\000\000\000\000\000\206\220\014\000\000"},
+	{317, "arith_expr", 0, 2, states_61,
+	 "\000\040\010\000\000\000\000\000\000\000\001\000\000\000\000\000\000\206\220\014\000\000"},
+	{318, "term", 0, 2, states_62,
+	 "\000\040\010\000\000\000\000\000\000\000\001\000\000\000\000\000\000\206\220\014\000\000"},
+	{319, "factor", 0, 3, states_63,
+	 "\000\040\010\000\000\000\000\000\000\000\001\000\000\000\000\000\000\206\220\014\000\000"},
+	{320, "power", 0, 4, states_64,
+	 "\000\040\010\000\000\000\000\000\000\000\001\000\000\000\000\000\000\000\220\014\000\000"},
+	{321, "atom", 0, 11, states_65,
+	 "\000\040\010\000\000\000\000\000\000\000\001\000\000\000\000\000\000\000\220\014\000\000"},
+	{322, "listmaker", 0, 5, states_66,
+	 "\000\040\010\000\000\000\000\000\000\000\001\000\000\000\101\000\000\206\220\014\000\000"},
+	{323, "testlist_gexp", 0, 5, states_67,
+	 "\000\040\010\000\000\000\000\000\000\000\001\000\000\000\101\000\000\206\220\014\000\000"},
+	{324, "lambdef", 0, 5, states_68,
+	 "\000\000\000\000\000\000\000\000\000\000\000\000\000\000\001\000\000\000\000\000\000\000"},
+	{325, "trailer", 0, 7, states_69,
+	 "\000\040\000\000\000\000\000\000\000\000\001\000\000\000\000\000\000\000\020\000\000\000"},
+	{326, "subscriptlist", 0, 3, states_70,
+	 "\000\040\210\000\000\000\000\000\000\000\001\000\000\000\101\000\000\206\220\014\000\000"},
+	{327, "subscript", 0, 5, states_71,
+	 "\000\040\210\000\000\000\000\000\000\000\001\000\000\000\101\000\000\206\220\014\000\000"},
+	{328, "sliceop", 0, 3, states_72,
+	 "\000\000\200\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"},
+	{329, "exprlist", 0, 3, states_73,
+	 "\000\040\010\000\000\000\000\000\000\000\001\000\000\000\000\000\000\206\220\014\000\000"},
+	{330, "testlist", 0, 3, states_74,
+	 "\000\040\010\000\000\000\000\000\000\000\001\000\000\000\101\000\000\206\220\014\000\000"},
+	{331, "dictsetmaker", 0, 8, states_75,
+	 "\000\040\010\000\000\000\000\000\000\000\001\000\000\000\101\000\000\206\220\014\000\000"},
+	{332, "classdef", 0, 8, states_76,
+	 "\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\002\000"},
+	{333, "arglist", 0, 8, states_77,
+	 "\000\040\010\240\000\000\000\000\000\000\001\000\000\000\101\000\000\206\220\014\000\000"},
+	{334, "argument", 0, 4, states_78,
+	 "\000\040\010\000\000\000\000\000\000\000\001\000\000\000\101\000\000\206\220\014\000\000"},
+	{335, "list_iter", 0, 2, states_79,
+	 "\000\000\000\000\000\000\000\000\000\000\000\040\002\000\000\000\000\000\000\000\000\000"},
+	{336, "list_for", 0, 6, states_80,
+	 "\000\000\000\000\000\000\000\000\000\000\000\000\002\000\000\000\000\000\000\000\000\000"},
+	{337, "list_if", 0, 4, states_81,
+	 "\000\000\000\000\000\000\000\000\000\000\000\040\000\000\000\000\000\000\000\000\000\000"},
+	{338, "gen_iter", 0, 2, states_82,
+	 "\000\000\000\000\000\000\000\000\000\000\000\040\002\000\000\000\000\000\000\000\000\000"},
+	{339, "gen_for", 0, 6, states_83,
+	 "\000\000\000\000\000\000\000\000\000\000\000\000\002\000\000\000\000\000\000\000\000\000"},
+	{340, "gen_if", 0, 4, states_84,
+	 "\000\000\000\000\000\000\000\000\000\000\000\040\000\000\000\000\000\000\000\000\000\000"},
+	{341, "testlist1", 0, 2, states_85,
+	 "\000\040\010\000\000\000\000\000\000\000\001\000\000\000\101\000\000\206\220\014\000\000"},
+	{342, "encoding_decl", 0, 2, states_86,
+	 "\000\000\010\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"},
+	{343, "yield_expr", 0, 3, states_87,
+	 "\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\002"},
 };
-static label labels[164] = {
+static label labels[170] = {
 	{0, "EMPTY"},
 	{256, 0},
 	{4, 0},
-	{267, 0},
-	{290, 0},
+	{272, 0},
+	{295, 0},
 	{257, 0},
-	{266, 0},
+	{271, 0},
 	{0, 0},
 	{258, 0},
-	{325, 0},
+	{330, 0},
 	{259, 0},
 	{50, 0},
-	{287, 0},
+	{292, 0},
 	{7, 0},
-	{328, 0},
+	{333, 0},
 	{8, 0},
 	{260, 0},
 	{261, 0},
 	{1, "def"},
 	{1, 0},
 	{262, 0},
+	{51, 0},
+	{307, 0},
 	{11, 0},
-	{298, 0},
+	{303, 0},
 	{263, 0},
-	{264, 0},
+	{265, 0},
 	{22, 0},
-	{302, 0},
 	{12, 0},
 	{16, 0},
+	{264, 0},
 	{36, 0},
-	{265, 0},
-	{268, 0},
-	{13, 0},
+	{266, 0},
+	{267, 0},
 	{269, 0},
-	{271, 0},
-	{272, 0},
+	{268, 0},
+	{270, 0},
 	{273, 0},
+	{13, 0},
 	{274, 0},
-	{280, 0},
-	{288, 0},
-	{289, 0},
-	{270, 0},
-	{338, 0},
+	{276, 0},
+	{277, 0},
+	{278, 0},
+	{279, 0},
+	{285, 0},
+	{293, 0},
+	{294, 0},
+	{275, 0},
+	{343, 0},
 	{37, 0},
 	{38, 0},
 	{39, 0},
@@ -1991,35 +2144,35 @@
 	{1, "print"},
 	{35, 0},
 	{1, "del"},
-	{324, 0},
+	{329, 0},
 	{1, "pass"},
-	{275, 0},
-	{276, 0},
-	{277, 0},
-	{279, 0},
-	{278, 0},
+	{280, 0},
+	{281, 0},
+	{282, 0},
+	{284, 0},
+	{283, 0},
 	{1, "break"},
 	{1, "continue"},
 	{1, "return"},
 	{1, "raise"},
-	{281, 0},
-	{282, 0},
-	{1, "import"},
 	{286, 0},
+	{287, 0},
+	{1, "import"},
+	{291, 0},
 	{1, "from"},
 	{23, 0},
-	{285, 0},
-	{283, 0},
+	{290, 0},
+	{288, 0},
 	{1, "as"},
-	{284, 0},
+	{289, 0},
 	{1, "global"},
 	{1, "assert"},
-	{291, 0},
-	{292, 0},
-	{293, 0},
-	{294, 0},
-	{295, 0},
-	{327, 0},
+	{296, 0},
+	{297, 0},
+	{298, 0},
+	{299, 0},
+	{300, 0},
+	{332, 0},
 	{1, "if"},
 	{1, "elif"},
 	{1, "else"},
@@ -2027,27 +2180,27 @@
 	{1, "for"},
 	{1, "in"},
 	{1, "try"},
-	{297, 0},
+	{302, 0},
 	{1, "finally"},
 	{1, "with"},
-	{296, 0},
-	{308, 0},
+	{301, 0},
+	{313, 0},
 	{1, "except"},
 	{5, 0},
 	{6, 0},
-	{299, 0},
-	{300, 0},
-	{303, 0},
-	{301, 0},
-	{1, "lambda"},
-	{319, 0},
 	{304, 0},
-	{1, "or"},
 	{305, 0},
+	{308, 0},
+	{306, 0},
+	{1, "lambda"},
+	{324, 0},
+	{309, 0},
+	{1, "or"},
+	{310, 0},
 	{1, "and"},
 	{1, "not"},
-	{306, 0},
-	{307, 0},
+	{311, 0},
+	{312, 0},
 	{20, 0},
 	{21, 0},
 	{28, 0},
@@ -2055,52 +2208,52 @@
 	{30, 0},
 	{29, 0},
 	{1, "is"},
-	{309, 0},
+	{314, 0},
 	{18, 0},
-	{310, 0},
+	{315, 0},
 	{33, 0},
-	{311, 0},
+	{316, 0},
 	{19, 0},
-	{312, 0},
+	{317, 0},
 	{34, 0},
-	{313, 0},
+	{318, 0},
 	{14, 0},
 	{15, 0},
-	{314, 0},
+	{319, 0},
 	{17, 0},
 	{24, 0},
 	{48, 0},
 	{32, 0},
-	{315, 0},
-	{316, 0},
 	{320, 0},
-	{318, 0},
+	{321, 0},
+	{325, 0},
+	{323, 0},
 	{9, 0},
-	{317, 0},
+	{322, 0},
 	{10, 0},
 	{26, 0},
-	{326, 0},
+	{331, 0},
 	{27, 0},
 	{2, 0},
 	{3, 0},
-	{331, 0},
-	{334, 0},
-	{321, 0},
-	{322, 0},
-	{323, 0},
+	{336, 0},
+	{339, 0},
+	{326, 0},
+	{327, 0},
+	{328, 0},
 	{1, "class"},
-	{329, 0},
-	{330, 0},
-	{332, 0},
-	{333, 0},
+	{334, 0},
 	{335, 0},
-	{336, 0},
 	{337, 0},
+	{338, 0},
+	{340, 0},
+	{341, 0},
+	{342, 0},
 	{1, "yield"},
 };
 grammar _PyParser_Grammar = {
-	83,
+	88,
 	dfas,
-	{164, labels},
+	{170, labels},
 	256
 };

Modified: python/branches/p3yk-noslice/Python/import.c
==============================================================================
--- python/branches/p3yk-noslice/Python/import.c	(original)
+++ python/branches/p3yk-noslice/Python/import.c	Thu Jan 11 00:21:28 2007
@@ -70,9 +70,10 @@
        	              3010 (removed UNARY_CONVERT)
 		      3020 (added BUILD_SET)
 		      3030 (added keyword-only parameters)
+		      3040 (added signature annotations)
 .
 */
-#define MAGIC (3030 | ((long)'\r'<<16) | ((long)'\n'<<24))
+#define MAGIC (3040 | ((long)'\r'<<16) | ((long)'\n'<<24))
 
 /* Magic word as global; note that _PyImport_Init() can change the
    value of this global to accommodate for alterations of how the

Modified: python/branches/p3yk-noslice/Python/marshal.c
==============================================================================
--- python/branches/p3yk-noslice/Python/marshal.c	(original)
+++ python/branches/p3yk-noslice/Python/marshal.c	Thu Jan 11 00:21:28 2007
@@ -182,8 +182,8 @@
 		}
 		else {
 			char buf[256]; /* Plenty to format any double */
-			PyFloat_AsReprString(buf, (PyFloatObject *)v);
-			n = strlen(buf);
+			n = _PyFloat_Repr(PyFloat_AS_DOUBLE(v),
+					  buf, sizeof(buf));
 			w_byte(TYPE_FLOAT, p);
 			w_byte((int)n, p);
 			w_string(buf, (int)n, p);
@@ -209,28 +209,14 @@
 		}
 		else {
 			char buf[256]; /* Plenty to format any double */
-			PyFloatObject *temp;
 			w_byte(TYPE_COMPLEX, p);
-			temp = (PyFloatObject*)PyFloat_FromDouble(
-				PyComplex_RealAsDouble(v));
-			if (!temp) {
-				p->error = 1;
-				return;
-			}
-			PyFloat_AsReprString(buf, temp);
-			Py_DECREF(temp);
+			n = _PyFloat_Repr(PyComplex_RealAsDouble(v),
+					  buf, sizeof(buf));
 			n = strlen(buf);
 			w_byte((int)n, p);
 			w_string(buf, (int)n, p);
-			temp = (PyFloatObject*)PyFloat_FromDouble(
-				PyComplex_ImagAsDouble(v));
-			if (!temp) {
-				p->error = 1;
-				return;
-			}
-			PyFloat_AsReprString(buf, temp);
-			Py_DECREF(temp);
-			n = strlen(buf);
+			n = _PyFloat_Repr(PyComplex_ImagAsDouble(v),
+					  buf, sizeof(buf));
 			w_byte((int)n, p);
 			w_string(buf, (int)n, p);
 		}

Modified: python/branches/p3yk-noslice/Python/symtable.c
==============================================================================
--- python/branches/p3yk-noslice/Python/symtable.c	(original)
+++ python/branches/p3yk-noslice/Python/symtable.c	Thu Jan 11 00:21:28 2007
@@ -172,9 +172,12 @@
 static int symtable_visit_comprehension(struct symtable *st, comprehension_ty);
 static int symtable_visit_keyword(struct symtable *st, keyword_ty);
 static int symtable_visit_slice(struct symtable *st, slice_ty);
-static int symtable_visit_params(struct symtable *st, asdl_seq *args, int top);
-static int symtable_visit_params_nested(struct symtable *st, asdl_seq *args);
+static int symtable_visit_params(struct symtable *st, asdl_seq *args, int top,
+                                 int annotations);
+static int symtable_visit_params_nested(struct symtable *st, asdl_seq *args,
+                                        int annotations);
 static int symtable_implicit_arg(struct symtable *st, int pos);
+static int symtable_visit_annotations(struct symtable *st, stmt_ty s);
 
 
 static identifier top = NULL, lambda = NULL, genexpr = NULL;
@@ -935,6 +938,8 @@
 		if (s->v.FunctionDef.args->kw_defaults)
 			VISIT_KWONLYDEFAULTS(st, 
 					   s->v.FunctionDef.args->kw_defaults);
+		if (!symtable_visit_annotations(st, s))
+			return 0;
 		if (s->v.FunctionDef.decorators)
 			VISIT_SEQ(st, expr, s->v.FunctionDef.decorators);
 		if (!symtable_enter_block(st, s->v.FunctionDef.name, 
@@ -1219,22 +1224,29 @@
 }
 
 static int 
-symtable_visit_params(struct symtable *st, asdl_seq *args, int toplevel)
+symtable_visit_params(struct symtable *st, asdl_seq *args, int toplevel,
+                      int annotations)
 {
 	int i;
+
+	if (!args)
+		return -1;
 	
         /* go through all the toplevel arguments first */
 	for (i = 0; i < asdl_seq_LEN(args); i++) {
-		expr_ty arg = (expr_ty)asdl_seq_GET(args, i);
-		if (arg->kind == Name_kind) {
-			assert(arg->v.Name.ctx == Param ||
-                               (arg->v.Name.ctx == Store && !toplevel));
-			if (!symtable_add_def(st, arg->v.Name.id, DEF_PARAM))
-				return 0;
+		arg_ty arg = (arg_ty)asdl_seq_GET(args, i);
+		if (arg->kind == SimpleArg_kind) {
+			if (!annotations) {
+				if (!symtable_add_def(st,
+				                      arg->v.SimpleArg.arg,
+				                      DEF_PARAM))
+					return 0;
+			}
+			else if (arg->v.SimpleArg.annotation)
+				VISIT(st, expr, arg->v.SimpleArg.annotation);
 		}
-		else if (arg->kind == Tuple_kind) {
-			assert(arg->v.Tuple.ctx == Store);
-			if (toplevel) {
+		else if (arg->kind == NestedArgs_kind) {
+			if (toplevel && !annotations) {
 				if (!symtable_implicit_arg(st, i))
 					return 0;
 			}
@@ -1249,7 +1261,7 @@
 	}
 
 	if (!toplevel) {
-		if (!symtable_visit_params_nested(st, args))
+		if (!symtable_visit_params_nested(st, args, annotations))
 			return 0;
 	}
 
@@ -1257,16 +1269,37 @@
 }
 
 static int
-symtable_visit_params_nested(struct symtable *st, asdl_seq *args)
+symtable_visit_params_nested(struct symtable *st, asdl_seq *args,
+                             int annotations)
 {
 	int i;
 	for (i = 0; i < asdl_seq_LEN(args); i++) {
-		expr_ty arg = (expr_ty)asdl_seq_GET(args, i);
-		if (arg->kind == Tuple_kind &&
-		    !symtable_visit_params(st, arg->v.Tuple.elts, 0))
+		arg_ty arg = (arg_ty)asdl_seq_GET(args, i);
+		if (arg->kind == NestedArgs_kind &&
+		    !symtable_visit_params(st, arg->v.NestedArgs.args, 0,
+		                           annotations))
 			return 0;
 	}
+
+	return 1;
+}
+
+
+static int
+symtable_visit_annotations(struct symtable *st, stmt_ty s)
+{
+	arguments_ty a = s->v.FunctionDef.args;
 	
+	if (a->args && !symtable_visit_params(st, a->args, 1, 1))
+		return 0;
+	if (a->varargannotation)
+		VISIT(st, expr, a->varargannotation);
+	if (a->kwargannotation)
+		VISIT(st, expr, a->kwargannotation);
+	if (a->kwonlyargs && !symtable_visit_params(st, a->kwonlyargs, 1, 1))
+		return 0;
+	if (s->v.FunctionDef.returns)
+		VISIT(st, expr, s->v.FunctionDef.returns);
 	return 1;
 }
 
@@ -1276,9 +1309,9 @@
 	/* skip default arguments inside function block
 	   XXX should ast be different?
 	*/
-	if (a->args && !symtable_visit_params(st, a->args, 1))
+	if (a->args && !symtable_visit_params(st, a->args, 1, 0))
 		return 0;
-	if (a->kwonlyargs && !symtable_visit_params(st, a->kwonlyargs, 1))
+	if (a->kwonlyargs && !symtable_visit_params(st, a->kwonlyargs, 1, 0))
 		return 0;
 	if (a->vararg) {
 		if (!symtable_add_def(st, a->vararg, DEF_PARAM))
@@ -1290,7 +1323,7 @@
 			return 0;
 		st->st_cur->ste_varkeywords = 1;
 	}
-	if (a->args && !symtable_visit_params_nested(st, a->args))
+	if (a->args && !symtable_visit_params_nested(st, a->args, 0))
 		return 0;
 	return 1;
 }

Modified: python/branches/p3yk-noslice/Python/sysmodule.c
==============================================================================
--- python/branches/p3yk-noslice/Python/sysmodule.c	(original)
+++ python/branches/p3yk-noslice/Python/sysmodule.c	Thu Jan 11 00:21:28 2007
@@ -264,6 +264,32 @@
 
 #endif
 
+
+static PyObject *
+sys_intern(PyObject *self, PyObject *args)
+{
+	PyObject *s;
+	if (!PyArg_ParseTuple(args, "S:intern", &s))
+		return NULL;
+	if (!PyString_CheckExact(s)) {
+		PyErr_SetString(PyExc_TypeError,
+				"can't intern subclass of string");
+		return NULL;
+	}
+	Py_INCREF(s);
+	PyString_InternInPlace(&s);
+	return s;
+}
+
+PyDoc_STRVAR(intern_doc,
+"intern(string) -> string\n\
+\n\
+``Intern'' the given string.  This enters the string in the (global)\n\
+table of interned strings whose purpose is to speed up dictionary lookups.\n\
+Return the string itself or the previously interned string object with the\n\
+same value.");
+
+
 /*
  * Cached interned string objects used for calling the profile and
  * trace functions.  Initialized by trace_init().
@@ -772,6 +798,7 @@
 	{"getwindowsversion", (PyCFunction)sys_getwindowsversion, METH_NOARGS,
 	 getwindowsversion_doc},
 #endif /* MS_WINDOWS */
+ 	{"intern",	sys_intern,     METH_VARARGS, intern_doc},
 #ifdef USE_MALLOPT
 	{"mdebug",	sys_mdebug, METH_VARARGS},
 #endif

Modified: python/branches/p3yk-noslice/README
==============================================================================
--- python/branches/p3yk-noslice/README	(original)
+++ python/branches/p3yk-noslice/README	Thu Jan 11 00:21:28 2007
@@ -1,7 +1,8 @@
 This is Python 3000 -- unversioned (branched off 2.5 in various beta stages)
 =================================================================
 
-Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006 Python Software Foundation.
+Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007 
+Python Software Foundation.
 All rights reserved.
 
 Copyright (c) 2000 BeOpen.com.

Modified: python/branches/p3yk-noslice/Tools/compiler/ast.txt
==============================================================================
--- python/branches/p3yk-noslice/Tools/compiler/ast.txt	(original)
+++ python/branches/p3yk-noslice/Tools/compiler/ast.txt	Thu Jan 11 00:21:28 2007
@@ -12,8 +12,11 @@
 Module: doc*, node
 Stmt: nodes!
 Decorators: nodes!
-Function: decorators&, name*, argnames*, defaults!, kwonlyargs*, flags*, doc*, code
-Lambda: argnames*, defaults!, kwonlyargs*, flags*, code
+Function: decorators&, name*, arguments!, defaults!, kwonlyargs!, returns&, flags*, doc*, code
+Lambda: arguments!, defaults!, kwonlyargs!, flags*, code
+SimpleArg: name*, annotation&
+NestedArgs: args!
+Kwarg: arg, expr
 Class: name*, bases!, doc*, code
 Pass: 
 Break: 
@@ -93,9 +96,10 @@
         self.varargs = 1
     if flags & CO_VARKEYWORDS:
         self.kwargs = 1
+    self.returns = None
 
 init(GenExpr):
-    self.argnames = ['.0']
+    self.arguments = [SimpleArg('.0', None)]
     self.varargs = self.kwargs = None
     self.kwonlyargs = ()
 

Modified: python/branches/p3yk-noslice/Tools/compiler/astgen.py
==============================================================================
--- python/branches/p3yk-noslice/Tools/compiler/astgen.py	(original)
+++ python/branches/p3yk-noslice/Tools/compiler/astgen.py	Thu Jan 11 00:21:28 2007
@@ -266,7 +266,10 @@
         pass # implemented by subclasses
 
 class EmptyNode(Node):
-    pass
+    def getChildNodes(self):
+        return ()
+    def getChildren(self):
+        return ()
 
 class Expression(Node):
     # Expression is an artificial node class to support "eval"

Modified: python/branches/p3yk-noslice/Tools/pybench/Strings.py
==============================================================================
--- python/branches/p3yk-noslice/Tools/pybench/Strings.py	(original)
+++ python/branches/p3yk-noslice/Tools/pybench/Strings.py	Thu Jan 11 00:21:28 2007
@@ -1,5 +1,6 @@
 from pybench import Test
 from string import join
+import sys
 
 class ConcatStrings(Test):
 
@@ -174,7 +175,7 @@
     def test(self):
 
         # Make sure the strings *are* interned
-        s = intern(join(map(str,range(10))))
+        s = sys.intern(join(map(str,range(10))))
         t = s
 
         for i in xrange(self.rounds):
@@ -240,7 +241,7 @@
 
     def calibrate(self):
 
-        s = intern(join(map(str,range(10))))
+        s = sys.intern(join(map(str,range(10))))
         t = s
 
         for i in xrange(self.rounds):

Modified: python/branches/p3yk-noslice/Tools/scripts/fixdiv.py
==============================================================================
--- python/branches/p3yk-noslice/Tools/scripts/fixdiv.py	(original)
+++ python/branches/p3yk-noslice/Tools/scripts/fixdiv.py	Thu Jan 11 00:21:28 2007
@@ -198,7 +198,7 @@
         list = warnings.get(filename)
         if list is None:
             warnings[filename] = list = []
-        list.append((int(lineno), intern(what)))
+        list.append((int(lineno), sys.intern(what)))
     f.close()
     return warnings
 

Modified: python/branches/p3yk-noslice/setup.py
==============================================================================
--- python/branches/p3yk-noslice/setup.py	(original)
+++ python/branches/p3yk-noslice/setup.py	Thu Jan 11 00:21:28 2007
@@ -606,7 +606,7 @@
         # a release.  Most open source OSes come with one or more
         # versions of BerkeleyDB already installed.
 
-        max_db_ver = (4, 4)
+        max_db_ver = (4, 5)
         min_db_ver = (3, 3)
         db_setup_debug = False   # verbose debug prints from this script?
 
@@ -623,7 +623,7 @@
             '/sw/include/db3',
         ]
         # 4.x minor number specific paths
-        for x in (0,1,2,3,4):
+        for x in (0,1,2,3,4,5):
             db_inc_paths.append('/usr/include/db4%d' % x)
             db_inc_paths.append('/usr/include/db4.%d' % x)
             db_inc_paths.append('/usr/local/BerkeleyDB.4.%d/include' % x)
@@ -631,7 +631,7 @@
             db_inc_paths.append('/pkg/db-4.%d/include' % x)
             db_inc_paths.append('/opt/db-4.%d/include' % x)
         # 3.x minor number specific paths
-        for x in (2,3):
+        for x in (3,):
             db_inc_paths.append('/usr/include/db3%d' % x)
             db_inc_paths.append('/usr/local/BerkeleyDB.3.%d/include' % x)
             db_inc_paths.append('/usr/local/include/db3%d' % x)


More information about the Python-checkins mailing list