From python-checkins at python.org Wed Oct 1 00:24:48 2008 From: python-checkins at python.org (thomas.lee) Date: Wed, 1 Oct 2008 00:24:48 +0200 (CEST) Subject: [Python-checkins] r66706 - in python/branches/tlee-ast-optimize: Demo/turtle/turtleDemo.py Doc/Makefile Doc/README.txt Doc/c-api/number.rst Doc/c-api/object.rst Doc/howto/cporting.rst Doc/howto/index.rst Doc/howto/urllib2.rst Doc/library/2to3.rst Doc/library/autogil.rst Doc/library/ctypes.rst Doc/library/json.rst Doc/library/multiprocessing.rst Doc/library/optparse.rst Doc/library/os.rst Doc/library/platform.rst Doc/library/random.rst Doc/library/select.rst Doc/library/site.rst Doc/library/socket.rst Doc/library/subprocess.rst Doc/library/turtle.rst Doc/library/unittest.rst Doc/reference/expressions.rst Doc/reference/simple_stmts.rst Doc/tools/sphinxext/download.html Doc/using/windows.rst Doc/whatsnew/2.6.rst Include/pystrcmp.h Lib/bsddb/test/test_basics.py Lib/collections.py Lib/ctypes/test/test_bitfields.py Lib/distutils/tests/test_build_ext.py Lib/ftplib.py Lib/lib-tk/turtle.py Lib/lib2to3 Lib/lib2to3/main.py Lib/lib2to3/refactor.py Lib/lib2to3/tests/data/fixers Lib/lib2to3/tests/test_refactor.py Lib/multiprocessing/dummy/__init__.py Lib/multiprocessing/synchronize.py Lib/ssl.py Lib/test/regrtest.py Lib/test/string_tests.py Lib/test/test_atexit.py Lib/test/test_collections.py Lib/test/test_cprofile.py Lib/test/test_file.py Lib/test/test_ftplib.py Lib/test/test_imageop.py Lib/test/test_io.py Lib/test/test_lib2to3.py Lib/test/test_multiprocessing.py Lib/test/test_ssl.py Lib/test/test_tarfile.py Lib/test/test_urllib.py Lib/urllib.py Misc/NEWS Modules/Setup.dist Modules/_bsddb.c Modules/_bytesio.c Modules/_ctypes/cfield.c Modules/_fileio.c Modules/_lsprof.c Modules/_struct.c Modules/bsddb.h Modules/imageop.c Modules/selectmodule.c Objects/fileobject.c Objects/floatobject.c Objects/obmalloc.c Objects/stringlib/count.h Objects/stringlib/find.h PC/os2emx/Makefile PC/os2emx/config.c PC/os2emx/pyconfig.h PCbuild/readme.txt Python/pymath.c setup.py Message-ID: <20080930222448.A057B1E4007@bag.python.org> Author: thomas.lee Date: Wed Oct 1 00:24:45 2008 New Revision: 66706 Log: Merged revisions 66521-66699 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ................ r66523 | georg.brandl | 2008-09-21 17:14:44 +1000 (Sun, 21 Sep 2008) | 2 lines #3852: fix some select.kqueue and kevent docs. ................ r66524 | georg.brandl | 2008-09-21 17:15:59 +1000 (Sun, 21 Sep 2008) | 2 lines #3912: document default for *places* arg. ................ r66525 | georg.brandl | 2008-09-21 17:17:00 +1000 (Sun, 21 Sep 2008) | 2 lines #3916: fixes for docs wrt. Windows directory layout ................ r66526 | georg.brandl | 2008-09-21 17:18:28 +1000 (Sun, 21 Sep 2008) | 2 lines #3914: add //= to the augmented assign operators. ................ r66529 | georg.brandl | 2008-09-21 17:24:11 +1000 (Sun, 21 Sep 2008) | 2 lines #3901: bsddb fix. ................ r66530 | georg.brandl | 2008-09-21 17:31:52 +1000 (Sun, 21 Sep 2008) | 2 lines #3897: _collections now has an underscore. ................ r66532 | georg.brandl | 2008-09-21 17:36:22 +1000 (Sun, 21 Sep 2008) | 2 lines Update readme and Makefile (web builder doesn't exist). ................ r66535 | georg.brandl | 2008-09-21 18:03:21 +1000 (Sun, 21 Sep 2008) | 2 lines #3918: note that uniform() args can be swapped. ................ r66538 | georg.brandl | 2008-09-21 20:03:39 +1000 (Sun, 21 Sep 2008) | 2 lines Add "dist" target. ................ r66539 | hirokazu.yamamoto | 2008-09-21 21:44:23 +1000 (Sun, 21 Sep 2008) | 2 lines Issue #3838: TarFile object assigned to self.tar should be closed explicitly. Reviewed by Lars Gust?bel. ................ r66542 | hirokazu.yamamoto | 2008-09-22 06:48:41 +1000 (Mon, 22 Sep 2008) | 2 lines Issue #3925: Ignores shutil.rmtree error on cygwin too. Reviewed by Benjamin Peterson. ................ r66544 | benjamin.peterson | 2008-09-22 07:27:51 +1000 (Mon, 22 Sep 2008) | 4 lines #3879 fix a regression in urllib.getproxies_environment reviewers: Benjamin, Georg ................ r66546 | georg.brandl | 2008-09-22 08:31:59 +1000 (Mon, 22 Sep 2008) | 2 lines Fill out download page. ................ r66552 | andrew.macintyre | 2008-09-23 00:10:54 +1000 (Tue, 23 Sep 2008) | 5 lines should use macro'ed symbols not direct Part of source_os2emx.patch in issue 3868 Reviewed by Amaury Forgeot d'Arc ................ r66553 | andrew.macintyre | 2008-09-23 00:11:41 +1000 (Tue, 23 Sep 2008) | 5 lines any platform without HAVE_LOG1P should have DBL_EPSILON in Part of source_os2emx.patch in issue 3868 Reviewed by Amaury Forgeot d'Arc ................ r66554 | andrew.macintyre | 2008-09-23 00:23:45 +1000 (Tue, 23 Sep 2008) | 8 lines build_os2emx.patch in issue 3868 - update OS/2 EMX makefile and config files Part of source_os2emx.patch in issue 3868: Include/pystrcmp.h: OS/2 has same C APIs as Windows Lib/test/test_io.py: OS/2 has same behaviour as Windows for this test Reviewed by Amaury Forgeot d'Arc ................ r66557 | benjamin.peterson | 2008-09-23 07:11:43 +1000 (Tue, 23 Sep 2008) | 1 line use the new threading properties for multiprocessing (reviewed by Jesse #3927) ................ r66561 | benjamin.peterson | 2008-09-23 08:13:29 +1000 (Tue, 23 Sep 2008) | 1 line clean up docs for platform's linux_distribution and dist functions ................ r66564 | benjamin.peterson | 2008-09-23 23:32:46 +1000 (Tue, 23 Sep 2008) | 1 line mention how to override boolean evaluation ................ r66566 | hirokazu.yamamoto | 2008-09-24 02:11:09 +1000 (Wed, 24 Sep 2008) | 2 lines Issue #3945: Fixed compile error on cygwin. (initializer element is not constant) Reviewed by Amaury Forgeot d'Arc. ................ r66568 | jesus.cea | 2008-09-24 04:54:08 +1000 (Wed, 24 Sep 2008) | 5 lines Bugfix for issue3885 and 'DB.verify()' crash. Reviewed by Nick Coghlan. ................ r66569 | benjamin.peterson | 2008-09-24 06:43:09 +1000 (Wed, 24 Sep 2008) | 1 line backport the atexit test for r66563 ................ r66580 | georg.brandl | 2008-09-24 19:47:55 +1000 (Wed, 24 Sep 2008) | 2 lines Indentation normalization. ................ r66610 | andrew.kuchling | 2008-09-25 03:27:55 +1000 (Thu, 25 Sep 2008) | 1 line Improve wording ................ r66611 | thomas.heller | 2008-09-25 04:26:05 +1000 (Thu, 25 Sep 2008) | 3 lines Fix issue #3547: ctypes is confused by bitfields of varying integer types Reviewed by Fredrik Lundh and Skip Montanaro. ................ r66614 | benjamin.peterson | 2008-09-25 08:11:59 +1000 (Thu, 25 Sep 2008) | 4 lines #3950 fix missing scale factors in turtle.py reviewers: Georg, Benjamin ................ r66616 | martin.v.loewis | 2008-09-25 14:12:50 +1000 (Thu, 25 Sep 2008) | 2 lines Bug #3951: Py_USING_MEMORY_DEBUGGER should not be enabled by default. ................ r66618 | benjamin.peterson | 2008-09-26 06:35:45 +1000 (Fri, 26 Sep 2008) | 1 line add a NEWs entry for r66614 ................ r66620 | amaury.forgeotdarc | 2008-09-26 06:52:56 +1000 (Fri, 26 Sep 2008) | 5 lines #3965: on Windows, open() crashes if the filename or the mode is invalid, and if the filename is a unicode string. Reviewed by Martin von Loewis. ................ r66624 | raymond.hettinger | 2008-09-26 09:31:52 +1000 (Fri, 26 Sep 2008) | 1 line Fix namedtuple bug reported by Glenn Linderman. Template did not form correctly if the field names were input in Unicode. ................ r66625 | benjamin.peterson | 2008-09-26 12:58:36 +1000 (Fri, 26 Sep 2008) | 1 line add the beginnings of a C-API 2 -> 3 porting guide ................ r66628 | benjamin.peterson | 2008-09-27 06:52:06 +1000 (Sat, 27 Sep 2008) | 1 line add an 'other options' section ................ r66629 | georg.brandl | 2008-09-27 07:15:21 +1000 (Sat, 27 Sep 2008) | 2 lines typos. ................ r66631 | amaury.forgeotdarc | 2008-09-27 08:34:08 +1000 (Sat, 27 Sep 2008) | 7 lines #3967: Correct a crash in count() and find() methods of string-like objects. For example: "".count("xxxx", sys.maxint, 0) Reviewed by Benjamin Peterson. Will port to 2.5 and 3.0. ................ r66634 | benjamin.peterson | 2008-09-27 12:49:54 +1000 (Sat, 27 Sep 2008) | 7 lines give ftplib a real test suite A asyncore based mock ftp server is used to test the protocol. This is all thanks to Giampaolo Rodola #3939 (Barry gave me permission to do this before final on IRC.) ................ r66643 | andrew.kuchling | 2008-09-28 00:12:33 +1000 (Sun, 28 Sep 2008) | 1 line Add a last bunch of items ................ r66645 | benjamin.peterson | 2008-09-28 02:23:55 +1000 (Sun, 28 Sep 2008) | 1 line 2to3's api should be considered unstable ................ r66653 | benjamin.peterson | 2008-09-28 07:09:10 +1000 (Sun, 28 Sep 2008) | 49 lines Merged revisions 66511,66548-66549,66644,66646-66652 via svnmerge from svn+ssh://pythondev at svn.python.org/sandbox/trunk/2to3/lib2to3 ........ r66511 | benjamin.peterson | 2008-09-18 21:49:27 -0500 (Thu, 18 Sep 2008) | 1 line remove a useless if __name__ == '__main__' ........ r66548 | benjamin.peterson | 2008-09-21 21:14:14 -0500 (Sun, 21 Sep 2008) | 1 line avoid the perils of mutable default arguments ........ r66549 | benjamin.peterson | 2008-09-21 21:26:11 -0500 (Sun, 21 Sep 2008) | 1 line some places in RefactoringTool should raise an error instead of logging it ........ r66644 | benjamin.peterson | 2008-09-27 10:45:10 -0500 (Sat, 27 Sep 2008) | 1 line fix doctest refactoring ........ r66646 | benjamin.peterson | 2008-09-27 11:40:13 -0500 (Sat, 27 Sep 2008) | 1 line don't print to stdout when 2to3 is used as a library ........ r66647 | benjamin.peterson | 2008-09-27 12:28:28 -0500 (Sat, 27 Sep 2008) | 1 line let fixer modules and classes have different prefixes ........ r66648 | benjamin.peterson | 2008-09-27 14:02:13 -0500 (Sat, 27 Sep 2008) | 1 line raise errors when 2to3 is used as a library ........ r66649 | benjamin.peterson | 2008-09-27 14:03:38 -0500 (Sat, 27 Sep 2008) | 1 line fix docstring ........ r66650 | benjamin.peterson | 2008-09-27 14:22:21 -0500 (Sat, 27 Sep 2008) | 1 line make use of enumerate ........ r66651 | benjamin.peterson | 2008-09-27 14:24:13 -0500 (Sat, 27 Sep 2008) | 1 line revert last revision; it breaks things ........ r66652 | benjamin.peterson | 2008-09-27 16:03:06 -0500 (Sat, 27 Sep 2008) | 1 line add tests for lib2to3.refactor ........ ................ r66654 | benjamin.peterson | 2008-09-28 07:12:20 +1000 (Sun, 28 Sep 2008) | 1 line enable refactor tests ................ r66657 | benjamin.peterson | 2008-09-28 08:08:12 +1000 (Sun, 28 Sep 2008) | 1 line backport r66656 so people using -Qnew aren't affected ................ r66660 | andrew.kuchling | 2008-09-28 08:54:08 +1000 (Sun, 28 Sep 2008) | 1 line #3510: future-proof text ................ r66661 | benjamin.peterson | 2008-09-28 09:28:43 +1000 (Sun, 28 Sep 2008) | 1 line clarify a few things ................ r66662 | andrew.kuchling | 2008-09-28 10:15:27 +1000 (Sun, 28 Sep 2008) | 1 line #1579477: mention necessity to flush output before exec'ing ................ r66663 | andrew.kuchling | 2008-09-28 11:08:47 +1000 (Sun, 28 Sep 2008) | 1 line #1415508: Document two functions ................ r66664 | benjamin.peterson | 2008-09-28 11:51:36 +1000 (Sun, 28 Sep 2008) | 1 line better grammar ................ r66665 | benjamin.peterson | 2008-09-28 11:53:29 +1000 (Sun, 28 Sep 2008) | 1 line note the 2to3 -d could be useful for other refactoring ................ r66667 | georg.brandl | 2008-09-28 18:34:31 +1000 (Sun, 28 Sep 2008) | 2 lines No downloads for RCs. ................ r66670 | georg.brandl | 2008-09-29 06:01:36 +1000 (Mon, 29 Sep 2008) | 2 lines Don't show version in title. ................ r66673 | benjamin.peterson | 2008-09-29 06:57:21 +1000 (Mon, 29 Sep 2008) | 1 line merge in the fix for test_ftplib on some bots [reviewed by Georg] ................ r66676 | jesus.cea | 2008-09-29 09:24:19 +1000 (Mon, 29 Sep 2008) | 1 line bsddb4.7.3pre9 renamed to 4.7.3 ................ r66677 | brett.cannon | 2008-09-29 13:41:21 +1000 (Mon, 29 Sep 2008) | 7 lines The _lsprof module could crash the interpreter if it was given an external timer that did not return a float and a timer was still running when the Profiler object was garbage collected. Fixes issue 3895. Code review by Benjamin Peterson. ................ r66681 | georg.brandl | 2008-09-30 02:51:35 +1000 (Tue, 30 Sep 2008) | 2 lines Update nasm location. ................ r66682 | bill.janssen | 2008-09-30 04:56:38 +1000 (Tue, 30 Sep 2008) | 1 line fix for release blocker 3910, 2.6 regression in socket.ssl method ................ r66683 | thomas.heller | 2008-09-30 05:56:24 +1000 (Tue, 30 Sep 2008) | 1 line Fix issue #3547 for MingW, update comments. ................ r66686 | martin.v.loewis | 2008-09-30 08:09:07 +1000 (Tue, 30 Sep 2008) | 5 lines Issue #3965: Allow repeated calls to turtle.Screen, by making it a true singleton object. Reviewed by Gregor Lingl. ................ r66688 | jesse.noller | 2008-09-30 10:15:45 +1000 (Tue, 30 Sep 2008) | 2 lines issue3770: if SEM_OPEN is 0, disable the mp.synchronize module, rev. Nick Coghlan, Damien Miller ................ r66689 | benjamin.peterson | 2008-09-30 11:31:49 +1000 (Tue, 30 Sep 2008) | 5 lines fix security issue 2: imageop's poor validation of arguments could result in segfaults patch by Victor Stinner reviewed by myself and Brett ................ r66693 | benjamin.peterson | 2008-09-30 12:11:07 +1000 (Tue, 30 Sep 2008) | 4 lines Victor Stinner's patches to check the return result of PyLong_Ssize_t reviewed by Amaury ................ r66696 | andrew.kuchling | 2008-09-30 22:31:07 +1000 (Tue, 30 Sep 2008) | 1 line Edits, and add markup ................ r66697 | andrew.kuchling | 2008-09-30 23:00:34 +1000 (Tue, 30 Sep 2008) | 1 line Markup fix ................ r66698 | andrew.kuchling | 2008-09-30 23:00:51 +1000 (Tue, 30 Sep 2008) | 1 line Markup fixes ................ r66699 | andrew.kuchling | 2008-09-30 23:01:46 +1000 (Tue, 30 Sep 2008) | 1 line Markup fixes. (optparse.rst probably needs an entire revision pass.) ................ Added: python/branches/tlee-ast-optimize/Doc/howto/cporting.rst - copied unchanged from r66699, /python/trunk/Doc/howto/cporting.rst python/branches/tlee-ast-optimize/Lib/lib2to3/tests/data/fixers/ - copied from r66699, /python/trunk/Lib/lib2to3/tests/data/fixers/ python/branches/tlee-ast-optimize/Lib/lib2to3/tests/test_refactor.py - copied unchanged from r66699, /python/trunk/Lib/lib2to3/tests/test_refactor.py Modified: python/branches/tlee-ast-optimize/ (props changed) python/branches/tlee-ast-optimize/Demo/turtle/turtleDemo.py python/branches/tlee-ast-optimize/Doc/Makefile python/branches/tlee-ast-optimize/Doc/README.txt python/branches/tlee-ast-optimize/Doc/c-api/number.rst python/branches/tlee-ast-optimize/Doc/c-api/object.rst python/branches/tlee-ast-optimize/Doc/howto/index.rst python/branches/tlee-ast-optimize/Doc/howto/urllib2.rst python/branches/tlee-ast-optimize/Doc/library/2to3.rst python/branches/tlee-ast-optimize/Doc/library/autogil.rst python/branches/tlee-ast-optimize/Doc/library/ctypes.rst python/branches/tlee-ast-optimize/Doc/library/json.rst python/branches/tlee-ast-optimize/Doc/library/multiprocessing.rst python/branches/tlee-ast-optimize/Doc/library/optparse.rst python/branches/tlee-ast-optimize/Doc/library/os.rst python/branches/tlee-ast-optimize/Doc/library/platform.rst python/branches/tlee-ast-optimize/Doc/library/random.rst python/branches/tlee-ast-optimize/Doc/library/select.rst python/branches/tlee-ast-optimize/Doc/library/site.rst python/branches/tlee-ast-optimize/Doc/library/socket.rst python/branches/tlee-ast-optimize/Doc/library/subprocess.rst python/branches/tlee-ast-optimize/Doc/library/turtle.rst python/branches/tlee-ast-optimize/Doc/library/unittest.rst python/branches/tlee-ast-optimize/Doc/reference/expressions.rst python/branches/tlee-ast-optimize/Doc/reference/simple_stmts.rst python/branches/tlee-ast-optimize/Doc/tools/sphinxext/download.html python/branches/tlee-ast-optimize/Doc/using/windows.rst python/branches/tlee-ast-optimize/Doc/whatsnew/2.6.rst python/branches/tlee-ast-optimize/Include/pystrcmp.h python/branches/tlee-ast-optimize/Lib/bsddb/test/test_basics.py python/branches/tlee-ast-optimize/Lib/collections.py python/branches/tlee-ast-optimize/Lib/ctypes/test/test_bitfields.py python/branches/tlee-ast-optimize/Lib/distutils/tests/test_build_ext.py python/branches/tlee-ast-optimize/Lib/ftplib.py python/branches/tlee-ast-optimize/Lib/lib-tk/turtle.py python/branches/tlee-ast-optimize/Lib/lib2to3/ (props changed) python/branches/tlee-ast-optimize/Lib/lib2to3/main.py python/branches/tlee-ast-optimize/Lib/lib2to3/refactor.py python/branches/tlee-ast-optimize/Lib/multiprocessing/dummy/__init__.py python/branches/tlee-ast-optimize/Lib/multiprocessing/synchronize.py python/branches/tlee-ast-optimize/Lib/ssl.py python/branches/tlee-ast-optimize/Lib/test/regrtest.py python/branches/tlee-ast-optimize/Lib/test/string_tests.py python/branches/tlee-ast-optimize/Lib/test/test_atexit.py python/branches/tlee-ast-optimize/Lib/test/test_collections.py python/branches/tlee-ast-optimize/Lib/test/test_cprofile.py python/branches/tlee-ast-optimize/Lib/test/test_file.py python/branches/tlee-ast-optimize/Lib/test/test_ftplib.py python/branches/tlee-ast-optimize/Lib/test/test_imageop.py python/branches/tlee-ast-optimize/Lib/test/test_io.py python/branches/tlee-ast-optimize/Lib/test/test_lib2to3.py python/branches/tlee-ast-optimize/Lib/test/test_multiprocessing.py python/branches/tlee-ast-optimize/Lib/test/test_ssl.py python/branches/tlee-ast-optimize/Lib/test/test_tarfile.py python/branches/tlee-ast-optimize/Lib/test/test_urllib.py python/branches/tlee-ast-optimize/Lib/urllib.py python/branches/tlee-ast-optimize/Misc/NEWS python/branches/tlee-ast-optimize/Modules/Setup.dist python/branches/tlee-ast-optimize/Modules/_bsddb.c python/branches/tlee-ast-optimize/Modules/_bytesio.c python/branches/tlee-ast-optimize/Modules/_ctypes/cfield.c python/branches/tlee-ast-optimize/Modules/_fileio.c python/branches/tlee-ast-optimize/Modules/_lsprof.c python/branches/tlee-ast-optimize/Modules/_struct.c python/branches/tlee-ast-optimize/Modules/bsddb.h python/branches/tlee-ast-optimize/Modules/imageop.c python/branches/tlee-ast-optimize/Modules/selectmodule.c python/branches/tlee-ast-optimize/Objects/fileobject.c python/branches/tlee-ast-optimize/Objects/floatobject.c python/branches/tlee-ast-optimize/Objects/obmalloc.c python/branches/tlee-ast-optimize/Objects/stringlib/count.h python/branches/tlee-ast-optimize/Objects/stringlib/find.h python/branches/tlee-ast-optimize/PC/os2emx/Makefile python/branches/tlee-ast-optimize/PC/os2emx/config.c python/branches/tlee-ast-optimize/PC/os2emx/pyconfig.h python/branches/tlee-ast-optimize/PCbuild/readme.txt python/branches/tlee-ast-optimize/Python/pymath.c python/branches/tlee-ast-optimize/setup.py Modified: python/branches/tlee-ast-optimize/Demo/turtle/turtleDemo.py ============================================================================== --- python/branches/tlee-ast-optimize/Demo/turtle/turtleDemo.py (original) +++ python/branches/tlee-ast-optimize/Demo/turtle/turtleDemo.py Wed Oct 1 00:24:45 2008 @@ -94,8 +94,8 @@ left_frame.pack(side=LEFT, fill=BOTH, expand=0) self.graph_frame = g_frame = Frame(root) - turtle.Screen._root = g_frame - turtle.Screen._canvas = turtle.ScrolledCanvas(g_frame, 800, 600, 1000, 800) + turtle._Screen._root = g_frame + turtle._Screen._canvas = turtle.ScrolledCanvas(g_frame, 800, 600, 1000, 800) #xturtle.Screen._canvas.pack(expand=1, fill="both") self.screen = _s_ = turtle.Screen() self.scanvas = _s_._canvas Modified: python/branches/tlee-ast-optimize/Doc/Makefile ============================================================================== --- python/branches/tlee-ast-optimize/Doc/Makefile (original) +++ python/branches/tlee-ast-optimize/Doc/Makefile Wed Oct 1 00:24:45 2008 @@ -9,22 +9,23 @@ SPHINXOPTS = PAPER = SOURCES = +DISTVERSION = ALLSPHINXOPTS = -b $(BUILDER) -d build/doctrees -D latex_paper_size=$(PAPER) \ $(SPHINXOPTS) . build/$(BUILDER) $(SOURCES) -.PHONY: help checkout update build html web htmlhelp clean coverage +.PHONY: help checkout update build html htmlhelp clean coverage dist help: @echo "Please use \`make ' where is one of" @echo " html to make standalone HTML files" - @echo " web to make file usable by Sphinx.web" @echo " htmlhelp to make HTML files and a HTML help project" @echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter" @echo " text to make plain text files" @echo " changes to make an overview over all changed/added/deprecated items" @echo " linkcheck to check all external links for integrity" @echo " coverage to check documentation coverage for library and C API" + @echo " dist to create a \"dist\" directory with archived docs for download" checkout: @if [ ! -d tools/sphinx ]; then \ @@ -59,12 +60,6 @@ html: build @echo "Build finished. The HTML pages are in build/html." -web: BUILDER = web -web: build - @echo "Build finished; now you can run" - @echo " PYTHONPATH=tools $(PYTHON) -m sphinx.web build/web" - @echo "to start the server." - htmlhelp: BUILDER = htmlhelp htmlhelp: build @echo "Build finished; now you can run HTML Help Workshop with the" \ @@ -105,6 +100,44 @@ htmlview: html $(PYTHON) -c "import webbrowser; webbrowser.open('build/html/index.html')" + clean: -rm -rf build/* -rm -rf tools/sphinx + +dist: + -rm -rf dist + mkdir -p dist + + # archive the HTML + make html + cp -a build/html dist/python$(DISTVERSION)-docs-html + tar -C dist -cf dist/python$(DISTVERSION)-docs-html.tar python$(DISTVERSION)-docs-html + bzip2 -9 -k dist/python$(DISTVERSION)-docs-html.tar + (cd dist; zip -q -r -9 python$(DISTVERSION)-docs-html.zip python$(DISTVERSION)-docs-html) + rm -r dist/python$(DISTVERSION)-docs-html + rm dist/python$(DISTVERSION)-docs-html.tar + + # archive the text build + make text + cp -a build/text dist/python$(DISTVERSION)-docs-text + tar -C dist -cf dist/python$(DISTVERSION)-docs-text.tar python$(DISTVERSION)-docs-text + bzip2 -9 -k dist/python$(DISTVERSION)-docs-text.tar + (cd dist; zip -q -r -9 python$(DISTVERSION)-docs-text.zip python$(DISTVERSION)-docs-text) + rm -r dist/python$(DISTVERSION)-docs-text + rm dist/python$(DISTVERSION)-docs-text.tar + + # archive the A4 latex + -rm -r build/latex + make latex PAPER=a4 + (cd build/latex; make clean && make all-pdf && make FMT=pdf zip bz2) + cp build/latex/docs-pdf.zip dist/python$(DISTVERSION)-docs-pdf-a4.zip + cp build/latex/docs-pdf.tar.bz2 dist/python$(DISTVERSION)-docs-pdf-a4.tar.bz2 + + # archive the letter latex + rm -r build/latex + make latex PAPER=letter + (cd build/latex; make clean && make all-pdf && make FMT=pdf zip bz2) + cp build/latex/docs-pdf.zip dist/python$(DISTVERSION)-docs-pdf-letter.zip + cp build/latex/docs-pdf.tar.bz2 dist/python$(DISTVERSION)-docs-pdf-letter.tar.bz2 + Modified: python/branches/tlee-ast-optimize/Doc/README.txt ============================================================================== --- python/branches/tlee-ast-optimize/Doc/README.txt (original) +++ python/branches/tlee-ast-optimize/Doc/README.txt Wed Oct 1 00:24:45 2008 @@ -38,9 +38,6 @@ * "html", which builds standalone HTML files for offline viewing. - * "web", which builds files usable with the Sphinx.web application (used to - serve the docs online at http://docs.python.org/). - * "htmlhelp", which builds HTML files and a HTML Help project file usable to convert them into a single Compiled HTML (.chm) file -- these are popular under Microsoft Windows, but very handy on every platform. Modified: python/branches/tlee-ast-optimize/Doc/c-api/number.rst ============================================================================== --- python/branches/tlee-ast-optimize/Doc/c-api/number.rst (original) +++ python/branches/tlee-ast-optimize/Doc/c-api/number.rst Wed Oct 1 00:24:45 2008 @@ -285,7 +285,7 @@ .. cfunction:: PyObject* PyNumber_Index(PyObject *o) Returns the *o* converted to a Python int or long on success or *NULL* with a - TypeError exception raised on failure. + :exc:`TypeError` exception raised on failure. .. versionadded:: 2.5 Modified: python/branches/tlee-ast-optimize/Doc/c-api/object.rst ============================================================================== --- python/branches/tlee-ast-optimize/Doc/c-api/object.rst (original) +++ python/branches/tlee-ast-optimize/Doc/c-api/object.rst Wed Oct 1 00:24:45 2008 @@ -279,7 +279,7 @@ .. cfunction:: long PyObject_HashNotImplemented(PyObject *o) - Set a TypeError indicating that ``type(o)`` is not hashable and return ``-1``. + Set a :exc:`TypeError` indicating that ``type(o)`` is not hashable and return ``-1``. This function receives special treatment when stored in a ``tp_hash`` slot, allowing a type to explicitly indicate to the interpreter that it is not hashable. Modified: python/branches/tlee-ast-optimize/Doc/howto/index.rst ============================================================================== --- python/branches/tlee-ast-optimize/Doc/howto/index.rst (original) +++ python/branches/tlee-ast-optimize/Doc/howto/index.rst Wed Oct 1 00:24:45 2008 @@ -14,6 +14,7 @@ :maxdepth: 1 advocacy.rst + cporting.rst curses.rst doanddont.rst functional.rst Modified: python/branches/tlee-ast-optimize/Doc/howto/urllib2.rst ============================================================================== --- python/branches/tlee-ast-optimize/Doc/howto/urllib2.rst (original) +++ python/branches/tlee-ast-optimize/Doc/howto/urllib2.rst Wed Oct 1 00:24:45 2008 @@ -182,11 +182,12 @@ Handling Exceptions =================== -*urlopen* raises ``URLError`` when it cannot handle a response (though as usual -with Python APIs, builtin exceptions such as ValueError, TypeError etc. may also +*urlopen* raises :exc:`URLError` when it cannot handle a response (though as usual +with Python APIs, builtin exceptions such as +:exc:`ValueError`, :exc:`TypeError` etc. may also be raised). -``HTTPError`` is the subclass of ``URLError`` raised in the specific case of +:exc:`HTTPError` is the subclass of :exc:`URLError` raised in the specific case of HTTP URLs. URLError @@ -215,12 +216,12 @@ default handlers will handle some of these responses for you (for example, if the response is a "redirection" that requests the client fetch the document from a different URL, urllib2 will handle that for you). For those it can't handle, -urlopen will raise an ``HTTPError``. Typical errors include '404' (page not +urlopen will raise an :exc:`HTTPError`. Typical errors include '404' (page not found), '403' (request forbidden), and '401' (authentication required). See section 10 of RFC 2616 for a reference on all the HTTP error codes. -The ``HTTPError`` instance raised will have an integer 'code' attribute, which +The :exc:`HTTPError` instance raised will have an integer 'code' attribute, which corresponds to the error sent by the server. Error Codes @@ -303,7 +304,7 @@ } When an error is raised the server responds by returning an HTTP error code -*and* an error page. You can use the ``HTTPError`` instance as a response on the +*and* an error page. You can use the :exc:`HTTPError` instance as a response on the page returned. This means that as well as the code attribute, it also has read, geturl, and info, methods. :: @@ -325,7 +326,7 @@ Wrapping it Up -------------- -So if you want to be prepared for ``HTTPError`` *or* ``URLError`` there are two +So if you want to be prepared for :exc:`HTTPError` *or* :exc:`URLError` there are two basic approaches. I prefer the second approach. Number 1 @@ -351,7 +352,7 @@ .. note:: The ``except HTTPError`` *must* come first, otherwise ``except URLError`` - will *also* catch an ``HTTPError``. + will *also* catch an :exc:`HTTPError`. Number 2 ~~~~~~~~ @@ -376,8 +377,8 @@ info and geturl =============== -The response returned by urlopen (or the ``HTTPError`` instance) has two useful -methods ``info`` and ``geturl``. +The response returned by urlopen (or the :exc:`HTTPError` instance) has two useful +methods :meth:`info` and :meth:`geturl`. **geturl** - this returns the real URL of the page fetched. This is useful because ``urlopen`` (or the opener object used) may have followed a Modified: python/branches/tlee-ast-optimize/Doc/library/2to3.rst ============================================================================== --- python/branches/tlee-ast-optimize/Doc/library/2to3.rst (original) +++ python/branches/tlee-ast-optimize/Doc/library/2to3.rst Wed Oct 1 00:24:45 2008 @@ -74,7 +74,9 @@ have compliant 3.x code. 2to3 can also refactor doctests. To enable this mode, use the :option:`-d` -flag. Note that *only* doctests will be refactored. +flag. Note that *only* doctests will be refactored. This also doesn't require +the module to be valid Python. For example, doctest like examples in a reST +document could also be refactored with this option. The :option:`-v` option enables the output of more information on the translation process. @@ -95,4 +97,10 @@ .. moduleauthor:: Guido van Rossum .. moduleauthor:: Collin Winter + +.. warning:: + + The :mod:`lib2to3` API should be considered unstable and may change + drastically in the future. + .. XXX What is the public interface anyway? Modified: python/branches/tlee-ast-optimize/Doc/library/autogil.rst ============================================================================== --- python/branches/tlee-ast-optimize/Doc/library/autogil.rst (original) +++ python/branches/tlee-ast-optimize/Doc/library/autogil.rst Wed Oct 1 00:24:45 2008 @@ -15,7 +15,7 @@ .. warning:: - This module is removed in 3.0. + This module has been removed in 3.0. .. exception:: AutoGILError Modified: python/branches/tlee-ast-optimize/Doc/library/ctypes.rst ============================================================================== --- python/branches/tlee-ast-optimize/Doc/library/ctypes.rst (original) +++ python/branches/tlee-ast-optimize/Doc/library/ctypes.rst Wed Oct 1 00:24:45 2008 @@ -1392,7 +1392,7 @@ The *use_last_error* parameter, when set to True, enables the same mechanism for the Windows error code which is managed by the -GetLastError() and SetLastError() Windows api functions; +:func:`GetLastError` and :func:`SetLastError` Windows API functions; `ctypes.get_last_error()` and `ctypes.set_last_error(value)` are used to request and change the ctypes private copy of the windows error code. Modified: python/branches/tlee-ast-optimize/Doc/library/json.rst ============================================================================== --- python/branches/tlee-ast-optimize/Doc/library/json.rst (original) +++ python/branches/tlee-ast-optimize/Doc/library/json.rst Wed Oct 1 00:24:45 2008 @@ -371,9 +371,9 @@ def default(self, o): try: - iterable = iter(o) + iterable = iter(o) except TypeError: - pass + pass else: return list(iterable) return JSONEncoder.default(self, o) Modified: python/branches/tlee-ast-optimize/Doc/library/multiprocessing.rst ============================================================================== --- python/branches/tlee-ast-optimize/Doc/library/multiprocessing.rst (original) +++ python/branches/tlee-ast-optimize/Doc/library/multiprocessing.rst Wed Oct 1 00:24:45 2008 @@ -18,6 +18,13 @@ leverage multiple processors on a given machine. It runs on both Unix and Windows. +.. warning:: + + Some of this package's functionality requires a functioning shared semaphore + implementation on the host operating system. Without one, the + :mod:`multiprocessing.synchronize` module will be disabled, and attempts to + import it will result in an :exc:`ImportError`. See + :issue:`3770` for additional information. The :class:`Process` class ~~~~~~~~~~~~~~~~~~~~~~~~~~ Modified: python/branches/tlee-ast-optimize/Doc/library/optparse.rst ============================================================================== --- python/branches/tlee-ast-optimize/Doc/library/optparse.rst (original) +++ python/branches/tlee-ast-optimize/Doc/library/optparse.rst Wed Oct 1 00:24:45 2008 @@ -602,7 +602,7 @@ programmer errors and user errors. Programmer errors are usually erroneous calls to ``parser.add_option()``, e.g. invalid option strings, unknown option attributes, missing option attributes, etc. These are dealt with in the usual -way: raise an exception (either ``optparse.OptionError`` or ``TypeError``) and +way: raise an exception (either ``optparse.OptionError`` or :exc:`TypeError`) and let the program crash. Handling user errors is much more important, since they are guaranteed to happen @@ -799,10 +799,10 @@ The keyword arguments define attributes of the new Option object. The most important option attribute is :attr:`action`, and it largely determines which other attributes are relevant or required. If you pass irrelevant option -attributes, or fail to pass required ones, :mod:`optparse` raises an OptionError -exception explaining your mistake. +attributes, or fail to pass required ones, :mod:`optparse` raises an +:exc:`OptionError` exception explaining your mistake. -An options's *action* determines what :mod:`optparse` does when it encounters +An option's *action* determines what :mod:`optparse` does when it encounters this option on the command-line. The standard option actions hard-coded into :mod:`optparse` are: @@ -1059,7 +1059,7 @@ The following option attributes may be passed as keyword arguments to ``parser.add_option()``. If you pass an option attribute that is not relevant to a particular option, or fail to pass a required option attribute, -:mod:`optparse` raises OptionError. +:mod:`optparse` raises :exc:`OptionError`. * :attr:`action` (default: ``"store"``) @@ -1152,7 +1152,7 @@ ``choice`` options are a subtype of ``string`` options. The ``choices`` option attribute (a sequence of strings) defines the set of allowed option arguments. ``optparse.check_choice()`` compares user-supplied option arguments against this -master list and raises OptionValueError if an invalid string is given. +master list and raises :exc:`OptionValueError` if an invalid string is given. .. _optparse-parsing-arguments: @@ -1198,22 +1198,37 @@ Querying and manipulating your option parser ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -Sometimes, it's useful to poke around your option parser and see what's there. -OptionParser provides a couple of methods to help you out: - -``has_option(opt_str)`` - Return true if the OptionParser has an option with option string ``opt_str`` - (e.g., ``"-q"`` or ``"--verbose"``). +The default behavior of the option parser can be customized slightly, +and you can also poke around your option parser and see what's there. +OptionParser provides several methods to help you out: + +``disable_interspersed_args()`` + Set parsing to stop on the first non-option. Use this if you have a + command processor which runs another command which has options of + its own and you want to make sure these options don't get + confused. For example, each command might have a different + set of options. + +``enable_interspersed_args()`` + Set parsing to not stop on the first non-option, allowing + interspersing switches with command arguments. For example, + ``"-s arg1 --long arg2"`` would return ``["arg1", "arg2"]`` + as the command arguments and ``-s, --long`` as options. + This is the default behavior. ``get_option(opt_str)`` Returns the Option instance with the option string ``opt_str``, or ``None`` if no options have that option string. +``has_option(opt_str)`` + Return true if the OptionParser has an option with option string ``opt_str`` + (e.g., ``"-q"`` or ``"--verbose"``). + ``remove_option(opt_str)`` - If the OptionParser has an option corresponding to ``opt_str``, that option is + If the :class:`OptionParser` has an option corresponding to ``opt_str``, that option is removed. If that option provided any other option strings, all of those option strings become invalid. If ``opt_str`` does not occur in any option belonging to - this OptionParser, raises ValueError. + this :class:`OptionParser`, raises :exc:`ValueError`. .. _optparse-conflicts-between-options: @@ -1244,13 +1259,13 @@ The available conflict handlers are: ``error`` (default) - assume option conflicts are a programming error and raise OptionConflictError + assume option conflicts are a programming error and raise :exc:`OptionConflictError` ``resolve`` resolve option conflicts intelligently (see below) -As an example, let's define an OptionParser that resolves conflicts +As an example, let's define an :class:`OptionParser` that resolves conflicts intelligently and add conflicting options to it:: parser = OptionParser(conflict_handler="resolve") @@ -1480,7 +1495,7 @@ Raising errors in a callback ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -The callback function should raise OptionValueError if there are any problems +The callback function should raise :exc:`OptionValueError` if there are any problems with the option or its argument(s). :mod:`optparse` catches this and terminates the program, printing the error message you supply to stderr. Your message should be clear, concise, accurate, and mention the option at fault. Otherwise, @@ -1681,9 +1696,9 @@ :meth:`OptionParser.parse_args`, or be passed to a callback as the ``value`` parameter. -Your type-checking function should raise OptionValueError if it encounters any -problems. OptionValueError takes a single string argument, which is passed -as-is to OptionParser's :meth:`error` method, which in turn prepends the program +Your type-checking function should raise :exc:`OptionValueError` if it encounters any +problems. :exc:`OptionValueError` takes a single string argument, which is passed +as-is to :class:`OptionParser`'s :meth:`error` method, which in turn prepends the program name and the string ``"error:"`` and prints everything to stderr before terminating the process. Modified: python/branches/tlee-ast-optimize/Doc/library/os.rst ============================================================================== --- python/branches/tlee-ast-optimize/Doc/library/os.rst (original) +++ python/branches/tlee-ast-optimize/Doc/library/os.rst Wed Oct 1 00:24:45 2008 @@ -1451,7 +1451,13 @@ These functions all execute a new program, replacing the current process; they do not return. On Unix, the new executable is loaded into the current process, and will have the same process id as the caller. Errors will be reported as - :exc:`OSError` exceptions. + :exc:`OSError` exceptions. + + The current process is replaced immediately. Open file objects and + descriptors are not flushed, so if there may be data buffered + on these open files, you should flush them using + :func:`sys.stdout.flush` or :func:`os.fsync` before calling an + :func:`exec\*` function. The "l" and "v" variants of the :func:`exec\*` functions differ in how command-line arguments are passed. The "l" variants are perhaps the easiest @@ -1477,8 +1483,9 @@ used to define the environment variables for the new process (these are used instead of the current process' environment); the functions :func:`execl`, :func:`execlp`, :func:`execv`, and :func:`execvp` all cause the new process to - inherit the environment of the current process. Availability: Unix, - Windows. + inherit the environment of the current process. + + Availability: Unix, Windows. .. function:: _exit(n) Modified: python/branches/tlee-ast-optimize/Doc/library/platform.rst ============================================================================== --- python/branches/tlee-ast-optimize/Doc/library/platform.rst (original) +++ python/branches/tlee-ast-optimize/Doc/library/platform.rst Wed Oct 1 00:24:45 2008 @@ -234,29 +234,23 @@ .. function:: dist(distname='', version='', id='', supported_dists=('SuSE','debian','redhat','mandrake',...)) - Tries to determine the name of the OS distribution name Returns a tuple - ``(distname, version, id)`` which defaults to the args given as parameters. - - ``supported_dists`` may be given to define the set of Linux - distributions to look for. It defaults to a list of currently - supported Linux distributions identified by their release file - name. + This is another name for :func:`linux_distribution`. .. function:: linux_distribution(distname='', version='', id='', supported_dists=('SuSE','debian','redhat','mandrake',...), full_distribution_name=1) Tries to determine the name of the Linux OS distribution name. - ``supported_dists`` may be given to define the set of Linux - distributions to look for. It defaults to a list of currently - supported Linux distributions identified by their release file - name. - - If ``full_distribution_name`` is true (default), the full - distribution read from the OS is returned. Otherwise the short name - taken from ``supported_dists`` is used. - - Returns a tuple ``(distname,version,id)`` which defaults to the - args given as parameters. + ``supported_dists`` may be given to define the set of Linux distributions to + look for. It defaults to a list of currently supported Linux distributions + identified by their release file name. + + If ``full_distribution_name`` is true (default), the full distribution read + from the OS is returned. Otherwise the short name taken from + ``supported_dists`` is used. + + Returns a tuple ``(distname,version,id)`` which defaults to the args given as + parameters. ``id`` is the item in parentheses after the version number. It + is usually the version codename. .. function:: libc_ver(executable=sys.executable, lib='', version='', chunksize=2048) Modified: python/branches/tlee-ast-optimize/Doc/library/random.rst ============================================================================== --- python/branches/tlee-ast-optimize/Doc/library/random.rst (original) +++ python/branches/tlee-ast-optimize/Doc/library/random.rst Wed Oct 1 00:24:45 2008 @@ -188,7 +188,9 @@ .. function:: uniform(a, b) - Return a random floating point number *N* such that ``a <= N < b``. + Return a random floating point number *N* such that ``a <= N < b`` for + ``a <= b`` and ``b <= N < a`` for ``b < a``. + .. function:: triangular(low, high, mode) Modified: python/branches/tlee-ast-optimize/Doc/library/select.rst ============================================================================== --- python/branches/tlee-ast-optimize/Doc/library/select.rst (original) +++ python/branches/tlee-ast-optimize/Doc/library/select.rst Wed Oct 1 00:24:45 2008 @@ -50,7 +50,7 @@ .. versionadded:: 2.6 -.. function:: kqueue(ident, filter=KQ_FILTER_READ, flags=KQ_ADD, fflags=0, data=0, udata=0) +.. function:: kevent(ident, filter=KQ_FILTER_READ, flags=KQ_ADD, fflags=0, data=0, udata=0) (Only supported on BSD.) Returns a kernel event object object; see section :ref:`kevent-objects` below for the methods supported by kqueue objects. @@ -272,12 +272,12 @@ Return the file descriptor number of the control fd. -.. method:: epoll.fromfd(fd) +.. method:: kqueue.fromfd(fd) Create a kqueue object from a given file descriptor. -.. method:: control(changelist, max_events=0[, timeout=None]) -> eventlist +.. method:: kqueue.control(changelist, max_events[, timeout=None]) -> eventlist Low level interface to kevent Modified: python/branches/tlee-ast-optimize/Doc/library/site.rst ============================================================================== --- python/branches/tlee-ast-optimize/Doc/library/site.rst (original) +++ python/branches/tlee-ast-optimize/Doc/library/site.rst Wed Oct 1 00:24:45 2008 @@ -62,10 +62,11 @@ bar -Then the following directories are added to ``sys.path``, in this order:: +Then the following version-specific directories are added to +``sys.path``, in this order:: - /usr/local/lib/python2.6/site-packages/bar - /usr/local/lib/python2.6/site-packages/foo + /usr/local/lib/pythonX.Y/site-packages/bar + /usr/local/lib/pythonX.Y/site-packages/foo Note that :file:`bletch` is omitted because it doesn't exist; the :file:`bar` directory precedes the :file:`foo` directory because :file:`bar.pth` comes Modified: python/branches/tlee-ast-optimize/Doc/library/socket.rst ============================================================================== --- python/branches/tlee-ast-optimize/Doc/library/socket.rst (original) +++ python/branches/tlee-ast-optimize/Doc/library/socket.rst Wed Oct 1 00:24:45 2008 @@ -219,18 +219,18 @@ .. function:: getaddrinfo(host, port[, family[, socktype[, proto[, flags]]]]) Resolves the *host*/*port* argument, into a sequence of 5-tuples that contain - all the necessary argument for the sockets manipulation. *host* is a domain - name, a string representation of IPv4/v6 address or ``None``. *port* is a string - service name (like ``'http'``), a numeric port number or ``None``. + all the necessary arguments for creating the corresponding socket. *host* is a domain + name, a string representation of an IPv4/v6 address or ``None``. *port* is a string + service name such as ``'http'``, a numeric port number or ``None``. + The rest of the arguments are optional and must be numeric if specified. + By passing ``None`` as the value of *host* and *port*, , you can pass ``NULL`` to the C API. - The rest of the arguments are optional and must be numeric if specified. For - *host* and *port*, by passing ``None``, you can pass ``NULL`` to the C API. The :func:`getaddrinfo` function returns a list of 5-tuples with the following structure: ``(family, socktype, proto, canonname, sockaddr)`` - *family*, *socktype*, *proto* are all integer and are meant to be passed to the + *family*, *socktype*, *proto* are all integers and are meant to be passed to the :func:`socket` function. *canonname* is a string representing the canonical name of the *host*. It can be a numeric IPv4/v6 address when :const:`AI_CANONNAME` is specified for a numeric *host*. *sockaddr* is a tuple describing a socket @@ -244,7 +244,7 @@ Return a fully qualified domain name for *name*. If *name* is omitted or empty, it is interpreted as the local host. To find the fully qualified name, the - hostname returned by :func:`gethostbyaddr` is checked, then aliases for the + hostname returned by :func:`gethostbyaddr` is checked, followed by aliases for the host, if available. The first name which includes a period is selected. In case no fully qualified domain name is available, the hostname as returned by :func:`gethostname` is returned. Modified: python/branches/tlee-ast-optimize/Doc/library/subprocess.rst ============================================================================== --- python/branches/tlee-ast-optimize/Doc/library/subprocess.rst (original) +++ python/branches/tlee-ast-optimize/Doc/library/subprocess.rst Wed Oct 1 00:24:45 2008 @@ -138,7 +138,7 @@ .. function:: check_call(*popenargs, **kwargs) Run command with arguments. Wait for command to complete. If the exit code was - zero then return, otherwise raise :exc:`CalledProcessError.` The + zero then return, otherwise raise :exc:`CalledProcessError`. The :exc:`CalledProcessError` object will have the return code in the :attr:`returncode` attribute. Modified: python/branches/tlee-ast-optimize/Doc/library/turtle.rst ============================================================================== --- python/branches/tlee-ast-optimize/Doc/library/turtle.rst (original) +++ python/branches/tlee-ast-optimize/Doc/library/turtle.rst Wed Oct 1 00:24:45 2008 @@ -40,10 +40,10 @@ :class:`ScrolledCanvas` as argument. It should be used when :mod:`turtle` is used as part of some application. - Derived from :class:`TurtleScreen` is the subclass :class:`Screen`. Screen - is implemented as sort of singleton, so there can exist only one instance of - Screen at a time. It should be used when :mod:`turtle` is used as a - standalone tool for doing graphics. + The function :func:`Screen` returns a singleton object of a + :class:`TurtleScreen` subclass. This function should be used when + :mod:`turtle` is used as a standalone tool for doing graphics. + As a singleton object, inheriting from its class is not possible. All methods of TurtleScreen/Screen also exist as functions, i.e. as part of the procedure-oriented interface. Modified: python/branches/tlee-ast-optimize/Doc/library/unittest.rst ============================================================================== --- python/branches/tlee-ast-optimize/Doc/library/unittest.rst (original) +++ python/branches/tlee-ast-optimize/Doc/library/unittest.rst Wed Oct 1 00:24:45 2008 @@ -595,7 +595,8 @@ TestCase.failUnlessAlmostEqual(first, second[, places[, msg]]) Test that *first* and *second* are approximately equal by computing the - difference, rounding to the given number of *places*, and comparing to zero. + difference, rounding to the given number of decimal *places* (default 7), + and comparing to zero. Note that comparing a given number of decimal places is not the same as comparing a given number of significant digits. If the values do not compare equal, the test will fail with the explanation given by *msg*, or :const:`None`. @@ -605,7 +606,8 @@ TestCase.failIfAlmostEqual(first, second[, places[, msg]]) Test that *first* and *second* are not approximately equal by computing the - difference, rounding to the given number of *places*, and comparing to zero. + difference, rounding to the given number of decimal *places* (default 7), + and comparing to zero. Note that comparing a given number of decimal places is not the same as comparing a given number of significant digits. If the values do not compare equal, the test will fail with the explanation given by *msg*, or :const:`None`. Modified: python/branches/tlee-ast-optimize/Doc/reference/expressions.rst ============================================================================== --- python/branches/tlee-ast-optimize/Doc/reference/expressions.rst (original) +++ python/branches/tlee-ast-optimize/Doc/reference/expressions.rst Wed Oct 1 00:24:45 2008 @@ -1143,7 +1143,8 @@ control flow statements, the following values are interpreted as false: ``False``, ``None``, numeric zero of all types, and empty strings and containers (including strings, tuples, lists, dictionaries, sets and frozensets). All -other values are interpreted as true. +other values are interpreted as true. (See the :meth:`~object.__nonzero__` +special method for a way to change this.) .. index:: operator: not Modified: python/branches/tlee-ast-optimize/Doc/reference/simple_stmts.rst ============================================================================== --- python/branches/tlee-ast-optimize/Doc/reference/simple_stmts.rst (original) +++ python/branches/tlee-ast-optimize/Doc/reference/simple_stmts.rst Wed Oct 1 00:24:45 2008 @@ -229,7 +229,7 @@ .. productionlist:: augmented_assignment_stmt: `target` `augop` (`expression_list` | `yield_expression`) - augop: "+=" | "-=" | "*=" | "/=" | "%=" | "**=" + augop: "+=" | "-=" | "*=" | "/=" | "//=" | "%=" | "**=" : | ">>=" | "<<=" | "&=" | "^=" | "|=" (See section :ref:`primaries` for the syntax definitions for the last three Modified: python/branches/tlee-ast-optimize/Doc/tools/sphinxext/download.html ============================================================================== --- python/branches/tlee-ast-optimize/Doc/tools/sphinxext/download.html (original) +++ python/branches/tlee-ast-optimize/Doc/tools/sphinxext/download.html Wed Oct 1 00:24:45 2008 @@ -1,21 +1,43 @@ {% extends "layout.html" %} {% set title = 'Download' %} +{% set dlbase = 'http://docs.python.org/ftp/python/doc/' + release %} {% block body %} -

Download Python {{ release }} Documentation - {%- if last_updated %} (last updated on {{ last_updated }}){% endif %}

+

Download Python {{ release }} Documentation

-

Currently, the development documentation isn't packaged for download.

+{% if 'a' in release or 'b' in release or 'c' in release %} +

We don't package the documentation for development releases for download. + Downloads will be available for the final release.

+ +{% else %} +{% if last_updated %}

Last updated on: {{ last_updated }}.

{% endif %} - +{% endif %} {% endblock %} Modified: python/branches/tlee-ast-optimize/Doc/using/windows.rst ============================================================================== --- python/branches/tlee-ast-optimize/Doc/using/windows.rst (original) +++ python/branches/tlee-ast-optimize/Doc/using/windows.rst Wed Oct 1 00:24:45 2008 @@ -142,7 +142,7 @@ entries. An example variable could look like this (assuming the first two entries are Windows' default):: - C:\WINNT\system32;C:\WINNT;C:\Python25 + C:\WINDOWS\system32;C:\WINDOWS;C:\Python25 Typing :command:`python` on your command prompt will now fire up the Python interpreter. Thus, you can also execute your scripts with command line options, @@ -278,11 +278,11 @@ +====================+==============+=======================+ | :file:`PC/VC6/` | 6.0 | 97 | +--------------------+--------------+-----------------------+ -| :file:`PCbuild/` | 7.1 | 2003 | +| :file:`PC/VS7.1/` | 7.1 | 2003 | +--------------------+--------------+-----------------------+ -| :file:`PCbuild8/` | 8.0 | 2005 | +| :file:`PC/VS8.0/` | 8.0 | 2005 | +--------------------+--------------+-----------------------+ -| :file:`PCbuild9/` | 9.0 | 2008 | +| :file:`PCbuild/` | 9.0 | 2008 | +--------------------+--------------+-----------------------+ Note that not all of these build directories are fully supported. Read the Modified: python/branches/tlee-ast-optimize/Doc/whatsnew/2.6.rst ============================================================================== --- python/branches/tlee-ast-optimize/Doc/whatsnew/2.6.rst (original) +++ python/branches/tlee-ast-optimize/Doc/whatsnew/2.6.rst Wed Oct 1 00:24:45 2008 @@ -1806,8 +1806,11 @@ is now available as a standalone package. The web page for the package is `www.jcea.es/programacion/pybsddb.htm `__. + The plan is to remove the package from the standard library + in Python 3.0, because its pace of releases is much more frequent than + Python's. -* The :mod:`bsddb.dbshelve` module now uses the highest pickling protocol + The :mod:`bsddb.dbshelve` module now uses the highest pickling protocol available, instead of restricting itself to protocol 1. (Contributed by W. Barnes; :issue:`1551443`.) @@ -1817,6 +1820,12 @@ "/cgi-bin/add.py?category=1". (Contributed by Alexandre Fiori and Nubis; :issue:`1817`.) + The :func:`parse_qs` and :func:`parse_qsl` functions have been + relocated from the :mod:`cgi` module to the :mod:`urlparse` module. + The versions still available in the :mod:`cgi` module will + trigger :exc:`PendingDeprecationWarning` messages in 2.6 + (:issue:`600362`). + * The :mod:`cmath` module underwent extensive revision, contributed by Mark Dickinson and Christian Heimes. Five new functions were added: @@ -1900,6 +1909,11 @@ (Contributed by Raymond Hettinger.) +* The :mod:`Cookie` module's :class:`Morsel` objects now support an + :attr:`httponly` attribute. In some browsers. cookies with this attribute + set cannot be accessed or manipulated by JavaScript code. + (Contributed by Arvin Schnell; :issue:`1638033`.) + * A new window method in the :mod:`curses` module, :meth:`chgat`, changes the display attributes for a certain number of characters on a single line. (Contributed by Fabian Kreutz.) :: @@ -2498,8 +2512,9 @@ ``with tempfile.NamedTemporaryFile() as tmp: ...``. (Contributed by Alexander Belopolsky; :issue:`2021`.) -* The :mod:`test.test_support` module now contains an - :func:`EnvironmentVarGuard` +* The :mod:`test.test_support` module gained a number + of context managers useful for writing tests. + :func:`EnvironmentVarGuard` is a context manager that temporarily changes environment variables and automatically restores them to their old values. @@ -2514,6 +2529,16 @@ f = urllib.urlopen('https://sf.net') ... + Finally, :func:`check_warnings` resets the :mod:`warning` module's + warning filters and returns an object that will record all warning + messages triggered (:issue:`3781`):: + + with test_support.check_warnings() as wrec: + warnings.simplefilter("always") + ... code that triggers a warning ... + assert str(wrec.message) == "function is outdated" + assert len(wrec.warnings) == 1, "Multiple warnings raised" + (Contributed by Brett Cannon.) * The :mod:`textwrap` module can now preserve existing whitespace @@ -2600,11 +2625,19 @@ (Added by Facundo Batista.) +* The Unicode database provided by the :mod:`unicodedata` module + has been updated to version 5.1.0. (Updated by + Martin von Loewis; :issue:`3811`.) + * The :mod:`warnings` module's :func:`formatwarning` and :func:`showwarning` gained an optional *line* argument that can be used to supply the line of source code. (Added as part of :issue:`1631171`, which re-implemented part of the :mod:`warnings` module in C code.) + A new function, :func:`catch_warnings`, is a context manager + intended for testing purposes that lets you temporarily modify the + warning filters and then restore their original values (:issue:`3781`). + * The XML-RPC :class:`SimpleXMLRPCServer` and :class:`DocXMLRPCServer` classes can now be prevented from immediately opening and binding to their socket by passing True as the ``bind_and_activate`` Modified: python/branches/tlee-ast-optimize/Include/pystrcmp.h ============================================================================== --- python/branches/tlee-ast-optimize/Include/pystrcmp.h (original) +++ python/branches/tlee-ast-optimize/Include/pystrcmp.h Wed Oct 1 00:24:45 2008 @@ -8,7 +8,7 @@ PyAPI_FUNC(int) PyOS_mystrnicmp(const char *, const char *, Py_ssize_t); PyAPI_FUNC(int) PyOS_mystricmp(const char *, const char *); -#ifdef MS_WINDOWS +#if defined(MS_WINDOWS) || defined(PYOS_OS2) #define PyOS_strnicmp strnicmp #define PyOS_stricmp stricmp #else Modified: python/branches/tlee-ast-optimize/Lib/bsddb/test/test_basics.py ============================================================================== --- python/branches/tlee-ast-optimize/Lib/bsddb/test/test_basics.py (original) +++ python/branches/tlee-ast-optimize/Lib/bsddb/test/test_basics.py Wed Oct 1 00:24:45 2008 @@ -573,6 +573,15 @@ #---------------------------------------- + def test07_verify(self): + # Verify bug solved in 4.7.3pre8 + self.d.close() + d = db.DB(self.env) + d.verify(self.filename) + + + #---------------------------------------- + #---------------------------------------------------------------------- @@ -602,13 +611,13 @@ #---------------------------------------- - def test07_EnvRemoveAndRename(self): + def test08_EnvRemoveAndRename(self): if not self.env: return if verbose: print '\n', '-=' * 30 - print "Running %s.test07_EnvRemoveAndRename..." % self.__class__.__name__ + print "Running %s.test08_EnvRemoveAndRename..." % self.__class__.__name__ # can't rename or remove an open DB self.d.close() @@ -619,7 +628,7 @@ # dbremove and dbrename are in 4.1 and later if db.version() < (4,1): - del test07_EnvRemoveAndRename + del test08_EnvRemoveAndRename #---------------------------------------- @@ -720,11 +729,11 @@ #---------------------------------------- - def test07_TxnTruncate(self): + def test08_TxnTruncate(self): d = self.d if verbose: print '\n', '-=' * 30 - print "Running %s.test07_TxnTruncate..." % self.__class__.__name__ + print "Running %s.test08_TxnTruncate..." % self.__class__.__name__ d.put("abcde", "ABCDE"); txn = self.env.txn_begin() @@ -737,7 +746,7 @@ #---------------------------------------- - def test08_TxnLateUse(self): + def test09_TxnLateUse(self): txn = self.env.txn_begin() txn.abort() try: @@ -771,11 +780,11 @@ dbtype = db.DB_BTREE dbsetflags = db.DB_RECNUM - def test07_RecnoInBTree(self): + def test08_RecnoInBTree(self): d = self.d if verbose: print '\n', '-=' * 30 - print "Running %s.test07_RecnoInBTree..." % self.__class__.__name__ + print "Running %s.test08_RecnoInBTree..." % self.__class__.__name__ rec = d.get(200) self.assertEqual(type(rec), type(())) @@ -805,11 +814,11 @@ class BasicDUPTestCase(BasicTestCase): dbsetflags = db.DB_DUP - def test08_DuplicateKeys(self): + def test09_DuplicateKeys(self): d = self.d if verbose: print '\n', '-=' * 30 - print "Running %s.test08_DuplicateKeys..." % \ + print "Running %s.test09_DuplicateKeys..." % \ self.__class__.__name__ d.put("dup0", "before") @@ -878,11 +887,11 @@ else: return db.DB_BTREE - def test09_MultiDB(self): + def test10_MultiDB(self): d1 = self.d if verbose: print '\n', '-=' * 30 - print "Running %s.test09_MultiDB..." % self.__class__.__name__ + print "Running %s.test10_MultiDB..." % self.__class__.__name__ d2 = db.DB(self.env) d2.open(self.filename, "second", self.dbtype, @@ -1014,9 +1023,20 @@ self.obj = db.DB() class CrashAndBurn(unittest.TestCase) : - def test01_OpenCrash(self) : - # See http://bugs.python.org/issue3307 - self.assertRaises(db.DBInvalidArgError, db.DB, None, 65535) + import sys + if sys.version_info[:3] < (2, 4, 0): + def assertTrue(self, expr, msg=None): + self.failUnless(expr,msg=msg) + + #def test01_OpenCrash(self) : + # # See http://bugs.python.org/issue3307 + # self.assertRaises(db.DBInvalidArgError, db.DB, None, 65535) + + def test02_DBEnv_dealloc(self): + # http://bugs.python.org/issue3885 + import gc + self.assertRaises(db.DBInvalidArgError, db.DBEnv, ~db.DB_RPCCLIENT) + gc.collect() #---------------------------------------------------------------------- @@ -1044,7 +1064,7 @@ suite.addTest(unittest.makeSuite(HashMultiDBTestCase)) suite.addTest(unittest.makeSuite(DBEnvPrivateObject)) suite.addTest(unittest.makeSuite(DBPrivateObject)) - #suite.addTest(unittest.makeSuite(CrashAndBurn)) + suite.addTest(unittest.makeSuite(CrashAndBurn)) return suite Modified: python/branches/tlee-ast-optimize/Lib/collections.py ============================================================================== --- python/branches/tlee-ast-optimize/Lib/collections.py (original) +++ python/branches/tlee-ast-optimize/Lib/collections.py Wed Oct 1 00:24:45 2008 @@ -38,7 +38,7 @@ # generating informative error messages and preventing template injection attacks. if isinstance(field_names, basestring): field_names = field_names.replace(',', ' ').split() # names separated by whitespace and/or commas - field_names = tuple(field_names) + field_names = tuple(map(str, field_names)) for name in (typename,) + field_names: if not all(c.isalnum() or c=='_' for c in name): raise ValueError('Type names and field names can only contain alphanumeric characters and underscores: %r' % name) Modified: python/branches/tlee-ast-optimize/Lib/ctypes/test/test_bitfields.py ============================================================================== --- python/branches/tlee-ast-optimize/Lib/ctypes/test/test_bitfields.py (original) +++ python/branches/tlee-ast-optimize/Lib/ctypes/test/test_bitfields.py Wed Oct 1 00:24:45 2008 @@ -215,6 +215,22 @@ ("b", c_ubyte, 4)] self.failUnlessEqual(sizeof(X), sizeof(c_byte)) + def test_mixed_4(self): + class X(Structure): + _fields_ = [("a", c_short, 4), + ("b", c_short, 4), + ("c", c_int, 24), + ("d", c_short, 4), + ("e", c_short, 4), + ("f", c_int, 24)] + # MSVC does NOT combine c_short and c_int into one field, GCC + # does (unless GCC is run with '-mms-bitfields' which + # produces code compatible with MSVC). + if os.name in ("nt", "ce"): + self.failUnlessEqual(sizeof(X), sizeof(c_int) * 4) + else: + self.failUnlessEqual(sizeof(X), sizeof(c_int) * 2) + def test_anon_bitfields(self): # anonymous bit-fields gave a strange error message class X(Structure): Modified: python/branches/tlee-ast-optimize/Lib/distutils/tests/test_build_ext.py ============================================================================== --- python/branches/tlee-ast-optimize/Lib/distutils/tests/test_build_ext.py (original) +++ python/branches/tlee-ast-optimize/Lib/distutils/tests/test_build_ext.py Wed Oct 1 00:24:45 2008 @@ -62,8 +62,8 @@ # Get everything back to normal test_support.unload('xx') sys.path = self.sys_path - # XXX on Windows the test leaves a directory with xx.pyd in TEMP - shutil.rmtree(self.tmp_dir, False if os.name != "nt" else True) + # XXX on Windows the test leaves a directory with xx module in TEMP + shutil.rmtree(self.tmp_dir, os.name == 'nt' or sys.platform == 'cygwin') def test_suite(): if not sysconfig.python_build: Modified: python/branches/tlee-ast-optimize/Lib/ftplib.py ============================================================================== --- python/branches/tlee-ast-optimize/Lib/ftplib.py (original) +++ python/branches/tlee-ast-optimize/Lib/ftplib.py Wed Oct 1 00:24:45 2008 @@ -252,7 +252,7 @@ port number. ''' hbytes = host.split('.') - pbytes = [repr(port/256), repr(port%256)] + pbytes = [repr(port//256), repr(port%256)] bytes = hbytes + pbytes cmd = 'PORT ' + ','.join(bytes) return self.voidcmd(cmd) Modified: python/branches/tlee-ast-optimize/Lib/lib-tk/turtle.py ============================================================================== --- python/branches/tlee-ast-optimize/Lib/lib-tk/turtle.py (original) +++ python/branches/tlee-ast-optimize/Lib/lib-tk/turtle.py Wed Oct 1 00:24:45 2008 @@ -732,7 +732,7 @@ """Configure image item as to draw image object at position (x,y) on canvas) """ - self.cv.coords(item, (x, -y)) + self.cv.coords(item, (x * self.xscale, -y * self.yscale)) self.cv.itemconfig(item, image=image) def _setbgpic(self, item, image): @@ -2422,7 +2422,7 @@ shape=_CFG["shape"], undobuffersize=_CFG["undobuffersize"], visible=_CFG["visible"]): - if isinstance(canvas, Screen): + if isinstance(canvas, _Screen): self.screen = canvas elif isinstance(canvas, TurtleScreen): if canvas not in RawTurtle.screens: @@ -3539,29 +3539,33 @@ RawPen = RawTurtle -### Screen - Klasse ######################## +### Screen - Singleton ######################## -class Screen(TurtleScreen): +def Screen(): + """Return the singleton screen object. + If none exists at the moment, create a new one and return it, + else return the existing one.""" + if Turtle._screen is None: + Turtle._screen = _Screen() + return Turtle._screen + +class _Screen(TurtleScreen): _root = None _canvas = None _title = _CFG["title"] - # Borg-Idiom - - _shared_state = {} - - def __new__(cls, *args, **kwargs): - obj = object.__new__(cls, *args, **kwargs) - obj.__dict__ = cls._shared_state - return obj - def __init__(self): - if Screen._root is None: - Screen._root = self._root = _Root() - self._root.title(Screen._title) + # XXX there is no need for this code to be conditional, + # as there will be only a single _Screen instance, anyway + # XXX actually, the turtle demo is injecting root window, + # so perhaps the conditional creation of a root should be + # preserved (perhaps by passing it as an optional parameter) + if _Screen._root is None: + _Screen._root = self._root = _Root() + self._root.title(_Screen._title) self._root.ondestroy(self._destroy) - if Screen._canvas is None: + if _Screen._canvas is None: width = _CFG["width"] height = _CFG["height"] canvwidth = _CFG["canvwidth"] @@ -3569,10 +3573,9 @@ leftright = _CFG["leftright"] topbottom = _CFG["topbottom"] self._root.setupcanvas(width, height, canvwidth, canvheight) - Screen._canvas = self._root._getcanvas() + _Screen._canvas = self._root._getcanvas() self.setup(width, height, leftright, topbottom) - TurtleScreen.__init__(self, Screen._canvas) - Turtle._screen = self + TurtleScreen.__init__(self, _Screen._canvas) def setup(self, width=_CFG["width"], height=_CFG["height"], startx=_CFG["leftright"], starty=_CFG["topbottom"]): @@ -3626,17 +3629,17 @@ Example (for a Screen instance named screen): >>> screen.title("Welcome to the turtle-zoo!") """ - if Screen._root is not None: - Screen._root.title(titlestring) - Screen._title = titlestring + if _Screen._root is not None: + _Screen._root.title(titlestring) + _Screen._title = titlestring def _destroy(self): root = self._root - if root is Screen._root: + if root is _Screen._root: Turtle._pen = None Turtle._screen = None - Screen._root = None - Screen._canvas = None + _Screen._root = None + _Screen._canvas = None TurtleScreen._RUNNING = True root.destroy() @@ -3728,7 +3731,7 @@ docsdict = {} for methodname in _tg_screen_functions: - key = "Screen."+methodname + key = "_Screen."+methodname docsdict[key] = eval(key).__doc__ for methodname in _tg_turtle_functions: key = "Turtle."+methodname @@ -3842,14 +3845,14 @@ for methodname in _tg_screen_functions: - pl1, pl2 = getmethparlist(eval('Screen.' + methodname)) + pl1, pl2 = getmethparlist(eval('_Screen.' + methodname)) if pl1 == "": print ">>>>>>", pl1, pl2 continue defstr = ("def %(key)s%(pl1)s: return _getscreen().%(key)s%(pl2)s" % {'key':methodname, 'pl1':pl1, 'pl2':pl2}) exec defstr - eval(methodname).__doc__ = _screen_docrevise(eval('Screen.'+methodname).__doc__) + eval(methodname).__doc__ = _screen_docrevise(eval('_Screen.'+methodname).__doc__) for methodname in _tg_turtle_functions: pl1, pl2 = getmethparlist(eval('Turtle.' + methodname)) Modified: python/branches/tlee-ast-optimize/Lib/lib2to3/main.py ============================================================================== --- python/branches/tlee-ast-optimize/Lib/lib2to3/main.py (original) +++ python/branches/tlee-ast-optimize/Lib/lib2to3/main.py Wed Oct 1 00:24:45 2008 @@ -10,6 +10,20 @@ from . import refactor +class StdoutRefactoringTool(refactor.RefactoringTool): + """ + Prints output to stdout. + """ + + def log_error(self, msg, *args, **kwargs): + self.errors.append((msg, args, kwargs)) + self.logger.error(msg, *args, **kwargs) + + def print_output(self, lines): + for line in lines: + print line + + def main(fixer_pkg, args=None): """Main program. @@ -68,7 +82,7 @@ fixer_names = avail_names if "all" in options.fix else explicit else: fixer_names = avail_names - rt = refactor.RefactoringTool(fixer_names, rt_opts, explicit=explicit) + rt = StdoutRefactoringTool(fixer_names, rt_opts, explicit=explicit) # Refactor all files and directories passed as arguments if not rt.errors: @@ -80,7 +94,3 @@ # Return error status (0 if rt.errors is zero) return int(bool(rt.errors)) - - -if __name__ == "__main__": - sys.exit(main()) Modified: python/branches/tlee-ast-optimize/Lib/lib2to3/refactor.py ============================================================================== --- python/branches/tlee-ast-optimize/Lib/lib2to3/refactor.py (original) +++ python/branches/tlee-ast-optimize/Lib/lib2to3/refactor.py Wed Oct 1 00:24:45 2008 @@ -90,11 +90,18 @@ for fix_name in get_all_fix_names(pkg_name, False)] +class FixerError(Exception): + """A fixer could not be loaded.""" + + class RefactoringTool(object): _default_options = {"print_function": False} - def __init__(self, fixer_names, options=None, explicit=[]): + CLASS_PREFIX = "Fix" # The prefix for fixer classes + FILE_PREFIX = "fix_" # The prefix for modules with a fixer within + + def __init__(self, fixer_names, options=None, explicit=None): """Initializer. Args: @@ -103,7 +110,7 @@ explicit: a list of fixers to run even if they are explicit. """ self.fixers = fixer_names - self.explicit = explicit + self.explicit = explicit or [] self.options = self._default_options.copy() if options is not None: self.options.update(options) @@ -134,29 +141,17 @@ pre_order_fixers = [] post_order_fixers = [] for fix_mod_path in self.fixers: - try: - mod = __import__(fix_mod_path, {}, {}, ["*"]) - except ImportError: - self.log_error("Can't load transformation module %s", - fix_mod_path) - continue + mod = __import__(fix_mod_path, {}, {}, ["*"]) fix_name = fix_mod_path.rsplit(".", 1)[-1] - if fix_name.startswith("fix_"): - fix_name = fix_name[4:] + if fix_name.startswith(self.FILE_PREFIX): + fix_name = fix_name[len(self.FILE_PREFIX):] parts = fix_name.split("_") - class_name = "Fix" + "".join([p.title() for p in parts]) + class_name = self.CLASS_PREFIX + "".join([p.title() for p in parts]) try: fix_class = getattr(mod, class_name) except AttributeError: - self.log_error("Can't find %s.%s", - fix_name, class_name) - continue - try: - fixer = fix_class(self.options, self.fixer_log) - except Exception, err: - self.log_error("Can't instantiate fixes.fix_%s.%s()", - fix_name, class_name, exc_info=True) - continue + raise FixerError("Can't find %s.%s" % (fix_name, class_name)) + fixer = fix_class(self.options, self.fixer_log) if fixer.explicit and self.explicit is not True and \ fix_mod_path not in self.explicit: self.log_message("Skipping implicit fixer: %s", fix_name) @@ -168,7 +163,7 @@ elif fixer.order == "post": post_order_fixers.append(fixer) else: - raise ValueError("Illegal fixer order: %r" % fixer.order) + raise FixerError("Illegal fixer order: %r" % fixer.order) key_func = operator.attrgetter("run_order") pre_order_fixers.sort(key=key_func) @@ -176,9 +171,8 @@ return (pre_order_fixers, post_order_fixers) def log_error(self, msg, *args, **kwds): - """Increments error count and log a message.""" - self.errors.append((msg, args, kwds)) - self.logger.error(msg, *args, **kwds) + """Called when an error occurs.""" + raise def log_message(self, msg, *args): """Hook to log a message.""" @@ -191,13 +185,17 @@ msg = msg % args self.logger.debug(msg) + def print_output(self, lines): + """Called with lines of output to give to the user.""" + pass + def refactor(self, items, write=False, doctests_only=False): """Refactor a list of files and directories.""" for dir_or_file in items: if os.path.isdir(dir_or_file): - self.refactor_dir(dir_or_file, write) + self.refactor_dir(dir_or_file, write, doctests_only) else: - self.refactor_file(dir_or_file, write) + self.refactor_file(dir_or_file, write, doctests_only) def refactor_dir(self, dir_name, write=False, doctests_only=False): """Descends down a directory and refactor every Python file found. @@ -348,12 +346,11 @@ if old_text == new_text: self.log_debug("No changes to %s", filename) return - diff_texts(old_text, new_text, filename) - if not write: - self.log_debug("Not writing changes to %s", filename) - return + self.print_output(diff_texts(old_text, new_text, filename)) if write: self.write_file(new_text, filename, old_text) + else: + self.log_debug("Not writing changes to %s", filename) def write_file(self, new_text, filename, old_text=None): """Writes a string to a file. @@ -528,10 +525,9 @@ def diff_texts(a, b, filename): - """Prints a unified diff of two strings.""" + """Return a unified diff of two strings.""" a = a.splitlines() b = b.splitlines() - for line in difflib.unified_diff(a, b, filename, filename, - "(original)", "(refactored)", - lineterm=""): - print line + return difflib.unified_diff(a, b, filename, filename, + "(original)", "(refactored)", + lineterm="") Modified: python/branches/tlee-ast-optimize/Lib/multiprocessing/dummy/__init__.py ============================================================================== --- python/branches/tlee-ast-optimize/Lib/multiprocessing/dummy/__init__.py (original) +++ python/branches/tlee-ast-optimize/Lib/multiprocessing/dummy/__init__.py Wed Oct 1 00:24:45 2008 @@ -54,12 +54,6 @@ else: return None - is_alive = threading.Thread.is_alive.im_func - get_name = threading.Thread.getName.im_func - set_name = threading.Thread.setName.im_func - is_daemon = threading.Thread.isDaemon.im_func - set_daemon = threading.Thread.setDaemon.im_func - # # # Modified: python/branches/tlee-ast-optimize/Lib/multiprocessing/synchronize.py ============================================================================== --- python/branches/tlee-ast-optimize/Lib/multiprocessing/synchronize.py (original) +++ python/branches/tlee-ast-optimize/Lib/multiprocessing/synchronize.py Wed Oct 1 00:24:45 2008 @@ -21,6 +21,17 @@ from multiprocessing.util import Finalize, register_after_fork, debug from multiprocessing.forking import assert_spawning, Popen +# Try to import the mp.synchronize module cleanly, if it fails +# raise ImportError for platforms lacking a working sem_open implementation. +# See issue 3770 +try: + from _multiprocessing import SemLock +except (ImportError): + raise ImportError("This platform lacks a functioning sem_open" + + " implementation, therefore, the required" + + " synchronization primitives needed will not" + + " function, see issue 3770.") + # # Constants # Modified: python/branches/tlee-ast-optimize/Lib/ssl.py ============================================================================== --- python/branches/tlee-ast-optimize/Lib/ssl.py (original) +++ python/branches/tlee-ast-optimize/Lib/ssl.py Wed Oct 1 00:24:45 2008 @@ -434,7 +434,18 @@ for compability with Python 2.5 and earlier. Will disappear in Python 3.0.""" - ssl_sock = _ssl.sslwrap(sock._sock, 0, keyfile, certfile, CERT_NONE, + if hasattr(sock, "_sock"): + sock = sock._sock + + ssl_sock = _ssl.sslwrap(sock, 0, keyfile, certfile, CERT_NONE, PROTOCOL_SSLv23, None) - ssl_sock.do_handshake() + try: + sock.getpeername() + except: + # no, no connection yet + pass + else: + # yes, do the handshake + ssl_sock.do_handshake() + return ssl_sock Modified: python/branches/tlee-ast-optimize/Lib/test/regrtest.py ============================================================================== --- python/branches/tlee-ast-optimize/Lib/test/regrtest.py (original) +++ python/branches/tlee-ast-optimize/Lib/test/regrtest.py Wed Oct 1 00:24:45 2008 @@ -1047,6 +1047,7 @@ test_tcl test_timeout test_urllibnet + test_multiprocessing """, 'aix5': """ @@ -1077,6 +1078,7 @@ test_ossaudiodev test_pep277 test_tcl + test_multiprocessing """, 'netbsd3': """ @@ -1092,6 +1094,7 @@ test_ossaudiodev test_pep277 test_tcl + test_multiprocessing """, } _expectations['freebsd5'] = _expectations['freebsd4'] Modified: python/branches/tlee-ast-optimize/Lib/test/string_tests.py ============================================================================== --- python/branches/tlee-ast-optimize/Lib/test/string_tests.py (original) +++ python/branches/tlee-ast-optimize/Lib/test/string_tests.py Wed Oct 1 00:24:45 2008 @@ -120,6 +120,14 @@ self.checkequal(2, 'aaa', 'count', '', -1) self.checkequal(4, 'aaa', 'count', '', -10) + self.checkequal(1, '', 'count', '') + self.checkequal(0, '', 'count', '', 1, 1) + self.checkequal(0, '', 'count', '', sys.maxint, 0) + + self.checkequal(0, '', 'count', 'xx') + self.checkequal(0, '', 'count', 'xx', 1, 1) + self.checkequal(0, '', 'count', 'xx', sys.maxint, 0) + self.checkraises(TypeError, 'hello', 'count') self.checkraises(TypeError, 'hello', 'count', 42) @@ -169,6 +177,14 @@ self.checkraises(TypeError, 'hello', 'find') self.checkraises(TypeError, 'hello', 'find', 42) + self.checkequal(0, '', 'find', '') + self.checkequal(-1, '', 'find', '', 1, 1) + self.checkequal(-1, '', 'find', '', sys.maxint, 0) + + self.checkequal(-1, '', 'find', 'xx') + self.checkequal(-1, '', 'find', 'xx', 1, 1) + self.checkequal(-1, '', 'find', 'xx', sys.maxint, 0) + # For a variety of combinations, # verify that str.find() matches __contains__ # and that the found substring is really at that location Modified: python/branches/tlee-ast-optimize/Lib/test/test_atexit.py ============================================================================== --- python/branches/tlee-ast-optimize/Lib/test/test_atexit.py (original) +++ python/branches/tlee-ast-optimize/Lib/test/test_atexit.py Wed Oct 1 00:24:45 2008 @@ -22,6 +22,19 @@ atexit._exithandlers = save_handlers self.assertEqual(s.getvalue(), "h4 (4,) {'kw': 'abc'}\nh4 () {}\nh1\n") + def test_badargs(self): + s = StringIO.StringIO() + sys.stdout = sys.stderr = s + save_handlers = atexit._exithandlers + atexit._exithandlers = [] + try: + atexit.register(lambda: 1, 0, 0, (x for x in (1,2)), 0, 0) + self.assertRaises(TypeError, atexit._run_exitfuncs) + finally: + sys.stdout = sys.__stdout__ + sys.stderr = sys.__stderr__ + atexit._exithandlers = save_handlers + def test_order(self): # be sure handlers are executed in reverse order s = StringIO.StringIO() Modified: python/branches/tlee-ast-optimize/Lib/test/test_collections.py ============================================================================== --- python/branches/tlee-ast-optimize/Lib/test/test_collections.py (original) +++ python/branches/tlee-ast-optimize/Lib/test/test_collections.py Wed Oct 1 00:24:45 2008 @@ -34,6 +34,11 @@ namedtuple('Point0', 'x1 y2') # Verify that numbers are allowed in names namedtuple('_', 'a b c') # Test leading underscores in a typename + nt = namedtuple('nt', u'the quick brown fox') # check unicode input + self.assert_("u'" not in repr(nt._fields)) + nt = namedtuple('nt', (u'the', u'quick')) # check unicode input + self.assert_("u'" not in repr(nt._fields)) + self.assertRaises(TypeError, Point._make, [11]) # catch too few args self.assertRaises(TypeError, Point._make, [11, 22, 33]) # catch too many args Modified: python/branches/tlee-ast-optimize/Lib/test/test_cprofile.py ============================================================================== --- python/branches/tlee-ast-optimize/Lib/test/test_cprofile.py (original) +++ python/branches/tlee-ast-optimize/Lib/test/test_cprofile.py Wed Oct 1 00:24:45 2008 @@ -1,7 +1,7 @@ """Test suite for the cProfile module.""" import sys -from test.test_support import run_unittest +from test.test_support import run_unittest, TESTFN, unlink # rip off all interesting stuff from test_profile import cProfile @@ -10,6 +10,20 @@ class CProfileTest(ProfileTest): profilerclass = cProfile.Profile + # Issue 3895. + def test_bad_counter_during_dealloc(self): + import _lsprof + # Must use a file as StringIO doesn't trigger the bug. + sys.stderr = open(TESTFN, 'w') + try: + obj = _lsprof.Profiler(lambda: int) + obj.enable() + obj = _lsprof.Profiler(1) + obj.disable() + finally: + sys.stderr = sys.__stderr__ + unlink(TESTFN) + def test_main(): run_unittest(CProfileTest) Modified: python/branches/tlee-ast-optimize/Lib/test/test_file.py ============================================================================== --- python/branches/tlee-ast-optimize/Lib/test/test_file.py (original) +++ python/branches/tlee-ast-optimize/Lib/test/test_file.py Wed Oct 1 00:24:45 2008 @@ -134,6 +134,16 @@ f.close() self.fail('%r is an invalid file mode' % mode) + # Some invalid modes fail on Windows, but pass on Unix + # Issue3965: avoid a crash on Windows when filename is unicode + for name in (TESTFN, unicode(TESTFN), unicode(TESTFN + '\t')): + try: + f = open(name, "rr") + except IOError: + pass + else: + f.close() + def testStdin(self): # This causes the interpreter to exit on OSF1 v5.1. if sys.platform != 'osf1V5': Modified: python/branches/tlee-ast-optimize/Lib/test/test_ftplib.py ============================================================================== --- python/branches/tlee-ast-optimize/Lib/test/test_ftplib.py (original) +++ python/branches/tlee-ast-optimize/Lib/test/test_ftplib.py Wed Oct 1 00:24:45 2008 @@ -1,43 +1,411 @@ -import socket -import threading +"""Test script for ftplib module.""" + +# Modified by Giampaolo Rodola' to test FTP class and IPv6 environment + import ftplib -import time +import threading +import asyncore +import asynchat +import socket +import StringIO from unittest import TestCase from test import test_support +from test.test_support import HOST -HOST = test_support.HOST -# This function sets the evt 3 times: -# 1) when the connection is ready to be accepted. -# 2) when it is safe for the caller to close the connection -# 3) when we have closed the socket -def server(evt, serv): - serv.listen(5) - # (1) Signal the caller that we are ready to accept the connection. - evt.set() - try: - conn, addr = serv.accept() - except socket.timeout: - pass - else: - conn.send("1 Hola mundo\n") - # (2) Signal the caller that it is safe to close the socket. - evt.set() +# the dummy data returned by server over the data channel when +# RETR, LIST and NLST commands are issued +RETR_DATA = 'abcde12345\r\n' * 1000 +LIST_DATA = 'foo\r\nbar\r\n' +NLST_DATA = 'foo\r\nbar\r\n' + + +class DummyDTPHandler(asynchat.async_chat): + + def __init__(self, conn, baseclass): + asynchat.async_chat.__init__(self, conn) + self.baseclass = baseclass + self.baseclass.last_received_data = '' + + def handle_read(self): + self.baseclass.last_received_data += self.recv(1024) + + def handle_close(self): + self.baseclass.push('226 transfer complete') + self.close() + + +class DummyFTPHandler(asynchat.async_chat): + + def __init__(self, conn): + asynchat.async_chat.__init__(self, conn) + self.set_terminator("\r\n") + self.in_buffer = [] + self.dtp = None + self.last_received_cmd = None + self.last_received_data = '' + self.next_response = '' + self.push('220 welcome') + + def collect_incoming_data(self, data): + self.in_buffer.append(data) + + def found_terminator(self): + line = ''.join(self.in_buffer) + self.in_buffer = [] + if self.next_response: + self.push(self.next_response) + self.next_response = '' + cmd = line.split(' ')[0].lower() + self.last_received_cmd = cmd + space = line.find(' ') + if space != -1: + arg = line[space + 1:] + else: + arg = "" + if hasattr(self, 'cmd_' + cmd): + method = getattr(self, 'cmd_' + cmd) + method(arg) + else: + self.push('550 command "%s" not understood.' %cmd) + + def handle_error(self): + raise + + def push(self, data): + asynchat.async_chat.push(self, data + '\r\n') + + def cmd_port(self, arg): + addr = map(int, arg.split(',')) + ip = '%d.%d.%d.%d' %tuple(addr[:4]) + port = (addr[4] * 256) + addr[5] + s = socket.create_connection((ip, port), timeout=2) + self.dtp = DummyDTPHandler(s, baseclass=self) + self.push('200 active data connection established') + + def cmd_pasv(self, arg): + sock = socket.socket() + sock.bind((self.socket.getsockname()[0], 0)) + sock.listen(5) + sock.settimeout(2) + ip, port = sock.getsockname()[:2] + ip = ip.replace('.', ','); p1 = port / 256; p2 = port % 256 + self.push('227 entering passive mode (%s,%d,%d)' %(ip, p1, p2)) + conn, addr = sock.accept() + self.dtp = DummyDTPHandler(conn, baseclass=self) + + def cmd_eprt(self, arg): + af, ip, port = arg.split(arg[0])[1:-1] + port = int(port) + s = socket.create_connection((ip, port), timeout=2) + self.dtp = DummyDTPHandler(s, baseclass=self) + self.push('200 active data connection established') + + def cmd_epsv(self, arg): + sock = socket.socket(socket.AF_INET6) + sock.bind((self.socket.getsockname()[0], 0)) + sock.listen(5) + sock.settimeout(2) + port = sock.getsockname()[1] + self.push('229 entering extended passive mode (|||%d|)' %port) + conn, addr = sock.accept() + self.dtp = DummyDTPHandler(conn, baseclass=self) + + def cmd_echo(self, arg): + # sends back the received string (used by the test suite) + self.push(arg) + + def cmd_user(self, arg): + self.push('331 username ok') + + def cmd_pass(self, arg): + self.push('230 password ok') + + def cmd_acct(self, arg): + self.push('230 acct ok') + + def cmd_rnfr(self, arg): + self.push('350 rnfr ok') + + def cmd_rnto(self, arg): + self.push('250 rnto ok') + + def cmd_dele(self, arg): + self.push('250 dele ok') + + def cmd_cwd(self, arg): + self.push('250 cwd ok') + + def cmd_size(self, arg): + self.push('250 1000') + + def cmd_mkd(self, arg): + self.push('257 "%s"' %arg) + + def cmd_rmd(self, arg): + self.push('250 rmd ok') + + def cmd_pwd(self, arg): + self.push('257 "pwd ok"') + + def cmd_type(self, arg): + self.push('200 type ok') + + def cmd_quit(self, arg): + self.push('221 quit ok') + self.close() + + def cmd_stor(self, arg): + self.push('125 stor ok') + + def cmd_retr(self, arg): + self.push('125 retr ok') + self.dtp.push(RETR_DATA) + self.dtp.close_when_done() + + def cmd_list(self, arg): + self.push('125 list ok') + self.dtp.push(LIST_DATA) + self.dtp.close_when_done() + + def cmd_nlst(self, arg): + self.push('125 nlst ok') + self.dtp.push(NLST_DATA) + self.dtp.close_when_done() + + +class DummyFTPServer(asyncore.dispatcher, threading.Thread): + + handler = DummyFTPHandler + + def __init__(self, address, af=socket.AF_INET): + threading.Thread.__init__(self) + asyncore.dispatcher.__init__(self) + self.create_socket(af, socket.SOCK_STREAM) + self.bind(address) + self.listen(5) + self.active = False + self.active_lock = threading.Lock() + self.host, self.port = self.socket.getsockname()[:2] + + def start(self): + assert not self.active + self.__flag = threading.Event() + threading.Thread.start(self) + self.__flag.wait() + + def run(self): + self.active = True + self.__flag.set() + while self.active and asyncore.socket_map: + self.active_lock.acquire() + asyncore.loop(timeout=0.1, count=1) + self.active_lock.release() + asyncore.close_all(ignore_all=True) + + def stop(self): + assert self.active + self.active = False + self.join() + + def handle_accept(self): + conn, addr = self.accept() + self.handler = self.handler(conn) + self.close() + + def handle_connect(self): + self.close() + handle_read = handle_connect + + def writable(self): + return 0 + + def handle_error(self): + raise + + +class TestFTPClass(TestCase): + + def setUp(self): + self.server = DummyFTPServer((HOST, 0)) + self.server.start() + self.client = ftplib.FTP(timeout=2) + self.client.connect(self.server.host, self.server.port) + + def tearDown(self): + self.client.close() + self.server.stop() + + def test_getwelcome(self): + self.assertEqual(self.client.getwelcome(), '220 welcome') + + def test_sanitize(self): + self.assertEqual(self.client.sanitize('foo'), repr('foo')) + self.assertEqual(self.client.sanitize('pass 12345'), repr('pass *****')) + self.assertEqual(self.client.sanitize('PASS 12345'), repr('PASS *****')) + + def test_exceptions(self): + self.assertRaises(ftplib.error_temp, self.client.sendcmd, 'echo 400') + self.assertRaises(ftplib.error_temp, self.client.sendcmd, 'echo 499') + self.assertRaises(ftplib.error_perm, self.client.sendcmd, 'echo 500') + self.assertRaises(ftplib.error_perm, self.client.sendcmd, 'echo 599') + self.assertRaises(ftplib.error_proto, self.client.sendcmd, 'echo 999') + + def test_all_errors(self): + exceptions = (ftplib.error_reply, ftplib.error_temp, ftplib.error_perm, + ftplib.error_proto, ftplib.Error, IOError, EOFError) + for x in exceptions: + try: + raise x('exception not included in all_errors set') + except ftplib.all_errors: + pass + + def test_set_pasv(self): + # passive mode is supposed to be enabled by default + self.assertTrue(self.client.passiveserver) + self.client.set_pasv(True) + self.assertTrue(self.client.passiveserver) + self.client.set_pasv(False) + self.assertFalse(self.client.passiveserver) + + def test_voidcmd(self): + self.client.voidcmd('echo 200') + self.client.voidcmd('echo 299') + self.assertRaises(ftplib.error_reply, self.client.voidcmd, 'echo 199') + self.assertRaises(ftplib.error_reply, self.client.voidcmd, 'echo 300') + + def test_login(self): + self.client.login() + + def test_acct(self): + self.client.acct('passwd') + + def test_rename(self): + self.client.rename('a', 'b') + self.server.handler.next_response = '200' + self.assertRaises(ftplib.error_reply, self.client.rename, 'a', 'b') + + def test_delete(self): + self.client.delete('foo') + self.server.handler.next_response = '199' + self.assertRaises(ftplib.error_reply, self.client.delete, 'foo') + + def test_size(self): + self.client.size('foo') + + def test_mkd(self): + dir = self.client.mkd('/foo') + self.assertEqual(dir, '/foo') + + def test_rmd(self): + self.client.rmd('foo') + + def test_pwd(self): + dir = self.client.pwd() + self.assertEqual(dir, 'pwd ok') + + def test_quit(self): + self.assertEqual(self.client.quit(), '221 quit ok') + # Ensure the connection gets closed; sock attribute should be None + self.assertEqual(self.client.sock, None) + + def test_retrbinary(self): + received = [] + self.client.retrbinary('retr', received.append) + self.assertEqual(''.join(received), RETR_DATA) + + def test_retrlines(self): + received = [] + self.client.retrlines('retr', received.append) + self.assertEqual(''.join(received), RETR_DATA.replace('\r\n', '')) + + def test_storbinary(self): + f = StringIO.StringIO(RETR_DATA) + self.client.storbinary('stor', f) + self.assertEqual(self.server.handler.last_received_data, RETR_DATA) + # test new callback arg + flag = [] + f.seek(0) + self.client.storbinary('stor', f, callback=lambda x: flag.append(None)) + self.assertTrue(flag) + + def test_storlines(self): + f = StringIO.StringIO(RETR_DATA.replace('\r\n', '\n')) + self.client.storlines('stor', f) + self.assertEqual(self.server.handler.last_received_data, RETR_DATA) + # test new callback arg + flag = [] + f.seek(0) + self.client.storlines('stor foo', f, callback=lambda x: flag.append(None)) + self.assertTrue(flag) + + def test_nlst(self): + self.client.nlst() + self.assertEqual(self.client.nlst(), NLST_DATA.split('\r\n')[:-1]) + + def test_dir(self): + l = [] + self.client.dir(lambda x: l.append(x)) + self.assertEqual(''.join(l), LIST_DATA.replace('\r\n', '')) + + def test_makeport(self): + self.client.makeport() + # IPv4 is in use, just make sure send_eprt has not been used + self.assertEqual(self.server.handler.last_received_cmd, 'port') + + def test_makepasv(self): + host, port = self.client.makepasv() + conn = socket.create_connection((host, port), 2) conn.close() - finally: - serv.close() - # (3) Signal the caller that we are done. - evt.set() + # IPv4 is in use, just make sure send_epsv has not been used + self.assertEqual(self.server.handler.last_received_cmd, 'pasv') + -class GeneralTests(TestCase): +class TestIPv6Environment(TestCase): + + def setUp(self): + self.server = DummyFTPServer((HOST, 0), af=socket.AF_INET6) + self.server.start() + self.client = ftplib.FTP() + self.client.connect(self.server.host, self.server.port) + + def tearDown(self): + self.client.close() + self.server.stop() + + def test_af(self): + self.assertEqual(self.client.af, socket.AF_INET6) + + def test_makeport(self): + self.client.makeport() + self.assertEqual(self.server.handler.last_received_cmd, 'eprt') + + def test_makepasv(self): + host, port = self.client.makepasv() + conn = socket.create_connection((host, port), 2) + conn.close() + self.assertEqual(self.server.handler.last_received_cmd, 'epsv') + + def test_transfer(self): + def retr(): + received = [] + self.client.retrbinary('retr', received.append) + self.assertEqual(''.join(received), RETR_DATA) + self.client.set_pasv(True) + retr() + self.client.set_pasv(False) + retr() + + +class TestTimeouts(TestCase): def setUp(self): self.evt = threading.Event() self.sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) self.sock.settimeout(3) self.port = test_support.bind_port(self.sock) - threading.Thread(target=server, args=(self.evt,self.sock)).start() + threading.Thread(target=self.server, args=(self.evt,self.sock)).start() # Wait for the server to be ready. self.evt.wait() self.evt.clear() @@ -46,14 +414,27 @@ def tearDown(self): self.evt.wait() - def testBasic(self): - # do nothing - ftplib.FTP() - - # connects - ftp = ftplib.FTP(HOST) - self.evt.wait() - ftp.close() + def server(self, evt, serv): + # This method sets the evt 3 times: + # 1) when the connection is ready to be accepted. + # 2) when it is safe for the caller to close the connection + # 3) when we have closed the socket + serv.listen(5) + # (1) Signal the caller that we are ready to accept the connection. + evt.set() + try: + conn, addr = serv.accept() + except socket.timeout: + pass + else: + conn.send("1 Hola mundo\n") + # (2) Signal the caller that it is safe to close the socket. + evt.set() + conn.close() + finally: + serv.close() + # (3) Signal the caller that we are done. + evt.set() def testTimeoutDefault(self): # default -- use global socket timeout @@ -109,8 +490,21 @@ ftp.close() -def test_main(verbose=None): - test_support.run_unittest(GeneralTests) +def test_main(): + tests = [TestFTPClass, TestTimeouts] + if socket.has_ipv6: + try: + DummyFTPServer((HOST, 0), af=socket.AF_INET6) + except socket.error: + pass + else: + tests.append(TestIPv6Environment) + thread_info = test_support.threading_setup() + try: + test_support.run_unittest(*tests) + finally: + test_support.threading_cleanup(*thread_info) + if __name__ == '__main__': test_main() Modified: python/branches/tlee-ast-optimize/Lib/test/test_imageop.py ============================================================================== --- python/branches/tlee-ast-optimize/Lib/test/test_imageop.py (original) +++ python/branches/tlee-ast-optimize/Lib/test/test_imageop.py Wed Oct 1 00:24:45 2008 @@ -5,13 +5,74 @@ Roger E. Masse """ -from test.test_support import verbose, unlink, import_module +from test.test_support import verbose, unlink, import_module, run_unittest imageop = import_module('imageop', deprecated=True) -import uu, os, imgfile +import uu, os, unittest + + +SIZES = (1, 2, 3, 4) +_VALUES = (1, 2, 2**10, 2**15-1, 2**15, 2**15+1, 2**31-2, 2**31-1) +VALUES = tuple( -x for x in reversed(_VALUES) ) + (0,) + _VALUES +AAAAA = "A" * 1024 + + +class InputValidationTests(unittest.TestCase): + + def _check(self, name, size=None, *extra): + func = getattr(imageop, name) + for height in VALUES: + for width in VALUES: + strlen = abs(width * height) + if size: + strlen *= size + if strlen < 1024: + data = "A" * strlen + else: + data = AAAAA + if size: + arguments = (data, size, width, height) + extra + else: + arguments = (data, width, height) + extra + try: + func(*arguments) + except (ValueError, imageop.error): + pass + + def check_size(self, name, *extra): + for size in SIZES: + self._check(name, size, *extra) + + def check(self, name, *extra): + self._check(name, None, *extra) + + def test_input_validation(self): + self.check_size("crop", 0, 0, 0, 0) + self.check_size("scale", 1, 0) + self.check_size("scale", -1, -1) + self.check_size("tovideo") + self.check("grey2mono", 128) + self.check("grey2grey4") + self.check("grey2grey2") + self.check("dither2mono") + self.check("dither2grey2") + self.check("mono2grey", 0, 0) + self.check("grey22grey") + self.check("rgb2rgb8") # nlen*4 == len + self.check("rgb82rgb") + self.check("rgb2grey") + self.check("grey2rgb") + def test_main(): + run_unittest(InputValidationTests) + + try: + import imgfile + except ImportError: + return + # Create binary test files uu.decode(get_qualified_path('testrgb'+os.extsep+'uue'), 'test'+os.extsep+'rgb') Modified: python/branches/tlee-ast-optimize/Lib/test/test_io.py ============================================================================== --- python/branches/tlee-ast-optimize/Lib/test/test_io.py (original) +++ python/branches/tlee-ast-optimize/Lib/test/test_io.py Wed Oct 1 00:24:45 2008 @@ -201,7 +201,7 @@ # On Windows and Mac OSX this test comsumes large resources; It takes # a long time to build the >2GB file and takes >2GB of disk space # therefore the resource must be enabled to run this test. - if sys.platform[:3] == 'win' or sys.platform == 'darwin': + if sys.platform[:3] in ('win', 'os2') or sys.platform == 'darwin': if not test_support.is_resource_enabled("largefile"): print("\nTesting large file ops skipped on %s." % sys.platform, file=sys.stderr) Modified: python/branches/tlee-ast-optimize/Lib/test/test_lib2to3.py ============================================================================== --- python/branches/tlee-ast-optimize/Lib/test/test_lib2to3.py (original) +++ python/branches/tlee-ast-optimize/Lib/test/test_lib2to3.py Wed Oct 1 00:24:45 2008 @@ -1,13 +1,13 @@ # Skipping test_parser and test_all_fixers # because of running -from lib2to3.tests import test_fixers, test_pytree, test_util +from lib2to3.tests import test_fixers, test_pytree, test_util, test_refactor import unittest from test.test_support import run_unittest def suite(): tests = unittest.TestSuite() loader = unittest.TestLoader() - for m in (test_fixers,test_pytree,test_util): + for m in (test_fixers,test_pytree,test_util, test_refactor): tests.addTests(loader.loadTestsFromModule(m)) return tests Modified: python/branches/tlee-ast-optimize/Lib/test/test_multiprocessing.py ============================================================================== --- python/branches/tlee-ast-optimize/Lib/test/test_multiprocessing.py (original) +++ python/branches/tlee-ast-optimize/Lib/test/test_multiprocessing.py Wed Oct 1 00:24:45 2008 @@ -18,6 +18,14 @@ import random import logging + +# Work around broken sem_open implementations +try: + import multiprocessing.synchronize +except ImportError, e: + from test.test_support import TestSkipped + raise TestSkipped(e) + import multiprocessing.dummy import multiprocessing.connection import multiprocessing.managers Modified: python/branches/tlee-ast-optimize/Lib/test/test_ssl.py ============================================================================== --- python/branches/tlee-ast-optimize/Lib/test/test_ssl.py (original) +++ python/branches/tlee-ast-optimize/Lib/test/test_ssl.py Wed Oct 1 00:24:45 2008 @@ -34,6 +34,21 @@ if test_support.verbose: sys.stdout.write(prefix + exc_format) + def testSimpleSSLwrap(self): + try: + ssl.sslwrap_simple(socket.socket(socket.AF_INET)) + except IOError, e: + if e.errno == 32: # broken pipe when ssl_sock.do_handshake(), this test doesn't care about that + pass + else: + raise + try: + ssl.sslwrap_simple(socket.socket(socket.AF_INET)._sock) + except IOError, e: + if e.errno == 32: # broken pipe when ssl_sock.do_handshake(), this test doesn't care about that + pass + else: + raise class BasicTests(unittest.TestCase): @@ -58,7 +73,6 @@ finally: s.close() - def testCrucialConstants(self): ssl.PROTOCOL_SSLv2 ssl.PROTOCOL_SSLv23 Modified: python/branches/tlee-ast-optimize/Lib/test/test_tarfile.py ============================================================================== --- python/branches/tlee-ast-optimize/Lib/test/test_tarfile.py (original) +++ python/branches/tlee-ast-optimize/Lib/test/test_tarfile.py Wed Oct 1 00:24:45 2008 @@ -787,6 +787,7 @@ self.tar.add(self.foo) def tearDown(self): + self.tar.close() os.remove(self.foo) os.remove(self.bar) Modified: python/branches/tlee-ast-optimize/Lib/test/test_urllib.py ============================================================================== --- python/branches/tlee-ast-optimize/Lib/test/test_urllib.py (original) +++ python/branches/tlee-ast-optimize/Lib/test/test_urllib.py Wed Oct 1 00:24:45 2008 @@ -94,6 +94,31 @@ for line in self.returned_obj.__iter__(): self.assertEqual(line, self.text) + +class ProxyTests(unittest.TestCase): + + def setUp(self): + unittest.TestCase.setUp(self) + # Save all proxy related env vars + self._saved_environ = dict([(k, v) for k, v in os.environ.iteritems() + if k.lower().find('proxy') >= 0]) + # Delete all proxy related env vars + for k in self._saved_environ: + del os.environ[k] + + def tearDown(self): + unittest.TestCase.tearDown(self) + # Restore all proxy related env vars + for k, v in self._saved_environ: + os.environ[k] = v + + def test_getproxies_environment_keep_no_proxies(self): + os.environ['NO_PROXY'] = 'localhost' + proxies = urllib.getproxies_environment() + # getproxies_environment use lowered case truncated (no '_proxy') keys + self.assertEquals('localhost', proxies['no']) + + class urlopen_HttpTests(unittest.TestCase): """Test urlopen() opening a fake http connection.""" @@ -648,6 +673,7 @@ urlopen_FileTests, urlopen_HttpTests, urlretrieve_FileTests, + ProxyTests, QuotingTests, UnquotingTests, urlencode_Tests, Modified: python/branches/tlee-ast-optimize/Lib/urllib.py ============================================================================== --- python/branches/tlee-ast-optimize/Lib/urllib.py (original) +++ python/branches/tlee-ast-optimize/Lib/urllib.py Wed Oct 1 00:24:45 2008 @@ -1299,9 +1299,6 @@ proxies = {} for name, value in os.environ.items(): name = name.lower() - if name == 'no_proxy': - # handled in proxy_bypass_environment - continue if value and name[-6:] == '_proxy': proxies[name[:-6]] = value return proxies Modified: python/branches/tlee-ast-optimize/Misc/NEWS ============================================================================== --- python/branches/tlee-ast-optimize/Misc/NEWS (original) +++ python/branches/tlee-ast-optimize/Misc/NEWS Wed Oct 1 00:24:45 2008 @@ -12,9 +12,31 @@ Core and Builtins ----------------- +- Issue #3967: Fixed a crash in the count() and find() methods of string-like + objects, when the "start" parameter is a huge value. + +- Issue #3965: Fixed a crash on Windows when open() is given an invalid + filename or mode, and the filename is a unicode string. + +- Bug #3951: Py_USING_MEMORY_DEBUGGER should not be enabled by default. + Library ------- +- Issue #3965: Allow repeated calls to turtle.Screen, by making it a + true singleton object. + +- Issue #3895: It was possible to crash the interpreter when an external timer + was used with cProfile that returned an object that could not be converted + into a float. + +- Issue #3950: Made turtle respect scale factors. + +- Issue #3547: Fixed ctypes structures bitfields of varying integer + sizes. + +- Issue #3879: A regression in urllib.getproxies_enviroment was fixed. + Build ----- @@ -32,6 +54,9 @@ Extension Modules ----------------- +- Security Issue #2: imageop did not validate arguments correctly and could + segfault as a result. + - Issue #3886: Possible integer overflows in the _hashopenssl module were closed. @@ -655,7 +680,7 @@ - Support for Windows 9x has been removed from the winsound module. -- bsddb module updated to version 4.7.3pre2. +- bsddb module updated to version 4.7.3. http://www.jcea.es/programacion/pybsddb.htm#bsddb3-4.7.3. This code should be compatible with Python 3.0. Modified: python/branches/tlee-ast-optimize/Modules/Setup.dist ============================================================================== --- python/branches/tlee-ast-optimize/Modules/Setup.dist (original) +++ python/branches/tlee-ast-optimize/Modules/Setup.dist Wed Oct 1 00:24:45 2008 @@ -176,7 +176,7 @@ #_weakref _weakref.c # basic weak reference support #_testcapi _testcapimodule.c # Python C API test module #_random _randommodule.c # Random number generator -#collections collectionsmodule.c # Container types +#_collections _collectionsmodule.c # Container types #itertools itertoolsmodule.c # Functions creating iterators for efficient looping #strop stropmodule.c # String manipulations Modified: python/branches/tlee-ast-optimize/Modules/_bsddb.c ============================================================================== --- python/branches/tlee-ast-optimize/Modules/_bsddb.c (original) +++ python/branches/tlee-ast-optimize/Modules/_bsddb.c Wed Oct 1 00:24:45 2008 @@ -989,7 +989,7 @@ /* Forward declaration */ -static PyObject *DB_close_internal(DBObject* self, int flags); +static PyObject *DB_close_internal(DBObject* self, int flags, int do_not_close); static void DB_dealloc(DBObject* self) @@ -997,8 +997,15 @@ PyObject *dummy; if (self->db != NULL) { - dummy=DB_close_internal(self,0); - Py_XDECREF(dummy); + dummy=DB_close_internal(self, 0, 0); + /* + ** Raising exceptions while doing + ** garbage collection is a fatal error. + */ + if (dummy) + Py_DECREF(dummy); + else + PyErr_Clear(); } if (self->in_weakreflist != NULL) { PyObject_ClearWeakRefs((PyObject *) self); @@ -1052,8 +1059,15 @@ PyObject *dummy; if (self->dbc != NULL) { - dummy=DBC_close_internal(self); - Py_XDECREF(dummy); + dummy=DBC_close_internal(self); + /* + ** Raising exceptions while doing + ** garbage collection is a fatal error. + */ + if (dummy) + Py_DECREF(dummy); + else + PyErr_Clear(); } if (self->in_weakreflist != NULL) { PyObject_ClearWeakRefs((PyObject *) self); @@ -1071,6 +1085,7 @@ if (self == NULL) return NULL; + self->db_env = NULL; self->closed = 1; self->flags = flags; self->moduleFlags.getReturnsNone = DEFAULT_GET_RETURNS_NONE; @@ -1107,8 +1122,15 @@ PyObject *dummy; if (self->db_env) { - dummy=DBEnv_close_internal(self,0); - Py_XDECREF(dummy); + dummy=DBEnv_close_internal(self, 0); + /* + ** Raising exceptions while doing + ** garbage collection is a fatal error. + */ + if (dummy) + Py_DECREF(dummy); + else + PyErr_Clear(); } Py_XDECREF(self->event_notifyCallback); @@ -1186,8 +1208,17 @@ if (self->txn) { int flag_prepare = self->flag_prepare; + dummy=DBTxn_abort_discard_internal(self,0); - Py_XDECREF(dummy); + /* + ** Raising exceptions while doing + ** garbage collection is a fatal error. + */ + if (dummy) + Py_DECREF(dummy); + else + PyErr_Clear(); + if (!flag_prepare) { PyErr_Warn(PyExc_RuntimeWarning, "DBTxn aborted in destructor. No prior commit() or abort()."); @@ -1280,7 +1311,14 @@ if (self->sequence != NULL) { dummy=DBSequence_close_internal(self,0,0); - Py_XDECREF(dummy); + /* + ** Raising exceptions while doing + ** garbage collection is a fatal error. + */ + if (dummy) + Py_DECREF(dummy); + else + PyErr_Clear(); } if (self->in_weakreflist != NULL) { @@ -1485,10 +1523,10 @@ static PyObject* -DB_close_internal(DBObject* self, int flags) +DB_close_internal(DBObject* self, int flags, int do_not_close) { PyObject *dummy; - int err; + int err = 0; if (self->db != NULL) { /* Can be NULL if db is not in an environment */ @@ -1511,10 +1549,20 @@ } #endif - MYDB_BEGIN_ALLOW_THREADS; - err = self->db->close(self->db, flags); - MYDB_END_ALLOW_THREADS; - self->db = NULL; + /* + ** "do_not_close" is used to dispose all related objects in the + ** tree, without actually releasing the "root" object. + ** This is done, for example, because function calls like + ** "DB.verify()" implicitly close the underlying handle. So + ** the handle doesn't need to be closed, but related objects + ** must be cleaned up. + */ + if (!do_not_close) { + MYDB_BEGIN_ALLOW_THREADS; + err = self->db->close(self->db, flags); + MYDB_END_ALLOW_THREADS; + self->db = NULL; + } RETURN_IF_ERR(); } RETURN_NONE(); @@ -1526,7 +1574,7 @@ int flags=0; if (!PyArg_ParseTuple(args,"|i:close", &flags)) return NULL; - return DB_close_internal(self,flags); + return DB_close_internal(self, flags, 0); } @@ -2146,7 +2194,7 @@ if (makeDBError(err)) { PyObject *dummy; - dummy=DB_close_internal(self,0); + dummy=DB_close_internal(self, 0, 0); Py_XDECREF(dummy); return NULL; } @@ -2840,21 +2888,24 @@ /* XXX(nnorwitz): it should probably be an exception if outFile can't be opened. */ - MYDB_BEGIN_ALLOW_THREADS; - err = self->db->verify(self->db, fileName, dbName, outFile, flags); - MYDB_END_ALLOW_THREADS; - if (outFile) - fclose(outFile); - { /* DB.verify acts as a DB handle destructor (like close) */ PyObject *error; - error=DB_close_internal(self,0); + error=DB_close_internal(self, 0, 1); if (error ) { return error; } } + MYDB_BEGIN_ALLOW_THREADS; + err = self->db->verify(self->db, fileName, dbName, outFile, flags); + MYDB_END_ALLOW_THREADS; + + self->db = NULL; /* Implicit close; related objects already released */ + + if (outFile) + fclose(outFile); + RETURN_IF_ERR(); RETURN_NONE(); } @@ -3978,7 +4029,7 @@ Py_XDECREF(dummy); } while(self->children_dbs) { - dummy=DB_close_internal(self->children_dbs,0); + dummy=DB_close_internal(self->children_dbs, 0, 0); Py_XDECREF(dummy); } } @@ -4003,7 +4054,7 @@ if (!PyArg_ParseTuple(args, "|i:close", &flags)) return NULL; - return DBEnv_close_internal(self,flags); + return DBEnv_close_internal(self, flags); } @@ -5949,7 +6000,7 @@ } #endif while (self->children_dbs) { - dummy=DB_close_internal(self->children_dbs,0); + dummy=DB_close_internal(self->children_dbs, 0, 0); Py_XDECREF(dummy); } @@ -6030,6 +6081,14 @@ self->txn=NULL; } + /* + ** "do_not_close" is used to dispose all related objects in the + ** tree, without actually releasing the "root" object. + ** This is done, for example, because function calls like + ** "DBSequence.remove()" implicitly close the underlying handle. So + ** the handle doesn't need to be closed, but related objects + ** must be cleaned up. + */ if (!do_not_close) { MYDB_BEGIN_ALLOW_THREADS err = self->sequence->close(self->sequence, flags); Modified: python/branches/tlee-ast-optimize/Modules/_bytesio.c ============================================================================== --- python/branches/tlee-ast-optimize/Modules/_bytesio.c (original) +++ python/branches/tlee-ast-optimize/Modules/_bytesio.c Wed Oct 1 00:24:45 2008 @@ -221,6 +221,8 @@ if (PyInt_Check(arg)) { size = PyInt_AsSsize_t(arg); + if (size == -1 && PyErr_Occurred()) + return NULL; } else if (arg == Py_None) { /* Read until EOF is reached, by default. */ @@ -288,6 +290,8 @@ if (PyInt_Check(arg)) { size = PyInt_AsSsize_t(arg); + if (size == -1 && PyErr_Occurred()) + return NULL; } else if (arg == Py_None) { /* No size limit, by default. */ @@ -332,6 +336,8 @@ if (PyInt_Check(arg)) { maxsize = PyInt_AsSsize_t(arg); + if (maxsize == -1 && PyErr_Occurred()) + return NULL; } else if (arg == Py_None) { /* No size limit, by default. */ @@ -415,6 +421,8 @@ if (PyInt_Check(arg)) { size = PyInt_AsSsize_t(arg); + if (size == -1 && PyErr_Occurred()) + return NULL; } else if (arg == Py_None) { /* Truncate to current position if no argument is passed. */ Modified: python/branches/tlee-ast-optimize/Modules/_ctypes/cfield.c ============================================================================== --- python/branches/tlee-ast-optimize/Modules/_ctypes/cfield.c (original) +++ python/branches/tlee-ast-optimize/Modules/_ctypes/cfield.c Wed Oct 1 00:24:45 2008 @@ -65,10 +65,12 @@ } if (bitsize /* this is a bitfield request */ && *pfield_size /* we have a bitfield open */ -#if defined(MS_WIN32) && !defined(__MINGW32__) - && dict->size * 8 == *pfield_size /* MSVC */ +#ifdef MS_WIN32 + /* MSVC, GCC with -mms-bitfields */ + && dict->size * 8 == *pfield_size #else - && dict->size * 8 <= *pfield_size /* GCC, MINGW */ + /* GCC */ + && dict->size * 8 <= *pfield_size #endif && (*pbitofs + bitsize) <= *pfield_size) { /* continue bit field */ @@ -163,7 +165,7 @@ break; case EXPAND_BITFIELD: - /* XXX needs more */ + *poffset += dict->size - *pfield_size/8; *psize += dict->size - *pfield_size/8; *pfield_size = dict->size * 8; Modified: python/branches/tlee-ast-optimize/Modules/_fileio.c ============================================================================== --- python/branches/tlee-ast-optimize/Modules/_fileio.c (original) +++ python/branches/tlee-ast-optimize/Modules/_fileio.c Wed Oct 1 00:24:45 2008 @@ -831,7 +831,7 @@ }; PyTypeObject PyFileIO_Type = { - PyVarObject_HEAD_INIT(&PyType_Type, 0) + PyVarObject_HEAD_INIT(NULL, 0) "_FileIO", sizeof(PyFileIOObject), 0, Modified: python/branches/tlee-ast-optimize/Modules/_lsprof.c ============================================================================== --- python/branches/tlee-ast-optimize/Modules/_lsprof.c (original) +++ python/branches/tlee-ast-optimize/Modules/_lsprof.c Wed Oct 1 00:24:45 2008 @@ -150,7 +150,16 @@ } Py_DECREF(o); if (PyErr_Occurred()) { - PyErr_WriteUnraisable((PyObject *) pObj); + PyObject *context = (PyObject *)pObj; + /* May have been called by profiler_dealloc(). */ + if (Py_REFCNT(context) < 1) { + context = PyString_FromString("profiler calling an " + "external timer"); + if (context == NULL) { + return 0; + } + } + PyErr_WriteUnraisable(context); return 0; } return result; Modified: python/branches/tlee-ast-optimize/Modules/_struct.c ============================================================================== --- python/branches/tlee-ast-optimize/Modules/_struct.c (original) +++ python/branches/tlee-ast-optimize/Modules/_struct.c Wed Oct 1 00:24:45 2008 @@ -1755,6 +1755,8 @@ /* Extract the offset from the first argument */ offset = PyInt_AsSsize_t(PyTuple_GET_ITEM(args, 1)); + if (offset == -1 && PyErr_Occurred()) + return NULL; /* Support negative offsets. */ if (offset < 0) Modified: python/branches/tlee-ast-optimize/Modules/bsddb.h ============================================================================== --- python/branches/tlee-ast-optimize/Modules/bsddb.h (original) +++ python/branches/tlee-ast-optimize/Modules/bsddb.h Wed Oct 1 00:24:45 2008 @@ -105,7 +105,7 @@ #error "eek! DBVER can't handle minor versions > 9" #endif -#define PY_BSDDB_VERSION "4.7.3pre5" +#define PY_BSDDB_VERSION "4.7.3" /* Python object definitions */ Modified: python/branches/tlee-ast-optimize/Modules/imageop.c ============================================================================== --- python/branches/tlee-ast-optimize/Modules/imageop.c (original) +++ python/branches/tlee-ast-optimize/Modules/imageop.c Wed Oct 1 00:24:45 2008 @@ -26,6 +26,46 @@ static PyObject *ImageopError; static PyObject *ImageopDict; +/** + * Check a coordonnate, make sure that (0 < value). + * Return 0 on error. + */ +static int +check_coordonnate(int value, const char* name) +{ + if ( 0 < value) + return 1; + PyErr_Format(PyExc_ValueError, "%s value is negative or nul", name); + return 0; +} + +/** + * Check integer overflow to make sure that product == x*y*size. + * Return 0 on error. + */ +static int +check_multiply_size(int product, int x, const char* xname, int y, const char* yname, int size) +{ + if ( !check_coordonnate(x, xname) ) + return 0; + if ( !check_coordonnate(y, yname) ) + return 0; + if ( size == (product / y) / x ) + return 1; + PyErr_SetString(ImageopError, "String has incorrect length"); + return 0; +} + +/** + * Check integer overflow to make sure that product == x*y. + * Return 0 on error. + */ +static int +check_multiply(int product, int x, int y) +{ + return check_multiply_size(product, x, "x", y, "y", 1); +} + /* If this function returns true (the default if anything goes wrong), we're behaving in a backward-compatible way with respect to how multi-byte pixels are stored in the strings. The code in this module was originally written @@ -85,26 +125,21 @@ if ( !PyArg_ParseTuple(args, "s#iiiiiii", &cp, &len, &size, &x, &y, &newx1, &newy1, &newx2, &newy2) ) return 0; - + if ( size != 1 && size != 2 && size != 4 ) { PyErr_SetString(ImageopError, "Size should be 1, 2 or 4"); return 0; } - if (( len != size*x*y ) || - ( size != ((len / x) / y) )) { - PyErr_SetString(ImageopError, "String has incorrect length"); + if ( !check_multiply_size(len, x, "x", y, "y", size) ) return 0; - } + xstep = (newx1 < newx2)? 1 : -1; ystep = (newy1 < newy2)? 1 : -1; - + nlen = (abs(newx2-newx1)+1)*(abs(newy2-newy1)+1)*size; - if ( size != ((nlen / (abs(newx2-newx1)+1)) / (abs(newy2-newy1)+1)) ) { - PyErr_SetString(ImageopError, "String has incorrect length"); + if ( !check_multiply_size(nlen, abs(newx2-newx1)+1, "abs(newx2-newx1)+1", abs(newy2-newy1)+1, "abs(newy2-newy1)+1", size) ) return 0; - } - rv = PyString_FromStringAndSize(NULL, - (abs(newx2-newx1)+1)*(abs(newy2-newy1)+1)*size); + rv = PyString_FromStringAndSize(NULL, nlen); if ( rv == 0 ) return 0; ncp = (char *)PyString_AsString(rv); @@ -131,7 +166,7 @@ } return rv; } - + static PyObject * imageop_scale(PyObject *self, PyObject *args) { @@ -146,22 +181,17 @@ if ( !PyArg_ParseTuple(args, "s#iiiii", &cp, &len, &size, &x, &y, &newx, &newy) ) return 0; - + if ( size != 1 && size != 2 && size != 4 ) { PyErr_SetString(ImageopError, "Size should be 1, 2 or 4"); return 0; } - if ( ( len != size*x*y ) || - ( size != ((len / x) / y) ) ) { - PyErr_SetString(ImageopError, "String has incorrect length"); + if ( !check_multiply_size(len, x, "x", y, "y", size) ) return 0; - } nlen = newx*newy*size; - if ( size != ((nlen / newx) / newy) ) { - PyErr_SetString(ImageopError, "String has incorrect length"); + if ( !check_multiply_size(nlen, newx, "newx", newy, "newy", size) ) return 0; - } - + rv = PyString_FromStringAndSize(NULL, nlen); if ( rv == 0 ) return 0; @@ -193,8 +223,8 @@ unsigned char *cp, *ncp; int width; PyObject *rv; - - + + if ( !PyArg_ParseTuple(args, "s#iii", &cp, &len, &width, &maxx, &maxy) ) return 0; @@ -202,12 +232,9 @@ PyErr_SetString(ImageopError, "Size should be 1 or 4"); return 0; } - if ( ( maxx*maxy*width != len ) || - ( maxx != ((len / maxy) / width) ) ) { - PyErr_SetString(ImageopError, "String has incorrect length"); + if ( !check_multiply_size(len, maxx, "max", maxy, "maxy", width) ) return 0; - } - + rv = PyString_FromStringAndSize(NULL, len); if ( rv == 0 ) return 0; @@ -248,17 +275,14 @@ unsigned char ovalue; PyObject *rv; int i, bit; - - + + if ( !PyArg_ParseTuple(args, "s#iii", &cp, &len, &x, &y, &tres) ) return 0; - if ( ( x*y != len ) || - ( x != len / y ) ) { - PyErr_SetString(ImageopError, "String has incorrect length"); + if ( !check_multiply(len, x, y) ) return 0; - } - + rv = PyString_FromStringAndSize(NULL, (len+7)/8); if ( rv == 0 ) return 0; @@ -290,17 +314,14 @@ PyObject *rv; int i; int pos; - - + + if ( !PyArg_ParseTuple(args, "s#ii", &cp, &len, &x, &y) ) return 0; - if ( ( x*y != len ) || - ( x != len / y ) ) { - PyErr_SetString(ImageopError, "String has incorrect length"); + if ( !check_multiply(len, x, y) ) return 0; - } - + rv = PyString_FromStringAndSize(NULL, (len+1)/2); if ( rv == 0 ) return 0; @@ -330,17 +351,14 @@ PyObject *rv; int i; int pos; - - + + if ( !PyArg_ParseTuple(args, "s#ii", &cp, &len, &x, &y) ) return 0; - if ( ( x*y != len ) || - ( x != len / y ) ) { - PyErr_SetString(ImageopError, "String has incorrect length"); + if ( !check_multiply(len, x, y) ) return 0; - } - + rv = PyString_FromStringAndSize(NULL, (len+3)/4); if ( rv == 0 ) return 0; @@ -369,17 +387,14 @@ unsigned char ovalue; PyObject *rv; int i, bit; - - + + if ( !PyArg_ParseTuple(args, "s#ii", &cp, &len, &x, &y) ) return 0; - if ( ( x*y != len ) || - ( x != len / y ) ) { - PyErr_SetString(ImageopError, "String has incorrect length"); + if ( !check_multiply(len, x, y) ) return 0; - } - + rv = PyString_FromStringAndSize(NULL, (len+7)/8); if ( rv == 0 ) return 0; @@ -416,17 +431,14 @@ int i; int pos; int sum = 0, nvalue; - - + + if ( !PyArg_ParseTuple(args, "s#ii", &cp, &len, &x, &y) ) return 0; - if ( ( x*y != len ) || - ( x != len / y ) ) { - PyErr_SetString(ImageopError, "String has incorrect length"); + if ( !check_multiply(len, x, y) ) return 0; - } - + rv = PyString_FromStringAndSize(NULL, (len+3)/4); if ( rv == 0 ) return 0; @@ -457,20 +469,18 @@ unsigned char *cp, *ncp; PyObject *rv; int i, bit; - + if ( !PyArg_ParseTuple(args, "s#iiii", &cp, &len, &x, &y, &v0, &v1) ) return 0; nlen = x*y; - if ( x != (nlen / y) ) { - PyErr_SetString(ImageopError, "String has incorrect length"); + if ( !check_multiply(nlen, x, y) ) return 0; - } if ( (nlen+7)/8 != len ) { PyErr_SetString(ImageopError, "String has incorrect length"); return 0; } - + rv = PyString_FromStringAndSize(NULL, nlen); if ( rv == 0 ) return 0; @@ -498,20 +508,19 @@ unsigned char *cp, *ncp; PyObject *rv; int i, pos, value = 0, nvalue; - + if ( !PyArg_ParseTuple(args, "s#ii", &cp, &len, &x, &y) ) return 0; nlen = x*y; - if ( x != (nlen / y) ) { - PyErr_SetString(ImageopError, "String has incorrect length"); + if ( !check_multiply(nlen, x, y) ) { return 0; } if ( (nlen+3)/4 != len ) { PyErr_SetString(ImageopError, "String has incorrect length"); return 0; } - + rv = PyString_FromStringAndSize(NULL, nlen); if ( rv == 0 ) return 0; @@ -538,20 +547,18 @@ unsigned char *cp, *ncp; PyObject *rv; int i, pos, value = 0, nvalue; - + if ( !PyArg_ParseTuple(args, "s#ii", &cp, &len, &x, &y) ) return 0; nlen = x*y; - if ( x != (nlen / y) ) { - PyErr_SetString(ImageopError, "String has incorrect length"); + if ( !check_multiply(nlen, x, y) ) return 0; - } if ( (nlen+1)/2 != len ) { PyErr_SetString(ImageopError, "String has incorrect length"); return 0; } - + rv = PyString_FromStringAndSize(NULL, nlen); if ( rv == 0 ) return 0; @@ -579,20 +586,16 @@ PyObject *rv; int i, r, g, b; int backward_compatible = imageop_backward_compatible(); - + if ( !PyArg_ParseTuple(args, "s#ii", &cp, &len, &x, &y) ) return 0; - nlen = x*y; - if ( x != (nlen / y) ) { - PyErr_SetString(ImageopError, "String has incorrect length"); + if ( !check_multiply_size(len*4, x, "x", y, "y", 4) ) return 0; - } - if ( nlen*4 != len ) { - PyErr_SetString(ImageopError, "String has incorrect length"); + nlen = x*y; + if ( !check_multiply(nlen, x, y) ) return 0; - } - + rv = PyString_FromStringAndSize(NULL, nlen); if ( rv == 0 ) return 0; @@ -627,31 +630,22 @@ int i, r, g, b; unsigned char value; int backward_compatible = imageop_backward_compatible(); - + if ( !PyArg_ParseTuple(args, "s#ii", &cp, &len, &x, &y) ) return 0; - nlen = x*y; - if ( x != (nlen / y) ) { - PyErr_SetString(ImageopError, "String has incorrect length"); - return 0; - } - if ( nlen != len ) { - PyErr_SetString(ImageopError, "String has incorrect length"); + if ( !check_multiply(len, x, y) ) return 0; - } - - if ( nlen / x != y || nlen > INT_MAX / 4) { - PyErr_SetString(ImageopError, "Image is too large"); + nlen = x*y*4; + if ( !check_multiply_size(nlen, x, "x", y, "y", 4) ) return 0; - } - - rv = PyString_FromStringAndSize(NULL, nlen*4); + + rv = PyString_FromStringAndSize(NULL, nlen); if ( rv == 0 ) return 0; ncp = (unsigned char *)PyString_AsString(rv); - for ( i=0; i < nlen; i++ ) { + for ( i=0; i < len; i++ ) { /* Bits in source: RRRBBGGG ** Red and Green are multiplied by 36.5, Blue by 85 */ @@ -686,20 +680,16 @@ int i, r, g, b; int nvalue; int backward_compatible = imageop_backward_compatible(); - + if ( !PyArg_ParseTuple(args, "s#ii", &cp, &len, &x, &y) ) return 0; - nlen = x*y; - if ( x != (nlen / y) ) { - PyErr_SetString(ImageopError, "String has incorrect length"); + if ( !check_multiply_size(len, x, "x", y, "y", 4) ) return 0; - } - if ( nlen*4 != len ) { - PyErr_SetString(ImageopError, "String has incorrect length"); + nlen = x*y; + if ( !check_multiply(nlen, x, y) ) return 0; - } - + rv = PyString_FromStringAndSize(NULL, nlen); if ( rv == 0 ) return 0; @@ -735,31 +725,22 @@ int i; unsigned char value; int backward_compatible = imageop_backward_compatible(); - + if ( !PyArg_ParseTuple(args, "s#ii", &cp, &len, &x, &y) ) return 0; - nlen = x*y; - if ( x != (nlen / y) ) { - PyErr_SetString(ImageopError, "String has incorrect length"); + if ( !check_multiply(len, x, y) ) return 0; - } - if ( nlen != len ) { - PyErr_SetString(ImageopError, "String has incorrect length"); + nlen = x*y*4; + if ( !check_multiply_size(nlen, x, "x", y, "y", 4) ) return 0; - } - - if ( nlen / x != y || nlen > INT_MAX / 4) { - PyErr_SetString(ImageopError, "Image is too large"); - return 0; - } - - rv = PyString_FromStringAndSize(NULL, nlen*4); + + rv = PyString_FromStringAndSize(NULL, nlen); if ( rv == 0 ) return 0; ncp = (unsigned char *)PyString_AsString(rv); - for ( i=0; i < nlen; i++ ) { + for ( i=0; i < len; i++ ) { value = *cp++; if (backward_compatible) { * (Py_UInt32 *) ncp = (Py_UInt32) value | ((Py_UInt32) value << 8 ) | ((Py_UInt32) value << 16); @@ -774,39 +755,6 @@ return rv; } -/* -static object * -imageop_mul(object *self, object *args) -{ - char *cp, *ncp; - int len, size, x, y; - object *rv; - int i; - - if ( !getargs(args, "(s#iii)", &cp, &len, &size, &x, &y) ) - return 0; - - if ( size != 1 && size != 4 ) { - err_setstr(ImageopError, "Size should be 1 or 4"); - return 0; - } - if ( len != size*x*y ) { - err_setstr(ImageopError, "String has incorrect length"); - return 0; - } - - rv = newsizedstringobject(NULL, XXXX); - if ( rv == 0 ) - return 0; - ncp = (char *)getstringvalue(rv); - - - for ( i=0; i < len; i += size ) { - } - return rv; -} -*/ - static PyMethodDef imageop_methods[] = { { "crop", imageop_crop, METH_VARARGS }, { "scale", imageop_scale, METH_VARARGS }, @@ -831,11 +779,11 @@ initimageop(void) { PyObject *m; - + if (PyErr_WarnPy3k("the imageop module has been removed in " "Python 3.0", 2) < 0) return; - + m = Py_InitModule("imageop", imageop_methods); if (m == NULL) return; Modified: python/branches/tlee-ast-optimize/Modules/selectmodule.c ============================================================================== --- python/branches/tlee-ast-optimize/Modules/selectmodule.c (original) +++ python/branches/tlee-ast-optimize/Modules/selectmodule.c Wed Oct 1 00:24:45 2008 @@ -1607,7 +1607,7 @@ } PyDoc_STRVAR(kqueue_queue_control_doc, -"control(changelist, max_events=0[, timeout=None]) -> eventlist\n\ +"control(changelist, max_events[, timeout=None]) -> eventlist\n\ \n\ Calls the kernel kevent function.\n\ - changelist must be a list of kevent objects describing the changes\n\ Modified: python/branches/tlee-ast-optimize/Objects/fileobject.c ============================================================================== --- python/branches/tlee-ast-optimize/Objects/fileobject.c (original) +++ python/branches/tlee-ast-optimize/Objects/fileobject.c Wed Oct 1 00:24:45 2008 @@ -305,10 +305,17 @@ #endif /* EINVAL is returned when an invalid filename or * an invalid mode is supplied. */ - if (errno == EINVAL) - PyErr_Format(PyExc_IOError, - "invalid filename: %s or mode: %s", - name, mode); + if (errno == EINVAL) { + PyObject *v; + char message[100]; + PyOS_snprintf(message, 100, + "invalid mode ('%.50s') or filename", mode); + v = Py_BuildValue("(isO)", errno, message, f->f_name); + if (v != NULL) { + PyErr_SetObject(PyExc_IOError, v); + Py_DECREF(v); + } + } else PyErr_SetFromErrnoWithFilenameObject(PyExc_IOError, f->f_name); f = NULL; Modified: python/branches/tlee-ast-optimize/Objects/floatobject.c ============================================================================== --- python/branches/tlee-ast-optimize/Objects/floatobject.c (original) +++ python/branches/tlee-ast-optimize/Objects/floatobject.c Wed Oct 1 00:24:45 2008 @@ -1339,12 +1339,12 @@ s++; /* infinities and nans */ - if (PyOS_mystrnicmp(s, "nan", 4) == 0) { + if (PyOS_strnicmp(s, "nan", 4) == 0) { x = Py_NAN; goto finished; } - if (PyOS_mystrnicmp(s, "inf", 4) == 0 || - PyOS_mystrnicmp(s, "infinity", 9) == 0) { + if (PyOS_strnicmp(s, "inf", 4) == 0 || + PyOS_strnicmp(s, "infinity", 9) == 0) { x = sign*Py_HUGE_VAL; goto finished; } Modified: python/branches/tlee-ast-optimize/Objects/obmalloc.c ============================================================================== --- python/branches/tlee-ast-optimize/Objects/obmalloc.c (original) +++ python/branches/tlee-ast-optimize/Objects/obmalloc.c Wed Oct 1 00:24:45 2008 @@ -677,8 +677,8 @@ /* This is only useful when running memory debuggers such as * Purify or Valgrind. Uncomment to use. * - */ #define Py_USING_MEMORY_DEBUGGER + */ #ifdef Py_USING_MEMORY_DEBUGGER Modified: python/branches/tlee-ast-optimize/Objects/stringlib/count.h ============================================================================== --- python/branches/tlee-ast-optimize/Objects/stringlib/count.h (original) +++ python/branches/tlee-ast-optimize/Objects/stringlib/count.h Wed Oct 1 00:24:45 2008 @@ -13,11 +13,10 @@ { Py_ssize_t count; - if (sub_len == 0) { - if (str_len < 0) - return 0; /* start > len(str) */ + if (str_len < 0) + return 0; /* start > len(str) */ + if (sub_len == 0) return str_len + 1; - } count = fastsearch(str, str_len, sub, sub_len, FAST_COUNT); Modified: python/branches/tlee-ast-optimize/Objects/stringlib/find.h ============================================================================== --- python/branches/tlee-ast-optimize/Objects/stringlib/find.h (original) +++ python/branches/tlee-ast-optimize/Objects/stringlib/find.h Wed Oct 1 00:24:45 2008 @@ -14,11 +14,10 @@ { Py_ssize_t pos; - if (sub_len == 0) { - if (str_len < 0) - return -1; + if (str_len < 0) + return -1; + if (sub_len == 0) return offset; - } pos = fastsearch(str, str_len, sub, sub_len, FAST_SEARCH); Modified: python/branches/tlee-ast-optimize/PC/os2emx/Makefile ============================================================================== --- python/branches/tlee-ast-optimize/PC/os2emx/Makefile (original) +++ python/branches/tlee-ast-optimize/PC/os2emx/Makefile Wed Oct 1 00:24:45 2008 @@ -287,7 +287,7 @@ Modules/binascii.c \ Modules/cmathmodule.c \ Modules/_codecsmodule.c \ - Modules/collectionsmodule.c \ + Modules/_collectionsmodule.c \ Modules/cPickle.c \ Modules/cStringIO.c \ Modules/_csv.c \ @@ -295,6 +295,7 @@ Modules/dlmodule.c \ Modules/errnomodule.c \ Modules/fcntlmodule.c \ + Modules/_fileio.c \ Modules/_functoolsmodule.c \ Modules/_heapqmodule.c \ Modules/imageop.c \ @@ -305,7 +306,6 @@ Modules/md5module.c \ Modules/operator.c \ Modules/_randommodule.c \ - Modules/rgbimgmodule.c \ Modules/shamodule.c \ Modules/sha256module.c \ Modules/sha512module.c \ @@ -343,6 +343,8 @@ Python/compile.c \ Python/codecs.c \ Python/errors.c \ + Python/formatter_string.c \ + Python/formatter_unicode.c \ Python/frozen.c \ Python/frozenmain.c \ Python/future.c \ @@ -359,8 +361,10 @@ Python/modsupport.c \ Python/mysnprintf.c \ Python/mystrtoul.c \ + Python/peephole.c \ Python/pyarena.c \ Python/pyfpe.c \ + Python/pymath.c \ Python/pystate.c \ Python/pystrtod.c \ Python/pythonrun.c \ @@ -370,11 +374,14 @@ Python/traceback.c \ Python/getopt.c \ Python/dynload_shlib.c \ - Python/thread.c) + Python/thread.c \ + Python/_warnings.c) SRC.OBJECT= $(addprefix $(TOP), \ Objects/abstract.c \ Objects/boolobject.c \ Objects/bufferobject.c \ + Objects/bytearrayobject.c \ + Objects/bytes_methods.c \ Objects/cellobject.c \ Objects/classobject.c \ Objects/cobject.c \ Modified: python/branches/tlee-ast-optimize/PC/os2emx/config.c ============================================================================== --- python/branches/tlee-ast-optimize/PC/os2emx/config.c (original) +++ python/branches/tlee-ast-optimize/PC/os2emx/config.c Wed Oct 1 00:24:45 2008 @@ -52,12 +52,13 @@ extern void initbinascii(); extern void initcPickle(); extern void initcStringIO(); -extern void initcollections(); +extern void init_collections(); extern void initcmath(); extern void initdatetime(); extern void initdl(); extern void initerrno(); extern void initfcntl(); +extern void init_fileio(); extern void init_functools(); extern void init_heapq(); extern void initimageop(); @@ -65,7 +66,6 @@ extern void initmath(); extern void init_md5(); extern void initoperator(); -extern void initrgbimg(); extern void init_sha(); extern void init_sha256(); extern void init_sha512(); @@ -118,12 +118,13 @@ {"binascii", initbinascii}, {"cPickle", initcPickle}, {"cStringIO", initcStringIO}, - {"collections", initcollections}, + {"_collections", init_collections}, {"cmath", initcmath}, {"datetime", initdatetime}, {"dl", initdl}, {"errno", initerrno}, {"fcntl", initfcntl}, + {"_fileio", init_fileio}, {"_functools", init_functools}, {"_heapq", init_heapq}, {"imageop", initimageop}, @@ -131,7 +132,6 @@ {"math", initmath}, {"_md5", init_md5}, {"operator", initoperator}, - {"rgbimg", initrgbimg}, {"_sha", init_sha}, {"_sha256", init_sha256}, {"_sha512", init_sha512}, Modified: python/branches/tlee-ast-optimize/PC/os2emx/pyconfig.h ============================================================================== --- python/branches/tlee-ast-optimize/PC/os2emx/pyconfig.h (original) +++ python/branches/tlee-ast-optimize/PC/os2emx/pyconfig.h Wed Oct 1 00:24:45 2008 @@ -264,6 +264,9 @@ /* Define if you have the header file. */ #undef HAVE_CONIO_H +/* Define to 1 if you have the `copysign' function. */ +#define HAVE_COPYSIGN 1 + /* Define if you have the header file. */ #undef HAVE_DIRECT_H Modified: python/branches/tlee-ast-optimize/PCbuild/readme.txt ============================================================================== --- python/branches/tlee-ast-optimize/PCbuild/readme.txt (original) +++ python/branches/tlee-ast-optimize/PCbuild/readme.txt Wed Oct 1 00:24:45 2008 @@ -21,7 +21,7 @@ The PCbuild directory is compatible with all versions of Visual Studio from VS C++ Express Edition over the standard edition up to the professional -edition. However the express edition does support features like solution +edition. However the express edition does not support features like solution folders or profile guided optimization (PGO). The missing bits and pieces won't stop you from building Python. @@ -104,7 +104,7 @@ Python-controlled subprojects that wrap external projects: _bsddb - Wraps Berkeley DB 4.4.20, which is currently built by _bsddb44.vcproj. + Wraps Berkeley DB 4.7.25, which is currently built by _bsddb.vcproj. project (see below). _sqlite3 Wraps SQLite 3.5.9, which is currently built by sqlite3.vcproj (see below). @@ -153,7 +153,7 @@ build process will automatically select the latest version. You must install the NASM assembler from - http://www.kernel.org/pub/software/devel/nasm/binaries/win32/ + http://nasm.sf.net for x86 builds. Put nasmw.exe anywhere in your PATH. You can also install ActivePerl from @@ -213,7 +213,7 @@ This will be cleaned up in the future; ideally Tcl/Tk will be brought into our pcbuild.sln as custom .vcproj files, just as we've recently done with the -_bsddb44.vcproj and sqlite3.vcproj files, which will remove the need for +_bsddb.vcproj and sqlite3.vcproj files, which will remove the need for Tcl/Tk to be built separately via a batch file. XXX trent.nelson 02-Apr-08: Modified: python/branches/tlee-ast-optimize/Python/pymath.c ============================================================================== --- python/branches/tlee-ast-optimize/Python/pymath.c (original) +++ python/branches/tlee-ast-optimize/Python/pymath.c Wed Oct 1 00:24:45 2008 @@ -35,6 +35,8 @@ #endif /* HAVE_COPYSIGN */ #ifndef HAVE_LOG1P +#include + double log1p(double x) { Modified: python/branches/tlee-ast-optimize/setup.py ============================================================================== --- python/branches/tlee-ast-optimize/setup.py (original) +++ python/branches/tlee-ast-optimize/setup.py Wed Oct 1 00:24:45 2008 @@ -1269,6 +1269,14 @@ ) libraries = [] + elif platform.startswith('openbsd'): + macros = dict( # OpenBSD + HAVE_SEM_OPEN=0, # Not implemented + HAVE_SEM_TIMEDWAIT=0, + HAVE_FD_TRANSFER=1, + ) + libraries = [] + else: # Linux and other unices macros = dict( HAVE_SEM_OPEN=1, From python-checkins at python.org Wed Oct 1 01:27:11 2008 From: python-checkins at python.org (benjamin.peterson) Date: Wed, 1 Oct 2008 01:27:11 +0200 (CEST) Subject: [Python-checkins] r66707 - in sandbox/trunk/2to3/lib2to3: fixes/fix_import.py tests/test_fixers.py Message-ID: <20080930232711.4AE261E4006@bag.python.org> Author: benjamin.peterson Date: Wed Oct 1 01:27:10 2008 New Revision: 66707 Log: fix #4001: fix_imports didn't check for __init__.py before converting to relative imports Modified: sandbox/trunk/2to3/lib2to3/fixes/fix_import.py sandbox/trunk/2to3/lib2to3/tests/test_fixers.py Modified: sandbox/trunk/2to3/lib2to3/fixes/fix_import.py ============================================================================== --- sandbox/trunk/2to3/lib2to3/fixes/fix_import.py (original) +++ sandbox/trunk/2to3/lib2to3/fixes/fix_import.py Wed Oct 1 01:27:10 2008 @@ -54,6 +54,10 @@ imp_name = imp_name.split('.', 1)[0].strip() base_path = dirname(file_path) base_path = join(base_path, imp_name) + # If there is no __init__.py next to the file its not in a package + # so can't be a relative import. + if not exists(join(dirname(base_path), '__init__.py')): + return False for ext in ['.py', pathsep, '.pyc', '.so', '.sl', '.pyd']: if exists(base_path + ext): return True Modified: sandbox/trunk/2to3/lib2to3/tests/test_fixers.py ============================================================================== --- sandbox/trunk/2to3/lib2to3/tests/test_fixers.py (original) +++ sandbox/trunk/2to3/lib2to3/tests/test_fixers.py Wed Oct 1 01:27:10 2008 @@ -9,10 +9,10 @@ import support # Python imports +import os import unittest from itertools import chain from operator import itemgetter -from os.path import dirname, pathsep # Local imports from .. import pygram @@ -3272,14 +3272,19 @@ # Need to replace fix_import's exists method # so we can check that it's doing the right thing self.files_checked = [] + self.present_files = set() self.always_exists = True def fake_exists(name): self.files_checked.append(name) - return self.always_exists + return self.always_exists or (name in self.present_files) from ..fixes import fix_import fix_import.exists = fake_exists + def tearDown(self): + from lib2to3.fixes import fix_import + fix_import.exists = os.path.exists + def check_both(self, b, a): self.always_exists = True FixerTestCase.check(self, b, a) @@ -3289,10 +3294,12 @@ def test_files_checked(self): def p(path): # Takes a unix path and returns a path with correct separators - return pathsep.join(path.split("/")) + return os.path.pathsep.join(path.split("/")) self.always_exists = False - expected_extensions = ('.py', pathsep, '.pyc', '.so', '.sl', '.pyd') + self.present_files = set(['__init__.py']) + expected_extensions = ('.py', os.path.pathsep, '.pyc', '.so', + '.sl', '.pyd') names_to_test = (p("/spam/eggs.py"), "ni.py", p("../../shrubbery.py")) for name in names_to_test: @@ -3300,11 +3307,32 @@ self.filename = name self.unchanged("import jam") - if dirname(name): name = dirname(name) + '/jam' - else: name = 'jam' + if os.path.dirname(name): + name = os.path.dirname(name) + '/jam' + else: + name = 'jam' expected_checks = set(name + ext for ext in expected_extensions) + expected_checks.add("__init__.py") + + self.assertEqual(set(self.files_checked), expected_checks) + + def test_not_in_package(self): + s = "import bar" + self.always_exists = False + self.present_files = set(["bar.py"]) + self.unchanged(s) - self.failUnlessEqual(set(self.files_checked), expected_checks) + def test_in_package(self): + b = "import bar" + a = "from . import bar" + self.always_exists = False + self.present_files = set(["__init__.py", "bar.py"]) + self.check(b, a) + + def test_comments_and_indent(self): + b = "import bar # Foo" + a = "from . import bar # Foo" + self.check(b, a) def test_from(self): b = "from foo import bar, baz" From buildbot at python.org Wed Oct 1 03:40:31 2008 From: buildbot at python.org (buildbot at python.org) Date: Wed, 01 Oct 2008 01:40:31 +0000 Subject: [Python-checkins] buildbot failure in x86 XP-4 trunk Message-ID: <20081001014032.00DE31E4025@bag.python.org> The Buildbot has detected a new failure of x86 XP-4 trunk. Full details are available at: http://www.python.org/dev/buildbot/all/x86%20XP-4%20trunk/builds/1547 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: bolen-windows Build Reason: The web-page 'rebuild' button was pressed by '': Build Source Stamp: [branch trunk] HEAD Blamelist: BUILD FAILED: failed test Excerpt from the test logfile: 3 tests failed: test_bsddb3 test_urllib2_localnet test_urllibnet ====================================================================== ERROR: test01_badpointer (bsddb.test.test_misc.MiscTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\trunk.bolen-windows\build\lib\bsddb\test\test_misc.py", line 21, in test01_badpointer dbs = dbshelve.open(self.filename) File "E:\cygwin\home\db3l\buildarea\trunk.bolen-windows\build\lib\bsddb\dbshelve.py", line 106, in open d.open(filename, dbname, filetype, flags, mode) File "E:\cygwin\home\db3l\buildarea\trunk.bolen-windows\build\lib\bsddb\dbshelve.py", line 171, in open self.db.open(*args, **kwargs) DBFileExistsError: (17, 'File exists -- __fop_file_setup: Retry limit (100) exceeded') ====================================================================== ERROR: test03_repr_closed_db (bsddb.test.test_misc.MiscTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\trunk.bolen-windows\build\lib\bsddb\test\test_misc.py", line 37, in test03_repr_closed_db db = hashopen(self.filename) File "E:\cygwin\home\db3l\buildarea\trunk.bolen-windows\build\lib\bsddb\__init__.py", line 361, in hashopen d.open(file, db.DB_HASH, flags, mode) DBFileExistsError: (17, 'File exists -- __fop_file_setup: Retry limit (100) exceeded') ====================================================================== ERROR: test04_repr_db (bsddb.test.test_misc.MiscTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\trunk.bolen-windows\build\lib\bsddb\test\test_misc.py", line 43, in test04_repr_db db = hashopen(self.filename) File "E:\cygwin\home\db3l\buildarea\trunk.bolen-windows\build\lib\bsddb\__init__.py", line 361, in hashopen d.open(file, db.DB_HASH, flags, mode) DBFileExistsError: (17, 'File exists -- __fop_file_setup: Retry limit (100) exceeded') ====================================================================== ERROR: test05_double_free_make_key_dbt (bsddb.test.test_misc.MiscTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\trunk.bolen-windows\build\lib\bsddb\test\test_misc.py", line 65, in test05_double_free_make_key_dbt db.DB_CREATE | db.DB_THREAD) DBFileExistsError: (17, 'File exists -- __fop_file_setup: Retry limit (100) exceeded') ====================================================================== ERROR: test06_key_with_null_bytes (bsddb.test.test_misc.MiscTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\trunk.bolen-windows\build\lib\bsddb\test\test_misc.py", line 77, in test06_key_with_null_bytes db1.open(self.filename, None, db.DB_HASH, db.DB_CREATE) DBFileExistsError: (17, 'File exists -- __fop_file_setup: Retry limit (100) exceeded') ====================================================================== ERROR: test07_DB_set_flags_persists (bsddb.test.test_misc.MiscTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\trunk.bolen-windows\build\lib\bsddb\test\test_misc.py", line 101, in test07_DB_set_flags_persists db1.open(self.filename, db.DB_HASH, db.DB_CREATE) DBFileExistsError: (17, 'File exists -- __fop_file_setup: Retry limit (100) exceeded') ====================================================================== FAIL: test_bad_address (test.test_urllib2_localnet.TestUrlopen) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\trunk.bolen-windows\build\lib\test\test_urllib2_localnet.py", line 477, in test_bad_address urllib2.urlopen, "http://www.python.invalid./") AssertionError: IOError not raised ====================================================================== FAIL: test_bad_address (test.test_urllibnet.urlopenNetworkTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\trunk.bolen-windows\build\lib\test\test_urllibnet.py", line 140, in test_bad_address urllib.urlopen, "http://www.python.invalid./") AssertionError: IOError not raised sincerely, -The Buildbot From buildbot at python.org Wed Oct 1 04:16:34 2008 From: buildbot at python.org (buildbot at python.org) Date: Wed, 01 Oct 2008 02:16:34 +0000 Subject: [Python-checkins] buildbot failure in x86 XP-4 3.0 Message-ID: <20081001021634.E55701E4002@bag.python.org> The Buildbot has detected a new failure of x86 XP-4 3.0. Full details are available at: http://www.python.org/dev/buildbot/all/x86%20XP-4%203.0/builds/1189 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: bolen-windows Build Reason: The web-page 'rebuild' button was pressed by '': Build Source Stamp: [branch branches/py3k] HEAD Blamelist: amaury.forgeotdarc,andrew.macintyre,antoine.pitrou,barry.warsaw,benjamin.peterson,brett.cannon,georg.brandl,gerhard.haering,hirokazu.yamamoto,martin.v.loewis,robert.schuppenies,skip.montanaro,thomas.heller BUILD FAILED: failed test Excerpt from the test logfile: 2 tests failed: test_urllib2_localnet test_urllibnet ====================================================================== FAIL: test_bad_address (test.test_urllib2_localnet.TestUrlopen) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_urllib2_localnet.py", line 452, in test_bad_address "http://www.python.invalid./") AssertionError: IOError not raised by urlopen ====================================================================== FAIL: test_bad_address (test.test_urllibnet.urlopenNetworkTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_urllibnet.py", line 142, in test_bad_address "http://www.python.invalid./") AssertionError: IOError not raised by urlopen sincerely, -The Buildbot From buildbot at python.org Wed Oct 1 04:52:25 2008 From: buildbot at python.org (buildbot at python.org) Date: Wed, 01 Oct 2008 02:52:25 +0000 Subject: [Python-checkins] buildbot failure in x86 XP-4 2.5 Message-ID: <20081001025225.A3F911E4002@bag.python.org> The Buildbot has detected a new failure of x86 XP-4 2.5. Full details are available at: http://www.python.org/dev/buildbot/all/x86%20XP-4%202.5/builds/246 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: bolen-windows Build Reason: Build Source Stamp: [branch branches/release25-maint] HEAD Blamelist: amaury.forgeotdarc,benjamin.peterson,brett.cannon,georg.brandl,thomas.heller BUILD FAILED: failed test Excerpt from the test logfile: 2 tests failed: test_urllib2net test_urllibnet ====================================================================== FAIL: test_bad_address (test.test_urllib2net.urlopenNetworkTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\2.5.bolen-windows\build\lib\test\test_urllib2net.py", line 147, in test_bad_address urllib2.urlopen, "http://www.python.invalid./") AssertionError: IOError not raised ====================================================================== FAIL: test_bad_address (test.test_urllibnet.urlopenNetworkTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\2.5.bolen-windows\build\lib\test\test_urllibnet.py", line 113, in test_bad_address urllib.urlopen, "http://www.python.invalid./") AssertionError: IOError not raised sincerely, -The Buildbot From python-checkins at python.org Wed Oct 1 05:25:26 2008 From: python-checkins at python.org (andrew.macintyre) Date: Wed, 1 Oct 2008 05:25:26 +0200 (CEST) Subject: [Python-checkins] r66708 - python/trunk/Lib/test/test_array.py Message-ID: <20081001032526.1E7F51E403B@bag.python.org> Author: andrew.macintyre Date: Wed Oct 1 05:25:25 2008 New Revision: 66708 Log: fix for issue 3862: test_array fails FreeBSD 7 amd64 FreeBSD 7's underlying malloc() is behaves differently to earlier versions and seriously overcommits available memory on amd64. This may affect other 64bit platforms in some circumstances, so the scale of the problematic test is wound back. Patch by Mark Dickinson, reviewed by Martin von Loewis. Modified: python/trunk/Lib/test/test_array.py Modified: python/trunk/Lib/test/test_array.py ============================================================================== --- python/trunk/Lib/test/test_array.py (original) +++ python/trunk/Lib/test/test_array.py Wed Oct 1 05:25:25 2008 @@ -1011,20 +1011,21 @@ minitemsize = 8 def test_alloc_overflow(self): + from sys import maxsize a = array.array('d', [-1]*65536) try: - a *= 65536 + a *= maxsize//65536 + 1 except MemoryError: pass else: - self.fail("a *= 2**16 didn't raise MemoryError") + self.fail("Array of size > maxsize created - MemoryError expected") b = array.array('d', [ 2.71828183, 3.14159265, -1]) try: - b * 1431655766 + b * (maxsize//3 + 1) except MemoryError: pass else: - self.fail("a * 1431655766 didn't raise MemoryError") + self.fail("Array of size > maxsize created - MemoryError expected") tests.append(DoubleTest) From buildbot at python.org Wed Oct 1 06:12:04 2008 From: buildbot at python.org (buildbot at python.org) Date: Wed, 01 Oct 2008 04:12:04 +0000 Subject: [Python-checkins] buildbot failure in x86 W2k8 trunk Message-ID: <20081001041204.D4A031E4002@bag.python.org> The Buildbot has detected a new failure of x86 W2k8 trunk. Full details are available at: http://www.python.org/dev/buildbot/all/x86%20W2k8%20trunk/builds/222 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: nelson-windows Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: andrew.macintyre BUILD FAILED: failed failed slave lost sincerely, -The Buildbot From buildbot at python.org Wed Oct 1 06:25:34 2008 From: buildbot at python.org (buildbot at python.org) Date: Wed, 01 Oct 2008 04:25:34 +0000 Subject: [Python-checkins] buildbot failure in g4 osx.4 trunk Message-ID: <20081001042534.74CEE1E4002@bag.python.org> The Buildbot has detected a new failure of g4 osx.4 trunk. Full details are available at: http://www.python.org/dev/buildbot/all/g4%20osx.4%20trunk/builds/3980 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: psf-g4 Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: andrew.macintyre BUILD FAILED: failed test Excerpt from the test logfile: Traceback (most recent call last): File "/Users/buildslave/bb/trunk.psf-g4/build/Lib/threading.py", line 522, in __bootstrap_inner self.run() File "/Users/buildslave/bb/trunk.psf-g4/build/Lib/test/test_ftplib.py", line 203, in run asyncore.loop(timeout=0.1, count=1) File "/Users/buildslave/bb/trunk.psf-g4/build/Lib/asyncore.py", line 204, in loop poll_fun(timeout, map) File "/Users/buildslave/bb/trunk.psf-g4/build/Lib/asyncore.py", line 141, in poll read(obj) File "/Users/buildslave/bb/trunk.psf-g4/build/Lib/asyncore.py", line 78, in read obj.handle_error() File "/Users/buildslave/bb/trunk.psf-g4/build/Lib/asyncore.py", line 74, in read obj.handle_read_event() File "/Users/buildslave/bb/trunk.psf-g4/build/Lib/asyncore.py", line 413, in handle_read_event self.handle_read() File "/Users/buildslave/bb/trunk.psf-g4/build/Lib/test/test_ssl.py", line 408, in handle_read self.send(data.lower()) File "/Users/buildslave/bb/trunk.psf-g4/build/Lib/asyncore.py", line 519, in send self.initiate_send() File "/Users/buildslave/bb/trunk.psf-g4/build/Lib/asyncore.py", line 506, in initiate_send num_sent = dispatcher.send(self, self.out_buffer[:512]) File "/Users/buildslave/bb/trunk.psf-g4/build/Lib/asyncore.py", line 349, in send result = self.socket.send(data) File "/Users/buildslave/bb/trunk.psf-g4/build/Lib/socket.py", line 165, in _dummy raise error(EBADF, 'Bad file descriptor') error: [Errno 9] Bad file descriptor 1 test failed: test_ftplib make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Wed Oct 1 06:40:10 2008 From: buildbot at python.org (buildbot at python.org) Date: Wed, 01 Oct 2008 04:40:10 +0000 Subject: [Python-checkins] buildbot failure in S-390 Debian trunk Message-ID: <20081001044010.D032F1E4007@bag.python.org> The Buildbot has detected a new failure of S-390 Debian trunk. Full details are available at: http://www.python.org/dev/buildbot/all/S-390%20Debian%20trunk/builds/1145 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-debian-s390 Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: andrew.macintyre BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_urllib2net make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Wed Oct 1 06:54:54 2008 From: buildbot at python.org (buildbot at python.org) Date: Wed, 01 Oct 2008 04:54:54 +0000 Subject: [Python-checkins] buildbot failure in x86 XP-4 trunk Message-ID: <20081001045454.B601F1E4002@bag.python.org> The Buildbot has detected a new failure of x86 XP-4 trunk. Full details are available at: http://www.python.org/dev/buildbot/all/x86%20XP-4%20trunk/builds/1550 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: bolen-windows Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: andrew.macintyre BUILD FAILED: failed test Excerpt from the test logfile: sincerely, -The Buildbot From buildbot at python.org Wed Oct 1 10:37:44 2008 From: buildbot at python.org (buildbot at python.org) Date: Wed, 01 Oct 2008 08:37:44 +0000 Subject: [Python-checkins] buildbot failure in x86 OpenBSD 2.5 Message-ID: <20081001083744.575BD1E4002@bag.python.org> The Buildbot has detected a new failure of x86 OpenBSD 2.5. Full details are available at: http://www.python.org/dev/buildbot/all/x86%20OpenBSD%202.5/builds/46 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: cortesi Build Reason: The web-page 'rebuild' button was pressed by '': Build Source Stamp: [branch branches/release25-maint] HEAD Blamelist: amaury.forgeotdarc,benjamin.peterson,brett.cannon,georg.brandl,gregory.p.smith,hirokazu.yamamoto,thomas.heller BUILD FAILED: failed test Excerpt from the test logfile: sincerely, -The Buildbot From python-checkins at python.org Wed Oct 1 13:19:51 2008 From: python-checkins at python.org (martin.v.loewis) Date: Wed, 1 Oct 2008 13:19:51 +0200 (CEST) Subject: [Python-checkins] r66710 - in python/trunk: Misc/NEWS Tools/msi/msi.py Message-ID: <20081001111951.24CAE1E4002@bag.python.org> Author: martin.v.loewis Date: Wed Oct 1 13:19:50 2008 New Revision: 66710 Log: Bug #3989: Package the 2to3 script (as 2to3.py) in the Windows installer. Modified: python/trunk/Misc/NEWS python/trunk/Tools/msi/msi.py Modified: python/trunk/Misc/NEWS ============================================================================== --- python/trunk/Misc/NEWS (original) +++ python/trunk/Misc/NEWS Wed Oct 1 13:19:50 2008 @@ -43,6 +43,9 @@ Build ----- +- Bug #3989: Package the 2to3 script (as 2to3.py) in the Windows + installer. + - Bug #3887: Package x64 version of CRT for AMD64 Windows binaries. Modified: python/trunk/Tools/msi/msi.py ============================================================================== --- python/trunk/Tools/msi/msi.py (original) +++ python/trunk/Tools/msi/msi.py Wed Oct 1 13:19:50 2008 @@ -1121,6 +1121,7 @@ if os.path.exists(os.path.join(lib.absolute, "README")): lib.add_file("README.txt", src="README") if f == 'Scripts': + lib.add_file("2to3.py", src="2to3") if have_tcl: lib.start_component("pydocgui.pyw", tcltk, keyfile="pydocgui.pyw") lib.add_file("pydocgui.pyw") From buildbot at python.org Wed Oct 1 14:06:31 2008 From: buildbot at python.org (buildbot at python.org) Date: Wed, 01 Oct 2008 12:06:31 +0000 Subject: [Python-checkins] buildbot failure in amd64 gentoo 3.0 Message-ID: <20081001120632.045111E4002@bag.python.org> The Buildbot has detected a new failure of amd64 gentoo 3.0. Full details are available at: http://www.python.org/dev/buildbot/all/amd64%20gentoo%203.0/builds/1159 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: norwitz-amd64 Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: martin.v.loewis BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_smtplib make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Wed Oct 1 14:09:05 2008 From: buildbot at python.org (buildbot at python.org) Date: Wed, 01 Oct 2008 12:09:05 +0000 Subject: [Python-checkins] buildbot failure in x86 W2k8 trunk Message-ID: <20081001120905.B4D3A1E4007@bag.python.org> The Buildbot has detected a new failure of x86 W2k8 trunk. Full details are available at: http://www.python.org/dev/buildbot/all/x86%20W2k8%20trunk/builds/224 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: nelson-windows Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: martin.v.loewis BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_bsddb3 sincerely, -The Buildbot From buildbot at python.org Wed Oct 1 14:26:08 2008 From: buildbot at python.org (buildbot at python.org) Date: Wed, 01 Oct 2008 12:26:08 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.0 Message-ID: <20081001122608.3F9D11E401C@bag.python.org> The Buildbot has detected a new failure of sparc solaris10 gcc 3.0. Full details are available at: http://www.python.org/dev/buildbot/all/sparc%20solaris10%20gcc%203.0/builds/618 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: loewis-sun Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: martin.v.loewis BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_posix ====================================================================== ERROR: test_getcwd_long_pathnames (test.test_posix.PosixTester) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/test/test_posix.py", line 252, in test_getcwd_long_pathnames support.rmtree(base_path) File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/test/support.py", line 98, in rmtree shutil.rmtree(path) File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/shutil.py", line 225, in rmtree onerror(os.rmdir, path, sys.exc_info()) File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/shutil.py", line 223, in rmtree os.rmdir(path) OSError: [Errno 22] Invalid argument: '/home2/buildbot/slave/3.0.loewis-sun/build/@test.getcwd/@test.getcwd' sincerely, -The Buildbot From buildbot at python.org Wed Oct 1 14:35:12 2008 From: buildbot at python.org (buildbot at python.org) Date: Wed, 01 Oct 2008 12:35:12 +0000 Subject: [Python-checkins] buildbot failure in x86 XP-4 3.0 Message-ID: <20081001123514.19B7A1E4002@bag.python.org> The Buildbot has detected a new failure of x86 XP-4 3.0. Full details are available at: http://www.python.org/dev/buildbot/all/x86%20XP-4%203.0/builds/1191 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: bolen-windows Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: martin.v.loewis BUILD FAILED: failed test Excerpt from the test logfile: 2 tests failed: test_urllib2_localnet test_urllibnet ====================================================================== FAIL: test_bad_address (test.test_urllib2_localnet.TestUrlopen) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_urllib2_localnet.py", line 452, in test_bad_address "http://www.python.invalid./") AssertionError: IOError not raised by urlopen ====================================================================== FAIL: test_bad_address (test.test_urllibnet.urlopenNetworkTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_urllibnet.py", line 142, in test_bad_address "http://www.python.invalid./") AssertionError: IOError not raised by urlopen sincerely, -The Buildbot From buildbot at python.org Wed Oct 1 16:45:02 2008 From: buildbot at python.org (buildbot at python.org) Date: Wed, 01 Oct 2008 14:45:02 +0000 Subject: [Python-checkins] buildbot failure in AMD64 W2k8 2.5 Message-ID: <20081001144502.4356D1E4006@bag.python.org> The Buildbot has detected a new failure of AMD64 W2k8 2.5. Full details are available at: http://www.python.org/dev/buildbot/all/AMD64%20W2k8%202.5/builds/85 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: nelson-win64 Build Reason: The web-page 'rebuild' button was pressed by '': Build Source Stamp: [branch branches/release25-maint] HEAD Blamelist: gregory.p.smith BUILD FAILED: failed compile sincerely, -The Buildbot From buildbot at python.org Wed Oct 1 16:45:07 2008 From: buildbot at python.org (buildbot at python.org) Date: Wed, 01 Oct 2008 14:45:07 +0000 Subject: [Python-checkins] buildbot failure in AMD64 W2k8 2.5 Message-ID: <20081001144507.696371E401B@bag.python.org> The Buildbot has detected a new failure of AMD64 W2k8 2.5. Full details are available at: http://www.python.org/dev/buildbot/all/AMD64%20W2k8%202.5/builds/87 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: nelson-win64 Build Reason: The web-page 'rebuild' button was pressed by '': Build Source Stamp: [branch branches/release25-maint] HEAD Blamelist: amaury.forgeotdarc,benjamin.peterson,brett.cannon,georg.brandl,gregory.p.smith,hirokazu.yamamoto,thomas.heller BUILD FAILED: failed compile sincerely, -The Buildbot From buildbot at python.org Wed Oct 1 16:59:05 2008 From: buildbot at python.org (buildbot at python.org) Date: Wed, 01 Oct 2008 14:59:05 +0000 Subject: [Python-checkins] buildbot failure in x86 W2k8 2.5 Message-ID: <20081001145905.CD1F51E4002@bag.python.org> The Buildbot has detected a new failure of x86 W2k8 2.5. Full details are available at: http://www.python.org/dev/buildbot/all/x86%20W2k8%202.5/builds/39 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: nelson-windows Build Reason: The web-page 'rebuild' button was pressed by '': Build Source Stamp: [branch branches/release25-maint] HEAD Blamelist: benjamin.peterson BUILD FAILED: failed failed slave lost sincerely, -The Buildbot From buildbot at python.org Wed Oct 1 17:28:56 2008 From: buildbot at python.org (buildbot at python.org) Date: Wed, 01 Oct 2008 15:28:56 +0000 Subject: [Python-checkins] buildbot failure in x86 XP-4 2.5 Message-ID: <20081001152856.515611E4002@bag.python.org> The Buildbot has detected a new failure of x86 XP-4 2.5. Full details are available at: http://www.python.org/dev/buildbot/all/x86%20XP-4%202.5/builds/249 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: bolen-windows Build Reason: The web-page 'rebuild' button was pressed by '': Build Source Stamp: [branch branches/release25-maint] HEAD Blamelist: hirokazu.yamamoto BUILD FAILED: failed test Excerpt from the test logfile: sincerely, -The Buildbot From buildbot at python.org Wed Oct 1 17:35:44 2008 From: buildbot at python.org (buildbot at python.org) Date: Wed, 01 Oct 2008 15:35:44 +0000 Subject: [Python-checkins] buildbot failure in x86 W2k8 trunk Message-ID: <20081001153544.9385C1E400C@bag.python.org> The Buildbot has detected a new failure of x86 W2k8 trunk. Full details are available at: http://www.python.org/dev/buildbot/all/x86%20W2k8%20trunk/builds/226 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: nelson-windows Build Reason: The web-page 'rebuild' button was pressed by '': Build Source Stamp: [branch trunk] HEAD Blamelist: amaury.forgeotdarc,andrew.kuchling,andrew.macintyre,benjamin.peterson,bill.janssen,brett.cannon,georg.brandl,gregory.p.smith,jesse.noller,jesus.cea,martin.v.loewis,thomas.heller BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_descr sincerely, -The Buildbot From buildbot at python.org Wed Oct 1 17:39:00 2008 From: buildbot at python.org (buildbot at python.org) Date: Wed, 01 Oct 2008 15:39:00 +0000 Subject: [Python-checkins] buildbot failure in AMD64 W2k8 trunk Message-ID: <20081001153900.52E9F1E4002@bag.python.org> The Buildbot has detected a new failure of AMD64 W2k8 trunk. Full details are available at: http://www.python.org/dev/buildbot/all/AMD64%20W2k8%20trunk/builds/980 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: nelson-win64 Build Reason: The web-page 'rebuild' button was pressed by '': Build Source Stamp: [branch trunk] HEAD Blamelist: amaury.forgeotdarc,benjamin.peterson,georg.brandl BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_bsddb3 sincerely, -The Buildbot From buildbot at python.org Wed Oct 1 18:23:37 2008 From: buildbot at python.org (buildbot at python.org) Date: Wed, 01 Oct 2008 16:23:37 +0000 Subject: [Python-checkins] buildbot failure in sparc Debian 2.5 Message-ID: <20081001162337.30F711E4002@bag.python.org> The Buildbot has detected a new failure of sparc Debian 2.5. Full details are available at: http://www.python.org/dev/buildbot/all/sparc%20Debian%202.5/builds/104 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-debian-sparc Build Reason: The web-page 'rebuild' button was pressed by '': Build Source Stamp: [branch branches/release25-maint] HEAD Blamelist: benjamin.peterson BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_subprocess make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Wed Oct 1 18:25:13 2008 From: buildbot at python.org (buildbot at python.org) Date: Wed, 01 Oct 2008 16:25:13 +0000 Subject: [Python-checkins] buildbot failure in sparc Ubuntu 2.5 Message-ID: <20081001162513.E2F671E4002@bag.python.org> The Buildbot has detected a new failure of sparc Ubuntu 2.5. Full details are available at: http://www.python.org/dev/buildbot/all/sparc%20Ubuntu%202.5/builds/124 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-ubuntu-sparc Build Reason: The web-page 'rebuild' button was pressed by '': Build Source Stamp: [branch branches/release25-maint] HEAD Blamelist: benjamin.peterson BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_subprocess make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Wed Oct 1 18:29:38 2008 From: buildbot at python.org (buildbot at python.org) Date: Wed, 01 Oct 2008 16:29:38 +0000 Subject: [Python-checkins] buildbot failure in AMD64 W2k8 2.5 Message-ID: <20081001162938.E86741E4002@bag.python.org> The Buildbot has detected a new failure of AMD64 W2k8 2.5. Full details are available at: http://www.python.org/dev/buildbot/all/AMD64%20W2k8%202.5/builds/89 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: nelson-win64 Build Reason: The web-page 'rebuild' button was pressed by '': Build Source Stamp: [branch branches/release25-maint] HEAD Blamelist: benjamin.peterson,brett.cannon,thomas.heller BUILD FAILED: failed compile sincerely, -The Buildbot From buildbot at python.org Wed Oct 1 18:30:55 2008 From: buildbot at python.org (buildbot at python.org) Date: Wed, 01 Oct 2008 16:30:55 +0000 Subject: [Python-checkins] buildbot failure in x86 OpenBSD 2.5 Message-ID: <20081001163055.4F25A1E4002@bag.python.org> The Buildbot has detected a new failure of x86 OpenBSD 2.5. Full details are available at: http://www.python.org/dev/buildbot/all/x86%20OpenBSD%202.5/builds/48 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: cortesi Build Reason: The web-page 'rebuild' button was pressed by '': Build Source Stamp: [branch branches/release25-maint] HEAD Blamelist: gregory.p.smith BUILD FAILED: failed test Excerpt from the test logfile: sincerely, -The Buildbot From buildbot at python.org Wed Oct 1 18:49:15 2008 From: buildbot at python.org (buildbot at python.org) Date: Wed, 01 Oct 2008 16:49:15 +0000 Subject: [Python-checkins] buildbot failure in amd64 gentoo trunk Message-ID: <20081001164916.1ACDB1E403E@bag.python.org> The Buildbot has detected a new failure of amd64 gentoo trunk. Full details are available at: http://www.python.org/dev/buildbot/all/amd64%20gentoo%20trunk/builds/1495 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: norwitz-amd64 Build Reason: The web-page 'rebuild' button was pressed by '': Build Source Stamp: [branch branches/fix-test-ftplib] HEAD Blamelist: BUILD FAILED: failed svn sincerely, -The Buildbot From buildbot at python.org Wed Oct 1 19:04:16 2008 From: buildbot at python.org (buildbot at python.org) Date: Wed, 01 Oct 2008 17:04:16 +0000 Subject: [Python-checkins] buildbot failure in g4 osx.4 trunk Message-ID: <20081001170416.456C71E404A@bag.python.org> The Buildbot has detected a new failure of g4 osx.4 trunk. Full details are available at: http://www.python.org/dev/buildbot/all/g4%20osx.4%20trunk/builds/3984 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: psf-g4 Build Reason: The web-page 'rebuild' button was pressed by '': Build Source Stamp: [branch trunk] HEAD Blamelist: amaury.forgeotdarc,andrew.kuchling,andrew.macintyre,antoine.pitrou,barry.warsaw,benjamin.peterson,bill.janssen,brett.cannon,georg.brandl,gerhard.haering,gregory.p.smith,hirokazu.yamamoto,jesse.noller,jesus.cea,josiah.carlson,lars.gustaebel,mark.hammond,martin.v.loewis,raymond.hettinger,skip.montanaro,thomas.heller BUILD FAILED: failed test Excerpt from the test logfile: sincerely, -The Buildbot From buildbot at python.org Wed Oct 1 19:10:06 2008 From: buildbot at python.org (buildbot at python.org) Date: Wed, 01 Oct 2008 17:10:06 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.0 Message-ID: <20081001171006.D5FBA1E403B@bag.python.org> The Buildbot has detected a new failure of sparc solaris10 gcc 3.0. Full details are available at: http://www.python.org/dev/buildbot/all/sparc%20solaris10%20gcc%203.0/builds/621 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: loewis-sun Build Reason: The web-page 'rebuild' button was pressed by '': Build Source Stamp: [branch branches/py3k] HEAD Blamelist: amaury.forgeotdarc,barry.warsaw,benjamin.peterson,brett.cannon,georg.brandl,hirokazu.yamamoto,martin.v.loewis,robert.schuppenies,thomas.heller BUILD FAILED: failed test Excerpt from the test logfile: 2 tests failed: test_posix test_subprocess ====================================================================== ERROR: test_getcwd_long_pathnames (test.test_posix.PosixTester) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/test/test_posix.py", line 252, in test_getcwd_long_pathnames support.rmtree(base_path) File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/test/support.py", line 98, in rmtree shutil.rmtree(path) File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/shutil.py", line 225, in rmtree onerror(os.rmdir, path, sys.exc_info()) File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/shutil.py", line 223, in rmtree os.rmdir(path) OSError: [Errno 22] Invalid argument: '/home2/buildbot/slave/3.0.loewis-sun/build/@test.getcwd/@test.getcwd' ====================================================================== FAIL: test_executable (test.test_subprocess.ProcessTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/test/test_subprocess.py", line 115, in test_executable self.assertEqual(p.returncode, 47) AssertionError: -6 != 47 sincerely, -The Buildbot From buildbot at python.org Wed Oct 1 19:33:05 2008 From: buildbot at python.org (buildbot at python.org) Date: Wed, 01 Oct 2008 17:33:05 +0000 Subject: [Python-checkins] buildbot failure in ia64 Ubuntu trunk Message-ID: <20081001173305.56CFF1E4002@bag.python.org> The Buildbot has detected a new failure of ia64 Ubuntu trunk. Full details are available at: http://www.python.org/dev/buildbot/all/ia64%20Ubuntu%20trunk/builds/633 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-debian-ia64 Build Reason: The web-page 'rebuild' button was pressed by '': Build Source Stamp: [branch branches/fix-test-ftplib] HEAD Blamelist: BUILD FAILED: failed svn sincerely, -The Buildbot From buildbot at python.org Wed Oct 1 19:37:35 2008 From: buildbot at python.org (buildbot at python.org) Date: Wed, 01 Oct 2008 17:37:35 +0000 Subject: [Python-checkins] buildbot failure in x86 XP-4 trunk Message-ID: <20081001173736.215541E4002@bag.python.org> The Buildbot has detected a new failure of x86 XP-4 trunk. Full details are available at: http://www.python.org/dev/buildbot/all/x86%20XP-4%20trunk/builds/1553 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: bolen-windows Build Reason: The web-page 'rebuild' button was pressed by '': Build Source Stamp: [branch trunk] HEAD Blamelist: BUILD FAILED: failed test Excerpt from the test logfile: 3 tests failed: test_bsddb3 test_urllib2_localnet test_urllibnet ====================================================================== ERROR: test01_badpointer (bsddb.test.test_misc.MiscTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\trunk.bolen-windows\build\lib\bsddb\test\test_misc.py", line 21, in test01_badpointer dbs = dbshelve.open(self.filename) File "E:\cygwin\home\db3l\buildarea\trunk.bolen-windows\build\lib\bsddb\dbshelve.py", line 106, in open d.open(filename, dbname, filetype, flags, mode) File "E:\cygwin\home\db3l\buildarea\trunk.bolen-windows\build\lib\bsddb\dbshelve.py", line 171, in open self.db.open(*args, **kwargs) DBFileExistsError: (17, 'File exists -- __fop_file_setup: Retry limit (100) exceeded') ====================================================================== ERROR: test03_repr_closed_db (bsddb.test.test_misc.MiscTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\trunk.bolen-windows\build\lib\bsddb\test\test_misc.py", line 37, in test03_repr_closed_db db = hashopen(self.filename) File "E:\cygwin\home\db3l\buildarea\trunk.bolen-windows\build\lib\bsddb\__init__.py", line 361, in hashopen d.open(file, db.DB_HASH, flags, mode) DBFileExistsError: (17, 'File exists -- __fop_file_setup: Retry limit (100) exceeded') ====================================================================== ERROR: test04_repr_db (bsddb.test.test_misc.MiscTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\trunk.bolen-windows\build\lib\bsddb\test\test_misc.py", line 43, in test04_repr_db db = hashopen(self.filename) File "E:\cygwin\home\db3l\buildarea\trunk.bolen-windows\build\lib\bsddb\__init__.py", line 361, in hashopen d.open(file, db.DB_HASH, flags, mode) DBFileExistsError: (17, 'File exists -- __fop_file_setup: Retry limit (100) exceeded') ====================================================================== ERROR: test05_double_free_make_key_dbt (bsddb.test.test_misc.MiscTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\trunk.bolen-windows\build\lib\bsddb\test\test_misc.py", line 65, in test05_double_free_make_key_dbt db.DB_CREATE | db.DB_THREAD) DBFileExistsError: (17, 'File exists -- __fop_file_setup: Retry limit (100) exceeded') ====================================================================== ERROR: test06_key_with_null_bytes (bsddb.test.test_misc.MiscTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\trunk.bolen-windows\build\lib\bsddb\test\test_misc.py", line 77, in test06_key_with_null_bytes db1.open(self.filename, None, db.DB_HASH, db.DB_CREATE) DBFileExistsError: (17, 'File exists -- __fop_file_setup: Retry limit (100) exceeded') ====================================================================== ERROR: test07_DB_set_flags_persists (bsddb.test.test_misc.MiscTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\trunk.bolen-windows\build\lib\bsddb\test\test_misc.py", line 101, in test07_DB_set_flags_persists db1.open(self.filename, db.DB_HASH, db.DB_CREATE) DBFileExistsError: (17, 'File exists -- __fop_file_setup: Retry limit (100) exceeded') ====================================================================== FAIL: test_bad_address (test.test_urllib2_localnet.TestUrlopen) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\trunk.bolen-windows\build\lib\test\test_urllib2_localnet.py", line 477, in test_bad_address urllib2.urlopen, "http://www.python.invalid./") AssertionError: IOError not raised ====================================================================== FAIL: test_bad_address (test.test_urllibnet.urlopenNetworkTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\trunk.bolen-windows\build\lib\test\test_urllibnet.py", line 140, in test_bad_address urllib.urlopen, "http://www.python.invalid./") AssertionError: IOError not raised sincerely, -The Buildbot From buildbot at python.org Wed Oct 1 20:04:48 2008 From: buildbot at python.org (buildbot at python.org) Date: Wed, 01 Oct 2008 18:04:48 +0000 Subject: [Python-checkins] buildbot failure in sparc Ubuntu trunk Message-ID: <20081001180448.C4C971E4002@bag.python.org> The Buildbot has detected a new failure of sparc Ubuntu trunk. Full details are available at: http://www.python.org/dev/buildbot/all/sparc%20Ubuntu%20trunk/builds/910 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-ubuntu-sparc Build Reason: The web-page 'rebuild' button was pressed by '': Build Source Stamp: [branch trunk] HEAD Blamelist: amaury.forgeotdarc,andrew.kuchling,andrew.macintyre,barry.warsaw,benjamin.peterson,bill.janssen,brett.cannon,georg.brandl,gregory.p.smith,hirokazu.yamamoto,jesse.noller,jesus.cea,josiah.carlson,lars.gustaebel,mark.hammond,martin.v.loewis,raymond.hettinger,skip.montanaro,thomas.heller BUILD FAILED: failed test Excerpt from the test logfile: make: *** [buildbottest] Bus error sincerely, -The Buildbot From buildbot at python.org Wed Oct 1 20:04:59 2008 From: buildbot at python.org (buildbot at python.org) Date: Wed, 01 Oct 2008 18:04:59 +0000 Subject: [Python-checkins] buildbot failure in x86 OpenBSD trunk Message-ID: <20081001180459.64D331E4002@bag.python.org> The Buildbot has detected a new failure of x86 OpenBSD trunk. Full details are available at: http://www.python.org/dev/buildbot/all/x86%20OpenBSD%20trunk/builds/308 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: cortesi Build Reason: The web-page 'rebuild' button was pressed by '': Build Source Stamp: [branch trunk] HEAD Blamelist: amaury.forgeotdarc,andrew.kuchling,andrew.macintyre,benjamin.peterson,bill.janssen,brett.cannon,georg.brandl,gregory.p.smith,jesse.noller,jesus.cea,martin.v.loewis,thomas.heller BUILD FAILED: failed test Excerpt from the test logfile: sincerely, -The Buildbot From buildbot at python.org Wed Oct 1 20:08:33 2008 From: buildbot at python.org (buildbot at python.org) Date: Wed, 01 Oct 2008 18:08:33 +0000 Subject: [Python-checkins] buildbot failure in sparc Debian trunk Message-ID: <20081001180834.04DB21E4002@bag.python.org> The Buildbot has detected a new failure of sparc Debian trunk. Full details are available at: http://www.python.org/dev/buildbot/all/sparc%20Debian%20trunk/builds/732 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-debian-sparc Build Reason: The web-page 'rebuild' button was pressed by '': Build Source Stamp: [branch trunk] HEAD Blamelist: amaury.forgeotdarc,andrew.kuchling,andrew.macintyre,antoine.pitrou,barry.warsaw,benjamin.peterson,bill.janssen,brett.cannon,georg.brandl,gerhard.haering,gregory.p.smith,hirokazu.yamamoto,jesse.noller,jesus.cea,josiah.carlson,lars.gustaebel,mark.hammond,martin.v.loewis,raymond.hettinger,skip.montanaro,thomas.heller BUILD FAILED: failed test Excerpt from the test logfile: make: *** [buildbottest] Bus error sincerely, -The Buildbot From buildbot at python.org Wed Oct 1 20:17:13 2008 From: buildbot at python.org (buildbot at python.org) Date: Wed, 01 Oct 2008 18:17:13 +0000 Subject: [Python-checkins] buildbot failure in x86 XP-4 3.0 Message-ID: <20081001181714.2393F1E4002@bag.python.org> The Buildbot has detected a new failure of x86 XP-4 3.0. Full details are available at: http://www.python.org/dev/buildbot/all/x86%20XP-4%203.0/builds/1194 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: bolen-windows Build Reason: The web-page 'rebuild' button was pressed by '': Build Source Stamp: [branch branches/py3k] HEAD Blamelist: amaury.forgeotdarc,andrew.macintyre,antoine.pitrou,barry.warsaw,benjamin.peterson,brett.cannon,georg.brandl,gerhard.haering,hirokazu.yamamoto,martin.v.loewis,robert.schuppenies,skip.montanaro,thomas.heller BUILD FAILED: failed test Excerpt from the test logfile: 2 tests failed: test_urllib2_localnet test_urllibnet ====================================================================== FAIL: test_bad_address (test.test_urllib2_localnet.TestUrlopen) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_urllib2_localnet.py", line 452, in test_bad_address "http://www.python.invalid./") AssertionError: IOError not raised by urlopen ====================================================================== FAIL: test_bad_address (test.test_urllibnet.urlopenNetworkTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_urllibnet.py", line 142, in test_bad_address "http://www.python.invalid./") AssertionError: IOError not raised by urlopen sincerely, -The Buildbot From buildbot at python.org Wed Oct 1 20:32:32 2008 From: buildbot at python.org (buildbot at python.org) Date: Wed, 01 Oct 2008 18:32:32 +0000 Subject: [Python-checkins] buildbot failure in g4 osx.4 3.0 Message-ID: <20081001183232.2CC8F1E4037@bag.python.org> The Buildbot has detected a new failure of g4 osx.4 3.0. Full details are available at: http://www.python.org/dev/buildbot/all/g4%20osx.4%203.0/builds/1466 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: psf-g4 Build Reason: The web-page 'rebuild' button was pressed by '': Build Source Stamp: [branch branches/py3k] HEAD Blamelist: BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_asynchat make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Wed Oct 1 20:40:58 2008 From: buildbot at python.org (buildbot at python.org) Date: Wed, 01 Oct 2008 18:40:58 +0000 Subject: [Python-checkins] buildbot failure in x86 OpenBSD 3.0 Message-ID: <20081001184058.D30211E4002@bag.python.org> The Buildbot has detected a new failure of x86 OpenBSD 3.0. Full details are available at: http://www.python.org/dev/buildbot/all/x86%20OpenBSD%203.0/builds/313 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: cortesi Build Reason: The web-page 'rebuild' button was pressed by '': Build Source Stamp: [branch branches/py3k] HEAD Blamelist: amaury.forgeotdarc,benjamin.peterson,brett.cannon,georg.brandl,martin.v.loewis,thomas.heller BUILD FAILED: failed compile sincerely, -The Buildbot From buildbot at python.org Wed Oct 1 21:25:51 2008 From: buildbot at python.org (buildbot at python.org) Date: Wed, 01 Oct 2008 19:25:51 +0000 Subject: [Python-checkins] buildbot failure in x86 XP-4 trunk Message-ID: <20081001192551.4ED741E4002@bag.python.org> The Buildbot has detected a new failure of x86 XP-4 trunk. Full details are available at: http://www.python.org/dev/buildbot/all/x86%20XP-4%20trunk/builds/1555 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: bolen-windows Build Reason: The web-page 'rebuild' button was pressed by '': Build Source Stamp: [branch trunk] HEAD Blamelist: amaury.forgeotdarc,andrew.kuchling,andrew.macintyre,antoine.pitrou,barry.warsaw,benjamin.peterson,bill.janssen,brett.cannon,georg.brandl,gerhard.haering,gregory.p.smith,hirokazu.yamamoto,jesse.noller,jesus.cea,josiah.carlson,lars.gustaebel,mark.hammond,martin.v.loewis,raymond.hettinger,skip.montanaro,thomas.heller BUILD FAILED: failed test Excerpt from the test logfile: 3 tests failed: test_bsddb3 test_urllib2_localnet test_urllibnet sincerely, -The Buildbot From buildbot at python.org Wed Oct 1 21:44:44 2008 From: buildbot at python.org (buildbot at python.org) Date: Wed, 01 Oct 2008 19:44:44 +0000 Subject: [Python-checkins] buildbot failure in x86 gentoo 3.0 Message-ID: <20081001194445.160B31E4002@bag.python.org> The Buildbot has detected a new failure of x86 gentoo 3.0. Full details are available at: http://www.python.org/dev/buildbot/all/x86%20gentoo%203.0/builds/1643 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: norwitz-x86 Build Reason: The web-page 'rebuild' button was pressed by '': Build Source Stamp: [branch branches/py3k] HEAD Blamelist: amaury.forgeotdarc,benjamin.peterson,brett.cannon,georg.brandl,martin.v.loewis,thomas.heller BUILD FAILED: failed test Excerpt from the test logfile: make: *** [buildbottest] Unknown signal 32 sincerely, -The Buildbot From buildbot at python.org Wed Oct 1 22:06:20 2008 From: buildbot at python.org (buildbot at python.org) Date: Wed, 01 Oct 2008 20:06:20 +0000 Subject: [Python-checkins] buildbot failure in x86 OpenBSD 2.5 Message-ID: <20081001200620.63A841E4002@bag.python.org> The Buildbot has detected a new failure of x86 OpenBSD 2.5. Full details are available at: http://www.python.org/dev/buildbot/all/x86%20OpenBSD%202.5/builds/50 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: cortesi Build Reason: The web-page 'rebuild' button was pressed by '': Build Source Stamp: [branch branches/release25-maint] HEAD Blamelist: amaury.forgeotdarc,benjamin.peterson,brett.cannon,georg.brandl,gregory.p.smith,hirokazu.yamamoto,thomas.heller BUILD FAILED: failed test Excerpt from the test logfile: sincerely, -The Buildbot From buildbot at python.org Wed Oct 1 22:53:38 2008 From: buildbot at python.org (buildbot at python.org) Date: Wed, 01 Oct 2008 20:53:38 +0000 Subject: [Python-checkins] buildbot failure in sparc Debian 3.0 Message-ID: <20081001205338.EB1EE1E404D@bag.python.org> The Buildbot has detected a new failure of sparc Debian 3.0. Full details are available at: http://www.python.org/dev/buildbot/all/sparc%20Debian%203.0/builds/589 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-debian-sparc Build Reason: The web-page 'rebuild' button was pressed by '': Build Source Stamp: [branch branches/py3k] HEAD Blamelist: BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_smtplib make: *** [buildbottest] Error 1 sincerely, -The Buildbot From python-checkins at python.org Wed Oct 1 23:46:41 2008 From: python-checkins at python.org (barry.warsaw) Date: Wed, 1 Oct 2008 23:46:41 +0200 (CEST) Subject: [Python-checkins] r66714 - in python/trunk: Include/patchlevel.h Lib/distutils/__init__.py Lib/idlelib/idlever.py Misc/NEWS Misc/RPM/python-2.6.spec README Message-ID: <20081001214641.351211E4002@bag.python.org> Author: barry.warsaw Date: Wed Oct 1 23:46:40 2008 New Revision: 66714 Log: Bumping to 2.6 final. Modified: python/trunk/Include/patchlevel.h python/trunk/Lib/distutils/__init__.py python/trunk/Lib/idlelib/idlever.py python/trunk/Misc/NEWS python/trunk/Misc/RPM/python-2.6.spec python/trunk/README Modified: python/trunk/Include/patchlevel.h ============================================================================== --- python/trunk/Include/patchlevel.h (original) +++ python/trunk/Include/patchlevel.h Wed Oct 1 23:46:40 2008 @@ -23,11 +23,11 @@ #define PY_MAJOR_VERSION 2 #define PY_MINOR_VERSION 6 #define PY_MICRO_VERSION 0 -#define PY_RELEASE_LEVEL PY_RELEASE_LEVEL_GAMMA -#define PY_RELEASE_SERIAL 2 +#define PY_RELEASE_LEVEL PY_RELEASE_LEVEL_FINAL +#define PY_RELEASE_SERIAL 0 /* Version as a string */ -#define PY_VERSION "2.6rc2+" +#define PY_VERSION "2.6" /*--end constants--*/ /* Subversion Revision number of this file (not of the repository) */ Modified: python/trunk/Lib/distutils/__init__.py ============================================================================== --- python/trunk/Lib/distutils/__init__.py (original) +++ python/trunk/Lib/distutils/__init__.py Wed Oct 1 23:46:40 2008 @@ -22,5 +22,5 @@ # #--start constants-- -__version__ = "2.6rc2" +__version__ = "2.6" #--end constants-- Modified: python/trunk/Lib/idlelib/idlever.py ============================================================================== --- python/trunk/Lib/idlelib/idlever.py (original) +++ python/trunk/Lib/idlelib/idlever.py Wed Oct 1 23:46:40 2008 @@ -1 +1 @@ -IDLE_VERSION = "2.6rc2" +IDLE_VERSION = "2.6" Modified: python/trunk/Misc/NEWS ============================================================================== --- python/trunk/Misc/NEWS (original) +++ python/trunk/Misc/NEWS Wed Oct 1 23:46:40 2008 @@ -7,7 +7,7 @@ What's New in Python 2.6 final ============================== -*Release date: XX-XXX-2008* +*Release date: 01-Oct-2008* Core and Builtins ----------------- Modified: python/trunk/Misc/RPM/python-2.6.spec ============================================================================== --- python/trunk/Misc/RPM/python-2.6.spec (original) +++ python/trunk/Misc/RPM/python-2.6.spec Wed Oct 1 23:46:40 2008 @@ -34,7 +34,7 @@ %define name python #--start constants-- -%define version 2.6rc2 +%define version 2.6 %define libver 2.6 #--end constants-- %define release 1pydotorg Modified: python/trunk/README ============================================================================== --- python/trunk/README (original) +++ python/trunk/README Wed Oct 1 23:46:40 2008 @@ -1,5 +1,5 @@ -This is Python version 2.6 release candidate 2 -============================================== +This is Python version 2.6 +========================== Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 Python Software Foundation. From python-checkins at python.org Thu Oct 2 00:05:44 2008 From: python-checkins at python.org (barry.warsaw) Date: Thu, 2 Oct 2008 00:05:44 +0200 (CEST) Subject: [Python-checkins] r66715 - python/trunk/Doc/whatsnew/2.6.rst Message-ID: <20081001220544.59BE51E4002@bag.python.org> Author: barry.warsaw Date: Thu Oct 2 00:05:43 2008 New Revision: 66715 Log: Today is the release date Modified: python/trunk/Doc/whatsnew/2.6.rst Modified: python/trunk/Doc/whatsnew/2.6.rst ============================================================================== --- python/trunk/Doc/whatsnew/2.6.rst (original) +++ python/trunk/Doc/whatsnew/2.6.rst Thu Oct 2 00:05:43 2008 @@ -49,9 +49,8 @@ This saves the maintainer some effort going through the SVN logs when researching a change. -This article explains the new features in Python 2.6. The release -schedule is described in :pep:`361`; currently the final release is -scheduled for October 1 2008. +This article explains the new features in Python 2.6, released on October 1 +2008. The release schedule is described in :pep:`361`. The major theme of Python 2.6 is preparing the migration path to Python 3.0, a major redesign of the language. Whenever possible, From buildbot at python.org Thu Oct 2 00:08:39 2008 From: buildbot at python.org (buildbot at python.org) Date: Wed, 01 Oct 2008 22:08:39 +0000 Subject: [Python-checkins] buildbot failure in sparc Ubuntu trunk Message-ID: <20081001220839.91FE31E4002@bag.python.org> The Buildbot has detected a new failure of sparc Ubuntu trunk. Full details are available at: http://www.python.org/dev/buildbot/all/sparc%20Ubuntu%20trunk/builds/914 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-ubuntu-sparc Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: barry.warsaw BUILD FAILED: failed test Excerpt from the test logfile: make: *** [buildbottest] Bus error sincerely, -The Buildbot From python-checkins at python.org Thu Oct 2 00:09:42 2008 From: python-checkins at python.org (barry.warsaw) Date: Thu, 2 Oct 2008 00:09:42 +0200 (CEST) Subject: [Python-checkins] r66716 - python/tags/r26 Message-ID: <20081001220942.C520C1E4002@bag.python.org> Author: barry.warsaw Date: Thu Oct 2 00:09:42 2008 New Revision: 66716 Log: Tagging for 2.6 final. Added: python/tags/r26/ - copied from r66715, /python/trunk/ From python-checkins at python.org Thu Oct 2 00:19:52 2008 From: python-checkins at python.org (barry.warsaw) Date: Thu, 2 Oct 2008 00:19:52 +0200 (CEST) Subject: [Python-checkins] r66717 - python/branches/release26-maint Message-ID: <20081001221952.60AC41E4002@bag.python.org> Author: barry.warsaw Date: Thu Oct 2 00:19:52 2008 New Revision: 66717 Log: Creating the Python 2.6 maintenance branch! Added: python/branches/release26-maint/ - copied from r66716, /python/trunk/ From buildbot at python.org Thu Oct 2 00:36:32 2008 From: buildbot at python.org (buildbot at python.org) Date: Wed, 01 Oct 2008 22:36:32 +0000 Subject: [Python-checkins] buildbot failure in x86 W2k8 trunk Message-ID: <20081001223632.7035F1E4031@bag.python.org> The Buildbot has detected a new failure of x86 W2k8 trunk. Full details are available at: http://www.python.org/dev/buildbot/all/x86%20W2k8%20trunk/builds/231 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: nelson-windows Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: barry.warsaw BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_bsddb3 sincerely, -The Buildbot From buildbot at python.org Thu Oct 2 00:56:18 2008 From: buildbot at python.org (buildbot at python.org) Date: Wed, 01 Oct 2008 22:56:18 +0000 Subject: [Python-checkins] buildbot failure in sparc Debian trunk Message-ID: <20081001225619.2FB1D1E4002@bag.python.org> The Buildbot has detected a new failure of sparc Debian trunk. Full details are available at: http://www.python.org/dev/buildbot/all/sparc%20Debian%20trunk/builds/736 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-debian-sparc Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: barry.warsaw BUILD FAILED: failed test Excerpt from the test logfile: make: *** [buildbottest] Bus error sincerely, -The Buildbot From buildbot at python.org Thu Oct 2 01:24:09 2008 From: buildbot at python.org (buildbot at python.org) Date: Wed, 01 Oct 2008 23:24:09 +0000 Subject: [Python-checkins] buildbot failure in x86 OpenBSD trunk Message-ID: <20081001232409.2BADE1E4002@bag.python.org> The Buildbot has detected a new failure of x86 OpenBSD trunk. Full details are available at: http://www.python.org/dev/buildbot/all/x86%20OpenBSD%20trunk/builds/310 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: cortesi Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: barry.warsaw BUILD FAILED: failed test Excerpt from the test logfile: sincerely, -The Buildbot From python-checkins at python.org Thu Oct 2 05:08:35 2008 From: python-checkins at python.org (barry.warsaw) Date: Thu, 2 Oct 2008 05:08:35 +0200 (CEST) Subject: [Python-checkins] r66718 - in python/branches/release26-maint: Include/patchlevel.h Misc/NEWS Message-ID: <20081002030835.0E5AF1E4002@bag.python.org> Author: barry.warsaw Date: Thu Oct 2 05:08:34 2008 New Revision: 66718 Log: Post release dance Modified: python/branches/release26-maint/Include/patchlevel.h python/branches/release26-maint/Misc/NEWS Modified: python/branches/release26-maint/Include/patchlevel.h ============================================================================== --- python/branches/release26-maint/Include/patchlevel.h (original) +++ python/branches/release26-maint/Include/patchlevel.h Thu Oct 2 05:08:34 2008 @@ -27,7 +27,7 @@ #define PY_RELEASE_SERIAL 0 /* Version as a string */ -#define PY_VERSION "2.6" +#define PY_VERSION "2.6+" /*--end constants--*/ /* Subversion Revision number of this file (not of the repository) */ Modified: python/branches/release26-maint/Misc/NEWS ============================================================================== --- python/branches/release26-maint/Misc/NEWS (original) +++ python/branches/release26-maint/Misc/NEWS Thu Oct 2 05:08:34 2008 @@ -4,6 +4,18 @@ (editors: check NEWS.help for information about editing NEWS using ReST.) +What's New in Python 2.6.1 alpha 1 +================================== + +*Release date: XX-XXX-2008* + +Core and Builtins +----------------- + +Library +------- + + What's New in Python 2.6 final ============================== From python-checkins at python.org Thu Oct 2 05:10:36 2008 From: python-checkins at python.org (barry.warsaw) Date: Thu, 2 Oct 2008 05:10:36 +0200 (CEST) Subject: [Python-checkins] r66719 - in peps/trunk: pep-0101.txt pep-0361.txt Message-ID: <20081002031036.60A561E4008@bag.python.org> Author: barry.warsaw Date: Thu Oct 2 05:10:35 2008 New Revision: 66719 Log: The usual post release updates Modified: peps/trunk/pep-0101.txt peps/trunk/pep-0361.txt Modified: peps/trunk/pep-0101.txt ============================================================================== --- peps/trunk/pep-0101.txt (original) +++ peps/trunk/pep-0101.txt Thu Oct 2 05:10:35 2008 @@ -35,9 +35,20 @@ the designated person performing the release. The roles and their current experts are: - * RM = Release Manager: Barry Warsaw - * WE = Windows: Martin von Loewis - * ME = Mac: Ronald Oussoren + * RM = Release Manager: Barry Warsaw (US/Eastern) + * WE = Windows: Martin von Loewis + * ME = Mac: Ronald Oussoren + * IE = Idle Expert: ?? + * RE = RPM Expert: Sean Reifschneider + + NOTE: It is highly recommended that the RM contact the Experts the day + before the release. Because the world is round and everyone lives + in different timezones, the RM must ensure that the release tag is + created in enough time for the Experts to cut binary releases. + + IT IS HIGHLY RECOMMENDED THAT YOU AT LEAST TAG THE TREE 24 HOURS + BEFORE A FINAL RELEASE. This will give the Experts enough time to + do their bits before the announcement goes out. XXX: We should include a dependency graph to illustrate the steps that can be taken in parallel, or those that depend on other @@ -45,28 +56,26 @@ As much as possible, the release steps are automated and guided by the release script, which is available in the Python sandbox. The release - script is currently being maintained by the RM: + script is currently being maintained here: http://svn.python.org/view/sandbox/trunk/release/ - We use the following conventions in the examples below. Where a - release number is given, it is of the form X.YaZ, e.g. 2.6a3 for - Python 2.6 alpha 3, where "a" == alpha, "b" == beta, "c" == - release candidate. - - Final releases are named "releaseXY". The branch tag is - "releaseXY-maint" because this will point to the long lived - maintenance branch. The fork tag on the trunk is - "releaseXY-fork". If a micro release number is used, then we'll - say X.Y.MaZ. + We use the following conventions in the examples below. Where a release + number is given, it is of the form X.YaZ, e.g. 2.6a3 for Python 2.6 alpha + 3, where "a" == alpha, "b" == beta, "c" == release candidate. + + Final releases are named "releaseXY". The branch tag is "releaseXY-maint" + because this will point to the long lived maintenance branch. The fork + tag on the trunk is "releaseXY-fork". If a micro release number is used, + then we'll say X.Y.MaZ. This helps by performing several automatic editing steps, and guides you to perform some manual editing steps. ___ Log into irc.freenode.net and join the #python-dev channel. - You probably need to coordinate with other people around the - world. This IRC channel is where we've arranged to meet. + You probably need to coordinate with other people around the world. + This IRC channel is where we've arranged to meet. ___ Impose a check-in freeze by sending email to python-committers at python.org @@ -87,21 +96,20 @@ release you're making; here are the relevant definitions: release blocker - Stops the release dead in its tracks. You may not - make a release with any open blocker bugs. + make any release with any open release blocker bugs. deferred blocker - Doesn't block this release, but it will block a - future release. + future release. You many not make a final or + candidate release with any open deferred blocker + bugs. - critical - Important bugs that should be fixed before the next release, - but which won't block a non-final release. - - You can make alpha and beta releases with open critical bugs, but you - may not make a final release with open critical bugs. + critical - Important bugs that should be fixed, but which does not block + a release. Review the release blockers and either resolve them, bump them down to deferred, or stop the release and ask for community assistance. If - you're making a final release, do the same with any open deferred and - crticial bugs. + you're making a final or candidate release, do the same with any open + deferred. ___ Check the stable buildbots. @@ -109,11 +117,11 @@ (the trailing slash is required). Look at the buildbots for the release you're making. Ignore any that are offline (or inform the community so - they can be restarted). If what remains are green buildbots, you're - good to go. If you have non-offline red buildbots, you may want to hold - up the release until they are fixed. Review the problems and use your - judgement, taking into account whether you are making an alpha, beta, or - final release. + they can be restarted). If what remains are (mostly) green buildbots, + you're good to go. If you have non-offline red buildbots, you may want + to hold up the release until they are fixed. Review the problems and + use your judgement, taking into account whether you are making an alpha, + beta, or final release. ___ Bump version numbers via the release script. @@ -124,10 +132,10 @@ set up correctly, release.py will pop up editor windows with the files you need to edit. - Most importantly is to update the Misc/NEWS file, however in recent - years, this has become easier as the community is responsible for most - of the content of this file. You should only need to review the text - for sanity, and update the release date with today's date. + It is important to update the Misc/NEWS file, however in recent years, + this has become easier as the community is responsible for most of the + content of this file. You should only need to review the text for + sanity, and update the release date with today's date. If the minor (middle) digit of the version number changes, you will be prompted to update some additional files: @@ -166,29 +174,28 @@ ___ Check with the IDLE maintainer to be sure that Lib/idlelib/NEWS.txt has been similarly updated. - (XXX Who is the IE (i.e. Idle Expert)? - ___ For a final release, edit the first paragraph of Doc/whatsnew/X.Y.rst to include the actual release date; e.g. "Python 2.5 was released on August 1, 2003." There's no need to edit this for alpha or beta releases. Note that Andrew Kuchling often takes care of this. - ___ Tag and/or branch the tree for release X.YaZ - - If you're releasing an alpha/beta/release candidate, you will just tag - the tree. If you are releasing a final release, you will both tag the - trunk and create the long-lived maintenance branch. + ___ Tag the release for X.YaZ .../sandbox/release/release.py --tag X.YaZ - Practically speaking, we tag and branch just before making the - release. Branching too early causes too much merging work. + ___ Send an email to the Experts so that they can build the binaries. + + For a final release, the RM may block at this point waiting for + confirmation from the Experts. - When making a major release (e.g., for 2.6), you should branch. - To create a _branch_ (e.g., release26-maint), do the following: + ___ If this is a final major release, branch the tree for X.YaZ - .../sandbox/release/release.py --branch X.Y.Z + When making a major release (e.g., for 2.6), you must create the + long-lived maintenance branch. To create a _branch_ (e.g., + release26-maint), do the following: + + .../sandbox/release/release.py --branch X.Y ___ If you just made the release branch, check out a clean version into a new directory. You'll be doing a lot of work in this @@ -200,9 +207,6 @@ ___ cd release26-maint # cd into the branch directory. - ___ XXX If this is a release candidate, mail Sean - noting the impending release, so that RPMs can be built and tested. - ___ XXX The WE builds the Windows helpfile, using (in Doc/) either $ make htmlhelp (on Unix) @@ -250,7 +254,7 @@ ___ Time to build the source tarball. If you created a branch, be sure to cd to your working directory for the branch. E.g. - % cd .../python-26 + % cd .../python26 ___ Do a "svn update ; svn status" in this directory. @@ -258,9 +262,12 @@ changes in your working directory, but you may pick up some of the expert's last minute changes. - ___ If you've seen updates to existing files, update the svn tag: + ___ If you've seen updates to existing files, update the branches. - .../sandbox/release/release.py --tag X.YaZ + ___ Delete the old tag branch and re-tag the tree + ___ Delete the maintenance branch and re-branch the trunk. + + This should be rare and indicates a breakdown in the process. ___ Use the release script to create the gzip and bz2 tarballs, md5 checksums, and gpg signature files. @@ -269,6 +276,13 @@ This will leave all the relevant files in a subdirectory called 'dist'. + ___ scp the files to your home directory on dinsdale.python.org. + + While you're waiting for the files to finish uploading, you can continue + on with the remaining tasks. You can also ask folks on #python-dev to + download the files as they finish uploading so that they can test them + on their platforms as well. + ___ Now you want to perform the very important step of checking the tarball you just created, to make sure a completely clean, virgin build passes the regression test. Here are the best @@ -308,18 +322,13 @@ To ensure that the regression test suite passes. If not, you screwed up somewhere! - ___ Upload the tar files to dinsdale.python.org using scp. - - ___ Now we're waiting for the scp to dinsdale to finish. Da de da, - da de dum, hmm, hmm, dum de dum. - ___ Now you need to go to dinsdale.python.org and move all the files in place over there. Our policy is that every Python version gets its own directory, but each directory may contain several releases. We keep all old releases, moving them into a "prev" subdirectory when we have a new release. - So, there's a directory called "2.6" which contains Python-2.5a2.exe and + So, there's a directory called "2.6" which contains Python-2.6a2.exe and Python-2.6a2.tgz, along with a "prev" subdirectory containing Python-2.6a1.msi, Python-2.6a1.tgz, Python-2.6a1.tar.bz2, etc. @@ -335,9 +344,10 @@ directory, You'll move everything in there when the final release comes out. - ___ Move the .tgz, tar.bz2, and .msi files to this directory. Make - sure they are world readable. They should also be group writable, - and group-owned by webmaster. + ___ Move the release .tgz, tar.bz2, and .msi files into place + + Make sure they are world readable. They should also be group + writable, and group-owned by webmaster. ___ md5sum the files and make sure they got uploaded intact. @@ -377,6 +387,38 @@ ___ Add a news section item to the front page by editing newsindex.yml. The format should be pretty self evident. + ___ If this is a final release... + + ___ update the 'Quick Links' section on the front page. Edit the + top-level `content.ht` file. + + ___ update the download page, editing `download/content.ht` + + ___ edit the previous release's last release content.ht page to point to + the new release. + + ___ Mention the release as the most recent stable one in + `doc/faq/general.ht` (section "How stable is Python?") + + ___ update `doc/content.ht` to indicate the new current documentation + version, and remove the current version from any 'in development' + section. + + ___ add the new version to `doc/version/content.ht` + + ___ Make the last change to the documentation area on python.org. + + The "current" symlink needs to be updated if this release is the + highest-versioned release. Log in to dinsdale.python.org, and + update a symlink in the doc/ tree: + + # on dinsdale: + $ cd /data/ftp.python.org/pub/www.python.org/doc/ + $ rm current && ln -s $VERSION current + + XXX This does not seem complete. I still don't really understand + how all the documentation stuff hangs together. + ___ Edit download/releases/content.ht to update the version numbers for this release. There are a bunch of places you need to touch: @@ -412,22 +454,6 @@ python-announce at python.org python-dev at python.org - ___ XXX Mention the release as the most recent stable one in - pydotorg:doc/faq/general.ht (section "How stable is - Python?") - - ___ XXX Make the last change to the documentation area on - python.org. (Remember those from the documentation items above? - It's time now.) - - The "current" symlink needs to be updated if this release is the - highest-versioned release. Log in to dinsdale.python.org, and - update a symlink in the doc/ tree: - - # on dinsdale: - $ cd /data/ftp.python.org/pub/www.python.org/doc/ - $ rm current && ln -s $VERSION current - Now it's time to do some cleaning up. These steps are very important! ___ If you made a non-maintenance branch, be sure to merge it into @@ -522,7 +548,7 @@ three major releases: Windows, Mac, and source. So we add this extra step to the release process for a final release: - ___ Hold up the final release until the WE and ME approve, or until we + ___ Hold up the final release until the Experts approve, or until we lose patience . Modified: peps/trunk/pep-0361.txt ============================================================================== --- peps/trunk/pep-0361.txt (original) +++ peps/trunk/pep-0361.txt Thu Oct 2 05:10:35 2008 @@ -59,9 +59,10 @@ Jul 17 2008: Python 2.6b2 and 3.0b2 are released Aug 20 2008: Python 2.6b3 and 3.0b3 are released Sep 12 2008: Python 2.6rc1 is released - Sep 17 2008: Python 2.6rc2 and 3.0rc1 planned - Oct 01 2008: Python 2.6final and 3.0rc2 planned - Oct 15 2008: Python 3.0final planned + Sep 17 2008: Python 2.6rc2 and 3.0rc1 released + Oct 01 2008: Python 2.6 final released + ??? ?? 2008: Python 3.0rc2 planned + ??? ?? 2008: Python 3.0final planned See the public `Google calendar`_ From python-checkins at python.org Thu Oct 2 05:13:06 2008 From: python-checkins at python.org (barry.warsaw) Date: Thu, 2 Oct 2008 05:13:06 +0200 (CEST) Subject: [Python-checkins] r66720 - sandbox/trunk/release/release.py Message-ID: <20081002031306.B74F71E4002@bag.python.org> Author: barry.warsaw Date: Thu Oct 2 05:13:05 2008 New Revision: 66720 Log: The usual post release updates Modified: sandbox/trunk/release/release.py Modified: sandbox/trunk/release/release.py ============================================================================== --- sandbox/trunk/release/release.py (original) +++ sandbox/trunk/release/release.py Thu Oct 2 05:13:05 2008 @@ -260,6 +260,10 @@ exported_docs = 'Python-%s-docs-html' % tag.text shutil.copytree(docs, exported_docs) + with changed_dir(os.path.join(python, 'Doc')): + print 'Removing doc build artifacts' + shutil.rmtree('build') + tarball(python) tarball(exported_docs) print '\n**Now extract the archives and run the tests**' @@ -306,13 +310,15 @@ def branch(tag): - if tag.minor > 0 or tag.patch > 0 or tag.level != "f": + if tag.patch > 0 or tag.level != "f": print 'It doesn\'t look like you\'re making a final release.' if raw_input('Are you sure you want to branch?') != "y": return - run_cmd(['svn', 'copy', get_current_location(), - 'svn+ssh://svn.python.org/projects/python/branches/' - 'release%s-maint' % (tag.major + tag.minor)]) + url = urlsplit(get_current_location()) + new_path = 'python/branches/release%s%s-maint' % (tag.major, tag.minor) + tag_url = urlunsplit((url.scheme, url.netloc, new_path, + url.query, url.fragment)) + run_cmd(['svn', 'copy', get_current_location(), tag_url]) def get_current_location(): From python-checkins at python.org Thu Oct 2 05:33:52 2008 From: python-checkins at python.org (barry.warsaw) Date: Thu, 2 Oct 2008 05:33:52 +0200 (CEST) Subject: [Python-checkins] r66721 - in python/trunk: Include/patchlevel.h Misc/NEWS Message-ID: <20081002033352.37E531E4002@bag.python.org> Author: barry.warsaw Date: Thu Oct 2 05:33:51 2008 New Revision: 66721 Log: Bump to 2.7a0 Modified: python/trunk/Include/patchlevel.h python/trunk/Misc/NEWS Modified: python/trunk/Include/patchlevel.h ============================================================================== --- python/trunk/Include/patchlevel.h (original) +++ python/trunk/Include/patchlevel.h Thu Oct 2 05:33:51 2008 @@ -21,13 +21,13 @@ /* Version parsed out into numeric values */ /*--start constants--*/ #define PY_MAJOR_VERSION 2 -#define PY_MINOR_VERSION 6 +#define PY_MINOR_VERSION 7 #define PY_MICRO_VERSION 0 -#define PY_RELEASE_LEVEL PY_RELEASE_LEVEL_FINAL +#define PY_RELEASE_LEVEL PY_RELEASE_LEVEL_ALPHA #define PY_RELEASE_SERIAL 0 /* Version as a string */ -#define PY_VERSION "2.6" +#define PY_VERSION "2.7a0" /*--end constants--*/ /* Subversion Revision number of this file (not of the repository) */ Modified: python/trunk/Misc/NEWS ============================================================================== --- python/trunk/Misc/NEWS (original) +++ python/trunk/Misc/NEWS Thu Oct 2 05:33:51 2008 @@ -4,6 +4,18 @@ (editors: check NEWS.help for information about editing NEWS using ReST.) +What's New in Python 2.7 alpha 1 +================================ + +*Release date: XX-XXX-20XX* + +Core and Builtins +----------------- + +Library +------- + + What's New in Python 2.6 final ============================== From buildbot at python.org Thu Oct 2 05:43:01 2008 From: buildbot at python.org (buildbot at python.org) Date: Thu, 02 Oct 2008 03:43:01 +0000 Subject: [Python-checkins] buildbot failure in AMD64 W2k8 trunk Message-ID: <20081002034301.21F4D1E4002@bag.python.org> The Buildbot has detected a new failure of AMD64 W2k8 trunk. Full details are available at: http://www.python.org/dev/buildbot/all/AMD64%20W2k8%20trunk/builds/984 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: nelson-win64 Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: barry.warsaw BUILD FAILED: failed test Excerpt from the test logfile: Traceback (most recent call last): File "../lib/test/regrtest.py", line 168, in from test import test_support File "S:\buildbots\python.x64\trunk.nelson-win64\build\lib\test\test_support.py", line 8, in import socket File "S:\buildbots\python.x64\trunk.nelson-win64\build\lib\socket.py", line 46, in import _socket ImportError: Module use of python26_d.dll conflicts with this version of Python. sincerely, -The Buildbot From buildbot at python.org Thu Oct 2 06:34:20 2008 From: buildbot at python.org (buildbot at python.org) Date: Thu, 02 Oct 2008 04:34:20 +0000 Subject: [Python-checkins] buildbot failure in g4 osx.4 trunk Message-ID: <20081002043421.16E641E4002@bag.python.org> The Buildbot has detected a new failure of g4 osx.4 trunk. Full details are available at: http://www.python.org/dev/buildbot/all/g4%20osx.4%20trunk/builds/3987 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: psf-g4 Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: barry.warsaw BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_asynchat make: *** [buildbottest] Error 1 sincerely, -The Buildbot From nnorwitz at gmail.com Thu Oct 2 11:00:29 2008 From: nnorwitz at gmail.com (Neal Norwitz) Date: Thu, 2 Oct 2008 05:00:29 -0400 Subject: [Python-checkins] Python Regression Test Failures basics (1) Message-ID: <20081002090029.GA5220@python.psfb.org> 326 tests OK. 1 test failed: test_distutils 33 tests skipped: test_aepack test_al test_applesingle test_bsddb185 test_bsddb3 test_cd test_cl test_curses test_epoll test_gl test_imgfile test_ioctl test_kqueue test_lib2to3 test_linuxaudiodev test_macos test_macostools test_multiprocessing test_ossaudiodev test_pep277 test_py3kwarn test_scriptpackages test_socketserver test_startfile test_sunaudiodev test_tcl test_timeout test_unicode_file test_urllib2net test_urllibnet test_winreg test_winsound test_zipfile64 4 skips unexpected on linux2: test_epoll test_multiprocessing test_lib2to3 test_ioctl test_grammar test_opcodes test_dict test_builtin test_exceptions test_types test_unittest test_doctest test_doctest2 test_MimeWriter test_SimpleHTTPServer test_StringIO test___all__ test___future__ test__locale test_abc test_abstract_numbers test_aepack test_aepack skipped -- No module named aepack test_al test_al skipped -- No module named al test_anydbm test_applesingle test_applesingle skipped -- No module named macostools test_array test_ast test_asynchat test_asyncore test_atexit test_audioop test_augassign test_base64 test_bastion test_bigaddrspace test_bigmem test_binascii test_binhex test_binop test_bisect test_bool test_bsddb test_bsddb185 test_bsddb185 skipped -- No module named bsddb185 test_bsddb3 test_bsddb3 skipped -- Use of the `bsddb' resource not enabled test_buffer test_bufio test_bytes test_bz2 test_calendar test_call test_capi test_cd test_cd skipped -- No module named cd test_cfgparser test_cgi test_charmapcodec test_cl test_cl skipped -- No module named cl test_class test_cmath test_cmd test_cmd_line test_cmd_line_script test_code test_codeccallbacks test_codecencodings_cn test_codecencodings_hk test_codecencodings_jp test_codecencodings_kr test_codecencodings_tw test_codecmaps_cn test_codecmaps_hk test_codecmaps_jp test_codecmaps_kr test_codecmaps_tw test_codecs test_codeop test_coding test_coercion test_collections test_colorsys test_commands test_compare test_compile test_compiler test_complex test_complex_args test_contains test_contextlib test_cookie test_cookielib test_copy test_copy_reg test_cpickle test_cprofile test_crypt test_csv test_ctypes test_curses test_curses skipped -- Use of the `curses' resource not enabled test_datetime test_dbm test_decimal test_decorators test_defaultdict test_deque test_descr test_descrtut test_difflib test_dircache test_dis test_distutils test test_distutils failed -- errors occurred; run in verbose mode for details test_dl test_docxmlrpc test_dumbdbm test_dummy_thread test_dummy_threading test_email test_email_codecs test_email_renamed test_enumerate test_eof test_epoll test_epoll skipped -- kernel doesn't support epoll() test_errno test_exception_variations test_extcall test_fcntl test_file test_filecmp test_fileinput test_fileio test_float test_fnmatch test_fork1 test_format test_fpformat test_fractions test_frozen test_ftplib test_funcattrs test_functools test_future test_future3 test_future4 test_future_builtins test_gc test_gdbm test_generators test_genericpath test_genexps test_getargs test_getargs2 test_getopt test_gettext test_gl test_gl skipped -- No module named gl test_glob test_global test_grp test_gzip test_hash test_hashlib test_heapq test_hmac test_hotshot test_htmllib test_htmlparser test_httplib test_httpservers [12826 refs] [12826 refs] [21355 refs] test_imageop test_imaplib test_imgfile test_imgfile skipped -- No module named imgfile test_imp test_import test_importhooks test_index test_inspect test_int test_int_literal test_io test_ioctl test_ioctl skipped -- Unable to open /dev/tty test_isinstance test_iter test_iterlen test_itertools test_json test_kqueue test_kqueue skipped -- test works only on BSD test_largefile test_lib2to3 test_lib2to3 skipped -- No module named myfixes test_linuxaudiodev test_linuxaudiodev skipped -- Use of the `audio' resource not enabled test_list test_locale test_logging test_long test_long_future test_longexp test_macos test_macos skipped -- No module named MacOS test_macostools test_macostools skipped -- No module named macostools test_macpath test_mailbox test_marshal test_math test_md5 test_memoryio test_mhlib test_mimetools test_mimetypes test_minidom test_mmap test_module test_modulefinder test_multibytecodec test_multibytecodec_support test_multifile test_multiprocessing test_multiprocessing skipped -- OSError raises on RLock creation, see issue 3111! test_mutants test_mutex test_netrc test_new test_nis test_normalization test_ntpath test_old_mailbox test_openpty test_operator test_optparse test_os /tmp/python-test/local/lib/python2.6/os.py:759: DeprecationWarning: integer argument expected, got float bs += read(_urandomfd, n - len(bs)) test_ossaudiodev test_ossaudiodev skipped -- Use of the `audio' resource not enabled test_parser Expecting 's_push: parser stack overflow' in next line s_push: parser stack overflow test_peepholer test_pep247 test_pep263 test_pep277 test_pep277 skipped -- test works only on NT+ test_pep292 test_pep352 test_pickle test_pickletools test_pipes test_pkg test_pkgimport test_pkgutil test_platform test_plistlib test_poll test_popen [12831 refs] [12831 refs] [12831 refs] test_popen2 test_poplib test_posix test_posixpath test_pow test_pprint test_print test_profile test_profilehooks test_property test_pstats test_pty test_pwd test_py3kwarn test_py3kwarn skipped -- test.test_py3kwarn must be run with the -3 flag test_pyclbr test_pydoc [17360 refs] test_pyexpat test_queue test_quopri [15345 refs] [15345 refs] test_random test_re test_repr test_resource test_rfc822 test_richcmp test_robotparser test_runpy test_sax test_scope test_scriptpackages test_scriptpackages skipped -- No module named aetools test_select test_set test_sets test_sgmllib test_sha test_shelve test_shlex test_shutil test_signal test_site [12826 refs] [12826 refs] [12829 refs] [12826 refs] test_slice test_smtplib test_socket test_socketserver test_socketserver skipped -- Use of the `network' resource not enabled test_softspace test_sort test_sqlite test_ssl test_startfile test_startfile skipped -- cannot import name startfile test_str test_strftime test_string test_stringprep test_strop test_strptime test_struct test_structmembers test_structseq test_subprocess [12826 refs] [12826 refs] [12826 refs] [12826 refs] [12826 refs] [12826 refs] [12826 refs] [12826 refs] [12826 refs] [12826 refs] [12826 refs] [12826 refs] [14726 refs] [13041 refs] [12826 refs] [12826 refs] [12826 refs] [12826 refs] [12826 refs] [12826 refs] . [12826 refs] [12826 refs] this bit of output is from a test of stdout in a different process ... [12826 refs] [12826 refs] [13041 refs] test_sunaudiodev test_sunaudiodev skipped -- No module named sunaudiodev test_sundry /tmp/python-test/local/lib/python2.6/test/test_sundry.py:67: DeprecationWarning: The posixfile module is deprecated; fcntl.lockf() provides better locking import posixfile test_symtable test_syntax test_sys [12826 refs] [12826 refs] [13055 refs] [12849 refs] test_tarfile test_tcl test_tcl skipped -- No module named _tkinter test_telnetlib test_tempfile [12829 refs] test_textwrap test_thread test_threaded_import test_threadedtempfile test_threading [16318 refs] [16812 refs] [15783 refs] [15783 refs] [15783 refs] [15783 refs] test_threading_local test_threadsignals test_time test_timeout test_timeout skipped -- Use of the `network' resource not enabled test_tokenize test_trace test_traceback test_transformer test_tuple test_typechecks test_ucn test_unary test_undocumented_details test_unicode test_unicode_file test_unicode_file skipped -- No Unicode filesystem semantics on this platform. test_unicodedata test_univnewlines test_unpack test_urllib test_urllib2 test_urllib2_localnet test_urllib2net test_urllib2net skipped -- Use of the `network' resource not enabled test_urllibnet test_urllibnet skipped -- Use of the `network' resource not enabled test_urlparse test_userdict test_userlist test_userstring test_uu test_uuid WARNING: uuid.getnode is unreliable on many platforms. It is disabled until the code and/or test can be fixed properly. WARNING: uuid._ifconfig_getnode is unreliable on many platforms. It is disabled until the code and/or test can be fixed properly. WARNING: uuid._unixdll_getnode is unreliable on many platforms. It is disabled until the code and/or test can be fixed properly. test_wait3 test_wait4 test_warnings test_wave test_weakref test_whichdb test_winreg test_winreg skipped -- No module named _winreg test_winsound test_winsound skipped -- No module named winsound test_with test_wsgiref test_xdrlib test_xml_etree test_xml_etree_c test_xmllib test_xmlrpc test_xpickle test_xrange test_zipfile test_zipfile64 test_zipfile64 skipped -- test requires loads of disk-space bytes and a long time to run test_zipimport test_zlib 326 tests OK. 1 test failed: test_distutils 33 tests skipped: test_aepack test_al test_applesingle test_bsddb185 test_bsddb3 test_cd test_cl test_curses test_epoll test_gl test_imgfile test_ioctl test_kqueue test_lib2to3 test_linuxaudiodev test_macos test_macostools test_multiprocessing test_ossaudiodev test_pep277 test_py3kwarn test_scriptpackages test_socketserver test_startfile test_sunaudiodev test_tcl test_timeout test_unicode_file test_urllib2net test_urllibnet test_winreg test_winsound test_zipfile64 4 skips unexpected on linux2: test_epoll test_multiprocessing test_lib2to3 test_ioctl [647817 refs] From nnorwitz at gmail.com Thu Oct 2 11:29:49 2008 From: nnorwitz at gmail.com (Neal Norwitz) Date: Thu, 2 Oct 2008 05:29:49 -0400 Subject: [Python-checkins] Python Regression Test Failures opt (1) Message-ID: <20081002092948.GA6644@python.psfb.org> 326 tests OK. 1 test failed: test_distutils 33 tests skipped: test_aepack test_al test_applesingle test_bsddb185 test_bsddb3 test_cd test_cl test_curses test_epoll test_gl test_imgfile test_ioctl test_kqueue test_lib2to3 test_linuxaudiodev test_macos test_macostools test_multiprocessing test_ossaudiodev test_pep277 test_py3kwarn test_scriptpackages test_socketserver test_startfile test_sunaudiodev test_tcl test_timeout test_unicode_file test_urllib2net test_urllibnet test_winreg test_winsound test_zipfile64 4 skips unexpected on linux2: test_epoll test_multiprocessing test_lib2to3 test_ioctl test_grammar test_opcodes test_dict test_builtin test_exceptions test_types test_unittest test_doctest test_doctest2 test_MimeWriter test_SimpleHTTPServer test_StringIO test___all__ test___future__ test__locale test_abc test_abstract_numbers test_aepack test_aepack skipped -- No module named aepack test_al test_al skipped -- No module named al test_anydbm test_applesingle test_applesingle skipped -- No module named macostools test_array test_ast test_asynchat test_asyncore test_atexit test_audioop test_augassign test_base64 test_bastion test_bigaddrspace test_bigmem test_binascii test_binhex test_binop test_bisect test_bool test_bsddb test_bsddb185 test_bsddb185 skipped -- No module named bsddb185 test_bsddb3 test_bsddb3 skipped -- Use of the `bsddb' resource not enabled test_buffer test_bufio test_bytes test_bz2 test_calendar test_call test_capi test_cd test_cd skipped -- No module named cd test_cfgparser test_cgi test_charmapcodec test_cl test_cl skipped -- No module named cl test_class test_cmath test_cmd test_cmd_line test_cmd_line_script test_code test_codeccallbacks test_codecencodings_cn test_codecencodings_hk test_codecencodings_jp test_codecencodings_kr test_codecencodings_tw test_codecmaps_cn test_codecmaps_hk test_codecmaps_jp test_codecmaps_kr test_codecmaps_tw test_codecs test_codeop test_coding test_coercion test_collections test_colorsys test_commands test_compare test_compile test_compiler test_complex test_complex_args test_contains test_contextlib test_cookie test_cookielib test_copy test_copy_reg test_cpickle test_cprofile test_crypt test_csv test_ctypes test_curses test_curses skipped -- Use of the `curses' resource not enabled test_datetime test_dbm test_decimal test_decorators test_defaultdict test_deque test_descr test_descrtut test_difflib test_dircache test_dis test_distutils [17000 refs] test test_distutils failed -- errors occurred; run in verbose mode for details test_dl test_docxmlrpc test_dumbdbm test_dummy_thread test_dummy_threading test_email test_email_codecs test_email_renamed test_enumerate test_eof test_epoll test_epoll skipped -- kernel doesn't support epoll() test_errno test_exception_variations test_extcall test_fcntl test_file test_filecmp test_fileinput test_fileio test_float test_fnmatch test_fork1 test_format test_fpformat test_fractions test_frozen test_ftplib test_funcattrs test_functools test_future test_future3 test_future4 test_future_builtins test_gc test_gdbm test_generators test_genericpath test_genexps test_getargs test_getargs2 test_getopt test_gettext test_gl test_gl skipped -- No module named gl test_glob test_global test_grp test_gzip test_hash test_hashlib test_heapq test_hmac test_hotshot test_htmllib test_htmlparser test_httplib test_httpservers [12826 refs] [12826 refs] [21355 refs] test_imageop test_imaplib test_imgfile test_imgfile skipped -- No module named imgfile test_imp test_import test_importhooks test_index test_inspect test_int test_int_literal test_io test_ioctl test_ioctl skipped -- Unable to open /dev/tty test_isinstance test_iter test_iterlen test_itertools test_json test_kqueue test_kqueue skipped -- test works only on BSD test_largefile test_lib2to3 test_lib2to3 skipped -- No module named myfixes test_linuxaudiodev test_linuxaudiodev skipped -- Use of the `audio' resource not enabled test_list test_locale test_logging test_long test_long_future test_longexp test_macos test_macos skipped -- No module named MacOS test_macostools test_macostools skipped -- No module named macostools test_macpath test_mailbox test_marshal test_math test_md5 test_memoryio test_mhlib test_mimetools test_mimetypes test_minidom test_mmap test_module test_modulefinder test_multibytecodec test_multibytecodec_support test_multifile test_multiprocessing test_multiprocessing skipped -- OSError raises on RLock creation, see issue 3111! test_mutants test_mutex test_netrc test_new test_nis test_normalization test_ntpath test_old_mailbox test_openpty test_operator test_optparse test_os /tmp/python-test/local/lib/python2.6/os.py:759: DeprecationWarning: integer argument expected, got float bs += read(_urandomfd, n - len(bs)) test_ossaudiodev test_ossaudiodev skipped -- Use of the `audio' resource not enabled test_parser Expecting 's_push: parser stack overflow' in next line s_push: parser stack overflow test_peepholer test_pep247 test_pep263 test_pep277 test_pep277 skipped -- test works only on NT+ test_pep292 test_pep352 test_pickle test_pickletools test_pipes test_pkg test_pkgimport test_pkgutil test_platform test_plistlib test_poll test_popen [12831 refs] [12831 refs] [12831 refs] test_popen2 test_poplib test_posix test_posixpath test_pow test_pprint test_print test_profile test_profilehooks test_property test_pstats test_pty test_pwd test_py3kwarn test_py3kwarn skipped -- test.test_py3kwarn must be run with the -3 flag test_pyclbr test_pydoc [17360 refs] test_pyexpat test_queue test_quopri [15345 refs] [15345 refs] test_random test_re test_repr test_resource test_rfc822 test_richcmp test_robotparser test_runpy test_sax test_scope test_scriptpackages test_scriptpackages skipped -- No module named aetools test_select test_set test_sets test_sgmllib test_sha test_shelve test_shlex test_shutil test_signal test_site [12826 refs] [12826 refs] [12829 refs] [12826 refs] test_slice test_smtplib test_socket test_socketserver test_socketserver skipped -- Use of the `network' resource not enabled test_softspace test_sort test_sqlite test_ssl test_startfile test_startfile skipped -- cannot import name startfile test_str test_strftime test_string test_stringprep test_strop test_strptime test_struct test_structmembers test_structseq test_subprocess [12826 refs] [12826 refs] [12826 refs] [12826 refs] [12826 refs] [12826 refs] [12826 refs] [12826 refs] [12826 refs] [12826 refs] [12826 refs] [12826 refs] [14726 refs] [13041 refs] [12826 refs] [12826 refs] [12826 refs] [12826 refs] [12826 refs] [12826 refs] . [12826 refs] [12826 refs] this bit of output is from a test of stdout in a different process ... [12826 refs] [12826 refs] [13041 refs] test_sunaudiodev test_sunaudiodev skipped -- No module named sunaudiodev test_sundry /tmp/python-test/local/lib/python2.6/test/test_sundry.py:67: DeprecationWarning: The posixfile module is deprecated; fcntl.lockf() provides better locking import posixfile test_symtable test_syntax test_sys [12826 refs] [12826 refs] [13055 refs] [12849 refs] test_tarfile test_tcl test_tcl skipped -- No module named _tkinter test_telnetlib test_tempfile [12829 refs] test_textwrap test_thread test_threaded_import test_threadedtempfile test_threading [16318 refs] [15967 refs] [15783 refs] [15783 refs] [15783 refs] [15783 refs] test_threading_local test_threadsignals test_time test_timeout test_timeout skipped -- Use of the `network' resource not enabled test_tokenize test_trace test_traceback test_transformer test_tuple test_typechecks test_ucn test_unary test_undocumented_details test_unicode test_unicode_file test_unicode_file skipped -- No Unicode filesystem semantics on this platform. test_unicodedata test_univnewlines test_unpack test_urllib test_urllib2 test_urllib2_localnet test_urllib2net test_urllib2net skipped -- Use of the `network' resource not enabled test_urllibnet test_urllibnet skipped -- Use of the `network' resource not enabled test_urlparse test_userdict test_userlist test_userstring test_uu test_uuid WARNING: uuid.getnode is unreliable on many platforms. It is disabled until the code and/or test can be fixed properly. WARNING: uuid._ifconfig_getnode is unreliable on many platforms. It is disabled until the code and/or test can be fixed properly. WARNING: uuid._unixdll_getnode is unreliable on many platforms. It is disabled until the code and/or test can be fixed properly. test_wait3 test_wait4 test_warnings test_wave test_weakref test_whichdb test_winreg test_winreg skipped -- No module named _winreg test_winsound test_winsound skipped -- No module named winsound test_with test_wsgiref test_xdrlib test_xml_etree test_xml_etree_c test_xmllib test_xmlrpc test_xpickle test_xrange test_zipfile test_zipfile64 test_zipfile64 skipped -- test requires loads of disk-space bytes and a long time to run test_zipimport test_zlib 326 tests OK. 1 test failed: test_distutils 33 tests skipped: test_aepack test_al test_applesingle test_bsddb185 test_bsddb3 test_cd test_cl test_curses test_epoll test_gl test_imgfile test_ioctl test_kqueue test_lib2to3 test_linuxaudiodev test_macos test_macostools test_multiprocessing test_ossaudiodev test_pep277 test_py3kwarn test_scriptpackages test_socketserver test_startfile test_sunaudiodev test_tcl test_timeout test_unicode_file test_urllib2net test_urllibnet test_winreg test_winsound test_zipfile64 4 skips unexpected on linux2: test_epoll test_multiprocessing test_lib2to3 test_ioctl [647099 refs] From python-checkins at python.org Thu Oct 2 13:44:18 2008 From: python-checkins at python.org (martin.v.loewis) Date: Thu, 2 Oct 2008 13:44:18 +0200 (CEST) Subject: [Python-checkins] r66722 - python/trunk/Tools/msi/merge.py Message-ID: <20081002114418.2DBEA1E4002@bag.python.org> Author: martin.v.loewis Date: Thu Oct 2 13:44:17 2008 New Revision: 66722 Log: Use CRT 9 policy files. Modified: python/trunk/Tools/msi/merge.py Modified: python/trunk/Tools/msi/merge.py ============================================================================== --- python/trunk/Tools/msi/merge.py (original) +++ python/trunk/Tools/msi/merge.py Thu Oct 2 13:44:17 2008 @@ -9,10 +9,10 @@ if len(sys.argv)==2: msi = sys.argv[1] if Win64: - modules = ["Microsoft_VC90_CRT_x86_x64.msm", "policy_8_0_Microsoft_VC80_CRT_x86_x64.msm"] + modules = ["Microsoft_VC90_CRT_x86_x64.msm", "policy_9_0_Microsoft_VC90_CRT_x86_x64.msm"] if not msi: msi = "python-%s.amd64.msi" % full_current_version else: - modules = ["Microsoft_VC90_CRT_x86.msm","policy_8_0_Microsoft_VC80_CRT_x86.msm"] + modules = ["Microsoft_VC90_CRT_x86.msm","policy_9_0_Microsoft_VC90_CRT_x86.msm"] if not msi: msi = "python-%s.msi" % full_current_version for i, n in enumerate(modules): modules[i] = os.path.join(mod_dir, n) From python-checkins at python.org Thu Oct 2 13:55:09 2008 From: python-checkins at python.org (martin.v.loewis) Date: Thu, 2 Oct 2008 13:55:09 +0200 (CEST) Subject: [Python-checkins] r66724 - python/branches/release26-maint/Tools/msi/merge.py Message-ID: <20081002115509.D2F811E4006@bag.python.org> Author: martin.v.loewis Date: Thu Oct 2 13:55:09 2008 New Revision: 66724 Log: Backport of r66722: Use CRT 9 policy files. Modified: python/branches/release26-maint/Tools/msi/merge.py Modified: python/branches/release26-maint/Tools/msi/merge.py ============================================================================== --- python/branches/release26-maint/Tools/msi/merge.py (original) +++ python/branches/release26-maint/Tools/msi/merge.py Thu Oct 2 13:55:09 2008 @@ -9,10 +9,10 @@ if len(sys.argv)==2: msi = sys.argv[1] if Win64: - modules = ["Microsoft_VC90_CRT_x86_x64.msm", "policy_8_0_Microsoft_VC80_CRT_x86_x64.msm"] + modules = ["Microsoft_VC90_CRT_x86_x64.msm", "policy_9_0_Microsoft_VC90_CRT_x86_x64.msm"] if not msi: msi = "python-%s.amd64.msi" % full_current_version else: - modules = ["Microsoft_VC90_CRT_x86.msm","policy_8_0_Microsoft_VC80_CRT_x86.msm"] + modules = ["Microsoft_VC90_CRT_x86.msm","policy_9_0_Microsoft_VC90_CRT_x86.msm"] if not msi: msi = "python-%s.msi" % full_current_version for i, n in enumerate(modules): modules[i] = os.path.join(mod_dir, n) From python-checkins at python.org Thu Oct 2 14:15:43 2008 From: python-checkins at python.org (martin.v.loewis) Date: Thu, 2 Oct 2008 14:15:43 +0200 (CEST) Subject: [Python-checkins] r66725 - in python/branches/empty: Makefile README Tools Tools/buildbot Tools/buildbot/build-amd64.bat Tools/buildbot/build.bat Tools/buildbot/clean-amd64.bat Tools/buildbot/clean.bat Tools/buildbot/test-amd64.bat Tools/buildbot/test.bat configure Message-ID: <20081002121543.7414C1E4002@bag.python.org> Author: martin.v.loewis Date: Thu Oct 2 14:15:43 2008 New Revision: 66725 Log: Create a nearly-empty Python project for cleaning up build slaves. Added: python/branches/empty/ python/branches/empty/Makefile python/branches/empty/README python/branches/empty/Tools/ python/branches/empty/Tools/buildbot/ python/branches/empty/Tools/buildbot/build-amd64.bat python/branches/empty/Tools/buildbot/build.bat python/branches/empty/Tools/buildbot/clean-amd64.bat python/branches/empty/Tools/buildbot/clean.bat python/branches/empty/Tools/buildbot/test-amd64.bat python/branches/empty/Tools/buildbot/test.bat python/branches/empty/configure (contents, props changed) Added: python/branches/empty/Makefile ============================================================================== --- (empty file) +++ python/branches/empty/Makefile Thu Oct 2 14:15:43 2008 @@ -0,0 +1,2 @@ +buildbottest distclean: + Added: python/branches/empty/README ============================================================================== --- (empty file) +++ python/branches/empty/README Thu Oct 2 14:15:43 2008 @@ -0,0 +1,2 @@ +This is an empty directory which can be used +to mostly-clean the local checkouts on the build slaves. Added: python/branches/empty/Tools/buildbot/build-amd64.bat ============================================================================== --- (empty file) +++ python/branches/empty/Tools/buildbot/build-amd64.bat Thu Oct 2 14:15:43 2008 @@ -0,0 +1 @@ + at echo Done Added: python/branches/empty/Tools/buildbot/build.bat ============================================================================== --- (empty file) +++ python/branches/empty/Tools/buildbot/build.bat Thu Oct 2 14:15:43 2008 @@ -0,0 +1 @@ + at echo Done Added: python/branches/empty/Tools/buildbot/clean-amd64.bat ============================================================================== --- (empty file) +++ python/branches/empty/Tools/buildbot/clean-amd64.bat Thu Oct 2 14:15:43 2008 @@ -0,0 +1 @@ + at echo Done Added: python/branches/empty/Tools/buildbot/clean.bat ============================================================================== --- (empty file) +++ python/branches/empty/Tools/buildbot/clean.bat Thu Oct 2 14:15:43 2008 @@ -0,0 +1 @@ + at echo Done Added: python/branches/empty/Tools/buildbot/test-amd64.bat ============================================================================== --- (empty file) +++ python/branches/empty/Tools/buildbot/test-amd64.bat Thu Oct 2 14:15:43 2008 @@ -0,0 +1 @@ + at echo Done Added: python/branches/empty/Tools/buildbot/test.bat ============================================================================== --- (empty file) +++ python/branches/empty/Tools/buildbot/test.bat Thu Oct 2 14:15:43 2008 @@ -0,0 +1 @@ + at echo Done Added: python/branches/empty/configure ============================================================================== --- (empty file) +++ python/branches/empty/configure Thu Oct 2 14:15:43 2008 @@ -0,0 +1,2 @@ +#!/bin/sh +exit 0 From python-checkins at python.org Thu Oct 2 14:40:50 2008 From: python-checkins at python.org (georg.brandl) Date: Thu, 2 Oct 2008 14:40:50 +0200 (CEST) Subject: [Python-checkins] r66726 - in peps/trunk: pep-0003.txt pep-0334.txt pep-0336.txt pep-0348.txt pep-0354.txt pep-3100.txt pep-3101.txt pep-3107.txt pep-3108.txt pep-3110.txt pep-3118.txt pep-3127.txt Message-ID: <20081002124050.3EE541E4002@bag.python.org> Author: georg.brandl Date: Thu Oct 2 14:40:49 2008 New Revision: 66726 Log: Update doc URLs in PEPs. Modified: peps/trunk/pep-0003.txt peps/trunk/pep-0334.txt peps/trunk/pep-0336.txt peps/trunk/pep-0348.txt peps/trunk/pep-0354.txt peps/trunk/pep-3100.txt peps/trunk/pep-3101.txt peps/trunk/pep-3107.txt peps/trunk/pep-3108.txt peps/trunk/pep-3110.txt peps/trunk/pep-3118.txt peps/trunk/pep-3127.txt Modified: peps/trunk/pep-0003.txt ============================================================================== --- peps/trunk/pep-0003.txt (original) +++ peps/trunk/pep-0003.txt Thu Oct 2 14:40:49 2008 @@ -18,9 +18,7 @@ These are guidelines for the developers of Python, not the submitters of bugs. Those are at - http://docs.python.org/lib/reporting-bugs.html - - (though this hardly seems the best place). + http://docs.python.org/bugs.html Guidelines Modified: peps/trunk/pep-0334.txt ============================================================================== --- peps/trunk/pep-0334.txt (original) +++ peps/trunk/pep-0334.txt Thu Oct 2 14:40:49 2008 @@ -394,7 +394,7 @@ (http://www.python.org/peps/pep-0255.html) .. [9] itertools - Functions creating iterators - (http://docs.python.org/lib/module-itertools.html) + (http://docs.python.org/library/itertools.html) .. [10] Microthreads in Python, David Mertz (http://www-106.ibm.com/developerworks/linux/library/l-pythrd.html) Modified: peps/trunk/pep-0336.txt ============================================================================== --- peps/trunk/pep-0336.txt (original) +++ peps/trunk/pep-0336.txt Thu Oct 2 14:40:49 2008 @@ -113,7 +113,7 @@ References [1] Python Reference Manual, Section 3.2, - http://docs.python.org/ref/ref.html + http://docs.python.org/reference/ Copyright Modified: peps/trunk/pep-0348.txt ============================================================================== --- peps/trunk/pep-0348.txt (original) +++ peps/trunk/pep-0348.txt Thu Oct 2 14:40:49 2008 @@ -464,7 +464,7 @@ http://mail.python.org/pipermail/python-dev/2005-August/055116.html .. [#exceptions-stdlib] exceptions module - http://docs.python.org/lib/module-exceptions.html + http://docs.python.org/library/exceptions.html .. [#python-dev-thread1] python-dev thread (Pre-PEP: Exception Reorganization for Python 3.0) @@ -508,7 +508,7 @@ http://www.python.org/peps/pep-0020.html .. [#tutorial] Python Tutorial - http://docs.python.org/tut/tut.html + http://docs.python.org/tutorial/ .. [#rejected] python-dev email (Bare except clauses in PEP 348) http://mail.python.org/pipermail/python-dev/2005-August/055676.html Modified: peps/trunk/pep-0354.txt ============================================================================== --- peps/trunk/pep-0354.txt (original) +++ peps/trunk/pep-0354.txt Thu Oct 2 14:40:49 2008 @@ -228,7 +228,7 @@ The ``NotImplemented`` return value from comparison operations signals the Python interpreter to attempt alternative comparisons or other fallbacks. - + .. [#ENUM-RECIPE] "First Class Enums in Python", Zoran Isailovski, Modified: peps/trunk/pep-3100.txt ============================================================================== --- peps/trunk/pep-3100.txt (original) +++ peps/trunk/pep-3100.txt Thu Oct 2 14:40:49 2008 @@ -350,19 +350,19 @@ http://mail.python.org/pipermail/python-dev/2008-February/076818.html .. [#sys-module] Python docs (sys -- System-specific parameters and functions) - http://docs.python.org/lib/module-sys.html + http://docs.python.org/library/sys.html .. [#operator-module] Python docs (operator -- Standard operators as functions) - http://docs.python.org/lib/module-operator.html + http://docs.python.org/library/operator.html .. [#array-module] Python docs (array -- Efficient arrays of numeric values) - http://docs.python.org/lib/module-array.html + http://docs.python.org/library/array.html .. [#file-object] Python docs (File objects) - http://docs.python.org/lib/bltin-file-objects.html + http://docs.python.org/library/stdtypes.html .. [#sequence-types] Python docs (Additional methods for emulation of sequence types) - http://docs.python.org/ref/sequence-methods.html + http://docs.python.org/reference/datamodel.html#additional-methods-for-emulation-of-sequence-types .. [#pep4] PEP 4 ("Deprecation of Standard Modules") http://www.python.org/dev/peps/pep-0004 Modified: peps/trunk/pep-3101.txt ============================================================================== --- peps/trunk/pep-3101.txt (original) +++ peps/trunk/pep-3101.txt Thu Oct 2 14:40:49 2008 @@ -794,10 +794,10 @@ References [1] Python Library Reference - String formating operations - http://docs.python.org/lib/typesseq-strings.html + http://docs.python.org/library/stdtypes.html#string-formatting-operations [2] Python Library References - Template strings - http://docs.python.org/lib/node109.html + http://docs.python.org/library/string.html#string.Template [3] [Python-3000] String formating operations in python 3k http://mail.python.org/pipermail/python-3000/2006-April/000285.html Modified: peps/trunk/pep-3107.txt ============================================================================== --- peps/trunk/pep-3107.txt (original) +++ peps/trunk/pep-3107.txt Thu Oct 2 14:40:49 2008 @@ -338,7 +338,7 @@ http://rpyc.wikispaces.com/ .. [#pydoc] - http://docs.python.org/lib/module-pydoc.html + http://docs.python.org/library/pydoc.html Copyright Modified: peps/trunk/pep-3108.txt ============================================================================== --- peps/trunk/pep-3108.txt (original) +++ peps/trunk/pep-3108.txt Thu Oct 2 14:40:49 2008 @@ -1143,9 +1143,6 @@ .. [#module-index] Python Documentation: Global Module Index (http://docs.python.org/modindex.html) -.. [#timing-module] Python Library Reference: Obsolete - (http://docs.python.org/lib/obsolete-modules.html) - .. [#silly-old-stuff] Python-Dev email: "Py3k release schedule worries" (http://mail.python.org/pipermail/python-3000/2006-December/005130.html) @@ -1181,7 +1178,7 @@ (http://appscript.sourceforge.net/) .. [#ast] _ast module - (http://docs.python.org/lib/ast.html) + (http://docs.python.org/library/ast.html) .. [#ast-removal] python-dev email: getting compiler package failures (http://mail.python.org/pipermail/python-3000/2007-May/007615.html) Modified: peps/trunk/pep-3110.txt ============================================================================== --- peps/trunk/pep-3110.txt (original) +++ peps/trunk/pep-3110.txt Thu Oct 2 14:40:49 2008 @@ -239,7 +239,7 @@ http://www.python.org/dev/peps/pep-0020/ .. [#sys-module] - http://docs.python.org/lib/module-sys.html + http://docs.python.org/library/sys.html .. [#pep3100] http://www.python.org/dev/peps/pep-3100/ Modified: peps/trunk/pep-3118.txt ============================================================================== --- peps/trunk/pep-3118.txt (original) +++ peps/trunk/pep-3118.txt Thu Oct 2 14:40:49 2008 @@ -635,7 +635,7 @@ The struct string-syntax is missing some characters to fully implement data-format descriptions already available elsewhere (in ctypes and NumPy for example). The Python 2.5 specification is -at http://docs.python.org/lib/module-struct.html. +at http://docs.python.org/library/struct.html. Here are the proposed additions: Modified: peps/trunk/pep-3127.txt ============================================================================== --- peps/trunk/pep-3127.txt (original) +++ peps/trunk/pep-3127.txt Thu Oct 2 14:40:49 2008 @@ -492,7 +492,7 @@ (http://www.gnu.org/software/libc/manual/html_node/Integer-Conversions.html) .. [2] Python string formatting operations - (http://docs.python.org/lib/typesseq-strings.html) + (http://docs.python.org/library/stdtypes.html#string-formatting-operations) .. [3] The Representation of Numbers, Jiajie Zhang and Donald A. Norman (http://acad88.sahs.uth.tmc.edu/research/publications/Number-Representation.pdf) From buildbot at python.org Thu Oct 2 14:50:36 2008 From: buildbot at python.org (buildbot at python.org) Date: Thu, 02 Oct 2008 12:50:36 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc trunk Message-ID: <20081002125036.82EF11E4002@bag.python.org> The Buildbot has detected a new failure of sparc solaris10 gcc trunk. Full details are available at: http://www.python.org/dev/buildbot/all/sparc%20solaris10%20gcc%20trunk/builds/0 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: loewis-sun Build Reason: The web-page 'force build' button was pressed by 'Martin v. L??wis': Test empty branch Build Source Stamp: [branch branches/empty] HEAD Blamelist: BUILD FAILED: failed compile sincerely, -The Buildbot From python-checkins at python.org Thu Oct 2 14:51:06 2008 From: python-checkins at python.org (georg.brandl) Date: Thu, 2 Oct 2008 14:51:06 +0200 (CEST) Subject: [Python-checkins] r66727 - in peps/trunk: pep-0201.txt pep-0202.txt pep-0212.txt pep-0214.txt pep-0231.txt pep-0256.txt pep-0269.txt pep-0292.txt pep-0301.txt pep-0316.txt pep-0317.txt pep-0319.txt pep-0323.txt pep-0331.txt pep-3107.txt pep-3109.txt pep-3110.txt pep-3112.txt Message-ID: <20081002125106.72E5B1E4002@bag.python.org> Author: georg.brandl Date: Thu Oct 2 14:51:05 2008 New Revision: 66727 Log: More link updates. Modified: peps/trunk/pep-0201.txt peps/trunk/pep-0202.txt peps/trunk/pep-0212.txt peps/trunk/pep-0214.txt peps/trunk/pep-0231.txt peps/trunk/pep-0256.txt peps/trunk/pep-0269.txt peps/trunk/pep-0292.txt peps/trunk/pep-0301.txt peps/trunk/pep-0316.txt peps/trunk/pep-0317.txt peps/trunk/pep-0319.txt peps/trunk/pep-0323.txt peps/trunk/pep-0331.txt peps/trunk/pep-3107.txt peps/trunk/pep-3109.txt peps/trunk/pep-3110.txt peps/trunk/pep-3112.txt Modified: peps/trunk/pep-0201.txt ============================================================================== --- peps/trunk/pep-0201.txt (original) +++ peps/trunk/pep-0201.txt Thu Oct 2 14:51:05 2008 @@ -262,7 +262,7 @@ References - [1] http://www.python.org/doc/current/ref/for.html + [1] http://docs.python.org/reference/compound_stmts.html#for [2] http://www.haskell.org/onlinereport/standard-prelude.html#$vzip Greg Wilson's questionaire on proposed syntax to some CS grad students Modified: peps/trunk/pep-0202.txt ============================================================================== --- peps/trunk/pep-0202.txt (original) +++ peps/trunk/pep-0202.txt Thu Oct 2 14:51:05 2008 @@ -75,7 +75,7 @@ References - [1] http://www.python.org/doc/current/ref/lists.html#l2h-238 + [1] http://docs.python.org/reference/expressions.html#list-displays Modified: peps/trunk/pep-0212.txt ============================================================================== --- peps/trunk/pep-0212.txt (original) +++ peps/trunk/pep-0212.txt Thu Oct 2 14:51:05 2008 @@ -153,7 +153,7 @@ References - [1] http://www.python.org/doc/current/ref/for.html + [1] http://docs.python.org/reference/compound_stmts.html#for [2] Lockstep Iteration, PEP 201 [3] http://sourceforge.net/patch/download.php?id=101138 [4] http://sourceforge.net/patch/download.php?id=101129 Modified: peps/trunk/pep-0214.txt ============================================================================== --- peps/trunk/pep-0214.txt (original) +++ peps/trunk/pep-0214.txt Thu Oct 2 14:51:05 2008 @@ -359,7 +359,7 @@ References - [1] http://www.python.org/doc/current/ref/print.html + [1] http://docs.python.org/reference/simple_stmts.html#print [2] http://sourceforge.net/patch/download.php?id=100970 Modified: peps/trunk/pep-0231.txt ============================================================================== --- peps/trunk/pep-0231.txt (original) +++ peps/trunk/pep-0231.txt Thu Oct 2 14:51:05 2008 @@ -594,13 +594,13 @@ References - [1] http://www.python.org/doc/current/ref/attribute-access.html + [1] http://docs.python.org/reference/datamodel.html#customizing-attribute-access [2] http://www.javasoft.com/products/javabeans/ [3] http://www.digicool.com/releases/ExtensionClass/Acquisition.html [5] http://www.digicool.com/releases/ExtensionClass [6] http://www.python.org/doc/essays/metaclasses/ [7] http://www.foretec.com/python/workshops/1998-11/dd-ascher-sum.html - [8] http://www.python.org/doc/howto/rexec/rexec.html + [8] http://docs.python.org/howto/regex.html [9] PEP 213, Attribute Access Handlers, Prescod http://www.python.org/peps/pep-0213.html Modified: peps/trunk/pep-0256.txt ============================================================================== --- peps/trunk/pep-0256.txt (original) +++ peps/trunk/pep-0256.txt Thu Oct 2 14:51:05 2008 @@ -269,7 +269,7 @@ .. _HappyDoc: http://happydoc.sourceforge.net/ -.. _pydoc: http://www.python.org/doc/current/lib/module-pydoc.html +.. _pydoc: http://docs.python.org/library/pydoc.html .. _docutils: http://www.tibsnjoan.co.uk/docutils.html Modified: peps/trunk/pep-0269.txt ============================================================================== --- peps/trunk/pep-0269.txt (original) +++ peps/trunk/pep-0269.txt Thu Oct 2 14:51:05 2008 @@ -163,10 +163,10 @@ http://www.python.org/sigs/compiler-sig/ [2] Parser Module Documentation - http://www.python.org/doc/current/lib/module-parser.html + http://docs.python.org/library/parser.html [3] Hylton, Jeremy. - http://www.python.org/doc/current/lib/compiler.html + http://docs.python.org/library/compiler.html [4] Pelletier, Michel. "Python Interface Syntax", PEP-245. http://www.python.org/peps/pep-0245.html Modified: peps/trunk/pep-0292.txt ============================================================================== --- peps/trunk/pep-0292.txt (original) +++ peps/trunk/pep-0292.txt Thu Oct 2 14:51:05 2008 @@ -182,10 +182,10 @@ References [1] String Formatting Operations - http://www.python.org/doc/current/lib/typesseq-strings.html + http://docs.python.org/library/stdtypes.html#string-formatting-operations [2] Identifiers and Keywords - http://www.python.org/doc/current/ref/identifiers.html + http://docs.python.org/reference/lexical_analysis.html#identifiers-and-keywords [3] Guido's python-dev posting from 21-Jul-2002 http://mail.python.org/pipermail/python-dev/2002-July/026397.html Modified: peps/trunk/pep-0301.txt ============================================================================== --- peps/trunk/pep-0301.txt (original) +++ peps/trunk/pep-0301.txt Thu Oct 2 14:51:05 2008 @@ -350,7 +350,7 @@ ========== .. [1] Distutils packaging system - (http://www.python.org/doc/current/lib/module-distutils.html) + (http://docs.python.org/library/distutils.html) .. [2] Trove (http://www.catb.org/~esr/trove/) Modified: peps/trunk/pep-0316.txt ============================================================================== --- peps/trunk/pep-0316.txt (original) +++ peps/trunk/pep-0316.txt Thu Oct 2 14:51:05 2008 @@ -401,7 +401,7 @@ .. [#oosc] Object-oriented Software Construction, Bertrand Meyer, ISBN 0-13-629031-0 -.. [#doctest] http://www.python.org/doc/current/lib/module-doctest.html +.. [#doctest] http://docs.python.org/library/doctest.html doctest -- Test docstrings represent reality .. [#dbc4p] Design by Contract for Python, R. Plosch Modified: peps/trunk/pep-0317.txt ============================================================================== --- peps/trunk/pep-0317.txt (original) +++ peps/trunk/pep-0317.txt Thu Oct 2 14:51:05 2008 @@ -437,7 +437,7 @@ http://www.python.org/peps/pep-0005.html .. [3] "Python Language Reference", Guido van Rossum. - http://www.python.org/doc/current/ref/raise.html + http://docs.python.org/reference/simple_stmts.html#raise .. [4] PEP 236 "Back to the __future__", Tim Peters. http://www.python.org/peps/pep-0236.html Modified: peps/trunk/pep-0319.txt ============================================================================== --- peps/trunk/pep-0319.txt (original) +++ peps/trunk/pep-0319.txt Thu Oct 2 14:51:05 2008 @@ -474,7 +474,7 @@ References [1] The Python Language Reference - http://www.python.org/doc/current/ref/ref.html + http://docs.python.org/reference/ [2] PEP 236, Back to the __future__, Peters http://python.sourceforge.net/peps/pep-0236.html Modified: peps/trunk/pep-0323.txt ============================================================================== --- peps/trunk/pep-0323.txt (original) +++ peps/trunk/pep-0323.txt Thu Oct 2 14:51:05 2008 @@ -463,7 +463,7 @@ http://mail.python.org/pipermail/python-dev/2003-October/038969.html [2] Online documentation for the copy module of the standard library: - http://www.python.org/doc/current/lib/module-copy.html + http://docs.python.org/library/copy.html [3] PEP 289, Generator Expressions, Hettinger http://www.python.org/peps/pep-0289.html Modified: peps/trunk/pep-0331.txt ============================================================================== --- peps/trunk/pep-0331.txt (original) +++ peps/trunk/pep-0331.txt Thu Oct 2 14:51:05 2008 @@ -167,7 +167,7 @@ http://www.python.org/peps/pep-0001.html [2] Python locale documentation for embedding, - http://www.python.org/doc/current/lib/embedding-locale.html + http://docs.python.org/library/locale.html [3] PyGTK homepage, http://www.daa.com.au/~james/pygtk/ Modified: peps/trunk/pep-3107.txt ============================================================================== --- peps/trunk/pep-3107.txt (original) +++ peps/trunk/pep-3107.txt Thu Oct 2 14:51:05 2008 @@ -299,7 +299,7 @@ http://svn.python.org/view?rev=53170&view=rev .. [#grammar] - http://www.python.org/doc/current/ref/function.html + http://docs.python.org/reference/compound_stmts.html#function-definitions .. [#lambda] http://mail.python.org/pipermail/python-3000/2006-May/001613.html Modified: peps/trunk/pep-3109.txt ============================================================================== --- peps/trunk/pep-3109.txt (original) +++ peps/trunk/pep-3109.txt Thu Oct 2 14:51:05 2008 @@ -248,7 +248,7 @@ http://www.python.org/dev/peps/pep-0020/ .. [#grammar] - http://www.python.org/doc/current/ref/raise.html + http://docs.python.org/reference/simple_stmts.html#raise .. [#throw-sig] http://www.python.org/dev/peps/pep-0342/ Modified: peps/trunk/pep-3110.txt ============================================================================== --- peps/trunk/pep-3110.txt (original) +++ peps/trunk/pep-3110.txt Thu Oct 2 14:51:05 2008 @@ -254,7 +254,7 @@ http://mail.python.org/pipermail/python-dev/2006-March/062640.html .. [#grammar] - http://www.python.org/doc/current/ref/try.html + http://docs.python.org/reference/compound_stmts.html#try .. [#except-translation] http://mail.python.org/pipermail/python-3000/2007-January/005395.html Modified: peps/trunk/pep-3112.txt ============================================================================== --- peps/trunk/pep-3112.txt (original) +++ peps/trunk/pep-3112.txt Thu Oct 2 14:51:05 2008 @@ -141,13 +141,13 @@ ========== .. [#stringliterals] - http://www.python.org/doc/current/ref/strings.html + http://docs.python.org/reference/lexical_analysis.html#string-literals .. [#encodings] - http://www.python.org/doc/current/ref/encodings.html + http://docs.python.org/reference/lexical_analysis.html#encoding-declarations .. [#concat] - http://www.python.org/doc/current/ref/string-catenation.html + http://docs.python.org/reference/lexical_analysis.html#string-literal-concatenation .. [#eachnew] http://mail.python.org/pipermail/python-3000/2007-February/005779.html From python-checkins at python.org Thu Oct 2 14:51:31 2008 From: python-checkins at python.org (martin.v.loewis) Date: Thu, 2 Oct 2008 14:51:31 +0200 (CEST) Subject: [Python-checkins] r66728 - python/branches/empty/Makefile Message-ID: <20081002125131.46CB11E4002@bag.python.org> Author: martin.v.loewis Date: Thu Oct 2 14:51:31 2008 New Revision: 66728 Log: Add all target. Modified: python/branches/empty/Makefile Modified: python/branches/empty/Makefile ============================================================================== --- python/branches/empty/Makefile (original) +++ python/branches/empty/Makefile Thu Oct 2 14:51:31 2008 @@ -1,2 +1,2 @@ -buildbottest distclean: +all buildbottest distclean: From python-checkins at python.org Thu Oct 2 15:41:04 2008 From: python-checkins at python.org (georg.brandl) Date: Thu, 2 Oct 2008 15:41:04 +0200 (CEST) Subject: [Python-checkins] r66729 - sandbox/trunk/release/release.py Message-ID: <20081002134104.780B71E4006@bag.python.org> Author: georg.brandl Date: Thu Oct 2 15:41:04 2008 New Revision: 66729 Log: Update w.r.t. docs build. Modified: sandbox/trunk/release/release.py Modified: sandbox/trunk/release/release.py ============================================================================== --- sandbox/trunk/release/release.py (original) +++ sandbox/trunk/release/release.py Thu Oct 2 15:41:04 2008 @@ -242,11 +242,11 @@ old_cur = os.getcwd() with changed_dir('dist'): print 'Exporting tag:', tag.text - python = 'Python-%s' % tag.text + archivename = 'Python-%s' % tag.text run_cmd(['svn', 'export', '-q', 'http://svn.python.org/projects/python/tags/r%s' - % tag.nickname, python]) - with changed_dir(python): + % tag.nickname, archivename]) + with changed_dir(archivename): print 'Removing .hgignore and .bzrignore' for name in ('.hgignore', '.bzrignore'): try: @@ -256,16 +256,19 @@ for name in ('Include/Python-ast.h', 'Python/Python-ast.c'): os.utime(name, None) - docs = build_docs() - exported_docs = 'Python-%s-docs-html' % tag.text - shutil.copytree(docs, exported_docs) + docdist = build_docs() + shutil.copytree(docdist, 'docs') - with changed_dir(os.path.join(python, 'Doc')): + with changed_dir(os.path.join(archivename, 'Doc')): print 'Removing doc build artifacts' shutil.rmtree('build') + shutil.rmtree('dist') + shutil.rmtree('tools/docutils') + shutil.rmtree('tools/sphinx') + shutil.rmtree('tools/jinja') + shutil.rmtree('tools/pygments') - tarball(python) - tarball(exported_docs) + tarball(archivename) print '\n**Now extract the archives and run the tests**' print '**You may also want to run make install and re-test**' @@ -274,8 +277,8 @@ """Build and tarball the documentation""" print "Building docs" with changed_dir('Doc'): - run_cmd(['make', 'html']) - return os.path.abspath('build/html') + run_cmd(['make', 'dist']) + return os.path.abspath('dist') class Tag(object): From python-checkins at python.org Thu Oct 2 15:41:14 2008 From: python-checkins at python.org (georg.brandl) Date: Thu, 2 Oct 2008 15:41:14 +0200 (CEST) Subject: [Python-checkins] r66730 - peps/trunk/pep-0101.txt Message-ID: <20081002134114.69CD01E4011@bag.python.org> Author: georg.brandl Date: Thu Oct 2 15:41:14 2008 New Revision: 66730 Log: Updates for doc process. Modified: peps/trunk/pep-0101.txt Modified: peps/trunk/pep-0101.txt ============================================================================== --- peps/trunk/pep-0101.txt (original) +++ peps/trunk/pep-0101.txt Thu Oct 2 15:41:14 2008 @@ -145,7 +145,7 @@ ___ There's a copy of the license in Doc/license.rst - ___ Doc/tutorial/interpreter.rst (3 references to '[Pp]ython26', one + ___ Doc/tutorial/interpreter.rst (2 references to '[Pp]ython26', one to 'Python 2.6'). ___ Doc/tutorial/stdlib.rst and Doc/tutorial/stdlib2.rst, which have @@ -221,6 +221,8 @@ python26.chm file. He then copies the file into the Doc directories of the build trees (once for each target architecture). + XXX The CHM file should also be scp'd to the docs download location. + ___ XXX The WE then generates Windows installer files for each Windows target architecture (for Python 2.6, this means x86 and AMD64). He has one checkout tree per target architecture, @@ -293,6 +295,11 @@ % cd Python-2.6c2 % ls (Do things look reasonable?) + % ls Lib + (Are there stray .pyc files?) + % ls Doc/tools + (Make sure it doesn't contain "docutils", "sphinx", "jinja" or + "pygments" directories.) % ./configure (Loads of configure output) % make test @@ -351,6 +358,10 @@ ___ md5sum the files and make sure they got uploaded intact. + ___ If this is a final release: Move the built docs to + /data/ftp.python.org/pub/python/doc/X.Y[.Z], and adapt the + "current" symlink in that directory. + Now it's time to twiddle the web site. To do these steps, you must have the permission to edit the website. If you @@ -402,22 +413,9 @@ ___ update `doc/content.ht` to indicate the new current documentation version, and remove the current version from any 'in development' - section. - - ___ add the new version to `doc/version/content.ht` - - ___ Make the last change to the documentation area on python.org. - - The "current" symlink needs to be updated if this release is the - highest-versioned release. Log in to dinsdale.python.org, and - update a symlink in the doc/ tree: - - # on dinsdale: - $ cd /data/ftp.python.org/pub/www.python.org/doc/ - $ rm current && ln -s $VERSION current + section. Update the version in the "What's New" link. - XXX This does not seem complete. I still don't really understand - how all the documentation stuff hangs together. + ___ Add the new version to `doc/version/content.ht`. ___ Edit download/releases/content.ht to update the version numbers for this release. There are a bunch of places you need to touch: From buildbot at python.org Thu Oct 2 16:17:03 2008 From: buildbot at python.org (buildbot at python.org) Date: Thu, 02 Oct 2008 14:17:03 +0000 Subject: [Python-checkins] buildbot failure in 2.7.msi Message-ID: <20081002141703.243501E4002@bag.python.org> The Buildbot has detected a new failure of 2.7.msi. Full details are available at: http://www.python.org/dev/buildbot/all/2.7.msi/builds/0 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: bolen-windows Build Reason: The Nightly scheduler named '2.7.msi' triggered this build Build Source Stamp: HEAD Blamelist: BUILD FAILED: failed compile sincerely, -The Buildbot From stackless-checkins-bounces at stackless.com Thu Oct 2 16:53:26 2008 From: stackless-checkins-bounces at stackless.com (stackless-checkins-bounces at stackless.com) Date: Thu, 02 Oct 2008 16:53:26 +0200 Subject: [Python-checkins] Your message to Stackless-checkins awaits moderator approval Message-ID: Your mail to 'Stackless-checkins' with the subject r66731 - in stackless/trunk: Demo/classes/Dates.py Demo/classes/bitvec.py Demo/curses/life.py Demo/curses/ncurses.py Demo/md5test/md5driver.py Demo/parser/unparse.py Demo/pdist/cmptree.py Demo/rpc/nfsclient.py Demo/rpc/rpc.py Demo/rpc/xdr.py Demo/scripts/fact.py Demo/scripts/ftpstats.py Demo/scripts/lpwatch.py Demo/scripts/markov.py Demo/scripts/newslist.py Demo/scripts/pi.py Demo/scripts/unbirthday.py Demo/sockets/ftp.py Demo/threads/Coroutine.py Demo/threads/Generator.py Demo/tkinter/guido/hanoi.py Demo/tkinter/guido/solitaire.py Demo/tkinter/guido/sortvisu.py Demo/turtle/turtleDemo.py Doc/Makefile Doc/README.txt Doc/bugs.rst Doc/c-api/number.rst Doc/c-api/object.rst Doc/distutils/apiref.rst Doc/distutils/builtdist.rst Doc/distutils/commandref.rst Doc/distutils/setupscript.rst Doc/extending/embedding.rst Doc/extending/windows.rst Doc/glossary.rst Doc/howto/cporting.rst Doc/howto/index.rst Doc/howto/sockets.rst Doc/howto/unicode.rst Doc/howto/urllib2.rst Doc/howto/webservers.rst Doc/includes/mp_distributing.py Doc/includes/mp_pool.py Doc/includes/mp_synchronize.py Doc/includes/mp_webserver.py Doc/includes/mp_workers.py Doc/library/2to3.rst Doc/library/asynchat.rst Doc/library/autogil.rst Doc/library/basehttpserver.rst Doc/library/binhex.rst Doc/library/bsddb.rst Doc/library/carbon.rst Doc/library/cgi.rst Doc/library/cgihttpserver.rst Doc/library/codecs.rst Doc/library/collections.rst Doc/library/compileall.rst Doc/library/cookie.rst Doc/library/ctypes.rst Doc/library/dbhash.rst Doc/library/framework.rst Doc/library/functions.rst Doc/library/getopt.rst Doc/library/idle.rst Doc/library/imp.rst Doc/library/index.rst Doc/library/json.rst Doc/library/logging.rst Doc/library/mac.rst Doc/library/macos.rst Doc/library/macpath.rst Doc/library/math.rst Doc/library/multiprocessing.rst Doc/library/optparse.rst Doc/library/os.path.rst Doc/library/os.rst Doc/library/platform.rst Doc/library/plistlib.rst Doc/library/random.rst Doc/library/select.rst Doc/library/shutil.rst Doc/library/signal.rst Doc/library/site.rst Doc/library/smtplib.rst Doc/library/socket.rst Doc/library/sqlite3.rst Doc/library/ssl.rst Doc/library/stdtypes.rst Doc/library/string.rst Doc/library/subprocess.rst Doc/library/symtable.rst Doc/library/sys.rst Doc/library/test.rst Doc/library/threading.rst Doc/library/time.rst Doc/library/tkinter.rst Doc/library/turtle.rst Doc/library/types.rst Doc/library/unicodedata.rst Doc/library/unittest.rst Doc/library/urllib.rst Doc/library/urlparse.rst Doc/library/warnings.rst Doc/library/webbrowser.rst Doc/reference/datamodel.rst Doc/reference/expressions.rst Doc/reference/index.rst Doc/reference/lexical_analysis.rst Doc/reference/simple_stmts.rst Doc/tools/sphinxext/download.html Doc/tutorial/appetite.rst Doc/tutorial/classes.rst Doc/tutorial/controlflow.rst Doc/tutorial/errors.rst Doc/tutorial/index.rst Doc/tutorial/inputoutput.rst Doc/tutorial/interpreter.rst Doc/tutorial/introduction.rst Doc/using/cmdline.rst Doc/using/mac.rst Doc/using/windows.rst Doc/whatsnew/2.6.rst Grammar/Grammar Include/abstract.h Include/cobject.h Include/object.h Include/patchlevel.h Include/pymath.h Include/pystrcmp.h Lib/BaseHTTPServer.py Lib/Cookie.py Lib/abc.py Lib/asynchat.py Lib/bsddb/__init__.py Lib/bsddb/dbshelve.py Lib/bsddb/dbtables.py Lib/bsddb/dbutils.py Lib/bsddb/test/test_all.py Lib/bsddb/test/test_associate.py Lib/bsddb/test/test_basics.py Lib/bsddb/test/test_compare.py Lib/bsddb/test/test_compat.py Lib/bsddb/test/test_cursor_pget_bug.py Lib/bsddb/test/test_dbobj.py Lib/bsddb/test/test_dbshelve.py Lib/bsddb/test/test_dbtables.py Lib/bsddb/test/test_distributed_transactions.py Lib/bsddb/test/test_early_close.py Lib/bsddb/test/test_get_none.py Lib/bsddb/test/test_join.py Lib/bsddb/test/test_lock.py Lib/bsddb/test/test_misc.py Lib/bsddb/test/test_pickle.py Lib/bsddb/test/test_queue.py Lib/bsddb/test/test_recno.py Lib/bsddb/test/test_replication.py Lib/bsddb/test/test_sequence.py Lib/bsddb/test/test_thread.py Lib/cgi.py Lib/collections.py Lib/compiler/transformer.py Lib/ctypes/test/test_bitfields.py Lib/ctypes/test/test_pointers.py Lib/ctypes/wintypes.py Lib/dbhash.py Lib/decimal.py Lib/distutils/__init__.py Lib/distutils/cygwinccompiler.py Lib/distutils/dist.py Lib/distutils/msvc9compiler.py Lib/distutils/tests/test_build_ext.py Lib/distutils/tests/test_dist.py Lib/ftplib.py Lib/hashlib.py Lib/hmac.py Lib/httplib.py Lib/idlelib/idlever.py Lib/lib-tk/Tkinter.py Lib/lib-tk/turtle.py Lib/lib2to3 Lib/lib2to3/Grammar.txt Lib/lib2to3/fixer_base.py Lib/lib2to3/fixer_util.py Lib/lib2to3/fixes/fix_metaclass.py Lib/lib2to3/fixes/fix_paren.py Lib/lib2to3/fixes/fix_print.py Lib/lib2to3/fixes/fix_raw_input.py Lib/lib2to3/fixes/fix_sys_exc.py Lib/lib2to3/main.py Lib/lib2to3/refactor.py Lib/lib2to3/tests/data/fixers Lib/lib2to3/tests/data/py2_test_grammar.py Lib/lib2to3/tests/data/py3_test_grammar.py Lib/lib2to3/tests/support.py Lib/lib2to3/tests/test_all_fixers.py Lib/lib2to3/tests/test_fixers.py Lib/lib2to3/tests/test_refactor.py Lib/logging/__init__.py Lib/logging/config.py Lib/mimetools.py Lib/msilib/__init__.py Lib/multiprocessing/connection.py Lib/multiprocessing/dummy/__init__.py Lib/multiprocessing/forking.py Lib/multiprocessing/managers.py Lib/multiprocessing/pool.py Lib/multiprocessing/process.py Lib/multiprocessing/queues.py Lib/multiprocessing/reduction.py Lib/multiprocessing/synchronize.py Lib/multiprocessing/util.py Lib/os.py Lib/platform.py Lib/pydoc.py Lib/ssl.py Lib/symtable.py Lib/test/crashers/iter.py Lib/test/regrtest.py Lib/test/string_tests.py Lib/test/test___all__.py Lib/test/test_abc.py Lib/test/test_array.py Lib/test/test_asyncore.py Lib/test/test_atexit.py Lib/test/test_bytes.py Lib/test/test_cgi.py Lib/test/test_collections.py Lib/test/test_compiler.py Lib/test/test_cprofile.py Lib/test/test_dummy_threading.py Lib/test/test_exceptions.py Lib/test/test_file.py Lib/test/test_fileio.py Lib/test/test_float.py Lib/test/test_ftplib.py Lib/test/test_grammar.py Lib/test/test_hashlib.py Lib/test/test_hmac.py Lib/test/test_imageop.py Lib/test/test_imp.py Lib/test/test_import.py Lib/test/test_io.py Lib/test/test_lib2to3.py Lib/test/test_list.py Lib/test/test_logging.py Lib/test/test_long.py Lib/test/test_macostools.py Lib/test/test_multiprocessing.py Lib/test/test_normalization.py Lib/test/test_os.py Lib/test/test_parser.py Lib/test/test_pep352.py Lib/test/test_py3kwarn.py Lib/test/test_random.py Lib/test/test_re.py Lib/test/test_smtplib.py Lib/test/test_socketserver.py Lib/test/test_ssl.py Lib/test/test_struct.py Lib/test/test_structmembers.py Lib/test/test_sundry.py Lib/test/test_support.py Lib/test/test_symtable.py Lib/test/test_tarfile.py Lib/test/test_threading.py Lib/test/test_typechecks.py Lib/test/test_unicode.py Lib/test/test_unicodedata.py Lib/test/test_urllib.py Lib/test/test_urllibnet.py Lib/test/test_urlparse.py Lib/test/test_userstring.py Lib/test/test_warnings.py Lib/test/test_weakref.py Lib/threading.py Lib/urllib.py Lib/urlparse.py Lib/warnings.py Lib/zipfile.py Makefile.pre.in Misc/ACKS Misc/NEWS Misc/RPM/python-2.6.spec Misc/build.sh Misc/find_recursionlimit.py Misc/valgrind-python.supp Modules/Setup.dist Modules/_bsddb.c Modules/_bytesio.c Modules/_collectionsmodule.c Modules/_ctypes/_ctypes.c Modules/_ctypes/cfield.c Modules/_ctypes/stgdict.c Modules/_fileio.c Modules/_hashopenssl.c Modules/_lsprof.c Modules/_multiprocessing/connection.h Modules/_multiprocessing/multiprocessing.h Modules/_sqlite/connection.c Modules/_sqlite/cursor.c Modules/_sqlite/microprotocols.c Modules/_sqlite/microprotocols.h Modules/_sqlite/module.c Modules/_sqlite/row.c Modules/_sqlite/statement.c Modules/_sqlite/util.c Modules/_sqlite/util.h Modules/_sre.c Modules/_struct.c Modules/_testcapimodule.c Modules/bsddb.h Modules/cPickle.c Modules/config.c.in Modules/imageop.c Modules/mmapmodule.c Modules/selectmodule.c Modules/signalmodule.c Modules/unicodedata.c Modules/unicodedata_db.h Modules/unicodename_db.h Objects/abstract.c Objects/bytearrayobject.c Objects/classobject.c Objects/cobject.c Objects/fileobject.c Objects/floatobject.c Objects/obmalloc.c Objects/stringlib/count.h Objects/stringlib/find.h Objects/stringlib/formatter.h Objects/stringobject.c Objects/structseq.c Objects/typeobject.c Objects/unicodectype.c Objects/unicodeobject.c Objects/unicodetype_db.h Objects/weakrefobject.c PC/VS7.1/pythoncore.vcproj PC/VS7.1/readme.txt PC/VS8.0/_bsddb.vcproj PC/VS8.0/_ctypes.vcproj PC/VS8.0/_multiprocessing.vcproj PC/VS8.0/_sqlite3.vcproj PC/VS8.0/pcbuild.sln PC/VS8.0/pyproject.vsprops PC/VS8.0/sqlite3.vcproj PC/os2emx/Makefile PC/os2emx/config.c PC/os2emx/pyconfig.h PCbuild/readme.txt PCbuild/vs9to8.py Parser/asdl_c.py Python/Python-ast.c Python/_warnings.c Python/ast.c Python/errors.c Python/getargs.c Python/graminit.c Python/import.c Python/pymath.c Python/pythonrun.c README Tools/msi/crtlicense.txt Tools/msi/merge.py Tools/msi/msi.py Tools/msi/uuids.py Tools/scripts/2to3 Tools/unicode/makeunicodedata.py configure.in pyconfig.h.in setup.py Is being held until the list moderator can review it for approval. The reason it is being held: Message body is too big: 3842513 bytes with a limit of 500 KB Either the message will get posted to the list, or you will receive notification of the moderator's decision. If you would like to cancel this posting, please visit the following URL: http://www.stackless.com/mailman/confirm/stackless-checkins/f5edbd3681412cb1fa4c63a7d22f65da865ca0e3 From nnorwitz at gmail.com Thu Oct 2 17:30:14 2008 From: nnorwitz at gmail.com (Neal Norwitz) Date: Thu, 2 Oct 2008 11:30:14 -0400 Subject: [Python-checkins] Python Regression Test Failures all (1) Message-ID: <20081002153013.GA31153@python.psfb.org> 331 tests OK. 1 test failed: test_distutils 25 tests skipped: test_aepack test_al test_applesingle test_bsddb185 test_cd test_cl test_epoll test_gl test_imgfile test_ioctl test_kqueue test_lib2to3 test_macos test_macostools test_multiprocessing test_pep277 test_py3kwarn test_scriptpackages test_startfile test_sunaudiodev test_tcl test_unicode_file test_winreg test_winsound test_zipfile64 4 skips unexpected on linux2: test_epoll test_multiprocessing test_lib2to3 test_ioctl test_grammar test_opcodes test_dict test_builtin test_exceptions test_types test_unittest test_doctest test_doctest2 test_MimeWriter test_SimpleHTTPServer test_StringIO test___all__ test___future__ test__locale test_abc test_abstract_numbers test_aepack test_aepack skipped -- No module named aepack test_al test_al skipped -- No module named al test_anydbm test_applesingle test_applesingle skipped -- No module named macostools test_array test_ast test_asynchat test_asyncore test_atexit test_audioop test_augassign test_base64 test_bastion test_bigaddrspace test_bigmem test_binascii test_binhex test_binop test_bisect test_bool test_bsddb test_bsddb185 test_bsddb185 skipped -- No module named bsddb185 test_bsddb3 Sleepycat Software: Berkeley DB 4.1.25: (December 19, 2002) Test path prefix: /tmp/z-test_bsddb3-28348 test_buffer test_bufio test_bytes test_bz2 test_calendar test_call test_capi test_cd test_cd skipped -- No module named cd test_cfgparser test_cgi test_charmapcodec test_cl test_cl skipped -- No module named cl test_class test_cmath test_cmd test_cmd_line test_cmd_line_script test_code test_codeccallbacks test_codecencodings_cn test_codecencodings_hk test_codecencodings_jp test_codecencodings_kr test_codecencodings_tw test_codecmaps_cn test_codecmaps_hk test_codecmaps_jp test_codecmaps_kr test_codecmaps_tw test_codecs test_codeop test_coding test_coercion test_collections test_colorsys test_commands test_compare test_compile test_compiler testCompileLibrary still working, be patient... testCompileLibrary still working, be patient... testCompileLibrary still working, be patient... testCompileLibrary still working, be patient... testCompileLibrary still working, be patient... testCompileLibrary still working, be patient... testCompileLibrary still working, be patient... testCompileLibrary still working, be patient... test_complex test_complex_args test_contains test_contextlib test_cookie test_cookielib test_copy test_copy_reg test_cpickle test_cprofile test_crypt test_csv test_ctypes test_datetime test_dbm test_decimal test_decorators test_defaultdict test_deque test_descr test_descrtut test_difflib test_dircache test_dis test_distutils test test_distutils failed -- errors occurred; run in verbose mode for details test_dl test_docxmlrpc test_dumbdbm test_dummy_thread test_dummy_threading test_email test_email_codecs test_email_renamed test_enumerate test_eof test_epoll test_epoll skipped -- kernel doesn't support epoll() test_errno test_exception_variations test_extcall test_fcntl test_file test_filecmp test_fileinput test_fileio test_float test_fnmatch test_fork1 test_format test_fpformat test_fractions test_frozen test_ftplib test_funcattrs test_functools test_future test_future3 test_future4 test_future_builtins test_gc test_gdbm test_generators test_genericpath test_genexps test_getargs test_getargs2 test_getopt test_gettext test_gl test_gl skipped -- No module named gl test_glob test_global test_grp test_gzip test_hash test_hashlib test_heapq test_hmac test_hotshot test_htmllib test_htmlparser test_httplib test_httpservers [12826 refs] [12826 refs] [21355 refs] test_imageop test_imaplib test_imgfile test_imgfile skipped -- No module named imgfile test_imp test_import test_importhooks test_index test_inspect test_int test_int_literal test_io test_ioctl test_ioctl skipped -- Unable to open /dev/tty test_isinstance test_iter test_iterlen test_itertools test_json test_kqueue test_kqueue skipped -- test works only on BSD test_largefile test_lib2to3 test_lib2to3 skipped -- No module named myfixes test_list test_locale test_logging test_long test_long_future test_longexp test_macos test_macos skipped -- No module named MacOS test_macostools test_macostools skipped -- No module named macostools test_macpath test_mailbox test_marshal test_math test_md5 test_memoryio test_mhlib test_mimetools test_mimetypes test_minidom test_mmap test_module test_modulefinder test_multibytecodec test_multibytecodec_support test_multifile test_multiprocessing test_multiprocessing skipped -- OSError raises on RLock creation, see issue 3111! test_mutants test_mutex test_netrc test_new test_nis test_normalization test_ntpath test_old_mailbox test_openpty test_operator test_optparse test_os /tmp/python-test/local/lib/python2.6/os.py:759: DeprecationWarning: integer argument expected, got float bs += read(_urandomfd, n - len(bs)) test_parser Expecting 's_push: parser stack overflow' in next line s_push: parser stack overflow test_peepholer test_pep247 test_pep263 test_pep277 test_pep277 skipped -- test works only on NT+ test_pep292 test_pep352 test_pickle test_pickletools test_pipes test_pkg test_pkgimport test_pkgutil test_platform test_plistlib test_poll test_popen [12831 refs] [12831 refs] [12831 refs] test_popen2 test_poplib test_posix test_posixpath test_pow test_pprint test_print test_profile test_profilehooks test_property test_pstats test_pty test_pwd test_py3kwarn test_py3kwarn skipped -- test.test_py3kwarn must be run with the -3 flag test_pyclbr test_pydoc [17360 refs] test_pyexpat test_queue test_quopri [15345 refs] [15345 refs] test_random test_re test_repr test_resource test_rfc822 test_richcmp test_robotparser test_runpy test_sax test_scope test_scriptpackages test_scriptpackages skipped -- No module named aetools test_select test_set test_sets test_sgmllib test_sha test_shelve test_shlex test_shutil test_signal test_site [12826 refs] [12826 refs] [12829 refs] [12826 refs] test_slice test_smtplib test_socket test_socketserver test_softspace test_sort test_sqlite test_ssl test_startfile test_startfile skipped -- cannot import name startfile test_str test_strftime test_string test_stringprep test_strop test_strptime test_struct test_structmembers test_structseq test_subprocess [12826 refs] [12826 refs] [12826 refs] [12826 refs] [12826 refs] [12826 refs] [12826 refs] [12826 refs] [12826 refs] [12826 refs] [12826 refs] [12826 refs] [14726 refs] [13041 refs] [12826 refs] [12826 refs] [12826 refs] [12826 refs] [12826 refs] [12826 refs] . [12826 refs] [12826 refs] this bit of output is from a test of stdout in a different process ... [12826 refs] [12826 refs] [13041 refs] test_sunaudiodev test_sunaudiodev skipped -- No module named sunaudiodev test_sundry /tmp/python-test/local/lib/python2.6/test/test_sundry.py:67: DeprecationWarning: The posixfile module is deprecated; fcntl.lockf() provides better locking import posixfile test_symtable test_syntax test_sys [12826 refs] [12826 refs] [13055 refs] [12849 refs] test_tarfile test_tcl test_tcl skipped -- No module named _tkinter test_telnetlib test_tempfile [12829 refs] test_textwrap test_thread test_threaded_import test_threadedtempfile test_threading [16318 refs] [15967 refs] [15783 refs] [15783 refs] [15783 refs] [15783 refs] test_threading_local test_threadsignals test_time test_timeout test_tokenize test_trace test_traceback test_transformer test_tuple test_typechecks test_ucn test_unary test_undocumented_details test_unicode test_unicode_file test_unicode_file skipped -- No Unicode filesystem semantics on this platform. test_unicodedata test_univnewlines test_unpack test_urllib test_urllib2 test_urllib2_localnet test_urllib2net test_urllibnet test_urlparse test_userdict test_userlist test_userstring test_uu test_uuid WARNING: uuid.getnode is unreliable on many platforms. It is disabled until the code and/or test can be fixed properly. WARNING: uuid._ifconfig_getnode is unreliable on many platforms. It is disabled until the code and/or test can be fixed properly. WARNING: uuid._unixdll_getnode is unreliable on many platforms. It is disabled until the code and/or test can be fixed properly. test_wait3 test_wait4 test_warnings test_wave test_weakref test_whichdb test_winreg test_winreg skipped -- No module named _winreg test_winsound test_winsound skipped -- No module named winsound test_with test_wsgiref test_xdrlib test_xml_etree test_xml_etree_c test_xmllib test_xmlrpc test_xpickle test_xrange test_zipfile test_zipfile64 test_zipfile64 skipped -- test requires loads of disk-space bytes and a long time to run test_zipimport test_zlib 331 tests OK. 1 test failed: test_distutils 25 tests skipped: test_aepack test_al test_applesingle test_bsddb185 test_cd test_cl test_epoll test_gl test_imgfile test_ioctl test_kqueue test_lib2to3 test_macos test_macostools test_multiprocessing test_pep277 test_py3kwarn test_scriptpackages test_startfile test_sunaudiodev test_tcl test_unicode_file test_winreg test_winsound test_zipfile64 4 skips unexpected on linux2: test_epoll test_multiprocessing test_lib2to3 test_ioctl [662730 refs] From python-checkins at python.org Thu Oct 2 18:19:44 2008 From: python-checkins at python.org (georg.brandl) Date: Thu, 2 Oct 2008 18:19:44 +0200 (CEST) Subject: [Python-checkins] r66735 - doctools/trunk/EXAMPLES Message-ID: <20081002161944.5ADB31E4002@bag.python.org> Author: georg.brandl Date: Thu Oct 2 18:19:44 2008 New Revision: 66735 Log: Add zc.async. Modified: doctools/trunk/EXAMPLES Modified: doctools/trunk/EXAMPLES ============================================================================== --- doctools/trunk/EXAMPLES (original) +++ doctools/trunk/EXAMPLES Thu Oct 2 18:19:44 2008 @@ -13,6 +13,7 @@ * Django: http://docs.djangoproject.com/ * Jinja: http://jinja.pocoo.org/2/documentation/ * F2py: http://www.f2py.org/html/ +* zc.async: http://packages.python.org/zc.async/1.5.0/ * Paver: http://www.blueskyonmars.com/projects/paver/ * Satchmo: http://www.satchmoproject.com/docs/svn/ * PyEphem: http://rhodesmill.org/pyephem/ From python-checkins at python.org Thu Oct 2 18:25:57 2008 From: python-checkins at python.org (georg.brandl) Date: Thu, 2 Oct 2008 18:25:57 +0200 (CEST) Subject: [Python-checkins] r66736 - in python/branches/release26-maint/Doc: Makefile tools/sphinxext/download.html tools/sphinxext/layout.html Message-ID: <20081002162557.82F5C1E4002@bag.python.org> Author: georg.brandl Date: Thu Oct 2 18:25:57 2008 New Revision: 66736 Log: Some Doc tweaks. Modified: python/branches/release26-maint/Doc/Makefile python/branches/release26-maint/Doc/tools/sphinxext/download.html python/branches/release26-maint/Doc/tools/sphinxext/layout.html Modified: python/branches/release26-maint/Doc/Makefile ============================================================================== --- python/branches/release26-maint/Doc/Makefile (original) +++ python/branches/release26-maint/Doc/Makefile Thu Oct 2 18:25:57 2008 @@ -111,7 +111,7 @@ # archive the HTML make html - cp -a build/html dist/python$(DISTVERSION)-docs-html + cp -pPR build/html dist/python$(DISTVERSION)-docs-html tar -C dist -cf dist/python$(DISTVERSION)-docs-html.tar python$(DISTVERSION)-docs-html bzip2 -9 -k dist/python$(DISTVERSION)-docs-html.tar (cd dist; zip -q -r -9 python$(DISTVERSION)-docs-html.zip python$(DISTVERSION)-docs-html) @@ -120,7 +120,7 @@ # archive the text build make text - cp -a build/text dist/python$(DISTVERSION)-docs-text + cp -pPR build/text dist/python$(DISTVERSION)-docs-text tar -C dist -cf dist/python$(DISTVERSION)-docs-text.tar python$(DISTVERSION)-docs-text bzip2 -9 -k dist/python$(DISTVERSION)-docs-text.tar (cd dist; zip -q -r -9 python$(DISTVERSION)-docs-text.zip python$(DISTVERSION)-docs-text) Modified: python/branches/release26-maint/Doc/tools/sphinxext/download.html ============================================================================== --- python/branches/release26-maint/Doc/tools/sphinxext/download.html (original) +++ python/branches/release26-maint/Doc/tools/sphinxext/download.html Thu Oct 2 18:25:57 2008 @@ -31,8 +31,8 @@ Download (ca. 4 MB) Plain Text - Download (ca. 2 MB) - Download (ca. 1.5 MB) + Download (ca. 2 MB) + Download (ca. 1.5 MB) Modified: python/branches/release26-maint/Doc/tools/sphinxext/layout.html ============================================================================== --- python/branches/release26-maint/Doc/tools/sphinxext/layout.html (original) +++ python/branches/release26-maint/Doc/tools/sphinxext/layout.html Thu Oct 2 18:25:57 2008 @@ -1,5 +1,4 @@ {% extends "!layout.html" %} {% block rootrellink %} -
  • -{{ super() }} +
  • {{ shorttitle }}{{ reldelim1 }}
  • {% endblock %} From buildbot at python.org Thu Oct 2 19:39:33 2008 From: buildbot at python.org (buildbot at python.org) Date: Thu, 02 Oct 2008 17:39:33 +0000 Subject: [Python-checkins] buildbot failure in x86 OpenBSD 3.0 Message-ID: <20081002173933.61F671E4002@bag.python.org> The Buildbot has detected a new failure of x86 OpenBSD 3.0. Full details are available at: http://www.python.org/dev/buildbot/all/x86%20OpenBSD%203.0/builds/316 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: cortesi Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: guido.van.rossum BUILD FAILED: failed compile sincerely, -The Buildbot From buildbot at python.org Thu Oct 2 20:05:06 2008 From: buildbot at python.org (buildbot at python.org) Date: Thu, 02 Oct 2008 18:05:06 +0000 Subject: [Python-checkins] buildbot failure in x86 gentoo 3.0 Message-ID: <20081002180506.355EB1E4006@bag.python.org> The Buildbot has detected a new failure of x86 gentoo 3.0. Full details are available at: http://www.python.org/dev/buildbot/all/x86%20gentoo%203.0/builds/1646 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: norwitz-x86 Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: guido.van.rossum BUILD FAILED: failed test Excerpt from the test logfile: make: *** [buildbottest] Unknown signal 32 sincerely, -The Buildbot From python-checkins at python.org Thu Oct 2 20:13:47 2008 From: python-checkins at python.org (barry.warsaw) Date: Thu, 2 Oct 2008 20:13:47 +0200 (CEST) Subject: [Python-checkins] r66738 - peps/trunk/pep-0101.txt Message-ID: <20081002181347.287B51E4017@bag.python.org> Author: barry.warsaw Date: Thu Oct 2 20:13:46 2008 New Revision: 66738 Log: Nix RPM steps; update timezones. Modified: peps/trunk/pep-0101.txt Modified: peps/trunk/pep-0101.txt ============================================================================== --- peps/trunk/pep-0101.txt (original) +++ peps/trunk/pep-0101.txt Thu Oct 2 20:13:46 2008 @@ -36,10 +36,9 @@ current experts are: * RM = Release Manager: Barry Warsaw (US/Eastern) - * WE = Windows: Martin von Loewis - * ME = Mac: Ronald Oussoren + * WE = Windows: Martin von Loewis (Central Europe) + * ME = Mac: Ronald Oussoren (Central Europe) * IE = Idle Expert: ?? - * RE = RPM Expert: Sean Reifschneider NOTE: It is highly recommended that the RM contact the Experts the day before the release. Because the world is round and everyone lives @@ -247,12 +246,6 @@ The WE checksums the files (*.msi and *.chm), uploads them to some place in the net, and emails you the location and md5sums. - ___ XXX Sean Reifschneider grabs the HTML and uses this to build the - Linux RPMs. Sean performs his Red Hat magic, generating a set - of RPMs. He uploads these files to python.org. He then sends - the RM a notice which includes the location and MD5 checksum of - the RPMs. - ___ Time to build the source tarball. If you created a branch, be sure to cd to your working directory for the branch. E.g. From python-checkins at python.org Thu Oct 2 20:33:42 2008 From: python-checkins at python.org (christian.heimes) Date: Thu, 2 Oct 2008 20:33:42 +0200 (CEST) Subject: [Python-checkins] r66739 - python/trunk/Objects/frameobject.c Message-ID: <20081002183342.278121E4002@bag.python.org> Author: christian.heimes Date: Thu Oct 2 20:33:41 2008 New Revision: 66739 Log: Fixed a comment to C89 style as of http://drj11.wordpress.com/2008/10/02/python-and-bragging-about-c89/ Modified: python/trunk/Objects/frameobject.c Modified: python/trunk/Objects/frameobject.c ============================================================================== --- python/trunk/Objects/frameobject.c (original) +++ python/trunk/Objects/frameobject.c Thu Oct 2 20:33:41 2008 @@ -517,7 +517,7 @@ nfrees = PyTuple_GET_SIZE(f->f_code->co_freevars); extras = f->f_code->co_stacksize + f->f_code->co_nlocals + ncells + nfrees; - // subtract one as it is already included in PyFrameObject + /* subtract one as it is already included in PyFrameObject */ res = sizeof(PyFrameObject) + (extras-1) * sizeof(PyObject *); return PyInt_FromSsize_t(res); From python-checkins at python.org Thu Oct 2 20:36:41 2008 From: python-checkins at python.org (christian.heimes) Date: Thu, 2 Oct 2008 20:36:41 +0200 (CEST) Subject: [Python-checkins] r66740 - python/branches/release26-maint Message-ID: <20081002183641.054D01E4002@bag.python.org> Author: christian.heimes Date: Thu Oct 2 20:36:40 2008 New Revision: 66740 Log: Initialized merge tracking via "svnmerge" with revisions "1-66716" from svn+ssh://pythondev at svn.python.org/python/trunk Modified: python/branches/release26-maint/ (props changed) From python-checkins at python.org Thu Oct 2 20:39:50 2008 From: python-checkins at python.org (christian.heimes) Date: Thu, 2 Oct 2008 20:39:50 +0200 (CEST) Subject: [Python-checkins] r66742 - in python/branches/release26-maint: Misc/NEWS Objects/frameobject.c Message-ID: <20081002183950.B40A91E4002@bag.python.org> Author: christian.heimes Date: Thu Oct 2 20:39:50 2008 New Revision: 66742 Log: Merged revisions 66739 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r66739 | christian.heimes | 2008-10-02 20:33:41 +0200 (Thu, 02 Oct 2008) | 1 line Fixed a comment to C89 style as of http://drj11.wordpress.com/2008/10/02/python-and-bragging-about-c89/ ........ Modified: python/branches/release26-maint/ (props changed) python/branches/release26-maint/Misc/NEWS python/branches/release26-maint/Objects/frameobject.c Modified: python/branches/release26-maint/Misc/NEWS ============================================================================== --- python/branches/release26-maint/Misc/NEWS (original) +++ python/branches/release26-maint/Misc/NEWS Thu Oct 2 20:39:50 2008 @@ -12,6 +12,9 @@ Core and Builtins ----------------- +- Fixed a broken comment in Objects/frameobject.c. Python is now C89 compatible + again. + Library ------- Modified: python/branches/release26-maint/Objects/frameobject.c ============================================================================== --- python/branches/release26-maint/Objects/frameobject.c (original) +++ python/branches/release26-maint/Objects/frameobject.c Thu Oct 2 20:39:50 2008 @@ -517,7 +517,7 @@ nfrees = PyTuple_GET_SIZE(f->f_code->co_freevars); extras = f->f_code->co_stacksize + f->f_code->co_nlocals + ncells + nfrees; - // subtract one as it is already included in PyFrameObject + /* subtract one as it is already included in PyFrameObject */ res = sizeof(PyFrameObject) + (extras-1) * sizeof(PyObject *); return PyInt_FromSsize_t(res); From buildbot at python.org Thu Oct 2 20:43:06 2008 From: buildbot at python.org (buildbot at python.org) Date: Thu, 02 Oct 2008 18:43:06 +0000 Subject: [Python-checkins] buildbot failure in sparc Ubuntu trunk Message-ID: <20081002184306.38C561E4002@bag.python.org> The Buildbot has detected a new failure of sparc Ubuntu trunk. Full details are available at: http://www.python.org/dev/buildbot/all/sparc%20Ubuntu%20trunk/builds/918 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-ubuntu-sparc Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: christian.heimes BUILD FAILED: failed test Excerpt from the test logfile: make: *** [buildbottest] Bus error sincerely, -The Buildbot From buildbot at python.org Thu Oct 2 20:43:56 2008 From: buildbot at python.org (buildbot at python.org) Date: Thu, 02 Oct 2008 18:43:56 +0000 Subject: [Python-checkins] buildbot failure in amd64 gentoo trunk Message-ID: <20081002184356.8D61E1E4002@bag.python.org> The Buildbot has detected a new failure of amd64 gentoo trunk. Full details are available at: http://www.python.org/dev/buildbot/all/amd64%20gentoo%20trunk/builds/1501 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: norwitz-amd64 Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: christian.heimes BUILD FAILED: failed failed slave lost sincerely, -The Buildbot From python-checkins at python.org Thu Oct 2 21:00:32 2008 From: python-checkins at python.org (benjamin.peterson) Date: Thu, 2 Oct 2008 21:00:32 +0200 (CEST) Subject: [Python-checkins] r66744 - python/trunk/Mac/BuildScript/scripts/postflight.patch-profile Message-ID: <20081002190032.108AC1E4002@bag.python.org> Author: benjamin.peterson Date: Thu Oct 2 21:00:31 2008 New Revision: 66744 Log: we're in 2.7 now Modified: python/trunk/Mac/BuildScript/scripts/postflight.patch-profile Modified: python/trunk/Mac/BuildScript/scripts/postflight.patch-profile ============================================================================== --- python/trunk/Mac/BuildScript/scripts/postflight.patch-profile (original) +++ python/trunk/Mac/BuildScript/scripts/postflight.patch-profile Thu Oct 2 21:00:31 2008 @@ -5,7 +5,7 @@ echo "These changes will be effective only in shell windows that you open" echo "after running this script." -PYVER=2.5 +PYVER=2.7 PYTHON_ROOT="/Library/Frameworks/Python.framework/Versions/Current" if [ `id -ur` = 0 ]; then From python-checkins at python.org Thu Oct 2 21:09:48 2008 From: python-checkins at python.org (georg.brandl) Date: Thu, 2 Oct 2008 21:09:48 +0200 (CEST) Subject: [Python-checkins] r66745 - in python/trunk/Doc: Makefile tools/sphinxext/download.html tools/sphinxext/layout.html Message-ID: <20081002190948.157171E4002@bag.python.org> Author: georg.brandl Date: Thu Oct 2 21:09:47 2008 New Revision: 66745 Log: Forward-port r66736. Modified: python/trunk/Doc/Makefile python/trunk/Doc/tools/sphinxext/download.html python/trunk/Doc/tools/sphinxext/layout.html Modified: python/trunk/Doc/Makefile ============================================================================== --- python/trunk/Doc/Makefile (original) +++ python/trunk/Doc/Makefile Thu Oct 2 21:09:47 2008 @@ -111,7 +111,7 @@ # archive the HTML make html - cp -a build/html dist/python$(DISTVERSION)-docs-html + cp -pPR build/html dist/python$(DISTVERSION)-docs-html tar -C dist -cf dist/python$(DISTVERSION)-docs-html.tar python$(DISTVERSION)-docs-html bzip2 -9 -k dist/python$(DISTVERSION)-docs-html.tar (cd dist; zip -q -r -9 python$(DISTVERSION)-docs-html.zip python$(DISTVERSION)-docs-html) @@ -120,7 +120,7 @@ # archive the text build make text - cp -a build/text dist/python$(DISTVERSION)-docs-text + cp -pPR build/text dist/python$(DISTVERSION)-docs-text tar -C dist -cf dist/python$(DISTVERSION)-docs-text.tar python$(DISTVERSION)-docs-text bzip2 -9 -k dist/python$(DISTVERSION)-docs-text.tar (cd dist; zip -q -r -9 python$(DISTVERSION)-docs-text.zip python$(DISTVERSION)-docs-text) Modified: python/trunk/Doc/tools/sphinxext/download.html ============================================================================== --- python/trunk/Doc/tools/sphinxext/download.html (original) +++ python/trunk/Doc/tools/sphinxext/download.html Thu Oct 2 21:09:47 2008 @@ -31,8 +31,8 @@ Download (ca. 4 MB) Plain Text - Download (ca. 2 MB) - Download (ca. 1.5 MB) + Download (ca. 2 MB) + Download (ca. 1.5 MB) Modified: python/trunk/Doc/tools/sphinxext/layout.html ============================================================================== --- python/trunk/Doc/tools/sphinxext/layout.html (original) +++ python/trunk/Doc/tools/sphinxext/layout.html Thu Oct 2 21:09:47 2008 @@ -1,5 +1,4 @@ {% extends "!layout.html" %} {% block rootrellink %} -
  • -{{ super() }} +
  • {{ shorttitle }}{{ reldelim1 }}
  • {% endblock %} From buildbot at python.org Thu Oct 2 21:16:48 2008 From: buildbot at python.org (buildbot at python.org) Date: Thu, 02 Oct 2008 19:16:48 +0000 Subject: [Python-checkins] buildbot failure in x86 W2k8 3.0 Message-ID: <20081002191648.8827C1E405D@bag.python.org> The Buildbot has detected a new failure of x86 W2k8 3.0. Full details are available at: http://www.python.org/dev/buildbot/all/x86%20W2k8%203.0/builds/304 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: nelson-windows Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: guido.van.rossum BUILD FAILED: failed test Excerpt from the test logfile: Traceback (most recent call last): File "S:\buildbots\python\3.0.nelson-windows\build\lib\test\test_unicode_file.py", line 157, in test_directories self._do_directory(TESTFN_UNICODE+ext, TESTFN_UNICODE+ext, False) File "S:\buildbots\python\3.0.nelson-windows\build\lib\test\test_unicode_file.py", line 114, in _do_directory os.rmdir(make_name) WindowsError: [Error 2] The system cannot find the file specified: '@test-??.dir' Traceback (most recent call last): File "", line 1, in File "S:\buildbots\python\3.0.nelson-windows\build\lib\multiprocessing\forking.py", line 342, in main prepare(preparation_data) File "S:\buildbots\python\3.0.nelson-windows\build\lib\multiprocessing\forking.py", line 451, in prepare file, path_name, etc = imp.find_module(main_name, dirs) ImportError: No module named regrtest Traceback (most recent call last): File "", line 1, in File "S:\buildbots\python\3.0.nelson-windows\build\lib\multiprocessing\forking.py", line 342, in main prepare(preparation_data) File "S:\buildbots\python\3.0.nelson-windows\build\lib\multiprocessing\forking.py", line 451, in prepare file, path_name, etc = imp.find_module(main_name, dirs) ImportError: No module named regrtest Traceback (most recent call last): File "", line 1, in File "S:\buildbots\python\3.0.nelson-windows\build\lib\multiprocessing\forking.py", line 342, in main prepare(preparation_data) File "S:\buildbots\python\3.0.nelson-windows\build\lib\multiprocessing\forking.py", line 451, in prepare file, path_name, etc = imp.find_module(main_name, dirs) ImportError: No module named regrtest Traceback (most recent call last): File "", line 1, in File "S:\buildbots\python\3.0.nelson-windows\build\lib\multiprocessing\forking.py", line 342, in main prepare(preparation_data) File "S:\buildbots\python\3.0.nelson-windows\build\lib\multiprocessing\forking.py", line 451, in prepare file, path_name, etc = imp.find_module(main_name, dirs) ImportError: No module named regrtest Traceback (most recent call last): File "", line 1, in File "S:\buildbots\python\3.0.nelson-windows\build\lib\multiprocessing\forking.py", line 342, in main prepare(preparation_data) File "S:\buildbots\python\3.0.nelson-windows\build\lib\multiprocessing\forking.py", line 451, in prepare file, path_name, etc = imp.find_module(main_name, dirs) ImportError: No module named regrtest 5 tests failed: test_fnmatch test_multiprocessing test_posixpath test_unicode_file test_zipimport ====================================================================== ERROR: test_bytes (test.test_fnmatch.FnmatchTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "S:\buildbots\python\3.0.nelson-windows\build\lib\test\test_fnmatch.py", line 47, in test_bytes self.check_match(b'test', b'te*') File "S:\buildbots\python\3.0.nelson-windows\build\lib\test\test_fnmatch.py", line 12, in check_match self.assert_(fnmatch(filename, pattern), File "S:\buildbots\python\3.0.nelson-windows\build\lib\fnmatch.py", line 36, in fnmatch name = os.path.normcase(name) File "S:\buildbots\python\3.0.nelson-windows\build\lib\ntpath.py", line 44, in normcase return s.replace("/", "\\").lower() TypeError: expected an object with the buffer interface Traceback (most recent call last): File "", line 1, in File "S:\buildbots\python\3.0.nelson-windows\build\lib\multiprocessing\forking.py", line 342, in main prepare(preparation_data) File "S:\buildbots\python\3.0.nelson-windows\build\lib\multiprocessing\forking.py", line 451, in prepare file, path_name, etc = imp.find_module(main_name, dirs) ImportError: No module named regrtest Traceback (most recent call last): File "", line 1, in File "S:\buildbots\python\3.0.nelson-windows\build\lib\multiprocessing\forking.py", line 342, in main prepare(preparation_data) File "S:\buildbots\python\3.0.nelson-windows\build\lib\multiprocessing\forking.py", line 451, in prepare file, path_name, etc = imp.find_module(main_name, dirs) ImportError: No module named regrtest Traceback (most recent call last): File "", line 1, in File "S:\buildbots\python\3.0.nelson-windows\build\lib\multiprocessing\forking.py", line 342, in main prepare(preparation_data) File "S:\buildbots\python\3.0.nelson-windows\build\lib\multiprocessing\forking.py", line 451, in prepare file, path_name, etc = imp.find_module(main_name, dirs) ImportError: No module named regrtest Traceback (most recent call last): File "", line 1, in File "S:\buildbots\python\3.0.nelson-windows\build\lib\multiprocessing\forking.py", line 342, in main prepare(preparation_data) File "S:\buildbots\python\3.0.nelson-windows\build\lib\multiprocessing\forking.py", line 451, in prepare file, path_name, etc = imp.find_module(main_name, dirs) ImportError: No module named regrtest Traceback (most recent call last): File "", line 1, in File "S:\buildbots\python\3.0.nelson-windows\build\lib\multiprocessing\forking.py", line 342, in main prepare(preparation_data) File "S:\buildbots\python\3.0.nelson-windows\build\lib\multiprocessing\forking.py", line 451, in prepare file, path_name, etc = imp.find_module(main_name, dirs) ImportError: No module named regrtest Traceback (most recent call last): File "../lib/test/regrtest.py", line 603, in runtest_inner File "S:\buildbots\python\3.0.nelson-windows\build\lib\test\test_multiprocessing.py", line 1793, in test_main ManagerMixin.manager.start() File "S:\buildbots\python\3.0.nelson-windows\build\lib\multiprocessing\managers.py", line 506, in start self._address = reader.recv() EOFError ====================================================================== ERROR: test_relpath_bytes (test.test_posixpath.PosixPathTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "S:\buildbots\python\3.0.nelson-windows\build\lib\test\test_posixpath.py", line 612, in test_relpath_bytes curdir = os.path.split(os.getcwdb())[-1] File "S:\buildbots\python\3.0.nelson-windows\build\lib\ntpath.py", line 171, in split while i and p[i-1] not in '/\\': TypeError: 'in ' requires string as left operand, not int ====================================================================== ERROR: test_directories (test.test_unicode_file.TestUnicodeFiles) ---------------------------------------------------------------------- Traceback (most recent call last): File "S:\buildbots\python\3.0.nelson-windows\build\lib\test\test_unicode_file.py", line 112, in _do_directory os.chdir(cwd) TypeError: chdir() argument 1 must be string, not bytes Traceback (most recent call last): File "S:\buildbots\python\3.0.nelson-windows\build\lib\test\test_unicode_file.py", line 157, in test_directories self._do_directory(TESTFN_UNICODE+ext, TESTFN_UNICODE+ext, False) File "S:\buildbots\python\3.0.nelson-windows\build\lib\test\test_unicode_file.py", line 114, in _do_directory os.rmdir(make_name) WindowsError: [Error 2] The system cannot find the file specified: '@test-??.dir' Traceback (most recent call last): File "S:\buildbots\python\3.0.nelson-windows\build\lib\test\test_unicode_file.py", line 157, in test_directories self._do_directory(TESTFN_UNICODE+ext, TESTFN_UNICODE+ext, False) File "S:\buildbots\python\3.0.nelson-windows\build\lib\test\test_unicode_file.py", line 114, in _do_directory os.rmdir(make_name) WindowsError: [Error 2] The system cannot find the file specified: '@test-??.dir' ====================================================================== ERROR: testBadMTime (test.test_zipimport.UncompressedZipImportTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "S:\buildbots\python\3.0.nelson-windows\build\lib\test\test_zipimport.py", line 180, in testBadMTime self.doTest(".py", files, TESTMOD) File "S:\buildbots\python\3.0.nelson-windows\build\lib\test\test_zipimport.py", line 91, in doTest ["__dummy__"]) ImportError: No module named ziptestmodule ====================================================================== ERROR: testBadMagic (test.test_zipimport.UncompressedZipImportTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "S:\buildbots\python\3.0.nelson-windows\build\lib\test\test_zipimport.py", line 160, in testBadMagic self.doTest(".py", files, TESTMOD) File "S:\buildbots\python\3.0.nelson-windows\build\lib\test\test_zipimport.py", line 91, in doTest ["__dummy__"]) ImportError: No module named ziptestmodule ====================================================================== ERROR: testBoth (test.test_zipimport.UncompressedZipImportTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "S:\buildbots\python\3.0.nelson-windows\build\lib\test\test_zipimport.py", line 148, in testBoth self.doTest(pyc_ext, files, TESTMOD) File "S:\buildbots\python\3.0.nelson-windows\build\lib\test\test_zipimport.py", line 91, in doTest ["__dummy__"]) ImportError: No module named ziptestmodule ====================================================================== ERROR: testDeepPackage (test.test_zipimport.UncompressedZipImportTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "S:\buildbots\python\3.0.nelson-windows\build\lib\test\test_zipimport.py", line 194, in testDeepPackage self.doTest(pyc_ext, files, TESTPACK, TESTPACK2, TESTMOD) File "S:\buildbots\python\3.0.nelson-windows\build\lib\test\test_zipimport.py", line 91, in doTest ["__dummy__"]) ImportError: No module named ziptestpackage.ziptestpackage2.ziptestmodule ====================================================================== ERROR: testDoctestFile (test.test_zipimport.UncompressedZipImportTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "S:\buildbots\python\3.0.nelson-windows\build\lib\test\test_zipimport.py", line 328, in testDoctestFile self.runDoctest(self.doDoctestFile) File "S:\buildbots\python\3.0.nelson-windows\build\lib\test\test_zipimport.py", line 313, in runDoctest self.doTest(".py", files, TESTMOD, call=callback) File "S:\buildbots\python\3.0.nelson-windows\build\lib\test\test_zipimport.py", line 91, in doTest ["__dummy__"]) ImportError: No module named ziptestmodule ====================================================================== ERROR: testDoctestSuite (test.test_zipimport.UncompressedZipImportTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "S:\buildbots\python\3.0.nelson-windows\build\lib\test\test_zipimport.py", line 339, in testDoctestSuite self.runDoctest(self.doDoctestSuite) File "S:\buildbots\python\3.0.nelson-windows\build\lib\test\test_zipimport.py", line 313, in runDoctest self.doTest(".py", files, TESTMOD, call=callback) File "S:\buildbots\python\3.0.nelson-windows\build\lib\test\test_zipimport.py", line 91, in doTest ["__dummy__"]) ImportError: No module named ziptestmodule ====================================================================== ERROR: testEmptyPy (test.test_zipimport.UncompressedZipImportTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "S:\buildbots\python\3.0.nelson-windows\build\lib\test\test_zipimport.py", line 152, in testEmptyPy self.doTest(None, files, TESTMOD) File "S:\buildbots\python\3.0.nelson-windows\build\lib\test\test_zipimport.py", line 91, in doTest ["__dummy__"]) ImportError: No module named ziptestmodule ====================================================================== ERROR: testGetCompiledSource (test.test_zipimport.UncompressedZipImportTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "S:\buildbots\python\3.0.nelson-windows\build\lib\test\test_zipimport.py", line 308, in testGetCompiledSource self.doTest(pyc_ext, files, TESTMOD, call=self.assertModuleSource) File "S:\buildbots\python\3.0.nelson-windows\build\lib\test\test_zipimport.py", line 91, in doTest ["__dummy__"]) ImportError: No module named ziptestmodule ====================================================================== ERROR: testGetData (test.test_zipimport.UncompressedZipImportTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "S:\buildbots\python\3.0.nelson-windows\build\lib\test\test_zipimport.py", line 272, in testGetData zi = zipimport.zipimporter(TEMP_ZIP) zipimport.ZipImportError: not a Zip file ====================================================================== ERROR: testGetSource (test.test_zipimport.UncompressedZipImportTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "S:\buildbots\python\3.0.nelson-windows\build\lib\test\test_zipimport.py", line 302, in testGetSource self.doTest(".py", files, TESTMOD, call=self.assertModuleSource) File "S:\buildbots\python\3.0.nelson-windows\build\lib\test\test_zipimport.py", line 91, in doTest ["__dummy__"]) ImportError: No module named ziptestmodule ====================================================================== ERROR: testImport_WithStuff (test.test_zipimport.UncompressedZipImportTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "S:\buildbots\python\3.0.nelson-windows\build\lib\test\test_zipimport.py", line 295, in testImport_WithStuff stuff=b"Some Stuff"*31) File "S:\buildbots\python\3.0.nelson-windows\build\lib\test\test_zipimport.py", line 91, in doTest ["__dummy__"]) ImportError: No module named ziptestmodule ====================================================================== ERROR: testImporterAttr (test.test_zipimport.UncompressedZipImportTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "S:\buildbots\python\3.0.nelson-windows\build\lib\test\test_zipimport.py", line 288, in testImporterAttr self.doTest(pyc_ext, files, TESTMOD) File "S:\buildbots\python\3.0.nelson-windows\build\lib\test\test_zipimport.py", line 91, in doTest ["__dummy__"]) ImportError: No module named ziptestmodule ====================================================================== ERROR: testPackage (test.test_zipimport.UncompressedZipImportTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "S:\buildbots\python\3.0.nelson-windows\build\lib\test\test_zipimport.py", line 186, in testPackage self.doTest(pyc_ext, files, TESTPACK, TESTMOD) File "S:\buildbots\python\3.0.nelson-windows\build\lib\test\test_zipimport.py", line 91, in doTest ["__dummy__"]) ImportError: No module named ziptestpackage.ziptestmodule ====================================================================== ERROR: testPy (test.test_zipimport.UncompressedZipImportTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "S:\buildbots\python\3.0.nelson-windows\build\lib\test\test_zipimport.py", line 139, in testPy self.doTest(".py", files, TESTMOD) File "S:\buildbots\python\3.0.nelson-windows\build\lib\test\test_zipimport.py", line 91, in doTest ["__dummy__"]) ImportError: No module named ziptestmodule ====================================================================== ERROR: testPyc (test.test_zipimport.UncompressedZipImportTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "S:\buildbots\python\3.0.nelson-windows\build\lib\test\test_zipimport.py", line 143, in testPyc self.doTest(pyc_ext, files, TESTMOD) File "S:\buildbots\python\3.0.nelson-windows\build\lib\test\test_zipimport.py", line 91, in doTest ["__dummy__"]) ImportError: No module named ziptestmodule ====================================================================== ERROR: testTraceback (test.test_zipimport.UncompressedZipImportTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "S:\buildbots\python\3.0.nelson-windows\build\lib\test\test_zipimport.py", line 362, in testTraceback self.doTest(None, files, TESTMOD, call=self.doTraceback) File "S:\buildbots\python\3.0.nelson-windows\build\lib\test\test_zipimport.py", line 91, in doTest ["__dummy__"]) ImportError: No module named ziptestmodule ====================================================================== ERROR: testZipImporterMethods (test.test_zipimport.UncompressedZipImportTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "S:\buildbots\python\3.0.nelson-windows\build\lib\test\test_zipimport.py", line 211, in testZipImporterMethods zi = zipimport.zipimporter(TEMP_ZIP) zipimport.ZipImportError: not a Zip file ====================================================================== ERROR: testZipImporterMethodsInSubDirectory (test.test_zipimport.UncompressedZipImportTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "S:\buildbots\python\3.0.nelson-windows\build\lib\test\test_zipimport.py", line 247, in testZipImporterMethodsInSubDirectory zi = zipimport.zipimporter(TEMP_ZIP + os.sep + packdir) zipimport.ZipImportError: not a Zip file ====================================================================== ERROR: testBadMTime (test.test_zipimport.CompressedZipImportTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "S:\buildbots\python\3.0.nelson-windows\build\lib\test\test_zipimport.py", line 180, in testBadMTime self.doTest(".py", files, TESTMOD) File "S:\buildbots\python\3.0.nelson-windows\build\lib\test\test_zipimport.py", line 91, in doTest ["__dummy__"]) ImportError: No module named ziptestmodule ====================================================================== ERROR: testBadMagic (test.test_zipimport.CompressedZipImportTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "S:\buildbots\python\3.0.nelson-windows\build\lib\test\test_zipimport.py", line 160, in testBadMagic self.doTest(".py", files, TESTMOD) File "S:\buildbots\python\3.0.nelson-windows\build\lib\test\test_zipimport.py", line 91, in doTest ["__dummy__"]) ImportError: No module named ziptestmodule ====================================================================== ERROR: testBoth (test.test_zipimport.CompressedZipImportTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "S:\buildbots\python\3.0.nelson-windows\build\lib\test\test_zipimport.py", line 148, in testBoth self.doTest(pyc_ext, files, TESTMOD) File "S:\buildbots\python\3.0.nelson-windows\build\lib\test\test_zipimport.py", line 91, in doTest ["__dummy__"]) ImportError: No module named ziptestmodule ====================================================================== ERROR: testDeepPackage (test.test_zipimport.CompressedZipImportTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "S:\buildbots\python\3.0.nelson-windows\build\lib\test\test_zipimport.py", line 194, in testDeepPackage self.doTest(pyc_ext, files, TESTPACK, TESTPACK2, TESTMOD) File "S:\buildbots\python\3.0.nelson-windows\build\lib\test\test_zipimport.py", line 91, in doTest ["__dummy__"]) ImportError: No module named ziptestpackage.ziptestpackage2.ziptestmodule ====================================================================== ERROR: testDoctestFile (test.test_zipimport.CompressedZipImportTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "S:\buildbots\python\3.0.nelson-windows\build\lib\test\test_zipimport.py", line 328, in testDoctestFile self.runDoctest(self.doDoctestFile) File "S:\buildbots\python\3.0.nelson-windows\build\lib\test\test_zipimport.py", line 313, in runDoctest self.doTest(".py", files, TESTMOD, call=callback) File "S:\buildbots\python\3.0.nelson-windows\build\lib\test\test_zipimport.py", line 91, in doTest ["__dummy__"]) ImportError: No module named ziptestmodule ====================================================================== ERROR: testDoctestSuite (test.test_zipimport.CompressedZipImportTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "S:\buildbots\python\3.0.nelson-windows\build\lib\test\test_zipimport.py", line 339, in testDoctestSuite self.runDoctest(self.doDoctestSuite) File "S:\buildbots\python\3.0.nelson-windows\build\lib\test\test_zipimport.py", line 313, in runDoctest self.doTest(".py", files, TESTMOD, call=callback) File "S:\buildbots\python\3.0.nelson-windows\build\lib\test\test_zipimport.py", line 91, in doTest ["__dummy__"]) ImportError: No module named ziptestmodule ====================================================================== ERROR: testEmptyPy (test.test_zipimport.CompressedZipImportTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "S:\buildbots\python\3.0.nelson-windows\build\lib\test\test_zipimport.py", line 152, in testEmptyPy self.doTest(None, files, TESTMOD) File "S:\buildbots\python\3.0.nelson-windows\build\lib\test\test_zipimport.py", line 91, in doTest ["__dummy__"]) ImportError: No module named ziptestmodule ====================================================================== ERROR: testGetCompiledSource (test.test_zipimport.CompressedZipImportTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "S:\buildbots\python\3.0.nelson-windows\build\lib\test\test_zipimport.py", line 308, in testGetCompiledSource self.doTest(pyc_ext, files, TESTMOD, call=self.assertModuleSource) File "S:\buildbots\python\3.0.nelson-windows\build\lib\test\test_zipimport.py", line 91, in doTest ["__dummy__"]) ImportError: No module named ziptestmodule ====================================================================== ERROR: testGetData (test.test_zipimport.CompressedZipImportTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "S:\buildbots\python\3.0.nelson-windows\build\lib\test\test_zipimport.py", line 272, in testGetData zi = zipimport.zipimporter(TEMP_ZIP) zipimport.ZipImportError: not a Zip file ====================================================================== ERROR: testGetSource (test.test_zipimport.CompressedZipImportTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "S:\buildbots\python\3.0.nelson-windows\build\lib\test\test_zipimport.py", line 302, in testGetSource self.doTest(".py", files, TESTMOD, call=self.assertModuleSource) File "S:\buildbots\python\3.0.nelson-windows\build\lib\test\test_zipimport.py", line 91, in doTest ["__dummy__"]) ImportError: No module named ziptestmodule ====================================================================== ERROR: testImport_WithStuff (test.test_zipimport.CompressedZipImportTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "S:\buildbots\python\3.0.nelson-windows\build\lib\test\test_zipimport.py", line 295, in testImport_WithStuff stuff=b"Some Stuff"*31) File "S:\buildbots\python\3.0.nelson-windows\build\lib\test\test_zipimport.py", line 91, in doTest ["__dummy__"]) ImportError: No module named ziptestmodule ====================================================================== ERROR: testImporterAttr (test.test_zipimport.CompressedZipImportTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "S:\buildbots\python\3.0.nelson-windows\build\lib\test\test_zipimport.py", line 288, in testImporterAttr self.doTest(pyc_ext, files, TESTMOD) File "S:\buildbots\python\3.0.nelson-windows\build\lib\test\test_zipimport.py", line 91, in doTest ["__dummy__"]) ImportError: No module named ziptestmodule ====================================================================== ERROR: testPackage (test.test_zipimport.CompressedZipImportTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "S:\buildbots\python\3.0.nelson-windows\build\lib\test\test_zipimport.py", line 186, in testPackage self.doTest(pyc_ext, files, TESTPACK, TESTMOD) File "S:\buildbots\python\3.0.nelson-windows\build\lib\test\test_zipimport.py", line 91, in doTest ["__dummy__"]) ImportError: No module named ziptestpackage.ziptestmodule ====================================================================== ERROR: testPy (test.test_zipimport.CompressedZipImportTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "S:\buildbots\python\3.0.nelson-windows\build\lib\test\test_zipimport.py", line 139, in testPy self.doTest(".py", files, TESTMOD) File "S:\buildbots\python\3.0.nelson-windows\build\lib\test\test_zipimport.py", line 91, in doTest ["__dummy__"]) ImportError: No module named ziptestmodule ====================================================================== ERROR: testPyc (test.test_zipimport.CompressedZipImportTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "S:\buildbots\python\3.0.nelson-windows\build\lib\test\test_zipimport.py", line 143, in testPyc self.doTest(pyc_ext, files, TESTMOD) File "S:\buildbots\python\3.0.nelson-windows\build\lib\test\test_zipimport.py", line 91, in doTest ["__dummy__"]) ImportError: No module named ziptestmodule ====================================================================== ERROR: testTraceback (test.test_zipimport.CompressedZipImportTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "S:\buildbots\python\3.0.nelson-windows\build\lib\test\test_zipimport.py", line 362, in testTraceback self.doTest(None, files, TESTMOD, call=self.doTraceback) File "S:\buildbots\python\3.0.nelson-windows\build\lib\test\test_zipimport.py", line 91, in doTest ["__dummy__"]) ImportError: No module named ziptestmodule ====================================================================== ERROR: testZipImporterMethods (test.test_zipimport.CompressedZipImportTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "S:\buildbots\python\3.0.nelson-windows\build\lib\test\test_zipimport.py", line 211, in testZipImporterMethods zi = zipimport.zipimporter(TEMP_ZIP) zipimport.ZipImportError: not a Zip file ====================================================================== ERROR: testZipImporterMethodsInSubDirectory (test.test_zipimport.CompressedZipImportTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "S:\buildbots\python\3.0.nelson-windows\build\lib\test\test_zipimport.py", line 247, in testZipImporterMethodsInSubDirectory zi = zipimport.zipimporter(TEMP_ZIP + os.sep + packdir) zipimport.ZipImportError: not a Zip file sincerely, -The Buildbot From buildbot at python.org Thu Oct 2 21:17:33 2008 From: buildbot at python.org (buildbot at python.org) Date: Thu, 02 Oct 2008 19:17:33 +0000 Subject: [Python-checkins] buildbot failure in ppc Debian unstable trunk Message-ID: <20081002191733.9FBBD1E4002@bag.python.org> The Buildbot has detected a new failure of ppc Debian unstable trunk. Full details are available at: http://www.python.org/dev/buildbot/all/ppc%20Debian%20unstable%20trunk/builds/2022 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-debian-ppc Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: christian.heimes BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_bsddb3 make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Thu Oct 2 21:18:35 2008 From: buildbot at python.org (buildbot at python.org) Date: Thu, 02 Oct 2008 19:18:35 +0000 Subject: [Python-checkins] buildbot failure in amd64 gentoo 3.0 Message-ID: <20081002191835.D134B1E4002@bag.python.org> The Buildbot has detected a new failure of amd64 gentoo 3.0. Full details are available at: http://www.python.org/dev/buildbot/all/amd64%20gentoo%203.0/builds/1168 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: norwitz-amd64 Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: guido.van.rossum BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_fnmatch ====================================================================== ERROR: test_mix_bytes_str (test.test_fnmatch.FnmatchTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/buildbot/slave/py-build/3.0.norwitz-amd64/build/Lib/test/test_fnmatch.py", line 41, in test_mix_bytes_str self.assertRaises(TypeError, fnmatch, 'test', b'*') File "/home/buildbot/slave/py-build/3.0.norwitz-amd64/build/Lib/unittest.py", line 311, in failUnlessRaises callableObj(*args, **kwargs) File "/home/buildbot/slave/py-build/3.0.norwitz-amd64/build/Lib/fnmatch.py", line 38, in fnmatch return fnmatchcase(name, pat) File "/home/buildbot/slave/py-build/3.0.norwitz-amd64/build/Lib/fnmatch.py", line 76, in fnmatchcase match = _compile_pattern(pat) File "/home/buildbot/slave/py-build/3.0.norwitz-amd64/build/Lib/fnmatch.py", line 41, in _compile_pattern regex = _cache.get(pat) BytesWarning: Comparison between bytes and string make: *** [buildbottest] Error 1 sincerely, -The Buildbot From python-checkins at python.org Thu Oct 2 21:26:56 2008 From: python-checkins at python.org (benjamin.peterson) Date: Thu, 2 Oct 2008 21:26:56 +0200 (CEST) Subject: [Python-checkins] r66747 - python/branches/release26-maint/Mac/BuildScript/scripts/postflight.patch-profile Message-ID: <20081002192656.9E7E61E4002@bag.python.org> Author: benjamin.peterson Date: Thu Oct 2 21:26:56 2008 New Revision: 66747 Log: change version to 2.6 Modified: python/branches/release26-maint/Mac/BuildScript/scripts/postflight.patch-profile Modified: python/branches/release26-maint/Mac/BuildScript/scripts/postflight.patch-profile ============================================================================== --- python/branches/release26-maint/Mac/BuildScript/scripts/postflight.patch-profile (original) +++ python/branches/release26-maint/Mac/BuildScript/scripts/postflight.patch-profile Thu Oct 2 21:26:56 2008 @@ -5,7 +5,7 @@ echo "These changes will be effective only in shell windows that you open" echo "after running this script." -PYVER=2.5 +PYVER=2.6 PYTHON_ROOT="/Library/Frameworks/Python.framework/Versions/Current" if [ `id -ur` = 0 ]; then From buildbot at python.org Thu Oct 2 21:33:08 2008 From: buildbot at python.org (buildbot at python.org) Date: Thu, 02 Oct 2008 19:33:08 +0000 Subject: [Python-checkins] buildbot failure in AMD64 W2k8 3.0 Message-ID: <20081002193308.477131E4002@bag.python.org> The Buildbot has detected a new failure of AMD64 W2k8 3.0. Full details are available at: http://www.python.org/dev/buildbot/all/AMD64%20W2k8%203.0/builds/833 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: nelson-win64 Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: guido.van.rossum BUILD FAILED: failed test Excerpt from the test logfile: Traceback (most recent call last): File "S:\buildbots\python.x64\3.0.nelson-win64\build\lib\test\test_unicode_file.py", line 157, in test_directories self._do_directory(TESTFN_UNICODE+ext, TESTFN_UNICODE+ext, False) File "S:\buildbots\python.x64\3.0.nelson-win64\build\lib\test\test_unicode_file.py", line 114, in _do_directory os.rmdir(make_name) WindowsError: [Error 2] The system cannot find the file specified: '@test-??.dir' Traceback (most recent call last): File "", line 1, in File "S:\buildbots\python.x64\3.0.nelson-win64\build\lib\multiprocessing\forking.py", line 342, in main prepare(preparation_data) File "S:\buildbots\python.x64\3.0.nelson-win64\build\lib\multiprocessing\forking.py", line 451, in prepare file, path_name, etc = imp.find_module(main_name, dirs) ImportError: No module named regrtest Traceback (most recent call last): File "", line 1, in File "S:\buildbots\python.x64\3.0.nelson-win64\build\lib\multiprocessing\forking.py", line 342, in main prepare(preparation_data) File "S:\buildbots\python.x64\3.0.nelson-win64\build\lib\multiprocessing\forking.py", line 451, in prepare file, path_name, etc = imp.find_module(main_name, dirs) ImportError: No module named regrtest Traceback (most recent call last): File "", line 1, in File "S:\buildbots\python.x64\3.0.nelson-win64\build\lib\multiprocessing\forking.py", line 342, in main prepare(preparation_data) File "S:\buildbots\python.x64\3.0.nelson-win64\build\lib\multiprocessing\forking.py", line 451, in prepare file, path_name, etc = imp.find_module(main_name, dirs) ImportError: No module named regrtest Traceback (most recent call last): File "", line 1, in File "S:\buildbots\python.x64\3.0.nelson-win64\build\lib\multiprocessing\forking.py", line 342, in main prepare(preparation_data) File "S:\buildbots\python.x64\3.0.nelson-win64\build\lib\multiprocessing\forking.py", line 451, in prepare file, path_name, etc = imp.find_module(main_name, dirs) ImportError: No module named regrtest Traceback (most recent call last): File "", line 1, in File "S:\buildbots\python.x64\3.0.nelson-win64\build\lib\multiprocessing\forking.py", line 342, in main prepare(preparation_data) File "S:\buildbots\python.x64\3.0.nelson-win64\build\lib\multiprocessing\forking.py", line 451, in prepare file, path_name, etc = imp.find_module(main_name, dirs) ImportError: No module named regrtest 4 tests failed: test_fnmatch test_multiprocessing test_posixpath test_unicode_file ====================================================================== ERROR: test_bytes (test.test_fnmatch.FnmatchTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "S:\buildbots\python.x64\3.0.nelson-win64\build\lib\test\test_fnmatch.py", line 47, in test_bytes self.check_match(b'test', b'te*') File "S:\buildbots\python.x64\3.0.nelson-win64\build\lib\test\test_fnmatch.py", line 12, in check_match self.assert_(fnmatch(filename, pattern), File "S:\buildbots\python.x64\3.0.nelson-win64\build\lib\fnmatch.py", line 36, in fnmatch name = os.path.normcase(name) File "S:\buildbots\python.x64\3.0.nelson-win64\build\lib\ntpath.py", line 44, in normcase return s.replace("/", "\\").lower() TypeError: expected an object with the buffer interface Traceback (most recent call last): File "", line 1, in File "S:\buildbots\python.x64\3.0.nelson-win64\build\lib\multiprocessing\forking.py", line 342, in main prepare(preparation_data) File "S:\buildbots\python.x64\3.0.nelson-win64\build\lib\multiprocessing\forking.py", line 451, in prepare file, path_name, etc = imp.find_module(main_name, dirs) ImportError: No module named regrtest Traceback (most recent call last): File "", line 1, in File "S:\buildbots\python.x64\3.0.nelson-win64\build\lib\multiprocessing\forking.py", line 342, in main prepare(preparation_data) File "S:\buildbots\python.x64\3.0.nelson-win64\build\lib\multiprocessing\forking.py", line 451, in prepare file, path_name, etc = imp.find_module(main_name, dirs) ImportError: No module named regrtest Traceback (most recent call last): File "", line 1, in File "S:\buildbots\python.x64\3.0.nelson-win64\build\lib\multiprocessing\forking.py", line 342, in main prepare(preparation_data) File "S:\buildbots\python.x64\3.0.nelson-win64\build\lib\multiprocessing\forking.py", line 451, in prepare file, path_name, etc = imp.find_module(main_name, dirs) ImportError: No module named regrtest Traceback (most recent call last): File "", line 1, in File "S:\buildbots\python.x64\3.0.nelson-win64\build\lib\multiprocessing\forking.py", line 342, in main prepare(preparation_data) File "S:\buildbots\python.x64\3.0.nelson-win64\build\lib\multiprocessing\forking.py", line 451, in prepare file, path_name, etc = imp.find_module(main_name, dirs) ImportError: No module named regrtest Traceback (most recent call last): File "", line 1, in File "S:\buildbots\python.x64\3.0.nelson-win64\build\lib\multiprocessing\forking.py", line 342, in main prepare(preparation_data) File "S:\buildbots\python.x64\3.0.nelson-win64\build\lib\multiprocessing\forking.py", line 451, in prepare file, path_name, etc = imp.find_module(main_name, dirs) ImportError: No module named regrtest Traceback (most recent call last): File "../lib/test/regrtest.py", line 603, in runtest_inner File "S:\buildbots\python.x64\3.0.nelson-win64\build\lib\test\test_multiprocessing.py", line 1793, in test_main ManagerMixin.manager.start() File "S:\buildbots\python.x64\3.0.nelson-win64\build\lib\multiprocessing\managers.py", line 506, in start self._address = reader.recv() EOFError ====================================================================== ERROR: test_relpath_bytes (test.test_posixpath.PosixPathTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "S:\buildbots\python.x64\3.0.nelson-win64\build\lib\test\test_posixpath.py", line 612, in test_relpath_bytes curdir = os.path.split(os.getcwdb())[-1] File "S:\buildbots\python.x64\3.0.nelson-win64\build\lib\ntpath.py", line 171, in split while i and p[i-1] not in '/\\': TypeError: 'in ' requires string as left operand, not int ====================================================================== ERROR: test_directories (test.test_unicode_file.TestUnicodeFiles) ---------------------------------------------------------------------- Traceback (most recent call last): File "S:\buildbots\python.x64\3.0.nelson-win64\build\lib\test\test_unicode_file.py", line 112, in _do_directory os.chdir(cwd) TypeError: chdir() argument 1 must be string, not bytes Traceback (most recent call last): File "S:\buildbots\python.x64\3.0.nelson-win64\build\lib\test\test_unicode_file.py", line 157, in test_directories self._do_directory(TESTFN_UNICODE+ext, TESTFN_UNICODE+ext, False) File "S:\buildbots\python.x64\3.0.nelson-win64\build\lib\test\test_unicode_file.py", line 114, in _do_directory os.rmdir(make_name) WindowsError: [Error 2] The system cannot find the file specified: '@test-??.dir' Traceback (most recent call last): File "S:\buildbots\python.x64\3.0.nelson-win64\build\lib\test\test_unicode_file.py", line 157, in test_directories self._do_directory(TESTFN_UNICODE+ext, TESTFN_UNICODE+ext, False) File "S:\buildbots\python.x64\3.0.nelson-win64\build\lib\test\test_unicode_file.py", line 114, in _do_directory os.rmdir(make_name) WindowsError: [Error 2] The system cannot find the file specified: '@test-??.dir' sincerely, -The Buildbot From python-checkins at python.org Thu Oct 2 21:47:50 2008 From: python-checkins at python.org (christian.heimes) Date: Thu, 2 Oct 2008 21:47:50 +0200 (CEST) Subject: [Python-checkins] r66748 - in python/trunk: Modules/_ctypes/libffi/src/x86/ffi.c Modules/signalmodule.c Modules/tkappinit.c Objects/unicodeobject.c Python/_warnings.c Message-ID: <20081002194750.B5A701E4002@bag.python.org> Author: christian.heimes Date: Thu Oct 2 21:47:50 2008 New Revision: 66748 Log: Fixed a couple more C99 comments and one occurence of inline. Modified: python/trunk/Modules/_ctypes/libffi/src/x86/ffi.c python/trunk/Modules/signalmodule.c python/trunk/Modules/tkappinit.c python/trunk/Objects/unicodeobject.c python/trunk/Python/_warnings.c Modified: python/trunk/Modules/_ctypes/libffi/src/x86/ffi.c ============================================================================== --- python/trunk/Modules/_ctypes/libffi/src/x86/ffi.c (original) +++ python/trunk/Modules/_ctypes/libffi/src/x86/ffi.c Thu Oct 2 21:47:50 2008 @@ -388,10 +388,10 @@ return FFI_BAD_ABI; } - // we currently don't support certain kinds of arguments for raw + /* we currently don't support certain kinds of arguments for raw // closures. This should be implemented by a separate assembly language // routine, since it would require argument processing, something we - // don't do now for performance. + // don't do now for performance. */ for (i = cif->nargs-1; i >= 0; i--) { Modified: python/trunk/Modules/signalmodule.c ============================================================================== --- python/trunk/Modules/signalmodule.c (original) +++ python/trunk/Modules/signalmodule.c Thu Oct 2 21:47:50 2008 @@ -107,7 +107,7 @@ tv->tv_usec = fmod(d, 1.0) * 1000000.0; } -static inline double +Py_LOCAL_INLINE(double) double_from_timeval(struct timeval *tv) { return tv->tv_sec + (double)(tv->tv_usec / 1000000.0); Modified: python/trunk/Modules/tkappinit.c ============================================================================== --- python/trunk/Modules/tkappinit.c (original) +++ python/trunk/Modules/tkappinit.c Thu Oct 2 21:47:50 2008 @@ -71,7 +71,7 @@ #endif #ifdef WITH_XXX - // Initialize modules that don't require Tk + /* Initialize modules that don't require Tk */ #endif _tkinter_skip_tk_init = Tcl_GetVar(interp, "_tkinter_skip_tk_init", TCL_GLOBAL_ONLY); Modified: python/trunk/Objects/unicodeobject.c ============================================================================== --- python/trunk/Objects/unicodeobject.c (original) +++ python/trunk/Objects/unicodeobject.c Thu Oct 2 21:47:50 2008 @@ -115,19 +115,19 @@ /* Fast detection of the most frequent whitespace characters */ const unsigned char _Py_ascii_whitespace[] = { 0, 0, 0, 0, 0, 0, 0, 0, -// case 0x0009: /* HORIZONTAL TABULATION */ -// case 0x000A: /* LINE FEED */ -// case 0x000B: /* VERTICAL TABULATION */ -// case 0x000C: /* FORM FEED */ -// case 0x000D: /* CARRIAGE RETURN */ +/* case 0x0009: * HORIZONTAL TABULATION */ +/* case 0x000A: * LINE FEED */ +/* case 0x000B: * VERTICAL TABULATION */ +/* case 0x000C: * FORM FEED */ +/* case 0x000D: * CARRIAGE RETURN */ 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -// case 0x001C: /* FILE SEPARATOR */ -// case 0x001D: /* GROUP SEPARATOR */ -// case 0x001E: /* RECORD SEPARATOR */ -// case 0x001F: /* UNIT SEPARATOR */ +/* case 0x001C: * FILE SEPARATOR */ +/* case 0x001D: * GROUP SEPARATOR */ +/* case 0x001E: * RECORD SEPARATOR */ +/* case 0x001F: * UNIT SEPARATOR */ 0, 0, 0, 0, 1, 1, 1, 1, -// case 0x0020: /* SPACE */ +/* case 0x0020: * SPACE */ 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, @@ -146,13 +146,13 @@ /* Same for linebreaks */ static unsigned char ascii_linebreak[] = { 0, 0, 0, 0, 0, 0, 0, 0, -// 0x000A, /* LINE FEED */ -// 0x000D, /* CARRIAGE RETURN */ +/* 0x000A, * LINE FEED */ +/* 0x000D, * CARRIAGE RETURN */ 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -// 0x001C, /* FILE SEPARATOR */ -// 0x001D, /* GROUP SEPARATOR */ -// 0x001E, /* RECORD SEPARATOR */ +/* 0x001C, * FILE SEPARATOR */ +/* 0x001D, * GROUP SEPARATOR */ +/* 0x001E, * RECORD SEPARATOR */ 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, Modified: python/trunk/Python/_warnings.c ============================================================================== --- python/trunk/Python/_warnings.c (original) +++ python/trunk/Python/_warnings.c Thu Oct 2 21:47:50 2008 @@ -377,7 +377,7 @@ } } - if (rc == 1) // Already warned for this module. */ + if (rc == 1) /* Already warned for this module. */ goto return_none; if (rc == 0) { PyObject *show_fxn = get_warnings_attr("showwarning"); @@ -800,8 +800,8 @@ warn_doc}, {"warn_explicit", (PyCFunction)warnings_warn_explicit, METH_VARARGS | METH_KEYWORDS, warn_explicit_doc}, - // XXX(brett.cannon): add showwarning? - // XXX(brett.cannon): Reasonable to add formatwarning? + /* XXX(brett.cannon): add showwarning? */ + /* XXX(brett.cannon): Reasonable to add formatwarning? */ {NULL, NULL} /* sentinel */ }; From python-checkins at python.org Thu Oct 2 21:49:47 2008 From: python-checkins at python.org (christian.heimes) Date: Thu, 2 Oct 2008 21:49:47 +0200 (CEST) Subject: [Python-checkins] r66749 - in python/branches/release26-maint: Misc/NEWS Modules/_ctypes/libffi/src/x86/ffi.c Modules/signalmodule.c Modules/tkappinit.c Objects/unicodeobject.c Python/_warnings.c Message-ID: <20081002194947.9C79B1E4008@bag.python.org> Author: christian.heimes Date: Thu Oct 2 21:49:47 2008 New Revision: 66749 Log: Merged revisions 66748 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r66748 | christian.heimes | 2008-10-02 21:47:50 +0200 (Thu, 02 Oct 2008) | 1 line Fixed a couple more C99 comments and one occurence of inline. ........ Modified: python/branches/release26-maint/ (props changed) python/branches/release26-maint/Misc/NEWS python/branches/release26-maint/Modules/_ctypes/libffi/src/x86/ffi.c python/branches/release26-maint/Modules/signalmodule.c python/branches/release26-maint/Modules/tkappinit.c python/branches/release26-maint/Objects/unicodeobject.c python/branches/release26-maint/Python/_warnings.c Modified: python/branches/release26-maint/Misc/NEWS ============================================================================== --- python/branches/release26-maint/Misc/NEWS (original) +++ python/branches/release26-maint/Misc/NEWS Thu Oct 2 21:49:47 2008 @@ -12,7 +12,7 @@ Core and Builtins ----------------- -- Fixed a broken comment in Objects/frameobject.c. Python is now C89 compatible +- Fixed C99 style comments in several files. Python is now C89 compatible again. Library Modified: python/branches/release26-maint/Modules/_ctypes/libffi/src/x86/ffi.c ============================================================================== --- python/branches/release26-maint/Modules/_ctypes/libffi/src/x86/ffi.c (original) +++ python/branches/release26-maint/Modules/_ctypes/libffi/src/x86/ffi.c Thu Oct 2 21:49:47 2008 @@ -388,10 +388,10 @@ return FFI_BAD_ABI; } - // we currently don't support certain kinds of arguments for raw + /* we currently don't support certain kinds of arguments for raw // closures. This should be implemented by a separate assembly language // routine, since it would require argument processing, something we - // don't do now for performance. + // don't do now for performance. */ for (i = cif->nargs-1; i >= 0; i--) { Modified: python/branches/release26-maint/Modules/signalmodule.c ============================================================================== --- python/branches/release26-maint/Modules/signalmodule.c (original) +++ python/branches/release26-maint/Modules/signalmodule.c Thu Oct 2 21:49:47 2008 @@ -107,7 +107,7 @@ tv->tv_usec = fmod(d, 1.0) * 1000000.0; } -static inline double +Py_LOCAL_INLINE(double) double_from_timeval(struct timeval *tv) { return tv->tv_sec + (double)(tv->tv_usec / 1000000.0); Modified: python/branches/release26-maint/Modules/tkappinit.c ============================================================================== --- python/branches/release26-maint/Modules/tkappinit.c (original) +++ python/branches/release26-maint/Modules/tkappinit.c Thu Oct 2 21:49:47 2008 @@ -71,7 +71,7 @@ #endif #ifdef WITH_XXX - // Initialize modules that don't require Tk + /* Initialize modules that don't require Tk */ #endif _tkinter_skip_tk_init = Tcl_GetVar(interp, "_tkinter_skip_tk_init", TCL_GLOBAL_ONLY); Modified: python/branches/release26-maint/Objects/unicodeobject.c ============================================================================== --- python/branches/release26-maint/Objects/unicodeobject.c (original) +++ python/branches/release26-maint/Objects/unicodeobject.c Thu Oct 2 21:49:47 2008 @@ -115,19 +115,19 @@ /* Fast detection of the most frequent whitespace characters */ const unsigned char _Py_ascii_whitespace[] = { 0, 0, 0, 0, 0, 0, 0, 0, -// case 0x0009: /* HORIZONTAL TABULATION */ -// case 0x000A: /* LINE FEED */ -// case 0x000B: /* VERTICAL TABULATION */ -// case 0x000C: /* FORM FEED */ -// case 0x000D: /* CARRIAGE RETURN */ +/* case 0x0009: * HORIZONTAL TABULATION */ +/* case 0x000A: * LINE FEED */ +/* case 0x000B: * VERTICAL TABULATION */ +/* case 0x000C: * FORM FEED */ +/* case 0x000D: * CARRIAGE RETURN */ 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -// case 0x001C: /* FILE SEPARATOR */ -// case 0x001D: /* GROUP SEPARATOR */ -// case 0x001E: /* RECORD SEPARATOR */ -// case 0x001F: /* UNIT SEPARATOR */ +/* case 0x001C: * FILE SEPARATOR */ +/* case 0x001D: * GROUP SEPARATOR */ +/* case 0x001E: * RECORD SEPARATOR */ +/* case 0x001F: * UNIT SEPARATOR */ 0, 0, 0, 0, 1, 1, 1, 1, -// case 0x0020: /* SPACE */ +/* case 0x0020: * SPACE */ 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, @@ -146,13 +146,13 @@ /* Same for linebreaks */ static unsigned char ascii_linebreak[] = { 0, 0, 0, 0, 0, 0, 0, 0, -// 0x000A, /* LINE FEED */ -// 0x000D, /* CARRIAGE RETURN */ +/* 0x000A, * LINE FEED */ +/* 0x000D, * CARRIAGE RETURN */ 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -// 0x001C, /* FILE SEPARATOR */ -// 0x001D, /* GROUP SEPARATOR */ -// 0x001E, /* RECORD SEPARATOR */ +/* 0x001C, * FILE SEPARATOR */ +/* 0x001D, * GROUP SEPARATOR */ +/* 0x001E, * RECORD SEPARATOR */ 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, Modified: python/branches/release26-maint/Python/_warnings.c ============================================================================== --- python/branches/release26-maint/Python/_warnings.c (original) +++ python/branches/release26-maint/Python/_warnings.c Thu Oct 2 21:49:47 2008 @@ -377,7 +377,7 @@ } } - if (rc == 1) // Already warned for this module. */ + if (rc == 1) /* Already warned for this module. */ goto return_none; if (rc == 0) { PyObject *show_fxn = get_warnings_attr("showwarning"); @@ -800,8 +800,8 @@ warn_doc}, {"warn_explicit", (PyCFunction)warnings_warn_explicit, METH_VARARGS | METH_KEYWORDS, warn_explicit_doc}, - // XXX(brett.cannon): add showwarning? - // XXX(brett.cannon): Reasonable to add formatwarning? + /* XXX(brett.cannon): add showwarning? */ + /* XXX(brett.cannon): Reasonable to add formatwarning? */ {NULL, NULL} /* sentinel */ }; From python-checkins at python.org Thu Oct 2 21:51:29 2008 From: python-checkins at python.org (phillip.eby) Date: Thu, 2 Oct 2008 21:51:29 +0200 (CEST) Subject: [Python-checkins] r66750 - sandbox/branches/setuptools-0.6/ez_setup.py Message-ID: <20081002195129.8B3F61E4056@bag.python.org> Author: phillip.eby Date: Thu Oct 2 21:51:29 2008 New Revision: 66750 Log: Signatures for 0.6c9 Modified: sandbox/branches/setuptools-0.6/ez_setup.py Modified: sandbox/branches/setuptools-0.6/ez_setup.py ============================================================================== --- sandbox/branches/setuptools-0.6/ez_setup.py (original) +++ sandbox/branches/setuptools-0.6/ez_setup.py Thu Oct 2 21:51:29 2008 @@ -48,6 +48,10 @@ 'setuptools-0.6c8-py2.3.egg': '50759d29b349db8cfd807ba8303f1902', 'setuptools-0.6c8-py2.4.egg': 'cba38d74f7d483c06e9daa6070cce6de', 'setuptools-0.6c8-py2.5.egg': '1721747ee329dc150590a58b3e1ac95b', + 'setuptools-0.6c9-py2.3.egg': 'a83c4020414807b496e4cfbe08507c03', + 'setuptools-0.6c9-py2.4.egg': '260a2be2e5388d66bdaee06abec6342a', + 'setuptools-0.6c9-py2.5.egg': 'fe67c3e5a17b12c0e7c541b7ea43a8e6', + 'setuptools-0.6c9-py2.6.egg': 'ca37b1ff16fa2ede6e19383e7b59245a', } import sys, os From buildbot at python.org Thu Oct 2 21:55:14 2008 From: buildbot at python.org (buildbot at python.org) Date: Thu, 02 Oct 2008 19:55:14 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc trunk Message-ID: <20081002195514.E71191E4002@bag.python.org> The Buildbot has detected a new failure of sparc solaris10 gcc trunk. Full details are available at: http://www.python.org/dev/buildbot/all/sparc%20solaris10%20gcc%20trunk/builds/2 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: loewis-sun Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: christian.heimes BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_posix ====================================================================== ERROR: test_getcwd_long_pathnames (test.test_posix.PosixTester) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home2/buildbot/slave/trunk.loewis-sun/build/Lib/test/test_posix.py", line 270, in test_getcwd_long_pathnames shutil.rmtree(base_path) File "/home2/buildbot/slave/trunk.loewis-sun/build/Lib/shutil.py", line 225, in rmtree onerror(os.rmdir, path, sys.exc_info()) File "/home2/buildbot/slave/trunk.loewis-sun/build/Lib/shutil.py", line 223, in rmtree os.rmdir(path) OSError: [Errno 22] Invalid argument: '/home2/buildbot/slave/trunk.loewis-sun/build/@test.getcwd/@test.getcwd' ====================================================================== ERROR: test_getcwd_long_pathnames (test.test_posix.PosixTester) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home2/buildbot/slave/trunk.loewis-sun/build/Lib/test/test_posix.py", line 27, in tearDown os.unlink(test_support.TESTFN) OSError: [Errno 2] No such file or directory: '@test' sincerely, -The Buildbot From python-checkins at python.org Thu Oct 2 22:04:47 2008 From: python-checkins at python.org (martin.v.loewis) Date: Thu, 2 Oct 2008 22:04:47 +0200 (CEST) Subject: [Python-checkins] r66752 - python/trunk/Tools/msi/msi.py Message-ID: <20081002200447.748461E4002@bag.python.org> Author: martin.v.loewis Date: Thu Oct 2 22:04:47 2008 New Revision: 66752 Log: Add UUID for 2.7. Modified: python/trunk/Tools/msi/msi.py Modified: python/trunk/Tools/msi/msi.py ============================================================================== --- python/trunk/Tools/msi/msi.py (original) +++ python/trunk/Tools/msi/msi.py Thu Oct 2 22:04:47 2008 @@ -111,6 +111,7 @@ "24":"{9B81E618-2301-4035-AC77-75D9ABEB7301}", "25":"{2e41b118-38bd-4c1b-a840-6977efd1b911}", "26":"{34ebecac-f046-4e1c-b0e3-9bac3cdaacfa}", + "27":"{4fe21c76-1760-437b-a2f2-99909130a175}", } [major+minor] # Compute the name that Sphinx gives to the docfile From buildbot at python.org Thu Oct 2 22:46:29 2008 From: buildbot at python.org (buildbot at python.org) Date: Thu, 02 Oct 2008 20:46:29 +0000 Subject: [Python-checkins] buildbot failure in ppc Debian unstable 3.0 Message-ID: <20081002204629.B5BBF1E4002@bag.python.org> The Buildbot has detected a new failure of ppc Debian unstable 3.0. Full details are available at: http://www.python.org/dev/buildbot/all/ppc%20Debian%20unstable%203.0/builds/1611 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-debian-ppc Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: benjamin.peterson,guido.van.rossum BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_fnmatch ====================================================================== ERROR: test_mix_bytes_str (test.test_fnmatch.FnmatchTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/pybot/buildarea/3.0.klose-debian-ppc/build/Lib/test/test_fnmatch.py", line 41, in test_mix_bytes_str self.assertRaises(TypeError, fnmatch, 'test', b'*') File "/home/pybot/buildarea/3.0.klose-debian-ppc/build/Lib/unittest.py", line 311, in failUnlessRaises callableObj(*args, **kwargs) File "/home/pybot/buildarea/3.0.klose-debian-ppc/build/Lib/fnmatch.py", line 38, in fnmatch return fnmatchcase(name, pat) File "/home/pybot/buildarea/3.0.klose-debian-ppc/build/Lib/fnmatch.py", line 76, in fnmatchcase match = _compile_pattern(pat) File "/home/pybot/buildarea/3.0.klose-debian-ppc/build/Lib/fnmatch.py", line 41, in _compile_pattern regex = _cache.get(pat) BytesWarning: Comparison between bytes and string make: *** [buildbottest] Error 1 sincerely, -The Buildbot From python-checkins at python.org Thu Oct 2 22:47:00 2008 From: python-checkins at python.org (benjamin.peterson) Date: Thu, 2 Oct 2008 22:47:00 +0200 (CEST) Subject: [Python-checkins] r66756 - python/trunk/Lib/pydoc_topics.py Message-ID: <20081002204700.E2FBC1E4012@bag.python.org> Author: benjamin.peterson Date: Thu Oct 2 22:46:58 2008 New Revision: 66756 Log: update pydoc topics Modified: python/trunk/Lib/pydoc_topics.py Modified: python/trunk/Lib/pydoc_topics.py ============================================================================== --- python/trunk/Lib/pydoc_topics.py (original) +++ python/trunk/Lib/pydoc_topics.py Thu Oct 2 22:46:58 2008 @@ -1,31 +1,31 @@ -# Autogenerated by Sphinx on Sun Jun 1 22:23:15 2008 +# Autogenerated by Sphinx on Thu Oct 2 15:45:36 2008 topics = {'assert': u'\nThe ``assert`` statement\n************************\n\nAssert statements are a convenient way to insert debugging assertions\ninto a program:\n\n assert_stmt ::= "assert" expression ["," expression]\n\nThe simple form, ``assert expression``, is equivalent to\n\n if __debug__:\n if not expression: raise AssertionError\n\nThe extended form, ``assert expression1, expression2``, is equivalent\nto\n\n if __debug__:\n if not expression1: raise AssertionError, expression2\n\nThese equivalences assume that ``__debug__`` and ``AssertionError``\nrefer to the built-in variables with those names. In the current\nimplementation, the built-in variable ``__debug__`` is ``True`` under\nnormal circumstances, ``False`` when optimization is requested\n(command line option -O). The current code generator emits no code\nfor an assert statement when optimization is requested at compile\ntime. Note that it is unnecessary to include the source code for the\nexpression that failed in the error message; it will be displayed as\npart of the stack trace.\n\nAssignments to ``__debug__`` are illegal. The value for the built-in\nvariable is determined when the interpreter starts.\n', - 'assignment': u'\nAssignment statements\n*********************\n\nAssignment statements are used to (re)bind names to values and to\nmodify attributes or items of mutable objects:\n\n assignment_stmt ::= (target_list "=")+ (expression_list | yield_expression)\n target_list ::= target ("," target)* [","]\n target ::= identifier\n | "(" target_list ")"\n | "[" target_list "]"\n | attributeref\n | subscription\n | slicing\n\n(See section *Primaries* for the syntax definitions for the last three\nsymbols.)\n\nAn assignment statement evaluates the expression list (remember that\nthis can be a single expression or a comma-separated list, the latter\nyielding a tuple) and assigns the single resulting object to each of\nthe target lists, from left to right.\n\nAssignment is defined recursively depending on the form of the target\n(list). When a target is part of a mutable object (an attribute\nreference, subscription or slicing), the mutable object must\nultimately perform the assignment and decide about its validity, and\nmay raise an exception if the assignment is unacceptable. The rules\nobserved by various types and the exceptions raised are given with the\ndefinition of the object types (see section *The standard type\nhierarchy*).\n\nAssignment of an object to a target list is recursively defined as\nfollows.\n\n* If the target list is a single target: The object is assigned to\n that target.\n\n* If the target list is a comma-separated list of targets: The object\n must be a sequence with the same number of items as there are\n targets in the target list, and the items are assigned, from left to\n right, to the corresponding targets. (This rule is relaxed as of\n Python 1.5; in earlier versions, the object had to be a tuple.\n Since strings are sequences, an assignment like ``a, b = "xy"`` is\n now legal as long as the string has the right length.)\n\nAssignment of an object to a single target is recursively defined as\nfollows.\n\n* If the target is an identifier (name):\n\n * If the name does not occur in a ``global`` statement in the\n current code block: the name is bound to the object in the current\n local namespace.\n\n * Otherwise: the name is bound to the object in the current global\n namespace.\n\n The name is rebound if it was already bound. This may cause the\n reference count for the object previously bound to the name to reach\n zero, causing the object to be deallocated and its destructor (if it\n has one) to be called.\n\n* If the target is a target list enclosed in parentheses or in square\n brackets: The object must be a sequence with the same number of\n items as there are targets in the target list, and its items are\n assigned, from left to right, to the corresponding targets.\n\n* If the target is an attribute reference: The primary expression in\n the reference is evaluated. It should yield an object with\n assignable attributes; if this is not the case, ``TypeError`` is\n raised. That object is then asked to assign the assigned object to\n the given attribute; if it cannot perform the assignment, it raises\n an exception (usually but not necessarily ``AttributeError``).\n\n* If the target is a subscription: The primary expression in the\n reference is evaluated. It should yield either a mutable sequence\n object (such as a list) or a mapping object (such as a dictionary).\n Next, the subscript expression is evaluated.\n\n If the primary is a mutable sequence object (such as a list), the\n subscript must yield a plain integer. If it is negative, the\n sequence\'s length is added to it. The resulting value must be a\n nonnegative integer less than the sequence\'s length, and the\n sequence is asked to assign the assigned object to its item with\n that index. If the index is out of range, ``IndexError`` is raised\n (assignment to a subscripted sequence cannot add new items to a\n list).\n\n If the primary is a mapping object (such as a dictionary), the\n subscript must have a type compatible with the mapping\'s key type,\n and the mapping is then asked to create a key/datum pair which maps\n the subscript to the assigned object. This can either replace an\n existing key/value pair with the same key value, or insert a new\n key/value pair (if no key with the same value existed).\n\n* If the target is a slicing: The primary expression in the reference\n is evaluated. It should yield a mutable sequence object (such as a\n list). The assigned object should be a sequence object of the same\n type. Next, the lower and upper bound expressions are evaluated,\n insofar they are present; defaults are zero and the sequence\'s\n length. The bounds should evaluate to (small) integers. If either\n bound is negative, the sequence\'s length is added to it. The\n resulting bounds are clipped to lie between zero and the sequence\'s\n length, inclusive. Finally, the sequence object is asked to replace\n the slice with the items of the assigned sequence. The length of\n the slice may be different from the length of the assigned sequence,\n thus changing the length of the target sequence, if the object\n allows it.\n\n(In the current implementation, the syntax for targets is taken to be\nthe same as for expressions, and invalid syntax is rejected during the\ncode generation phase, causing less detailed error messages.)\n\nWARNING: Although the definition of assignment implies that overlaps\nbetween the left-hand side and the right-hand side are \'safe\' (for\nexample ``a, b = b, a`` swaps two variables), overlaps *within* the\ncollection of assigned-to variables are not safe! For instance, the\nfollowing program prints ``[0, 2]``:\n\n x = [0, 1]\n i = 0\n i, x[i] = 1, 2\n print x\n\n\nAugmented assignment statements\n===============================\n\nAugmented assignment is the combination, in a single statement, of a\nbinary operation and an assignment statement:\n\n augmented_assignment_stmt ::= target augop (expression_list | yield_expression)\n augop ::= "+=" | "-=" | "*=" | "/=" | "%=" | "**="\n | ">>=" | "<<=" | "&=" | "^=" | "|="\n\n(See section *Primaries* for the syntax definitions for the last three\nsymbols.)\n\nAn augmented assignment evaluates the target (which, unlike normal\nassignment statements, cannot be an unpacking) and the expression\nlist, performs the binary operation specific to the type of assignment\non the two operands, and assigns the result to the original target.\nThe target is only evaluated once.\n\nAn augmented assignment expression like ``x += 1`` can be rewritten as\n``x = x + 1`` to achieve a similar, but not exactly equal effect. In\nthe augmented version, ``x`` is only evaluated once. Also, when\npossible, the actual operation is performed *in-place*, meaning that\nrather than creating a new object and assigning that to the target,\nthe old object is modified instead.\n\nWith the exception of assigning to tuples and multiple targets in a\nsingle statement, the assignment done by augmented assignment\nstatements is handled the same way as normal assignments. Similarly,\nwith the exception of the possible *in-place* behavior, the binary\noperation performed by augmented assignment is the same as the normal\nbinary operations.\n\nFor targets which are attribute references, the initial value is\nretrieved with a ``getattr()`` and the result is assigned with a\n``setattr()``. Notice that the two methods do not necessarily refer\nto the same variable. When ``getattr()`` refers to a class variable,\n``setattr()`` still writes to an instance variable. For example:\n\n class A:\n x = 3 # class variable\n a = A()\n a.x += 1 # writes a.x as 4 leaving A.x as 3\n', + 'assignment': u'\nAssignment statements\n*********************\n\nAssignment statements are used to (re)bind names to values and to\nmodify attributes or items of mutable objects:\n\n assignment_stmt ::= (target_list "=")+ (expression_list | yield_expression)\n target_list ::= target ("," target)* [","]\n target ::= identifier\n | "(" target_list ")"\n | "[" target_list "]"\n | attributeref\n | subscription\n | slicing\n\n(See section *Primaries* for the syntax definitions for the last three\nsymbols.)\n\nAn assignment statement evaluates the expression list (remember that\nthis can be a single expression or a comma-separated list, the latter\nyielding a tuple) and assigns the single resulting object to each of\nthe target lists, from left to right.\n\nAssignment is defined recursively depending on the form of the target\n(list). When a target is part of a mutable object (an attribute\nreference, subscription or slicing), the mutable object must\nultimately perform the assignment and decide about its validity, and\nmay raise an exception if the assignment is unacceptable. The rules\nobserved by various types and the exceptions raised are given with the\ndefinition of the object types (see section *The standard type\nhierarchy*).\n\nAssignment of an object to a target list is recursively defined as\nfollows.\n\n* If the target list is a single target: The object is assigned to\n that target.\n\n* If the target list is a comma-separated list of targets: The object\n must be a sequence with the same number of items as there are\n targets in the target list, and the items are assigned, from left to\n right, to the corresponding targets. (This rule is relaxed as of\n Python 1.5; in earlier versions, the object had to be a tuple.\n Since strings are sequences, an assignment like ``a, b = "xy"`` is\n now legal as long as the string has the right length.)\n\nAssignment of an object to a single target is recursively defined as\nfollows.\n\n* If the target is an identifier (name):\n\n * If the name does not occur in a ``global`` statement in the\n current code block: the name is bound to the object in the current\n local namespace.\n\n * Otherwise: the name is bound to the object in the current global\n namespace.\n\n The name is rebound if it was already bound. This may cause the\n reference count for the object previously bound to the name to reach\n zero, causing the object to be deallocated and its destructor (if it\n has one) to be called.\n\n* If the target is a target list enclosed in parentheses or in square\n brackets: The object must be a sequence with the same number of\n items as there are targets in the target list, and its items are\n assigned, from left to right, to the corresponding targets.\n\n* If the target is an attribute reference: The primary expression in\n the reference is evaluated. It should yield an object with\n assignable attributes; if this is not the case, ``TypeError`` is\n raised. That object is then asked to assign the assigned object to\n the given attribute; if it cannot perform the assignment, it raises\n an exception (usually but not necessarily ``AttributeError``).\n\n* If the target is a subscription: The primary expression in the\n reference is evaluated. It should yield either a mutable sequence\n object (such as a list) or a mapping object (such as a dictionary).\n Next, the subscript expression is evaluated.\n\n If the primary is a mutable sequence object (such as a list), the\n subscript must yield a plain integer. If it is negative, the\n sequence\'s length is added to it. The resulting value must be a\n nonnegative integer less than the sequence\'s length, and the\n sequence is asked to assign the assigned object to its item with\n that index. If the index is out of range, ``IndexError`` is raised\n (assignment to a subscripted sequence cannot add new items to a\n list).\n\n If the primary is a mapping object (such as a dictionary), the\n subscript must have a type compatible with the mapping\'s key type,\n and the mapping is then asked to create a key/datum pair which maps\n the subscript to the assigned object. This can either replace an\n existing key/value pair with the same key value, or insert a new\n key/value pair (if no key with the same value existed).\n\n* If the target is a slicing: The primary expression in the reference\n is evaluated. It should yield a mutable sequence object (such as a\n list). The assigned object should be a sequence object of the same\n type. Next, the lower and upper bound expressions are evaluated,\n insofar they are present; defaults are zero and the sequence\'s\n length. The bounds should evaluate to (small) integers. If either\n bound is negative, the sequence\'s length is added to it. The\n resulting bounds are clipped to lie between zero and the sequence\'s\n length, inclusive. Finally, the sequence object is asked to replace\n the slice with the items of the assigned sequence. The length of\n the slice may be different from the length of the assigned sequence,\n thus changing the length of the target sequence, if the object\n allows it.\n\n(In the current implementation, the syntax for targets is taken to be\nthe same as for expressions, and invalid syntax is rejected during the\ncode generation phase, causing less detailed error messages.)\n\nWARNING: Although the definition of assignment implies that overlaps\nbetween the left-hand side and the right-hand side are \'safe\' (for\nexample ``a, b = b, a`` swaps two variables), overlaps *within* the\ncollection of assigned-to variables are not safe! For instance, the\nfollowing program prints ``[0, 2]``:\n\n x = [0, 1]\n i = 0\n i, x[i] = 1, 2\n print x\n\n\nAugmented assignment statements\n===============================\n\nAugmented assignment is the combination, in a single statement, of a\nbinary operation and an assignment statement:\n\n augmented_assignment_stmt ::= target augop (expression_list | yield_expression)\n augop ::= "+=" | "-=" | "*=" | "/=" | "//=" | "%=" | "**="\n | ">>=" | "<<=" | "&=" | "^=" | "|="\n\n(See section *Primaries* for the syntax definitions for the last three\nsymbols.)\n\nAn augmented assignment evaluates the target (which, unlike normal\nassignment statements, cannot be an unpacking) and the expression\nlist, performs the binary operation specific to the type of assignment\non the two operands, and assigns the result to the original target.\nThe target is only evaluated once.\n\nAn augmented assignment expression like ``x += 1`` can be rewritten as\n``x = x + 1`` to achieve a similar, but not exactly equal effect. In\nthe augmented version, ``x`` is only evaluated once. Also, when\npossible, the actual operation is performed *in-place*, meaning that\nrather than creating a new object and assigning that to the target,\nthe old object is modified instead.\n\nWith the exception of assigning to tuples and multiple targets in a\nsingle statement, the assignment done by augmented assignment\nstatements is handled the same way as normal assignments. Similarly,\nwith the exception of the possible *in-place* behavior, the binary\noperation performed by augmented assignment is the same as the normal\nbinary operations.\n\nFor targets which are attribute references, the initial value is\nretrieved with a ``getattr()`` and the result is assigned with a\n``setattr()``. Notice that the two methods do not necessarily refer\nto the same variable. When ``getattr()`` refers to a class variable,\n``setattr()`` still writes to an instance variable. For example:\n\n class A:\n x = 3 # class variable\n a = A()\n a.x += 1 # writes a.x as 4 leaving A.x as 3\n', 'atom-identifiers': u'\nIdentifiers (Names)\n*******************\n\nAn identifier occurring as an atom is a name. See section\n*Identifiers and keywords* for lexical definition and section *Naming\nand binding* for documentation of naming and binding.\n\nWhen the name is bound to an object, evaluation of the atom yields\nthat object. When a name is not bound, an attempt to evaluate it\nraises a ``NameError`` exception.\n\n**Private name mangling:** When an identifier that textually occurs in\na class definition begins with two or more underscore characters and\ndoes not end in two or more underscores, it is considered a *private\nname* of that class. Private names are transformed to a longer form\nbefore code is generated for them. The transformation inserts the\nclass name in front of the name, with leading underscores removed, and\na single underscore inserted in front of the class name. For example,\nthe identifier ``__spam`` occurring in a class named ``Ham`` will be\ntransformed to ``_Ham__spam``. This transformation is independent of\nthe syntactical context in which the identifier is used. If the\ntransformed name is extremely long (longer than 255 characters),\nimplementation defined truncation may happen. If the class name\nconsists only of underscores, no transformation is done.\n', 'atom-literals': u"\nLiterals\n********\n\nPython supports string literals and various numeric literals:\n\n literal ::= stringliteral | integer | longinteger\n | floatnumber | imagnumber\n\nEvaluation of a literal yields an object of the given type (string,\ninteger, long integer, floating point number, complex number) with the\ngiven value. The value may be approximated in the case of floating\npoint and imaginary (complex) literals. See section *Literals* for\ndetails.\n\nAll literals correspond to immutable data types, and hence the\nobject's identity is less important than its value. Multiple\nevaluations of literals with the same value (either the same\noccurrence in the program text or a different occurrence) may obtain\nthe same object or a different object with the same value.\n", - 'attribute-access': u'\nCustomizing attribute access\n****************************\n\nThe following methods can be defined to customize the meaning of\nattribute access (use of, assignment to, or deletion of ``x.name``)\nfor class instances.\n\nobject.__getattr__(self, name)\n\n Called when an attribute lookup has not found the attribute in the\n usual places (i.e. it is not an instance attribute nor is it found\n in the class tree for ``self``). ``name`` is the attribute name.\n This method should return the (computed) attribute value or raise\n an ``AttributeError`` exception.\n\n Note that if the attribute is found through the normal mechanism,\n ``__getattr__()`` is not called. (This is an intentional asymmetry\n between ``__getattr__()`` and ``__setattr__()``.) This is done both\n for efficiency reasons and because otherwise ``__setattr__()``\n would have no way to access other attributes of the instance. Note\n that at least for instance variables, you can fake total control by\n not inserting any values in the instance attribute dictionary (but\n instead inserting them in another object). See the\n ``__getattribute__()`` method below for a way to actually get total\n control in new-style classes.\n\nobject.__setattr__(self, name, value)\n\n Called when an attribute assignment is attempted. This is called\n instead of the normal mechanism (i.e. store the value in the\n instance dictionary). *name* is the attribute name, *value* is the\n value to be assigned to it.\n\n If ``__setattr__()`` wants to assign to an instance attribute, it\n should not simply execute ``self.name = value`` --- this would\n cause a recursive call to itself. Instead, it should insert the\n value in the dictionary of instance attributes, e.g.,\n ``self.__dict__[name] = value``. For new-style classes, rather\n than accessing the instance dictionary, it should call the base\n class method with the same name, for example,\n ``object.__setattr__(self, name, value)``.\n\nobject.__delattr__(self, name)\n\n Like ``__setattr__()`` but for attribute deletion instead of\n assignment. This should only be implemented if ``del obj.name`` is\n meaningful for the object.\n\n\nMore attribute access for new-style classes\n===========================================\n\nThe following methods only apply to new-style classes.\n\nobject.__getattribute__(self, name)\n\n Called unconditionally to implement attribute accesses for\n instances of the class. If the class also defines\n ``__getattr__()``, the latter will not be called unless\n ``__getattribute__()`` either calls it explicitly or raises an\n ``AttributeError``. This method should return the (computed)\n attribute value or raise an ``AttributeError`` exception. In order\n to avoid infinite recursion in this method, its implementation\n should always call the base class method with the same name to\n access any attributes it needs, for example,\n ``object.__getattribute__(self, name)``.\n\n\nImplementing Descriptors\n========================\n\nThe following methods only apply when an instance of the class\ncontaining the method (a so-called *descriptor* class) appears in the\nclass dictionary of another new-style class, known as the *owner*\nclass. In the examples below, "the attribute" refers to the attribute\nwhose name is the key of the property in the owner class\'\n``__dict__``. Descriptors can only be implemented as new-style\nclasses themselves.\n\nobject.__get__(self, instance, owner)\n\n Called to get the attribute of the owner class (class attribute\n access) or of an instance of that class (instance attribute\n access). *owner* is always the owner class, while *instance* is the\n instance that the attribute was accessed through, or ``None`` when\n the attribute is accessed through the *owner*. This method should\n return the (computed) attribute value or raise an\n ``AttributeError`` exception.\n\nobject.__set__(self, instance, value)\n\n Called to set the attribute on an instance *instance* of the owner\n class to a new value, *value*.\n\nobject.__delete__(self, instance)\n\n Called to delete the attribute on an instance *instance* of the\n owner class.\n\n\nInvoking Descriptors\n====================\n\nIn general, a descriptor is an object attribute with "binding\nbehavior", one whose attribute access has been overridden by methods\nin the descriptor protocol: ``__get__()``, ``__set__()``, and\n``__delete__()``. If any of those methods are defined for an object,\nit is said to be a descriptor.\n\nThe default behavior for attribute access is to get, set, or delete\nthe attribute from an object\'s dictionary. For instance, ``a.x`` has a\nlookup chain starting with ``a.__dict__[\'x\']``, then\n``type(a).__dict__[\'x\']``, and continuing through the base classes of\n``type(a)`` excluding metaclasses.\n\nHowever, if the looked-up value is an object defining one of the\ndescriptor methods, then Python may override the default behavior and\ninvoke the descriptor method instead. Where this occurs in the\nprecedence chain depends on which descriptor methods were defined and\nhow they were called. Note that descriptors are only invoked for new\nstyle objects or classes (ones that subclass ``object()`` or\n``type()``).\n\nThe starting point for descriptor invocation is a binding, ``a.x``.\nHow the arguments are assembled depends on ``a``:\n\nDirect Call\n The simplest and least common call is when user code directly\n invokes a descriptor method: ``x.__get__(a)``.\n\nInstance Binding\n If binding to a new-style object instance, ``a.x`` is transformed\n into the call: ``type(a).__dict__[\'x\'].__get__(a, type(a))``.\n\nClass Binding\n If binding to a new-style class, ``A.x`` is transformed into the\n call: ``A.__dict__[\'x\'].__get__(None, A)``.\n\nSuper Binding\n If ``a`` is an instance of ``super``, then the binding ``super(B,\n obj).m()`` searches ``obj.__class__.__mro__`` for the base class\n ``A`` immediately preceding ``B`` and then invokes the descriptor\n with the call: ``A.__dict__[\'m\'].__get__(obj, A)``.\n\nFor instance bindings, the precedence of descriptor invocation depends\non the which descriptor methods are defined. Normally, data\ndescriptors define both ``__get__()`` and ``__set__()``, while non-\ndata descriptors have just the ``__get__()`` method. Data descriptors\nalways override a redefinition in an instance dictionary. In\ncontrast, non-data descriptors can be overridden by instances. [3]\n\nPython methods (including ``staticmethod()`` and ``classmethod()``)\nare implemented as non-data descriptors. Accordingly, instances can\nredefine and override methods. This allows individual instances to\nacquire behaviors that differ from other instances of the same class.\n\nThe ``property()`` function is implemented as a data descriptor.\nAccordingly, instances cannot override the behavior of a property.\n\n\n__slots__\n=========\n\nBy default, instances of both old and new-style classes have a\ndictionary for attribute storage. This wastes space for objects\nhaving very few instance variables. The space consumption can become\nacute when creating large numbers of instances.\n\nThe default can be overridden by defining *__slots__* in a new-style\nclass definition. The *__slots__* declaration takes a sequence of\ninstance variables and reserves just enough space in each instance to\nhold a value for each variable. Space is saved because *__dict__* is\nnot created for each instance.\n\n__slots__\n\n This class variable can be assigned a string, iterable, or sequence\n of strings with variable names used by instances. If defined in a\n new-style class, *__slots__* reserves space for the declared\n variables and prevents the automatic creation of *__dict__* and\n *__weakref__* for each instance.\n\n Added in version 2.2.\n\nNotes on using *__slots__*\n\n* Without a *__dict__* variable, instances cannot be assigned new\n variables not listed in the *__slots__* definition. Attempts to\n assign to an unlisted variable name raises ``AttributeError``. If\n dynamic assignment of new variables is desired, then add\n ``\'__dict__\'`` to the sequence of strings in the *__slots__*\n declaration.\n\n Changed in version 2.3: Previously, adding ``\'__dict__\'`` to the\n *__slots__* declaration would not enable the assignment of new\n attributes not specifically listed in the sequence of instance\n variable names.\n\n* Without a *__weakref__* variable for each instance, classes defining\n *__slots__* do not support weak references to its instances. If weak\n reference support is needed, then add ``\'__weakref__\'`` to the\n sequence of strings in the *__slots__* declaration.\n\n Changed in version 2.3: Previously, adding ``\'__weakref__\'`` to the\n *__slots__* declaration would not enable support for weak\n references.\n\n* *__slots__* are implemented at the class level by creating\n descriptors (*Implementing Descriptors*) for each variable name. As\n a result, class attributes cannot be used to set default values for\n instance variables defined by *__slots__*; otherwise, the class\n attribute would overwrite the descriptor assignment.\n\n* If a class defines a slot also defined in a base class, the instance\n variable defined by the base class slot is inaccessible (except by\n retrieving its descriptor directly from the base class). This\n renders the meaning of the program undefined. In the future, a\n check may be added to prevent this.\n\n* The action of a *__slots__* declaration is limited to the class\n where it is defined. As a result, subclasses will have a *__dict__*\n unless they also define *__slots__*.\n\n* *__slots__* do not work for classes derived from "variable-length"\n built-in types such as ``long``, ``str`` and ``tuple``.\n\n* Any non-string iterable may be assigned to *__slots__*. Mappings may\n also be used; however, in the future, special meaning may be\n assigned to the values corresponding to each key.\n\n* *__class__* assignment works only if both classes have the same\n *__slots__*.\n\n Changed in version 2.6: Previously, *__class__* assignment raised an\n error if either new or old class had *__slots__*.\n', + 'attribute-access': u'\nCustomizing attribute access\n****************************\n\nThe following methods can be defined to customize the meaning of\nattribute access (use of, assignment to, or deletion of ``x.name``)\nfor class instances.\n\nobject.__getattr__(self, name)\n\n Called when an attribute lookup has not found the attribute in the\n usual places (i.e. it is not an instance attribute nor is it found\n in the class tree for ``self``). ``name`` is the attribute name.\n This method should return the (computed) attribute value or raise\n an ``AttributeError`` exception.\n\n Note that if the attribute is found through the normal mechanism,\n ``__getattr__()`` is not called. (This is an intentional asymmetry\n between ``__getattr__()`` and ``__setattr__()``.) This is done both\n for efficiency reasons and because otherwise ``__getattr__()``\n would have no way to access other attributes of the instance. Note\n that at least for instance variables, you can fake total control by\n not inserting any values in the instance attribute dictionary (but\n instead inserting them in another object). See the\n ``__getattribute__()`` method below for a way to actually get total\n control in new-style classes.\n\nobject.__setattr__(self, name, value)\n\n Called when an attribute assignment is attempted. This is called\n instead of the normal mechanism (i.e. store the value in the\n instance dictionary). *name* is the attribute name, *value* is the\n value to be assigned to it.\n\n If ``__setattr__()`` wants to assign to an instance attribute, it\n should not simply execute ``self.name = value`` --- this would\n cause a recursive call to itself. Instead, it should insert the\n value in the dictionary of instance attributes, e.g.,\n ``self.__dict__[name] = value``. For new-style classes, rather\n than accessing the instance dictionary, it should call the base\n class method with the same name, for example,\n ``object.__setattr__(self, name, value)``.\n\nobject.__delattr__(self, name)\n\n Like ``__setattr__()`` but for attribute deletion instead of\n assignment. This should only be implemented if ``del obj.name`` is\n meaningful for the object.\n\n\nMore attribute access for new-style classes\n===========================================\n\nThe following methods only apply to new-style classes.\n\nobject.__getattribute__(self, name)\n\n Called unconditionally to implement attribute accesses for\n instances of the class. If the class also defines\n ``__getattr__()``, the latter will not be called unless\n ``__getattribute__()`` either calls it explicitly or raises an\n ``AttributeError``. This method should return the (computed)\n attribute value or raise an ``AttributeError`` exception. In order\n to avoid infinite recursion in this method, its implementation\n should always call the base class method with the same name to\n access any attributes it needs, for example,\n ``object.__getattribute__(self, name)``.\n\n Note: This method may still be bypassed when looking up special methods\n as the result of implicit invocation via language syntax or\n builtin functions. See *Special method lookup for new-style\n classes*.\n\n\nImplementing Descriptors\n========================\n\nThe following methods only apply when an instance of the class\ncontaining the method (a so-called *descriptor* class) appears in the\nclass dictionary of another new-style class, known as the *owner*\nclass. In the examples below, "the attribute" refers to the attribute\nwhose name is the key of the property in the owner class\'\n``__dict__``. Descriptors can only be implemented as new-style\nclasses themselves.\n\nobject.__get__(self, instance, owner)\n\n Called to get the attribute of the owner class (class attribute\n access) or of an instance of that class (instance attribute\n access). *owner* is always the owner class, while *instance* is the\n instance that the attribute was accessed through, or ``None`` when\n the attribute is accessed through the *owner*. This method should\n return the (computed) attribute value or raise an\n ``AttributeError`` exception.\n\nobject.__set__(self, instance, value)\n\n Called to set the attribute on an instance *instance* of the owner\n class to a new value, *value*.\n\nobject.__delete__(self, instance)\n\n Called to delete the attribute on an instance *instance* of the\n owner class.\n\n\nInvoking Descriptors\n====================\n\nIn general, a descriptor is an object attribute with "binding\nbehavior", one whose attribute access has been overridden by methods\nin the descriptor protocol: ``__get__()``, ``__set__()``, and\n``__delete__()``. If any of those methods are defined for an object,\nit is said to be a descriptor.\n\nThe default behavior for attribute access is to get, set, or delete\nthe attribute from an object\'s dictionary. For instance, ``a.x`` has a\nlookup chain starting with ``a.__dict__[\'x\']``, then\n``type(a).__dict__[\'x\']``, and continuing through the base classes of\n``type(a)`` excluding metaclasses.\n\nHowever, if the looked-up value is an object defining one of the\ndescriptor methods, then Python may override the default behavior and\ninvoke the descriptor method instead. Where this occurs in the\nprecedence chain depends on which descriptor methods were defined and\nhow they were called. Note that descriptors are only invoked for new\nstyle objects or classes (ones that subclass ``object()`` or\n``type()``).\n\nThe starting point for descriptor invocation is a binding, ``a.x``.\nHow the arguments are assembled depends on ``a``:\n\nDirect Call\n The simplest and least common call is when user code directly\n invokes a descriptor method: ``x.__get__(a)``.\n\nInstance Binding\n If binding to a new-style object instance, ``a.x`` is transformed\n into the call: ``type(a).__dict__[\'x\'].__get__(a, type(a))``.\n\nClass Binding\n If binding to a new-style class, ``A.x`` is transformed into the\n call: ``A.__dict__[\'x\'].__get__(None, A)``.\n\nSuper Binding\n If ``a`` is an instance of ``super``, then the binding ``super(B,\n obj).m()`` searches ``obj.__class__.__mro__`` for the base class\n ``A`` immediately preceding ``B`` and then invokes the descriptor\n with the call: ``A.__dict__[\'m\'].__get__(obj, A)``.\n\nFor instance bindings, the precedence of descriptor invocation depends\non the which descriptor methods are defined. Normally, data\ndescriptors define both ``__get__()`` and ``__set__()``, while non-\ndata descriptors have just the ``__get__()`` method. Data descriptors\nalways override a redefinition in an instance dictionary. In\ncontrast, non-data descriptors can be overridden by instances. [2]\n\nPython methods (including ``staticmethod()`` and ``classmethod()``)\nare implemented as non-data descriptors. Accordingly, instances can\nredefine and override methods. This allows individual instances to\nacquire behaviors that differ from other instances of the same class.\n\nThe ``property()`` function is implemented as a data descriptor.\nAccordingly, instances cannot override the behavior of a property.\n\n\n__slots__\n=========\n\nBy default, instances of both old and new-style classes have a\ndictionary for attribute storage. This wastes space for objects\nhaving very few instance variables. The space consumption can become\nacute when creating large numbers of instances.\n\nThe default can be overridden by defining *__slots__* in a new-style\nclass definition. The *__slots__* declaration takes a sequence of\ninstance variables and reserves just enough space in each instance to\nhold a value for each variable. Space is saved because *__dict__* is\nnot created for each instance.\n\n__slots__\n\n This class variable can be assigned a string, iterable, or sequence\n of strings with variable names used by instances. If defined in a\n new-style class, *__slots__* reserves space for the declared\n variables and prevents the automatic creation of *__dict__* and\n *__weakref__* for each instance.\n\n New in version 2.2.\n\nNotes on using *__slots__*\n\n* When inheriting from a class without *__slots__*, the *__dict__*\n attribute of that class will always be accessible, so a *__slots__*\n definition in the subclass is meaningless.\n\n* Without a *__dict__* variable, instances cannot be assigned new\n variables not listed in the *__slots__* definition. Attempts to\n assign to an unlisted variable name raises ``AttributeError``. If\n dynamic assignment of new variables is desired, then add\n ``\'__dict__\'`` to the sequence of strings in the *__slots__*\n declaration.\n\n Changed in version 2.3: Previously, adding ``\'__dict__\'`` to the\n *__slots__* declaration would not enable the assignment of new\n attributes not specifically listed in the sequence of instance\n variable names.\n\n* Without a *__weakref__* variable for each instance, classes defining\n *__slots__* do not support weak references to its instances. If weak\n reference support is needed, then add ``\'__weakref__\'`` to the\n sequence of strings in the *__slots__* declaration.\n\n Changed in version 2.3: Previously, adding ``\'__weakref__\'`` to the\n *__slots__* declaration would not enable support for weak\n references.\n\n* *__slots__* are implemented at the class level by creating\n descriptors (*Implementing Descriptors*) for each variable name. As\n a result, class attributes cannot be used to set default values for\n instance variables defined by *__slots__*; otherwise, the class\n attribute would overwrite the descriptor assignment.\n\n* If a class defines a slot also defined in a base class, the instance\n variable defined by the base class slot is inaccessible (except by\n retrieving its descriptor directly from the base class). This\n renders the meaning of the program undefined. In the future, a\n check may be added to prevent this.\n\n* The action of a *__slots__* declaration is limited to the class\n where it is defined. As a result, subclasses will have a *__dict__*\n unless they also define *__slots__*.\n\n* *__slots__* do not work for classes derived from "variable-length"\n built-in types such as ``long``, ``str`` and ``tuple``.\n\n* Any non-string iterable may be assigned to *__slots__*. Mappings may\n also be used; however, in the future, special meaning may be\n assigned to the values corresponding to each key.\n\n* *__class__* assignment works only if both classes have the same\n *__slots__*.\n\n Changed in version 2.6: Previously, *__class__* assignment raised an\n error if either new or old class had *__slots__*.\n', 'attribute-references': u'\nAttribute references\n********************\n\nAn attribute reference is a primary followed by a period and a name:\n\n attributeref ::= primary "." identifier\n\nThe primary must evaluate to an object of a type that supports\nattribute references, e.g., a module, list, or an instance. This\nobject is then asked to produce the attribute whose name is the\nidentifier. If this attribute is not available, the exception\n``AttributeError`` is raised. Otherwise, the type and value of the\nobject produced is determined by the object. Multiple evaluations of\nthe same attribute reference may yield different objects.\n', - 'augassign': u'\nAugmented assignment statements\n*******************************\n\nAugmented assignment is the combination, in a single statement, of a\nbinary operation and an assignment statement:\n\n augmented_assignment_stmt ::= target augop (expression_list | yield_expression)\n augop ::= "+=" | "-=" | "*=" | "/=" | "%=" | "**="\n | ">>=" | "<<=" | "&=" | "^=" | "|="\n\n(See section *Primaries* for the syntax definitions for the last three\nsymbols.)\n\nAn augmented assignment evaluates the target (which, unlike normal\nassignment statements, cannot be an unpacking) and the expression\nlist, performs the binary operation specific to the type of assignment\non the two operands, and assigns the result to the original target.\nThe target is only evaluated once.\n\nAn augmented assignment expression like ``x += 1`` can be rewritten as\n``x = x + 1`` to achieve a similar, but not exactly equal effect. In\nthe augmented version, ``x`` is only evaluated once. Also, when\npossible, the actual operation is performed *in-place*, meaning that\nrather than creating a new object and assigning that to the target,\nthe old object is modified instead.\n\nWith the exception of assigning to tuples and multiple targets in a\nsingle statement, the assignment done by augmented assignment\nstatements is handled the same way as normal assignments. Similarly,\nwith the exception of the possible *in-place* behavior, the binary\noperation performed by augmented assignment is the same as the normal\nbinary operations.\n\nFor targets which are attribute references, the initial value is\nretrieved with a ``getattr()`` and the result is assigned with a\n``setattr()``. Notice that the two methods do not necessarily refer\nto the same variable. When ``getattr()`` refers to a class variable,\n``setattr()`` still writes to an instance variable. For example:\n\n class A:\n x = 3 # class variable\n a = A()\n a.x += 1 # writes a.x as 4 leaving A.x as 3\n', - 'binary': u'\nBinary arithmetic operations\n****************************\n\nThe binary arithmetic operations have the conventional priority\nlevels. Note that some of these operations also apply to certain non-\nnumeric types. Apart from the power operator, there are only two\nlevels, one for multiplicative operators and one for additive\noperators:\n\n m_expr ::= u_expr | m_expr "*" u_expr | m_expr "//" u_expr | m_expr "/" u_expr\n | m_expr "%" u_expr\n a_expr ::= m_expr | a_expr "+" m_expr | a_expr "-" m_expr\n\nThe ``*`` (multiplication) operator yields the product of its\narguments. The arguments must either both be numbers, or one argument\nmust be an integer (plain or long) and the other must be a sequence.\nIn the former case, the numbers are converted to a common type and\nthen multiplied together. In the latter case, sequence repetition is\nperformed; a negative repetition factor yields an empty sequence.\n\nThe ``/`` (division) and ``//`` (floor division) operators yield the\nquotient of their arguments. The numeric arguments are first\nconverted to a common type. Plain or long integer division yields an\ninteger of the same type; the result is that of mathematical division\nwith the \'floor\' function applied to the result. Division by zero\nraises the ``ZeroDivisionError`` exception.\n\nThe ``%`` (modulo) operator yields the remainder from the division of\nthe first argument by the second. The numeric arguments are first\nconverted to a common type. A zero right argument raises the\n``ZeroDivisionError`` exception. The arguments may be floating point\nnumbers, e.g., ``3.14%0.7`` equals ``0.34`` (since ``3.14`` equals\n``4*0.7 + 0.34``.) The modulo operator always yields a result with\nthe same sign as its second operand (or zero); the absolute value of\nthe result is strictly smaller than the absolute value of the second\noperand [2].\n\nThe integer division and modulo operators are connected by the\nfollowing identity: ``x == (x/y)*y + (x%y)``. Integer division and\nmodulo are also connected with the built-in function ``divmod()``:\n``divmod(x, y) == (x/y, x%y)``. These identities don\'t hold for\nfloating point numbers; there similar identities hold approximately\nwhere ``x/y`` is replaced by ``floor(x/y)`` or ``floor(x/y) - 1`` [3].\n\nIn addition to performing the modulo operation on numbers, the ``%``\noperator is also overloaded by string and unicode objects to perform\nstring formatting (also known as interpolation). The syntax for string\nformatting is described in the Python Library Reference, section\n*String Formatting Operations*.\n\nDeprecated in version 2.3: The floor division operator, the modulo\noperator, and the ``divmod()`` function are no longer defined for\ncomplex numbers. Instead, convert to a floating point number using\nthe ``abs()`` function if appropriate.\n\nThe ``+`` (addition) operator yields the sum of its arguments. The\narguments must either both be numbers or both sequences of the same\ntype. In the former case, the numbers are converted to a common type\nand then added together. In the latter case, the sequences are\nconcatenated.\n\nThe ``-`` (subtraction) operator yields the difference of its\narguments. The numeric arguments are first converted to a common\ntype.\n', + 'augassign': u'\nAugmented assignment statements\n*******************************\n\nAugmented assignment is the combination, in a single statement, of a\nbinary operation and an assignment statement:\n\n augmented_assignment_stmt ::= target augop (expression_list | yield_expression)\n augop ::= "+=" | "-=" | "*=" | "/=" | "//=" | "%=" | "**="\n | ">>=" | "<<=" | "&=" | "^=" | "|="\n\n(See section *Primaries* for the syntax definitions for the last three\nsymbols.)\n\nAn augmented assignment evaluates the target (which, unlike normal\nassignment statements, cannot be an unpacking) and the expression\nlist, performs the binary operation specific to the type of assignment\non the two operands, and assigns the result to the original target.\nThe target is only evaluated once.\n\nAn augmented assignment expression like ``x += 1`` can be rewritten as\n``x = x + 1`` to achieve a similar, but not exactly equal effect. In\nthe augmented version, ``x`` is only evaluated once. Also, when\npossible, the actual operation is performed *in-place*, meaning that\nrather than creating a new object and assigning that to the target,\nthe old object is modified instead.\n\nWith the exception of assigning to tuples and multiple targets in a\nsingle statement, the assignment done by augmented assignment\nstatements is handled the same way as normal assignments. Similarly,\nwith the exception of the possible *in-place* behavior, the binary\noperation performed by augmented assignment is the same as the normal\nbinary operations.\n\nFor targets which are attribute references, the initial value is\nretrieved with a ``getattr()`` and the result is assigned with a\n``setattr()``. Notice that the two methods do not necessarily refer\nto the same variable. When ``getattr()`` refers to a class variable,\n``setattr()`` still writes to an instance variable. For example:\n\n class A:\n x = 3 # class variable\n a = A()\n a.x += 1 # writes a.x as 4 leaving A.x as 3\n', + 'binary': u'\nBinary arithmetic operations\n****************************\n\nThe binary arithmetic operations have the conventional priority\nlevels. Note that some of these operations also apply to certain non-\nnumeric types. Apart from the power operator, there are only two\nlevels, one for multiplicative operators and one for additive\noperators:\n\n m_expr ::= u_expr | m_expr "*" u_expr | m_expr "//" u_expr | m_expr "/" u_expr\n | m_expr "%" u_expr\n a_expr ::= m_expr | a_expr "+" m_expr | a_expr "-" m_expr\n\nThe ``*`` (multiplication) operator yields the product of its\narguments. The arguments must either both be numbers, or one argument\nmust be an integer (plain or long) and the other must be a sequence.\nIn the former case, the numbers are converted to a common type and\nthen multiplied together. In the latter case, sequence repetition is\nperformed; a negative repetition factor yields an empty sequence.\n\nThe ``/`` (division) and ``//`` (floor division) operators yield the\nquotient of their arguments. The numeric arguments are first\nconverted to a common type. Plain or long integer division yields an\ninteger of the same type; the result is that of mathematical division\nwith the \'floor\' function applied to the result. Division by zero\nraises the ``ZeroDivisionError`` exception.\n\nThe ``%`` (modulo) operator yields the remainder from the division of\nthe first argument by the second. The numeric arguments are first\nconverted to a common type. A zero right argument raises the\n``ZeroDivisionError`` exception. The arguments may be floating point\nnumbers, e.g., ``3.14%0.7`` equals ``0.34`` (since ``3.14`` equals\n``4*0.7 + 0.34``.) The modulo operator always yields a result with\nthe same sign as its second operand (or zero); the absolute value of\nthe result is strictly smaller than the absolute value of the second\noperand [2].\n\nThe integer division and modulo operators are connected by the\nfollowing identity: ``x == (x/y)*y + (x%y)``. Integer division and\nmodulo are also connected with the built-in function ``divmod()``:\n``divmod(x, y) == (x/y, x%y)``. These identities don\'t hold for\nfloating point numbers; there similar identities hold approximately\nwhere ``x/y`` is replaced by ``floor(x/y)`` or ``floor(x/y) - 1`` [3].\n\nIn addition to performing the modulo operation on numbers, the ``%``\noperator is also overloaded by string and unicode objects to perform\nstring formatting (also known as interpolation). The syntax for string\nformatting is described in the Python Library Reference, section\n*String Formatting Operations*.\n\nDeprecated since version 2.3: The floor division operator, the modulo\noperator, and the ``divmod()`` function are no longer defined for\ncomplex numbers. Instead, convert to a floating point number using\nthe ``abs()`` function if appropriate.\n\nThe ``+`` (addition) operator yields the sum of its arguments. The\narguments must either both be numbers or both sequences of the same\ntype. In the former case, the numbers are converted to a common type\nand then added together. In the latter case, the sequences are\nconcatenated.\n\nThe ``-`` (subtraction) operator yields the difference of its\narguments. The numeric arguments are first converted to a common\ntype.\n', 'bitwise': u'\nBinary bitwise operations\n*************************\n\nEach of the three bitwise operations has a different priority level:\n\n and_expr ::= shift_expr | and_expr "&" shift_expr\n xor_expr ::= and_expr | xor_expr "^" and_expr\n or_expr ::= xor_expr | or_expr "|" xor_expr\n\nThe ``&`` operator yields the bitwise AND of its arguments, which must\nbe plain or long integers. The arguments are converted to a common\ntype.\n\nThe ``^`` operator yields the bitwise XOR (exclusive OR) of its\narguments, which must be plain or long integers. The arguments are\nconverted to a common type.\n\nThe ``|`` operator yields the bitwise (inclusive) OR of its arguments,\nwhich must be plain or long integers. The arguments are converted to\na common type.\n', 'bltin-code-objects': u'\nCode Objects\n************\n\nCode objects are used by the implementation to represent "pseudo-\ncompiled" executable Python code such as a function body. They differ\nfrom function objects because they don\'t contain a reference to their\nglobal execution environment. Code objects are returned by the built-\nin ``compile()`` function and can be extracted from function objects\nthrough their ``func_code`` attribute. See also the ``code`` module.\n\nA code object can be executed or evaluated by passing it (instead of a\nsource string) to the ``exec`` statement or the built-in ``eval()``\nfunction.\n\nSee *The standard type hierarchy* for more information.\n', 'bltin-ellipsis-object': u'\nThe Ellipsis Object\n*******************\n\nThis object is used by extended slice notation (see *Slicings*). It\nsupports no special operations. There is exactly one ellipsis object,\nnamed ``Ellipsis`` (a built-in name).\n\nIt is written as ``Ellipsis``.\n', - 'bltin-file-objects': u'\nFile Objects\n************\n\nFile objects are implemented using C\'s ``stdio`` package and can be\ncreated with the built-in ``open()`` function. File objects are also\nreturned by some other built-in functions and methods, such as\n``os.popen()`` and ``os.fdopen()`` and the ``makefile()`` method of\nsocket objects. Temporary files can be created using the ``tempfile``\nmodule, and high-level file operations such as copying, moving, and\ndeleting files and directories can be achieved with the ``shutil``\nmodule.\n\nWhen a file operation fails for an I/O-related reason, the exception\n``IOError`` is raised. This includes situations where the operation\nis not defined for some reason, like ``seek()`` on a tty device or\nwriting a file opened for reading.\n\nFiles have the following methods:\n\nfile.close()\n\n Close the file. A closed file cannot be read or written any more.\n Any operation which requires that the file be open will raise a\n ``ValueError`` after the file has been closed. Calling ``close()``\n more than once is allowed.\n\n As of Python 2.5, you can avoid having to call this method\n explicitly if you use the ``with`` statement. For example, the\n following code will automatically close *f* when the ``with`` block\n is exited:\n\n from __future__ import with_statement\n\n with open("hello.txt") as f:\n for line in f:\n print line\n\n In older versions of Python, you would have needed to do this to\n get the same effect:\n\n f = open("hello.txt")\n try:\n for line in f:\n print line\n finally:\n f.close()\n\n Note: Not all "file-like" types in Python support use as a context\n manager for the ``with`` statement. If your code is intended to\n work with any file-like object, you can use the function\n ``contextlib.closing()`` instead of using the object directly.\n\nfile.flush()\n\n Flush the internal buffer, like ``stdio``\'s ``fflush``. This may\n be a no-op on some file-like objects.\n\nfile.fileno()\n\n Return the integer "file descriptor" that is used by the underlying\n implementation to request I/O operations from the operating system.\n This can be useful for other, lower level interfaces that use file\n descriptors, such as the ``fcntl`` module or ``os.read()`` and\n friends.\n\n Note: File-like objects which do not have a real file descriptor should\n *not* provide this method!\n\nfile.isatty()\n\n Return ``True`` if the file is connected to a tty(-like) device,\n else ``False``.\n\n Note: If a file-like object is not associated with a real file, this\n method should *not* be implemented.\n\nfile.next()\n\n A file object is its own iterator, for example ``iter(f)`` returns\n *f* (unless *f* is closed). When a file is used as an iterator,\n typically in a ``for`` loop (for example, ``for line in f: print\n line``), the ``next()`` method is called repeatedly. This method\n returns the next input line, or raises ``StopIteration`` when EOF\n is hit when the file is open for reading (behavior is undefined\n when the file is open for writing). In order to make a ``for``\n loop the most efficient way of looping over the lines of a file (a\n very common operation), the ``next()`` method uses a hidden read-\n ahead buffer. As a consequence of using a read-ahead buffer,\n combining ``next()`` with other file methods (like ``readline()``)\n does not work right. However, using ``seek()`` to reposition the\n file to an absolute position will flush the read-ahead buffer.\n\n Added in version 2.3.\n\nfile.read([size])\n\n Read at most *size* bytes from the file (less if the read hits EOF\n before obtaining *size* bytes). If the *size* argument is negative\n or omitted, read all data until EOF is reached. The bytes are\n returned as a string object. An empty string is returned when EOF\n is encountered immediately. (For certain files, like ttys, it\n makes sense to continue reading after an EOF is hit.) Note that\n this method may call the underlying C function ``fread`` more than\n once in an effort to acquire as close to *size* bytes as possible.\n Also note that when in non-blocking mode, less data than what was\n requested may be returned, even if no *size* parameter was given.\n\nfile.readline([size])\n\n Read one entire line from the file. A trailing newline character\n is kept in the string (but may be absent when a file ends with an\n incomplete line). [6] If the *size* argument is present and non-\n negative, it is a maximum byte count (including the trailing\n newline) and an incomplete line may be returned. An empty string is\n returned *only* when EOF is encountered immediately.\n\n Note: Unlike ``stdio``\'s ``fgets``, the returned string contains null\n characters (``\'\\0\'``) if they occurred in the input.\n\nfile.readlines([sizehint])\n\n Read until EOF using ``readline()`` and return a list containing\n the lines thus read. If the optional *sizehint* argument is\n present, instead of reading up to EOF, whole lines totalling\n approximately *sizehint* bytes (possibly after rounding up to an\n internal buffer size) are read. Objects implementing a file-like\n interface may choose to ignore *sizehint* if it cannot be\n implemented, or cannot be implemented efficiently.\n\nfile.xreadlines()\n\n This method returns the same thing as ``iter(f)``.\n\n Added in version 2.1.\n\n Deprecated in version 2.3: Use ``for line in file`` instead.\n\nfile.seek(offset[, whence])\n\n Set the file\'s current position, like ``stdio``\'s ``fseek``. The\n *whence* argument is optional and defaults to ``os.SEEK_SET`` or\n ``0`` (absolute file positioning); other values are ``os.SEEK_CUR``\n or ``1`` (seek relative to the current position) and\n ``os.SEEK_END`` or ``2`` (seek relative to the file\'s end). There\n is no return value.\n\n For example, ``f.seek(2, os.SEEK_CUR)`` advances the position by\n two and ``f.seek(-3, os.SEEK_END)`` sets the position to the third\n to last.\n\n Note that if the file is opened for appending (mode ``\'a\'`` or\n ``\'a+\'``), any ``seek()`` operations will be undone at the next\n write. If the file is only opened for writing in append mode (mode\n ``\'a\'``), this method is essentially a no-op, but it remains useful\n for files opened in append mode with reading enabled (mode\n ``\'a+\'``). If the file is opened in text mode (without ``\'b\'``),\n only offsets returned by ``tell()`` are legal. Use of other\n offsets causes undefined behavior.\n\n Note that not all file objects are seekable.\n\n Changed in version 2.6: Passing float values as offset has been\n deprecated.\n\nfile.tell()\n\n Return the file\'s current position, like ``stdio``\'s ``ftell``.\n\n Note: On Windows, ``tell()`` can return illegal values (after an\n ``fgets``) when reading files with Unix-style line-endings. Use\n binary mode (``\'rb\'``) to circumvent this problem.\n\nfile.truncate([size])\n\n Truncate the file\'s size. If the optional *size* argument is\n present, the file is truncated to (at most) that size. The size\n defaults to the current position. The current file position is not\n changed. Note that if a specified size exceeds the file\'s current\n size, the result is platform-dependent: possibilities include that\n the file may remain unchanged, increase to the specified size as if\n zero-filled, or increase to the specified size with undefined new\n content. Availability: Windows, many Unix variants.\n\nfile.write(str)\n\n Write a string to the file. There is no return value. Due to\n buffering, the string may not actually show up in the file until\n the ``flush()`` or ``close()`` method is called.\n\nfile.writelines(sequence)\n\n Write a sequence of strings to the file. The sequence can be any\n iterable object producing strings, typically a list of strings.\n There is no return value. (The name is intended to match\n ``readlines()``; ``writelines()`` does not add line separators.)\n\nFiles support the iterator protocol. Each iteration returns the same\nresult as ``file.readline()``, and iteration ends when the\n``readline()`` method returns an empty string.\n\nFile objects also offer a number of other interesting attributes.\nThese are not required for file-like objects, but should be\nimplemented if they make sense for the particular object.\n\nfile.closed\n\n bool indicating the current state of the file object. This is a\n read-only attribute; the ``close()`` method changes the value. It\n may not be available on all file-like objects.\n\nfile.encoding\n\n The encoding that this file uses. When Unicode strings are written\n to a file, they will be converted to byte strings using this\n encoding. In addition, when the file is connected to a terminal,\n the attribute gives the encoding that the terminal is likely to use\n (that information might be incorrect if the user has misconfigured\n the terminal). The attribute is read-only and may not be present\n on all file-like objects. It may also be ``None``, in which case\n the file uses the system default encoding for converting Unicode\n strings.\n\n Added in version 2.3.\n\nfile.errors\n\n The Unicode error handler used to along with the encoding.\n\n Added in version 2.6.\n\nfile.mode\n\n The I/O mode for the file. If the file was created using the\n ``open()`` built-in function, this will be the value of the *mode*\n parameter. This is a read-only attribute and may not be present on\n all file-like objects.\n\nfile.name\n\n If the file object was created using ``open()``, the name of the\n file. Otherwise, some string that indicates the source of the file\n object, of the form ``<...>``. This is a read-only attribute and\n may not be present on all file-like objects.\n\nfile.newlines\n\n If Python was built with the *--with-universal-newlines* option to\n **configure** (the default) this read-only attribute exists, and\n for files opened in universal newline read mode it keeps track of\n the types of newlines encountered while reading the file. The\n values it can take are ``\'\\r\'``, ``\'\\n\'``, ``\'\\r\\n\'``, ``None``\n (unknown, no newlines read yet) or a tuple containing all the\n newline types seen, to indicate that multiple newline conventions\n were encountered. For files not opened in universal newline read\n mode the value of this attribute will be ``None``.\n\nfile.softspace\n\n Boolean that indicates whether a space character needs to be\n printed before another value when using the ``print`` statement.\n Classes that are trying to simulate a file object should also have\n a writable ``softspace`` attribute, which should be initialized to\n zero. This will be automatic for most classes implemented in\n Python (care may be needed for objects that override attribute\n access); types implemented in C will have to provide a writable\n ``softspace`` attribute.\n\n Note: This attribute is not used to control the ``print`` statement,\n but to allow the implementation of ``print`` to keep track of its\n internal state.\n', + 'bltin-file-objects': u'\nFile Objects\n************\n\nFile objects are implemented using C\'s ``stdio`` package and can be\ncreated with the built-in ``open()`` function. File objects are also\nreturned by some other built-in functions and methods, such as\n``os.popen()`` and ``os.fdopen()`` and the ``makefile()`` method of\nsocket objects. Temporary files can be created using the ``tempfile``\nmodule, and high-level file operations such as copying, moving, and\ndeleting files and directories can be achieved with the ``shutil``\nmodule.\n\nWhen a file operation fails for an I/O-related reason, the exception\n``IOError`` is raised. This includes situations where the operation\nis not defined for some reason, like ``seek()`` on a tty device or\nwriting a file opened for reading.\n\nFiles have the following methods:\n\nfile.close()\n\n Close the file. A closed file cannot be read or written any more.\n Any operation which requires that the file be open will raise a\n ``ValueError`` after the file has been closed. Calling ``close()``\n more than once is allowed.\n\n As of Python 2.5, you can avoid having to call this method\n explicitly if you use the ``with`` statement. For example, the\n following code will automatically close *f* when the ``with`` block\n is exited:\n\n from __future__ import with_statement # This isn\'t required in Python 2.6\n\n with open("hello.txt") as f:\n for line in f:\n print line\n\n In older versions of Python, you would have needed to do this to\n get the same effect:\n\n f = open("hello.txt")\n try:\n for line in f:\n print line\n finally:\n f.close()\n\n Note: Not all "file-like" types in Python support use as a context\n manager for the ``with`` statement. If your code is intended to\n work with any file-like object, you can use the function\n ``contextlib.closing()`` instead of using the object directly.\n\nfile.flush()\n\n Flush the internal buffer, like ``stdio``\'s ``fflush``. This may\n be a no-op on some file-like objects.\n\nfile.fileno()\n\n Return the integer "file descriptor" that is used by the underlying\n implementation to request I/O operations from the operating system.\n This can be useful for other, lower level interfaces that use file\n descriptors, such as the ``fcntl`` module or ``os.read()`` and\n friends.\n\n Note: File-like objects which do not have a real file descriptor should\n *not* provide this method!\n\nfile.isatty()\n\n Return ``True`` if the file is connected to a tty(-like) device,\n else ``False``.\n\n Note: If a file-like object is not associated with a real file, this\n method should *not* be implemented.\n\nfile.next()\n\n A file object is its own iterator, for example ``iter(f)`` returns\n *f* (unless *f* is closed). When a file is used as an iterator,\n typically in a ``for`` loop (for example, ``for line in f: print\n line``), the ``next()`` method is called repeatedly. This method\n returns the next input line, or raises ``StopIteration`` when EOF\n is hit when the file is open for reading (behavior is undefined\n when the file is open for writing). In order to make a ``for``\n loop the most efficient way of looping over the lines of a file (a\n very common operation), the ``next()`` method uses a hidden read-\n ahead buffer. As a consequence of using a read-ahead buffer,\n combining ``next()`` with other file methods (like ``readline()``)\n does not work right. However, using ``seek()`` to reposition the\n file to an absolute position will flush the read-ahead buffer.\n\n New in version 2.3.\n\nfile.read([size])\n\n Read at most *size* bytes from the file (less if the read hits EOF\n before obtaining *size* bytes). If the *size* argument is negative\n or omitted, read all data until EOF is reached. The bytes are\n returned as a string object. An empty string is returned when EOF\n is encountered immediately. (For certain files, like ttys, it\n makes sense to continue reading after an EOF is hit.) Note that\n this method may call the underlying C function ``fread`` more than\n once in an effort to acquire as close to *size* bytes as possible.\n Also note that when in non-blocking mode, less data than was\n requested may be returned, even if no *size* parameter was given.\n\n Note: This function is simply a wrapper for the underlying ``fread`` C\n function, and will behave the same in corner cases, such as\n whether the EOF value is cached.\n\nfile.readline([size])\n\n Read one entire line from the file. A trailing newline character\n is kept in the string (but may be absent when a file ends with an\n incomplete line). [6] If the *size* argument is present and non-\n negative, it is a maximum byte count (including the trailing\n newline) and an incomplete line may be returned. An empty string is\n returned *only* when EOF is encountered immediately.\n\n Note: Unlike ``stdio``\'s ``fgets``, the returned string contains null\n characters (``\'\\0\'``) if they occurred in the input.\n\nfile.readlines([sizehint])\n\n Read until EOF using ``readline()`` and return a list containing\n the lines thus read. If the optional *sizehint* argument is\n present, instead of reading up to EOF, whole lines totalling\n approximately *sizehint* bytes (possibly after rounding up to an\n internal buffer size) are read. Objects implementing a file-like\n interface may choose to ignore *sizehint* if it cannot be\n implemented, or cannot be implemented efficiently.\n\nfile.xreadlines()\n\n This method returns the same thing as ``iter(f)``.\n\n New in version 2.1.\n\n Deprecated since version 2.3: Use ``for line in file`` instead.\n\nfile.seek(offset[, whence])\n\n Set the file\'s current position, like ``stdio``\'s ``fseek``. The\n *whence* argument is optional and defaults to ``os.SEEK_SET`` or\n ``0`` (absolute file positioning); other values are ``os.SEEK_CUR``\n or ``1`` (seek relative to the current position) and\n ``os.SEEK_END`` or ``2`` (seek relative to the file\'s end). There\n is no return value.\n\n For example, ``f.seek(2, os.SEEK_CUR)`` advances the position by\n two and ``f.seek(-3, os.SEEK_END)`` sets the position to the third\n to last.\n\n Note that if the file is opened for appending (mode ``\'a\'`` or\n ``\'a+\'``), any ``seek()`` operations will be undone at the next\n write. If the file is only opened for writing in append mode (mode\n ``\'a\'``), this method is essentially a no-op, but it remains useful\n for files opened in append mode with reading enabled (mode\n ``\'a+\'``). If the file is opened in text mode (without ``\'b\'``),\n only offsets returned by ``tell()`` are legal. Use of other\n offsets causes undefined behavior.\n\n Note that not all file objects are seekable.\n\n Changed in version 2.6: Passing float values as offset has been\n deprecated.\n\nfile.tell()\n\n Return the file\'s current position, like ``stdio``\'s ``ftell``.\n\n Note: On Windows, ``tell()`` can return illegal values (after an\n ``fgets``) when reading files with Unix-style line-endings. Use\n binary mode (``\'rb\'``) to circumvent this problem.\n\nfile.truncate([size])\n\n Truncate the file\'s size. If the optional *size* argument is\n present, the file is truncated to (at most) that size. The size\n defaults to the current position. The current file position is not\n changed. Note that if a specified size exceeds the file\'s current\n size, the result is platform-dependent: possibilities include that\n the file may remain unchanged, increase to the specified size as if\n zero-filled, or increase to the specified size with undefined new\n content. Availability: Windows, many Unix variants.\n\nfile.write(str)\n\n Write a string to the file. There is no return value. Due to\n buffering, the string may not actually show up in the file until\n the ``flush()`` or ``close()`` method is called.\n\nfile.writelines(sequence)\n\n Write a sequence of strings to the file. The sequence can be any\n iterable object producing strings, typically a list of strings.\n There is no return value. (The name is intended to match\n ``readlines()``; ``writelines()`` does not add line separators.)\n\nFiles support the iterator protocol. Each iteration returns the same\nresult as ``file.readline()``, and iteration ends when the\n``readline()`` method returns an empty string.\n\nFile objects also offer a number of other interesting attributes.\nThese are not required for file-like objects, but should be\nimplemented if they make sense for the particular object.\n\nfile.closed\n\n bool indicating the current state of the file object. This is a\n read-only attribute; the ``close()`` method changes the value. It\n may not be available on all file-like objects.\n\nfile.encoding\n\n The encoding that this file uses. When Unicode strings are written\n to a file, they will be converted to byte strings using this\n encoding. In addition, when the file is connected to a terminal,\n the attribute gives the encoding that the terminal is likely to use\n (that information might be incorrect if the user has misconfigured\n the terminal). The attribute is read-only and may not be present\n on all file-like objects. It may also be ``None``, in which case\n the file uses the system default encoding for converting Unicode\n strings.\n\n New in version 2.3.\n\nfile.errors\n\n The Unicode error handler used along with the encoding.\n\n New in version 2.6.\n\nfile.mode\n\n The I/O mode for the file. If the file was created using the\n ``open()`` built-in function, this will be the value of the *mode*\n parameter. This is a read-only attribute and may not be present on\n all file-like objects.\n\nfile.name\n\n If the file object was created using ``open()``, the name of the\n file. Otherwise, some string that indicates the source of the file\n object, of the form ``<...>``. This is a read-only attribute and\n may not be present on all file-like objects.\n\nfile.newlines\n\n If Python was built with the *--with-universal-newlines* option to\n **configure** (the default) this read-only attribute exists, and\n for files opened in universal newline read mode it keeps track of\n the types of newlines encountered while reading the file. The\n values it can take are ``\'\\r\'``, ``\'\\n\'``, ``\'\\r\\n\'``, ``None``\n (unknown, no newlines read yet) or a tuple containing all the\n newline types seen, to indicate that multiple newline conventions\n were encountered. For files not opened in universal newline read\n mode the value of this attribute will be ``None``.\n\nfile.softspace\n\n Boolean that indicates whether a space character needs to be\n printed before another value when using the ``print`` statement.\n Classes that are trying to simulate a file object should also have\n a writable ``softspace`` attribute, which should be initialized to\n zero. This will be automatic for most classes implemented in\n Python (care may be needed for objects that override attribute\n access); types implemented in C will have to provide a writable\n ``softspace`` attribute.\n\n Note: This attribute is not used to control the ``print`` statement,\n but to allow the implementation of ``print`` to keep track of its\n internal state.\n', 'bltin-null-object': u"\nThe Null Object\n***************\n\nThis object is returned by functions that don't explicitly return a\nvalue. It supports no special operations. There is exactly one null\nobject, named ``None`` (a built-in name).\n\nIt is written as ``None``.\n", 'bltin-type-objects': u"\nType Objects\n************\n\nType objects represent the various object types. An object's type is\naccessed by the built-in function ``type()``. There are no special\noperations on types. The standard module ``types`` defines names for\nall standard built-in types.\n\nTypes are written like this: ````.\n", - 'booleans': u'\nBoolean operations\n******************\n\nBoolean operations have the lowest priority of all Python operations:\n\n expression ::= conditional_expression | lambda_form\n old_expression ::= or_test | old_lambda_form\n conditional_expression ::= or_test ["if" or_test "else" expression]\n or_test ::= and_test | or_test "or" and_test\n and_test ::= not_test | and_test "and" not_test\n not_test ::= comparison | "not" not_test\n\nIn the context of Boolean operations, and also when expressions are\nused by control flow statements, the following values are interpreted\nas false: ``False``, ``None``, numeric zero of all types, and empty\nstrings and containers (including strings, tuples, lists,\ndictionaries, sets and frozensets). All other values are interpreted\nas true.\n\nThe operator ``not`` yields ``True`` if its argument is false,\n``False`` otherwise.\n\nThe expression ``x if C else y`` first evaluates *C* (*not* *x*); if\n*C* is true, *x* is evaluated and its value is returned; otherwise,\n*y* is evaluated and its value is returned.\n\nAdded in version 2.5.\n\nThe expression ``x and y`` first evaluates *x*; if *x* is false, its\nvalue is returned; otherwise, *y* is evaluated and the resulting value\nis returned.\n\nThe expression ``x or y`` first evaluates *x*; if *x* is true, its\nvalue is returned; otherwise, *y* is evaluated and the resulting value\nis returned.\n\n(Note that neither ``and`` nor ``or`` restrict the value and type they\nreturn to ``False`` and ``True``, but rather return the last evaluated\nargument. This is sometimes useful, e.g., if ``s`` is a string that\nshould be replaced by a default value if it is empty, the expression\n``s or \'foo\'`` yields the desired value. Because ``not`` has to\ninvent a value anyway, it does not bother to return a value of the\nsame type as its argument, so e.g., ``not \'foo\'`` yields ``False``,\nnot ``\'\'``.)\n', + 'booleans': u'\nBoolean operations\n******************\n\nBoolean operations have the lowest priority of all Python operations:\n\n expression ::= conditional_expression | lambda_form\n old_expression ::= or_test | old_lambda_form\n conditional_expression ::= or_test ["if" or_test "else" expression]\n or_test ::= and_test | or_test "or" and_test\n and_test ::= not_test | and_test "and" not_test\n not_test ::= comparison | "not" not_test\n\nIn the context of Boolean operations, and also when expressions are\nused by control flow statements, the following values are interpreted\nas false: ``False``, ``None``, numeric zero of all types, and empty\nstrings and containers (including strings, tuples, lists,\ndictionaries, sets and frozensets). All other values are interpreted\nas true. (See the ``__nonzero__()`` special method for a way to\nchange this.)\n\nThe operator ``not`` yields ``True`` if its argument is false,\n``False`` otherwise.\n\nThe expression ``x if C else y`` first evaluates *C* (*not* *x*); if\n*C* is true, *x* is evaluated and its value is returned; otherwise,\n*y* is evaluated and its value is returned.\n\nNew in version 2.5.\n\nThe expression ``x and y`` first evaluates *x*; if *x* is false, its\nvalue is returned; otherwise, *y* is evaluated and the resulting value\nis returned.\n\nThe expression ``x or y`` first evaluates *x*; if *x* is true, its\nvalue is returned; otherwise, *y* is evaluated and the resulting value\nis returned.\n\n(Note that neither ``and`` nor ``or`` restrict the value and type they\nreturn to ``False`` and ``True``, but rather return the last evaluated\nargument. This is sometimes useful, e.g., if ``s`` is a string that\nshould be replaced by a default value if it is empty, the expression\n``s or \'foo\'`` yields the desired value. Because ``not`` has to\ninvent a value anyway, it does not bother to return a value of the\nsame type as its argument, so e.g., ``not \'foo\'`` yields ``False``,\nnot ``\'\'``.)\n', 'break': u'\nThe ``break`` statement\n***********************\n\n break_stmt ::= "break"\n\n``break`` may only occur syntactically nested in a ``for`` or\n``while`` loop, but not nested in a function or class definition\nwithin that loop.\n\nIt terminates the nearest enclosing loop, skipping the optional\n``else`` clause if the loop has one.\n\nIf a ``for`` loop is terminated by ``break``, the loop control target\nkeeps its current value.\n\nWhen ``break`` passes control out of a ``try`` statement with a\n``finally`` clause, that ``finally`` clause is executed before really\nleaving the loop.\n', 'callable-types': u'\nEmulating callable objects\n**************************\n\nobject.__call__(self[, args...])\n\n Called when the instance is "called" as a function; if this method\n is defined, ``x(arg1, arg2, ...)`` is a shorthand for\n ``x.__call__(arg1, arg2, ...)``.\n', - 'calls': u'\nCalls\n*****\n\nA call calls a callable object (e.g., a function) with a possibly\nempty series of arguments:\n\n call ::= primary "(" [argument_list [","]\n | expression genexpr_for] ")"\n argument_list ::= positional_arguments ["," keyword_arguments]\n ["," "*" expression]\n ["," "**" expression]\n | keyword_arguments ["," "*" expression]\n ["," "**" expression]\n | "*" expression ["," "**" expression]\n | "**" expression\n positional_arguments ::= expression ("," expression)*\n keyword_arguments ::= keyword_item ("," keyword_item)*\n keyword_item ::= identifier "=" expression\n\nA trailing comma may be present after the positional and keyword\narguments but does not affect the semantics.\n\nThe primary must evaluate to a callable object (user-defined\nfunctions, built-in functions, methods of built-in objects, class\nobjects, methods of class instances, and certain class instances\nthemselves are callable; extensions may define additional callable\nobject types). All argument expressions are evaluated before the call\nis attempted. Please refer to section *Function definitions* for the\nsyntax of formal parameter lists.\n\nIf keyword arguments are present, they are first converted to\npositional arguments, as follows. First, a list of unfilled slots is\ncreated for the formal parameters. If there are N positional\narguments, they are placed in the first N slots. Next, for each\nkeyword argument, the identifier is used to determine the\ncorresponding slot (if the identifier is the same as the first formal\nparameter name, the first slot is used, and so on). If the slot is\nalready filled, a ``TypeError`` exception is raised. Otherwise, the\nvalue of the argument is placed in the slot, filling it (even if the\nexpression is ``None``, it fills the slot). When all arguments have\nbeen processed, the slots that are still unfilled are filled with the\ncorresponding default value from the function definition. (Default\nvalues are calculated, once, when the function is defined; thus, a\nmutable object such as a list or dictionary used as default value will\nbe shared by all calls that don\'t specify an argument value for the\ncorresponding slot; this should usually be avoided.) If there are any\nunfilled slots for which no default value is specified, a\n``TypeError`` exception is raised. Otherwise, the list of filled\nslots is used as the argument list for the call.\n\nNote: An implementation may provide builtin functions whose positional\n parameters do not have names, even if they are \'named\' for the\n purpose of documentation, and which therefore cannot be supplied by\n keyword. In CPython, this is the case for functions implemented in\n C that use ``PyArg_ParseTuple`` to parse their arguments.\n\nIf there are more positional arguments than there are formal parameter\nslots, a ``TypeError`` exception is raised, unless a formal parameter\nusing the syntax ``*identifier`` is present; in this case, that formal\nparameter receives a tuple containing the excess positional arguments\n(or an empty tuple if there were no excess positional arguments).\n\nIf any keyword argument does not correspond to a formal parameter\nname, a ``TypeError`` exception is raised, unless a formal parameter\nusing the syntax ``**identifier`` is present; in this case, that\nformal parameter receives a dictionary containing the excess keyword\narguments (using the keywords as keys and the argument values as\ncorresponding values), or a (new) empty dictionary if there were no\nexcess keyword arguments.\n\nIf the syntax ``*expression`` appears in the function call,\n``expression`` must evaluate to a sequence. Elements from this\nsequence are treated as if they were additional positional arguments;\nif there are positional arguments *x1*,...,*xN* , and ``expression``\nevaluates to a sequence *y1*,...,*yM*, this is equivalent to a call\nwith M+N positional arguments *x1*,...,*xN*,*y1*,...,*yM*.\n\nA consequence of this is that although the ``*expression`` syntax\nappears *after* any keyword arguments, it is processed *before* the\nkeyword arguments (and the ``**expression`` argument, if any -- see\nbelow). So:\n\n >>> def f(a, b):\n ... print a, b\n ...\n >>> f(b=1, *(2,))\n 2 1\n >>> f(a=1, *(2,))\n Traceback (most recent call last):\n File "", line 1, in ?\n TypeError: f() got multiple values for keyword argument \'a\'\n >>> f(1, *(2,))\n 1 2\n\nIt is unusual for both keyword arguments and the ``*expression``\nsyntax to be used in the same call, so in practice this confusion does\nnot arise.\n\nIf the syntax ``**expression`` appears in the function call,\n``expression`` must evaluate to a mapping, the contents of which are\ntreated as additional keyword arguments. In the case of a keyword\nappearing in both ``expression`` and as an explicit keyword argument,\na ``TypeError`` exception is raised.\n\nFormal parameters using the syntax ``*identifier`` or ``**identifier``\ncannot be used as positional argument slots or as keyword argument\nnames. Formal parameters using the syntax ``(sublist)`` cannot be\nused as keyword argument names; the outermost sublist corresponds to a\nsingle unnamed argument slot, and the argument value is assigned to\nthe sublist using the usual tuple assignment rules after all other\nparameter processing is done.\n\nA call always returns some value, possibly ``None``, unless it raises\nan exception. How this value is computed depends on the type of the\ncallable object.\n\nIf it is---\n\na user-defined function:\n The code block for the function is executed, passing it the\n argument list. The first thing the code block will do is bind the\n formal parameters to the arguments; this is described in section\n *Function definitions*. When the code block executes a ``return``\n statement, this specifies the return value of the function call.\n\na built-in function or method:\n The result is up to the interpreter; see *Built-in Functions* for\n the descriptions of built-in functions and methods.\n\na class object:\n A new instance of that class is returned.\n\na class instance method:\n The corresponding user-defined function is called, with an argument\n list that is one longer than the argument list of the call: the\n instance becomes the first argument.\n\na class instance:\n The class must define a ``__call__()`` method; the effect is then\n the same as if that method was called.\n', - 'class': u'\nClass definitions\n*****************\n\nA class definition defines a class object (see section *The standard\ntype hierarchy*):\n\n classdef ::= "class" classname [inheritance] ":" suite\n inheritance ::= "(" [expression_list] ")"\n classname ::= identifier\n\nA class definition is an executable statement. It first evaluates the\ninheritance list, if present. Each item in the inheritance list\nshould evaluate to a class object or class type which allows\nsubclassing. The class\'s suite is then executed in a new execution\nframe (see section *Naming and binding*), using a newly created local\nnamespace and the original global namespace. (Usually, the suite\ncontains only function definitions.) When the class\'s suite finishes\nexecution, its execution frame is discarded but its local namespace is\nsaved. A class object is then created using the inheritance list for\nthe base classes and the saved local namespace for the attribute\ndictionary. The class name is bound to this class object in the\noriginal local namespace.\n\n**Programmer\'s note:** Variables defined in the class definition are\nclass variables; they are shared by all instances. To create instance\nvariables, they can be set in a method with ``self.name = value``.\nBoth class and instance variables are accessible through the notation\n"``self.name``", and an instance variable hides a class variable with\nthe same name when accessed in this way. Class variables can be used\nas defaults for instance variables, but using mutable values there can\nlead to unexpected results. For *new-style class*es, descriptors can\nbe used to create instance variables with different implementation\ndetails.\n\nClass definitions, like function definitions, may be wrapped by one or\nmore *decorator* expressions. The evaluation rules for the decorator\nexpressions are the same as for functions. The result must be a class\nobject, which is then bound to the class name.\n\n-[ Footnotes ]-\n\n[1] The exception is propagated to the invocation stack only if there\n is no ``finally`` clause that negates the exception.\n\n[2] Currently, control "flows off the end" except in the case of an\n exception or the execution of a ``return``, ``continue``, or\n ``break`` statement.\n', - 'coercion-rules': u"\nCoercion rules\n**************\n\nThis section used to document the rules for coercion. As the language\nhas evolved, the coercion rules have become hard to document\nprecisely; documenting what one version of one particular\nimplementation does is undesirable. Instead, here are some informal\nguidelines regarding coercion. In Python 3.0, coercion will not be\nsupported.\n\n* If the left operand of a % operator is a string or Unicode object,\n no coercion takes place and the string formatting operation is\n invoked instead.\n\n* It is no longer recommended to define a coercion operation. Mixed-\n mode operations on types that don't define coercion pass the\n original arguments to the operation.\n\n* New-style classes (those derived from ``object``) never invoke the\n ``__coerce__()`` method in response to a binary operator; the only\n time ``__coerce__()`` is invoked is when the built-in function\n ``coerce()`` is called.\n\n* For most intents and purposes, an operator that returns\n ``NotImplemented`` is treated the same as one that is not\n implemented at all.\n\n* Below, ``__op__()`` and ``__rop__()`` are used to signify the\n generic method names corresponding to an operator; ``__iop__()`` is\n used for the corresponding in-place operator. For example, for the\n operator '``+``', ``__add__()`` and ``__radd__()`` are used for the\n left and right variant of the binary operator, and ``__iadd__()``\n for the in-place variant.\n\n* For objects *x* and *y*, first ``x.__op__(y)`` is tried. If this is\n not implemented or returns ``NotImplemented``, ``y.__rop__(x)`` is\n tried. If this is also not implemented or returns\n ``NotImplemented``, a ``TypeError`` exception is raised. But see\n the following exception:\n\n* Exception to the previous item: if the left operand is an instance\n of a built-in type or a new-style class, and the right operand is an\n instance of a proper subclass of that type or class and overrides\n the base's ``__rop__()`` method, the right operand's ``__rop__()``\n method is tried *before* the left operand's ``__op__()`` method.\n\n This is done so that a subclass can completely override binary\n operators. Otherwise, the left operand's ``__op__()`` method would\n always accept the right operand: when an instance of a given class\n is expected, an instance of a subclass of that class is always\n acceptable.\n\n* When either operand type defines a coercion, this coercion is called\n before that type's ``__op__()`` or ``__rop__()`` method is called,\n but no sooner. If the coercion returns an object of a different\n type for the operand whose coercion is invoked, part of the process\n is redone using the new object.\n\n* When an in-place operator (like '``+=``') is used, if the left\n operand implements ``__iop__()``, it is invoked without any\n coercion. When the operation falls back to ``__op__()`` and/or\n ``__rop__()``, the normal coercion rules apply.\n\n* In *x*``+``*y*, if *x* is a sequence that implements sequence\n concatenation, sequence concatenation is invoked.\n\n* In *x*``*``*y*, if one operator is a sequence that implements\n sequence repetition, and the other is an integer (``int`` or\n ``long``), sequence repetition is invoked.\n\n* Rich comparisons (implemented by methods ``__eq__()`` and so on)\n never use coercion. Three-way comparison (implemented by\n ``__cmp__()``) does use coercion under the same conditions as other\n binary operations use it.\n\n* In the current implementation, the built-in numeric types ``int``,\n ``long`` and ``float`` do not use coercion; the type ``complex``\n however does use it. The difference can become apparent when\n subclassing these types. Over time, the type ``complex`` may be\n fixed to avoid coercion. All these types implement a\n ``__coerce__()`` method, for use by the built-in ``coerce()``\n function.\n", - 'comparisons': u'\nComparisons\n***********\n\nUnlike C, all comparison operations in Python have the same priority,\nwhich is lower than that of any arithmetic, shifting or bitwise\noperation. Also unlike C, expressions like ``a < b < c`` have the\ninterpretation that is conventional in mathematics:\n\n comparison ::= or_expr ( comp_operator or_expr )*\n comp_operator ::= "<" | ">" | "==" | ">=" | "<=" | "<>" | "!="\n | "is" ["not"] | ["not"] "in"\n\nComparisons yield boolean values: ``True`` or ``False``.\n\nComparisons can be chained arbitrarily, e.g., ``x < y <= z`` is\nequivalent to ``x < y and y <= z``, except that ``y`` is evaluated\nonly once (but in both cases ``z`` is not evaluated at all when ``x <\ny`` is found to be false).\n\nFormally, if *a*, *b*, *c*, ..., *y*, *z* are expressions and *op1*,\n*op2*, ..., *opN* are comparison operators, then ``a op1 b op2 c ... y\nopN z`` is equivalent to ``a op1 b and b op2 c and ... y opN z``,\nexcept that each expression is evaluated at most once.\n\nNote that ``a op1 b op2 c`` doesn\'t imply any kind of comparison\nbetween *a* and *c*, so that, e.g., ``x < y > z`` is perfectly legal\n(though perhaps not pretty).\n\nThe forms ``<>`` and ``!=`` are equivalent; for consistency with C,\n``!=`` is preferred; where ``!=`` is mentioned below ``<>`` is also\naccepted. The ``<>`` spelling is considered obsolescent.\n\nThe operators ``<``, ``>``, ``==``, ``>=``, ``<=``, and ``!=`` compare\nthe values of two objects. The objects need not have the same type.\nIf both are numbers, they are converted to a common type. Otherwise,\nobjects of different types *always* compare unequal, and are ordered\nconsistently but arbitrarily. You can control comparison behavior of\nobjects of non-builtin types by defining a ``__cmp__`` method or rich\ncomparison methods like ``__gt__``, described in section *Special\nmethod names*.\n\n(This unusual definition of comparison was used to simplify the\ndefinition of operations like sorting and the ``in`` and ``not in``\noperators. In the future, the comparison rules for objects of\ndifferent types are likely to change.)\n\nComparison of objects of the same type depends on the type:\n\n* Numbers are compared arithmetically.\n\n* Strings are compared lexicographically using the numeric equivalents\n (the result of the built-in function ``ord()``) of their characters.\n Unicode and 8-bit strings are fully interoperable in this behavior.\n [4]\n\n* Tuples and lists are compared lexicographically using comparison of\n corresponding elements. This means that to compare equal, each\n element must compare equal and the two sequences must be of the same\n type and have the same length.\n\n If not equal, the sequences are ordered the same as their first\n differing elements. For example, ``cmp([1,2,x], [1,2,y])`` returns\n the same as ``cmp(x,y)``. If the corresponding element does not\n exist, the shorter sequence is ordered first (for example, ``[1,2] <\n [1,2,3]``).\n\n* Mappings (dictionaries) compare equal if and only if their sorted\n (key, value) lists compare equal. [5] Outcomes other than equality\n are resolved consistently, but are not otherwise defined. [6]\n\n* Most other objects of builtin types compare unequal unless they are\n the same object; the choice whether one object is considered smaller\n or larger than another one is made arbitrarily but consistently\n within one execution of a program.\n\nThe operators ``in`` and ``not in`` test for collection membership.\n``x in s`` evaluates to true if *x* is a member of the collection *s*,\nand false otherwise. ``x not in s`` returns the negation of ``x in\ns``. The collection membership test has traditionally been bound to\nsequences; an object is a member of a collection if the collection is\na sequence and contains an element equal to that object. However, it\nmake sense for many other object types to support membership tests\nwithout being a sequence. In particular, dictionaries (for keys) and\nsets support membership testing.\n\nFor the list and tuple types, ``x in y`` is true if and only if there\nexists an index *i* such that ``x == y[i]`` is true.\n\nFor the Unicode and string types, ``x in y`` is true if and only if\n*x* is a substring of *y*. An equivalent test is ``y.find(x) != -1``.\nNote, *x* and *y* need not be the same type; consequently, ``u\'ab\' in\n\'abc\'`` will return ``True``. Empty strings are always considered to\nbe a substring of any other string, so ``"" in "abc"`` will return\n``True``.\n\nChanged in version 2.3: Previously, *x* was required to be a string of\nlength ``1``.\n\nFor user-defined classes which define the ``__contains__()`` method,\n``x in y`` is true if and only if ``y.__contains__(x)`` is true.\n\nFor user-defined classes which do not define ``__contains__()`` and do\ndefine ``__getitem__()``, ``x in y`` is true if and only if there is a\nnon-negative integer index *i* such that ``x == y[i]``, and all lower\ninteger indices do not raise ``IndexError`` exception. (If any other\nexception is raised, it is as if ``in`` raised that exception).\n\nThe operator ``not in`` is defined to have the inverse true value of\n``in``.\n\nThe operators ``is`` and ``is not`` test for object identity: ``x is\ny`` is true if and only if *x* and *y* are the same object. ``x is\nnot y`` yields the inverse truth value.\n', - 'compound': u'\nCompound statements\n*******************\n\nCompound statements contain (groups of) other statements; they affect\nor control the execution of those other statements in some way. In\ngeneral, compound statements span multiple lines, although in simple\nincarnations a whole compound statement may be contained in one line.\n\nThe ``if``, ``while`` and ``for`` statements implement traditional\ncontrol flow constructs. ``try`` specifies exception handlers and/or\ncleanup code for a group of statements. Function and class\ndefinitions are also syntactically compound statements.\n\nCompound statements consist of one or more \'clauses.\' A clause\nconsists of a header and a \'suite.\' The clause headers of a\nparticular compound statement are all at the same indentation level.\nEach clause header begins with a uniquely identifying keyword and ends\nwith a colon. A suite is a group of statements controlled by a\nclause. A suite can be one or more semicolon-separated simple\nstatements on the same line as the header, following the header\'s\ncolon, or it can be one or more indented statements on subsequent\nlines. Only the latter form of suite can contain nested compound\nstatements; the following is illegal, mostly because it wouldn\'t be\nclear to which ``if`` clause a following ``else`` clause would belong:\n\n if test1: if test2: print x\n\nAlso note that the semicolon binds tighter than the colon in this\ncontext, so that in the following example, either all or none of the\n``print`` statements are executed:\n\n if x < y < z: print x; print y; print z\n\nSummarizing:\n\n compound_stmt ::= if_stmt\n | while_stmt\n | for_stmt\n | try_stmt\n | with_stmt\n | funcdef\n | classdef\n | decorated\n suite ::= stmt_list NEWLINE | NEWLINE INDENT statement+ DEDENT\n statement ::= stmt_list NEWLINE | compound_stmt\n stmt_list ::= simple_stmt (";" simple_stmt)* [";"]\n\nNote that statements always end in a ``NEWLINE`` possibly followed by\na ``DEDENT``. Also note that optional continuation clauses always\nbegin with a keyword that cannot start a statement, thus there are no\nambiguities (the \'dangling ``else``\' problem is solved in Python by\nrequiring nested ``if`` statements to be indented).\n\nThe formatting of the grammar rules in the following sections places\neach clause on a separate line for clarity.\n\n\nThe ``if`` statement\n====================\n\nThe ``if`` statement is used for conditional execution:\n\n if_stmt ::= "if" expression ":" suite\n ( "elif" expression ":" suite )*\n ["else" ":" suite]\n\nIt selects exactly one of the suites by evaluating the expressions one\nby one until one is found to be true (see section *Boolean operations*\nfor the definition of true and false); then that suite is executed\n(and no other part of the ``if`` statement is executed or evaluated).\nIf all expressions are false, the suite of the ``else`` clause, if\npresent, is executed.\n\n\nThe ``while`` statement\n=======================\n\nThe ``while`` statement is used for repeated execution as long as an\nexpression is true:\n\n while_stmt ::= "while" expression ":" suite\n ["else" ":" suite]\n\nThis repeatedly tests the expression and, if it is true, executes the\nfirst suite; if the expression is false (which may be the first time\nit is tested) the suite of the ``else`` clause, if present, is\nexecuted and the loop terminates.\n\nA ``break`` statement executed in the first suite terminates the loop\nwithout executing the ``else`` clause\'s suite. A ``continue``\nstatement executed in the first suite skips the rest of the suite and\ngoes back to testing the expression.\n\n\nThe ``for`` statement\n=====================\n\nThe ``for`` statement is used to iterate over the elements of a\nsequence (such as a string, tuple or list) or other iterable object:\n\n for_stmt ::= "for" target_list "in" expression_list ":" suite\n ["else" ":" suite]\n\nThe expression list is evaluated once; it should yield an iterable\nobject. An iterator is created for the result of the\n``expression_list``. The suite is then executed once for each item\nprovided by the iterator, in the order of ascending indices. Each\nitem in turn is assigned to the target list using the standard rules\nfor assignments, and then the suite is executed. When the items are\nexhausted (which is immediately when the sequence is empty), the suite\nin the ``else`` clause, if present, is executed, and the loop\nterminates.\n\nA ``break`` statement executed in the first suite terminates the loop\nwithout executing the ``else`` clause\'s suite. A ``continue``\nstatement executed in the first suite skips the rest of the suite and\ncontinues with the next item, or with the ``else`` clause if there was\nno next item.\n\nThe suite may assign to the variable(s) in the target list; this does\nnot affect the next item assigned to it.\n\nThe target list is not deleted when the loop is finished, but if the\nsequence is empty, it will not have been assigned to at all by the\nloop. Hint: the built-in function ``range()`` returns a sequence of\nintegers suitable to emulate the effect of Pascal\'s ``for i := a to b\ndo``; e.g., ``range(3)`` returns the list ``[0, 1, 2]``.\n\nWarning: There is a subtlety when the sequence is being modified by the loop\n (this can only occur for mutable sequences, i.e. lists). An internal\n counter is used to keep track of which item is used next, and this\n is incremented on each iteration. When this counter has reached the\n length of the sequence the loop terminates. This means that if the\n suite deletes the current (or a previous) item from the sequence,\n the next item will be skipped (since it gets the index of the\n current item which has already been treated). Likewise, if the\n suite inserts an item in the sequence before the current item, the\n current item will be treated again the next time through the loop.\n This can lead to nasty bugs that can be avoided by making a\n temporary copy using a slice of the whole sequence, e.g.,\n\n for x in a[:]:\n if x < 0: a.remove(x)\n\n\nThe ``try`` statement\n=====================\n\nThe ``try`` statement specifies exception handlers and/or cleanup code\nfor a group of statements:\n\n try_stmt ::= try1_stmt | try2_stmt\n try1_stmt ::= "try" ":" suite\n ("except" [expression ["," target]] ":" suite)+\n ["else" ":" suite]\n ["finally" ":" suite]\n try2_stmt ::= "try" ":" suite\n "finally" ":" suite\n\nChanged in version 2.5: In previous versions of Python,\n``try``...``except``...``finally`` did not work. ``try``...``except``\nhad to be nested in ``try``...``finally``.\n\nThe ``except`` clause(s) specify one or more exception handlers. When\nno exception occurs in the ``try`` clause, no exception handler is\nexecuted. When an exception occurs in the ``try`` suite, a search for\nan exception handler is started. This search inspects the except\nclauses in turn until one is found that matches the exception. An\nexpression-less except clause, if present, must be last; it matches\nany exception. For an except clause with an expression, that\nexpression is evaluated, and the clause matches the exception if the\nresulting object is "compatible" with the exception. An object is\ncompatible with an exception if it is the class or a base class of the\nexception object, a tuple containing an item compatible with the\nexception, or, in the (deprecated) case of string exceptions, is the\nraised string itself (note that the object identities must match, i.e.\nit must be the same string object, not just a string with the same\nvalue).\n\nIf no except clause matches the exception, the search for an exception\nhandler continues in the surrounding code and on the invocation stack.\n[1]\n\nIf the evaluation of an expression in the header of an except clause\nraises an exception, the original search for a handler is canceled and\na search starts for the new exception in the surrounding code and on\nthe call stack (it is treated as if the entire ``try`` statement\nraised the exception).\n\nWhen a matching except clause is found, the exception is assigned to\nthe target specified in that except clause, if present, and the except\nclause\'s suite is executed. All except clauses must have an\nexecutable block. When the end of this block is reached, execution\ncontinues normally after the entire try statement. (This means that\nif two nested handlers exist for the same exception, and the exception\noccurs in the try clause of the inner handler, the outer handler will\nnot handle the exception.)\n\nBefore an except clause\'s suite is executed, details about the\nexception are assigned to three variables in the ``sys`` module:\n``sys.exc_type`` receives the object identifying the exception;\n``sys.exc_value`` receives the exception\'s parameter;\n``sys.exc_traceback`` receives a traceback object (see section *The\nstandard type hierarchy*) identifying the point in the program where\nthe exception occurred. These details are also available through the\n``sys.exc_info()`` function, which returns a tuple ``(exc_type,\nexc_value, exc_traceback)``. Use of the corresponding variables is\ndeprecated in favor of this function, since their use is unsafe in a\nthreaded program. As of Python 1.5, the variables are restored to\ntheir previous values (before the call) when returning from a function\nthat handled an exception.\n\nThe optional ``else`` clause is executed if and when control flows off\nthe end of the ``try`` clause. [2] Exceptions in the ``else`` clause\nare not handled by the preceding ``except`` clauses.\n\nIf ``finally`` is present, it specifies a \'cleanup\' handler. The\n``try`` clause is executed, including any ``except`` and ``else``\nclauses. If an exception occurs in any of the clauses and is not\nhandled, the exception is temporarily saved. The ``finally`` clause is\nexecuted. If there is a saved exception, it is re-raised at the end\nof the ``finally`` clause. If the ``finally`` clause raises another\nexception or executes a ``return`` or ``break`` statement, the saved\nexception is lost. The exception information is not available to the\nprogram during execution of the ``finally`` clause.\n\nWhen a ``return``, ``break`` or ``continue`` statement is executed in\nthe ``try`` suite of a ``try``...``finally`` statement, the\n``finally`` clause is also executed \'on the way out.\' A ``continue``\nstatement is illegal in the ``finally`` clause. (The reason is a\nproblem with the current implementation --- this restriction may be\nlifted in the future).\n\nAdditional information on exceptions can be found in section\n*Exceptions*, and information on using the ``raise`` statement to\ngenerate exceptions may be found in section *The raise statement*.\n\n\nThe ``with`` statement\n======================\n\nAdded in version 2.5.\n\nThe ``with`` statement is used to wrap the execution of a block with\nmethods defined by a context manager (see section *With Statement\nContext Managers*). This allows common\n``try``...``except``...``finally`` usage patterns to be encapsulated\nfor convenient reuse.\n\n with_stmt ::= "with" expression ["as" target] ":" suite\n\nThe execution of the ``with`` statement proceeds as follows:\n\n1. The context expression is evaluated to obtain a context manager.\n\n2. The context manager\'s ``__enter__()`` method is invoked.\n\n3. If a target was included in the ``with`` statement, the return\n value from ``__enter__()`` is assigned to it.\n\n Note: The ``with`` statement guarantees that if the ``__enter__()``\n method returns without an error, then ``__exit__()`` will always\n be called. Thus, if an error occurs during the assignment to the\n target list, it will be treated the same as an error occurring\n within the suite would be. See step 5 below.\n\n4. The suite is executed.\n\n5. The context manager\'s ``__exit__()`` method is invoked. If an\n exception caused the suite to be exited, its type, value, and\n traceback are passed as arguments to ``__exit__()``. Otherwise,\n three ``None`` arguments are supplied.\n\n If the suite was exited due to an exception, and the return value\n from the ``__exit__()`` method was false, the exception is\n reraised. If the return value was true, the exception is\n suppressed, and execution continues with the statement following\n the ``with`` statement.\n\n If the suite was exited for any reason other than an exception, the\n return value from ``__exit__()`` is ignored, and execution proceeds\n at the normal location for the kind of exit that was taken.\n\nNote: In Python 2.5, the ``with`` statement is only allowed when the\n ``with_statement`` feature has been enabled. It is always enabled\n in Python 2.6.\n\nSee also:\n\n **PEP 0343** - The "with" statement\n The specification, background, and examples for the Python\n ``with`` statement.\n\n\nFunction definitions\n====================\n\nA function definition defines a user-defined function object (see\nsection *The standard type hierarchy*):\n\n decorated ::= decorators (classdef | funcdef)\n decorators ::= decorator+\n decorator ::= "@" dotted_name ["(" [argument_list [","]] ")"] NEWLINE\n funcdef ::= "def" funcname "(" [parameter_list] ")" ":" suite\n dotted_name ::= identifier ("." identifier)*\n parameter_list ::= (defparameter ",")*\n ( "*" identifier [, "**" identifier]\n | "**" identifier\n | defparameter [","] )\n defparameter ::= parameter ["=" expression]\n sublist ::= parameter ("," parameter)* [","]\n parameter ::= identifier | "(" sublist ")"\n funcname ::= identifier\n\nA function definition is an executable statement. Its execution binds\nthe function name in the current local namespace to a function object\n(a wrapper around the executable code for the function). This\nfunction object contains a reference to the current global namespace\nas the global namespace to be used when the function is called.\n\nThe function definition does not execute the function body; this gets\nexecuted only when the function is called.\n\nA function definition may be wrapped by one or more *decorator*\nexpressions. Decorator expressions are evaluated when the function is\ndefined, in the scope that contains the function definition. The\nresult must be a callable, which is invoked with the function object\nas the only argument. The returned value is bound to the function name\ninstead of the function object. Multiple decorators are applied in\nnested fashion. For example, the following code:\n\n @f1(arg)\n @f2\n def func(): pass\n\nis equivalent to:\n\n def func(): pass\n func = f1(arg)(f2(func))\n\nWhen one or more top-level parameters have the form *parameter* ``=``\n*expression*, the function is said to have "default parameter values."\nFor a parameter with a default value, the corresponding argument may\nbe omitted from a call, in which case the parameter\'s default value is\nsubstituted. If a parameter has a default value, all following\nparameters must also have a default value --- this is a syntactic\nrestriction that is not expressed by the grammar.\n\n**Default parameter values are evaluated when the function definition\nis executed.** This means that the expression is evaluated once, when\nthe function is defined, and that that same "pre-computed" value is\nused for each call. This is especially important to understand when a\ndefault parameter is a mutable object, such as a list or a dictionary:\nif the function modifies the object (e.g. by appending an item to a\nlist), the default value is in effect modified. This is generally not\nwhat was intended. A way around this is to use ``None`` as the\ndefault, and explicitly test for it in the body of the function, e.g.:\n\n def whats_on_the_telly(penguin=None):\n if penguin is None:\n penguin = []\n penguin.append("property of the zoo")\n return penguin\n\nFunction call semantics are described in more detail in section\n*Calls*. A function call always assigns values to all parameters\nmentioned in the parameter list, either from position arguments, from\nkeyword arguments, or from default values. If the form\n"``*identifier``" is present, it is initialized to a tuple receiving\nany excess positional parameters, defaulting to the empty tuple. If\nthe form "``**identifier``" is present, it is initialized to a new\ndictionary receiving any excess keyword arguments, defaulting to a new\nempty dictionary.\n\nIt is also possible to create anonymous functions (functions not bound\nto a name), for immediate use in expressions. This uses lambda forms,\ndescribed in section *Expression lists*. Note that the lambda form is\nmerely a shorthand for a simplified function definition; a function\ndefined in a "``def``" statement can be passed around or assigned to\nanother name just like a function defined by a lambda form. The\n"``def``" form is actually more powerful since it allows the execution\nof multiple statements.\n\n**Programmer\'s note:** Functions are first-class objects. A "``def``"\nform executed inside a function definition defines a local function\nthat can be returned or passed around. Free variables used in the\nnested function can access the local variables of the function\ncontaining the def. See section *Naming and binding* for details.\n\n\nClass definitions\n=================\n\nA class definition defines a class object (see section *The standard\ntype hierarchy*):\n\n classdef ::= "class" classname [inheritance] ":" suite\n inheritance ::= "(" [expression_list] ")"\n classname ::= identifier\n\nA class definition is an executable statement. It first evaluates the\ninheritance list, if present. Each item in the inheritance list\nshould evaluate to a class object or class type which allows\nsubclassing. The class\'s suite is then executed in a new execution\nframe (see section *Naming and binding*), using a newly created local\nnamespace and the original global namespace. (Usually, the suite\ncontains only function definitions.) When the class\'s suite finishes\nexecution, its execution frame is discarded but its local namespace is\nsaved. A class object is then created using the inheritance list for\nthe base classes and the saved local namespace for the attribute\ndictionary. The class name is bound to this class object in the\noriginal local namespace.\n\n**Programmer\'s note:** Variables defined in the class definition are\nclass variables; they are shared by all instances. To create instance\nvariables, they can be set in a method with ``self.name = value``.\nBoth class and instance variables are accessible through the notation\n"``self.name``", and an instance variable hides a class variable with\nthe same name when accessed in this way. Class variables can be used\nas defaults for instance variables, but using mutable values there can\nlead to unexpected results. For *new-style class*es, descriptors can\nbe used to create instance variables with different implementation\ndetails.\n\nClass definitions, like function definitions, may be wrapped by one or\nmore *decorator* expressions. The evaluation rules for the decorator\nexpressions are the same as for functions. The result must be a class\nobject, which is then bound to the class name.\n\n-[ Footnotes ]-\n\n[1] The exception is propagated to the invocation stack only if there\n is no ``finally`` clause that negates the exception.\n\n[2] Currently, control "flows off the end" except in the case of an\n exception or the execution of a ``return``, ``continue``, or\n ``break`` statement.\n', - 'context-managers': u'\nWith Statement Context Managers\n*******************************\n\nAdded in version 2.5.\n\nA *context manager* is an object that defines the runtime context to\nbe established when executing a ``with`` statement. The context\nmanager handles the entry into, and the exit from, the desired runtime\ncontext for the execution of the block of code. Context managers are\nnormally invoked using the ``with`` statement (described in section\n*The with statement*), but can also be used by directly invoking their\nmethods.\n\nTypical uses of context managers include saving and restoring various\nkinds of global state, locking and unlocking resources, closing opened\nfiles, etc.\n\nFor more information on context managers, see *Context Manager Types*.\n\nobject.__enter__(self)\n\n Enter the runtime context related to this object. The ``with``\n statement will bind this method\'s return value to the target(s)\n specified in the ``as`` clause of the statement, if any.\n\nobject.__exit__(self, exc_type, exc_value, traceback)\n\n Exit the runtime context related to this object. The parameters\n describe the exception that caused the context to be exited. If the\n context was exited without an exception, all three arguments will\n be ``None``.\n\n If an exception is supplied, and the method wishes to suppress the\n exception (i.e., prevent it from being propagated), it should\n return a true value. Otherwise, the exception will be processed\n normally upon exit from this method.\n\n Note that ``__exit__()`` methods should not reraise the passed-in\n exception; this is the caller\'s responsibility.\n\nSee also:\n\n **PEP 0343** - The "with" statement\n The specification, background, and examples for the Python\n ``with`` statement.\n\n-[ Footnotes ]-\n\n[1] Since Python 2.2, a gradual merging of types and classes has been\n started that makes this and a few other assertions made in this\n manual not 100% accurate and complete: for example, it *is* now\n possible in some cases to change an object\'s type, under certain\n controlled conditions. Until this manual undergoes extensive\n revision, it must now be taken as authoritative only regarding\n "classic classes", that are still the default, for compatibility\n purposes, in Python 2.2 and 2.3. For more information, see\n http://www.python.org/doc/newstyle/.\n\n[2] This, and other statements, are only roughly true for instances of\n new-style classes.\n\n[3] A descriptor can define any combination of ``__get__()``,\n ``__set__()`` and ``__delete__()``. If it does not define\n ``__get__()``, then accessing the attribute even on an instance\n will return the descriptor object itself. If the descriptor\n defines ``__set__()`` and/or ``__delete__()``, it is a data\n descriptor; if it defines neither, it is a non-data descriptor.\n\n[4] For operands of the same type, it is assumed that if the non-\n reflected method (such as ``__add__()``) fails the operation is\n not supported, which is why the reflected method is not called.\n', + 'calls': u'\nCalls\n*****\n\nA call calls a callable object (e.g., a function) with a possibly\nempty series of arguments:\n\n call ::= primary "(" [argument_list [","]\n | expression genexpr_for] ")"\n argument_list ::= positional_arguments ["," keyword_arguments]\n ["," "*" expression] ["," keyword_arguments]\n ["," "**" expression]\n | keyword_arguments ["," "*" expression]\n ["," "**" expression]\n | "*" expression ["," "*" expression] ["," "**" expression]\n | "**" expression\n positional_arguments ::= expression ("," expression)*\n keyword_arguments ::= keyword_item ("," keyword_item)*\n keyword_item ::= identifier "=" expression\n\nA trailing comma may be present after the positional and keyword\narguments but does not affect the semantics.\n\nThe primary must evaluate to a callable object (user-defined\nfunctions, built-in functions, methods of built-in objects, class\nobjects, methods of class instances, and certain class instances\nthemselves are callable; extensions may define additional callable\nobject types). All argument expressions are evaluated before the call\nis attempted. Please refer to section *Function definitions* for the\nsyntax of formal parameter lists.\n\nIf keyword arguments are present, they are first converted to\npositional arguments, as follows. First, a list of unfilled slots is\ncreated for the formal parameters. If there are N positional\narguments, they are placed in the first N slots. Next, for each\nkeyword argument, the identifier is used to determine the\ncorresponding slot (if the identifier is the same as the first formal\nparameter name, the first slot is used, and so on). If the slot is\nalready filled, a ``TypeError`` exception is raised. Otherwise, the\nvalue of the argument is placed in the slot, filling it (even if the\nexpression is ``None``, it fills the slot). When all arguments have\nbeen processed, the slots that are still unfilled are filled with the\ncorresponding default value from the function definition. (Default\nvalues are calculated, once, when the function is defined; thus, a\nmutable object such as a list or dictionary used as default value will\nbe shared by all calls that don\'t specify an argument value for the\ncorresponding slot; this should usually be avoided.) If there are any\nunfilled slots for which no default value is specified, a\n``TypeError`` exception is raised. Otherwise, the list of filled\nslots is used as the argument list for the call.\n\nNote: An implementation may provide builtin functions whose positional\n parameters do not have names, even if they are \'named\' for the\n purpose of documentation, and which therefore cannot be supplied by\n keyword. In CPython, this is the case for functions implemented in\n C that use ``PyArg_ParseTuple`` to parse their arguments.\n\nIf there are more positional arguments than there are formal parameter\nslots, a ``TypeError`` exception is raised, unless a formal parameter\nusing the syntax ``*identifier`` is present; in this case, that formal\nparameter receives a tuple containing the excess positional arguments\n(or an empty tuple if there were no excess positional arguments).\n\nIf any keyword argument does not correspond to a formal parameter\nname, a ``TypeError`` exception is raised, unless a formal parameter\nusing the syntax ``**identifier`` is present; in this case, that\nformal parameter receives a dictionary containing the excess keyword\narguments (using the keywords as keys and the argument values as\ncorresponding values), or a (new) empty dictionary if there were no\nexcess keyword arguments.\n\nIf the syntax ``*expression`` appears in the function call,\n``expression`` must evaluate to a sequence. Elements from this\nsequence are treated as if they were additional positional arguments;\nif there are positional arguments *x1*,..., *xN*, and ``expression``\nevaluates to a sequence *y1*, ..., *yM*, this is equivalent to a call\nwith M+N positional arguments *x1*, ..., *xN*, *y1*, ..., *yM*.\n\nA consequence of this is that although the ``*expression`` syntax may\nappear *after* some keyword arguments, it is processed *before* the\nkeyword arguments (and the ``**expression`` argument, if any -- see\nbelow). So:\n\n >>> def f(a, b):\n ... print a, b\n ...\n >>> f(b=1, *(2,))\n 2 1\n >>> f(a=1, *(2,))\n Traceback (most recent call last):\n File "", line 1, in ?\n TypeError: f() got multiple values for keyword argument \'a\'\n >>> f(1, *(2,))\n 1 2\n\nIt is unusual for both keyword arguments and the ``*expression``\nsyntax to be used in the same call, so in practice this confusion does\nnot arise.\n\nIf the syntax ``**expression`` appears in the function call,\n``expression`` must evaluate to a mapping, the contents of which are\ntreated as additional keyword arguments. In the case of a keyword\nappearing in both ``expression`` and as an explicit keyword argument,\na ``TypeError`` exception is raised.\n\nFormal parameters using the syntax ``*identifier`` or ``**identifier``\ncannot be used as positional argument slots or as keyword argument\nnames. Formal parameters using the syntax ``(sublist)`` cannot be\nused as keyword argument names; the outermost sublist corresponds to a\nsingle unnamed argument slot, and the argument value is assigned to\nthe sublist using the usual tuple assignment rules after all other\nparameter processing is done.\n\nA call always returns some value, possibly ``None``, unless it raises\nan exception. How this value is computed depends on the type of the\ncallable object.\n\nIf it is---\n\na user-defined function:\n The code block for the function is executed, passing it the\n argument list. The first thing the code block will do is bind the\n formal parameters to the arguments; this is described in section\n *Function definitions*. When the code block executes a ``return``\n statement, this specifies the return value of the function call.\n\na built-in function or method:\n The result is up to the interpreter; see *Built-in Functions* for\n the descriptions of built-in functions and methods.\n\na class object:\n A new instance of that class is returned.\n\na class instance method:\n The corresponding user-defined function is called, with an argument\n list that is one longer than the argument list of the call: the\n instance becomes the first argument.\n\na class instance:\n The class must define a ``__call__()`` method; the effect is then\n the same as if that method was called.\n', + 'class': u'\nClass definitions\n*****************\n\nA class definition defines a class object (see section *The standard\ntype hierarchy*):\n\n classdef ::= "class" classname [inheritance] ":" suite\n inheritance ::= "(" [expression_list] ")"\n classname ::= identifier\n\nA class definition is an executable statement. It first evaluates the\ninheritance list, if present. Each item in the inheritance list\nshould evaluate to a class object or class type which allows\nsubclassing. The class\'s suite is then executed in a new execution\nframe (see section *Naming and binding*), using a newly created local\nnamespace and the original global namespace. (Usually, the suite\ncontains only function definitions.) When the class\'s suite finishes\nexecution, its execution frame is discarded but its local namespace is\nsaved. [4] A class object is then created using the inheritance list\nfor the base classes and the saved local namespace for the attribute\ndictionary. The class name is bound to this class object in the\noriginal local namespace.\n\n**Programmer\'s note:** Variables defined in the class definition are\nclass variables; they are shared by all instances. To create instance\nvariables, they can be set in a method with ``self.name = value``.\nBoth class and instance variables are accessible through the notation\n"``self.name``", and an instance variable hides a class variable with\nthe same name when accessed in this way. Class variables can be used\nas defaults for instance variables, but using mutable values there can\nlead to unexpected results. For *new-style class*es, descriptors can\nbe used to create instance variables with different implementation\ndetails.\n\nClass definitions, like function definitions, may be wrapped by one or\nmore *decorator* expressions. The evaluation rules for the decorator\nexpressions are the same as for functions. The result must be a class\nobject, which is then bound to the class name.\n\n-[ Footnotes ]-\n\n[1] The exception is propagated to the invocation stack only if there\n is no ``finally`` clause that negates the exception.\n\n[2] Currently, control "flows off the end" except in the case of an\n exception or the execution of a ``return``, ``continue``, or\n ``break`` statement.\n\n[3] A string literal appearing as the first statement in the function\n body is transformed into the function\'s ``__doc__`` attribute and\n therefore the function\'s *docstring*.\n\n[4] A string literal appearing as the first statement in the class\n body is transformed into the namespace\'s ``__doc__`` item and\n therefore the class\'s *docstring*.\n', + 'coercion-rules': u"\nCoercion rules\n**************\n\nThis section used to document the rules for coercion. As the language\nhas evolved, the coercion rules have become hard to document\nprecisely; documenting what one version of one particular\nimplementation does is undesirable. Instead, here are some informal\nguidelines regarding coercion. In Python 3.0, coercion will not be\nsupported.\n\n* If the left operand of a % operator is a string or Unicode object,\n no coercion takes place and the string formatting operation is\n invoked instead.\n\n* It is no longer recommended to define a coercion operation. Mixed-\n mode operations on types that don't define coercion pass the\n original arguments to the operation.\n\n* New-style classes (those derived from ``object``) never invoke the\n ``__coerce__()`` method in response to a binary operator; the only\n time ``__coerce__()`` is invoked is when the built-in function\n ``coerce()`` is called.\n\n* For most intents and purposes, an operator that returns\n ``NotImplemented`` is treated the same as one that is not\n implemented at all.\n\n* Below, ``__op__()`` and ``__rop__()`` are used to signify the\n generic method names corresponding to an operator; ``__iop__()`` is\n used for the corresponding in-place operator. For example, for the\n operator '``+``', ``__add__()`` and ``__radd__()`` are used for the\n left and right variant of the binary operator, and ``__iadd__()``\n for the in-place variant.\n\n* For objects *x* and *y*, first ``x.__op__(y)`` is tried. If this is\n not implemented or returns ``NotImplemented``, ``y.__rop__(x)`` is\n tried. If this is also not implemented or returns\n ``NotImplemented``, a ``TypeError`` exception is raised. But see\n the following exception:\n\n* Exception to the previous item: if the left operand is an instance\n of a built-in type or a new-style class, and the right operand is an\n instance of a proper subclass of that type or class and overrides\n the base's ``__rop__()`` method, the right operand's ``__rop__()``\n method is tried *before* the left operand's ``__op__()`` method.\n\n This is done so that a subclass can completely override binary\n operators. Otherwise, the left operand's ``__op__()`` method would\n always accept the right operand: when an instance of a given class\n is expected, an instance of a subclass of that class is always\n acceptable.\n\n* When either operand type defines a coercion, this coercion is called\n before that type's ``__op__()`` or ``__rop__()`` method is called,\n but no sooner. If the coercion returns an object of a different\n type for the operand whose coercion is invoked, part of the process\n is redone using the new object.\n\n* When an in-place operator (like '``+=``') is used, if the left\n operand implements ``__iop__()``, it is invoked without any\n coercion. When the operation falls back to ``__op__()`` and/or\n ``__rop__()``, the normal coercion rules apply.\n\n* In ``x + y``, if *x* is a sequence that implements sequence\n concatenation, sequence concatenation is invoked.\n\n* In ``x * y``, if one operator is a sequence that implements sequence\n repetition, and the other is an integer (``int`` or ``long``),\n sequence repetition is invoked.\n\n* Rich comparisons (implemented by methods ``__eq__()`` and so on)\n never use coercion. Three-way comparison (implemented by\n ``__cmp__()``) does use coercion under the same conditions as other\n binary operations use it.\n\n* In the current implementation, the built-in numeric types ``int``,\n ``long`` and ``float`` do not use coercion; the type ``complex``\n however does use it. The difference can become apparent when\n subclassing these types. Over time, the type ``complex`` may be\n fixed to avoid coercion. All these types implement a\n ``__coerce__()`` method, for use by the built-in ``coerce()``\n function.\n", + 'comparisons': u'\nComparisons\n***********\n\nUnlike C, all comparison operations in Python have the same priority,\nwhich is lower than that of any arithmetic, shifting or bitwise\noperation. Also unlike C, expressions like ``a < b < c`` have the\ninterpretation that is conventional in mathematics:\n\n comparison ::= or_expr ( comp_operator or_expr )*\n comp_operator ::= "<" | ">" | "==" | ">=" | "<=" | "<>" | "!="\n | "is" ["not"] | ["not"] "in"\n\nComparisons yield boolean values: ``True`` or ``False``.\n\nComparisons can be chained arbitrarily, e.g., ``x < y <= z`` is\nequivalent to ``x < y and y <= z``, except that ``y`` is evaluated\nonly once (but in both cases ``z`` is not evaluated at all when ``x <\ny`` is found to be false).\n\nFormally, if *a*, *b*, *c*, ..., *y*, *z* are expressions and *op1*,\n*op2*, ..., *opN* are comparison operators, then ``a op1 b op2 c ... y\nopN z`` is equivalent to ``a op1 b and b op2 c and ... y opN z``,\nexcept that each expression is evaluated at most once.\n\nNote that ``a op1 b op2 c`` doesn\'t imply any kind of comparison\nbetween *a* and *c*, so that, e.g., ``x < y > z`` is perfectly legal\n(though perhaps not pretty).\n\nThe forms ``<>`` and ``!=`` are equivalent; for consistency with C,\n``!=`` is preferred; where ``!=`` is mentioned below ``<>`` is also\naccepted. The ``<>`` spelling is considered obsolescent.\n\nThe operators ``<``, ``>``, ``==``, ``>=``, ``<=``, and ``!=`` compare\nthe values of two objects. The objects need not have the same type.\nIf both are numbers, they are converted to a common type. Otherwise,\nobjects of different types *always* compare unequal, and are ordered\nconsistently but arbitrarily. You can control comparison behavior of\nobjects of non-builtin types by defining a ``__cmp__`` method or rich\ncomparison methods like ``__gt__``, described in section *Special\nmethod names*.\n\n(This unusual definition of comparison was used to simplify the\ndefinition of operations like sorting and the ``in`` and ``not in``\noperators. In the future, the comparison rules for objects of\ndifferent types are likely to change.)\n\nComparison of objects of the same type depends on the type:\n\n* Numbers are compared arithmetically.\n\n* Strings are compared lexicographically using the numeric equivalents\n (the result of the built-in function ``ord()``) of their characters.\n Unicode and 8-bit strings are fully interoperable in this behavior.\n [4]\n\n* Tuples and lists are compared lexicographically using comparison of\n corresponding elements. This means that to compare equal, each\n element must compare equal and the two sequences must be of the same\n type and have the same length.\n\n If not equal, the sequences are ordered the same as their first\n differing elements. For example, ``cmp([1,2,x], [1,2,y])`` returns\n the same as ``cmp(x,y)``. If the corresponding element does not\n exist, the shorter sequence is ordered first (for example, ``[1,2] <\n [1,2,3]``).\n\n* Mappings (dictionaries) compare equal if and only if their sorted\n (key, value) lists compare equal. [5] Outcomes other than equality\n are resolved consistently, but are not otherwise defined. [6]\n\n* Most other objects of builtin types compare unequal unless they are\n the same object; the choice whether one object is considered smaller\n or larger than another one is made arbitrarily but consistently\n within one execution of a program.\n\nThe operators ``in`` and ``not in`` test for collection membership.\n``x in s`` evaluates to true if *x* is a member of the collection *s*,\nand false otherwise. ``x not in s`` returns the negation of ``x in\ns``. The collection membership test has traditionally been bound to\nsequences; an object is a member of a collection if the collection is\na sequence and contains an element equal to that object. However, it\nmake sense for many other object types to support membership tests\nwithout being a sequence. In particular, dictionaries (for keys) and\nsets support membership testing.\n\nFor the list and tuple types, ``x in y`` is true if and only if there\nexists an index *i* such that ``x == y[i]`` is true.\n\nFor the Unicode and string types, ``x in y`` is true if and only if\n*x* is a substring of *y*. An equivalent test is ``y.find(x) != -1``.\nNote, *x* and *y* need not be the same type; consequently, ``u\'ab\' in\n\'abc\'`` will return ``True``. Empty strings are always considered to\nbe a substring of any other string, so ``"" in "abc"`` will return\n``True``.\n\nChanged in version 2.3: Previously, *x* was required to be a string of\nlength ``1``.\n\nFor user-defined classes which define the ``__contains__()`` method,\n``x in y`` is true if and only if ``y.__contains__(x)`` is true.\n\nFor user-defined classes which do not define ``__contains__()`` and do\ndefine ``__getitem__()``, ``x in y`` is true if and only if there is a\nnon-negative integer index *i* such that ``x == y[i]``, and all lower\ninteger indices do not raise ``IndexError`` exception. (If any other\nexception is raised, it is as if ``in`` raised that exception).\n\nThe operator ``not in`` is defined to have the inverse true value of\n``in``.\n\nThe operators ``is`` and ``is not`` test for object identity: ``x is\ny`` is true if and only if *x* and *y* are the same object. ``x is\nnot y`` yields the inverse truth value. [7]\n', + 'compound': u'\nCompound statements\n*******************\n\nCompound statements contain (groups of) other statements; they affect\nor control the execution of those other statements in some way. In\ngeneral, compound statements span multiple lines, although in simple\nincarnations a whole compound statement may be contained in one line.\n\nThe ``if``, ``while`` and ``for`` statements implement traditional\ncontrol flow constructs. ``try`` specifies exception handlers and/or\ncleanup code for a group of statements. Function and class\ndefinitions are also syntactically compound statements.\n\nCompound statements consist of one or more \'clauses.\' A clause\nconsists of a header and a \'suite.\' The clause headers of a\nparticular compound statement are all at the same indentation level.\nEach clause header begins with a uniquely identifying keyword and ends\nwith a colon. A suite is a group of statements controlled by a\nclause. A suite can be one or more semicolon-separated simple\nstatements on the same line as the header, following the header\'s\ncolon, or it can be one or more indented statements on subsequent\nlines. Only the latter form of suite can contain nested compound\nstatements; the following is illegal, mostly because it wouldn\'t be\nclear to which ``if`` clause a following ``else`` clause would belong:\n\n if test1: if test2: print x\n\nAlso note that the semicolon binds tighter than the colon in this\ncontext, so that in the following example, either all or none of the\n``print`` statements are executed:\n\n if x < y < z: print x; print y; print z\n\nSummarizing:\n\n compound_stmt ::= if_stmt\n | while_stmt\n | for_stmt\n | try_stmt\n | with_stmt\n | funcdef\n | classdef\n | decorated\n suite ::= stmt_list NEWLINE | NEWLINE INDENT statement+ DEDENT\n statement ::= stmt_list NEWLINE | compound_stmt\n stmt_list ::= simple_stmt (";" simple_stmt)* [";"]\n\nNote that statements always end in a ``NEWLINE`` possibly followed by\na ``DEDENT``. Also note that optional continuation clauses always\nbegin with a keyword that cannot start a statement, thus there are no\nambiguities (the \'dangling ``else``\' problem is solved in Python by\nrequiring nested ``if`` statements to be indented).\n\nThe formatting of the grammar rules in the following sections places\neach clause on a separate line for clarity.\n\n\nThe ``if`` statement\n====================\n\nThe ``if`` statement is used for conditional execution:\n\n if_stmt ::= "if" expression ":" suite\n ( "elif" expression ":" suite )*\n ["else" ":" suite]\n\nIt selects exactly one of the suites by evaluating the expressions one\nby one until one is found to be true (see section *Boolean operations*\nfor the definition of true and false); then that suite is executed\n(and no other part of the ``if`` statement is executed or evaluated).\nIf all expressions are false, the suite of the ``else`` clause, if\npresent, is executed.\n\n\nThe ``while`` statement\n=======================\n\nThe ``while`` statement is used for repeated execution as long as an\nexpression is true:\n\n while_stmt ::= "while" expression ":" suite\n ["else" ":" suite]\n\nThis repeatedly tests the expression and, if it is true, executes the\nfirst suite; if the expression is false (which may be the first time\nit is tested) the suite of the ``else`` clause, if present, is\nexecuted and the loop terminates.\n\nA ``break`` statement executed in the first suite terminates the loop\nwithout executing the ``else`` clause\'s suite. A ``continue``\nstatement executed in the first suite skips the rest of the suite and\ngoes back to testing the expression.\n\n\nThe ``for`` statement\n=====================\n\nThe ``for`` statement is used to iterate over the elements of a\nsequence (such as a string, tuple or list) or other iterable object:\n\n for_stmt ::= "for" target_list "in" expression_list ":" suite\n ["else" ":" suite]\n\nThe expression list is evaluated once; it should yield an iterable\nobject. An iterator is created for the result of the\n``expression_list``. The suite is then executed once for each item\nprovided by the iterator, in the order of ascending indices. Each\nitem in turn is assigned to the target list using the standard rules\nfor assignments, and then the suite is executed. When the items are\nexhausted (which is immediately when the sequence is empty), the suite\nin the ``else`` clause, if present, is executed, and the loop\nterminates.\n\nA ``break`` statement executed in the first suite terminates the loop\nwithout executing the ``else`` clause\'s suite. A ``continue``\nstatement executed in the first suite skips the rest of the suite and\ncontinues with the next item, or with the ``else`` clause if there was\nno next item.\n\nThe suite may assign to the variable(s) in the target list; this does\nnot affect the next item assigned to it.\n\nThe target list is not deleted when the loop is finished, but if the\nsequence is empty, it will not have been assigned to at all by the\nloop. Hint: the built-in function ``range()`` returns a sequence of\nintegers suitable to emulate the effect of Pascal\'s ``for i := a to b\ndo``; e.g., ``range(3)`` returns the list ``[0, 1, 2]``.\n\nWarning: There is a subtlety when the sequence is being modified by the loop\n (this can only occur for mutable sequences, i.e. lists). An internal\n counter is used to keep track of which item is used next, and this\n is incremented on each iteration. When this counter has reached the\n length of the sequence the loop terminates. This means that if the\n suite deletes the current (or a previous) item from the sequence,\n the next item will be skipped (since it gets the index of the\n current item which has already been treated). Likewise, if the\n suite inserts an item in the sequence before the current item, the\n current item will be treated again the next time through the loop.\n This can lead to nasty bugs that can be avoided by making a\n temporary copy using a slice of the whole sequence, e.g.,\n\n for x in a[:]:\n if x < 0: a.remove(x)\n\n\nThe ``try`` statement\n=====================\n\nThe ``try`` statement specifies exception handlers and/or cleanup code\nfor a group of statements:\n\n try_stmt ::= try1_stmt | try2_stmt\n try1_stmt ::= "try" ":" suite\n ("except" [expression ["," target]] ":" suite)+\n ["else" ":" suite]\n ["finally" ":" suite]\n try2_stmt ::= "try" ":" suite\n "finally" ":" suite\n\nChanged in version 2.5: In previous versions of Python,\n``try``...``except``...``finally`` did not work. ``try``...``except``\nhad to be nested in ``try``...``finally``.\n\nThe ``except`` clause(s) specify one or more exception handlers. When\nno exception occurs in the ``try`` clause, no exception handler is\nexecuted. When an exception occurs in the ``try`` suite, a search for\nan exception handler is started. This search inspects the except\nclauses in turn until one is found that matches the exception. An\nexpression-less except clause, if present, must be last; it matches\nany exception. For an except clause with an expression, that\nexpression is evaluated, and the clause matches the exception if the\nresulting object is "compatible" with the exception. An object is\ncompatible with an exception if it is the class or a base class of the\nexception object, a tuple containing an item compatible with the\nexception, or, in the (deprecated) case of string exceptions, is the\nraised string itself (note that the object identities must match, i.e.\nit must be the same string object, not just a string with the same\nvalue).\n\nIf no except clause matches the exception, the search for an exception\nhandler continues in the surrounding code and on the invocation stack.\n[1]\n\nIf the evaluation of an expression in the header of an except clause\nraises an exception, the original search for a handler is canceled and\na search starts for the new exception in the surrounding code and on\nthe call stack (it is treated as if the entire ``try`` statement\nraised the exception).\n\nWhen a matching except clause is found, the exception is assigned to\nthe target specified in that except clause, if present, and the except\nclause\'s suite is executed. All except clauses must have an\nexecutable block. When the end of this block is reached, execution\ncontinues normally after the entire try statement. (This means that\nif two nested handlers exist for the same exception, and the exception\noccurs in the try clause of the inner handler, the outer handler will\nnot handle the exception.)\n\nBefore an except clause\'s suite is executed, details about the\nexception are assigned to three variables in the ``sys`` module:\n``sys.exc_type`` receives the object identifying the exception;\n``sys.exc_value`` receives the exception\'s parameter;\n``sys.exc_traceback`` receives a traceback object (see section *The\nstandard type hierarchy*) identifying the point in the program where\nthe exception occurred. These details are also available through the\n``sys.exc_info()`` function, which returns a tuple ``(exc_type,\nexc_value, exc_traceback)``. Use of the corresponding variables is\ndeprecated in favor of this function, since their use is unsafe in a\nthreaded program. As of Python 1.5, the variables are restored to\ntheir previous values (before the call) when returning from a function\nthat handled an exception.\n\nThe optional ``else`` clause is executed if and when control flows off\nthe end of the ``try`` clause. [2] Exceptions in the ``else`` clause\nare not handled by the preceding ``except`` clauses.\n\nIf ``finally`` is present, it specifies a \'cleanup\' handler. The\n``try`` clause is executed, including any ``except`` and ``else``\nclauses. If an exception occurs in any of the clauses and is not\nhandled, the exception is temporarily saved. The ``finally`` clause is\nexecuted. If there is a saved exception, it is re-raised at the end\nof the ``finally`` clause. If the ``finally`` clause raises another\nexception or executes a ``return`` or ``break`` statement, the saved\nexception is lost. The exception information is not available to the\nprogram during execution of the ``finally`` clause.\n\nWhen a ``return``, ``break`` or ``continue`` statement is executed in\nthe ``try`` suite of a ``try``...``finally`` statement, the\n``finally`` clause is also executed \'on the way out.\' A ``continue``\nstatement is illegal in the ``finally`` clause. (The reason is a\nproblem with the current implementation --- this restriction may be\nlifted in the future).\n\nAdditional information on exceptions can be found in section\n*Exceptions*, and information on using the ``raise`` statement to\ngenerate exceptions may be found in section *The raise statement*.\n\n\nThe ``with`` statement\n======================\n\nNew in version 2.5.\n\nThe ``with`` statement is used to wrap the execution of a block with\nmethods defined by a context manager (see section *With Statement\nContext Managers*). This allows common\n``try``...``except``...``finally`` usage patterns to be encapsulated\nfor convenient reuse.\n\n with_stmt ::= "with" expression ["as" target] ":" suite\n\nThe execution of the ``with`` statement proceeds as follows:\n\n1. The context expression is evaluated to obtain a context manager.\n\n2. The context manager\'s ``__enter__()`` method is invoked.\n\n3. If a target was included in the ``with`` statement, the return\n value from ``__enter__()`` is assigned to it.\n\n Note: The ``with`` statement guarantees that if the ``__enter__()``\n method returns without an error, then ``__exit__()`` will always\n be called. Thus, if an error occurs during the assignment to the\n target list, it will be treated the same as an error occurring\n within the suite would be. See step 5 below.\n\n4. The suite is executed.\n\n5. The context manager\'s ``__exit__()`` method is invoked. If an\n exception caused the suite to be exited, its type, value, and\n traceback are passed as arguments to ``__exit__()``. Otherwise,\n three ``None`` arguments are supplied.\n\n If the suite was exited due to an exception, and the return value\n from the ``__exit__()`` method was false, the exception is\n reraised. If the return value was true, the exception is\n suppressed, and execution continues with the statement following\n the ``with`` statement.\n\n If the suite was exited for any reason other than an exception, the\n return value from ``__exit__()`` is ignored, and execution proceeds\n at the normal location for the kind of exit that was taken.\n\nNote: In Python 2.5, the ``with`` statement is only allowed when the\n ``with_statement`` feature has been enabled. It is always enabled\n in Python 2.6.\n\nSee also:\n\n **PEP 0343** - The "with" statement\n The specification, background, and examples for the Python\n ``with`` statement.\n\n\nFunction definitions\n====================\n\nA function definition defines a user-defined function object (see\nsection *The standard type hierarchy*):\n\n decorated ::= decorators (classdef | funcdef)\n decorators ::= decorator+\n decorator ::= "@" dotted_name ["(" [argument_list [","]] ")"] NEWLINE\n funcdef ::= "def" funcname "(" [parameter_list] ")" ":" suite\n dotted_name ::= identifier ("." identifier)*\n parameter_list ::= (defparameter ",")*\n ( "*" identifier [, "**" identifier]\n | "**" identifier\n | defparameter [","] )\n defparameter ::= parameter ["=" expression]\n sublist ::= parameter ("," parameter)* [","]\n parameter ::= identifier | "(" sublist ")"\n funcname ::= identifier\n\nA function definition is an executable statement. Its execution binds\nthe function name in the current local namespace to a function object\n(a wrapper around the executable code for the function). This\nfunction object contains a reference to the current global namespace\nas the global namespace to be used when the function is called.\n\nThe function definition does not execute the function body; this gets\nexecuted only when the function is called. [3]\n\nA function definition may be wrapped by one or more *decorator*\nexpressions. Decorator expressions are evaluated when the function is\ndefined, in the scope that contains the function definition. The\nresult must be a callable, which is invoked with the function object\nas the only argument. The returned value is bound to the function name\ninstead of the function object. Multiple decorators are applied in\nnested fashion. For example, the following code:\n\n @f1(arg)\n @f2\n def func(): pass\n\nis equivalent to:\n\n def func(): pass\n func = f1(arg)(f2(func))\n\nWhen one or more top-level parameters have the form *parameter* ``=``\n*expression*, the function is said to have "default parameter values."\nFor a parameter with a default value, the corresponding argument may\nbe omitted from a call, in which case the parameter\'s default value is\nsubstituted. If a parameter has a default value, all following\nparameters must also have a default value --- this is a syntactic\nrestriction that is not expressed by the grammar.\n\n**Default parameter values are evaluated when the function definition\nis executed.** This means that the expression is evaluated once, when\nthe function is defined, and that that same "pre-computed" value is\nused for each call. This is especially important to understand when a\ndefault parameter is a mutable object, such as a list or a dictionary:\nif the function modifies the object (e.g. by appending an item to a\nlist), the default value is in effect modified. This is generally not\nwhat was intended. A way around this is to use ``None`` as the\ndefault, and explicitly test for it in the body of the function, e.g.:\n\n def whats_on_the_telly(penguin=None):\n if penguin is None:\n penguin = []\n penguin.append("property of the zoo")\n return penguin\n\nFunction call semantics are described in more detail in section\n*Calls*. A function call always assigns values to all parameters\nmentioned in the parameter list, either from position arguments, from\nkeyword arguments, or from default values. If the form\n"``*identifier``" is present, it is initialized to a tuple receiving\nany excess positional parameters, defaulting to the empty tuple. If\nthe form "``**identifier``" is present, it is initialized to a new\ndictionary receiving any excess keyword arguments, defaulting to a new\nempty dictionary.\n\nIt is also possible to create anonymous functions (functions not bound\nto a name), for immediate use in expressions. This uses lambda forms,\ndescribed in section *Expression lists*. Note that the lambda form is\nmerely a shorthand for a simplified function definition; a function\ndefined in a "``def``" statement can be passed around or assigned to\nanother name just like a function defined by a lambda form. The\n"``def``" form is actually more powerful since it allows the execution\nof multiple statements.\n\n**Programmer\'s note:** Functions are first-class objects. A "``def``"\nform executed inside a function definition defines a local function\nthat can be returned or passed around. Free variables used in the\nnested function can access the local variables of the function\ncontaining the def. See section *Naming and binding* for details.\n\n\nClass definitions\n=================\n\nA class definition defines a class object (see section *The standard\ntype hierarchy*):\n\n classdef ::= "class" classname [inheritance] ":" suite\n inheritance ::= "(" [expression_list] ")"\n classname ::= identifier\n\nA class definition is an executable statement. It first evaluates the\ninheritance list, if present. Each item in the inheritance list\nshould evaluate to a class object or class type which allows\nsubclassing. The class\'s suite is then executed in a new execution\nframe (see section *Naming and binding*), using a newly created local\nnamespace and the original global namespace. (Usually, the suite\ncontains only function definitions.) When the class\'s suite finishes\nexecution, its execution frame is discarded but its local namespace is\nsaved. [4] A class object is then created using the inheritance list\nfor the base classes and the saved local namespace for the attribute\ndictionary. The class name is bound to this class object in the\noriginal local namespace.\n\n**Programmer\'s note:** Variables defined in the class definition are\nclass variables; they are shared by all instances. To create instance\nvariables, they can be set in a method with ``self.name = value``.\nBoth class and instance variables are accessible through the notation\n"``self.name``", and an instance variable hides a class variable with\nthe same name when accessed in this way. Class variables can be used\nas defaults for instance variables, but using mutable values there can\nlead to unexpected results. For *new-style class*es, descriptors can\nbe used to create instance variables with different implementation\ndetails.\n\nClass definitions, like function definitions, may be wrapped by one or\nmore *decorator* expressions. The evaluation rules for the decorator\nexpressions are the same as for functions. The result must be a class\nobject, which is then bound to the class name.\n\n-[ Footnotes ]-\n\n[1] The exception is propagated to the invocation stack only if there\n is no ``finally`` clause that negates the exception.\n\n[2] Currently, control "flows off the end" except in the case of an\n exception or the execution of a ``return``, ``continue``, or\n ``break`` statement.\n\n[3] A string literal appearing as the first statement in the function\n body is transformed into the function\'s ``__doc__`` attribute and\n therefore the function\'s *docstring*.\n\n[4] A string literal appearing as the first statement in the class\n body is transformed into the namespace\'s ``__doc__`` item and\n therefore the class\'s *docstring*.\n', + 'context-managers': u'\nWith Statement Context Managers\n*******************************\n\nNew in version 2.5.\n\nA *context manager* is an object that defines the runtime context to\nbe established when executing a ``with`` statement. The context\nmanager handles the entry into, and the exit from, the desired runtime\ncontext for the execution of the block of code. Context managers are\nnormally invoked using the ``with`` statement (described in section\n*The with statement*), but can also be used by directly invoking their\nmethods.\n\nTypical uses of context managers include saving and restoring various\nkinds of global state, locking and unlocking resources, closing opened\nfiles, etc.\n\nFor more information on context managers, see *Context Manager Types*.\n\nobject.__enter__(self)\n\n Enter the runtime context related to this object. The ``with``\n statement will bind this method\'s return value to the target(s)\n specified in the ``as`` clause of the statement, if any.\n\nobject.__exit__(self, exc_type, exc_value, traceback)\n\n Exit the runtime context related to this object. The parameters\n describe the exception that caused the context to be exited. If the\n context was exited without an exception, all three arguments will\n be ``None``.\n\n If an exception is supplied, and the method wishes to suppress the\n exception (i.e., prevent it from being propagated), it should\n return a true value. Otherwise, the exception will be processed\n normally upon exit from this method.\n\n Note that ``__exit__()`` methods should not reraise the passed-in\n exception; this is the caller\'s responsibility.\n\nSee also:\n\n **PEP 0343** - The "with" statement\n The specification, background, and examples for the Python\n ``with`` statement.\n', 'continue': u'\nThe ``continue`` statement\n**************************\n\n continue_stmt ::= "continue"\n\n``continue`` may only occur syntactically nested in a ``for`` or\n``while`` loop, but not nested in a function or class definition or\n``finally`` clause within that loop. It continues with the next cycle\nof the nearest enclosing loop.\n\nWhen ``continue`` passes control out of a ``try`` statement with a\n``finally`` clause, that ``finally`` clause is executed before really\nstarting the next loop cycle.\n', 'conversions': u'\nArithmetic conversions\n**********************\n\nWhen a description of an arithmetic operator below uses the phrase\n"the numeric arguments are converted to a common type," the arguments\nare coerced using the coercion rules listed at *Coercion rules*. If\nboth arguments are standard numeric types, the following coercions are\napplied:\n\n* If either argument is a complex number, the other is converted to\n complex;\n\n* otherwise, if either argument is a floating point number, the other\n is converted to floating point;\n\n* otherwise, if either argument is a long integer, the other is\n converted to long integer;\n\n* otherwise, both must be plain integers and no conversion is\n necessary.\n\nSome additional rules apply for certain operators (e.g., a string left\nargument to the \'%\' operator). Extensions can define their own\ncoercions.\n', - 'customization': u'\nBasic customization\n*******************\n\nobject.__new__(cls[, ...])\n\n Called to create a new instance of class *cls*. ``__new__()`` is a\n static method (special-cased so you need not declare it as such)\n that takes the class of which an instance was requested as its\n first argument. The remaining arguments are those passed to the\n object constructor expression (the call to the class). The return\n value of ``__new__()`` should be the new object instance (usually\n an instance of *cls*).\n\n Typical implementations create a new instance of the class by\n invoking the superclass\'s ``__new__()`` method using\n ``super(currentclass, cls).__new__(cls[, ...])`` with appropriate\n arguments and then modifying the newly-created instance as\n necessary before returning it.\n\n If ``__new__()`` returns an instance of *cls*, then the new\n instance\'s ``__init__()`` method will be invoked like\n ``__init__(self[, ...])``, where *self* is the new instance and the\n remaining arguments are the same as were passed to ``__new__()``.\n\n If ``__new__()`` does not return an instance of *cls*, then the new\n instance\'s ``__init__()`` method will not be invoked.\n\n ``__new__()`` is intended mainly to allow subclasses of immutable\n types (like int, str, or tuple) to customize instance creation. It\n is also commonly overridden in custom metaclasses in order to\n customize class creation.\n\nobject.__init__(self[, ...])\n\n Called when the instance is created. The arguments are those\n passed to the class constructor expression. If a base class has an\n ``__init__()`` method, the derived class\'s ``__init__()`` method,\n if any, must explicitly call it to ensure proper initialization of\n the base class part of the instance; for example:\n ``BaseClass.__init__(self, [args...])``. As a special constraint\n on constructors, no value may be returned; doing so will cause a\n ``TypeError`` to be raised at runtime.\n\nobject.__del__(self)\n\n Called when the instance is about to be destroyed. This is also\n called a destructor. If a base class has a ``__del__()`` method,\n the derived class\'s ``__del__()`` method, if any, must explicitly\n call it to ensure proper deletion of the base class part of the\n instance. Note that it is possible (though not recommended!) for\n the ``__del__()`` method to postpone destruction of the instance by\n creating a new reference to it. It may then be called at a later\n time when this new reference is deleted. It is not guaranteed that\n ``__del__()`` methods are called for objects that still exist when\n the interpreter exits.\n\n Note: ``del x`` doesn\'t directly call ``x.__del__()`` --- the former\n decrements the reference count for ``x`` by one, and the latter\n is only called when ``x``\'s reference count reaches zero. Some\n common situations that may prevent the reference count of an\n object from going to zero include: circular references between\n objects (e.g., a doubly-linked list or a tree data structure with\n parent and child pointers); a reference to the object on the\n stack frame of a function that caught an exception (the traceback\n stored in ``sys.exc_traceback`` keeps the stack frame alive); or\n a reference to the object on the stack frame that raised an\n unhandled exception in interactive mode (the traceback stored in\n ``sys.last_traceback`` keeps the stack frame alive). The first\n situation can only be remedied by explicitly breaking the cycles;\n the latter two situations can be resolved by storing ``None`` in\n ``sys.exc_traceback`` or ``sys.last_traceback``. Circular\n references which are garbage are detected when the option cycle\n detector is enabled (it\'s on by default), but can only be cleaned\n up if there are no Python-level ``__del__()`` methods involved.\n Refer to the documentation for the ``gc`` module for more\n information about how ``__del__()`` methods are handled by the\n cycle detector, particularly the description of the ``garbage``\n value.\n\n Warning: Due to the precarious circumstances under which ``__del__()``\n methods are invoked, exceptions that occur during their execution\n are ignored, and a warning is printed to ``sys.stderr`` instead.\n Also, when ``__del__()`` is invoked in response to a module being\n deleted (e.g., when execution of the program is done), other\n globals referenced by the ``__del__()`` method may already have\n been deleted. For this reason, ``__del__()`` methods should do\n the absolute minimum needed to maintain external invariants.\n Starting with version 1.5, Python guarantees that globals whose\n name begins with a single underscore are deleted from their\n module before other globals are deleted; if no other references\n to such globals exist, this may help in assuring that imported\n modules are still available at the time when the ``__del__()``\n method is called.\n\nobject.__repr__(self)\n\n Called by the ``repr()`` built-in function and by string\n conversions (reverse quotes) to compute the "official" string\n representation of an object. If at all possible, this should look\n like a valid Python expression that could be used to recreate an\n object with the same value (given an appropriate environment). If\n this is not possible, a string of the form ``<...some useful\n description...>`` should be returned. The return value must be a\n string object. If a class defines ``__repr__()`` but not\n ``__str__()``, then ``__repr__()`` is also used when an "informal"\n string representation of instances of that class is required.\n\n This is typically used for debugging, so it is important that the\n representation is information-rich and unambiguous.\n\nobject.__str__(self)\n\n Called by the ``str()`` built-in function and by the ``print``\n statement to compute the "informal" string representation of an\n object. This differs from ``__repr__()`` in that it does not have\n to be a valid Python expression: a more convenient or concise\n representation may be used instead. The return value must be a\n string object.\n\nobject.__lt__(self, other)\nobject.__le__(self, other)\nobject.__eq__(self, other)\nobject.__ne__(self, other)\nobject.__gt__(self, other)\nobject.__ge__(self, other)\n\n Added in version 2.1.\n\n These are the so-called "rich comparison" methods, and are called\n for comparison operators in preference to ``__cmp__()`` below. The\n correspondence between operator symbols and method names is as\n follows: ``xy`` call ``x.__ne__(y)``, ``x>y`` calls ``x.__gt__(y)``, and\n ``x>=y`` calls ``x.__ge__(y)``.\n\n A rich comparison method may return the singleton\n ``NotImplemented`` if it does not implement the operation for a\n given pair of arguments. By convention, ``False`` and ``True`` are\n returned for a successful comparison. However, these methods can\n return any value, so if the comparison operator is used in a\n Boolean context (e.g., in the condition of an ``if`` statement),\n Python will call ``bool()`` on the value to determine if the result\n is true or false.\n\n There are no implied relationships among the comparison operators.\n The truth of ``x==y`` does not imply that ``x!=y`` is false.\n Accordingly, when defining ``__eq__()``, one should also define\n ``__ne__()`` so that the operators will behave as expected. See\n the paragraph on ``__hash__()`` for some important notes on\n creating *hashable* objects which support custom comparison\n operations and are usable as dictionary keys.\n\n There are no swapped-argument versions of these methods (to be used\n when the left argument does not support the operation but the right\n argument does); rather, ``__lt__()`` and ``__gt__()`` are each\n other\'s reflection, ``__le__()`` and ``__ge__()`` are each other\'s\n reflection, and ``__eq__()`` and ``__ne__()`` are their own\n reflection.\n\n Arguments to rich comparison methods are never coerced.\n\nobject.__cmp__(self, other)\n\n Called by comparison operations if rich comparison (see above) is\n not defined. Should return a negative integer if ``self < other``,\n zero if ``self == other``, a positive integer if ``self > other``.\n If no ``__cmp__()``, ``__eq__()`` or ``__ne__()`` operation is\n defined, class instances are compared by object identity\n ("address"). See also the description of ``__hash__()`` for some\n important notes on creating *hashable* objects which support custom\n comparison operations and are usable as dictionary keys. (Note: the\n restriction that exceptions are not propagated by ``__cmp__()`` has\n been removed since Python 1.5.)\n\nobject.__rcmp__(self, other)\n\n Changed in version 2.1: No longer supported.\n\nobject.__hash__(self)\n\n Called for the key object for dictionary operations, and by the\n built-in function ``hash()``. Should return an integer usable as a\n hash value for dictionary operations. The only required property\n is that objects which compare equal have the same hash value; it is\n advised to somehow mix together (e.g., using exclusive or) the hash\n values for the components of the object that also play a part in\n comparison of objects.\n\n If a class does not define a ``__cmp__()`` or ``__eq__()`` method\n it should not define a ``__hash__()`` operation either; if it\n defines ``__cmp__()`` or ``__eq__()`` but not ``__hash__()``, its\n instances will not be usable as dictionary keys. If a class\n defines mutable objects and implements a ``__cmp__()`` or\n ``__eq__()`` method, it should not implement ``__hash__()``, since\n the dictionary implementation requires that a key\'s hash value is\n immutable (if the object\'s hash value changes, it will be in the\n wrong hash bucket).\n\n User-defined classes have ``__cmp__()`` and ``__hash__()`` methods\n by default; with them, all objects compare unequal and\n ``x.__hash__()`` returns ``id(x)``.\n\n Changed in version 2.5: ``__hash__()`` may now also return a long\n integer object; the 32-bit integer is then derived from the hash of\n that object.\n\nobject.__nonzero__(self)\n\n Called to implement truth value testing, and the built-in operation\n ``bool()``; should return ``False`` or ``True``, or their integer\n equivalents ``0`` or ``1``. When this method is not defined,\n ``__len__()`` is called, if it is defined (see below). If a class\n defines neither ``__len__()`` nor ``__nonzero__()``, all its\n instances are considered true.\n\nobject.__unicode__(self)\n\n Called to implement ``unicode()`` builtin; should return a Unicode\n object. When this method is not defined, string conversion is\n attempted, and the result of string conversion is converted to\n Unicode using the system default encoding.\n', - 'debugger': u'\n``pdb`` --- The Python Debugger\n*******************************\n\nThe module ``pdb`` defines an interactive source code debugger for\nPython programs. It supports setting (conditional) breakpoints and\nsingle stepping at the source line level, inspection of stack frames,\nsource code listing, and evaluation of arbitrary Python code in the\ncontext of any stack frame. It also supports post-mortem debugging\nand can be called under program control.\n\nThe debugger is extensible --- it is actually defined as the class\n``Pdb``. This is currently undocumented but easily understood by\nreading the source. The extension interface uses the modules ``bdb``\n(undocumented) and ``cmd``.\n\nThe debugger\'s prompt is ``(Pdb)``. Typical usage to run a program\nunder control of the debugger is:\n\n >>> import pdb\n >>> import mymodule\n >>> pdb.run(\'mymodule.test()\')\n > (0)?()\n (Pdb) continue\n > (1)?()\n (Pdb) continue\n NameError: \'spam\'\n > (1)?()\n (Pdb)\n\n``pdb.py`` can also be invoked as a script to debug other scripts.\nFor example:\n\n python -m pdb myscript.py\n\nWhen invoked as a script, pdb will automatically enter post-mortem\ndebugging if the program being debugged exits abnormally. After post-\nmortem debugging (or after normal exit of the program), pdb will\nrestart the program. Automatic restarting preserves pdb\'s state (such\nas breakpoints) and in most cases is more useful than quitting the\ndebugger upon program\'s exit.\n\nAdded in version 2.4: Restarting post-mortem behavior added.\n\nTypical usage to inspect a crashed program is:\n\n >>> import pdb\n >>> import mymodule\n >>> mymodule.test()\n Traceback (most recent call last):\n File "", line 1, in ?\n File "./mymodule.py", line 4, in test\n test2()\n File "./mymodule.py", line 3, in test2\n print spam\n NameError: spam\n >>> pdb.pm()\n > ./mymodule.py(3)test2()\n -> print spam\n (Pdb)\n\nThe module defines the following functions; each enters the debugger\nin a slightly different way:\n\npdb.run(statement[, globals[, locals]])\n\n Execute the *statement* (given as a string) under debugger control.\n The debugger prompt appears before any code is executed; you can\n set breakpoints and type ``continue``, or you can step through the\n statement using ``step`` or ``next`` (all these commands are\n explained below). The optional *globals* and *locals* arguments\n specify the environment in which the code is executed; by default\n the dictionary of the module ``__main__`` is used. (See the\n explanation of the ``exec`` statement or the ``eval()`` built-in\n function.)\n\npdb.runeval(expression[, globals[, locals]])\n\n Evaluate the *expression* (given as a string) under debugger\n control. When ``runeval()`` returns, it returns the value of the\n expression. Otherwise this function is similar to ``run()``.\n\npdb.runcall(function[, argument, ...])\n\n Call the *function* (a function or method object, not a string)\n with the given arguments. When ``runcall()`` returns, it returns\n whatever the function call returned. The debugger prompt appears\n as soon as the function is entered.\n\npdb.set_trace()\n\n Enter the debugger at the calling stack frame. This is useful to\n hard-code a breakpoint at a given point in a program, even if the\n code is not otherwise being debugged (e.g. when an assertion\n fails).\n\npdb.post_mortem([traceback])\n\n Enter post-mortem debugging of the given *traceback* object. If no\n *traceback* is given, it uses the one of the exception that is\n currently being handled (an exception must be being handled if the\n default is to be used).\n\npdb.pm()\n\n Enter post-mortem debugging of the traceback found in\n ``sys.last_traceback``.\n', + 'customization': u'\nBasic customization\n*******************\n\nobject.__new__(cls[, ...])\n\n Called to create a new instance of class *cls*. ``__new__()`` is a\n static method (special-cased so you need not declare it as such)\n that takes the class of which an instance was requested as its\n first argument. The remaining arguments are those passed to the\n object constructor expression (the call to the class). The return\n value of ``__new__()`` should be the new object instance (usually\n an instance of *cls*).\n\n Typical implementations create a new instance of the class by\n invoking the superclass\'s ``__new__()`` method using\n ``super(currentclass, cls).__new__(cls[, ...])`` with appropriate\n arguments and then modifying the newly-created instance as\n necessary before returning it.\n\n If ``__new__()`` returns an instance of *cls*, then the new\n instance\'s ``__init__()`` method will be invoked like\n ``__init__(self[, ...])``, where *self* is the new instance and the\n remaining arguments are the same as were passed to ``__new__()``.\n\n If ``__new__()`` does not return an instance of *cls*, then the new\n instance\'s ``__init__()`` method will not be invoked.\n\n ``__new__()`` is intended mainly to allow subclasses of immutable\n types (like int, str, or tuple) to customize instance creation. It\n is also commonly overridden in custom metaclasses in order to\n customize class creation.\n\nobject.__init__(self[, ...])\n\n Called when the instance is created. The arguments are those\n passed to the class constructor expression. If a base class has an\n ``__init__()`` method, the derived class\'s ``__init__()`` method,\n if any, must explicitly call it to ensure proper initialization of\n the base class part of the instance; for example:\n ``BaseClass.__init__(self, [args...])``. As a special constraint\n on constructors, no value may be returned; doing so will cause a\n ``TypeError`` to be raised at runtime.\n\nobject.__del__(self)\n\n Called when the instance is about to be destroyed. This is also\n called a destructor. If a base class has a ``__del__()`` method,\n the derived class\'s ``__del__()`` method, if any, must explicitly\n call it to ensure proper deletion of the base class part of the\n instance. Note that it is possible (though not recommended!) for\n the ``__del__()`` method to postpone destruction of the instance by\n creating a new reference to it. It may then be called at a later\n time when this new reference is deleted. It is not guaranteed that\n ``__del__()`` methods are called for objects that still exist when\n the interpreter exits.\n\n Note: ``del x`` doesn\'t directly call ``x.__del__()`` --- the former\n decrements the reference count for ``x`` by one, and the latter\n is only called when ``x``\'s reference count reaches zero. Some\n common situations that may prevent the reference count of an\n object from going to zero include: circular references between\n objects (e.g., a doubly-linked list or a tree data structure with\n parent and child pointers); a reference to the object on the\n stack frame of a function that caught an exception (the traceback\n stored in ``sys.exc_traceback`` keeps the stack frame alive); or\n a reference to the object on the stack frame that raised an\n unhandled exception in interactive mode (the traceback stored in\n ``sys.last_traceback`` keeps the stack frame alive). The first\n situation can only be remedied by explicitly breaking the cycles;\n the latter two situations can be resolved by storing ``None`` in\n ``sys.exc_traceback`` or ``sys.last_traceback``. Circular\n references which are garbage are detected when the option cycle\n detector is enabled (it\'s on by default), but can only be cleaned\n up if there are no Python-level ``__del__()`` methods involved.\n Refer to the documentation for the ``gc`` module for more\n information about how ``__del__()`` methods are handled by the\n cycle detector, particularly the description of the ``garbage``\n value.\n\n Warning: Due to the precarious circumstances under which ``__del__()``\n methods are invoked, exceptions that occur during their execution\n are ignored, and a warning is printed to ``sys.stderr`` instead.\n Also, when ``__del__()`` is invoked in response to a module being\n deleted (e.g., when execution of the program is done), other\n globals referenced by the ``__del__()`` method may already have\n been deleted. For this reason, ``__del__()`` methods should do\n the absolute minimum needed to maintain external invariants.\n Starting with version 1.5, Python guarantees that globals whose\n name begins with a single underscore are deleted from their\n module before other globals are deleted; if no other references\n to such globals exist, this may help in assuring that imported\n modules are still available at the time when the ``__del__()``\n method is called.\n\nobject.__repr__(self)\n\n Called by the ``repr()`` built-in function and by string\n conversions (reverse quotes) to compute the "official" string\n representation of an object. If at all possible, this should look\n like a valid Python expression that could be used to recreate an\n object with the same value (given an appropriate environment). If\n this is not possible, a string of the form ``<...some useful\n description...>`` should be returned. The return value must be a\n string object. If a class defines ``__repr__()`` but not\n ``__str__()``, then ``__repr__()`` is also used when an "informal"\n string representation of instances of that class is required.\n\n This is typically used for debugging, so it is important that the\n representation is information-rich and unambiguous.\n\nobject.__str__(self)\n\n Called by the ``str()`` built-in function and by the ``print``\n statement to compute the "informal" string representation of an\n object. This differs from ``__repr__()`` in that it does not have\n to be a valid Python expression: a more convenient or concise\n representation may be used instead. The return value must be a\n string object.\n\nobject.__lt__(self, other)\nobject.__le__(self, other)\nobject.__eq__(self, other)\nobject.__ne__(self, other)\nobject.__gt__(self, other)\nobject.__ge__(self, other)\n\n New in version 2.1.\n\n These are the so-called "rich comparison" methods, and are called\n for comparison operators in preference to ``__cmp__()`` below. The\n correspondence between operator symbols and method names is as\n follows: ``xy`` call ``x.__ne__(y)``, ``x>y`` calls ``x.__gt__(y)``, and\n ``x>=y`` calls ``x.__ge__(y)``.\n\n A rich comparison method may return the singleton\n ``NotImplemented`` if it does not implement the operation for a\n given pair of arguments. By convention, ``False`` and ``True`` are\n returned for a successful comparison. However, these methods can\n return any value, so if the comparison operator is used in a\n Boolean context (e.g., in the condition of an ``if`` statement),\n Python will call ``bool()`` on the value to determine if the result\n is true or false.\n\n There are no implied relationships among the comparison operators.\n The truth of ``x==y`` does not imply that ``x!=y`` is false.\n Accordingly, when defining ``__eq__()``, one should also define\n ``__ne__()`` so that the operators will behave as expected. See\n the paragraph on ``__hash__()`` for some important notes on\n creating *hashable* objects which support custom comparison\n operations and are usable as dictionary keys.\n\n There are no swapped-argument versions of these methods (to be used\n when the left argument does not support the operation but the right\n argument does); rather, ``__lt__()`` and ``__gt__()`` are each\n other\'s reflection, ``__le__()`` and ``__ge__()`` are each other\'s\n reflection, and ``__eq__()`` and ``__ne__()`` are their own\n reflection.\n\n Arguments to rich comparison methods are never coerced.\n\nobject.__cmp__(self, other)\n\n Called by comparison operations if rich comparison (see above) is\n not defined. Should return a negative integer if ``self < other``,\n zero if ``self == other``, a positive integer if ``self > other``.\n If no ``__cmp__()``, ``__eq__()`` or ``__ne__()`` operation is\n defined, class instances are compared by object identity\n ("address"). See also the description of ``__hash__()`` for some\n important notes on creating *hashable* objects which support custom\n comparison operations and are usable as dictionary keys. (Note: the\n restriction that exceptions are not propagated by ``__cmp__()`` has\n been removed since Python 1.5.)\n\nobject.__rcmp__(self, other)\n\n Changed in version 2.1: No longer supported.\n\nobject.__hash__(self)\n\n Called for the key object for dictionary operations, and by the\n built-in function ``hash()``. Should return an integer usable as a\n hash value for dictionary operations. The only required property\n is that objects which compare equal have the same hash value; it is\n advised to somehow mix together (e.g., using exclusive or) the hash\n values for the components of the object that also play a part in\n comparison of objects.\n\n If a class does not define a ``__cmp__()`` or ``__eq__()`` method\n it should not define a ``__hash__()`` operation either; if it\n defines ``__cmp__()`` or ``__eq__()`` but not ``__hash__()``, its\n instances will not be usable as dictionary keys. If a class\n defines mutable objects and implements a ``__cmp__()`` or\n ``__eq__()`` method, it should not implement ``__hash__()``, since\n the dictionary implementation requires that a key\'s hash value is\n immutable (if the object\'s hash value changes, it will be in the\n wrong hash bucket).\n\n User-defined classes have ``__cmp__()`` and ``__hash__()`` methods\n by default; with them, all objects compare unequal (except with\n themselves) and ``x.__hash__()`` returns ``id(x)``.\n\n Classes which inherit a ``__hash__()`` method from a parent class\n but change the meaning of ``__cmp__()`` or ``__eq__()`` such that\n the hash value returned is no longer appropriate (e.g. by switching\n to a value-based concept of equality instead of the default\n identity based equality) can explicitly flag themselves as being\n unhashable by setting ``__hash__ = None`` in the class definition.\n Doing so means that not only will instances of the class raise an\n appropriate ``TypeError`` when a program attempts to retrieve their\n hash value, but they will also be correctly identified as\n unhashable when checking ``isinstance(obj, collections.Hashable)``\n (unlike classes which define their own ``__hash__()`` to explicitly\n raise ``TypeError``).\n\n Changed in version 2.5: ``__hash__()`` may now also return a long\n integer object; the 32-bit integer is then derived from the hash of\n that object.\n\n Changed in version 2.6: ``__hash__`` may now be set to ``None`` to\n explicitly flag instances of a class as unhashable.\n\nobject.__nonzero__(self)\n\n Called to implement truth value testing, and the built-in operation\n ``bool()``; should return ``False`` or ``True``, or their integer\n equivalents ``0`` or ``1``. When this method is not defined,\n ``__len__()`` is called, if it is defined (see below). If a class\n defines neither ``__len__()`` nor ``__nonzero__()``, all its\n instances are considered true.\n\nobject.__unicode__(self)\n\n Called to implement ``unicode()`` builtin; should return a Unicode\n object. When this method is not defined, string conversion is\n attempted, and the result of string conversion is converted to\n Unicode using the system default encoding.\n', + 'debugger': u'\n``pdb`` --- The Python Debugger\n*******************************\n\nThe module ``pdb`` defines an interactive source code debugger for\nPython programs. It supports setting (conditional) breakpoints and\nsingle stepping at the source line level, inspection of stack frames,\nsource code listing, and evaluation of arbitrary Python code in the\ncontext of any stack frame. It also supports post-mortem debugging\nand can be called under program control.\n\nThe debugger is extensible --- it is actually defined as the class\n``Pdb``. This is currently undocumented but easily understood by\nreading the source. The extension interface uses the modules ``bdb``\n(undocumented) and ``cmd``.\n\nThe debugger\'s prompt is ``(Pdb)``. Typical usage to run a program\nunder control of the debugger is:\n\n >>> import pdb\n >>> import mymodule\n >>> pdb.run(\'mymodule.test()\')\n > (0)?()\n (Pdb) continue\n > (1)?()\n (Pdb) continue\n NameError: \'spam\'\n > (1)?()\n (Pdb)\n\n``pdb.py`` can also be invoked as a script to debug other scripts.\nFor example:\n\n python -m pdb myscript.py\n\nWhen invoked as a script, pdb will automatically enter post-mortem\ndebugging if the program being debugged exits abnormally. After post-\nmortem debugging (or after normal exit of the program), pdb will\nrestart the program. Automatic restarting preserves pdb\'s state (such\nas breakpoints) and in most cases is more useful than quitting the\ndebugger upon program\'s exit.\n\nNew in version 2.4: Restarting post-mortem behavior added.\n\nTypical usage to inspect a crashed program is:\n\n >>> import pdb\n >>> import mymodule\n >>> mymodule.test()\n Traceback (most recent call last):\n File "", line 1, in ?\n File "./mymodule.py", line 4, in test\n test2()\n File "./mymodule.py", line 3, in test2\n print spam\n NameError: spam\n >>> pdb.pm()\n > ./mymodule.py(3)test2()\n -> print spam\n (Pdb)\n\nThe module defines the following functions; each enters the debugger\nin a slightly different way:\n\npdb.run(statement[, globals[, locals]])\n\n Execute the *statement* (given as a string) under debugger control.\n The debugger prompt appears before any code is executed; you can\n set breakpoints and type ``continue``, or you can step through the\n statement using ``step`` or ``next`` (all these commands are\n explained below). The optional *globals* and *locals* arguments\n specify the environment in which the code is executed; by default\n the dictionary of the module ``__main__`` is used. (See the\n explanation of the ``exec`` statement or the ``eval()`` built-in\n function.)\n\npdb.runeval(expression[, globals[, locals]])\n\n Evaluate the *expression* (given as a string) under debugger\n control. When ``runeval()`` returns, it returns the value of the\n expression. Otherwise this function is similar to ``run()``.\n\npdb.runcall(function[, argument, ...])\n\n Call the *function* (a function or method object, not a string)\n with the given arguments. When ``runcall()`` returns, it returns\n whatever the function call returned. The debugger prompt appears\n as soon as the function is entered.\n\npdb.set_trace()\n\n Enter the debugger at the calling stack frame. This is useful to\n hard-code a breakpoint at a given point in a program, even if the\n code is not otherwise being debugged (e.g. when an assertion\n fails).\n\npdb.post_mortem([traceback])\n\n Enter post-mortem debugging of the given *traceback* object. If no\n *traceback* is given, it uses the one of the exception that is\n currently being handled (an exception must be being handled if the\n default is to be used).\n\npdb.pm()\n\n Enter post-mortem debugging of the traceback found in\n ``sys.last_traceback``.\n', 'del': u'\nThe ``del`` statement\n*********************\n\n del_stmt ::= "del" target_list\n\nDeletion is recursively defined very similar to the way assignment is\ndefined. Rather that spelling it out in full details, here are some\nhints.\n\nDeletion of a target list recursively deletes each target, from left\nto right.\n\nDeletion of a name removes the binding of that name from the local or\nglobal namespace, depending on whether the name occurs in a ``global``\nstatement in the same code block. If the name is unbound, a\n``NameError`` exception will be raised.\n\nIt is illegal to delete a name from the local namespace if it occurs\nas a free variable in a nested block.\n\nDeletion of attribute references, subscriptions and slicings is passed\nto the primary object involved; deletion of a slicing is in general\nequivalent to assignment of an empty slice of the right type (but even\nthis is determined by the sliced object).\n', 'dict': u'\nDictionary displays\n*******************\n\nA dictionary display is a possibly empty series of key/datum pairs\nenclosed in curly braces:\n\n dict_display ::= "{" [key_datum_list] "}"\n key_datum_list ::= key_datum ("," key_datum)* [","]\n key_datum ::= expression ":" expression\n\nA dictionary display yields a new dictionary object.\n\nThe key/datum pairs are evaluated from left to right to define the\nentries of the dictionary: each key object is used as a key into the\ndictionary to store the corresponding datum.\n\nRestrictions on the types of the key values are listed earlier in\nsection *The standard type hierarchy*. (To summarize, the key type\nshould be *hashable*, which excludes all mutable objects.) Clashes\nbetween duplicate keys are not detected; the last datum (textually\nrightmost in the display) stored for a given key value prevails.\n', 'dynamic-features': u'\nInteraction with dynamic features\n*********************************\n\nThere are several cases where Python statements are illegal when used\nin conjunction with nested scopes that contain free variables.\n\nIf a variable is referenced in an enclosing scope, it is illegal to\ndelete the name. An error will be reported at compile time.\n\nIf the wild card form of import --- ``import *`` --- is used in a\nfunction and the function contains or is a nested block with free\nvariables, the compiler will raise a ``SyntaxError``.\n\nIf ``exec`` is used in a function and the function contains or is a\nnested block with free variables, the compiler will raise a\n``SyntaxError`` unless the exec explicitly specifies the local\nnamespace for the ``exec``. (In other words, ``exec obj`` would be\nillegal, but ``exec obj in ns`` would be legal.)\n\nThe ``eval()``, ``execfile()``, and ``input()`` functions and the\n``exec`` statement do not have access to the full environment for\nresolving names. Names may be resolved in the local and global\nnamespaces of the caller. Free variables are not resolved in the\nnearest enclosing namespace, but in the global namespace. [1] The\n``exec`` statement and the ``eval()`` and ``execfile()`` functions\nhave optional arguments to override the global and local namespace.\nIf only one namespace is specified, it is used for both.\n', @@ -36,48 +36,48 @@ 'exprlists': u'\nExpression lists\n****************\n\n expression_list ::= expression ( "," expression )* [","]\n\nAn expression list containing at least one comma yields a tuple. The\nlength of the tuple is the number of expressions in the list. The\nexpressions are evaluated from left to right.\n\nThe trailing comma is required only to create a single tuple (a.k.a. a\n*singleton*); it is optional in all other cases. A single expression\nwithout a trailing comma doesn\'t create a tuple, but rather yields the\nvalue of that expression. (To create an empty tuple, use an empty pair\nof parentheses: ``()``.)\n', 'floating': u'\nFloating point literals\n***********************\n\nFloating point literals are described by the following lexical\ndefinitions:\n\n floatnumber ::= pointfloat | exponentfloat\n pointfloat ::= [intpart] fraction | intpart "."\n exponentfloat ::= (intpart | pointfloat) exponent\n intpart ::= digit+\n fraction ::= "." digit+\n exponent ::= ("e" | "E") ["+" | "-"] digit+\n\nNote that the integer and exponent parts of floating point numbers can\nlook like octal integers, but are interpreted using radix 10. For\nexample, ``077e010`` is legal, and denotes the same number as\n``77e10``. The allowed range of floating point literals is\nimplementation-dependent. Some examples of floating point literals:\n\n 3.14 10. .001 1e100 3.14e-10 0e0\n\nNote that numeric literals do not include a sign; a phrase like ``-1``\nis actually an expression composed of the unary operator ``-`` and the\nliteral ``1``.\n', 'for': u'\nThe ``for`` statement\n*********************\n\nThe ``for`` statement is used to iterate over the elements of a\nsequence (such as a string, tuple or list) or other iterable object:\n\n for_stmt ::= "for" target_list "in" expression_list ":" suite\n ["else" ":" suite]\n\nThe expression list is evaluated once; it should yield an iterable\nobject. An iterator is created for the result of the\n``expression_list``. The suite is then executed once for each item\nprovided by the iterator, in the order of ascending indices. Each\nitem in turn is assigned to the target list using the standard rules\nfor assignments, and then the suite is executed. When the items are\nexhausted (which is immediately when the sequence is empty), the suite\nin the ``else`` clause, if present, is executed, and the loop\nterminates.\n\nA ``break`` statement executed in the first suite terminates the loop\nwithout executing the ``else`` clause\'s suite. A ``continue``\nstatement executed in the first suite skips the rest of the suite and\ncontinues with the next item, or with the ``else`` clause if there was\nno next item.\n\nThe suite may assign to the variable(s) in the target list; this does\nnot affect the next item assigned to it.\n\nThe target list is not deleted when the loop is finished, but if the\nsequence is empty, it will not have been assigned to at all by the\nloop. Hint: the built-in function ``range()`` returns a sequence of\nintegers suitable to emulate the effect of Pascal\'s ``for i := a to b\ndo``; e.g., ``range(3)`` returns the list ``[0, 1, 2]``.\n\nWarning: There is a subtlety when the sequence is being modified by the loop\n (this can only occur for mutable sequences, i.e. lists). An internal\n counter is used to keep track of which item is used next, and this\n is incremented on each iteration. When this counter has reached the\n length of the sequence the loop terminates. This means that if the\n suite deletes the current (or a previous) item from the sequence,\n the next item will be skipped (since it gets the index of the\n current item which has already been treated). Likewise, if the\n suite inserts an item in the sequence before the current item, the\n current item will be treated again the next time through the loop.\n This can lead to nasty bugs that can be avoided by making a\n temporary copy using a slice of the whole sequence, e.g.,\n\n for x in a[:]:\n if x < 0: a.remove(x)\n', - 'formatstrings': u'\nFormat String Syntax\n********************\n\nThe ``str.format()`` method and the ``Formatter`` class share the same\nsyntax for format strings (although in the case of ``Formatter``,\nsubclasses can define their own format string syntax.)\n\nFormat strings contain "replacement fields" surrounded by curly braces\n``{}``. Anything that is not contained in braces is considered literal\ntext, which is copied unchanged to the output. If you need to include\na brace character in the literal text, it can be escaped by doubling:\n``{{`` and ``}}``.\n\nThe grammar for a replacement field is as follows:\n\n replacement_field ::= "{" field_name ["!" conversion] [":" format_spec] "}"\n field_name ::= (identifier | integer) ("." attribute_name | "[" element_index "]")*\n attribute_name ::= identifier\n element_index ::= integer\n conversion ::= "r" | "s"\n format_spec ::= \n\nIn less formal terms, the replacement field starts with a\n*field_name*, which can either be a number (for a positional\nargument), or an identifier (for keyword arguments). Following this\nis an optional *conversion* field, which is preceded by an exclamation\npoint ``\'!\'``, and a *format_spec*, which is preceded by a colon\n``\':\'``.\n\nThe *field_name* itself begins with either a number or a keyword. If\nit\'s a number, it refers to a positional argument, and if it\'s a\nkeyword it refers to a named keyword argument. This can be followed\nby any number of index or attribute expressions. An expression of the\nform ``\'.name\'`` selects the named attribute using ``getattr()``,\nwhile an expression of the form ``\'[index]\'`` does an index lookup\nusing ``__getitem__()``.\n\nSome simple format string examples:\n\n "First, thou shalt count to {0}" # References first positional argument\n "My quest is {name}" # References keyword argument \'name\'\n "Weight in tons {0.weight}" # \'weight\' attribute of first positional arg\n "Units destroyed: {players[0]}" # First element of keyword argument \'players\'.\n\nThe *conversion* field causes a type coercion before formatting.\nNormally, the job of formatting a value is done by the\n``__format__()`` method of the value itself. However, in some cases\nit is desirable to force a type to be formatted as a string,\noverriding its own definition of formatting. By converting the value\nto a string before calling ``__format__()``, the normal formatting\nlogic is bypassed.\n\nTwo conversion flags are currently supported: ``\'!s\'`` which calls\n``str()`` on the value, and ``\'!r\'`` which calls ``repr()``.\n\nSome examples:\n\n "Harold\'s a clever {0!s}" # Calls str() on the argument first\n "Bring out the holy {name!r}" # Calls repr() on the argument first\n\nThe *format_spec* field contains a specification of how the value\nshould be presented, including such details as field width, alignment,\npadding, decimal precision and so on. Each value type can define it\'s\nown "formatting mini-language" or interpretation of the *format_spec*.\n\nMost built-in types support a common formatting mini-language, which\nis described in the next section.\n\nA *format_spec* field can also include nested replacement fields\nwithin it. These nested replacement fields can contain only a field\nname; conversion flags and format specifications are not allowed. The\nreplacement fields within the format_spec are substituted before the\n*format_spec* string is interpreted. This allows the formatting of a\nvalue to be dynamically specified.\n\nFor example, suppose you wanted to have a replacement field whose\nfield width is determined by another variable:\n\n "A man with two {0:{1}}".format("noses", 10)\n\nThis would first evaluate the inner replacement field, making the\nformat string effectively:\n\n "A man with two {0:10}"\n\nThen the outer replacement field would be evaluated, producing:\n\n "noses "\n\nWhich is subsitituted into the string, yielding:\n\n "A man with two noses "\n\n(The extra space is because we specified a field width of 10, and\nbecause left alignment is the default for strings.)\n\n\nFormat Specification Mini-Language\n==================================\n\n"Format specifications" are used within replacement fields contained\nwithin a format string to define how individual values are presented\n(see *Format String Syntax*.) They can also be passed directly to the\nbuiltin ``format()`` function. Each formattable type may define how\nthe format specification is to be interpreted.\n\nMost built-in types implement the following options for format\nspecifications, although some of the formatting options are only\nsupported by the numeric types.\n\nA general convention is that an empty format string (``""``) produces\nthe same result as if you had called ``str()`` on the value.\n\nThe general form of a *standard format specifier* is:\n\n format_spec ::= [[fill]align][sign][0][width][.precision][type]\n fill ::= \n align ::= "<" | ">" | "=" | "^"\n sign ::= "+" | "-" | " "\n width ::= integer\n precision ::= integer\n type ::= "b" | "c" | "d" | "e" | "E" | "f" | "F" | "g" | "G" | "n" | "o" | "x" | "X" | "%"\n\nThe *fill* character can be any character other than \'}\' (which\nsignifies the end of the field). The presence of a fill character is\nsignaled by the *next* character, which must be one of the alignment\noptions. If the second character of *format_spec* is not a valid\nalignment option, then it is assumed that both the fill character and\nthe alignment option are absent.\n\nThe meaning of the various alignment options is as follows:\n\n +-----------+------------------------------------------------------------+\n | Option | Meaning |\n +===========+============================================================+\n | ``\'<\'`` | Forces the field to be left-aligned within the available |\n | | space (This is the default.) |\n +-----------+------------------------------------------------------------+\n | ``\'>\'`` | Forces the field to be right-aligned within the available |\n | | space. |\n +-----------+------------------------------------------------------------+\n | ``\'=\'`` | Forces the padding to be placed after the sign (if any) |\n | | but before the digits. This is used for printing fields |\n | | in the form \'+000000120\'. This alignment option is only |\n | | valid for numeric types. |\n +-----------+------------------------------------------------------------+\n | ``\'^\'`` | Forces the field to be centered within the available |\n | | space. |\n +-----------+------------------------------------------------------------+\n\nNote that unless a minimum field width is defined, the field width\nwill always be the same size as the data to fill it, so that the\nalignment option has no meaning in this case.\n\nThe *sign* option is only valid for number types, and can be one of\nthe following:\n\n +-----------+------------------------------------------------------------+\n | Option | Meaning |\n +===========+============================================================+\n | ``\'+\'`` | indicates that a sign should be used for both positive as |\n | | well as negative numbers. |\n +-----------+------------------------------------------------------------+\n | ``\'-\'`` | indicates that a sign should be used only for negative |\n | | numbers (this is the default behavior). |\n +-----------+------------------------------------------------------------+\n | space | indicates that a leading space should be used on positive |\n | | numbers, and a minus sign on negative numbers. |\n +-----------+------------------------------------------------------------+\n\n*width* is a decimal integer defining the minimum field width. If not\nspecified, then the field width will be determined by the content.\n\nIf the *width* field is preceded by a zero (``\'0\'``) character, this\nenables zero-padding. This is equivalent to an *alignment* type of\n``\'=\'`` and a *fill* character of ``\'0\'``.\n\nThe *precision* is a decimal number indicating how many digits should\nbe displayed after the decimal point for a floating point value. For\nnon-number types the field indicates the maximum field size - in other\nwords, how many characters will be used from the field content. The\n*precision* is ignored for integer values.\n\nFinally, the *type* determines how the data should be presented.\n\nThe available integer presentation types are:\n\n +-----------+------------------------------------------------------------+\n | Type | Meaning |\n +===========+============================================================+\n | ``\'b\'`` | Binary. Outputs the number in base 2. |\n +-----------+------------------------------------------------------------+\n | ``\'c\'`` | Character. Converts the integer to the corresponding |\n | | unicode character before printing. |\n +-----------+------------------------------------------------------------+\n | ``\'d\'`` | Decimal Integer. Outputs the number in base 10. |\n +-----------+------------------------------------------------------------+\n | ``\'o\'`` | Octal format. Outputs the number in base 8. |\n +-----------+------------------------------------------------------------+\n | ``\'x\'`` | Hex format. Outputs the number in base 16, using lower- |\n | | case letters for the digits above 9. |\n +-----------+------------------------------------------------------------+\n | ``\'X\'`` | Hex format. Outputs the number in base 16, using upper- |\n | | case letters for the digits above 9. |\n +-----------+------------------------------------------------------------+\n | ``\'n\'`` | Number. This is the same as ``\'d\'``, except that it uses |\n | | the current locale setting to insert the appropriate |\n | | number separator characters. |\n +-----------+------------------------------------------------------------+\n | None | the same as ``\'d\'`` |\n +-----------+------------------------------------------------------------+\n\nThe available presentation types for floating point and decimal values\nare:\n\n +-----------+------------------------------------------------------------+\n | Type | Meaning |\n +===========+============================================================+\n | ``\'e\'`` | Exponent notation. Prints the number in scientific |\n | | notation using the letter \'e\' to indicate the exponent. |\n +-----------+------------------------------------------------------------+\n | ``\'E\'`` | Exponent notation. Same as ``\'e\'`` except it uses an upper |\n | | case \'E\' as the separator character. |\n +-----------+------------------------------------------------------------+\n | ``\'f\'`` | Fixed point. Displays the number as a fixed-point number. |\n +-----------+------------------------------------------------------------+\n | ``\'F\'`` | Fixed point. Same as ``\'f\'``. |\n +-----------+------------------------------------------------------------+\n | ``\'g\'`` | General format. This prints the number as a fixed-point |\n | | number, unless the number is too large, in which case it |\n | | switches to ``\'e\'`` exponent notation. |\n +-----------+------------------------------------------------------------+\n | ``\'G\'`` | General format. Same as ``\'g\'`` except switches to ``\'E\'`` |\n | | if the number gets to large. |\n +-----------+------------------------------------------------------------+\n | ``\'n\'`` | Number. This is the same as ``\'g\'``, except that it uses |\n | | the current locale setting to insert the appropriate |\n | | number separator characters. |\n +-----------+------------------------------------------------------------+\n | ``\'%\'`` | Percentage. Multiplies the number by 100 and displays in |\n | | fixed (``\'f\'``) format, followed by a percent sign. |\n +-----------+------------------------------------------------------------+\n | None | the same as ``\'g\'`` |\n +-----------+------------------------------------------------------------+\n', - 'function': u'\nFunction definitions\n********************\n\nA function definition defines a user-defined function object (see\nsection *The standard type hierarchy*):\n\n decorated ::= decorators (classdef | funcdef)\n decorators ::= decorator+\n decorator ::= "@" dotted_name ["(" [argument_list [","]] ")"] NEWLINE\n funcdef ::= "def" funcname "(" [parameter_list] ")" ":" suite\n dotted_name ::= identifier ("." identifier)*\n parameter_list ::= (defparameter ",")*\n ( "*" identifier [, "**" identifier]\n | "**" identifier\n | defparameter [","] )\n defparameter ::= parameter ["=" expression]\n sublist ::= parameter ("," parameter)* [","]\n parameter ::= identifier | "(" sublist ")"\n funcname ::= identifier\n\nA function definition is an executable statement. Its execution binds\nthe function name in the current local namespace to a function object\n(a wrapper around the executable code for the function). This\nfunction object contains a reference to the current global namespace\nas the global namespace to be used when the function is called.\n\nThe function definition does not execute the function body; this gets\nexecuted only when the function is called.\n\nA function definition may be wrapped by one or more *decorator*\nexpressions. Decorator expressions are evaluated when the function is\ndefined, in the scope that contains the function definition. The\nresult must be a callable, which is invoked with the function object\nas the only argument. The returned value is bound to the function name\ninstead of the function object. Multiple decorators are applied in\nnested fashion. For example, the following code:\n\n @f1(arg)\n @f2\n def func(): pass\n\nis equivalent to:\n\n def func(): pass\n func = f1(arg)(f2(func))\n\nWhen one or more top-level parameters have the form *parameter* ``=``\n*expression*, the function is said to have "default parameter values."\nFor a parameter with a default value, the corresponding argument may\nbe omitted from a call, in which case the parameter\'s default value is\nsubstituted. If a parameter has a default value, all following\nparameters must also have a default value --- this is a syntactic\nrestriction that is not expressed by the grammar.\n\n**Default parameter values are evaluated when the function definition\nis executed.** This means that the expression is evaluated once, when\nthe function is defined, and that that same "pre-computed" value is\nused for each call. This is especially important to understand when a\ndefault parameter is a mutable object, such as a list or a dictionary:\nif the function modifies the object (e.g. by appending an item to a\nlist), the default value is in effect modified. This is generally not\nwhat was intended. A way around this is to use ``None`` as the\ndefault, and explicitly test for it in the body of the function, e.g.:\n\n def whats_on_the_telly(penguin=None):\n if penguin is None:\n penguin = []\n penguin.append("property of the zoo")\n return penguin\n\nFunction call semantics are described in more detail in section\n*Calls*. A function call always assigns values to all parameters\nmentioned in the parameter list, either from position arguments, from\nkeyword arguments, or from default values. If the form\n"``*identifier``" is present, it is initialized to a tuple receiving\nany excess positional parameters, defaulting to the empty tuple. If\nthe form "``**identifier``" is present, it is initialized to a new\ndictionary receiving any excess keyword arguments, defaulting to a new\nempty dictionary.\n\nIt is also possible to create anonymous functions (functions not bound\nto a name), for immediate use in expressions. This uses lambda forms,\ndescribed in section *Expression lists*. Note that the lambda form is\nmerely a shorthand for a simplified function definition; a function\ndefined in a "``def``" statement can be passed around or assigned to\nanother name just like a function defined by a lambda form. The\n"``def``" form is actually more powerful since it allows the execution\nof multiple statements.\n\n**Programmer\'s note:** Functions are first-class objects. A "``def``"\nform executed inside a function definition defines a local function\nthat can be returned or passed around. Free variables used in the\nnested function can access the local variables of the function\ncontaining the def. See section *Naming and binding* for details.\n', + 'formatstrings': u'\nFormat String Syntax\n********************\n\nThe ``str.format()`` method and the ``Formatter`` class share the same\nsyntax for format strings (although in the case of ``Formatter``,\nsubclasses can define their own format string syntax.)\n\nFormat strings contain "replacement fields" surrounded by curly braces\n``{}``. Anything that is not contained in braces is considered literal\ntext, which is copied unchanged to the output. If you need to include\na brace character in the literal text, it can be escaped by doubling:\n``{{`` and ``}}``.\n\nThe grammar for a replacement field is as follows:\n\n replacement_field ::= "{" field_name ["!" conversion] [":" format_spec] "}"\n field_name ::= (identifier | integer) ("." attribute_name | "[" element_index "]")*\n attribute_name ::= identifier\n element_index ::= integer\n conversion ::= "r" | "s"\n format_spec ::= \n\nIn less formal terms, the replacement field starts with a\n*field_name*, which can either be a number (for a positional\nargument), or an identifier (for keyword arguments). Following this\nis an optional *conversion* field, which is preceded by an exclamation\npoint ``\'!\'``, and a *format_spec*, which is preceded by a colon\n``\':\'``.\n\nThe *field_name* itself begins with either a number or a keyword. If\nit\'s a number, it refers to a positional argument, and if it\'s a\nkeyword it refers to a named keyword argument. This can be followed\nby any number of index or attribute expressions. An expression of the\nform ``\'.name\'`` selects the named attribute using ``getattr()``,\nwhile an expression of the form ``\'[index]\'`` does an index lookup\nusing ``__getitem__()``.\n\nSome simple format string examples:\n\n "First, thou shalt count to {0}" # References first positional argument\n "My quest is {name}" # References keyword argument \'name\'\n "Weight in tons {0.weight}" # \'weight\' attribute of first positional arg\n "Units destroyed: {players[0]}" # First element of keyword argument \'players\'.\n\nThe *conversion* field causes a type coercion before formatting.\nNormally, the job of formatting a value is done by the\n``__format__()`` method of the value itself. However, in some cases\nit is desirable to force a type to be formatted as a string,\noverriding its own definition of formatting. By converting the value\nto a string before calling ``__format__()``, the normal formatting\nlogic is bypassed.\n\nTwo conversion flags are currently supported: ``\'!s\'`` which calls\n``str()`` on the value, and ``\'!r\'`` which calls ``repr()``.\n\nSome examples:\n\n "Harold\'s a clever {0!s}" # Calls str() on the argument first\n "Bring out the holy {name!r}" # Calls repr() on the argument first\n\nThe *format_spec* field contains a specification of how the value\nshould be presented, including such details as field width, alignment,\npadding, decimal precision and so on. Each value type can define it\'s\nown "formatting mini-language" or interpretation of the *format_spec*.\n\nMost built-in types support a common formatting mini-language, which\nis described in the next section.\n\nA *format_spec* field can also include nested replacement fields\nwithin it. These nested replacement fields can contain only a field\nname; conversion flags and format specifications are not allowed. The\nreplacement fields within the format_spec are substituted before the\n*format_spec* string is interpreted. This allows the formatting of a\nvalue to be dynamically specified.\n\nFor example, suppose you wanted to have a replacement field whose\nfield width is determined by another variable:\n\n "A man with two {0:{1}}".format("noses", 10)\n\nThis would first evaluate the inner replacement field, making the\nformat string effectively:\n\n "A man with two {0:10}"\n\nThen the outer replacement field would be evaluated, producing:\n\n "noses "\n\nWhich is substituted into the string, yielding:\n\n "A man with two noses "\n\n(The extra space is because we specified a field width of 10, and\nbecause left alignment is the default for strings.)\n\n\nFormat Specification Mini-Language\n==================================\n\n"Format specifications" are used within replacement fields contained\nwithin a format string to define how individual values are presented\n(see *Format String Syntax*.) They can also be passed directly to the\nbuiltin ``format()`` function. Each formattable type may define how\nthe format specification is to be interpreted.\n\nMost built-in types implement the following options for format\nspecifications, although some of the formatting options are only\nsupported by the numeric types.\n\nA general convention is that an empty format string (``""``) produces\nthe same result as if you had called ``str()`` on the value.\n\nThe general form of a *standard format specifier* is:\n\n format_spec ::= [[fill]align][sign][#][0][width][.precision][type]\n fill ::= \n align ::= "<" | ">" | "=" | "^"\n sign ::= "+" | "-" | " "\n width ::= integer\n precision ::= integer\n type ::= "b" | "c" | "d" | "e" | "E" | "f" | "F" | "g" | "G" | "n" | "o" | "x" | "X" | "%"\n\nThe *fill* character can be any character other than \'}\' (which\nsignifies the end of the field). The presence of a fill character is\nsignaled by the *next* character, which must be one of the alignment\noptions. If the second character of *format_spec* is not a valid\nalignment option, then it is assumed that both the fill character and\nthe alignment option are absent.\n\nThe meaning of the various alignment options is as follows:\n\n +-----------+------------------------------------------------------------+\n | Option | Meaning |\n +===========+============================================================+\n | ``\'<\'`` | Forces the field to be left-aligned within the available |\n | | space (This is the default.) |\n +-----------+------------------------------------------------------------+\n | ``\'>\'`` | Forces the field to be right-aligned within the available |\n | | space. |\n +-----------+------------------------------------------------------------+\n | ``\'=\'`` | Forces the padding to be placed after the sign (if any) |\n | | but before the digits. This is used for printing fields |\n | | in the form \'+000000120\'. This alignment option is only |\n | | valid for numeric types. |\n +-----------+------------------------------------------------------------+\n | ``\'^\'`` | Forces the field to be centered within the available |\n | | space. |\n +-----------+------------------------------------------------------------+\n\nNote that unless a minimum field width is defined, the field width\nwill always be the same size as the data to fill it, so that the\nalignment option has no meaning in this case.\n\nThe *sign* option is only valid for number types, and can be one of\nthe following:\n\n +-----------+------------------------------------------------------------+\n | Option | Meaning |\n +===========+============================================================+\n | ``\'+\'`` | indicates that a sign should be used for both positive as |\n | | well as negative numbers. |\n +-----------+------------------------------------------------------------+\n | ``\'-\'`` | indicates that a sign should be used only for negative |\n | | numbers (this is the default behavior). |\n +-----------+------------------------------------------------------------+\n | space | indicates that a leading space should be used on positive |\n | | numbers, and a minus sign on negative numbers. |\n +-----------+------------------------------------------------------------+\n\nThe ``\'#\'`` option is only valid for integers, and only for binary,\noctal, or hexadecimal output. If present, it specifies that the\noutput will be prefixed by ``\'0b\'``, ``\'0o\'``, or ``\'0x\'``,\nrespectively.\n\n*width* is a decimal integer defining the minimum field width. If not\nspecified, then the field width will be determined by the content.\n\nIf the *width* field is preceded by a zero (``\'0\'``) character, this\nenables zero-padding. This is equivalent to an *alignment* type of\n``\'=\'`` and a *fill* character of ``\'0\'``.\n\nThe *precision* is a decimal number indicating how many digits should\nbe displayed after the decimal point for a floating point value\nformatted with ``\'f\'`` and ``\'F\'``, or before and after the decimal\npoint for a floating point value formatted with ``\'g\'`` or ``\'G\'``.\nFor non-number types the field indicates the maximum field size - in\nother words, how many characters will be used from the field content.\nThe *precision* is ignored for integer values.\n\nFinally, the *type* determines how the data should be presented.\n\nThe available integer presentation types are:\n\n +-----------+------------------------------------------------------------+\n | Type | Meaning |\n +===========+============================================================+\n | ``\'b\'`` | Binary format. Outputs the number in base 2. |\n +-----------+------------------------------------------------------------+\n | ``\'c\'`` | Character. Converts the integer to the corresponding |\n | | unicode character before printing. |\n +-----------+------------------------------------------------------------+\n | ``\'d\'`` | Decimal Integer. Outputs the number in base 10. |\n +-----------+------------------------------------------------------------+\n | ``\'o\'`` | Octal format. Outputs the number in base 8. |\n +-----------+------------------------------------------------------------+\n | ``\'x\'`` | Hex format. Outputs the number in base 16, using lower- |\n | | case letters for the digits above 9. |\n +-----------+------------------------------------------------------------+\n | ``\'X\'`` | Hex format. Outputs the number in base 16, using upper- |\n | | case letters for the digits above 9. |\n +-----------+------------------------------------------------------------+\n | ``\'n\'`` | Number. This is the same as ``\'d\'``, except that it uses |\n | | the current locale setting to insert the appropriate |\n | | number separator characters. |\n +-----------+------------------------------------------------------------+\n | None | The same as ``\'d\'``. |\n +-----------+------------------------------------------------------------+\n\nThe available presentation types for floating point and decimal values\nare:\n\n +-----------+------------------------------------------------------------+\n | Type | Meaning |\n +===========+============================================================+\n | ``\'e\'`` | Exponent notation. Prints the number in scientific |\n | | notation using the letter \'e\' to indicate the exponent. |\n +-----------+------------------------------------------------------------+\n | ``\'E\'`` | Exponent notation. Same as ``\'e\'`` except it uses an upper |\n | | case \'E\' as the separator character. |\n +-----------+------------------------------------------------------------+\n | ``\'f\'`` | Fixed point. Displays the number as a fixed-point number. |\n +-----------+------------------------------------------------------------+\n | ``\'F\'`` | Fixed point. Same as ``\'f\'``. |\n +-----------+------------------------------------------------------------+\n | ``\'g\'`` | General format. This prints the number as a fixed-point |\n | | number, unless the number is too large, in which case it |\n | | switches to ``\'e\'`` exponent notation. Infinity and NaN |\n | | values are formatted as ``inf``, ``-inf`` and ``nan``, |\n | | respectively. |\n +-----------+------------------------------------------------------------+\n | ``\'G\'`` | General format. Same as ``\'g\'`` except switches to ``\'E\'`` |\n | | if the number gets to large. The representations of |\n | | infinity and NaN are uppercased, too. |\n +-----------+------------------------------------------------------------+\n | ``\'n\'`` | Number. This is the same as ``\'g\'``, except that it uses |\n | | the current locale setting to insert the appropriate |\n | | number separator characters. |\n +-----------+------------------------------------------------------------+\n | ``\'%\'`` | Percentage. Multiplies the number by 100 and displays in |\n | | fixed (``\'f\'``) format, followed by a percent sign. |\n +-----------+------------------------------------------------------------+\n | None | The same as ``\'g\'``. |\n +-----------+------------------------------------------------------------+\n', + 'function': u'\nFunction definitions\n********************\n\nA function definition defines a user-defined function object (see\nsection *The standard type hierarchy*):\n\n decorated ::= decorators (classdef | funcdef)\n decorators ::= decorator+\n decorator ::= "@" dotted_name ["(" [argument_list [","]] ")"] NEWLINE\n funcdef ::= "def" funcname "(" [parameter_list] ")" ":" suite\n dotted_name ::= identifier ("." identifier)*\n parameter_list ::= (defparameter ",")*\n ( "*" identifier [, "**" identifier]\n | "**" identifier\n | defparameter [","] )\n defparameter ::= parameter ["=" expression]\n sublist ::= parameter ("," parameter)* [","]\n parameter ::= identifier | "(" sublist ")"\n funcname ::= identifier\n\nA function definition is an executable statement. Its execution binds\nthe function name in the current local namespace to a function object\n(a wrapper around the executable code for the function). This\nfunction object contains a reference to the current global namespace\nas the global namespace to be used when the function is called.\n\nThe function definition does not execute the function body; this gets\nexecuted only when the function is called. [3]\n\nA function definition may be wrapped by one or more *decorator*\nexpressions. Decorator expressions are evaluated when the function is\ndefined, in the scope that contains the function definition. The\nresult must be a callable, which is invoked with the function object\nas the only argument. The returned value is bound to the function name\ninstead of the function object. Multiple decorators are applied in\nnested fashion. For example, the following code:\n\n @f1(arg)\n @f2\n def func(): pass\n\nis equivalent to:\n\n def func(): pass\n func = f1(arg)(f2(func))\n\nWhen one or more top-level parameters have the form *parameter* ``=``\n*expression*, the function is said to have "default parameter values."\nFor a parameter with a default value, the corresponding argument may\nbe omitted from a call, in which case the parameter\'s default value is\nsubstituted. If a parameter has a default value, all following\nparameters must also have a default value --- this is a syntactic\nrestriction that is not expressed by the grammar.\n\n**Default parameter values are evaluated when the function definition\nis executed.** This means that the expression is evaluated once, when\nthe function is defined, and that that same "pre-computed" value is\nused for each call. This is especially important to understand when a\ndefault parameter is a mutable object, such as a list or a dictionary:\nif the function modifies the object (e.g. by appending an item to a\nlist), the default value is in effect modified. This is generally not\nwhat was intended. A way around this is to use ``None`` as the\ndefault, and explicitly test for it in the body of the function, e.g.:\n\n def whats_on_the_telly(penguin=None):\n if penguin is None:\n penguin = []\n penguin.append("property of the zoo")\n return penguin\n\nFunction call semantics are described in more detail in section\n*Calls*. A function call always assigns values to all parameters\nmentioned in the parameter list, either from position arguments, from\nkeyword arguments, or from default values. If the form\n"``*identifier``" is present, it is initialized to a tuple receiving\nany excess positional parameters, defaulting to the empty tuple. If\nthe form "``**identifier``" is present, it is initialized to a new\ndictionary receiving any excess keyword arguments, defaulting to a new\nempty dictionary.\n\nIt is also possible to create anonymous functions (functions not bound\nto a name), for immediate use in expressions. This uses lambda forms,\ndescribed in section *Expression lists*. Note that the lambda form is\nmerely a shorthand for a simplified function definition; a function\ndefined in a "``def``" statement can be passed around or assigned to\nanother name just like a function defined by a lambda form. The\n"``def``" form is actually more powerful since it allows the execution\nof multiple statements.\n\n**Programmer\'s note:** Functions are first-class objects. A "``def``"\nform executed inside a function definition defines a local function\nthat can be returned or passed around. Free variables used in the\nnested function can access the local variables of the function\ncontaining the def. See section *Naming and binding* for details.\n', 'global': u'\nThe ``global`` statement\n************************\n\n global_stmt ::= "global" identifier ("," identifier)*\n\nThe ``global`` statement is a declaration which holds for the entire\ncurrent code block. It means that the listed identifiers are to be\ninterpreted as globals. It would be impossible to assign to a global\nvariable without ``global``, although free variables may refer to\nglobals without being declared global.\n\nNames listed in a ``global`` statement must not be used in the same\ncode block textually preceding that ``global`` statement.\n\nNames listed in a ``global`` statement must not be defined as formal\nparameters or in a ``for`` loop control target, ``class`` definition,\nfunction definition, or ``import`` statement.\n\n(The current implementation does not enforce the latter two\nrestrictions, but programs should not abuse this freedom, as future\nimplementations may enforce them or silently change the meaning of the\nprogram.)\n\n**Programmer\'s note:** the ``global`` is a directive to the parser.\nIt applies only to code parsed at the same time as the ``global``\nstatement. In particular, a ``global`` statement contained in an\n``exec`` statement does not affect the code block *containing* the\n``exec`` statement, and code contained in an ``exec`` statement is\nunaffected by ``global`` statements in the code containing the\n``exec`` statement. The same applies to the ``eval()``,\n``execfile()`` and ``compile()`` functions.\n', 'id-classes': u'\nReserved classes of identifiers\n*******************************\n\nCertain classes of identifiers (besides keywords) have special\nmeanings. These classes are identified by the patterns of leading and\ntrailing underscore characters:\n\n``_*``\n Not imported by ``from module import *``. The special identifier\n ``_`` is used in the interactive interpreter to store the result of\n the last evaluation; it is stored in the ``__builtin__`` module.\n When not in interactive mode, ``_`` has no special meaning and is\n not defined. See section *The import statement*.\n\n Note: The name ``_`` is often used in conjunction with\n internationalization; refer to the documentation for the\n ``gettext`` module for more information on this convention.\n\n``__*__``\n System-defined names. These names are defined by the interpreter\n and its implementation (including the standard library);\n applications should not expect to define additional names using\n this convention. The set of names of this class defined by Python\n may be extended in future versions. See section *Special method\n names*.\n\n``__*``\n Class-private names. Names in this category, when used within the\n context of a class definition, are re-written to use a mangled form\n to help avoid name clashes between "private" attributes of base and\n derived classes. See section *Identifiers (Names)*.\n', 'identifiers': u'\nIdentifiers and keywords\n************************\n\nIdentifiers (also referred to as *names*) are described by the\nfollowing lexical definitions:\n\n identifier ::= (letter|"_") (letter | digit | "_")*\n letter ::= lowercase | uppercase\n lowercase ::= "a"..."z"\n uppercase ::= "A"..."Z"\n digit ::= "0"..."9"\n\nIdentifiers are unlimited in length. Case is significant.\n\n\nKeywords\n========\n\nThe following identifiers are used as reserved words, or *keywords* of\nthe language, and cannot be used as ordinary identifiers. They must\nbe spelled exactly as written here:\n\n and del from not while\n as elif global or with\n assert else if pass yield\n break except import print\n class exec in raise\n continue finally is return\n def for lambda try\n\nChanged in version 2.4: ``None`` became a constant and is now\nrecognized by the compiler as a name for the built-in object ``None``.\nAlthough it is not a keyword, you cannot assign a different object to\nit.\n\nChanged in version 2.5: Both ``as`` and ``with`` are only recognized\nwhen the ``with_statement`` future feature has been enabled. It will\nalways be enabled in Python 2.6. See section *The with statement* for\ndetails. Note that using ``as`` and ``with`` as identifiers will\nalways issue a warning, even when the ``with_statement`` future\ndirective is not in effect.\n\n\nReserved classes of identifiers\n===============================\n\nCertain classes of identifiers (besides keywords) have special\nmeanings. These classes are identified by the patterns of leading and\ntrailing underscore characters:\n\n``_*``\n Not imported by ``from module import *``. The special identifier\n ``_`` is used in the interactive interpreter to store the result of\n the last evaluation; it is stored in the ``__builtin__`` module.\n When not in interactive mode, ``_`` has no special meaning and is\n not defined. See section *The import statement*.\n\n Note: The name ``_`` is often used in conjunction with\n internationalization; refer to the documentation for the\n ``gettext`` module for more information on this convention.\n\n``__*__``\n System-defined names. These names are defined by the interpreter\n and its implementation (including the standard library);\n applications should not expect to define additional names using\n this convention. The set of names of this class defined by Python\n may be extended in future versions. See section *Special method\n names*.\n\n``__*``\n Class-private names. Names in this category, when used within the\n context of a class definition, are re-written to use a mangled form\n to help avoid name clashes between "private" attributes of base and\n derived classes. See section *Identifiers (Names)*.\n', 'if': u'\nThe ``if`` statement\n********************\n\nThe ``if`` statement is used for conditional execution:\n\n if_stmt ::= "if" expression ":" suite\n ( "elif" expression ":" suite )*\n ["else" ":" suite]\n\nIt selects exactly one of the suites by evaluating the expressions one\nby one until one is found to be true (see section *Boolean operations*\nfor the definition of true and false); then that suite is executed\n(and no other part of the ``if`` statement is executed or evaluated).\nIf all expressions are false, the suite of the ``else`` clause, if\npresent, is executed.\n', 'imaginary': u'\nImaginary literals\n******************\n\nImaginary literals are described by the following lexical definitions:\n\n imagnumber ::= (floatnumber | intpart) ("j" | "J")\n\nAn imaginary literal yields a complex number with a real part of 0.0.\nComplex numbers are represented as a pair of floating point numbers\nand have the same restrictions on their range. To create a complex\nnumber with a nonzero real part, add a floating point number to it,\ne.g., ``(3+4j)``. Some examples of imaginary literals:\n\n 3.14j 10.j 10j .001j 1e100j 3.14e-10j\n', - 'import': u'\nThe ``import`` statement\n************************\n\n import_stmt ::= "import" module ["as" name] ( "," module ["as" name] )*\n | "from" relative_module "import" identifier ["as" name]\n ( "," identifier ["as" name] )*\n | "from" relative_module "import" "(" identifier ["as" name]\n ( "," identifier ["as" name] )* [","] ")"\n | "from" module "import" "*"\n module ::= (identifier ".")* identifier\n relative_module ::= "."* module | "."+\n name ::= identifier\n\nImport statements are executed in two steps: (1) find a module, and\ninitialize it if necessary; (2) define a name or names in the local\nnamespace (of the scope where the ``import`` statement occurs). The\nfirst form (without ``from``) repeats these steps for each identifier\nin the list. The form with ``from`` performs step (1) once, and then\nperforms step (2) repeatedly.\n\nIn this context, to "initialize" a built-in or extension module means\nto call an initialization function that the module must provide for\nthe purpose (in the reference implementation, the function\'s name is\nobtained by prepending string "init" to the module\'s name); to\n"initialize" a Python-coded module means to execute the module\'s body.\n\nThe system maintains a table of modules that have been or are being\ninitialized, indexed by module name. This table is accessible as\n``sys.modules``. When a module name is found in this table, step (1)\nis finished. If not, a search for a module definition is started.\nWhen a module is found, it is loaded. Details of the module searching\nand loading process are implementation and platform specific. It\ngenerally involves searching for a "built-in" module with the given\nname and then searching a list of locations given as ``sys.path``.\n\nIf a built-in module is found, its built-in initialization code is\nexecuted and step (1) is finished. If no matching file is found,\n``ImportError`` is raised. If a file is found, it is parsed, yielding\nan executable code block. If a syntax error occurs, ``SyntaxError``\nis raised. Otherwise, an empty module of the given name is created\nand inserted in the module table, and then the code block is executed\nin the context of this module. Exceptions during this execution\nterminate step (1).\n\nWhen step (1) finishes without raising an exception, step (2) can\nbegin.\n\nThe first form of ``import`` statement binds the module name in the\nlocal namespace to the module object, and then goes on to import the\nnext identifier, if any. If the module name is followed by ``as``,\nthe name following ``as`` is used as the local name for the module.\n\nThe ``from`` form does not bind the module name: it goes through the\nlist of identifiers, looks each one of them up in the module found in\nstep (1), and binds the name in the local namespace to the object thus\nfound. As with the first form of ``import``, an alternate local name\ncan be supplied by specifying "``as`` localname". If a name is not\nfound, ``ImportError`` is raised. If the list of identifiers is\nreplaced by a star (``\'*\'``), all public names defined in the module\nare bound in the local namespace of the ``import`` statement..\n\nThe *public names* defined by a module are determined by checking the\nmodule\'s namespace for a variable named ``__all__``; if defined, it\nmust be a sequence of strings which are names defined or imported by\nthat module. The names given in ``__all__`` are all considered public\nand are required to exist. If ``__all__`` is not defined, the set of\npublic names includes all names found in the module\'s namespace which\ndo not begin with an underscore character (``\'_\'``). ``__all__``\nshould contain the entire public API. It is intended to avoid\naccidentally exporting items that are not part of the API (such as\nlibrary modules which were imported and used within the module).\n\nThe ``from`` form with ``*`` may only occur in a module scope. If the\nwild card form of import --- ``import *`` --- is used in a function\nand the function contains or is a nested block with free variables,\nthe compiler will raise a ``SyntaxError``.\n\n**Hierarchical module names:** when the module names contains one or\nmore dots, the module search path is carried out differently. The\nsequence of identifiers up to the last dot is used to find a\n"package"; the final identifier is then searched inside the package.\nA package is generally a subdirectory of a directory on ``sys.path``\nthat has a file ``__init__.py``. [XXX Can\'t be bothered to spell this\nout right now; see the URL\nhttp://www.python.org/doc/essays/packages.html for more details, also\nabout how the module search works from inside a package.]\n\nThe built-in function ``__import__()`` is provided to support\napplications that determine which modules need to be loaded\ndynamically; refer to *Built-in Functions* for additional information.\n\n\nFuture statements\n=================\n\nA *future statement* is a directive to the compiler that a particular\nmodule should be compiled using syntax or semantics that will be\navailable in a specified future release of Python. The future\nstatement is intended to ease migration to future versions of Python\nthat introduce incompatible changes to the language. It allows use of\nthe new features on a per-module basis before the release in which the\nfeature becomes standard.\n\n future_statement ::= "from" "__future__" "import" feature ["as" name]\n ("," feature ["as" name])*\n | "from" "__future__" "import" "(" feature ["as" name]\n ("," feature ["as" name])* [","] ")"\n feature ::= identifier\n name ::= identifier\n\nA future statement must appear near the top of the module. The only\nlines that can appear before a future statement are:\n\n* the module docstring (if any),\n\n* comments,\n\n* blank lines, and\n\n* other future statements.\n\nThe features recognized by Python 2.5 are ``absolute_import``,\n``division``, ``generators``, ``nested_scopes`` and\n``with_statement``. ``generators`` and ``nested_scopes`` are\nredundant in Python version 2.3 and above because they are always\nenabled.\n\nA future statement is recognized and treated specially at compile\ntime: Changes to the semantics of core constructs are often\nimplemented by generating different code. It may even be the case\nthat a new feature introduces new incompatible syntax (such as a new\nreserved word), in which case the compiler may need to parse the\nmodule differently. Such decisions cannot be pushed off until\nruntime.\n\nFor any given release, the compiler knows which feature names have\nbeen defined, and raises a compile-time error if a future statement\ncontains a feature not known to it.\n\nThe direct runtime semantics are the same as for any import statement:\nthere is a standard module ``__future__``, described later, and it\nwill be imported in the usual way at the time the future statement is\nexecuted.\n\nThe interesting runtime semantics depend on the specific feature\nenabled by the future statement.\n\nNote that there is nothing special about the statement:\n\n import __future__ [as name]\n\nThat is not a future statement; it\'s an ordinary import statement with\nno special semantics or syntax restrictions.\n\nCode compiled by an ``exec`` statement or calls to the builtin\nfunctions ``compile()`` and ``execfile()`` that occur in a module\n``M`` containing a future statement will, by default, use the new\nsyntax or semantics associated with the future statement. This can,\nstarting with Python 2.2 be controlled by optional arguments to\n``compile()`` --- see the documentation of that function for details.\n\nA future statement typed at an interactive interpreter prompt will\ntake effect for the rest of the interpreter session. If an\ninterpreter is started with the *-i* option, is passed a script name\nto execute, and the script includes a future statement, it will be in\neffect in the interactive session started after the script is\nexecuted.\n', - 'in': u'\nComparisons\n***********\n\nUnlike C, all comparison operations in Python have the same priority,\nwhich is lower than that of any arithmetic, shifting or bitwise\noperation. Also unlike C, expressions like ``a < b < c`` have the\ninterpretation that is conventional in mathematics:\n\n comparison ::= or_expr ( comp_operator or_expr )*\n comp_operator ::= "<" | ">" | "==" | ">=" | "<=" | "<>" | "!="\n | "is" ["not"] | ["not"] "in"\n\nComparisons yield boolean values: ``True`` or ``False``.\n\nComparisons can be chained arbitrarily, e.g., ``x < y <= z`` is\nequivalent to ``x < y and y <= z``, except that ``y`` is evaluated\nonly once (but in both cases ``z`` is not evaluated at all when ``x <\ny`` is found to be false).\n\nFormally, if *a*, *b*, *c*, ..., *y*, *z* are expressions and *op1*,\n*op2*, ..., *opN* are comparison operators, then ``a op1 b op2 c ... y\nopN z`` is equivalent to ``a op1 b and b op2 c and ... y opN z``,\nexcept that each expression is evaluated at most once.\n\nNote that ``a op1 b op2 c`` doesn\'t imply any kind of comparison\nbetween *a* and *c*, so that, e.g., ``x < y > z`` is perfectly legal\n(though perhaps not pretty).\n\nThe forms ``<>`` and ``!=`` are equivalent; for consistency with C,\n``!=`` is preferred; where ``!=`` is mentioned below ``<>`` is also\naccepted. The ``<>`` spelling is considered obsolescent.\n\nThe operators ``<``, ``>``, ``==``, ``>=``, ``<=``, and ``!=`` compare\nthe values of two objects. The objects need not have the same type.\nIf both are numbers, they are converted to a common type. Otherwise,\nobjects of different types *always* compare unequal, and are ordered\nconsistently but arbitrarily. You can control comparison behavior of\nobjects of non-builtin types by defining a ``__cmp__`` method or rich\ncomparison methods like ``__gt__``, described in section *Special\nmethod names*.\n\n(This unusual definition of comparison was used to simplify the\ndefinition of operations like sorting and the ``in`` and ``not in``\noperators. In the future, the comparison rules for objects of\ndifferent types are likely to change.)\n\nComparison of objects of the same type depends on the type:\n\n* Numbers are compared arithmetically.\n\n* Strings are compared lexicographically using the numeric equivalents\n (the result of the built-in function ``ord()``) of their characters.\n Unicode and 8-bit strings are fully interoperable in this behavior.\n [4]\n\n* Tuples and lists are compared lexicographically using comparison of\n corresponding elements. This means that to compare equal, each\n element must compare equal and the two sequences must be of the same\n type and have the same length.\n\n If not equal, the sequences are ordered the same as their first\n differing elements. For example, ``cmp([1,2,x], [1,2,y])`` returns\n the same as ``cmp(x,y)``. If the corresponding element does not\n exist, the shorter sequence is ordered first (for example, ``[1,2] <\n [1,2,3]``).\n\n* Mappings (dictionaries) compare equal if and only if their sorted\n (key, value) lists compare equal. [5] Outcomes other than equality\n are resolved consistently, but are not otherwise defined. [6]\n\n* Most other objects of builtin types compare unequal unless they are\n the same object; the choice whether one object is considered smaller\n or larger than another one is made arbitrarily but consistently\n within one execution of a program.\n\nThe operators ``in`` and ``not in`` test for collection membership.\n``x in s`` evaluates to true if *x* is a member of the collection *s*,\nand false otherwise. ``x not in s`` returns the negation of ``x in\ns``. The collection membership test has traditionally been bound to\nsequences; an object is a member of a collection if the collection is\na sequence and contains an element equal to that object. However, it\nmake sense for many other object types to support membership tests\nwithout being a sequence. In particular, dictionaries (for keys) and\nsets support membership testing.\n\nFor the list and tuple types, ``x in y`` is true if and only if there\nexists an index *i* such that ``x == y[i]`` is true.\n\nFor the Unicode and string types, ``x in y`` is true if and only if\n*x* is a substring of *y*. An equivalent test is ``y.find(x) != -1``.\nNote, *x* and *y* need not be the same type; consequently, ``u\'ab\' in\n\'abc\'`` will return ``True``. Empty strings are always considered to\nbe a substring of any other string, so ``"" in "abc"`` will return\n``True``.\n\nChanged in version 2.3: Previously, *x* was required to be a string of\nlength ``1``.\n\nFor user-defined classes which define the ``__contains__()`` method,\n``x in y`` is true if and only if ``y.__contains__(x)`` is true.\n\nFor user-defined classes which do not define ``__contains__()`` and do\ndefine ``__getitem__()``, ``x in y`` is true if and only if there is a\nnon-negative integer index *i* such that ``x == y[i]``, and all lower\ninteger indices do not raise ``IndexError`` exception. (If any other\nexception is raised, it is as if ``in`` raised that exception).\n\nThe operator ``not in`` is defined to have the inverse true value of\n``in``.\n\nThe operators ``is`` and ``is not`` test for object identity: ``x is\ny`` is true if and only if *x* and *y* are the same object. ``x is\nnot y`` yields the inverse truth value.\n', + 'import': u'\nThe ``import`` statement\n************************\n\n import_stmt ::= "import" module ["as" name] ( "," module ["as" name] )*\n | "from" relative_module "import" identifier ["as" name]\n ( "," identifier ["as" name] )*\n | "from" relative_module "import" "(" identifier ["as" name]\n ( "," identifier ["as" name] )* [","] ")"\n | "from" module "import" "*"\n module ::= (identifier ".")* identifier\n relative_module ::= "."* module | "."+\n name ::= identifier\n\nImport statements are executed in two steps: (1) find a module, and\ninitialize it if necessary; (2) define a name or names in the local\nnamespace (of the scope where the ``import`` statement occurs). The\nfirst form (without ``from``) repeats these steps for each identifier\nin the list. The form with ``from`` performs step (1) once, and then\nperforms step (2) repeatedly.\n\nIn this context, to "initialize" a built-in or extension module means\nto call an initialization function that the module must provide for\nthe purpose (in the reference implementation, the function\'s name is\nobtained by prepending string "init" to the module\'s name); to\n"initialize" a Python-coded module means to execute the module\'s body.\n\nThe system maintains a table of modules that have been or are being\ninitialized, indexed by module name. This table is accessible as\n``sys.modules``. When a module name is found in this table, step (1)\nis finished. If not, a search for a module definition is started.\nWhen a module is found, it is loaded. Details of the module searching\nand loading process are implementation and platform specific. It\ngenerally involves searching for a "built-in" module with the given\nname and then searching a list of locations given as ``sys.path``.\n\nIf a built-in module is found, its built-in initialization code is\nexecuted and step (1) is finished. If no matching file is found,\n``ImportError`` is raised. If a file is found, it is parsed, yielding\nan executable code block. If a syntax error occurs, ``SyntaxError``\nis raised. Otherwise, an empty module of the given name is created\nand inserted in the module table, and then the code block is executed\nin the context of this module. Exceptions during this execution\nterminate step (1).\n\nWhen step (1) finishes without raising an exception, step (2) can\nbegin.\n\nThe first form of ``import`` statement binds the module name in the\nlocal namespace to the module object, and then goes on to import the\nnext identifier, if any. If the module name is followed by ``as``,\nthe name following ``as`` is used as the local name for the module.\n\nThe ``from`` form does not bind the module name: it goes through the\nlist of identifiers, looks each one of them up in the module found in\nstep (1), and binds the name in the local namespace to the object thus\nfound. As with the first form of ``import``, an alternate local name\ncan be supplied by specifying "``as`` localname". If a name is not\nfound, ``ImportError`` is raised. If the list of identifiers is\nreplaced by a star (``\'*\'``), all public names defined in the module\nare bound in the local namespace of the ``import`` statement..\n\nThe *public names* defined by a module are determined by checking the\nmodule\'s namespace for a variable named ``__all__``; if defined, it\nmust be a sequence of strings which are names defined or imported by\nthat module. The names given in ``__all__`` are all considered public\nand are required to exist. If ``__all__`` is not defined, the set of\npublic names includes all names found in the module\'s namespace which\ndo not begin with an underscore character (``\'_\'``). ``__all__``\nshould contain the entire public API. It is intended to avoid\naccidentally exporting items that are not part of the API (such as\nlibrary modules which were imported and used within the module).\n\nThe ``from`` form with ``*`` may only occur in a module scope. If the\nwild card form of import --- ``import *`` --- is used in a function\nand the function contains or is a nested block with free variables,\nthe compiler will raise a ``SyntaxError``.\n\n**Hierarchical module names:** when the module names contains one or\nmore dots, the module search path is carried out differently. The\nsequence of identifiers up to the last dot is used to find a\n"package"; the final identifier is then searched inside the package.\nA package is generally a subdirectory of a directory on ``sys.path``\nthat has a file ``__init__.py``.\n\nThe built-in function ``__import__()`` is provided to support\napplications that determine which modules need to be loaded\ndynamically; refer to *Built-in Functions* for additional information.\n\n\nFuture statements\n=================\n\nA *future statement* is a directive to the compiler that a particular\nmodule should be compiled using syntax or semantics that will be\navailable in a specified future release of Python. The future\nstatement is intended to ease migration to future versions of Python\nthat introduce incompatible changes to the language. It allows use of\nthe new features on a per-module basis before the release in which the\nfeature becomes standard.\n\n future_statement ::= "from" "__future__" "import" feature ["as" name]\n ("," feature ["as" name])*\n | "from" "__future__" "import" "(" feature ["as" name]\n ("," feature ["as" name])* [","] ")"\n feature ::= identifier\n name ::= identifier\n\nA future statement must appear near the top of the module. The only\nlines that can appear before a future statement are:\n\n* the module docstring (if any),\n\n* comments,\n\n* blank lines, and\n\n* other future statements.\n\nThe features recognized by Python 2.5 are ``absolute_import``,\n``division``, ``generators``, ``nested_scopes`` and\n``with_statement``. ``generators`` and ``nested_scopes`` are\nredundant in Python version 2.3 and above because they are always\nenabled.\n\nA future statement is recognized and treated specially at compile\ntime: Changes to the semantics of core constructs are often\nimplemented by generating different code. It may even be the case\nthat a new feature introduces new incompatible syntax (such as a new\nreserved word), in which case the compiler may need to parse the\nmodule differently. Such decisions cannot be pushed off until\nruntime.\n\nFor any given release, the compiler knows which feature names have\nbeen defined, and raises a compile-time error if a future statement\ncontains a feature not known to it.\n\nThe direct runtime semantics are the same as for any import statement:\nthere is a standard module ``__future__``, described later, and it\nwill be imported in the usual way at the time the future statement is\nexecuted.\n\nThe interesting runtime semantics depend on the specific feature\nenabled by the future statement.\n\nNote that there is nothing special about the statement:\n\n import __future__ [as name]\n\nThat is not a future statement; it\'s an ordinary import statement with\nno special semantics or syntax restrictions.\n\nCode compiled by an ``exec`` statement or calls to the builtin\nfunctions ``compile()`` and ``execfile()`` that occur in a module\n``M`` containing a future statement will, by default, use the new\nsyntax or semantics associated with the future statement. This can,\nstarting with Python 2.2 be controlled by optional arguments to\n``compile()`` --- see the documentation of that function for details.\n\nA future statement typed at an interactive interpreter prompt will\ntake effect for the rest of the interpreter session. If an\ninterpreter is started with the *-i* option, is passed a script name\nto execute, and the script includes a future statement, it will be in\neffect in the interactive session started after the script is\nexecuted.\n', + 'in': u'\nComparisons\n***********\n\nUnlike C, all comparison operations in Python have the same priority,\nwhich is lower than that of any arithmetic, shifting or bitwise\noperation. Also unlike C, expressions like ``a < b < c`` have the\ninterpretation that is conventional in mathematics:\n\n comparison ::= or_expr ( comp_operator or_expr )*\n comp_operator ::= "<" | ">" | "==" | ">=" | "<=" | "<>" | "!="\n | "is" ["not"] | ["not"] "in"\n\nComparisons yield boolean values: ``True`` or ``False``.\n\nComparisons can be chained arbitrarily, e.g., ``x < y <= z`` is\nequivalent to ``x < y and y <= z``, except that ``y`` is evaluated\nonly once (but in both cases ``z`` is not evaluated at all when ``x <\ny`` is found to be false).\n\nFormally, if *a*, *b*, *c*, ..., *y*, *z* are expressions and *op1*,\n*op2*, ..., *opN* are comparison operators, then ``a op1 b op2 c ... y\nopN z`` is equivalent to ``a op1 b and b op2 c and ... y opN z``,\nexcept that each expression is evaluated at most once.\n\nNote that ``a op1 b op2 c`` doesn\'t imply any kind of comparison\nbetween *a* and *c*, so that, e.g., ``x < y > z`` is perfectly legal\n(though perhaps not pretty).\n\nThe forms ``<>`` and ``!=`` are equivalent; for consistency with C,\n``!=`` is preferred; where ``!=`` is mentioned below ``<>`` is also\naccepted. The ``<>`` spelling is considered obsolescent.\n\nThe operators ``<``, ``>``, ``==``, ``>=``, ``<=``, and ``!=`` compare\nthe values of two objects. The objects need not have the same type.\nIf both are numbers, they are converted to a common type. Otherwise,\nobjects of different types *always* compare unequal, and are ordered\nconsistently but arbitrarily. You can control comparison behavior of\nobjects of non-builtin types by defining a ``__cmp__`` method or rich\ncomparison methods like ``__gt__``, described in section *Special\nmethod names*.\n\n(This unusual definition of comparison was used to simplify the\ndefinition of operations like sorting and the ``in`` and ``not in``\noperators. In the future, the comparison rules for objects of\ndifferent types are likely to change.)\n\nComparison of objects of the same type depends on the type:\n\n* Numbers are compared arithmetically.\n\n* Strings are compared lexicographically using the numeric equivalents\n (the result of the built-in function ``ord()``) of their characters.\n Unicode and 8-bit strings are fully interoperable in this behavior.\n [4]\n\n* Tuples and lists are compared lexicographically using comparison of\n corresponding elements. This means that to compare equal, each\n element must compare equal and the two sequences must be of the same\n type and have the same length.\n\n If not equal, the sequences are ordered the same as their first\n differing elements. For example, ``cmp([1,2,x], [1,2,y])`` returns\n the same as ``cmp(x,y)``. If the corresponding element does not\n exist, the shorter sequence is ordered first (for example, ``[1,2] <\n [1,2,3]``).\n\n* Mappings (dictionaries) compare equal if and only if their sorted\n (key, value) lists compare equal. [5] Outcomes other than equality\n are resolved consistently, but are not otherwise defined. [6]\n\n* Most other objects of builtin types compare unequal unless they are\n the same object; the choice whether one object is considered smaller\n or larger than another one is made arbitrarily but consistently\n within one execution of a program.\n\nThe operators ``in`` and ``not in`` test for collection membership.\n``x in s`` evaluates to true if *x* is a member of the collection *s*,\nand false otherwise. ``x not in s`` returns the negation of ``x in\ns``. The collection membership test has traditionally been bound to\nsequences; an object is a member of a collection if the collection is\na sequence and contains an element equal to that object. However, it\nmake sense for many other object types to support membership tests\nwithout being a sequence. In particular, dictionaries (for keys) and\nsets support membership testing.\n\nFor the list and tuple types, ``x in y`` is true if and only if there\nexists an index *i* such that ``x == y[i]`` is true.\n\nFor the Unicode and string types, ``x in y`` is true if and only if\n*x* is a substring of *y*. An equivalent test is ``y.find(x) != -1``.\nNote, *x* and *y* need not be the same type; consequently, ``u\'ab\' in\n\'abc\'`` will return ``True``. Empty strings are always considered to\nbe a substring of any other string, so ``"" in "abc"`` will return\n``True``.\n\nChanged in version 2.3: Previously, *x* was required to be a string of\nlength ``1``.\n\nFor user-defined classes which define the ``__contains__()`` method,\n``x in y`` is true if and only if ``y.__contains__(x)`` is true.\n\nFor user-defined classes which do not define ``__contains__()`` and do\ndefine ``__getitem__()``, ``x in y`` is true if and only if there is a\nnon-negative integer index *i* such that ``x == y[i]``, and all lower\ninteger indices do not raise ``IndexError`` exception. (If any other\nexception is raised, it is as if ``in`` raised that exception).\n\nThe operator ``not in`` is defined to have the inverse true value of\n``in``.\n\nThe operators ``is`` and ``is not`` test for object identity: ``x is\ny`` is true if and only if *x* and *y* are the same object. ``x is\nnot y`` yields the inverse truth value. [7]\n', 'integers': u'\nInteger and long integer literals\n*********************************\n\nInteger and long integer literals are described by the following\nlexical definitions:\n\n longinteger ::= integer ("l" | "L")\n integer ::= decimalinteger | octinteger | hexinteger\n decimalinteger ::= nonzerodigit digit* | "0"\n octinteger ::= "0" octdigit+\n hexinteger ::= "0" ("x" | "X") hexdigit+\n nonzerodigit ::= "1"..."9"\n octdigit ::= "0"..."7"\n hexdigit ::= digit | "a"..."f" | "A"..."F"\n\nAlthough both lower case ``\'l\'`` and upper case ``\'L\'`` are allowed as\nsuffix for long integers, it is strongly recommended to always use\n``\'L\'``, since the letter ``\'l\'`` looks too much like the digit\n``\'1\'``.\n\nPlain integer literals that are above the largest representable plain\ninteger (e.g., 2147483647 when using 32-bit arithmetic) are accepted\nas if they were long integers instead. [1] There is no limit for long\ninteger literals apart from what can be stored in available memory.\n\nSome examples of plain integer literals (first row) and long integer\nliterals (second and third rows):\n\n 7 2147483647 0177\n 3L 79228162514264337593543950336L 0377L 0x100000000L\n 79228162514264337593543950336 0xdeadbeef\n', 'lambda': u'\nExpression lists\n****************\n\n expression_list ::= expression ( "," expression )* [","]\n\nAn expression list containing at least one comma yields a tuple. The\nlength of the tuple is the number of expressions in the list. The\nexpressions are evaluated from left to right.\n\nThe trailing comma is required only to create a single tuple (a.k.a. a\n*singleton*); it is optional in all other cases. A single expression\nwithout a trailing comma doesn\'t create a tuple, but rather yields the\nvalue of that expression. (To create an empty tuple, use an empty pair\nof parentheses: ``()``.)\n', 'lists': u'\nList displays\n*************\n\nA list display is a possibly empty series of expressions enclosed in\nsquare brackets:\n\n list_display ::= "[" [expression_list | list_comprehension] "]"\n list_comprehension ::= expression list_for\n list_for ::= "for" target_list "in" old_expression_list [list_iter]\n old_expression_list ::= old_expression [("," old_expression)+ [","]]\n list_iter ::= list_for | list_if\n list_if ::= "if" old_expression [list_iter]\n\nA list display yields a new list object. Its contents are specified\nby providing either a list of expressions or a list comprehension.\nWhen a comma-separated list of expressions is supplied, its elements\nare evaluated from left to right and placed into the list object in\nthat order. When a list comprehension is supplied, it consists of a\nsingle expression followed by at least one ``for`` clause and zero or\nmore ``for`` or ``if`` clauses. In this case, the elements of the new\nlist are those that would be produced by considering each of the\n``for`` or ``if`` clauses a block, nesting from left to right, and\nevaluating the expression to produce a list element each time the\ninnermost block is reached [1].\n', 'naming': u'\nNaming and binding\n******************\n\n*Names* refer to objects. Names are introduced by name binding\noperations. Each occurrence of a name in the program text refers to\nthe *binding* of that name established in the innermost function block\ncontaining the use.\n\nA *block* is a piece of Python program text that is executed as a\nunit. The following are blocks: a module, a function body, and a class\ndefinition. Each command typed interactively is a block. A script\nfile (a file given as standard input to the interpreter or specified\non the interpreter command line the first argument) is a code block.\nA script command (a command specified on the interpreter command line\nwith the \'**-c**\' option) is a code block. The file read by the\nbuilt-in function ``execfile()`` is a code block. The string argument\npassed to the built-in function ``eval()`` and to the ``exec``\nstatement is a code block. The expression read and evaluated by the\nbuilt-in function ``input()`` is a code block.\n\nA code block is executed in an *execution frame*. A frame contains\nsome administrative information (used for debugging) and determines\nwhere and how execution continues after the code block\'s execution has\ncompleted.\n\nA *scope* defines the visibility of a name within a block. If a local\nvariable is defined in a block, its scope includes that block. If the\ndefinition occurs in a function block, the scope extends to any blocks\ncontained within the defining one, unless a contained block introduces\na different binding for the name. The scope of names defined in a\nclass block is limited to the class block; it does not extend to the\ncode blocks of methods -- this includes generator expressions since\nthey are implemented using a function scope. This means that the\nfollowing will fail:\n\n class A:\n a = 42\n b = list(a + i for i in range(10))\n\nWhen a name is used in a code block, it is resolved using the nearest\nenclosing scope. The set of all such scopes visible to a code block\nis called the block\'s *environment*.\n\nIf a name is bound in a block, it is a local variable of that block.\nIf a name is bound at the module level, it is a global variable. (The\nvariables of the module code block are local and global.) If a\nvariable is used in a code block but not defined there, it is a *free\nvariable*.\n\nWhen a name is not found at all, a ``NameError`` exception is raised.\nIf the name refers to a local variable that has not been bound, a\n``UnboundLocalError`` exception is raised. ``UnboundLocalError`` is a\nsubclass of ``NameError``.\n\nThe following constructs bind names: formal parameters to functions,\n``import`` statements, class and function definitions (these bind the\nclass or function name in the defining block), and targets that are\nidentifiers if occurring in an assignment, ``for`` loop header, or in\nthe second position of an ``except`` clause header. The ``import``\nstatement of the form "``from ...import *``" binds all names defined\nin the imported module, except those beginning with an underscore.\nThis form may only be used at the module level.\n\nA target occurring in a ``del`` statement is also considered bound for\nthis purpose (though the actual semantics are to unbind the name). It\nis illegal to unbind a name that is referenced by an enclosing scope;\nthe compiler will report a ``SyntaxError``.\n\nEach assignment or import statement occurs within a block defined by a\nclass or function definition or at the module level (the top-level\ncode block).\n\nIf a name binding operation occurs anywhere within a code block, all\nuses of the name within the block are treated as references to the\ncurrent block. This can lead to errors when a name is used within a\nblock before it is bound. This rule is subtle. Python lacks\ndeclarations and allows name binding operations to occur anywhere\nwithin a code block. The local variables of a code block can be\ndetermined by scanning the entire text of the block for name binding\noperations.\n\nIf the global statement occurs within a block, all uses of the name\nspecified in the statement refer to the binding of that name in the\ntop-level namespace. Names are resolved in the top-level namespace by\nsearching the global namespace, i.e. the namespace of the module\ncontaining the code block, and the builtin namespace, the namespace of\nthe module ``__builtin__``. The global namespace is searched first.\nIf the name is not found there, the builtin namespace is searched.\nThe global statement must precede all uses of the name.\n\nThe built-in namespace associated with the execution of a code block\nis actually found by looking up the name ``__builtins__`` in its\nglobal namespace; this should be a dictionary or a module (in the\nlatter case the module\'s dictionary is used). By default, when in the\n``__main__`` module, ``__builtins__`` is the built-in module\n``__builtin__`` (note: no \'s\'); when in any other module,\n``__builtins__`` is an alias for the dictionary of the ``__builtin__``\nmodule itself. ``__builtins__`` can be set to a user-created\ndictionary to create a weak form of restricted execution.\n\nNote: Users should not touch ``__builtins__``; it is strictly an\n implementation detail. Users wanting to override values in the\n built-in namespace should ``import`` the ``__builtin__`` (no \'s\')\n module and modify its attributes appropriately.\n\nThe namespace for a module is automatically created the first time a\nmodule is imported. The main module for a script is always called\n``__main__``.\n\nThe global statement has the same scope as a name binding operation in\nthe same block. If the nearest enclosing scope for a free variable\ncontains a global statement, the free variable is treated as a global.\n\nA class definition is an executable statement that may use and define\nnames. These references follow the normal rules for name resolution.\nThe namespace of the class definition becomes the attribute dictionary\nof the class. Names defined at the class scope are not visible in\nmethods.\n\n\nInteraction with dynamic features\n=================================\n\nThere are several cases where Python statements are illegal when used\nin conjunction with nested scopes that contain free variables.\n\nIf a variable is referenced in an enclosing scope, it is illegal to\ndelete the name. An error will be reported at compile time.\n\nIf the wild card form of import --- ``import *`` --- is used in a\nfunction and the function contains or is a nested block with free\nvariables, the compiler will raise a ``SyntaxError``.\n\nIf ``exec`` is used in a function and the function contains or is a\nnested block with free variables, the compiler will raise a\n``SyntaxError`` unless the exec explicitly specifies the local\nnamespace for the ``exec``. (In other words, ``exec obj`` would be\nillegal, but ``exec obj in ns`` would be legal.)\n\nThe ``eval()``, ``execfile()``, and ``input()`` functions and the\n``exec`` statement do not have access to the full environment for\nresolving names. Names may be resolved in the local and global\nnamespaces of the caller. Free variables are not resolved in the\nnearest enclosing namespace, but in the global namespace. [1] The\n``exec`` statement and the ``eval()`` and ``execfile()`` functions\nhave optional arguments to override the global and local namespace.\nIf only one namespace is specified, it is used for both.\n', 'numbers': u"\nNumeric literals\n****************\n\nThere are four types of numeric literals: plain integers, long\nintegers, floating point numbers, and imaginary numbers. There are no\ncomplex literals (complex numbers can be formed by adding a real\nnumber and an imaginary number).\n\nNote that numeric literals do not include a sign; a phrase like ``-1``\nis actually an expression composed of the unary operator '``-``' and\nthe literal ``1``.\n", - 'numeric-types': u'\nEmulating numeric types\n***********************\n\nThe following methods can be defined to emulate numeric objects.\nMethods corresponding to operations that are not supported by the\nparticular kind of number implemented (e.g., bitwise operations for\nnon-integral numbers) should be left undefined.\n\nobject.__add__(self, other)\nobject.__sub__(self, other)\nobject.__mul__(self, other)\nobject.__floordiv__(self, other)\nobject.__mod__(self, other)\nobject.__divmod__(self, other)\nobject.__pow__(self, other[, modulo])\nobject.__lshift__(self, other)\nobject.__rshift__(self, other)\nobject.__and__(self, other)\nobject.__xor__(self, other)\nobject.__or__(self, other)\n\n These methods are called to implement the binary arithmetic\n operations (``+``, ``-``, ``*``, ``//``, ``%``, ``divmod()``,\n ``pow()``, ``**``, ``<<``, ``>>``, ``&``, ``^``, ``|``). For\n instance, to evaluate the expression *x*``+``*y*, where *x* is an\n instance of a class that has an ``__add__()`` method,\n ``x.__add__(y)`` is called. The ``__divmod__()`` method should be\n the equivalent to using ``__floordiv__()`` and ``__mod__()``; it\n should not be related to ``__truediv__()`` (described below). Note\n that ``__pow__()`` should be defined to accept an optional third\n argument if the ternary version of the built-in ``pow()`` function\n is to be supported.\n\n If one of those methods does not support the operation with the\n supplied arguments, it should return ``NotImplemented``.\n\nobject.__div__(self, other)\nobject.__truediv__(self, other)\n\n The division operator (``/``) is implemented by these methods. The\n ``__truediv__()`` method is used when ``__future__.division`` is in\n effect, otherwise ``__div__()`` is used. If only one of these two\n methods is defined, the object will not support division in the\n alternate context; ``TypeError`` will be raised instead.\n\nobject.__radd__(self, other)\nobject.__rsub__(self, other)\nobject.__rmul__(self, other)\nobject.__rdiv__(self, other)\nobject.__rtruediv__(self, other)\nobject.__rfloordiv__(self, other)\nobject.__rmod__(self, other)\nobject.__rdivmod__(self, other)\nobject.__rpow__(self, other)\nobject.__rlshift__(self, other)\nobject.__rrshift__(self, other)\nobject.__rand__(self, other)\nobject.__rxor__(self, other)\nobject.__ror__(self, other)\n\n These methods are called to implement the binary arithmetic\n operations (``+``, ``-``, ``*``, ``/``, ``%``, ``divmod()``,\n ``pow()``, ``**``, ``<<``, ``>>``, ``&``, ``^``, ``|``) with\n reflected (swapped) operands. These functions are only called if\n the left operand does not support the corresponding operation and\n the operands are of different types. [4] For instance, to evaluate\n the expression *x*``-``*y*, where *y* is an instance of a class\n that has an ``__rsub__()`` method, ``y.__rsub__(x)`` is called if\n ``x.__sub__(y)`` returns *NotImplemented*.\n\n Note that ternary ``pow()`` will not try calling ``__rpow__()``\n (the coercion rules would become too complicated).\n\n Note: If the right operand\'s type is a subclass of the left operand\'s\n type and that subclass provides the reflected method for the\n operation, this method will be called before the left operand\'s\n non-reflected method. This behavior allows subclasses to\n override their ancestors\' operations.\n\nobject.__iadd__(self, other)\nobject.__isub__(self, other)\nobject.__imul__(self, other)\nobject.__idiv__(self, other)\nobject.__itruediv__(self, other)\nobject.__ifloordiv__(self, other)\nobject.__imod__(self, other)\nobject.__ipow__(self, other[, modulo])\nobject.__ilshift__(self, other)\nobject.__irshift__(self, other)\nobject.__iand__(self, other)\nobject.__ixor__(self, other)\nobject.__ior__(self, other)\n\n These methods are called to implement the augmented arithmetic\n operations (``+=``, ``-=``, ``*=``, ``/=``, ``//=``, ``%=``,\n ``**=``, ``<<=``, ``>>=``, ``&=``, ``^=``, ``|=``). These methods\n should attempt to do the operation in-place (modifying *self*) and\n return the result (which could be, but does not have to be,\n *self*). If a specific method is not defined, the augmented\n operation falls back to the normal methods. For instance, to\n evaluate the expression *x*``+=``*y*, where *x* is an instance of a\n class that has an ``__iadd__()`` method, ``x.__iadd__(y)`` is\n called. If *x* is an instance of a class that does not define a\n ``__iadd__()`` method, ``x.__add__(y)`` and ``y.__radd__(x)`` are\n considered, as with the evaluation of *x*``+``*y*.\n\nobject.__neg__(self)\nobject.__pos__(self)\nobject.__abs__(self)\nobject.__invert__(self)\n\n Called to implement the unary arithmetic operations (``-``, ``+``,\n ``abs()`` and ``~``).\n\nobject.__complex__(self)\nobject.__int__(self)\nobject.__long__(self)\nobject.__float__(self)\n\n Called to implement the built-in functions ``complex()``,\n ``int()``, ``long()``, and ``float()``. Should return a value of\n the appropriate type.\n\nobject.__oct__(self)\nobject.__hex__(self)\n\n Called to implement the built-in functions ``oct()`` and ``hex()``.\n Should return a string value.\n\nobject.__index__(self)\n\n Called to implement ``operator.index()``. Also called whenever\n Python needs an integer object (such as in slicing). Must return\n an integer (int or long).\n\n Added in version 2.5.\n\nobject.__coerce__(self, other)\n\n Called to implement "mixed-mode" numeric arithmetic. Should either\n return a 2-tuple containing *self* and *other* converted to a\n common numeric type, or ``None`` if conversion is impossible. When\n the common type would be the type of ``other``, it is sufficient to\n return ``None``, since the interpreter will also ask the other\n object to attempt a coercion (but sometimes, if the implementation\n of the other type cannot be changed, it is useful to do the\n conversion to the other type here). A return value of\n ``NotImplemented`` is equivalent to returning ``None``.\n', + 'numeric-types': u'\nEmulating numeric types\n***********************\n\nThe following methods can be defined to emulate numeric objects.\nMethods corresponding to operations that are not supported by the\nparticular kind of number implemented (e.g., bitwise operations for\nnon-integral numbers) should be left undefined.\n\nobject.__add__(self, other)\nobject.__sub__(self, other)\nobject.__mul__(self, other)\nobject.__floordiv__(self, other)\nobject.__mod__(self, other)\nobject.__divmod__(self, other)\nobject.__pow__(self, other[, modulo])\nobject.__lshift__(self, other)\nobject.__rshift__(self, other)\nobject.__and__(self, other)\nobject.__xor__(self, other)\nobject.__or__(self, other)\n\n These methods are called to implement the binary arithmetic\n operations (``+``, ``-``, ``*``, ``//``, ``%``, ``divmod()``,\n ``pow()``, ``**``, ``<<``, ``>>``, ``&``, ``^``, ``|``). For\n instance, to evaluate the expression ``x + y``, where *x* is an\n instance of a class that has an ``__add__()`` method,\n ``x.__add__(y)`` is called. The ``__divmod__()`` method should be\n the equivalent to using ``__floordiv__()`` and ``__mod__()``; it\n should not be related to ``__truediv__()`` (described below). Note\n that ``__pow__()`` should be defined to accept an optional third\n argument if the ternary version of the built-in ``pow()`` function\n is to be supported.\n\n If one of those methods does not support the operation with the\n supplied arguments, it should return ``NotImplemented``.\n\nobject.__div__(self, other)\nobject.__truediv__(self, other)\n\n The division operator (``/``) is implemented by these methods. The\n ``__truediv__()`` method is used when ``__future__.division`` is in\n effect, otherwise ``__div__()`` is used. If only one of these two\n methods is defined, the object will not support division in the\n alternate context; ``TypeError`` will be raised instead.\n\nobject.__radd__(self, other)\nobject.__rsub__(self, other)\nobject.__rmul__(self, other)\nobject.__rdiv__(self, other)\nobject.__rtruediv__(self, other)\nobject.__rfloordiv__(self, other)\nobject.__rmod__(self, other)\nobject.__rdivmod__(self, other)\nobject.__rpow__(self, other)\nobject.__rlshift__(self, other)\nobject.__rrshift__(self, other)\nobject.__rand__(self, other)\nobject.__rxor__(self, other)\nobject.__ror__(self, other)\n\n These methods are called to implement the binary arithmetic\n operations (``+``, ``-``, ``*``, ``/``, ``%``, ``divmod()``,\n ``pow()``, ``**``, ``<<``, ``>>``, ``&``, ``^``, ``|``) with\n reflected (swapped) operands. These functions are only called if\n the left operand does not support the corresponding operation and\n the operands are of different types. [3] For instance, to evaluate\n the expression ``x - y``, where *y* is an instance of a class that\n has an ``__rsub__()`` method, ``y.__rsub__(x)`` is called if\n ``x.__sub__(y)`` returns *NotImplemented*.\n\n Note that ternary ``pow()`` will not try calling ``__rpow__()``\n (the coercion rules would become too complicated).\n\n Note: If the right operand\'s type is a subclass of the left operand\'s\n type and that subclass provides the reflected method for the\n operation, this method will be called before the left operand\'s\n non-reflected method. This behavior allows subclasses to\n override their ancestors\' operations.\n\nobject.__iadd__(self, other)\nobject.__isub__(self, other)\nobject.__imul__(self, other)\nobject.__idiv__(self, other)\nobject.__itruediv__(self, other)\nobject.__ifloordiv__(self, other)\nobject.__imod__(self, other)\nobject.__ipow__(self, other[, modulo])\nobject.__ilshift__(self, other)\nobject.__irshift__(self, other)\nobject.__iand__(self, other)\nobject.__ixor__(self, other)\nobject.__ior__(self, other)\n\n These methods are called to implement the augmented arithmetic\n operations (``+=``, ``-=``, ``*=``, ``/=``, ``//=``, ``%=``,\n ``**=``, ``<<=``, ``>>=``, ``&=``, ``^=``, ``|=``). These methods\n should attempt to do the operation in-place (modifying *self*) and\n return the result (which could be, but does not have to be,\n *self*). If a specific method is not defined, the augmented\n operation falls back to the normal methods. For instance, to\n evaluate the expression ``x += y``, where *x* is an instance of a\n class that has an ``__iadd__()`` method, ``x.__iadd__(y)`` is\n called. If *x* is an instance of a class that does not define a\n ``__iadd__()`` method, ``x.__add__(y)`` and ``y.__radd__(x)`` are\n considered, as with the evaluation of ``x + y``.\n\nobject.__neg__(self)\nobject.__pos__(self)\nobject.__abs__(self)\nobject.__invert__(self)\n\n Called to implement the unary arithmetic operations (``-``, ``+``,\n ``abs()`` and ``~``).\n\nobject.__complex__(self)\nobject.__int__(self)\nobject.__long__(self)\nobject.__float__(self)\n\n Called to implement the built-in functions ``complex()``,\n ``int()``, ``long()``, and ``float()``. Should return a value of\n the appropriate type.\n\nobject.__oct__(self)\nobject.__hex__(self)\n\n Called to implement the built-in functions ``oct()`` and ``hex()``.\n Should return a string value.\n\nobject.__index__(self)\n\n Called to implement ``operator.index()``. Also called whenever\n Python needs an integer object (such as in slicing). Must return\n an integer (int or long).\n\n New in version 2.5.\n\nobject.__coerce__(self, other)\n\n Called to implement "mixed-mode" numeric arithmetic. Should either\n return a 2-tuple containing *self* and *other* converted to a\n common numeric type, or ``None`` if conversion is impossible. When\n the common type would be the type of ``other``, it is sufficient to\n return ``None``, since the interpreter will also ask the other\n object to attempt a coercion (but sometimes, if the implementation\n of the other type cannot be changed, it is useful to do the\n conversion to the other type here). A return value of\n ``NotImplemented`` is equivalent to returning ``None``.\n', 'objects': u'\nObjects, values and types\n*************************\n\n*Objects* are Python\'s abstraction for data. All data in a Python\nprogram is represented by objects or by relations between objects. (In\na sense, and in conformance to Von Neumann\'s model of a "stored\nprogram computer," code is also represented by objects.)\n\nEvery object has an identity, a type and a value. An object\'s\n*identity* never changes once it has been created; you may think of it\nas the object\'s address in memory. The \'``is``\' operator compares the\nidentity of two objects; the ``id()`` function returns an integer\nrepresenting its identity (currently implemented as its address). An\nobject\'s *type* is also unchangeable. [1] An object\'s type determines\nthe operations that the object supports (e.g., "does it have a\nlength?") and also defines the possible values for objects of that\ntype. The ``type()`` function returns an object\'s type (which is an\nobject itself). The *value* of some objects can change. Objects\nwhose value can change are said to be *mutable*; objects whose value\nis unchangeable once they are created are called *immutable*. (The\nvalue of an immutable container object that contains a reference to a\nmutable object can change when the latter\'s value is changed; however\nthe container is still considered immutable, because the collection of\nobjects it contains cannot be changed. So, immutability is not\nstrictly the same as having an unchangeable value, it is more subtle.)\nAn object\'s mutability is determined by its type; for instance,\nnumbers, strings and tuples are immutable, while dictionaries and\nlists are mutable.\n\nObjects are never explicitly destroyed; however, when they become\nunreachable they may be garbage-collected. An implementation is\nallowed to postpone garbage collection or omit it altogether --- it is\na matter of implementation quality how garbage collection is\nimplemented, as long as no objects are collected that are still\nreachable. (Implementation note: the current implementation uses a\nreference-counting scheme with (optional) delayed detection of\ncyclically linked garbage, which collects most objects as soon as they\nbecome unreachable, but is not guaranteed to collect garbage\ncontaining circular references. See the documentation of the ``gc``\nmodule for information on controlling the collection of cyclic\ngarbage.)\n\nNote that the use of the implementation\'s tracing or debugging\nfacilities may keep objects alive that would normally be collectable.\nAlso note that catching an exception with a \'``try``...``except``\'\nstatement may keep objects alive.\n\nSome objects contain references to "external" resources such as open\nfiles or windows. It is understood that these resources are freed\nwhen the object is garbage-collected, but since garbage collection is\nnot guaranteed to happen, such objects also provide an explicit way to\nrelease the external resource, usually a ``close()`` method. Programs\nare strongly recommended to explicitly close such objects. The\n\'``try``...``finally``\' statement provides a convenient way to do\nthis.\n\nSome objects contain references to other objects; these are called\n*containers*. Examples of containers are tuples, lists and\ndictionaries. The references are part of a container\'s value. In\nmost cases, when we talk about the value of a container, we imply the\nvalues, not the identities of the contained objects; however, when we\ntalk about the mutability of a container, only the identities of the\nimmediately contained objects are implied. So, if an immutable\ncontainer (like a tuple) contains a reference to a mutable object, its\nvalue changes if that mutable object is changed.\n\nTypes affect almost all aspects of object behavior. Even the\nimportance of object identity is affected in some sense: for immutable\ntypes, operations that compute new values may actually return a\nreference to any existing object with the same type and value, while\nfor mutable objects this is not allowed. E.g., after ``a = 1; b =\n1``, ``a`` and ``b`` may or may not refer to the same object with the\nvalue one, depending on the implementation, but after ``c = []; d =\n[]``, ``c`` and ``d`` are guaranteed to refer to two different,\nunique, newly created empty lists. (Note that ``c = d = []`` assigns\nthe same object to both ``c`` and ``d``.)\n', - 'operator-summary': u'\nSummary\n*******\n\nThe following table summarizes the operator precedences in Python,\nfrom lowest precedence (least binding) to highest precedence (most\nbinding). Operators in the same box have the same precedence. Unless\nthe syntax is explicitly given, operators are binary. Operators in\nthe same box group left to right (except for comparisons, including\ntests, which all have the same precedence and chain from left to right\n--- see section *Comparisons* --- and exponentiation, which groups\nfrom right to left).\n\n+-------------------------------------------------+---------------------------------------+\n| Operator | Description |\n+=================================================+=======================================+\n| ``lambda`` | Lambda expression |\n+-------------------------------------------------+---------------------------------------+\n| ``or`` | Boolean OR |\n+-------------------------------------------------+---------------------------------------+\n| ``and`` | Boolean AND |\n+-------------------------------------------------+---------------------------------------+\n| ``not`` *x* | Boolean NOT |\n+-------------------------------------------------+---------------------------------------+\n| ``in``, ``not`` ``in`` | Membership tests |\n+-------------------------------------------------+---------------------------------------+\n| ``is``, ``is not`` | Identity tests |\n+-------------------------------------------------+---------------------------------------+\n| ``<``, ``<=``, ``>``, ``>=``, ``<>``, ``!=``, | Comparisons |\n| ``==`` | |\n+-------------------------------------------------+---------------------------------------+\n| ``|`` | Bitwise OR |\n+-------------------------------------------------+---------------------------------------+\n| ``^`` | Bitwise XOR |\n+-------------------------------------------------+---------------------------------------+\n| ``&`` | Bitwise AND |\n+-------------------------------------------------+---------------------------------------+\n| ``<<``, ``>>`` | Shifts |\n+-------------------------------------------------+---------------------------------------+\n| ``+``, ``-`` | Addition and subtraction |\n+-------------------------------------------------+---------------------------------------+\n| ``*``, ``/``, ``%`` | Multiplication, division, remainder |\n+-------------------------------------------------+---------------------------------------+\n| ``+x``, ``-x`` | Positive, negative |\n+-------------------------------------------------+---------------------------------------+\n| ``~x`` | Bitwise not |\n+-------------------------------------------------+---------------------------------------+\n| ``**`` | Exponentiation |\n+-------------------------------------------------+---------------------------------------+\n| ``x.attribute`` | Attribute reference |\n+-------------------------------------------------+---------------------------------------+\n| ``x[index]`` | Subscription |\n+-------------------------------------------------+---------------------------------------+\n| ``x[index:index]`` | Slicing |\n+-------------------------------------------------+---------------------------------------+\n| ``f(arguments...)`` | Function call |\n+-------------------------------------------------+---------------------------------------+\n| ``(expressions...)`` | Binding or tuple display |\n+-------------------------------------------------+---------------------------------------+\n| ``[expressions...]`` | List display |\n+-------------------------------------------------+---------------------------------------+\n| ``{key:datum...}`` | Dictionary display |\n+-------------------------------------------------+---------------------------------------+\n| ```expressions...``` | String conversion |\n+-------------------------------------------------+---------------------------------------+\n\n-[ Footnotes ]-\n\n[1] In Python 2.3 and later releases, a list comprehension "leaks" the\n control variables of each ``for`` it contains into the containing\n scope. However, this behavior is deprecated, and relying on it\n will not work in Python 3.0\n\n[2] While ``abs(x%y) < abs(y)`` is true mathematically, for floats it\n may not be true numerically due to roundoff. For example, and\n assuming a platform on which a Python float is an IEEE 754 double-\n precision number, in order that ``-1e-100 % 1e100`` have the same\n sign as ``1e100``, the computed result is ``-1e-100 + 1e100``,\n which is numerically exactly equal to ``1e100``. Function\n ``fmod()`` in the ``math`` module returns a result whose sign\n matches the sign of the first argument instead, and so returns\n ``-1e-100`` in this case. Which approach is more appropriate\n depends on the application.\n\n[3] If x is very close to an exact integer multiple of y, it\'s\n possible for ``floor(x/y)`` to be one larger than ``(x-x%y)/y``\n due to rounding. In such cases, Python returns the latter result,\n in order to preserve that ``divmod(x,y)[0] * y + x % y`` be very\n close to ``x``.\n\n[4] While comparisons between unicode strings make sense at the byte\n level, they may be counter-intuitive to users. For example, the\n strings ``u"\\u00C7"`` and ``u"\\u0043\\u0327"`` compare differently,\n even though they both represent the same unicode character (LATIN\n CAPTITAL LETTER C WITH CEDILLA). To compare strings in a human\n recognizable way, compare using ``unicodedata.normalize()``.\n\n[5] The implementation computes this efficiently, without constructing\n lists or sorting.\n\n[6] Earlier versions of Python used lexicographic comparison of the\n sorted (key, value) lists, but this was very expensive for the\n common case of comparing for equality. An even earlier version of\n Python compared dictionaries by identity only, but this caused\n surprises because people expected to be able to test a dictionary\n for emptiness by comparing it to ``{}``.\n', + 'operator-summary': u'\nSummary\n*******\n\nThe following table summarizes the operator precedences in Python,\nfrom lowest precedence (least binding) to highest precedence (most\nbinding). Operators in the same box have the same precedence. Unless\nthe syntax is explicitly given, operators are binary. Operators in\nthe same box group left to right (except for comparisons, including\ntests, which all have the same precedence and chain from left to right\n--- see section *Comparisons* --- and exponentiation, which groups\nfrom right to left).\n\n+-------------------------------------------------+---------------------------------------+\n| Operator | Description |\n+=================================================+=======================================+\n| ``lambda`` | Lambda expression |\n+-------------------------------------------------+---------------------------------------+\n| ``or`` | Boolean OR |\n+-------------------------------------------------+---------------------------------------+\n| ``and`` | Boolean AND |\n+-------------------------------------------------+---------------------------------------+\n| ``not`` *x* | Boolean NOT |\n+-------------------------------------------------+---------------------------------------+\n| ``in``, ``not`` ``in`` | Membership tests |\n+-------------------------------------------------+---------------------------------------+\n| ``is``, ``is not`` | Identity tests |\n+-------------------------------------------------+---------------------------------------+\n| ``<``, ``<=``, ``>``, ``>=``, ``<>``, ``!=``, | Comparisons |\n| ``==`` | |\n+-------------------------------------------------+---------------------------------------+\n| ``|`` | Bitwise OR |\n+-------------------------------------------------+---------------------------------------+\n| ``^`` | Bitwise XOR |\n+-------------------------------------------------+---------------------------------------+\n| ``&`` | Bitwise AND |\n+-------------------------------------------------+---------------------------------------+\n| ``<<``, ``>>`` | Shifts |\n+-------------------------------------------------+---------------------------------------+\n| ``+``, ``-`` | Addition and subtraction |\n+-------------------------------------------------+---------------------------------------+\n| ``*``, ``/``, ``%`` | Multiplication, division, remainder |\n+-------------------------------------------------+---------------------------------------+\n| ``+x``, ``-x`` | Positive, negative |\n+-------------------------------------------------+---------------------------------------+\n| ``~x`` | Bitwise not |\n+-------------------------------------------------+---------------------------------------+\n| ``**`` | Exponentiation |\n+-------------------------------------------------+---------------------------------------+\n| ``x[index]`` | Subscription |\n+-------------------------------------------------+---------------------------------------+\n| ``x[index:index]`` | Slicing |\n+-------------------------------------------------+---------------------------------------+\n| ``x(arguments...)`` | Call |\n+-------------------------------------------------+---------------------------------------+\n| ``x.attribute`` | Attribute reference |\n+-------------------------------------------------+---------------------------------------+\n| ``(expressions...)`` | Binding or tuple display |\n+-------------------------------------------------+---------------------------------------+\n| ``[expressions...]`` | List display |\n+-------------------------------------------------+---------------------------------------+\n| ``{key:datum...}`` | Dictionary display |\n+-------------------------------------------------+---------------------------------------+\n| ```expressions...``` | String conversion |\n+-------------------------------------------------+---------------------------------------+\n\n-[ Footnotes ]-\n\n[1] In Python 2.3 and later releases, a list comprehension "leaks" the\n control variables of each ``for`` it contains into the containing\n scope. However, this behavior is deprecated, and relying on it\n will not work in Python 3.0\n\n[2] While ``abs(x%y) < abs(y)`` is true mathematically, for floats it\n may not be true numerically due to roundoff. For example, and\n assuming a platform on which a Python float is an IEEE 754 double-\n precision number, in order that ``-1e-100 % 1e100`` have the same\n sign as ``1e100``, the computed result is ``-1e-100 + 1e100``,\n which is numerically exactly equal to ``1e100``. Function\n ``fmod()`` in the ``math`` module returns a result whose sign\n matches the sign of the first argument instead, and so returns\n ``-1e-100`` in this case. Which approach is more appropriate\n depends on the application.\n\n[3] If x is very close to an exact integer multiple of y, it\'s\n possible for ``floor(x/y)`` to be one larger than ``(x-x%y)/y``\n due to rounding. In such cases, Python returns the latter result,\n in order to preserve that ``divmod(x,y)[0] * y + x % y`` be very\n close to ``x``.\n\n[4] While comparisons between unicode strings make sense at the byte\n level, they may be counter-intuitive to users. For example, the\n strings ``u"\\u00C7"`` and ``u"\\u0043\\u0327"`` compare differently,\n even though they both represent the same unicode character (LATIN\n CAPTITAL LETTER C WITH CEDILLA). To compare strings in a human\n recognizable way, compare using ``unicodedata.normalize()``.\n\n[5] The implementation computes this efficiently, without constructing\n lists or sorting.\n\n[6] Earlier versions of Python used lexicographic comparison of the\n sorted (key, value) lists, but this was very expensive for the\n common case of comparing for equality. An even earlier version of\n Python compared dictionaries by identity only, but this caused\n surprises because people expected to be able to test a dictionary\n for emptiness by comparing it to ``{}``.\n\n[7] Due to automatic garbage-collection, free lists, and the dynamic\n nature of descriptors, you may notice seemingly unusual behaviour\n in certain uses of the ``is`` operator, like those involving\n comparisons between instance methods, or constants. Check their\n documentation for more info.\n', 'pass': u'\nThe ``pass`` statement\n**********************\n\n pass_stmt ::= "pass"\n\n``pass`` is a null operation --- when it is executed, nothing happens.\nIt is useful as a placeholder when a statement is required\nsyntactically, but no code needs to be executed, for example:\n\n def f(arg): pass # a function that does nothing (yet)\n\n class C: pass # a class with no methods (yet)\n', 'power': u'\nThe power operator\n******************\n\nThe power operator binds more tightly than unary operators on its\nleft; it binds less tightly than unary operators on its right. The\nsyntax is:\n\n power ::= primary ["**" u_expr]\n\nThus, in an unparenthesized sequence of power and unary operators, the\noperators are evaluated from right to left (this does not constrain\nthe evaluation order for the operands): ``-1**2`` results in ``-1``.\n\nThe power operator has the same semantics as the built-in ``pow()``\nfunction, when called with two arguments: it yields its left argument\nraised to the power of its right argument. The numeric arguments are\nfirst converted to a common type. The result type is that of the\narguments after coercion.\n\nWith mixed operand types, the coercion rules for binary arithmetic\noperators apply. For int and long int operands, the result has the\nsame type as the operands (after coercion) unless the second argument\nis negative; in that case, all arguments are converted to float and a\nfloat result is delivered. For example, ``10**2`` returns ``100``, but\n``10**-2`` returns ``0.01``. (This last feature was added in Python\n2.2. In Python 2.1 and before, if both arguments were of integer types\nand the second argument was negative, an exception was raised).\n\nRaising ``0.0`` to a negative power results in a\n``ZeroDivisionError``. Raising a negative number to a fractional power\nresults in a ``ValueError``.\n', - 'print': u'\nThe ``print`` statement\n***********************\n\n print_stmt ::= "print" ([expression ("," expression)* [","]\n | ">>" expression [("," expression)+ [","])\n\n``print`` evaluates each expression in turn and writes the resulting\nobject to standard output (see below). If an object is not a string,\nit is first converted to a string using the rules for string\nconversions. The (resulting or original) string is then written. A\nspace is written before each object is (converted and) written, unless\nthe output system believes it is positioned at the beginning of a\nline. This is the case (1) when no characters have yet been written\nto standard output, (2) when the last character written to standard\noutput is ``\'\\n\'``, or (3) when the last write operation on standard\noutput was not a ``print`` statement. (In some cases it may be\nfunctional to write an empty string to standard output for this\nreason.)\n\nNote: Objects which act like file objects but which are not the built-in\n file objects often do not properly emulate this aspect of the file\n object\'s behavior, so it is best not to rely on this.\n\nA ``\'\\n\'`` character is written at the end, unless the ``print``\nstatement ends with a comma. This is the only action if the statement\ncontains just the keyword ``print``.\n\nStandard output is defined as the file object named ``stdout`` in the\nbuilt-in module ``sys``. If no such object exists, or if it does not\nhave a ``write()`` method, a ``RuntimeError`` exception is raised.\n\n``print`` also has an extended form, defined by the second portion of\nthe syntax described above. This form is sometimes referred to as\n"``print`` chevron." In this form, the first expression after the\n``>>`` must evaluate to a "file-like" object, specifically an object\nthat has a ``write()`` method as described above. With this extended\nform, the subsequent expressions are printed to this file object. If\nthe first expression evaluates to ``None``, then ``sys.stdout`` is\nused as the file for output.\n', + 'print': u'\nThe ``print`` statement\n***********************\n\n print_stmt ::= "print" ([expression ("," expression)* [","]]\n | ">>" expression [("," expression)+ [","]])\n\n``print`` evaluates each expression in turn and writes the resulting\nobject to standard output (see below). If an object is not a string,\nit is first converted to a string using the rules for string\nconversions. The (resulting or original) string is then written. A\nspace is written before each object is (converted and) written, unless\nthe output system believes it is positioned at the beginning of a\nline. This is the case (1) when no characters have yet been written\nto standard output, (2) when the last character written to standard\noutput is ``\'\\n\'``, or (3) when the last write operation on standard\noutput was not a ``print`` statement. (In some cases it may be\nfunctional to write an empty string to standard output for this\nreason.)\n\nNote: Objects which act like file objects but which are not the built-in\n file objects often do not properly emulate this aspect of the file\n object\'s behavior, so it is best not to rely on this.\n\nA ``\'\\n\'`` character is written at the end, unless the ``print``\nstatement ends with a comma. This is the only action if the statement\ncontains just the keyword ``print``.\n\nStandard output is defined as the file object named ``stdout`` in the\nbuilt-in module ``sys``. If no such object exists, or if it does not\nhave a ``write()`` method, a ``RuntimeError`` exception is raised.\n\n``print`` also has an extended form, defined by the second portion of\nthe syntax described above. This form is sometimes referred to as\n"``print`` chevron." In this form, the first expression after the\n``>>`` must evaluate to a "file-like" object, specifically an object\nthat has a ``write()`` method as described above. With this extended\nform, the subsequent expressions are printed to this file object. If\nthe first expression evaluates to ``None``, then ``sys.stdout`` is\nused as the file for output.\n', 'raise': u'\nThe ``raise`` statement\n***********************\n\n raise_stmt ::= "raise" [expression ["," expression ["," expression]]]\n\nIf no expressions are present, ``raise`` re-raises the last exception\nthat was active in the current scope. If no exception is active in\nthe current scope, a ``TypeError`` exception is raised indicating that\nthis is an error (if running under IDLE, a ``Queue.Empty`` exception\nis raised instead).\n\nOtherwise, ``raise`` evaluates the expressions to get three objects,\nusing ``None`` as the value of omitted expressions. The first two\nobjects are used to determine the *type* and *value* of the exception.\n\nIf the first object is an instance, the type of the exception is the\nclass of the instance, the instance itself is the value, and the\nsecond object must be ``None``.\n\nIf the first object is a class, it becomes the type of the exception.\nThe second object is used to determine the exception value: If it is\nan instance of the class, the instance becomes the exception value. If\nthe second object is a tuple, it is used as the argument list for the\nclass constructor; if it is ``None``, an empty argument list is used,\nand any other object is treated as a single argument to the\nconstructor. The instance so created by calling the constructor is\nused as the exception value.\n\nIf a third object is present and not ``None``, it must be a traceback\nobject (see section *The standard type hierarchy*), and it is\nsubstituted instead of the current location as the place where the\nexception occurred. If the third object is present and not a\ntraceback object or ``None``, a ``TypeError`` exception is raised.\nThe three-expression form of ``raise`` is useful to re-raise an\nexception transparently in an except clause, but ``raise`` with no\nexpressions should be preferred if the exception to be re-raised was\nthe most recently active exception in the current scope.\n\nAdditional information on exceptions can be found in section\n*Exceptions*, and information about handling exceptions is in section\n*The try statement*.\n', 'return': u'\nThe ``return`` statement\n************************\n\n return_stmt ::= "return" [expression_list]\n\n``return`` may only occur syntactically nested in a function\ndefinition, not within a nested class definition.\n\nIf an expression list is present, it is evaluated, else ``None`` is\nsubstituted.\n\n``return`` leaves the current function call with the expression list\n(or ``None``) as return value.\n\nWhen ``return`` passes control out of a ``try`` statement with a\n``finally`` clause, that ``finally`` clause is executed before really\nleaving the function.\n\nIn a generator function, the ``return`` statement is not allowed to\ninclude an **expression_list**. In that context, a bare ``return``\nindicates that the generator is done and will cause ``StopIteration``\nto be raised.\n', - 'sequence-methods': u'\nAdditional methods for emulation of sequence types\n**************************************************\n\nThe following optional methods can be defined to further emulate\nsequence objects. Immutable sequences methods should at most only\ndefine ``__getslice__()``; mutable sequences might define all three\nmethods.\n\nobject.__getslice__(self, i, j)\n\n Deprecated in version 2.0: Support slice objects as parameters to\n the ``__getitem__()`` method. (However, built-in types in CPython\n currently still implement ``__getslice__()``. Therefore, you have\n to override it in derived classes when implementing slicing.)\n\n Called to implement evaluation of ``self[i:j]``. The returned\n object should be of the same type as *self*. Note that missing *i*\n or *j* in the slice expression are replaced by zero or\n ``sys.maxint``, respectively. If negative indexes are used in the\n slice, the length of the sequence is added to that index. If the\n instance does not implement the ``__len__()`` method, an\n ``AttributeError`` is raised. No guarantee is made that indexes\n adjusted this way are not still negative. Indexes which are\n greater than the length of the sequence are not modified. If no\n ``__getslice__()`` is found, a slice object is created instead, and\n passed to ``__getitem__()`` instead.\n\nobject.__setslice__(self, i, j, sequence)\n\n Called to implement assignment to ``self[i:j]``. Same notes for *i*\n and *j* as for ``__getslice__()``.\n\n This method is deprecated. If no ``__setslice__()`` is found, or\n for extended slicing of the form ``self[i:j:k]``, a slice object is\n created, and passed to ``__setitem__()``, instead of\n ``__setslice__()`` being called.\n\nobject.__delslice__(self, i, j)\n\n Called to implement deletion of ``self[i:j]``. Same notes for *i*\n and *j* as for ``__getslice__()``. This method is deprecated. If no\n ``__delslice__()`` is found, or for extended slicing of the form\n ``self[i:j:k]``, a slice object is created, and passed to\n ``__delitem__()``, instead of ``__delslice__()`` being called.\n\nNotice that these methods are only invoked when a single slice with a\nsingle colon is used, and the slice method is available. For slice\noperations involving extended slice notation, or in absence of the\nslice methods, ``__getitem__()``, ``__setitem__()`` or\n``__delitem__()`` is called with a slice object as argument.\n\nThe following example demonstrate how to make your program or module\ncompatible with earlier versions of Python (assuming that methods\n``__getitem__()``, ``__setitem__()`` and ``__delitem__()`` support\nslice objects as arguments):\n\n class MyClass:\n ...\n def __getitem__(self, index):\n ...\n def __setitem__(self, index, value):\n ...\n def __delitem__(self, index):\n ...\n\n if sys.version_info < (2, 0):\n # They won\'t be defined if version is at least 2.0 final\n\n def __getslice__(self, i, j):\n return self[max(0, i):max(0, j):]\n def __setslice__(self, i, j, seq):\n self[max(0, i):max(0, j):] = seq\n def __delslice__(self, i, j):\n del self[max(0, i):max(0, j):]\n ...\n\nNote the calls to ``max()``; these are necessary because of the\nhandling of negative indices before the ``__*slice__()`` methods are\ncalled. When negative indexes are used, the ``__*item__()`` methods\nreceive them as provided, but the ``__*slice__()`` methods get a\n"cooked" form of the index values. For each negative index value, the\nlength of the sequence is added to the index before calling the method\n(which may still result in a negative index); this is the customary\nhandling of negative indexes by the built-in sequence types, and the\n``__*item__()`` methods are expected to do this as well. However,\nsince they should already be doing that, negative indexes cannot be\npassed in; they must be constrained to the bounds of the sequence\nbefore being passed to the ``__*item__()`` methods. Calling ``max(0,\ni)`` conveniently returns the proper value.\n', - 'sequence-types': u"\nEmulating container types\n*************************\n\nThe following methods can be defined to implement container objects.\nContainers usually are sequences (such as lists or tuples) or mappings\n(like dictionaries), but can represent other containers as well. The\nfirst set of methods is used either to emulate a sequence or to\nemulate a mapping; the difference is that for a sequence, the\nallowable keys should be the integers *k* for which ``0 <= k < N``\nwhere *N* is the length of the sequence, or slice objects, which\ndefine a range of items. (For backwards compatibility, the method\n``__getslice__()`` (see below) can also be defined to handle simple,\nbut not extended slices.) It is also recommended that mappings provide\nthe methods ``keys()``, ``values()``, ``items()``, ``has_key()``,\n``get()``, ``clear()``, ``setdefault()``, ``iterkeys()``,\n``itervalues()``, ``iteritems()``, ``pop()``, ``popitem()``,\n``copy()``, and ``update()`` behaving similar to those for Python's\nstandard dictionary objects. The ``UserDict`` module provides a\n``DictMixin`` class to help create those methods from a base set of\n``__getitem__()``, ``__setitem__()``, ``__delitem__()``, and\n``keys()``. Mutable sequences should provide methods ``append()``,\n``count()``, ``index()``, ``extend()``, ``insert()``, ``pop()``,\n``remove()``, ``reverse()`` and ``sort()``, like Python standard list\nobjects. Finally, sequence types should implement addition (meaning\nconcatenation) and multiplication (meaning repetition) by defining the\nmethods ``__add__()``, ``__radd__()``, ``__iadd__()``, ``__mul__()``,\n``__rmul__()`` and ``__imul__()`` described below; they should not\ndefine ``__coerce__()`` or other numerical operators. It is\nrecommended that both mappings and sequences implement the\n``__contains__()`` method to allow efficient use of the ``in``\noperator; for mappings, ``in`` should be equivalent of ``has_key()``;\nfor sequences, it should search through the values. It is further\nrecommended that both mappings and sequences implement the\n``__iter__()`` method to allow efficient iteration through the\ncontainer; for mappings, ``__iter__()`` should be the same as\n``iterkeys()``; for sequences, it should iterate through the values.\n\nobject.__len__(self)\n\n Called to implement the built-in function ``len()``. Should return\n the length of the object, an integer ``>=`` 0. Also, an object\n that doesn't define a ``__nonzero__()`` method and whose\n ``__len__()`` method returns zero is considered to be false in a\n Boolean context.\n\nobject.__getitem__(self, key)\n\n Called to implement evaluation of ``self[key]``. For sequence\n types, the accepted keys should be integers and slice objects.\n Note that the special interpretation of negative indexes (if the\n class wishes to emulate a sequence type) is up to the\n ``__getitem__()`` method. If *key* is of an inappropriate type,\n ``TypeError`` may be raised; if of a value outside the set of\n indexes for the sequence (after any special interpretation of\n negative values), ``IndexError`` should be raised. For mapping\n types, if *key* is missing (not in the container), ``KeyError``\n should be raised.\n\n Note: ``for`` loops expect that an ``IndexError`` will be raised for\n illegal indexes to allow proper detection of the end of the\n sequence.\n\nobject.__setitem__(self, key, value)\n\n Called to implement assignment to ``self[key]``. Same note as for\n ``__getitem__()``. This should only be implemented for mappings if\n the objects support changes to the values for keys, or if new keys\n can be added, or for sequences if elements can be replaced. The\n same exceptions should be raised for improper *key* values as for\n the ``__getitem__()`` method.\n\nobject.__delitem__(self, key)\n\n Called to implement deletion of ``self[key]``. Same note as for\n ``__getitem__()``. This should only be implemented for mappings if\n the objects support removal of keys, or for sequences if elements\n can be removed from the sequence. The same exceptions should be\n raised for improper *key* values as for the ``__getitem__()``\n method.\n\nobject.__iter__(self)\n\n This method is called when an iterator is required for a container.\n This method should return a new iterator object that can iterate\n over all the objects in the container. For mappings, it should\n iterate over the keys of the container, and should also be made\n available as the method ``iterkeys()``.\n\n Iterator objects also need to implement this method; they are\n required to return themselves. For more information on iterator\n objects, see *Iterator Types*.\n\nobject.__reversed__(self)\n\n Called (if present) by the ``reversed()`` builtin to implement\n reverse iteration. It should return a new iterator object that\n iterates over all the objects in the container in reverse order.\n\n If the ``__reversed__()`` method is not provided, the\n ``reversed()`` builtin will fall back to using the sequence\n protocol (``__len__()`` and ``__getitem__()``). Objects should\n normally only provide ``__reversed__()`` if they do not support the\n sequence protocol and an efficient implementation of reverse\n iteration is possible.\n\n Added in version 2.6.\n\nThe membership test operators (``in`` and ``not in``) are normally\nimplemented as an iteration through a sequence. However, container\nobjects can supply the following special method with a more efficient\nimplementation, which also does not require the object be a sequence.\n\nobject.__contains__(self, item)\n\n Called to implement membership test operators. Should return true\n if *item* is in *self*, false otherwise. For mapping objects, this\n should consider the keys of the mapping rather than the values or\n the key-item pairs.\n", + 'sequence-methods': u'\nAdditional methods for emulation of sequence types\n**************************************************\n\nThe following optional methods can be defined to further emulate\nsequence objects. Immutable sequences methods should at most only\ndefine ``__getslice__()``; mutable sequences might define all three\nmethods.\n\nobject.__getslice__(self, i, j)\n\n Deprecated since version 2.0: Support slice objects as parameters\n to the ``__getitem__()`` method. (However, built-in types in\n CPython currently still implement ``__getslice__()``. Therefore,\n you have to override it in derived classes when implementing\n slicing.)\n\n Called to implement evaluation of ``self[i:j]``. The returned\n object should be of the same type as *self*. Note that missing *i*\n or *j* in the slice expression are replaced by zero or\n ``sys.maxint``, respectively. If negative indexes are used in the\n slice, the length of the sequence is added to that index. If the\n instance does not implement the ``__len__()`` method, an\n ``AttributeError`` is raised. No guarantee is made that indexes\n adjusted this way are not still negative. Indexes which are\n greater than the length of the sequence are not modified. If no\n ``__getslice__()`` is found, a slice object is created instead, and\n passed to ``__getitem__()`` instead.\n\nobject.__setslice__(self, i, j, sequence)\n\n Called to implement assignment to ``self[i:j]``. Same notes for *i*\n and *j* as for ``__getslice__()``.\n\n This method is deprecated. If no ``__setslice__()`` is found, or\n for extended slicing of the form ``self[i:j:k]``, a slice object is\n created, and passed to ``__setitem__()``, instead of\n ``__setslice__()`` being called.\n\nobject.__delslice__(self, i, j)\n\n Called to implement deletion of ``self[i:j]``. Same notes for *i*\n and *j* as for ``__getslice__()``. This method is deprecated. If no\n ``__delslice__()`` is found, or for extended slicing of the form\n ``self[i:j:k]``, a slice object is created, and passed to\n ``__delitem__()``, instead of ``__delslice__()`` being called.\n\nNotice that these methods are only invoked when a single slice with a\nsingle colon is used, and the slice method is available. For slice\noperations involving extended slice notation, or in absence of the\nslice methods, ``__getitem__()``, ``__setitem__()`` or\n``__delitem__()`` is called with a slice object as argument.\n\nThe following example demonstrate how to make your program or module\ncompatible with earlier versions of Python (assuming that methods\n``__getitem__()``, ``__setitem__()`` and ``__delitem__()`` support\nslice objects as arguments):\n\n class MyClass:\n ...\n def __getitem__(self, index):\n ...\n def __setitem__(self, index, value):\n ...\n def __delitem__(self, index):\n ...\n\n if sys.version_info < (2, 0):\n # They won\'t be defined if version is at least 2.0 final\n\n def __getslice__(self, i, j):\n return self[max(0, i):max(0, j):]\n def __setslice__(self, i, j, seq):\n self[max(0, i):max(0, j):] = seq\n def __delslice__(self, i, j):\n del self[max(0, i):max(0, j):]\n ...\n\nNote the calls to ``max()``; these are necessary because of the\nhandling of negative indices before the ``__*slice__()`` methods are\ncalled. When negative indexes are used, the ``__*item__()`` methods\nreceive them as provided, but the ``__*slice__()`` methods get a\n"cooked" form of the index values. For each negative index value, the\nlength of the sequence is added to the index before calling the method\n(which may still result in a negative index); this is the customary\nhandling of negative indexes by the built-in sequence types, and the\n``__*item__()`` methods are expected to do this as well. However,\nsince they should already be doing that, negative indexes cannot be\npassed in; they must be constrained to the bounds of the sequence\nbefore being passed to the ``__*item__()`` methods. Calling ``max(0,\ni)`` conveniently returns the proper value.\n', + 'sequence-types': u"\nEmulating container types\n*************************\n\nThe following methods can be defined to implement container objects.\nContainers usually are sequences (such as lists or tuples) or mappings\n(like dictionaries), but can represent other containers as well. The\nfirst set of methods is used either to emulate a sequence or to\nemulate a mapping; the difference is that for a sequence, the\nallowable keys should be the integers *k* for which ``0 <= k < N``\nwhere *N* is the length of the sequence, or slice objects, which\ndefine a range of items. (For backwards compatibility, the method\n``__getslice__()`` (see below) can also be defined to handle simple,\nbut not extended slices.) It is also recommended that mappings provide\nthe methods ``keys()``, ``values()``, ``items()``, ``has_key()``,\n``get()``, ``clear()``, ``setdefault()``, ``iterkeys()``,\n``itervalues()``, ``iteritems()``, ``pop()``, ``popitem()``,\n``copy()``, and ``update()`` behaving similar to those for Python's\nstandard dictionary objects. The ``UserDict`` module provides a\n``DictMixin`` class to help create those methods from a base set of\n``__getitem__()``, ``__setitem__()``, ``__delitem__()``, and\n``keys()``. Mutable sequences should provide methods ``append()``,\n``count()``, ``index()``, ``extend()``, ``insert()``, ``pop()``,\n``remove()``, ``reverse()`` and ``sort()``, like Python standard list\nobjects. Finally, sequence types should implement addition (meaning\nconcatenation) and multiplication (meaning repetition) by defining the\nmethods ``__add__()``, ``__radd__()``, ``__iadd__()``, ``__mul__()``,\n``__rmul__()`` and ``__imul__()`` described below; they should not\ndefine ``__coerce__()`` or other numerical operators. It is\nrecommended that both mappings and sequences implement the\n``__contains__()`` method to allow efficient use of the ``in``\noperator; for mappings, ``in`` should be equivalent of ``has_key()``;\nfor sequences, it should search through the values. It is further\nrecommended that both mappings and sequences implement the\n``__iter__()`` method to allow efficient iteration through the\ncontainer; for mappings, ``__iter__()`` should be the same as\n``iterkeys()``; for sequences, it should iterate through the values.\n\nobject.__len__(self)\n\n Called to implement the built-in function ``len()``. Should return\n the length of the object, an integer ``>=`` 0. Also, an object\n that doesn't define a ``__nonzero__()`` method and whose\n ``__len__()`` method returns zero is considered to be false in a\n Boolean context.\n\nobject.__getitem__(self, key)\n\n Called to implement evaluation of ``self[key]``. For sequence\n types, the accepted keys should be integers and slice objects.\n Note that the special interpretation of negative indexes (if the\n class wishes to emulate a sequence type) is up to the\n ``__getitem__()`` method. If *key* is of an inappropriate type,\n ``TypeError`` may be raised; if of a value outside the set of\n indexes for the sequence (after any special interpretation of\n negative values), ``IndexError`` should be raised. For mapping\n types, if *key* is missing (not in the container), ``KeyError``\n should be raised.\n\n Note: ``for`` loops expect that an ``IndexError`` will be raised for\n illegal indexes to allow proper detection of the end of the\n sequence.\n\nobject.__setitem__(self, key, value)\n\n Called to implement assignment to ``self[key]``. Same note as for\n ``__getitem__()``. This should only be implemented for mappings if\n the objects support changes to the values for keys, or if new keys\n can be added, or for sequences if elements can be replaced. The\n same exceptions should be raised for improper *key* values as for\n the ``__getitem__()`` method.\n\nobject.__delitem__(self, key)\n\n Called to implement deletion of ``self[key]``. Same note as for\n ``__getitem__()``. This should only be implemented for mappings if\n the objects support removal of keys, or for sequences if elements\n can be removed from the sequence. The same exceptions should be\n raised for improper *key* values as for the ``__getitem__()``\n method.\n\nobject.__iter__(self)\n\n This method is called when an iterator is required for a container.\n This method should return a new iterator object that can iterate\n over all the objects in the container. For mappings, it should\n iterate over the keys of the container, and should also be made\n available as the method ``iterkeys()``.\n\n Iterator objects also need to implement this method; they are\n required to return themselves. For more information on iterator\n objects, see *Iterator Types*.\n\nobject.__reversed__(self)\n\n Called (if present) by the ``reversed()`` builtin to implement\n reverse iteration. It should return a new iterator object that\n iterates over all the objects in the container in reverse order.\n\n If the ``__reversed__()`` method is not provided, the\n ``reversed()`` builtin will fall back to using the sequence\n protocol (``__len__()`` and ``__getitem__()``). Objects should\n normally only provide ``__reversed__()`` if they do not support the\n sequence protocol and an efficient implementation of reverse\n iteration is possible.\n\n New in version 2.6.\n\nThe membership test operators (``in`` and ``not in``) are normally\nimplemented as an iteration through a sequence. However, container\nobjects can supply the following special method with a more efficient\nimplementation, which also does not require the object be a sequence.\n\nobject.__contains__(self, item)\n\n Called to implement membership test operators. Should return true\n if *item* is in *self*, false otherwise. For mapping objects, this\n should consider the keys of the mapping rather than the values or\n the key-item pairs.\n", 'shifting': u'\nShifting operations\n*******************\n\nThe shifting operations have lower priority than the arithmetic\noperations:\n\n shift_expr ::= a_expr | shift_expr ( "<<" | ">>" ) a_expr\n\nThese operators accept plain or long integers as arguments. The\narguments are converted to a common type. They shift the first\nargument to the left or right by the number of bits given by the\nsecond argument.\n\nA right shift by *n* bits is defined as division by ``pow(2, n)``. A\nleft shift by *n* bits is defined as multiplication with ``pow(2,\nn)``. Negative shift counts raise a ``ValueError`` exception.\n', 'slicings': u'\nSlicings\n********\n\nA slicing selects a range of items in a sequence object (e.g., a\nstring, tuple or list). Slicings may be used as expressions or as\ntargets in assignment or ``del`` statements. The syntax for a\nslicing:\n\n slicing ::= simple_slicing | extended_slicing\n simple_slicing ::= primary "[" short_slice "]"\n extended_slicing ::= primary "[" slice_list "]"\n slice_list ::= slice_item ("," slice_item)* [","]\n slice_item ::= expression | proper_slice | ellipsis\n proper_slice ::= short_slice | long_slice\n short_slice ::= [lower_bound] ":" [upper_bound]\n long_slice ::= short_slice ":" [stride]\n lower_bound ::= expression\n upper_bound ::= expression\n stride ::= expression\n ellipsis ::= "..."\n\nThere is ambiguity in the formal syntax here: anything that looks like\nan expression list also looks like a slice list, so any subscription\ncan be interpreted as a slicing. Rather than further complicating the\nsyntax, this is disambiguated by defining that in this case the\ninterpretation as a subscription takes priority over the\ninterpretation as a slicing (this is the case if the slice list\ncontains no proper slice nor ellipses). Similarly, when the slice\nlist has exactly one short slice and no trailing comma, the\ninterpretation as a simple slicing takes priority over that as an\nextended slicing.\n\nThe semantics for a simple slicing are as follows. The primary must\nevaluate to a sequence object. The lower and upper bound expressions,\nif present, must evaluate to plain integers; defaults are zero and the\n``sys.maxint``, respectively. If either bound is negative, the\nsequence\'s length is added to it. The slicing now selects all items\nwith index *k* such that ``i <= k < j`` where *i* and *j* are the\nspecified lower and upper bounds. This may be an empty sequence. It\nis not an error if *i* or *j* lie outside the range of valid indexes\n(such items don\'t exist so they aren\'t selected).\n\nThe semantics for an extended slicing are as follows. The primary\nmust evaluate to a mapping object, and it is indexed with a key that\nis constructed from the slice list, as follows. If the slice list\ncontains at least one comma, the key is a tuple containing the\nconversion of the slice items; otherwise, the conversion of the lone\nslice item is the key. The conversion of a slice item that is an\nexpression is that expression. The conversion of an ellipsis slice\nitem is the built-in ``Ellipsis`` object. The conversion of a proper\nslice is a slice object (see section *The standard type hierarchy*)\nwhose ``start``, ``stop`` and ``step`` attributes are the values of\nthe expressions given as lower bound, upper bound and stride,\nrespectively, substituting ``None`` for missing expressions.\n', - 'specialattrs': u"\nSpecial Attributes\n******************\n\nThe implementation adds a few special read-only attributes to several\nobject types, where they are relevant. Some of these are not reported\nby the ``dir()`` built-in function.\n\nobject.__dict__\n\n A dictionary or other mapping object used to store an object's\n (writable) attributes.\n\nobject.__methods__\n\n Deprecated in version 2.2: Use the built-in function ``dir()`` to\n get a list of an object's attributes. This attribute is no longer\n available.\n\nobject.__members__\n\n Deprecated in version 2.2: Use the built-in function ``dir()`` to\n get a list of an object's attributes. This attribute is no longer\n available.\n\ninstance.__class__\n\n The class to which a class instance belongs.\n\nclass.__bases__\n\n The tuple of base classes of a class object. If there are no base\n classes, this will be an empty tuple.\n\nclass.__name__\n\n The name of the class or type.\n\n-[ Footnotes ]-\n\n[1] Additional information on these special methods may be found in\n the Python Reference Manual (*Basic customization*).\n\n[2] As a consequence, the list ``[1, 2]`` is considered equal to\n ``[1.0, 2.0]``, and similarly for tuples.\n\n[3] They must have since the parser can't tell the type of the\n operands.\n\n[4] To format only a tuple you should therefore provide a singleton\n tuple whose only element is the tuple to be formatted.\n\n[5] These numbers are fairly arbitrary. They are intended to avoid\n printing endless strings of meaningless digits without hampering\n correct use and without having to know the exact precision of\n floating point values on a particular machine.\n\n[6] The advantage of leaving the newline on is that returning an empty\n string is then an unambiguous EOF indication. It is also possible\n (in cases where it might matter, for example, if you want to make\n an exact copy of a file while scanning its lines) to tell whether\n the last line of a file ended in a newline or not (yes this\n happens!).\n", - 'specialnames': u'\nSpecial method names\n********************\n\nA class can implement certain operations that are invoked by special\nsyntax (such as arithmetic operations or subscripting and slicing) by\ndefining methods with special names. This is Python\'s approach to\n*operator overloading*, allowing classes to define their own behavior\nwith respect to language operators. For instance, if a class defines\na method named ``__getitem__()``, and ``x`` is an instance of this\nclass, then ``x[i]`` is equivalent [2] to ``x.__getitem__(i)``.\nExcept where mentioned, attempts to execute an operation raise an\nexception when no appropriate method is defined.\n\nFor new-style classes, special methods are only guaranteed to work if\ndefined in an object\'s class, not in the object\'s instance dictionary.\nThat explains why this won\'t work:\n\n >>> class C:\n ... pass\n ...\n >>> c = C()\n >>> c.__len__ = lambda: 5\n >>> len(c)\n Traceback (most recent call last):\n File "", line 1, in \n TypeError: object of type \'C\' has no len()\n\nWhen implementing a class that emulates any built-in type, it is\nimportant that the emulation only be implemented to the degree that it\nmakes sense for the object being modelled. For example, some\nsequences may work well with retrieval of individual elements, but\nextracting a slice may not make sense. (One example of this is the\n``NodeList`` interface in the W3C\'s Document Object Model.)\n\n\nBasic customization\n===================\n\nobject.__new__(cls[, ...])\n\n Called to create a new instance of class *cls*. ``__new__()`` is a\n static method (special-cased so you need not declare it as such)\n that takes the class of which an instance was requested as its\n first argument. The remaining arguments are those passed to the\n object constructor expression (the call to the class). The return\n value of ``__new__()`` should be the new object instance (usually\n an instance of *cls*).\n\n Typical implementations create a new instance of the class by\n invoking the superclass\'s ``__new__()`` method using\n ``super(currentclass, cls).__new__(cls[, ...])`` with appropriate\n arguments and then modifying the newly-created instance as\n necessary before returning it.\n\n If ``__new__()`` returns an instance of *cls*, then the new\n instance\'s ``__init__()`` method will be invoked like\n ``__init__(self[, ...])``, where *self* is the new instance and the\n remaining arguments are the same as were passed to ``__new__()``.\n\n If ``__new__()`` does not return an instance of *cls*, then the new\n instance\'s ``__init__()`` method will not be invoked.\n\n ``__new__()`` is intended mainly to allow subclasses of immutable\n types (like int, str, or tuple) to customize instance creation. It\n is also commonly overridden in custom metaclasses in order to\n customize class creation.\n\nobject.__init__(self[, ...])\n\n Called when the instance is created. The arguments are those\n passed to the class constructor expression. If a base class has an\n ``__init__()`` method, the derived class\'s ``__init__()`` method,\n if any, must explicitly call it to ensure proper initialization of\n the base class part of the instance; for example:\n ``BaseClass.__init__(self, [args...])``. As a special constraint\n on constructors, no value may be returned; doing so will cause a\n ``TypeError`` to be raised at runtime.\n\nobject.__del__(self)\n\n Called when the instance is about to be destroyed. This is also\n called a destructor. If a base class has a ``__del__()`` method,\n the derived class\'s ``__del__()`` method, if any, must explicitly\n call it to ensure proper deletion of the base class part of the\n instance. Note that it is possible (though not recommended!) for\n the ``__del__()`` method to postpone destruction of the instance by\n creating a new reference to it. It may then be called at a later\n time when this new reference is deleted. It is not guaranteed that\n ``__del__()`` methods are called for objects that still exist when\n the interpreter exits.\n\n Note: ``del x`` doesn\'t directly call ``x.__del__()`` --- the former\n decrements the reference count for ``x`` by one, and the latter\n is only called when ``x``\'s reference count reaches zero. Some\n common situations that may prevent the reference count of an\n object from going to zero include: circular references between\n objects (e.g., a doubly-linked list or a tree data structure with\n parent and child pointers); a reference to the object on the\n stack frame of a function that caught an exception (the traceback\n stored in ``sys.exc_traceback`` keeps the stack frame alive); or\n a reference to the object on the stack frame that raised an\n unhandled exception in interactive mode (the traceback stored in\n ``sys.last_traceback`` keeps the stack frame alive). The first\n situation can only be remedied by explicitly breaking the cycles;\n the latter two situations can be resolved by storing ``None`` in\n ``sys.exc_traceback`` or ``sys.last_traceback``. Circular\n references which are garbage are detected when the option cycle\n detector is enabled (it\'s on by default), but can only be cleaned\n up if there are no Python-level ``__del__()`` methods involved.\n Refer to the documentation for the ``gc`` module for more\n information about how ``__del__()`` methods are handled by the\n cycle detector, particularly the description of the ``garbage``\n value.\n\n Warning: Due to the precarious circumstances under which ``__del__()``\n methods are invoked, exceptions that occur during their execution\n are ignored, and a warning is printed to ``sys.stderr`` instead.\n Also, when ``__del__()`` is invoked in response to a module being\n deleted (e.g., when execution of the program is done), other\n globals referenced by the ``__del__()`` method may already have\n been deleted. For this reason, ``__del__()`` methods should do\n the absolute minimum needed to maintain external invariants.\n Starting with version 1.5, Python guarantees that globals whose\n name begins with a single underscore are deleted from their\n module before other globals are deleted; if no other references\n to such globals exist, this may help in assuring that imported\n modules are still available at the time when the ``__del__()``\n method is called.\n\nobject.__repr__(self)\n\n Called by the ``repr()`` built-in function and by string\n conversions (reverse quotes) to compute the "official" string\n representation of an object. If at all possible, this should look\n like a valid Python expression that could be used to recreate an\n object with the same value (given an appropriate environment). If\n this is not possible, a string of the form ``<...some useful\n description...>`` should be returned. The return value must be a\n string object. If a class defines ``__repr__()`` but not\n ``__str__()``, then ``__repr__()`` is also used when an "informal"\n string representation of instances of that class is required.\n\n This is typically used for debugging, so it is important that the\n representation is information-rich and unambiguous.\n\nobject.__str__(self)\n\n Called by the ``str()`` built-in function and by the ``print``\n statement to compute the "informal" string representation of an\n object. This differs from ``__repr__()`` in that it does not have\n to be a valid Python expression: a more convenient or concise\n representation may be used instead. The return value must be a\n string object.\n\nobject.__lt__(self, other)\nobject.__le__(self, other)\nobject.__eq__(self, other)\nobject.__ne__(self, other)\nobject.__gt__(self, other)\nobject.__ge__(self, other)\n\n Added in version 2.1.\n\n These are the so-called "rich comparison" methods, and are called\n for comparison operators in preference to ``__cmp__()`` below. The\n correspondence between operator symbols and method names is as\n follows: ``xy`` call ``x.__ne__(y)``, ``x>y`` calls ``x.__gt__(y)``, and\n ``x>=y`` calls ``x.__ge__(y)``.\n\n A rich comparison method may return the singleton\n ``NotImplemented`` if it does not implement the operation for a\n given pair of arguments. By convention, ``False`` and ``True`` are\n returned for a successful comparison. However, these methods can\n return any value, so if the comparison operator is used in a\n Boolean context (e.g., in the condition of an ``if`` statement),\n Python will call ``bool()`` on the value to determine if the result\n is true or false.\n\n There are no implied relationships among the comparison operators.\n The truth of ``x==y`` does not imply that ``x!=y`` is false.\n Accordingly, when defining ``__eq__()``, one should also define\n ``__ne__()`` so that the operators will behave as expected. See\n the paragraph on ``__hash__()`` for some important notes on\n creating *hashable* objects which support custom comparison\n operations and are usable as dictionary keys.\n\n There are no swapped-argument versions of these methods (to be used\n when the left argument does not support the operation but the right\n argument does); rather, ``__lt__()`` and ``__gt__()`` are each\n other\'s reflection, ``__le__()`` and ``__ge__()`` are each other\'s\n reflection, and ``__eq__()`` and ``__ne__()`` are their own\n reflection.\n\n Arguments to rich comparison methods are never coerced.\n\nobject.__cmp__(self, other)\n\n Called by comparison operations if rich comparison (see above) is\n not defined. Should return a negative integer if ``self < other``,\n zero if ``self == other``, a positive integer if ``self > other``.\n If no ``__cmp__()``, ``__eq__()`` or ``__ne__()`` operation is\n defined, class instances are compared by object identity\n ("address"). See also the description of ``__hash__()`` for some\n important notes on creating *hashable* objects which support custom\n comparison operations and are usable as dictionary keys. (Note: the\n restriction that exceptions are not propagated by ``__cmp__()`` has\n been removed since Python 1.5.)\n\nobject.__rcmp__(self, other)\n\n Changed in version 2.1: No longer supported.\n\nobject.__hash__(self)\n\n Called for the key object for dictionary operations, and by the\n built-in function ``hash()``. Should return an integer usable as a\n hash value for dictionary operations. The only required property\n is that objects which compare equal have the same hash value; it is\n advised to somehow mix together (e.g., using exclusive or) the hash\n values for the components of the object that also play a part in\n comparison of objects.\n\n If a class does not define a ``__cmp__()`` or ``__eq__()`` method\n it should not define a ``__hash__()`` operation either; if it\n defines ``__cmp__()`` or ``__eq__()`` but not ``__hash__()``, its\n instances will not be usable as dictionary keys. If a class\n defines mutable objects and implements a ``__cmp__()`` or\n ``__eq__()`` method, it should not implement ``__hash__()``, since\n the dictionary implementation requires that a key\'s hash value is\n immutable (if the object\'s hash value changes, it will be in the\n wrong hash bucket).\n\n User-defined classes have ``__cmp__()`` and ``__hash__()`` methods\n by default; with them, all objects compare unequal and\n ``x.__hash__()`` returns ``id(x)``.\n\n Changed in version 2.5: ``__hash__()`` may now also return a long\n integer object; the 32-bit integer is then derived from the hash of\n that object.\n\nobject.__nonzero__(self)\n\n Called to implement truth value testing, and the built-in operation\n ``bool()``; should return ``False`` or ``True``, or their integer\n equivalents ``0`` or ``1``. When this method is not defined,\n ``__len__()`` is called, if it is defined (see below). If a class\n defines neither ``__len__()`` nor ``__nonzero__()``, all its\n instances are considered true.\n\nobject.__unicode__(self)\n\n Called to implement ``unicode()`` builtin; should return a Unicode\n object. When this method is not defined, string conversion is\n attempted, and the result of string conversion is converted to\n Unicode using the system default encoding.\n\n\nCustomizing attribute access\n============================\n\nThe following methods can be defined to customize the meaning of\nattribute access (use of, assignment to, or deletion of ``x.name``)\nfor class instances.\n\nobject.__getattr__(self, name)\n\n Called when an attribute lookup has not found the attribute in the\n usual places (i.e. it is not an instance attribute nor is it found\n in the class tree for ``self``). ``name`` is the attribute name.\n This method should return the (computed) attribute value or raise\n an ``AttributeError`` exception.\n\n Note that if the attribute is found through the normal mechanism,\n ``__getattr__()`` is not called. (This is an intentional asymmetry\n between ``__getattr__()`` and ``__setattr__()``.) This is done both\n for efficiency reasons and because otherwise ``__setattr__()``\n would have no way to access other attributes of the instance. Note\n that at least for instance variables, you can fake total control by\n not inserting any values in the instance attribute dictionary (but\n instead inserting them in another object). See the\n ``__getattribute__()`` method below for a way to actually get total\n control in new-style classes.\n\nobject.__setattr__(self, name, value)\n\n Called when an attribute assignment is attempted. This is called\n instead of the normal mechanism (i.e. store the value in the\n instance dictionary). *name* is the attribute name, *value* is the\n value to be assigned to it.\n\n If ``__setattr__()`` wants to assign to an instance attribute, it\n should not simply execute ``self.name = value`` --- this would\n cause a recursive call to itself. Instead, it should insert the\n value in the dictionary of instance attributes, e.g.,\n ``self.__dict__[name] = value``. For new-style classes, rather\n than accessing the instance dictionary, it should call the base\n class method with the same name, for example,\n ``object.__setattr__(self, name, value)``.\n\nobject.__delattr__(self, name)\n\n Like ``__setattr__()`` but for attribute deletion instead of\n assignment. This should only be implemented if ``del obj.name`` is\n meaningful for the object.\n\n\nMore attribute access for new-style classes\n-------------------------------------------\n\nThe following methods only apply to new-style classes.\n\nobject.__getattribute__(self, name)\n\n Called unconditionally to implement attribute accesses for\n instances of the class. If the class also defines\n ``__getattr__()``, the latter will not be called unless\n ``__getattribute__()`` either calls it explicitly or raises an\n ``AttributeError``. This method should return the (computed)\n attribute value or raise an ``AttributeError`` exception. In order\n to avoid infinite recursion in this method, its implementation\n should always call the base class method with the same name to\n access any attributes it needs, for example,\n ``object.__getattribute__(self, name)``.\n\n\nImplementing Descriptors\n------------------------\n\nThe following methods only apply when an instance of the class\ncontaining the method (a so-called *descriptor* class) appears in the\nclass dictionary of another new-style class, known as the *owner*\nclass. In the examples below, "the attribute" refers to the attribute\nwhose name is the key of the property in the owner class\'\n``__dict__``. Descriptors can only be implemented as new-style\nclasses themselves.\n\nobject.__get__(self, instance, owner)\n\n Called to get the attribute of the owner class (class attribute\n access) or of an instance of that class (instance attribute\n access). *owner* is always the owner class, while *instance* is the\n instance that the attribute was accessed through, or ``None`` when\n the attribute is accessed through the *owner*. This method should\n return the (computed) attribute value or raise an\n ``AttributeError`` exception.\n\nobject.__set__(self, instance, value)\n\n Called to set the attribute on an instance *instance* of the owner\n class to a new value, *value*.\n\nobject.__delete__(self, instance)\n\n Called to delete the attribute on an instance *instance* of the\n owner class.\n\n\nInvoking Descriptors\n--------------------\n\nIn general, a descriptor is an object attribute with "binding\nbehavior", one whose attribute access has been overridden by methods\nin the descriptor protocol: ``__get__()``, ``__set__()``, and\n``__delete__()``. If any of those methods are defined for an object,\nit is said to be a descriptor.\n\nThe default behavior for attribute access is to get, set, or delete\nthe attribute from an object\'s dictionary. For instance, ``a.x`` has a\nlookup chain starting with ``a.__dict__[\'x\']``, then\n``type(a).__dict__[\'x\']``, and continuing through the base classes of\n``type(a)`` excluding metaclasses.\n\nHowever, if the looked-up value is an object defining one of the\ndescriptor methods, then Python may override the default behavior and\ninvoke the descriptor method instead. Where this occurs in the\nprecedence chain depends on which descriptor methods were defined and\nhow they were called. Note that descriptors are only invoked for new\nstyle objects or classes (ones that subclass ``object()`` or\n``type()``).\n\nThe starting point for descriptor invocation is a binding, ``a.x``.\nHow the arguments are assembled depends on ``a``:\n\nDirect Call\n The simplest and least common call is when user code directly\n invokes a descriptor method: ``x.__get__(a)``.\n\nInstance Binding\n If binding to a new-style object instance, ``a.x`` is transformed\n into the call: ``type(a).__dict__[\'x\'].__get__(a, type(a))``.\n\nClass Binding\n If binding to a new-style class, ``A.x`` is transformed into the\n call: ``A.__dict__[\'x\'].__get__(None, A)``.\n\nSuper Binding\n If ``a`` is an instance of ``super``, then the binding ``super(B,\n obj).m()`` searches ``obj.__class__.__mro__`` for the base class\n ``A`` immediately preceding ``B`` and then invokes the descriptor\n with the call: ``A.__dict__[\'m\'].__get__(obj, A)``.\n\nFor instance bindings, the precedence of descriptor invocation depends\non the which descriptor methods are defined. Normally, data\ndescriptors define both ``__get__()`` and ``__set__()``, while non-\ndata descriptors have just the ``__get__()`` method. Data descriptors\nalways override a redefinition in an instance dictionary. In\ncontrast, non-data descriptors can be overridden by instances. [3]\n\nPython methods (including ``staticmethod()`` and ``classmethod()``)\nare implemented as non-data descriptors. Accordingly, instances can\nredefine and override methods. This allows individual instances to\nacquire behaviors that differ from other instances of the same class.\n\nThe ``property()`` function is implemented as a data descriptor.\nAccordingly, instances cannot override the behavior of a property.\n\n\n__slots__\n---------\n\nBy default, instances of both old and new-style classes have a\ndictionary for attribute storage. This wastes space for objects\nhaving very few instance variables. The space consumption can become\nacute when creating large numbers of instances.\n\nThe default can be overridden by defining *__slots__* in a new-style\nclass definition. The *__slots__* declaration takes a sequence of\ninstance variables and reserves just enough space in each instance to\nhold a value for each variable. Space is saved because *__dict__* is\nnot created for each instance.\n\n__slots__\n\n This class variable can be assigned a string, iterable, or sequence\n of strings with variable names used by instances. If defined in a\n new-style class, *__slots__* reserves space for the declared\n variables and prevents the automatic creation of *__dict__* and\n *__weakref__* for each instance.\n\n Added in version 2.2.\n\nNotes on using *__slots__*\n\n* Without a *__dict__* variable, instances cannot be assigned new\n variables not listed in the *__slots__* definition. Attempts to\n assign to an unlisted variable name raises ``AttributeError``. If\n dynamic assignment of new variables is desired, then add\n ``\'__dict__\'`` to the sequence of strings in the *__slots__*\n declaration.\n\n Changed in version 2.3: Previously, adding ``\'__dict__\'`` to the\n *__slots__* declaration would not enable the assignment of new\n attributes not specifically listed in the sequence of instance\n variable names.\n\n* Without a *__weakref__* variable for each instance, classes defining\n *__slots__* do not support weak references to its instances. If weak\n reference support is needed, then add ``\'__weakref__\'`` to the\n sequence of strings in the *__slots__* declaration.\n\n Changed in version 2.3: Previously, adding ``\'__weakref__\'`` to the\n *__slots__* declaration would not enable support for weak\n references.\n\n* *__slots__* are implemented at the class level by creating\n descriptors (*Implementing Descriptors*) for each variable name. As\n a result, class attributes cannot be used to set default values for\n instance variables defined by *__slots__*; otherwise, the class\n attribute would overwrite the descriptor assignment.\n\n* If a class defines a slot also defined in a base class, the instance\n variable defined by the base class slot is inaccessible (except by\n retrieving its descriptor directly from the base class). This\n renders the meaning of the program undefined. In the future, a\n check may be added to prevent this.\n\n* The action of a *__slots__* declaration is limited to the class\n where it is defined. As a result, subclasses will have a *__dict__*\n unless they also define *__slots__*.\n\n* *__slots__* do not work for classes derived from "variable-length"\n built-in types such as ``long``, ``str`` and ``tuple``.\n\n* Any non-string iterable may be assigned to *__slots__*. Mappings may\n also be used; however, in the future, special meaning may be\n assigned to the values corresponding to each key.\n\n* *__class__* assignment works only if both classes have the same\n *__slots__*.\n\n Changed in version 2.6: Previously, *__class__* assignment raised an\n error if either new or old class had *__slots__*.\n\n\nCustomizing class creation\n==========================\n\nBy default, new-style classes are constructed using ``type()``. A\nclass definition is read into a separate namespace and the value of\nclass name is bound to the result of ``type(name, bases, dict)``.\n\nWhen the class definition is read, if *__metaclass__* is defined then\nthe callable assigned to it will be called instead of ``type()``. This\nallows classes or functions to be written which monitor or alter the\nclass creation process:\n\n* Modifying the class dictionary prior to the class being created.\n\n* Returning an instance of another class -- essentially performing the\n role of a factory function.\n\nThese steps will have to be performed in the metaclass\'s ``__new__()``\nmethod -- ``type.__new__()`` can then be called from this method to\ncreate a class with different properties. This example adds a new\nelement to the class dictionary before creating the class:\n\n class metacls(type):\n def __new__(mcs, name, bases, dict):\n dict[\'foo\'] = \'metacls was here\'\n return type.__new__(mcs, name, bases, dict)\n\nYou can of course also override other class methods (or add new\nmethods); for example defining a custom ``__call__()`` method in the\nmetaclass allows custom behavior when the class is called, e.g. not\nalways creating a new instance.\n\n__metaclass__\n\n This variable can be any callable accepting arguments for ``name``,\n ``bases``, and ``dict``. Upon class creation, the callable is used\n instead of the built-in ``type()``.\n\n Added in version 2.2.\n\nThe appropriate metaclass is determined by the following precedence\nrules:\n\n* If ``dict[\'__metaclass__\']`` exists, it is used.\n\n* Otherwise, if there is at least one base class, its metaclass is\n used (this looks for a *__class__* attribute first and if not found,\n uses its type).\n\n* Otherwise, if a global variable named __metaclass__ exists, it is\n used.\n\n* Otherwise, the old-style, classic metaclass (types.ClassType) is\n used.\n\nThe potential uses for metaclasses are boundless. Some ideas that have\nbeen explored including logging, interface checking, automatic\ndelegation, automatic property creation, proxies, frameworks, and\nautomatic resource locking/synchronization.\n\n\nEmulating callable objects\n==========================\n\nobject.__call__(self[, args...])\n\n Called when the instance is "called" as a function; if this method\n is defined, ``x(arg1, arg2, ...)`` is a shorthand for\n ``x.__call__(arg1, arg2, ...)``.\n\n\nEmulating container types\n=========================\n\nThe following methods can be defined to implement container objects.\nContainers usually are sequences (such as lists or tuples) or mappings\n(like dictionaries), but can represent other containers as well. The\nfirst set of methods is used either to emulate a sequence or to\nemulate a mapping; the difference is that for a sequence, the\nallowable keys should be the integers *k* for which ``0 <= k < N``\nwhere *N* is the length of the sequence, or slice objects, which\ndefine a range of items. (For backwards compatibility, the method\n``__getslice__()`` (see below) can also be defined to handle simple,\nbut not extended slices.) It is also recommended that mappings provide\nthe methods ``keys()``, ``values()``, ``items()``, ``has_key()``,\n``get()``, ``clear()``, ``setdefault()``, ``iterkeys()``,\n``itervalues()``, ``iteritems()``, ``pop()``, ``popitem()``,\n``copy()``, and ``update()`` behaving similar to those for Python\'s\nstandard dictionary objects. The ``UserDict`` module provides a\n``DictMixin`` class to help create those methods from a base set of\n``__getitem__()``, ``__setitem__()``, ``__delitem__()``, and\n``keys()``. Mutable sequences should provide methods ``append()``,\n``count()``, ``index()``, ``extend()``, ``insert()``, ``pop()``,\n``remove()``, ``reverse()`` and ``sort()``, like Python standard list\nobjects. Finally, sequence types should implement addition (meaning\nconcatenation) and multiplication (meaning repetition) by defining the\nmethods ``__add__()``, ``__radd__()``, ``__iadd__()``, ``__mul__()``,\n``__rmul__()`` and ``__imul__()`` described below; they should not\ndefine ``__coerce__()`` or other numerical operators. It is\nrecommended that both mappings and sequences implement the\n``__contains__()`` method to allow efficient use of the ``in``\noperator; for mappings, ``in`` should be equivalent of ``has_key()``;\nfor sequences, it should search through the values. It is further\nrecommended that both mappings and sequences implement the\n``__iter__()`` method to allow efficient iteration through the\ncontainer; for mappings, ``__iter__()`` should be the same as\n``iterkeys()``; for sequences, it should iterate through the values.\n\nobject.__len__(self)\n\n Called to implement the built-in function ``len()``. Should return\n the length of the object, an integer ``>=`` 0. Also, an object\n that doesn\'t define a ``__nonzero__()`` method and whose\n ``__len__()`` method returns zero is considered to be false in a\n Boolean context.\n\nobject.__getitem__(self, key)\n\n Called to implement evaluation of ``self[key]``. For sequence\n types, the accepted keys should be integers and slice objects.\n Note that the special interpretation of negative indexes (if the\n class wishes to emulate a sequence type) is up to the\n ``__getitem__()`` method. If *key* is of an inappropriate type,\n ``TypeError`` may be raised; if of a value outside the set of\n indexes for the sequence (after any special interpretation of\n negative values), ``IndexError`` should be raised. For mapping\n types, if *key* is missing (not in the container), ``KeyError``\n should be raised.\n\n Note: ``for`` loops expect that an ``IndexError`` will be raised for\n illegal indexes to allow proper detection of the end of the\n sequence.\n\nobject.__setitem__(self, key, value)\n\n Called to implement assignment to ``self[key]``. Same note as for\n ``__getitem__()``. This should only be implemented for mappings if\n the objects support changes to the values for keys, or if new keys\n can be added, or for sequences if elements can be replaced. The\n same exceptions should be raised for improper *key* values as for\n the ``__getitem__()`` method.\n\nobject.__delitem__(self, key)\n\n Called to implement deletion of ``self[key]``. Same note as for\n ``__getitem__()``. This should only be implemented for mappings if\n the objects support removal of keys, or for sequences if elements\n can be removed from the sequence. The same exceptions should be\n raised for improper *key* values as for the ``__getitem__()``\n method.\n\nobject.__iter__(self)\n\n This method is called when an iterator is required for a container.\n This method should return a new iterator object that can iterate\n over all the objects in the container. For mappings, it should\n iterate over the keys of the container, and should also be made\n available as the method ``iterkeys()``.\n\n Iterator objects also need to implement this method; they are\n required to return themselves. For more information on iterator\n objects, see *Iterator Types*.\n\nobject.__reversed__(self)\n\n Called (if present) by the ``reversed()`` builtin to implement\n reverse iteration. It should return a new iterator object that\n iterates over all the objects in the container in reverse order.\n\n If the ``__reversed__()`` method is not provided, the\n ``reversed()`` builtin will fall back to using the sequence\n protocol (``__len__()`` and ``__getitem__()``). Objects should\n normally only provide ``__reversed__()`` if they do not support the\n sequence protocol and an efficient implementation of reverse\n iteration is possible.\n\n Added in version 2.6.\n\nThe membership test operators (``in`` and ``not in``) are normally\nimplemented as an iteration through a sequence. However, container\nobjects can supply the following special method with a more efficient\nimplementation, which also does not require the object be a sequence.\n\nobject.__contains__(self, item)\n\n Called to implement membership test operators. Should return true\n if *item* is in *self*, false otherwise. For mapping objects, this\n should consider the keys of the mapping rather than the values or\n the key-item pairs.\n\n\nAdditional methods for emulation of sequence types\n==================================================\n\nThe following optional methods can be defined to further emulate\nsequence objects. Immutable sequences methods should at most only\ndefine ``__getslice__()``; mutable sequences might define all three\nmethods.\n\nobject.__getslice__(self, i, j)\n\n Deprecated in version 2.0: Support slice objects as parameters to\n the ``__getitem__()`` method. (However, built-in types in CPython\n currently still implement ``__getslice__()``. Therefore, you have\n to override it in derived classes when implementing slicing.)\n\n Called to implement evaluation of ``self[i:j]``. The returned\n object should be of the same type as *self*. Note that missing *i*\n or *j* in the slice expression are replaced by zero or\n ``sys.maxint``, respectively. If negative indexes are used in the\n slice, the length of the sequence is added to that index. If the\n instance does not implement the ``__len__()`` method, an\n ``AttributeError`` is raised. No guarantee is made that indexes\n adjusted this way are not still negative. Indexes which are\n greater than the length of the sequence are not modified. If no\n ``__getslice__()`` is found, a slice object is created instead, and\n passed to ``__getitem__()`` instead.\n\nobject.__setslice__(self, i, j, sequence)\n\n Called to implement assignment to ``self[i:j]``. Same notes for *i*\n and *j* as for ``__getslice__()``.\n\n This method is deprecated. If no ``__setslice__()`` is found, or\n for extended slicing of the form ``self[i:j:k]``, a slice object is\n created, and passed to ``__setitem__()``, instead of\n ``__setslice__()`` being called.\n\nobject.__delslice__(self, i, j)\n\n Called to implement deletion of ``self[i:j]``. Same notes for *i*\n and *j* as for ``__getslice__()``. This method is deprecated. If no\n ``__delslice__()`` is found, or for extended slicing of the form\n ``self[i:j:k]``, a slice object is created, and passed to\n ``__delitem__()``, instead of ``__delslice__()`` being called.\n\nNotice that these methods are only invoked when a single slice with a\nsingle colon is used, and the slice method is available. For slice\noperations involving extended slice notation, or in absence of the\nslice methods, ``__getitem__()``, ``__setitem__()`` or\n``__delitem__()`` is called with a slice object as argument.\n\nThe following example demonstrate how to make your program or module\ncompatible with earlier versions of Python (assuming that methods\n``__getitem__()``, ``__setitem__()`` and ``__delitem__()`` support\nslice objects as arguments):\n\n class MyClass:\n ...\n def __getitem__(self, index):\n ...\n def __setitem__(self, index, value):\n ...\n def __delitem__(self, index):\n ...\n\n if sys.version_info < (2, 0):\n # They won\'t be defined if version is at least 2.0 final\n\n def __getslice__(self, i, j):\n return self[max(0, i):max(0, j):]\n def __setslice__(self, i, j, seq):\n self[max(0, i):max(0, j):] = seq\n def __delslice__(self, i, j):\n del self[max(0, i):max(0, j):]\n ...\n\nNote the calls to ``max()``; these are necessary because of the\nhandling of negative indices before the ``__*slice__()`` methods are\ncalled. When negative indexes are used, the ``__*item__()`` methods\nreceive them as provided, but the ``__*slice__()`` methods get a\n"cooked" form of the index values. For each negative index value, the\nlength of the sequence is added to the index before calling the method\n(which may still result in a negative index); this is the customary\nhandling of negative indexes by the built-in sequence types, and the\n``__*item__()`` methods are expected to do this as well. However,\nsince they should already be doing that, negative indexes cannot be\npassed in; they must be constrained to the bounds of the sequence\nbefore being passed to the ``__*item__()`` methods. Calling ``max(0,\ni)`` conveniently returns the proper value.\n\n\nEmulating numeric types\n=======================\n\nThe following methods can be defined to emulate numeric objects.\nMethods corresponding to operations that are not supported by the\nparticular kind of number implemented (e.g., bitwise operations for\nnon-integral numbers) should be left undefined.\n\nobject.__add__(self, other)\nobject.__sub__(self, other)\nobject.__mul__(self, other)\nobject.__floordiv__(self, other)\nobject.__mod__(self, other)\nobject.__divmod__(self, other)\nobject.__pow__(self, other[, modulo])\nobject.__lshift__(self, other)\nobject.__rshift__(self, other)\nobject.__and__(self, other)\nobject.__xor__(self, other)\nobject.__or__(self, other)\n\n These methods are called to implement the binary arithmetic\n operations (``+``, ``-``, ``*``, ``//``, ``%``, ``divmod()``,\n ``pow()``, ``**``, ``<<``, ``>>``, ``&``, ``^``, ``|``). For\n instance, to evaluate the expression *x*``+``*y*, where *x* is an\n instance of a class that has an ``__add__()`` method,\n ``x.__add__(y)`` is called. The ``__divmod__()`` method should be\n the equivalent to using ``__floordiv__()`` and ``__mod__()``; it\n should not be related to ``__truediv__()`` (described below). Note\n that ``__pow__()`` should be defined to accept an optional third\n argument if the ternary version of the built-in ``pow()`` function\n is to be supported.\n\n If one of those methods does not support the operation with the\n supplied arguments, it should return ``NotImplemented``.\n\nobject.__div__(self, other)\nobject.__truediv__(self, other)\n\n The division operator (``/``) is implemented by these methods. The\n ``__truediv__()`` method is used when ``__future__.division`` is in\n effect, otherwise ``__div__()`` is used. If only one of these two\n methods is defined, the object will not support division in the\n alternate context; ``TypeError`` will be raised instead.\n\nobject.__radd__(self, other)\nobject.__rsub__(self, other)\nobject.__rmul__(self, other)\nobject.__rdiv__(self, other)\nobject.__rtruediv__(self, other)\nobject.__rfloordiv__(self, other)\nobject.__rmod__(self, other)\nobject.__rdivmod__(self, other)\nobject.__rpow__(self, other)\nobject.__rlshift__(self, other)\nobject.__rrshift__(self, other)\nobject.__rand__(self, other)\nobject.__rxor__(self, other)\nobject.__ror__(self, other)\n\n These methods are called to implement the binary arithmetic\n operations (``+``, ``-``, ``*``, ``/``, ``%``, ``divmod()``,\n ``pow()``, ``**``, ``<<``, ``>>``, ``&``, ``^``, ``|``) with\n reflected (swapped) operands. These functions are only called if\n the left operand does not support the corresponding operation and\n the operands are of different types. [4] For instance, to evaluate\n the expression *x*``-``*y*, where *y* is an instance of a class\n that has an ``__rsub__()`` method, ``y.__rsub__(x)`` is called if\n ``x.__sub__(y)`` returns *NotImplemented*.\n\n Note that ternary ``pow()`` will not try calling ``__rpow__()``\n (the coercion rules would become too complicated).\n\n Note: If the right operand\'s type is a subclass of the left operand\'s\n type and that subclass provides the reflected method for the\n operation, this method will be called before the left operand\'s\n non-reflected method. This behavior allows subclasses to\n override their ancestors\' operations.\n\nobject.__iadd__(self, other)\nobject.__isub__(self, other)\nobject.__imul__(self, other)\nobject.__idiv__(self, other)\nobject.__itruediv__(self, other)\nobject.__ifloordiv__(self, other)\nobject.__imod__(self, other)\nobject.__ipow__(self, other[, modulo])\nobject.__ilshift__(self, other)\nobject.__irshift__(self, other)\nobject.__iand__(self, other)\nobject.__ixor__(self, other)\nobject.__ior__(self, other)\n\n These methods are called to implement the augmented arithmetic\n operations (``+=``, ``-=``, ``*=``, ``/=``, ``//=``, ``%=``,\n ``**=``, ``<<=``, ``>>=``, ``&=``, ``^=``, ``|=``). These methods\n should attempt to do the operation in-place (modifying *self*) and\n return the result (which could be, but does not have to be,\n *self*). If a specific method is not defined, the augmented\n operation falls back to the normal methods. For instance, to\n evaluate the expression *x*``+=``*y*, where *x* is an instance of a\n class that has an ``__iadd__()`` method, ``x.__iadd__(y)`` is\n called. If *x* is an instance of a class that does not define a\n ``__iadd__()`` method, ``x.__add__(y)`` and ``y.__radd__(x)`` are\n considered, as with the evaluation of *x*``+``*y*.\n\nobject.__neg__(self)\nobject.__pos__(self)\nobject.__abs__(self)\nobject.__invert__(self)\n\n Called to implement the unary arithmetic operations (``-``, ``+``,\n ``abs()`` and ``~``).\n\nobject.__complex__(self)\nobject.__int__(self)\nobject.__long__(self)\nobject.__float__(self)\n\n Called to implement the built-in functions ``complex()``,\n ``int()``, ``long()``, and ``float()``. Should return a value of\n the appropriate type.\n\nobject.__oct__(self)\nobject.__hex__(self)\n\n Called to implement the built-in functions ``oct()`` and ``hex()``.\n Should return a string value.\n\nobject.__index__(self)\n\n Called to implement ``operator.index()``. Also called whenever\n Python needs an integer object (such as in slicing). Must return\n an integer (int or long).\n\n Added in version 2.5.\n\nobject.__coerce__(self, other)\n\n Called to implement "mixed-mode" numeric arithmetic. Should either\n return a 2-tuple containing *self* and *other* converted to a\n common numeric type, or ``None`` if conversion is impossible. When\n the common type would be the type of ``other``, it is sufficient to\n return ``None``, since the interpreter will also ask the other\n object to attempt a coercion (but sometimes, if the implementation\n of the other type cannot be changed, it is useful to do the\n conversion to the other type here). A return value of\n ``NotImplemented`` is equivalent to returning ``None``.\n\n\nCoercion rules\n==============\n\nThis section used to document the rules for coercion. As the language\nhas evolved, the coercion rules have become hard to document\nprecisely; documenting what one version of one particular\nimplementation does is undesirable. Instead, here are some informal\nguidelines regarding coercion. In Python 3.0, coercion will not be\nsupported.\n\n* If the left operand of a % operator is a string or Unicode object,\n no coercion takes place and the string formatting operation is\n invoked instead.\n\n* It is no longer recommended to define a coercion operation. Mixed-\n mode operations on types that don\'t define coercion pass the\n original arguments to the operation.\n\n* New-style classes (those derived from ``object``) never invoke the\n ``__coerce__()`` method in response to a binary operator; the only\n time ``__coerce__()`` is invoked is when the built-in function\n ``coerce()`` is called.\n\n* For most intents and purposes, an operator that returns\n ``NotImplemented`` is treated the same as one that is not\n implemented at all.\n\n* Below, ``__op__()`` and ``__rop__()`` are used to signify the\n generic method names corresponding to an operator; ``__iop__()`` is\n used for the corresponding in-place operator. For example, for the\n operator \'``+``\', ``__add__()`` and ``__radd__()`` are used for the\n left and right variant of the binary operator, and ``__iadd__()``\n for the in-place variant.\n\n* For objects *x* and *y*, first ``x.__op__(y)`` is tried. If this is\n not implemented or returns ``NotImplemented``, ``y.__rop__(x)`` is\n tried. If this is also not implemented or returns\n ``NotImplemented``, a ``TypeError`` exception is raised. But see\n the following exception:\n\n* Exception to the previous item: if the left operand is an instance\n of a built-in type or a new-style class, and the right operand is an\n instance of a proper subclass of that type or class and overrides\n the base\'s ``__rop__()`` method, the right operand\'s ``__rop__()``\n method is tried *before* the left operand\'s ``__op__()`` method.\n\n This is done so that a subclass can completely override binary\n operators. Otherwise, the left operand\'s ``__op__()`` method would\n always accept the right operand: when an instance of a given class\n is expected, an instance of a subclass of that class is always\n acceptable.\n\n* When either operand type defines a coercion, this coercion is called\n before that type\'s ``__op__()`` or ``__rop__()`` method is called,\n but no sooner. If the coercion returns an object of a different\n type for the operand whose coercion is invoked, part of the process\n is redone using the new object.\n\n* When an in-place operator (like \'``+=``\') is used, if the left\n operand implements ``__iop__()``, it is invoked without any\n coercion. When the operation falls back to ``__op__()`` and/or\n ``__rop__()``, the normal coercion rules apply.\n\n* In *x*``+``*y*, if *x* is a sequence that implements sequence\n concatenation, sequence concatenation is invoked.\n\n* In *x*``*``*y*, if one operator is a sequence that implements\n sequence repetition, and the other is an integer (``int`` or\n ``long``), sequence repetition is invoked.\n\n* Rich comparisons (implemented by methods ``__eq__()`` and so on)\n never use coercion. Three-way comparison (implemented by\n ``__cmp__()``) does use coercion under the same conditions as other\n binary operations use it.\n\n* In the current implementation, the built-in numeric types ``int``,\n ``long`` and ``float`` do not use coercion; the type ``complex``\n however does use it. The difference can become apparent when\n subclassing these types. Over time, the type ``complex`` may be\n fixed to avoid coercion. All these types implement a\n ``__coerce__()`` method, for use by the built-in ``coerce()``\n function.\n\n\nWith Statement Context Managers\n===============================\n\nAdded in version 2.5.\n\nA *context manager* is an object that defines the runtime context to\nbe established when executing a ``with`` statement. The context\nmanager handles the entry into, and the exit from, the desired runtime\ncontext for the execution of the block of code. Context managers are\nnormally invoked using the ``with`` statement (described in section\n*The with statement*), but can also be used by directly invoking their\nmethods.\n\nTypical uses of context managers include saving and restoring various\nkinds of global state, locking and unlocking resources, closing opened\nfiles, etc.\n\nFor more information on context managers, see *Context Manager Types*.\n\nobject.__enter__(self)\n\n Enter the runtime context related to this object. The ``with``\n statement will bind this method\'s return value to the target(s)\n specified in the ``as`` clause of the statement, if any.\n\nobject.__exit__(self, exc_type, exc_value, traceback)\n\n Exit the runtime context related to this object. The parameters\n describe the exception that caused the context to be exited. If the\n context was exited without an exception, all three arguments will\n be ``None``.\n\n If an exception is supplied, and the method wishes to suppress the\n exception (i.e., prevent it from being propagated), it should\n return a true value. Otherwise, the exception will be processed\n normally upon exit from this method.\n\n Note that ``__exit__()`` methods should not reraise the passed-in\n exception; this is the caller\'s responsibility.\n\nSee also:\n\n **PEP 0343** - The "with" statement\n The specification, background, and examples for the Python\n ``with`` statement.\n\n-[ Footnotes ]-\n\n[1] Since Python 2.2, a gradual merging of types and classes has been\n started that makes this and a few other assertions made in this\n manual not 100% accurate and complete: for example, it *is* now\n possible in some cases to change an object\'s type, under certain\n controlled conditions. Until this manual undergoes extensive\n revision, it must now be taken as authoritative only regarding\n "classic classes", that are still the default, for compatibility\n purposes, in Python 2.2 and 2.3. For more information, see\n http://www.python.org/doc/newstyle/.\n\n[2] This, and other statements, are only roughly true for instances of\n new-style classes.\n\n[3] A descriptor can define any combination of ``__get__()``,\n ``__set__()`` and ``__delete__()``. If it does not define\n ``__get__()``, then accessing the attribute even on an instance\n will return the descriptor object itself. If the descriptor\n defines ``__set__()`` and/or ``__delete__()``, it is a data\n descriptor; if it defines neither, it is a non-data descriptor.\n\n[4] For operands of the same type, it is assumed that if the non-\n reflected method (such as ``__add__()``) fails the operation is\n not supported, which is why the reflected method is not called.\n', + 'specialattrs': u"\nSpecial Attributes\n******************\n\nThe implementation adds a few special read-only attributes to several\nobject types, where they are relevant. Some of these are not reported\nby the ``dir()`` built-in function.\n\nobject.__dict__\n\n A dictionary or other mapping object used to store an object's\n (writable) attributes.\n\nobject.__methods__\n\n Deprecated since version 2.2: Use the built-in function ``dir()``\n to get a list of an object's attributes. This attribute is no\n longer available.\n\nobject.__members__\n\n Deprecated since version 2.2: Use the built-in function ``dir()``\n to get a list of an object's attributes. This attribute is no\n longer available.\n\ninstance.__class__\n\n The class to which a class instance belongs.\n\nclass.__bases__\n\n The tuple of base classes of a class object. If there are no base\n classes, this will be an empty tuple.\n\nclass.__name__\n\n The name of the class or type.\n\n-[ Footnotes ]-\n\n[1] Additional information on these special methods may be found in\n the Python Reference Manual (*Basic customization*).\n\n[2] As a consequence, the list ``[1, 2]`` is considered equal to\n ``[1.0, 2.0]``, and similarly for tuples.\n\n[3] They must have since the parser can't tell the type of the\n operands.\n\n[4] To format only a tuple you should therefore provide a singleton\n tuple whose only element is the tuple to be formatted.\n\n[5] These numbers are fairly arbitrary. They are intended to avoid\n printing endless strings of meaningless digits without hampering\n correct use and without having to know the exact precision of\n floating point values on a particular machine.\n\n[6] The advantage of leaving the newline on is that returning an empty\n string is then an unambiguous EOF indication. It is also possible\n (in cases where it might matter, for example, if you want to make\n an exact copy of a file while scanning its lines) to tell whether\n the last line of a file ended in a newline or not (yes this\n happens!).\n", + 'specialnames': u'\nSpecial method names\n********************\n\nA class can implement certain operations that are invoked by special\nsyntax (such as arithmetic operations or subscripting and slicing) by\ndefining methods with special names. This is Python\'s approach to\n*operator overloading*, allowing classes to define their own behavior\nwith respect to language operators. For instance, if a class defines\na method named ``__getitem__()``, and ``x`` is an instance of this\nclass, then ``x[i]`` is roughly equivalent to ``x.__getitem__(i)`` for\nold-style classes and ``type(x).__getitem__(x, i)`` for new-style\nclasses. Except where mentioned, attempts to execute an operation\nraise an exception when no appropriate method is defined (typically\n``AttributeError`` or ``TypeError``).\n\nWhen implementing a class that emulates any built-in type, it is\nimportant that the emulation only be implemented to the degree that it\nmakes sense for the object being modelled. For example, some\nsequences may work well with retrieval of individual elements, but\nextracting a slice may not make sense. (One example of this is the\n``NodeList`` interface in the W3C\'s Document Object Model.)\n\n\nBasic customization\n===================\n\nobject.__new__(cls[, ...])\n\n Called to create a new instance of class *cls*. ``__new__()`` is a\n static method (special-cased so you need not declare it as such)\n that takes the class of which an instance was requested as its\n first argument. The remaining arguments are those passed to the\n object constructor expression (the call to the class). The return\n value of ``__new__()`` should be the new object instance (usually\n an instance of *cls*).\n\n Typical implementations create a new instance of the class by\n invoking the superclass\'s ``__new__()`` method using\n ``super(currentclass, cls).__new__(cls[, ...])`` with appropriate\n arguments and then modifying the newly-created instance as\n necessary before returning it.\n\n If ``__new__()`` returns an instance of *cls*, then the new\n instance\'s ``__init__()`` method will be invoked like\n ``__init__(self[, ...])``, where *self* is the new instance and the\n remaining arguments are the same as were passed to ``__new__()``.\n\n If ``__new__()`` does not return an instance of *cls*, then the new\n instance\'s ``__init__()`` method will not be invoked.\n\n ``__new__()`` is intended mainly to allow subclasses of immutable\n types (like int, str, or tuple) to customize instance creation. It\n is also commonly overridden in custom metaclasses in order to\n customize class creation.\n\nobject.__init__(self[, ...])\n\n Called when the instance is created. The arguments are those\n passed to the class constructor expression. If a base class has an\n ``__init__()`` method, the derived class\'s ``__init__()`` method,\n if any, must explicitly call it to ensure proper initialization of\n the base class part of the instance; for example:\n ``BaseClass.__init__(self, [args...])``. As a special constraint\n on constructors, no value may be returned; doing so will cause a\n ``TypeError`` to be raised at runtime.\n\nobject.__del__(self)\n\n Called when the instance is about to be destroyed. This is also\n called a destructor. If a base class has a ``__del__()`` method,\n the derived class\'s ``__del__()`` method, if any, must explicitly\n call it to ensure proper deletion of the base class part of the\n instance. Note that it is possible (though not recommended!) for\n the ``__del__()`` method to postpone destruction of the instance by\n creating a new reference to it. It may then be called at a later\n time when this new reference is deleted. It is not guaranteed that\n ``__del__()`` methods are called for objects that still exist when\n the interpreter exits.\n\n Note: ``del x`` doesn\'t directly call ``x.__del__()`` --- the former\n decrements the reference count for ``x`` by one, and the latter\n is only called when ``x``\'s reference count reaches zero. Some\n common situations that may prevent the reference count of an\n object from going to zero include: circular references between\n objects (e.g., a doubly-linked list or a tree data structure with\n parent and child pointers); a reference to the object on the\n stack frame of a function that caught an exception (the traceback\n stored in ``sys.exc_traceback`` keeps the stack frame alive); or\n a reference to the object on the stack frame that raised an\n unhandled exception in interactive mode (the traceback stored in\n ``sys.last_traceback`` keeps the stack frame alive). The first\n situation can only be remedied by explicitly breaking the cycles;\n the latter two situations can be resolved by storing ``None`` in\n ``sys.exc_traceback`` or ``sys.last_traceback``. Circular\n references which are garbage are detected when the option cycle\n detector is enabled (it\'s on by default), but can only be cleaned\n up if there are no Python-level ``__del__()`` methods involved.\n Refer to the documentation for the ``gc`` module for more\n information about how ``__del__()`` methods are handled by the\n cycle detector, particularly the description of the ``garbage``\n value.\n\n Warning: Due to the precarious circumstances under which ``__del__()``\n methods are invoked, exceptions that occur during their execution\n are ignored, and a warning is printed to ``sys.stderr`` instead.\n Also, when ``__del__()`` is invoked in response to a module being\n deleted (e.g., when execution of the program is done), other\n globals referenced by the ``__del__()`` method may already have\n been deleted. For this reason, ``__del__()`` methods should do\n the absolute minimum needed to maintain external invariants.\n Starting with version 1.5, Python guarantees that globals whose\n name begins with a single underscore are deleted from their\n module before other globals are deleted; if no other references\n to such globals exist, this may help in assuring that imported\n modules are still available at the time when the ``__del__()``\n method is called.\n\nobject.__repr__(self)\n\n Called by the ``repr()`` built-in function and by string\n conversions (reverse quotes) to compute the "official" string\n representation of an object. If at all possible, this should look\n like a valid Python expression that could be used to recreate an\n object with the same value (given an appropriate environment). If\n this is not possible, a string of the form ``<...some useful\n description...>`` should be returned. The return value must be a\n string object. If a class defines ``__repr__()`` but not\n ``__str__()``, then ``__repr__()`` is also used when an "informal"\n string representation of instances of that class is required.\n\n This is typically used for debugging, so it is important that the\n representation is information-rich and unambiguous.\n\nobject.__str__(self)\n\n Called by the ``str()`` built-in function and by the ``print``\n statement to compute the "informal" string representation of an\n object. This differs from ``__repr__()`` in that it does not have\n to be a valid Python expression: a more convenient or concise\n representation may be used instead. The return value must be a\n string object.\n\nobject.__lt__(self, other)\nobject.__le__(self, other)\nobject.__eq__(self, other)\nobject.__ne__(self, other)\nobject.__gt__(self, other)\nobject.__ge__(self, other)\n\n New in version 2.1.\n\n These are the so-called "rich comparison" methods, and are called\n for comparison operators in preference to ``__cmp__()`` below. The\n correspondence between operator symbols and method names is as\n follows: ``xy`` call ``x.__ne__(y)``, ``x>y`` calls ``x.__gt__(y)``, and\n ``x>=y`` calls ``x.__ge__(y)``.\n\n A rich comparison method may return the singleton\n ``NotImplemented`` if it does not implement the operation for a\n given pair of arguments. By convention, ``False`` and ``True`` are\n returned for a successful comparison. However, these methods can\n return any value, so if the comparison operator is used in a\n Boolean context (e.g., in the condition of an ``if`` statement),\n Python will call ``bool()`` on the value to determine if the result\n is true or false.\n\n There are no implied relationships among the comparison operators.\n The truth of ``x==y`` does not imply that ``x!=y`` is false.\n Accordingly, when defining ``__eq__()``, one should also define\n ``__ne__()`` so that the operators will behave as expected. See\n the paragraph on ``__hash__()`` for some important notes on\n creating *hashable* objects which support custom comparison\n operations and are usable as dictionary keys.\n\n There are no swapped-argument versions of these methods (to be used\n when the left argument does not support the operation but the right\n argument does); rather, ``__lt__()`` and ``__gt__()`` are each\n other\'s reflection, ``__le__()`` and ``__ge__()`` are each other\'s\n reflection, and ``__eq__()`` and ``__ne__()`` are their own\n reflection.\n\n Arguments to rich comparison methods are never coerced.\n\nobject.__cmp__(self, other)\n\n Called by comparison operations if rich comparison (see above) is\n not defined. Should return a negative integer if ``self < other``,\n zero if ``self == other``, a positive integer if ``self > other``.\n If no ``__cmp__()``, ``__eq__()`` or ``__ne__()`` operation is\n defined, class instances are compared by object identity\n ("address"). See also the description of ``__hash__()`` for some\n important notes on creating *hashable* objects which support custom\n comparison operations and are usable as dictionary keys. (Note: the\n restriction that exceptions are not propagated by ``__cmp__()`` has\n been removed since Python 1.5.)\n\nobject.__rcmp__(self, other)\n\n Changed in version 2.1: No longer supported.\n\nobject.__hash__(self)\n\n Called for the key object for dictionary operations, and by the\n built-in function ``hash()``. Should return an integer usable as a\n hash value for dictionary operations. The only required property\n is that objects which compare equal have the same hash value; it is\n advised to somehow mix together (e.g., using exclusive or) the hash\n values for the components of the object that also play a part in\n comparison of objects.\n\n If a class does not define a ``__cmp__()`` or ``__eq__()`` method\n it should not define a ``__hash__()`` operation either; if it\n defines ``__cmp__()`` or ``__eq__()`` but not ``__hash__()``, its\n instances will not be usable as dictionary keys. If a class\n defines mutable objects and implements a ``__cmp__()`` or\n ``__eq__()`` method, it should not implement ``__hash__()``, since\n the dictionary implementation requires that a key\'s hash value is\n immutable (if the object\'s hash value changes, it will be in the\n wrong hash bucket).\n\n User-defined classes have ``__cmp__()`` and ``__hash__()`` methods\n by default; with them, all objects compare unequal (except with\n themselves) and ``x.__hash__()`` returns ``id(x)``.\n\n Classes which inherit a ``__hash__()`` method from a parent class\n but change the meaning of ``__cmp__()`` or ``__eq__()`` such that\n the hash value returned is no longer appropriate (e.g. by switching\n to a value-based concept of equality instead of the default\n identity based equality) can explicitly flag themselves as being\n unhashable by setting ``__hash__ = None`` in the class definition.\n Doing so means that not only will instances of the class raise an\n appropriate ``TypeError`` when a program attempts to retrieve their\n hash value, but they will also be correctly identified as\n unhashable when checking ``isinstance(obj, collections.Hashable)``\n (unlike classes which define their own ``__hash__()`` to explicitly\n raise ``TypeError``).\n\n Changed in version 2.5: ``__hash__()`` may now also return a long\n integer object; the 32-bit integer is then derived from the hash of\n that object.\n\n Changed in version 2.6: ``__hash__`` may now be set to ``None`` to\n explicitly flag instances of a class as unhashable.\n\nobject.__nonzero__(self)\n\n Called to implement truth value testing, and the built-in operation\n ``bool()``; should return ``False`` or ``True``, or their integer\n equivalents ``0`` or ``1``. When this method is not defined,\n ``__len__()`` is called, if it is defined (see below). If a class\n defines neither ``__len__()`` nor ``__nonzero__()``, all its\n instances are considered true.\n\nobject.__unicode__(self)\n\n Called to implement ``unicode()`` builtin; should return a Unicode\n object. When this method is not defined, string conversion is\n attempted, and the result of string conversion is converted to\n Unicode using the system default encoding.\n\n\nCustomizing attribute access\n============================\n\nThe following methods can be defined to customize the meaning of\nattribute access (use of, assignment to, or deletion of ``x.name``)\nfor class instances.\n\nobject.__getattr__(self, name)\n\n Called when an attribute lookup has not found the attribute in the\n usual places (i.e. it is not an instance attribute nor is it found\n in the class tree for ``self``). ``name`` is the attribute name.\n This method should return the (computed) attribute value or raise\n an ``AttributeError`` exception.\n\n Note that if the attribute is found through the normal mechanism,\n ``__getattr__()`` is not called. (This is an intentional asymmetry\n between ``__getattr__()`` and ``__setattr__()``.) This is done both\n for efficiency reasons and because otherwise ``__getattr__()``\n would have no way to access other attributes of the instance. Note\n that at least for instance variables, you can fake total control by\n not inserting any values in the instance attribute dictionary (but\n instead inserting them in another object). See the\n ``__getattribute__()`` method below for a way to actually get total\n control in new-style classes.\n\nobject.__setattr__(self, name, value)\n\n Called when an attribute assignment is attempted. This is called\n instead of the normal mechanism (i.e. store the value in the\n instance dictionary). *name* is the attribute name, *value* is the\n value to be assigned to it.\n\n If ``__setattr__()`` wants to assign to an instance attribute, it\n should not simply execute ``self.name = value`` --- this would\n cause a recursive call to itself. Instead, it should insert the\n value in the dictionary of instance attributes, e.g.,\n ``self.__dict__[name] = value``. For new-style classes, rather\n than accessing the instance dictionary, it should call the base\n class method with the same name, for example,\n ``object.__setattr__(self, name, value)``.\n\nobject.__delattr__(self, name)\n\n Like ``__setattr__()`` but for attribute deletion instead of\n assignment. This should only be implemented if ``del obj.name`` is\n meaningful for the object.\n\n\nMore attribute access for new-style classes\n-------------------------------------------\n\nThe following methods only apply to new-style classes.\n\nobject.__getattribute__(self, name)\n\n Called unconditionally to implement attribute accesses for\n instances of the class. If the class also defines\n ``__getattr__()``, the latter will not be called unless\n ``__getattribute__()`` either calls it explicitly or raises an\n ``AttributeError``. This method should return the (computed)\n attribute value or raise an ``AttributeError`` exception. In order\n to avoid infinite recursion in this method, its implementation\n should always call the base class method with the same name to\n access any attributes it needs, for example,\n ``object.__getattribute__(self, name)``.\n\n Note: This method may still be bypassed when looking up special methods\n as the result of implicit invocation via language syntax or\n builtin functions. See *Special method lookup for new-style\n classes*.\n\n\nImplementing Descriptors\n------------------------\n\nThe following methods only apply when an instance of the class\ncontaining the method (a so-called *descriptor* class) appears in the\nclass dictionary of another new-style class, known as the *owner*\nclass. In the examples below, "the attribute" refers to the attribute\nwhose name is the key of the property in the owner class\'\n``__dict__``. Descriptors can only be implemented as new-style\nclasses themselves.\n\nobject.__get__(self, instance, owner)\n\n Called to get the attribute of the owner class (class attribute\n access) or of an instance of that class (instance attribute\n access). *owner* is always the owner class, while *instance* is the\n instance that the attribute was accessed through, or ``None`` when\n the attribute is accessed through the *owner*. This method should\n return the (computed) attribute value or raise an\n ``AttributeError`` exception.\n\nobject.__set__(self, instance, value)\n\n Called to set the attribute on an instance *instance* of the owner\n class to a new value, *value*.\n\nobject.__delete__(self, instance)\n\n Called to delete the attribute on an instance *instance* of the\n owner class.\n\n\nInvoking Descriptors\n--------------------\n\nIn general, a descriptor is an object attribute with "binding\nbehavior", one whose attribute access has been overridden by methods\nin the descriptor protocol: ``__get__()``, ``__set__()``, and\n``__delete__()``. If any of those methods are defined for an object,\nit is said to be a descriptor.\n\nThe default behavior for attribute access is to get, set, or delete\nthe attribute from an object\'s dictionary. For instance, ``a.x`` has a\nlookup chain starting with ``a.__dict__[\'x\']``, then\n``type(a).__dict__[\'x\']``, and continuing through the base classes of\n``type(a)`` excluding metaclasses.\n\nHowever, if the looked-up value is an object defining one of the\ndescriptor methods, then Python may override the default behavior and\ninvoke the descriptor method instead. Where this occurs in the\nprecedence chain depends on which descriptor methods were defined and\nhow they were called. Note that descriptors are only invoked for new\nstyle objects or classes (ones that subclass ``object()`` or\n``type()``).\n\nThe starting point for descriptor invocation is a binding, ``a.x``.\nHow the arguments are assembled depends on ``a``:\n\nDirect Call\n The simplest and least common call is when user code directly\n invokes a descriptor method: ``x.__get__(a)``.\n\nInstance Binding\n If binding to a new-style object instance, ``a.x`` is transformed\n into the call: ``type(a).__dict__[\'x\'].__get__(a, type(a))``.\n\nClass Binding\n If binding to a new-style class, ``A.x`` is transformed into the\n call: ``A.__dict__[\'x\'].__get__(None, A)``.\n\nSuper Binding\n If ``a`` is an instance of ``super``, then the binding ``super(B,\n obj).m()`` searches ``obj.__class__.__mro__`` for the base class\n ``A`` immediately preceding ``B`` and then invokes the descriptor\n with the call: ``A.__dict__[\'m\'].__get__(obj, A)``.\n\nFor instance bindings, the precedence of descriptor invocation depends\non the which descriptor methods are defined. Normally, data\ndescriptors define both ``__get__()`` and ``__set__()``, while non-\ndata descriptors have just the ``__get__()`` method. Data descriptors\nalways override a redefinition in an instance dictionary. In\ncontrast, non-data descriptors can be overridden by instances. [2]\n\nPython methods (including ``staticmethod()`` and ``classmethod()``)\nare implemented as non-data descriptors. Accordingly, instances can\nredefine and override methods. This allows individual instances to\nacquire behaviors that differ from other instances of the same class.\n\nThe ``property()`` function is implemented as a data descriptor.\nAccordingly, instances cannot override the behavior of a property.\n\n\n__slots__\n---------\n\nBy default, instances of both old and new-style classes have a\ndictionary for attribute storage. This wastes space for objects\nhaving very few instance variables. The space consumption can become\nacute when creating large numbers of instances.\n\nThe default can be overridden by defining *__slots__* in a new-style\nclass definition. The *__slots__* declaration takes a sequence of\ninstance variables and reserves just enough space in each instance to\nhold a value for each variable. Space is saved because *__dict__* is\nnot created for each instance.\n\n__slots__\n\n This class variable can be assigned a string, iterable, or sequence\n of strings with variable names used by instances. If defined in a\n new-style class, *__slots__* reserves space for the declared\n variables and prevents the automatic creation of *__dict__* and\n *__weakref__* for each instance.\n\n New in version 2.2.\n\nNotes on using *__slots__*\n\n* When inheriting from a class without *__slots__*, the *__dict__*\n attribute of that class will always be accessible, so a *__slots__*\n definition in the subclass is meaningless.\n\n* Without a *__dict__* variable, instances cannot be assigned new\n variables not listed in the *__slots__* definition. Attempts to\n assign to an unlisted variable name raises ``AttributeError``. If\n dynamic assignment of new variables is desired, then add\n ``\'__dict__\'`` to the sequence of strings in the *__slots__*\n declaration.\n\n Changed in version 2.3: Previously, adding ``\'__dict__\'`` to the\n *__slots__* declaration would not enable the assignment of new\n attributes not specifically listed in the sequence of instance\n variable names.\n\n* Without a *__weakref__* variable for each instance, classes defining\n *__slots__* do not support weak references to its instances. If weak\n reference support is needed, then add ``\'__weakref__\'`` to the\n sequence of strings in the *__slots__* declaration.\n\n Changed in version 2.3: Previously, adding ``\'__weakref__\'`` to the\n *__slots__* declaration would not enable support for weak\n references.\n\n* *__slots__* are implemented at the class level by creating\n descriptors (*Implementing Descriptors*) for each variable name. As\n a result, class attributes cannot be used to set default values for\n instance variables defined by *__slots__*; otherwise, the class\n attribute would overwrite the descriptor assignment.\n\n* If a class defines a slot also defined in a base class, the instance\n variable defined by the base class slot is inaccessible (except by\n retrieving its descriptor directly from the base class). This\n renders the meaning of the program undefined. In the future, a\n check may be added to prevent this.\n\n* The action of a *__slots__* declaration is limited to the class\n where it is defined. As a result, subclasses will have a *__dict__*\n unless they also define *__slots__*.\n\n* *__slots__* do not work for classes derived from "variable-length"\n built-in types such as ``long``, ``str`` and ``tuple``.\n\n* Any non-string iterable may be assigned to *__slots__*. Mappings may\n also be used; however, in the future, special meaning may be\n assigned to the values corresponding to each key.\n\n* *__class__* assignment works only if both classes have the same\n *__slots__*.\n\n Changed in version 2.6: Previously, *__class__* assignment raised an\n error if either new or old class had *__slots__*.\n\n\nCustomizing class creation\n==========================\n\nBy default, new-style classes are constructed using ``type()``. A\nclass definition is read into a separate namespace and the value of\nclass name is bound to the result of ``type(name, bases, dict)``.\n\nWhen the class definition is read, if *__metaclass__* is defined then\nthe callable assigned to it will be called instead of ``type()``. This\nallows classes or functions to be written which monitor or alter the\nclass creation process:\n\n* Modifying the class dictionary prior to the class being created.\n\n* Returning an instance of another class -- essentially performing the\n role of a factory function.\n\nThese steps will have to be performed in the metaclass\'s ``__new__()``\nmethod -- ``type.__new__()`` can then be called from this method to\ncreate a class with different properties. This example adds a new\nelement to the class dictionary before creating the class:\n\n class metacls(type):\n def __new__(mcs, name, bases, dict):\n dict[\'foo\'] = \'metacls was here\'\n return type.__new__(mcs, name, bases, dict)\n\nYou can of course also override other class methods (or add new\nmethods); for example defining a custom ``__call__()`` method in the\nmetaclass allows custom behavior when the class is called, e.g. not\nalways creating a new instance.\n\n__metaclass__\n\n This variable can be any callable accepting arguments for ``name``,\n ``bases``, and ``dict``. Upon class creation, the callable is used\n instead of the built-in ``type()``.\n\n New in version 2.2.\n\nThe appropriate metaclass is determined by the following precedence\nrules:\n\n* If ``dict[\'__metaclass__\']`` exists, it is used.\n\n* Otherwise, if there is at least one base class, its metaclass is\n used (this looks for a *__class__* attribute first and if not found,\n uses its type).\n\n* Otherwise, if a global variable named __metaclass__ exists, it is\n used.\n\n* Otherwise, the old-style, classic metaclass (types.ClassType) is\n used.\n\nThe potential uses for metaclasses are boundless. Some ideas that have\nbeen explored including logging, interface checking, automatic\ndelegation, automatic property creation, proxies, frameworks, and\nautomatic resource locking/synchronization.\n\n\nEmulating callable objects\n==========================\n\nobject.__call__(self[, args...])\n\n Called when the instance is "called" as a function; if this method\n is defined, ``x(arg1, arg2, ...)`` is a shorthand for\n ``x.__call__(arg1, arg2, ...)``.\n\n\nEmulating container types\n=========================\n\nThe following methods can be defined to implement container objects.\nContainers usually are sequences (such as lists or tuples) or mappings\n(like dictionaries), but can represent other containers as well. The\nfirst set of methods is used either to emulate a sequence or to\nemulate a mapping; the difference is that for a sequence, the\nallowable keys should be the integers *k* for which ``0 <= k < N``\nwhere *N* is the length of the sequence, or slice objects, which\ndefine a range of items. (For backwards compatibility, the method\n``__getslice__()`` (see below) can also be defined to handle simple,\nbut not extended slices.) It is also recommended that mappings provide\nthe methods ``keys()``, ``values()``, ``items()``, ``has_key()``,\n``get()``, ``clear()``, ``setdefault()``, ``iterkeys()``,\n``itervalues()``, ``iteritems()``, ``pop()``, ``popitem()``,\n``copy()``, and ``update()`` behaving similar to those for Python\'s\nstandard dictionary objects. The ``UserDict`` module provides a\n``DictMixin`` class to help create those methods from a base set of\n``__getitem__()``, ``__setitem__()``, ``__delitem__()``, and\n``keys()``. Mutable sequences should provide methods ``append()``,\n``count()``, ``index()``, ``extend()``, ``insert()``, ``pop()``,\n``remove()``, ``reverse()`` and ``sort()``, like Python standard list\nobjects. Finally, sequence types should implement addition (meaning\nconcatenation) and multiplication (meaning repetition) by defining the\nmethods ``__add__()``, ``__radd__()``, ``__iadd__()``, ``__mul__()``,\n``__rmul__()`` and ``__imul__()`` described below; they should not\ndefine ``__coerce__()`` or other numerical operators. It is\nrecommended that both mappings and sequences implement the\n``__contains__()`` method to allow efficient use of the ``in``\noperator; for mappings, ``in`` should be equivalent of ``has_key()``;\nfor sequences, it should search through the values. It is further\nrecommended that both mappings and sequences implement the\n``__iter__()`` method to allow efficient iteration through the\ncontainer; for mappings, ``__iter__()`` should be the same as\n``iterkeys()``; for sequences, it should iterate through the values.\n\nobject.__len__(self)\n\n Called to implement the built-in function ``len()``. Should return\n the length of the object, an integer ``>=`` 0. Also, an object\n that doesn\'t define a ``__nonzero__()`` method and whose\n ``__len__()`` method returns zero is considered to be false in a\n Boolean context.\n\nobject.__getitem__(self, key)\n\n Called to implement evaluation of ``self[key]``. For sequence\n types, the accepted keys should be integers and slice objects.\n Note that the special interpretation of negative indexes (if the\n class wishes to emulate a sequence type) is up to the\n ``__getitem__()`` method. If *key* is of an inappropriate type,\n ``TypeError`` may be raised; if of a value outside the set of\n indexes for the sequence (after any special interpretation of\n negative values), ``IndexError`` should be raised. For mapping\n types, if *key* is missing (not in the container), ``KeyError``\n should be raised.\n\n Note: ``for`` loops expect that an ``IndexError`` will be raised for\n illegal indexes to allow proper detection of the end of the\n sequence.\n\nobject.__setitem__(self, key, value)\n\n Called to implement assignment to ``self[key]``. Same note as for\n ``__getitem__()``. This should only be implemented for mappings if\n the objects support changes to the values for keys, or if new keys\n can be added, or for sequences if elements can be replaced. The\n same exceptions should be raised for improper *key* values as for\n the ``__getitem__()`` method.\n\nobject.__delitem__(self, key)\n\n Called to implement deletion of ``self[key]``. Same note as for\n ``__getitem__()``. This should only be implemented for mappings if\n the objects support removal of keys, or for sequences if elements\n can be removed from the sequence. The same exceptions should be\n raised for improper *key* values as for the ``__getitem__()``\n method.\n\nobject.__iter__(self)\n\n This method is called when an iterator is required for a container.\n This method should return a new iterator object that can iterate\n over all the objects in the container. For mappings, it should\n iterate over the keys of the container, and should also be made\n available as the method ``iterkeys()``.\n\n Iterator objects also need to implement this method; they are\n required to return themselves. For more information on iterator\n objects, see *Iterator Types*.\n\nobject.__reversed__(self)\n\n Called (if present) by the ``reversed()`` builtin to implement\n reverse iteration. It should return a new iterator object that\n iterates over all the objects in the container in reverse order.\n\n If the ``__reversed__()`` method is not provided, the\n ``reversed()`` builtin will fall back to using the sequence\n protocol (``__len__()`` and ``__getitem__()``). Objects should\n normally only provide ``__reversed__()`` if they do not support the\n sequence protocol and an efficient implementation of reverse\n iteration is possible.\n\n New in version 2.6.\n\nThe membership test operators (``in`` and ``not in``) are normally\nimplemented as an iteration through a sequence. However, container\nobjects can supply the following special method with a more efficient\nimplementation, which also does not require the object be a sequence.\n\nobject.__contains__(self, item)\n\n Called to implement membership test operators. Should return true\n if *item* is in *self*, false otherwise. For mapping objects, this\n should consider the keys of the mapping rather than the values or\n the key-item pairs.\n\n\nAdditional methods for emulation of sequence types\n==================================================\n\nThe following optional methods can be defined to further emulate\nsequence objects. Immutable sequences methods should at most only\ndefine ``__getslice__()``; mutable sequences might define all three\nmethods.\n\nobject.__getslice__(self, i, j)\n\n Deprecated since version 2.0: Support slice objects as parameters\n to the ``__getitem__()`` method. (However, built-in types in\n CPython currently still implement ``__getslice__()``. Therefore,\n you have to override it in derived classes when implementing\n slicing.)\n\n Called to implement evaluation of ``self[i:j]``. The returned\n object should be of the same type as *self*. Note that missing *i*\n or *j* in the slice expression are replaced by zero or\n ``sys.maxint``, respectively. If negative indexes are used in the\n slice, the length of the sequence is added to that index. If the\n instance does not implement the ``__len__()`` method, an\n ``AttributeError`` is raised. No guarantee is made that indexes\n adjusted this way are not still negative. Indexes which are\n greater than the length of the sequence are not modified. If no\n ``__getslice__()`` is found, a slice object is created instead, and\n passed to ``__getitem__()`` instead.\n\nobject.__setslice__(self, i, j, sequence)\n\n Called to implement assignment to ``self[i:j]``. Same notes for *i*\n and *j* as for ``__getslice__()``.\n\n This method is deprecated. If no ``__setslice__()`` is found, or\n for extended slicing of the form ``self[i:j:k]``, a slice object is\n created, and passed to ``__setitem__()``, instead of\n ``__setslice__()`` being called.\n\nobject.__delslice__(self, i, j)\n\n Called to implement deletion of ``self[i:j]``. Same notes for *i*\n and *j* as for ``__getslice__()``. This method is deprecated. If no\n ``__delslice__()`` is found, or for extended slicing of the form\n ``self[i:j:k]``, a slice object is created, and passed to\n ``__delitem__()``, instead of ``__delslice__()`` being called.\n\nNotice that these methods are only invoked when a single slice with a\nsingle colon is used, and the slice method is available. For slice\noperations involving extended slice notation, or in absence of the\nslice methods, ``__getitem__()``, ``__setitem__()`` or\n``__delitem__()`` is called with a slice object as argument.\n\nThe following example demonstrate how to make your program or module\ncompatible with earlier versions of Python (assuming that methods\n``__getitem__()``, ``__setitem__()`` and ``__delitem__()`` support\nslice objects as arguments):\n\n class MyClass:\n ...\n def __getitem__(self, index):\n ...\n def __setitem__(self, index, value):\n ...\n def __delitem__(self, index):\n ...\n\n if sys.version_info < (2, 0):\n # They won\'t be defined if version is at least 2.0 final\n\n def __getslice__(self, i, j):\n return self[max(0, i):max(0, j):]\n def __setslice__(self, i, j, seq):\n self[max(0, i):max(0, j):] = seq\n def __delslice__(self, i, j):\n del self[max(0, i):max(0, j):]\n ...\n\nNote the calls to ``max()``; these are necessary because of the\nhandling of negative indices before the ``__*slice__()`` methods are\ncalled. When negative indexes are used, the ``__*item__()`` methods\nreceive them as provided, but the ``__*slice__()`` methods get a\n"cooked" form of the index values. For each negative index value, the\nlength of the sequence is added to the index before calling the method\n(which may still result in a negative index); this is the customary\nhandling of negative indexes by the built-in sequence types, and the\n``__*item__()`` methods are expected to do this as well. However,\nsince they should already be doing that, negative indexes cannot be\npassed in; they must be constrained to the bounds of the sequence\nbefore being passed to the ``__*item__()`` methods. Calling ``max(0,\ni)`` conveniently returns the proper value.\n\n\nEmulating numeric types\n=======================\n\nThe following methods can be defined to emulate numeric objects.\nMethods corresponding to operations that are not supported by the\nparticular kind of number implemented (e.g., bitwise operations for\nnon-integral numbers) should be left undefined.\n\nobject.__add__(self, other)\nobject.__sub__(self, other)\nobject.__mul__(self, other)\nobject.__floordiv__(self, other)\nobject.__mod__(self, other)\nobject.__divmod__(self, other)\nobject.__pow__(self, other[, modulo])\nobject.__lshift__(self, other)\nobject.__rshift__(self, other)\nobject.__and__(self, other)\nobject.__xor__(self, other)\nobject.__or__(self, other)\n\n These methods are called to implement the binary arithmetic\n operations (``+``, ``-``, ``*``, ``//``, ``%``, ``divmod()``,\n ``pow()``, ``**``, ``<<``, ``>>``, ``&``, ``^``, ``|``). For\n instance, to evaluate the expression ``x + y``, where *x* is an\n instance of a class that has an ``__add__()`` method,\n ``x.__add__(y)`` is called. The ``__divmod__()`` method should be\n the equivalent to using ``__floordiv__()`` and ``__mod__()``; it\n should not be related to ``__truediv__()`` (described below). Note\n that ``__pow__()`` should be defined to accept an optional third\n argument if the ternary version of the built-in ``pow()`` function\n is to be supported.\n\n If one of those methods does not support the operation with the\n supplied arguments, it should return ``NotImplemented``.\n\nobject.__div__(self, other)\nobject.__truediv__(self, other)\n\n The division operator (``/``) is implemented by these methods. The\n ``__truediv__()`` method is used when ``__future__.division`` is in\n effect, otherwise ``__div__()`` is used. If only one of these two\n methods is defined, the object will not support division in the\n alternate context; ``TypeError`` will be raised instead.\n\nobject.__radd__(self, other)\nobject.__rsub__(self, other)\nobject.__rmul__(self, other)\nobject.__rdiv__(self, other)\nobject.__rtruediv__(self, other)\nobject.__rfloordiv__(self, other)\nobject.__rmod__(self, other)\nobject.__rdivmod__(self, other)\nobject.__rpow__(self, other)\nobject.__rlshift__(self, other)\nobject.__rrshift__(self, other)\nobject.__rand__(self, other)\nobject.__rxor__(self, other)\nobject.__ror__(self, other)\n\n These methods are called to implement the binary arithmetic\n operations (``+``, ``-``, ``*``, ``/``, ``%``, ``divmod()``,\n ``pow()``, ``**``, ``<<``, ``>>``, ``&``, ``^``, ``|``) with\n reflected (swapped) operands. These functions are only called if\n the left operand does not support the corresponding operation and\n the operands are of different types. [3] For instance, to evaluate\n the expression ``x - y``, where *y* is an instance of a class that\n has an ``__rsub__()`` method, ``y.__rsub__(x)`` is called if\n ``x.__sub__(y)`` returns *NotImplemented*.\n\n Note that ternary ``pow()`` will not try calling ``__rpow__()``\n (the coercion rules would become too complicated).\n\n Note: If the right operand\'s type is a subclass of the left operand\'s\n type and that subclass provides the reflected method for the\n operation, this method will be called before the left operand\'s\n non-reflected method. This behavior allows subclasses to\n override their ancestors\' operations.\n\nobject.__iadd__(self, other)\nobject.__isub__(self, other)\nobject.__imul__(self, other)\nobject.__idiv__(self, other)\nobject.__itruediv__(self, other)\nobject.__ifloordiv__(self, other)\nobject.__imod__(self, other)\nobject.__ipow__(self, other[, modulo])\nobject.__ilshift__(self, other)\nobject.__irshift__(self, other)\nobject.__iand__(self, other)\nobject.__ixor__(self, other)\nobject.__ior__(self, other)\n\n These methods are called to implement the augmented arithmetic\n operations (``+=``, ``-=``, ``*=``, ``/=``, ``//=``, ``%=``,\n ``**=``, ``<<=``, ``>>=``, ``&=``, ``^=``, ``|=``). These methods\n should attempt to do the operation in-place (modifying *self*) and\n return the result (which could be, but does not have to be,\n *self*). If a specific method is not defined, the augmented\n operation falls back to the normal methods. For instance, to\n evaluate the expression ``x += y``, where *x* is an instance of a\n class that has an ``__iadd__()`` method, ``x.__iadd__(y)`` is\n called. If *x* is an instance of a class that does not define a\n ``__iadd__()`` method, ``x.__add__(y)`` and ``y.__radd__(x)`` are\n considered, as with the evaluation of ``x + y``.\n\nobject.__neg__(self)\nobject.__pos__(self)\nobject.__abs__(self)\nobject.__invert__(self)\n\n Called to implement the unary arithmetic operations (``-``, ``+``,\n ``abs()`` and ``~``).\n\nobject.__complex__(self)\nobject.__int__(self)\nobject.__long__(self)\nobject.__float__(self)\n\n Called to implement the built-in functions ``complex()``,\n ``int()``, ``long()``, and ``float()``. Should return a value of\n the appropriate type.\n\nobject.__oct__(self)\nobject.__hex__(self)\n\n Called to implement the built-in functions ``oct()`` and ``hex()``.\n Should return a string value.\n\nobject.__index__(self)\n\n Called to implement ``operator.index()``. Also called whenever\n Python needs an integer object (such as in slicing). Must return\n an integer (int or long).\n\n New in version 2.5.\n\nobject.__coerce__(self, other)\n\n Called to implement "mixed-mode" numeric arithmetic. Should either\n return a 2-tuple containing *self* and *other* converted to a\n common numeric type, or ``None`` if conversion is impossible. When\n the common type would be the type of ``other``, it is sufficient to\n return ``None``, since the interpreter will also ask the other\n object to attempt a coercion (but sometimes, if the implementation\n of the other type cannot be changed, it is useful to do the\n conversion to the other type here). A return value of\n ``NotImplemented`` is equivalent to returning ``None``.\n\n\nCoercion rules\n==============\n\nThis section used to document the rules for coercion. As the language\nhas evolved, the coercion rules have become hard to document\nprecisely; documenting what one version of one particular\nimplementation does is undesirable. Instead, here are some informal\nguidelines regarding coercion. In Python 3.0, coercion will not be\nsupported.\n\n* If the left operand of a % operator is a string or Unicode object,\n no coercion takes place and the string formatting operation is\n invoked instead.\n\n* It is no longer recommended to define a coercion operation. Mixed-\n mode operations on types that don\'t define coercion pass the\n original arguments to the operation.\n\n* New-style classes (those derived from ``object``) never invoke the\n ``__coerce__()`` method in response to a binary operator; the only\n time ``__coerce__()`` is invoked is when the built-in function\n ``coerce()`` is called.\n\n* For most intents and purposes, an operator that returns\n ``NotImplemented`` is treated the same as one that is not\n implemented at all.\n\n* Below, ``__op__()`` and ``__rop__()`` are used to signify the\n generic method names corresponding to an operator; ``__iop__()`` is\n used for the corresponding in-place operator. For example, for the\n operator \'``+``\', ``__add__()`` and ``__radd__()`` are used for the\n left and right variant of the binary operator, and ``__iadd__()``\n for the in-place variant.\n\n* For objects *x* and *y*, first ``x.__op__(y)`` is tried. If this is\n not implemented or returns ``NotImplemented``, ``y.__rop__(x)`` is\n tried. If this is also not implemented or returns\n ``NotImplemented``, a ``TypeError`` exception is raised. But see\n the following exception:\n\n* Exception to the previous item: if the left operand is an instance\n of a built-in type or a new-style class, and the right operand is an\n instance of a proper subclass of that type or class and overrides\n the base\'s ``__rop__()`` method, the right operand\'s ``__rop__()``\n method is tried *before* the left operand\'s ``__op__()`` method.\n\n This is done so that a subclass can completely override binary\n operators. Otherwise, the left operand\'s ``__op__()`` method would\n always accept the right operand: when an instance of a given class\n is expected, an instance of a subclass of that class is always\n acceptable.\n\n* When either operand type defines a coercion, this coercion is called\n before that type\'s ``__op__()`` or ``__rop__()`` method is called,\n but no sooner. If the coercion returns an object of a different\n type for the operand whose coercion is invoked, part of the process\n is redone using the new object.\n\n* When an in-place operator (like \'``+=``\') is used, if the left\n operand implements ``__iop__()``, it is invoked without any\n coercion. When the operation falls back to ``__op__()`` and/or\n ``__rop__()``, the normal coercion rules apply.\n\n* In ``x + y``, if *x* is a sequence that implements sequence\n concatenation, sequence concatenation is invoked.\n\n* In ``x * y``, if one operator is a sequence that implements sequence\n repetition, and the other is an integer (``int`` or ``long``),\n sequence repetition is invoked.\n\n* Rich comparisons (implemented by methods ``__eq__()`` and so on)\n never use coercion. Three-way comparison (implemented by\n ``__cmp__()``) does use coercion under the same conditions as other\n binary operations use it.\n\n* In the current implementation, the built-in numeric types ``int``,\n ``long`` and ``float`` do not use coercion; the type ``complex``\n however does use it. The difference can become apparent when\n subclassing these types. Over time, the type ``complex`` may be\n fixed to avoid coercion. All these types implement a\n ``__coerce__()`` method, for use by the built-in ``coerce()``\n function.\n\n\nWith Statement Context Managers\n===============================\n\nNew in version 2.5.\n\nA *context manager* is an object that defines the runtime context to\nbe established when executing a ``with`` statement. The context\nmanager handles the entry into, and the exit from, the desired runtime\ncontext for the execution of the block of code. Context managers are\nnormally invoked using the ``with`` statement (described in section\n*The with statement*), but can also be used by directly invoking their\nmethods.\n\nTypical uses of context managers include saving and restoring various\nkinds of global state, locking and unlocking resources, closing opened\nfiles, etc.\n\nFor more information on context managers, see *Context Manager Types*.\n\nobject.__enter__(self)\n\n Enter the runtime context related to this object. The ``with``\n statement will bind this method\'s return value to the target(s)\n specified in the ``as`` clause of the statement, if any.\n\nobject.__exit__(self, exc_type, exc_value, traceback)\n\n Exit the runtime context related to this object. The parameters\n describe the exception that caused the context to be exited. If the\n context was exited without an exception, all three arguments will\n be ``None``.\n\n If an exception is supplied, and the method wishes to suppress the\n exception (i.e., prevent it from being propagated), it should\n return a true value. Otherwise, the exception will be processed\n normally upon exit from this method.\n\n Note that ``__exit__()`` methods should not reraise the passed-in\n exception; this is the caller\'s responsibility.\n\nSee also:\n\n **PEP 0343** - The "with" statement\n The specification, background, and examples for the Python\n ``with`` statement.\n\n\nSpecial method lookup for old-style classes\n===========================================\n\nFor old-style classes, special methods are always looked up in exactly\nthe same way as any other method or attribute. This is the case\nregardless of whether the method is being looked up explicitly as in\n``x.__getitem__(i)`` or implicitly as in ``x[i]``.\n\nThis behaviour means that special methods may exhibit different\nbehaviour for different instances of a single old-style class if the\nappropriate special attributes are set differently:\n\n >>> class C:\n ... pass\n ...\n >>> c1 = C()\n >>> c2 = C()\n >>> c1.__len__ = lambda: 5\n >>> c2.__len__ = lambda: 9\n >>> len(c1)\n 5\n >>> len(c2)\n 9\n\n\nSpecial method lookup for new-style classes\n===========================================\n\nFor new-style classes, implicit invocations of special methods are\nonly guaranteed to work correctly if defined on an object\'s type, not\nin the object\'s instance dictionary. That behaviour is the reason why\nthe following code raises an exception (unlike the equivalent example\nwith old-style classes):\n\n >>> class C(object):\n ... pass\n ...\n >>> c = C()\n >>> c.__len__ = lambda: 5\n >>> len(c)\n Traceback (most recent call last):\n File "", line 1, in \n TypeError: object of type \'C\' has no len()\n\nThe rationale behind this behaviour lies with a number of special\nmethods such as ``__hash__()`` and ``__repr__()`` that are implemented\nby all objects, including type objects. If the implicit lookup of\nthese methods used the conventional lookup process, they would fail\nwhen invoked on the type object itself:\n\n >>> 1 .__hash__() == hash(1)\n True\n >>> int.__hash__() == hash(int)\n Traceback (most recent call last):\n File "", line 1, in \n TypeError: descriptor \'__hash__\' of \'int\' object needs an argument\n\nIncorrectly attempting to invoke an unbound method of a class in this\nway is sometimes referred to as \'metaclass confusion\', and is avoided\nby bypassing the instance when looking up special methods:\n\n >>> type(1).__hash__(1) == hash(1)\n True\n >>> type(int).__hash__(int) == hash(int)\n True\n\nIn addition to bypassing any instance attributes in the interest of\ncorrectness, implicit special method lookup may also bypass the\n``__getattribute__()`` method even of the object\'s metaclass:\n\n >>> class Meta(type):\n ... def __getattribute__(*args):\n ... print "Metaclass getattribute invoked"\n ... return type.__getattribute__(*args)\n ...\n >>> class C(object):\n ... __metaclass__ = Meta\n ... def __len__(self):\n ... return 10\n ... def __getattribute__(*args):\n ... print "Class getattribute invoked"\n ... return object.__getattribute__(*args)\n ...\n >>> c = C()\n >>> c.__len__() # Explicit lookup via instance\n Class getattribute invoked\n 10\n >>> type(c).__len__(c) # Explicit lookup via type\n Metaclass getattribute invoked\n 10\n >>> len(c) # Implicit lookup\n 10\n\nBypassing the ``__getattribute__()`` machinery in this fashion\nprovides significant scope for speed optimisations within the\ninterpreter, at the cost of some flexibility in the handling of\nspecial methods (the special method *must* be set on the class object\nitself in order to be consistently invoked by the interpreter).\n\n-[ Footnotes ]-\n\n[1] It *is* possible in some cases to change an object\'s type, under\n certain controlled conditions. It generally isn\'t a good idea\n though, since it can lead to some very strange behaviour if it is\n handled incorrectly.\n\n[2] A descriptor can define any combination of ``__get__()``,\n ``__set__()`` and ``__delete__()``. If it does not define\n ``__get__()``, then accessing the attribute even on an instance\n will return the descriptor object itself. If the descriptor\n defines ``__set__()`` and/or ``__delete__()``, it is a data\n descriptor; if it defines neither, it is a non-data descriptor.\n\n[3] For operands of the same type, it is assumed that if the non-\n reflected method (such as ``__add__()``) fails the operation is\n not supported, which is why the reflected method is not called.\n', 'string-conversions': u'\nString conversions\n******************\n\nA string conversion is an expression list enclosed in reverse (a.k.a.\nbackward) quotes:\n\n string_conversion ::= "\'" expression_list "\'"\n\nA string conversion evaluates the contained expression list and\nconverts the resulting object into a string according to rules\nspecific to its type.\n\nIf the object is a string, a number, ``None``, or a tuple, list or\ndictionary containing only objects whose type is one of these, the\nresulting string is a valid Python expression which can be passed to\nthe built-in function ``eval()`` to yield an expression with the same\nvalue (or an approximation, if floating point numbers are involved).\n\n(In particular, converting a string adds quotes around it and converts\n"funny" characters to escape sequences that are safe to print.)\n\nRecursive objects (for example, lists or dictionaries that contain a\nreference to themselves, directly or indirectly) use ``...`` to\nindicate a recursive reference, and the result cannot be passed to\n``eval()`` to get an equal value (``SyntaxError`` will be raised\ninstead).\n\nThe built-in function ``repr()`` performs exactly the same conversion\nin its argument as enclosing it in parentheses and reverse quotes\ndoes. The built-in function ``str()`` performs a similar but more\nuser-friendly conversion.\n', - 'string-methods': u'\nString Methods\n**************\n\nBelow are listed the string methods which both 8-bit strings and\nUnicode objects support. Note that none of these methods take keyword\narguments.\n\nIn addition, Python\'s strings support the sequence type methods\ndescribed in the *Sequence Types --- str, unicode, list, tuple,\nbuffer, xrange* section. To output formatted strings use template\nstrings or the ``%`` operator described in the *String Formatting\nOperations* section. Also, see the ``re`` module for string functions\nbased on regular expressions.\n\nstr.capitalize()\n\n Return a copy of the string with only its first character\n capitalized.\n\n For 8-bit strings, this method is locale-dependent.\n\nstr.center(width[, fillchar])\n\n Return centered in a string of length *width*. Padding is done\n using the specified *fillchar* (default is a space).\n\n Changed in version 2.4: Support for the *fillchar* argument.\n\nstr.count(sub[, start[, end]])\n\n Return the number of occurrences of substring *sub* in the range\n [*start*, *end*]. Optional arguments *start* and *end* are\n interpreted as in slice notation.\n\nstr.decode([encoding[, errors]])\n\n Decodes the string using the codec registered for *encoding*.\n *encoding* defaults to the default string encoding. *errors* may\n be given to set a different error handling scheme. The default is\n ``\'strict\'``, meaning that encoding errors raise ``UnicodeError``.\n Other possible values are ``\'ignore\'``, ``\'replace\'`` and any other\n name registered via ``codecs.register_error()``, see section *Codec\n Base Classes*.\n\n Added in version 2.2.\n\n Changed in version 2.3: Support for other error handling schemes\n added.\n\nstr.encode([encoding[, errors]])\n\n Return an encoded version of the string. Default encoding is the\n current default string encoding. *errors* may be given to set a\n different error handling scheme. The default for *errors* is\n ``\'strict\'``, meaning that encoding errors raise a\n ``UnicodeError``. Other possible values are ``\'ignore\'``,\n ``\'replace\'``, ``\'xmlcharrefreplace\'``, ``\'backslashreplace\'`` and\n any other name registered via ``codecs.register_error()``, see\n section *Codec Base Classes*. For a list of possible encodings, see\n section *Standard Encodings*.\n\n Added in version 2.0.\n\n Changed in version 2.3: Support for ``\'xmlcharrefreplace\'`` and\n ``\'backslashreplace\'`` and other error handling schemes added.\n\nstr.endswith(suffix[, start[, end]])\n\n Return ``True`` if the string ends with the specified *suffix*,\n otherwise return ``False``. *suffix* can also be a tuple of\n suffixes to look for. With optional *start*, test beginning at\n that position. With optional *end*, stop comparing at that\n position.\n\n Changed in version 2.5: Accept tuples as *suffix*.\n\nstr.expandtabs([tabsize])\n\n Return a copy of the string where all tab characters are replaced\n by one or more spaces, depending on the current column and the\n given tab size. The column number is reset to zero after each\n newline occurring in the string. If *tabsize* is not given, a tab\n size of ``8`` characters is assumed. This doesn\'t understand other\n non-printing characters or escape sequences.\n\nstr.find(sub[, start[, end]])\n\n Return the lowest index in the string where substring *sub* is\n found, such that *sub* is contained in the range [*start*, *end*].\n Optional arguments *start* and *end* are interpreted as in slice\n notation. Return ``-1`` if *sub* is not found.\n\nstr.format(format_string, *args, **kwargs)\n\n Perform a string formatting operation. The *format_string*\n argument can contain literal text or replacement fields delimited\n by braces ``{}``. Each replacement field contains either the\n numeric index of a positional argument, or the name of a keyword\n argument. Returns a copy of *format_string* where each replacement\n field is replaced with the string value of the corresponding\n argument.\n\n >>> "The sum of 1 + 2 is {0}".format(1+2)\n \'The sum of 1 + 2 is 3\'\n\n See *Format String Syntax* for a description of the various\n formatting options that can be specified in format strings.\n\n This method of string formatting is the new standard in Python 3.0,\n and should be preferred to the ``%`` formatting described in\n *String Formatting Operations* in new code.\n\n Added in version 2.6.\n\nstr.index(sub[, start[, end]])\n\n Like ``find()``, but raise ``ValueError`` when the substring is not\n found.\n\nstr.isalnum()\n\n Return true if all characters in the string are alphanumeric and\n there is at least one character, false otherwise.\n\n For 8-bit strings, this method is locale-dependent.\n\nstr.isalpha()\n\n Return true if all characters in the string are alphabetic and\n there is at least one character, false otherwise.\n\n For 8-bit strings, this method is locale-dependent.\n\nstr.isdigit()\n\n Return true if all characters in the string are digits and there is\n at least one character, false otherwise.\n\n For 8-bit strings, this method is locale-dependent.\n\nstr.islower()\n\n Return true if all cased characters in the string are lowercase and\n there is at least one cased character, false otherwise.\n\n For 8-bit strings, this method is locale-dependent.\n\nstr.isspace()\n\n Return true if there are only whitespace characters in the string\n and there is at least one character, false otherwise.\n\n For 8-bit strings, this method is locale-dependent.\n\nstr.istitle()\n\n Return true if the string is a titlecased string and there is at\n least one character, for example uppercase characters may only\n follow uncased characters and lowercase characters only cased ones.\n Return false otherwise.\n\n For 8-bit strings, this method is locale-dependent.\n\nstr.isupper()\n\n Return true if all cased characters in the string are uppercase and\n there is at least one cased character, false otherwise.\n\n For 8-bit strings, this method is locale-dependent.\n\nstr.join(seq)\n\n Return a string which is the concatenation of the strings in the\n sequence *seq*. The separator between elements is the string\n providing this method.\n\nstr.ljust(width[, fillchar])\n\n Return the string left justified in a string of length *width*.\n Padding is done using the specified *fillchar* (default is a\n space). The original string is returned if *width* is less than\n ``len(s)``.\n\n Changed in version 2.4: Support for the *fillchar* argument.\n\nstr.lower()\n\n Return a copy of the string converted to lowercase.\n\n For 8-bit strings, this method is locale-dependent.\n\nstr.lstrip([chars])\n\n Return a copy of the string with leading characters removed. The\n *chars* argument is a string specifying the set of characters to be\n removed. If omitted or ``None``, the *chars* argument defaults to\n removing whitespace. The *chars* argument is not a prefix; rather,\n all combinations of its values are stripped:\n\n >>> \' spacious \'.lstrip()\n \'spacious \'\n >>> \'www.example.com\'.lstrip(\'cmowz.\')\n \'example.com\'\n\n Changed in version 2.2.2: Support for the *chars* argument.\n\nstr.partition(sep)\n\n Split the string at the first occurrence of *sep*, and return a\n 3-tuple containing the part before the separator, the separator\n itself, and the part after the separator. If the separator is not\n found, return a 3-tuple containing the string itself, followed by\n two empty strings.\n\n Added in version 2.5.\n\nstr.replace(old, new[, count])\n\n Return a copy of the string with all occurrences of substring *old*\n replaced by *new*. If the optional argument *count* is given, only\n the first *count* occurrences are replaced.\n\nstr.rfind(sub[, start[, end]])\n\n Return the highest index in the string where substring *sub* is\n found, such that *sub* is contained within s[start,end]. Optional\n arguments *start* and *end* are interpreted as in slice notation.\n Return ``-1`` on failure.\n\nstr.rindex(sub[, start[, end]])\n\n Like ``rfind()`` but raises ``ValueError`` when the substring *sub*\n is not found.\n\nstr.rjust(width[, fillchar])\n\n Return the string right justified in a string of length *width*.\n Padding is done using the specified *fillchar* (default is a\n space). The original string is returned if *width* is less than\n ``len(s)``.\n\n Changed in version 2.4: Support for the *fillchar* argument.\n\nstr.rpartition(sep)\n\n Split the string at the last occurrence of *sep*, and return a\n 3-tuple containing the part before the separator, the separator\n itself, and the part after the separator. If the separator is not\n found, return a 3-tuple containing two empty strings, followed by\n the string itself.\n\n Added in version 2.5.\n\nstr.rsplit([sep[, maxsplit]])\n\n Return a list of the words in the string, using *sep* as the\n delimiter string. If *maxsplit* is given, at most *maxsplit* splits\n are done, the *rightmost* ones. If *sep* is not specified or\n ``None``, any whitespace string is a separator. Except for\n splitting from the right, ``rsplit()`` behaves like ``split()``\n which is described in detail below.\n\n Added in version 2.4.\n\nstr.rstrip([chars])\n\n Return a copy of the string with trailing characters removed. The\n *chars* argument is a string specifying the set of characters to be\n removed. If omitted or ``None``, the *chars* argument defaults to\n removing whitespace. The *chars* argument is not a suffix; rather,\n all combinations of its values are stripped:\n\n >>> \' spacious \'.rstrip()\n \' spacious\'\n >>> \'mississippi\'.rstrip(\'ipz\')\n \'mississ\'\n\n Changed in version 2.2.2: Support for the *chars* argument.\n\nstr.split([sep[, maxsplit]])\n\n Return a list of the words in the string, using *sep* as the\n delimiter string. If *maxsplit* is given, at most *maxsplit*\n splits are done (thus, the list will have at most ``maxsplit+1``\n elements). If *maxsplit* is not specified, then there is no limit\n on the number of splits (all possible splits are made).\n\n If *sep* is given, consecutive delimiters are not grouped together\n and are deemed to delimit empty strings (for example,\n ``\'1,,2\'.split(\',\')`` returns ``[\'1\', \'\', \'2\']``). The *sep*\n argument may consist of multiple characters (for example,\n ``\'1<>2<>3\'.split(\'<>\')`` returns ``[\'1\', \'2\', \'3\']``). Splitting\n an empty string with a specified separator returns ``[\'\']``.\n\n If *sep* is not specified or is ``None``, a different splitting\n algorithm is applied: runs of consecutive whitespace are regarded\n as a single separator, and the result will contain no empty strings\n at the start or end if the string has leading or trailing\n whitespace. Consequently, splitting an empty string or a string\n consisting of just whitespace with a ``None`` separator returns\n ``[]``.\n\n For example, ``\' 1 2 3 \'.split()`` returns ``[\'1\', \'2\', \'3\']``,\n and ``\' 1 2 3 \'.split(None, 1)`` returns ``[\'1\', \'2 3 \']``.\n\nstr.splitlines([keepends])\n\n Return a list of the lines in the string, breaking at line\n boundaries. Line breaks are not included in the resulting list\n unless *keepends* is given and true.\n\nstr.startswith(prefix[, start[, end]])\n\n Return ``True`` if string starts with the *prefix*, otherwise\n return ``False``. *prefix* can also be a tuple of prefixes to look\n for. With optional *start*, test string beginning at that\n position. With optional *end*, stop comparing string at that\n position.\n\n Changed in version 2.5: Accept tuples as *prefix*.\n\nstr.strip([chars])\n\n Return a copy of the string with the leading and trailing\n characters removed. The *chars* argument is a string specifying the\n set of characters to be removed. If omitted or ``None``, the\n *chars* argument defaults to removing whitespace. The *chars*\n argument is not a prefix or suffix; rather, all combinations of its\n values are stripped:\n\n >>> \' spacious \'.strip()\n \'spacious\'\n >>> \'www.example.com\'.strip(\'cmowz.\')\n \'example\'\n\n Changed in version 2.2.2: Support for the *chars* argument.\n\nstr.swapcase()\n\n Return a copy of the string with uppercase characters converted to\n lowercase and vice versa.\n\n For 8-bit strings, this method is locale-dependent.\n\nstr.title()\n\n Return a titlecased version of the string: words start with\n uppercase characters, all remaining cased characters are lowercase.\n\n For 8-bit strings, this method is locale-dependent.\n\nstr.translate(table[, deletechars])\n\n Return a copy of the string where all characters occurring in the\n optional argument *deletechars* are removed, and the remaining\n characters have been mapped through the given translation table,\n which must be a string of length 256.\n\n You can use the ``maketrans()`` helper function in the ``string``\n module to create a translation table. For string objects, set the\n *table* argument to ``None`` for translations that only delete\n characters:\n\n >>> \'read this short text\'.translate(None, \'aeiou\')\n \'rd ths shrt txt\'\n\n Added in version 2.6: Support for a ``None`` *table* argument.\n\n For Unicode objects, the ``translate()`` method does not accept the\n optional *deletechars* argument. Instead, it returns a copy of the\n *s* where all characters have been mapped through the given\n translation table which must be a mapping of Unicode ordinals to\n Unicode ordinals, Unicode strings or ``None``. Unmapped characters\n are left untouched. Characters mapped to ``None`` are deleted.\n Note, a more flexible approach is to create a custom character\n mapping codec using the ``codecs`` module (see ``encodings.cp1251``\n for an example).\n\nstr.upper()\n\n Return a copy of the string converted to uppercase.\n\n For 8-bit strings, this method is locale-dependent.\n\nstr.zfill(width)\n\n Return the numeric string left filled with zeros in a string of\n length *width*. A sign prefix is handled correctly. The original\n string is returned if *width* is less than ``len(s)``.\n\n Added in version 2.2.2.\n\nThe following methods are present only on unicode objects:\n\nunicode.isnumeric()\n\n Return ``True`` if there are only numeric characters in S,\n ``False`` otherwise. Numeric characters include digit characters,\n and all characters that have the Unicode numeric value property,\n e.g. U+2155, VULGAR FRACTION ONE FIFTH.\n\nunicode.isdecimal()\n\n Return ``True`` if there are only decimal characters in S,\n ``False`` otherwise. Decimal characters include digit characters,\n and all characters that that can be used to form decimal-radix\n numbers, e.g. U+0660, ARABIC-INDIC DIGIT ZERO.\n', - 'strings': u'\nString literals\n***************\n\nString literals are described by the following lexical definitions:\n\n stringliteral ::= [stringprefix](shortstring | longstring)\n stringprefix ::= "r" | "u" | "ur" | "R" | "U" | "UR" | "Ur" | "uR"\n shortstring ::= "\'" shortstringitem* "\'" | \'"\' shortstringitem* \'"\'\n longstring ::= ""\'" longstringitem* ""\'"\n | \'"""\' longstringitem* \'"""\'\n shortstringitem ::= shortstringchar | escapeseq\n longstringitem ::= longstringchar | escapeseq\n shortstringchar ::= \n longstringchar ::= \n escapeseq ::= "\\" \n\nOne syntactic restriction not indicated by these productions is that\nwhitespace is not allowed between the **stringprefix** and the rest of\nthe string literal. The source character set is defined by the\nencoding declaration; it is ASCII if no encoding declaration is given\nin the source file; see section *Encoding declarations*.\n\nIn plain English: String literals can be enclosed in matching single\nquotes (``\'``) or double quotes (``"``). They can also be enclosed in\nmatching groups of three single or double quotes (these are generally\nreferred to as *triple-quoted strings*). The backslash (``\\``)\ncharacter is used to escape characters that otherwise have a special\nmeaning, such as newline, backslash itself, or the quote character.\nString literals may optionally be prefixed with a letter ``\'r\'`` or\n``\'R\'``; such strings are called *raw strings* and use different rules\nfor interpreting backslash escape sequences. A prefix of ``\'u\'`` or\n``\'U\'`` makes the string a Unicode string. Unicode strings use the\nUnicode character set as defined by the Unicode Consortium and ISO\n10646. Some additional escape sequences, described below, are\navailable in Unicode strings. The two prefix characters may be\ncombined; in this case, ``\'u\'`` must appear before ``\'r\'``.\n\nIn triple-quoted strings, unescaped newlines and quotes are allowed\n(and are retained), except that three unescaped quotes in a row\nterminate the string. (A "quote" is the character used to open the\nstring, i.e. either ``\'`` or ``"``.)\n\nUnless an ``\'r\'`` or ``\'R\'`` prefix is present, escape sequences in\nstrings are interpreted according to rules similar to those used by\nStandard C. The recognized escape sequences are:\n\n+-------------------+-----------------------------------+---------+\n| Escape Sequence | Meaning | Notes |\n+===================+===================================+=========+\n| ``\\newline`` | Ignored | |\n+-------------------+-----------------------------------+---------+\n| ``\\\\`` | Backslash (``\\``) | |\n+-------------------+-----------------------------------+---------+\n| ``\\\'`` | Single quote (``\'``) | |\n+-------------------+-----------------------------------+---------+\n| ``\\"`` | Double quote (``"``) | |\n+-------------------+-----------------------------------+---------+\n| ``\\a`` | ASCII Bell (BEL) | |\n+-------------------+-----------------------------------+---------+\n| ``\\b`` | ASCII Backspace (BS) | |\n+-------------------+-----------------------------------+---------+\n| ``\\f`` | ASCII Formfeed (FF) | |\n+-------------------+-----------------------------------+---------+\n| ``\\n`` | ASCII Linefeed (LF) | |\n+-------------------+-----------------------------------+---------+\n| ``\\N{name}`` | Character named *name* in the | |\n| | Unicode database (Unicode only) | |\n+-------------------+-----------------------------------+---------+\n| ``\\r`` | ASCII Carriage Return (CR) | |\n+-------------------+-----------------------------------+---------+\n| ``\\t`` | ASCII Horizontal Tab (TAB) | |\n+-------------------+-----------------------------------+---------+\n| ``\\uxxxx`` | Character with 16-bit hex value | (1) |\n| | *xxxx* (Unicode only) | |\n+-------------------+-----------------------------------+---------+\n| ``\\Uxxxxxxxx`` | Character with 32-bit hex value | (2) |\n| | *xxxxxxxx* (Unicode only) | |\n+-------------------+-----------------------------------+---------+\n| ``\\v`` | ASCII Vertical Tab (VT) | |\n+-------------------+-----------------------------------+---------+\n| ``\\ooo`` | Character with octal value *ooo* | (3,5) |\n+-------------------+-----------------------------------+---------+\n| ``\\xhh`` | Character with hex value *hh* | (4,5) |\n+-------------------+-----------------------------------+---------+\n\nNotes:\n\n1. Individual code units which form parts of a surrogate pair can be\n encoded using this escape sequence.\n\n2. Any Unicode character can be encoded this way, but characters\n outside the Basic Multilingual Plane (BMP) will be encoded using a\n surrogate pair if Python is compiled to use 16-bit code units (the\n default). Individual code units which form parts of a surrogate\n pair can be encoded using this escape sequence.\n\n3. As in Standard C, up to three octal digits are accepted.\n\n4. Unlike in Standard C, exactly two hex digits are required.\n\n5. In a string literal, hexadecimal and octal escapes denote the byte\n with the given value; it is not necessary that the byte encodes a\n character in the source character set. In a Unicode literal, these\n escapes denote a Unicode character with the given value.\n\nUnlike Standard C, all unrecognized escape sequences are left in the\nstring unchanged, i.e., *the backslash is left in the string*. (This\nbehavior is useful when debugging: if an escape sequence is mistyped,\nthe resulting output is more easily recognized as broken.) It is also\nimportant to note that the escape sequences marked as "(Unicode only)"\nin the table above fall into the category of unrecognized escapes for\nnon-Unicode string literals.\n\nWhen an ``\'r\'`` or ``\'R\'`` prefix is present, a character following a\nbackslash is included in the string without change, and *all\nbackslashes are left in the string*. For example, the string literal\n``r"\\n"`` consists of two characters: a backslash and a lowercase\n``\'n\'``. String quotes can be escaped with a backslash, but the\nbackslash remains in the string; for example, ``r"\\""`` is a valid\nstring literal consisting of two characters: a backslash and a double\nquote; ``r"\\"`` is not a valid string literal (even a raw string\ncannot end in an odd number of backslashes). Specifically, *a raw\nstring cannot end in a single backslash* (since the backslash would\nescape the following quote character). Note also that a single\nbackslash followed by a newline is interpreted as those two characters\nas part of the string, *not* as a line continuation.\n\nWhen an ``\'r\'`` or ``\'R\'`` prefix is used in conjunction with a\n``\'u\'`` or ``\'U\'`` prefix, then the ``\\uXXXX`` and ``\\UXXXXXXXX``\nescape sequences are processed while *all other backslashes are left\nin the string*. For example, the string literal ``ur"\\u0062\\n"``\nconsists of three Unicode characters: \'LATIN SMALL LETTER B\', \'REVERSE\nSOLIDUS\', and \'LATIN SMALL LETTER N\'. Backslashes can be escaped with\na preceding backslash; however, both remain in the string. As a\nresult, ``\\uXXXX`` escape sequences are only recognized when there are\nan odd number of backslashes.\n', + 'string-methods': u'\nString Methods\n**************\n\nBelow are listed the string methods which both 8-bit strings and\nUnicode objects support. Note that none of these methods take keyword\narguments.\n\nIn addition, Python\'s strings support the sequence type methods\ndescribed in the *Sequence Types --- str, unicode, list, tuple,\nbuffer, xrange* section. To output formatted strings use template\nstrings or the ``%`` operator described in the *String Formatting\nOperations* section. Also, see the ``re`` module for string functions\nbased on regular expressions.\n\nstr.capitalize()\n\n Return a copy of the string with only its first character\n capitalized.\n\n For 8-bit strings, this method is locale-dependent.\n\nstr.center(width[, fillchar])\n\n Return centered in a string of length *width*. Padding is done\n using the specified *fillchar* (default is a space).\n\n Changed in version 2.4: Support for the *fillchar* argument.\n\nstr.count(sub[, start[, end]])\n\n Return the number of occurrences of substring *sub* in the range\n [*start*, *end*]. Optional arguments *start* and *end* are\n interpreted as in slice notation.\n\nstr.decode([encoding[, errors]])\n\n Decodes the string using the codec registered for *encoding*.\n *encoding* defaults to the default string encoding. *errors* may\n be given to set a different error handling scheme. The default is\n ``\'strict\'``, meaning that encoding errors raise ``UnicodeError``.\n Other possible values are ``\'ignore\'``, ``\'replace\'`` and any other\n name registered via ``codecs.register_error()``, see section *Codec\n Base Classes*.\n\n New in version 2.2.\n\n Changed in version 2.3: Support for other error handling schemes\n added.\n\nstr.encode([encoding[, errors]])\n\n Return an encoded version of the string. Default encoding is the\n current default string encoding. *errors* may be given to set a\n different error handling scheme. The default for *errors* is\n ``\'strict\'``, meaning that encoding errors raise a\n ``UnicodeError``. Other possible values are ``\'ignore\'``,\n ``\'replace\'``, ``\'xmlcharrefreplace\'``, ``\'backslashreplace\'`` and\n any other name registered via ``codecs.register_error()``, see\n section *Codec Base Classes*. For a list of possible encodings, see\n section *Standard Encodings*.\n\n New in version 2.0.\n\n Changed in version 2.3: Support for ``\'xmlcharrefreplace\'`` and\n ``\'backslashreplace\'`` and other error handling schemes added.\n\nstr.endswith(suffix[, start[, end]])\n\n Return ``True`` if the string ends with the specified *suffix*,\n otherwise return ``False``. *suffix* can also be a tuple of\n suffixes to look for. With optional *start*, test beginning at\n that position. With optional *end*, stop comparing at that\n position.\n\n Changed in version 2.5: Accept tuples as *suffix*.\n\nstr.expandtabs([tabsize])\n\n Return a copy of the string where all tab characters are replaced\n by one or more spaces, depending on the current column and the\n given tab size. The column number is reset to zero after each\n newline occurring in the string. If *tabsize* is not given, a tab\n size of ``8`` characters is assumed. This doesn\'t understand other\n non-printing characters or escape sequences.\n\nstr.find(sub[, start[, end]])\n\n Return the lowest index in the string where substring *sub* is\n found, such that *sub* is contained in the range [*start*, *end*].\n Optional arguments *start* and *end* are interpreted as in slice\n notation. Return ``-1`` if *sub* is not found.\n\nstr.format(format_string, *args, **kwargs)\n\n Perform a string formatting operation. The *format_string*\n argument can contain literal text or replacement fields delimited\n by braces ``{}``. Each replacement field contains either the\n numeric index of a positional argument, or the name of a keyword\n argument. Returns a copy of *format_string* where each replacement\n field is replaced with the string value of the corresponding\n argument.\n\n >>> "The sum of 1 + 2 is {0}".format(1+2)\n \'The sum of 1 + 2 is 3\'\n\n See *Format String Syntax* for a description of the various\n formatting options that can be specified in format strings.\n\n This method of string formatting is the new standard in Python 3.0,\n and should be preferred to the ``%`` formatting described in\n *String Formatting Operations* in new code.\n\n New in version 2.6.\n\nstr.index(sub[, start[, end]])\n\n Like ``find()``, but raise ``ValueError`` when the substring is not\n found.\n\nstr.isalnum()\n\n Return true if all characters in the string are alphanumeric and\n there is at least one character, false otherwise.\n\n For 8-bit strings, this method is locale-dependent.\n\nstr.isalpha()\n\n Return true if all characters in the string are alphabetic and\n there is at least one character, false otherwise.\n\n For 8-bit strings, this method is locale-dependent.\n\nstr.isdigit()\n\n Return true if all characters in the string are digits and there is\n at least one character, false otherwise.\n\n For 8-bit strings, this method is locale-dependent.\n\nstr.islower()\n\n Return true if all cased characters in the string are lowercase and\n there is at least one cased character, false otherwise.\n\n For 8-bit strings, this method is locale-dependent.\n\nstr.isspace()\n\n Return true if there are only whitespace characters in the string\n and there is at least one character, false otherwise.\n\n For 8-bit strings, this method is locale-dependent.\n\nstr.istitle()\n\n Return true if the string is a titlecased string and there is at\n least one character, for example uppercase characters may only\n follow uncased characters and lowercase characters only cased ones.\n Return false otherwise.\n\n For 8-bit strings, this method is locale-dependent.\n\nstr.isupper()\n\n Return true if all cased characters in the string are uppercase and\n there is at least one cased character, false otherwise.\n\n For 8-bit strings, this method is locale-dependent.\n\nstr.join(seq)\n\n Return a string which is the concatenation of the strings in the\n sequence *seq*. The separator between elements is the string\n providing this method.\n\nstr.ljust(width[, fillchar])\n\n Return the string left justified in a string of length *width*.\n Padding is done using the specified *fillchar* (default is a\n space). The original string is returned if *width* is less than\n ``len(s)``.\n\n Changed in version 2.4: Support for the *fillchar* argument.\n\nstr.lower()\n\n Return a copy of the string converted to lowercase.\n\n For 8-bit strings, this method is locale-dependent.\n\nstr.lstrip([chars])\n\n Return a copy of the string with leading characters removed. The\n *chars* argument is a string specifying the set of characters to be\n removed. If omitted or ``None``, the *chars* argument defaults to\n removing whitespace. The *chars* argument is not a prefix; rather,\n all combinations of its values are stripped:\n\n >>> \' spacious \'.lstrip()\n \'spacious \'\n >>> \'www.example.com\'.lstrip(\'cmowz.\')\n \'example.com\'\n\n Changed in version 2.2.2: Support for the *chars* argument.\n\nstr.partition(sep)\n\n Split the string at the first occurrence of *sep*, and return a\n 3-tuple containing the part before the separator, the separator\n itself, and the part after the separator. If the separator is not\n found, return a 3-tuple containing the string itself, followed by\n two empty strings.\n\n New in version 2.5.\n\nstr.replace(old, new[, count])\n\n Return a copy of the string with all occurrences of substring *old*\n replaced by *new*. If the optional argument *count* is given, only\n the first *count* occurrences are replaced.\n\nstr.rfind(sub[, start[, end]])\n\n Return the highest index in the string where substring *sub* is\n found, such that *sub* is contained within s[start,end]. Optional\n arguments *start* and *end* are interpreted as in slice notation.\n Return ``-1`` on failure.\n\nstr.rindex(sub[, start[, end]])\n\n Like ``rfind()`` but raises ``ValueError`` when the substring *sub*\n is not found.\n\nstr.rjust(width[, fillchar])\n\n Return the string right justified in a string of length *width*.\n Padding is done using the specified *fillchar* (default is a\n space). The original string is returned if *width* is less than\n ``len(s)``.\n\n Changed in version 2.4: Support for the *fillchar* argument.\n\nstr.rpartition(sep)\n\n Split the string at the last occurrence of *sep*, and return a\n 3-tuple containing the part before the separator, the separator\n itself, and the part after the separator. If the separator is not\n found, return a 3-tuple containing two empty strings, followed by\n the string itself.\n\n New in version 2.5.\n\nstr.rsplit([sep[, maxsplit]])\n\n Return a list of the words in the string, using *sep* as the\n delimiter string. If *maxsplit* is given, at most *maxsplit* splits\n are done, the *rightmost* ones. If *sep* is not specified or\n ``None``, any whitespace string is a separator. Except for\n splitting from the right, ``rsplit()`` behaves like ``split()``\n which is described in detail below.\n\n New in version 2.4.\n\nstr.rstrip([chars])\n\n Return a copy of the string with trailing characters removed. The\n *chars* argument is a string specifying the set of characters to be\n removed. If omitted or ``None``, the *chars* argument defaults to\n removing whitespace. The *chars* argument is not a suffix; rather,\n all combinations of its values are stripped:\n\n >>> \' spacious \'.rstrip()\n \' spacious\'\n >>> \'mississippi\'.rstrip(\'ipz\')\n \'mississ\'\n\n Changed in version 2.2.2: Support for the *chars* argument.\n\nstr.split([sep[, maxsplit]])\n\n Return a list of the words in the string, using *sep* as the\n delimiter string. If *maxsplit* is given, at most *maxsplit*\n splits are done (thus, the list will have at most ``maxsplit+1``\n elements). If *maxsplit* is not specified, then there is no limit\n on the number of splits (all possible splits are made).\n\n If *sep* is given, consecutive delimiters are not grouped together\n and are deemed to delimit empty strings (for example,\n ``\'1,,2\'.split(\',\')`` returns ``[\'1\', \'\', \'2\']``). The *sep*\n argument may consist of multiple characters (for example,\n ``\'1<>2<>3\'.split(\'<>\')`` returns ``[\'1\', \'2\', \'3\']``). Splitting\n an empty string with a specified separator returns ``[\'\']``.\n\n If *sep* is not specified or is ``None``, a different splitting\n algorithm is applied: runs of consecutive whitespace are regarded\n as a single separator, and the result will contain no empty strings\n at the start or end if the string has leading or trailing\n whitespace. Consequently, splitting an empty string or a string\n consisting of just whitespace with a ``None`` separator returns\n ``[]``.\n\n For example, ``\' 1 2 3 \'.split()`` returns ``[\'1\', \'2\', \'3\']``,\n and ``\' 1 2 3 \'.split(None, 1)`` returns ``[\'1\', \'2 3 \']``.\n\nstr.splitlines([keepends])\n\n Return a list of the lines in the string, breaking at line\n boundaries. Line breaks are not included in the resulting list\n unless *keepends* is given and true.\n\nstr.startswith(prefix[, start[, end]])\n\n Return ``True`` if string starts with the *prefix*, otherwise\n return ``False``. *prefix* can also be a tuple of prefixes to look\n for. With optional *start*, test string beginning at that\n position. With optional *end*, stop comparing string at that\n position.\n\n Changed in version 2.5: Accept tuples as *prefix*.\n\nstr.strip([chars])\n\n Return a copy of the string with the leading and trailing\n characters removed. The *chars* argument is a string specifying the\n set of characters to be removed. If omitted or ``None``, the\n *chars* argument defaults to removing whitespace. The *chars*\n argument is not a prefix or suffix; rather, all combinations of its\n values are stripped:\n\n >>> \' spacious \'.strip()\n \'spacious\'\n >>> \'www.example.com\'.strip(\'cmowz.\')\n \'example\'\n\n Changed in version 2.2.2: Support for the *chars* argument.\n\nstr.swapcase()\n\n Return a copy of the string with uppercase characters converted to\n lowercase and vice versa.\n\n For 8-bit strings, this method is locale-dependent.\n\nstr.title()\n\n Return a titlecased version of the string: words start with\n uppercase characters, all remaining cased characters are lowercase.\n\n For 8-bit strings, this method is locale-dependent.\n\nstr.translate(table[, deletechars])\n\n Return a copy of the string where all characters occurring in the\n optional argument *deletechars* are removed, and the remaining\n characters have been mapped through the given translation table,\n which must be a string of length 256.\n\n You can use the ``maketrans()`` helper function in the ``string``\n module to create a translation table. For string objects, set the\n *table* argument to ``None`` for translations that only delete\n characters:\n\n >>> \'read this short text\'.translate(None, \'aeiou\')\n \'rd ths shrt txt\'\n\n New in version 2.6: Support for a ``None`` *table* argument.\n\n For Unicode objects, the ``translate()`` method does not accept the\n optional *deletechars* argument. Instead, it returns a copy of the\n *s* where all characters have been mapped through the given\n translation table which must be a mapping of Unicode ordinals to\n Unicode ordinals, Unicode strings or ``None``. Unmapped characters\n are left untouched. Characters mapped to ``None`` are deleted.\n Note, a more flexible approach is to create a custom character\n mapping codec using the ``codecs`` module (see ``encodings.cp1251``\n for an example).\n\nstr.upper()\n\n Return a copy of the string converted to uppercase.\n\n For 8-bit strings, this method is locale-dependent.\n\nstr.zfill(width)\n\n Return the numeric string left filled with zeros in a string of\n length *width*. A sign prefix is handled correctly. The original\n string is returned if *width* is less than ``len(s)``.\n\n New in version 2.2.2.\n\nThe following methods are present only on unicode objects:\n\nunicode.isnumeric()\n\n Return ``True`` if there are only numeric characters in S,\n ``False`` otherwise. Numeric characters include digit characters,\n and all characters that have the Unicode numeric value property,\n e.g. U+2155, VULGAR FRACTION ONE FIFTH.\n\nunicode.isdecimal()\n\n Return ``True`` if there are only decimal characters in S,\n ``False`` otherwise. Decimal characters include digit characters,\n and all characters that that can be used to form decimal-radix\n numbers, e.g. U+0660, ARABIC-INDIC DIGIT ZERO.\n', + 'strings': u'\nString literals\n***************\n\nString literals are described by the following lexical definitions:\n\n stringliteral ::= [stringprefix](shortstring | longstring)\n stringprefix ::= "r" | "u" | "ur" | "R" | "U" | "UR" | "Ur" | "uR"\n shortstring ::= "\'" shortstringitem* "\'" | \'"\' shortstringitem* \'"\'\n longstring ::= "\'\'\'" longstringitem* "\'\'\'"\n | \'"""\' longstringitem* \'"""\'\n shortstringitem ::= shortstringchar | escapeseq\n longstringitem ::= longstringchar | escapeseq\n shortstringchar ::= \n longstringchar ::= \n escapeseq ::= "\\" \n\nOne syntactic restriction not indicated by these productions is that\nwhitespace is not allowed between the **stringprefix** and the rest of\nthe string literal. The source character set is defined by the\nencoding declaration; it is ASCII if no encoding declaration is given\nin the source file; see section *Encoding declarations*.\n\nIn plain English: String literals can be enclosed in matching single\nquotes (``\'``) or double quotes (``"``). They can also be enclosed in\nmatching groups of three single or double quotes (these are generally\nreferred to as *triple-quoted strings*). The backslash (``\\``)\ncharacter is used to escape characters that otherwise have a special\nmeaning, such as newline, backslash itself, or the quote character.\nString literals may optionally be prefixed with a letter ``\'r\'`` or\n``\'R\'``; such strings are called *raw strings* and use different rules\nfor interpreting backslash escape sequences. A prefix of ``\'u\'`` or\n``\'U\'`` makes the string a Unicode string. Unicode strings use the\nUnicode character set as defined by the Unicode Consortium and ISO\n10646. Some additional escape sequences, described below, are\navailable in Unicode strings. The two prefix characters may be\ncombined; in this case, ``\'u\'`` must appear before ``\'r\'``.\n\nIn triple-quoted strings, unescaped newlines and quotes are allowed\n(and are retained), except that three unescaped quotes in a row\nterminate the string. (A "quote" is the character used to open the\nstring, i.e. either ``\'`` or ``"``.)\n\nUnless an ``\'r\'`` or ``\'R\'`` prefix is present, escape sequences in\nstrings are interpreted according to rules similar to those used by\nStandard C. The recognized escape sequences are:\n\n+-------------------+-----------------------------------+---------+\n| Escape Sequence | Meaning | Notes |\n+===================+===================================+=========+\n| ``\\newline`` | Ignored | |\n+-------------------+-----------------------------------+---------+\n| ``\\\\`` | Backslash (``\\``) | |\n+-------------------+-----------------------------------+---------+\n| ``\\\'`` | Single quote (``\'``) | |\n+-------------------+-----------------------------------+---------+\n| ``\\"`` | Double quote (``"``) | |\n+-------------------+-----------------------------------+---------+\n| ``\\a`` | ASCII Bell (BEL) | |\n+-------------------+-----------------------------------+---------+\n| ``\\b`` | ASCII Backspace (BS) | |\n+-------------------+-----------------------------------+---------+\n| ``\\f`` | ASCII Formfeed (FF) | |\n+-------------------+-----------------------------------+---------+\n| ``\\n`` | ASCII Linefeed (LF) | |\n+-------------------+-----------------------------------+---------+\n| ``\\N{name}`` | Character named *name* in the | |\n| | Unicode database (Unicode only) | |\n+-------------------+-----------------------------------+---------+\n| ``\\r`` | ASCII Carriage Return (CR) | |\n+-------------------+-----------------------------------+---------+\n| ``\\t`` | ASCII Horizontal Tab (TAB) | |\n+-------------------+-----------------------------------+---------+\n| ``\\uxxxx`` | Character with 16-bit hex value | (1) |\n| | *xxxx* (Unicode only) | |\n+-------------------+-----------------------------------+---------+\n| ``\\Uxxxxxxxx`` | Character with 32-bit hex value | (2) |\n| | *xxxxxxxx* (Unicode only) | |\n+-------------------+-----------------------------------+---------+\n| ``\\v`` | ASCII Vertical Tab (VT) | |\n+-------------------+-----------------------------------+---------+\n| ``\\ooo`` | Character with octal value *ooo* | (3,5) |\n+-------------------+-----------------------------------+---------+\n| ``\\xhh`` | Character with hex value *hh* | (4,5) |\n+-------------------+-----------------------------------+---------+\n\nNotes:\n\n1. Individual code units which form parts of a surrogate pair can be\n encoded using this escape sequence.\n\n2. Any Unicode character can be encoded this way, but characters\n outside the Basic Multilingual Plane (BMP) will be encoded using a\n surrogate pair if Python is compiled to use 16-bit code units (the\n default). Individual code units which form parts of a surrogate\n pair can be encoded using this escape sequence.\n\n3. As in Standard C, up to three octal digits are accepted.\n\n4. Unlike in Standard C, exactly two hex digits are required.\n\n5. In a string literal, hexadecimal and octal escapes denote the byte\n with the given value; it is not necessary that the byte encodes a\n character in the source character set. In a Unicode literal, these\n escapes denote a Unicode character with the given value.\n\nUnlike Standard C, all unrecognized escape sequences are left in the\nstring unchanged, i.e., *the backslash is left in the string*. (This\nbehavior is useful when debugging: if an escape sequence is mistyped,\nthe resulting output is more easily recognized as broken.) It is also\nimportant to note that the escape sequences marked as "(Unicode only)"\nin the table above fall into the category of unrecognized escapes for\nnon-Unicode string literals.\n\nWhen an ``\'r\'`` or ``\'R\'`` prefix is present, a character following a\nbackslash is included in the string without change, and *all\nbackslashes are left in the string*. For example, the string literal\n``r"\\n"`` consists of two characters: a backslash and a lowercase\n``\'n\'``. String quotes can be escaped with a backslash, but the\nbackslash remains in the string; for example, ``r"\\""`` is a valid\nstring literal consisting of two characters: a backslash and a double\nquote; ``r"\\"`` is not a valid string literal (even a raw string\ncannot end in an odd number of backslashes). Specifically, *a raw\nstring cannot end in a single backslash* (since the backslash would\nescape the following quote character). Note also that a single\nbackslash followed by a newline is interpreted as those two characters\nas part of the string, *not* as a line continuation.\n\nWhen an ``\'r\'`` or ``\'R\'`` prefix is used in conjunction with a\n``\'u\'`` or ``\'U\'`` prefix, then the ``\\uXXXX`` and ``\\UXXXXXXXX``\nescape sequences are processed while *all other backslashes are left\nin the string*. For example, the string literal ``ur"\\u0062\\n"``\nconsists of three Unicode characters: \'LATIN SMALL LETTER B\', \'REVERSE\nSOLIDUS\', and \'LATIN SMALL LETTER N\'. Backslashes can be escaped with\na preceding backslash; however, both remain in the string. As a\nresult, ``\\uXXXX`` escape sequences are only recognized when there are\nan odd number of backslashes.\n', 'subscriptions': u'\nSubscriptions\n*************\n\nA subscription selects an item of a sequence (string, tuple or list)\nor mapping (dictionary) object:\n\n subscription ::= primary "[" expression_list "]"\n\nThe primary must evaluate to an object of a sequence or mapping type.\n\nIf the primary is a mapping, the expression list must evaluate to an\nobject whose value is one of the keys of the mapping, and the\nsubscription selects the value in the mapping that corresponds to that\nkey. (The expression list is a tuple except if it has exactly one\nitem.)\n\nIf the primary is a sequence, the expression (list) must evaluate to a\nplain integer. If this value is negative, the length of the sequence\nis added to it (so that, e.g., ``x[-1]`` selects the last item of\n``x``.) The resulting value must be a nonnegative integer less than\nthe number of items in the sequence, and the subscription selects the\nitem whose index is that value (counting from zero).\n\nA string\'s items are characters. A character is not a separate data\ntype but a string of exactly one character.\n', 'truth': u"\nTruth Value Testing\n*******************\n\nAny object can be tested for truth value, for use in an ``if`` or\n``while`` condition or as operand of the Boolean operations below. The\nfollowing values are considered false:\n\n* ``None``\n\n* ``False``\n\n* zero of any numeric type, for example, ``0``, ``0L``, ``0.0``,\n ``0j``.\n\n* any empty sequence, for example, ``''``, ``()``, ``[]``.\n\n* any empty mapping, for example, ``{}``.\n\n* instances of user-defined classes, if the class defines a\n ``__nonzero__()`` or ``__len__()`` method, when that method returns\n the integer zero or ``bool`` value ``False``. [1]\n\nAll other values are considered true --- so objects of many types are\nalways true.\n\nOperations and built-in functions that have a Boolean result always\nreturn ``0`` or ``False`` for false and ``1`` or ``True`` for true,\nunless otherwise stated. (Important exception: the Boolean operations\n``or`` and ``and`` always return one of their operands.)\n", 'try': u'\nThe ``try`` statement\n*********************\n\nThe ``try`` statement specifies exception handlers and/or cleanup code\nfor a group of statements:\n\n try_stmt ::= try1_stmt | try2_stmt\n try1_stmt ::= "try" ":" suite\n ("except" [expression ["," target]] ":" suite)+\n ["else" ":" suite]\n ["finally" ":" suite]\n try2_stmt ::= "try" ":" suite\n "finally" ":" suite\n\nChanged in version 2.5: In previous versions of Python,\n``try``...``except``...``finally`` did not work. ``try``...``except``\nhad to be nested in ``try``...``finally``.\n\nThe ``except`` clause(s) specify one or more exception handlers. When\nno exception occurs in the ``try`` clause, no exception handler is\nexecuted. When an exception occurs in the ``try`` suite, a search for\nan exception handler is started. This search inspects the except\nclauses in turn until one is found that matches the exception. An\nexpression-less except clause, if present, must be last; it matches\nany exception. For an except clause with an expression, that\nexpression is evaluated, and the clause matches the exception if the\nresulting object is "compatible" with the exception. An object is\ncompatible with an exception if it is the class or a base class of the\nexception object, a tuple containing an item compatible with the\nexception, or, in the (deprecated) case of string exceptions, is the\nraised string itself (note that the object identities must match, i.e.\nit must be the same string object, not just a string with the same\nvalue).\n\nIf no except clause matches the exception, the search for an exception\nhandler continues in the surrounding code and on the invocation stack.\n[1]\n\nIf the evaluation of an expression in the header of an except clause\nraises an exception, the original search for a handler is canceled and\na search starts for the new exception in the surrounding code and on\nthe call stack (it is treated as if the entire ``try`` statement\nraised the exception).\n\nWhen a matching except clause is found, the exception is assigned to\nthe target specified in that except clause, if present, and the except\nclause\'s suite is executed. All except clauses must have an\nexecutable block. When the end of this block is reached, execution\ncontinues normally after the entire try statement. (This means that\nif two nested handlers exist for the same exception, and the exception\noccurs in the try clause of the inner handler, the outer handler will\nnot handle the exception.)\n\nBefore an except clause\'s suite is executed, details about the\nexception are assigned to three variables in the ``sys`` module:\n``sys.exc_type`` receives the object identifying the exception;\n``sys.exc_value`` receives the exception\'s parameter;\n``sys.exc_traceback`` receives a traceback object (see section *The\nstandard type hierarchy*) identifying the point in the program where\nthe exception occurred. These details are also available through the\n``sys.exc_info()`` function, which returns a tuple ``(exc_type,\nexc_value, exc_traceback)``. Use of the corresponding variables is\ndeprecated in favor of this function, since their use is unsafe in a\nthreaded program. As of Python 1.5, the variables are restored to\ntheir previous values (before the call) when returning from a function\nthat handled an exception.\n\nThe optional ``else`` clause is executed if and when control flows off\nthe end of the ``try`` clause. [2] Exceptions in the ``else`` clause\nare not handled by the preceding ``except`` clauses.\n\nIf ``finally`` is present, it specifies a \'cleanup\' handler. The\n``try`` clause is executed, including any ``except`` and ``else``\nclauses. If an exception occurs in any of the clauses and is not\nhandled, the exception is temporarily saved. The ``finally`` clause is\nexecuted. If there is a saved exception, it is re-raised at the end\nof the ``finally`` clause. If the ``finally`` clause raises another\nexception or executes a ``return`` or ``break`` statement, the saved\nexception is lost. The exception information is not available to the\nprogram during execution of the ``finally`` clause.\n\nWhen a ``return``, ``break`` or ``continue`` statement is executed in\nthe ``try`` suite of a ``try``...``finally`` statement, the\n``finally`` clause is also executed \'on the way out.\' A ``continue``\nstatement is illegal in the ``finally`` clause. (The reason is a\nproblem with the current implementation --- this restriction may be\nlifted in the future).\n\nAdditional information on exceptions can be found in section\n*Exceptions*, and information on using the ``raise`` statement to\ngenerate exceptions may be found in section *The raise statement*.\n', - 'types': u'\nThe standard type hierarchy\n***************************\n\nBelow is a list of the types that are built into Python. Extension\nmodules (written in C, Java, or other languages, depending on the\nimplementation) can define additional types. Future versions of\nPython may add types to the type hierarchy (e.g., rational numbers,\nefficiently stored arrays of integers, etc.).\n\nSome of the type descriptions below contain a paragraph listing\n\'special attributes.\' These are attributes that provide access to the\nimplementation and are not intended for general use. Their definition\nmay change in the future.\n\nNone\n This type has a single value. There is a single object with this\n value. This object is accessed through the built-in name ``None``.\n It is used to signify the absence of a value in many situations,\n e.g., it is returned from functions that don\'t explicitly return\n anything. Its truth value is false.\n\nNotImplemented\n This type has a single value. There is a single object with this\n value. This object is accessed through the built-in name\n ``NotImplemented``. Numeric methods and rich comparison methods may\n return this value if they do not implement the operation for the\n operands provided. (The interpreter will then try the reflected\n operation, or some other fallback, depending on the operator.) Its\n truth value is true.\n\nEllipsis\n This type has a single value. There is a single object with this\n value. This object is accessed through the built-in name\n ``Ellipsis``. It is used to indicate the presence of the ``...``\n syntax in a slice. Its truth value is true.\n\n``numbers.Number``\n These are created by numeric literals and returned as results by\n arithmetic operators and arithmetic built-in functions. Numeric\n objects are immutable; once created their value never changes.\n Python numbers are of course strongly related to mathematical\n numbers, but subject to the limitations of numerical representation\n in computers.\n\n Python distinguishes between integers, floating point numbers, and\n complex numbers:\n\n ``numbers.Integral``\n These represent elements from the mathematical set of integers\n (positive and negative).\n\n There are three types of integers:\n\n Plain integers\n These represent numbers in the range -2147483648 through\n 2147483647. (The range may be larger on machines with a\n larger natural word size, but not smaller.) When the result\n of an operation would fall outside this range, the result is\n normally returned as a long integer (in some cases, the\n exception ``OverflowError`` is raised instead). For the\n purpose of shift and mask operations, integers are assumed to\n have a binary, 2\'s complement notation using 32 or more bits,\n and hiding no bits from the user (i.e., all 4294967296\n different bit patterns correspond to different values).\n\n Long integers\n These represent numbers in an unlimited range, subject to\n available (virtual) memory only. For the purpose of shift\n and mask operations, a binary representation is assumed, and\n negative numbers are represented in a variant of 2\'s\n complement which gives the illusion of an infinite string of\n sign bits extending to the left.\n\n Booleans\n These represent the truth values False and True. The two\n objects representing the values False and True are the only\n Boolean objects. The Boolean type is a subtype of plain\n integers, and Boolean values behave like the values 0 and 1,\n respectively, in almost all contexts, the exception being\n that when converted to a string, the strings ``"False"`` or\n ``"True"`` are returned, respectively.\n\n The rules for integer representation are intended to give the\n most meaningful interpretation of shift and mask operations\n involving negative integers and the least surprises when\n switching between the plain and long integer domains. Any\n operation, if it yields a result in the plain integer domain,\n will yield the same result in the long integer domain or when\n using mixed operands. The switch between domains is transparent\n to the programmer.\n\n ``numbers.Real`` (``float``)\n These represent machine-level double precision floating point\n numbers. You are at the mercy of the underlying machine\n architecture (and C or Java implementation) for the accepted\n range and handling of overflow. Python does not support single-\n precision floating point numbers; the savings in processor and\n memory usage that are usually the reason for using these is\n dwarfed by the overhead of using objects in Python, so there is\n no reason to complicate the language with two kinds of floating\n point numbers.\n\n ``numbers.Complex``\n These represent complex numbers as a pair of machine-level\n double precision floating point numbers. The same caveats apply\n as for floating point numbers. The real and imaginary parts of a\n complex number ``z`` can be retrieved through the read-only\n attributes ``z.real`` and ``z.imag``.\n\nSequences\n These represent finite ordered sets indexed by non-negative\n numbers. The built-in function ``len()`` returns the number of\n items of a sequence. When the length of a sequence is *n*, the\n index set contains the numbers 0, 1, ..., *n*-1. Item *i* of\n sequence *a* is selected by ``a[i]``.\n\n Sequences also support slicing: ``a[i:j]`` selects all items with\n index *k* such that *i* ``<=`` *k* ``<`` *j*. When used as an\n expression, a slice is a sequence of the same type. This implies\n that the index set is renumbered so that it starts at 0.\n\n Some sequences also support "extended slicing" with a third "step"\n parameter: ``a[i:j:k]`` selects all items of *a* with index *x*\n where ``x = i + n*k``, *n* ``>=`` ``0`` and *i* ``<=`` *x* ``<``\n *j*.\n\n Sequences are distinguished according to their mutability:\n\n Immutable sequences\n An object of an immutable sequence type cannot change once it is\n created. (If the object contains references to other objects,\n these other objects may be mutable and may be changed; however,\n the collection of objects directly referenced by an immutable\n object cannot change.)\n\n The following types are immutable sequences:\n\n Strings\n The items of a string are characters. There is no separate\n character type; a character is represented by a string of one\n item. Characters represent (at least) 8-bit bytes. The\n built-in functions ``chr()`` and ``ord()`` convert between\n characters and nonnegative integers representing the byte\n values. Bytes with the values 0-127 usually represent the\n corresponding ASCII values, but the interpretation of values\n is up to the program. The string data type is also used to\n represent arrays of bytes, e.g., to hold data read from a\n file.\n\n (On systems whose native character set is not ASCII, strings\n may use EBCDIC in their internal representation, provided the\n functions ``chr()`` and ``ord()`` implement a mapping between\n ASCII and EBCDIC, and string comparison preserves the ASCII\n order. Or perhaps someone can propose a better rule?)\n\n Unicode\n The items of a Unicode object are Unicode code units. A\n Unicode code unit is represented by a Unicode object of one\n item and can hold either a 16-bit or 32-bit value\n representing a Unicode ordinal (the maximum value for the\n ordinal is given in ``sys.maxunicode``, and depends on how\n Python is configured at compile time). Surrogate pairs may\n be present in the Unicode object, and will be reported as two\n separate items. The built-in functions ``unichr()`` and\n ``ord()`` convert between code units and nonnegative integers\n representing the Unicode ordinals as defined in the Unicode\n Standard 3.0. Conversion from and to other encodings are\n possible through the Unicode method ``encode()`` and the\n built-in function ``unicode()``.\n\n Tuples\n The items of a tuple are arbitrary Python objects. Tuples of\n two or more items are formed by comma-separated lists of\n expressions. A tuple of one item (a \'singleton\') can be\n formed by affixing a comma to an expression (an expression by\n itself does not create a tuple, since parentheses must be\n usable for grouping of expressions). An empty tuple can be\n formed by an empty pair of parentheses.\n\n Mutable sequences\n Mutable sequences can be changed after they are created. The\n subscription and slicing notations can be used as the target of\n assignment and ``del`` (delete) statements.\n\n There is currently a single intrinsic mutable sequence type:\n\n Lists\n The items of a list are arbitrary Python objects. Lists are\n formed by placing a comma-separated list of expressions in\n square brackets. (Note that there are no special cases needed\n to form lists of length 0 or 1.)\n\n The extension module ``array`` provides an additional example of\n a mutable sequence type.\n\nSet types\n These represent unordered, finite sets of unique, immutable\n objects. As such, they cannot be indexed by any subscript. However,\n they can be iterated over, and the built-in function ``len()``\n returns the number of items in a set. Common uses for sets are fast\n membership testing, removing duplicates from a sequence, and\n computing mathematical operations such as intersection, union,\n difference, and symmetric difference.\n\n For set elements, the same immutability rules apply as for\n dictionary keys. Note that numeric types obey the normal rules for\n numeric comparison: if two numbers compare equal (e.g., ``1`` and\n ``1.0``), only one of them can be contained in a set.\n\n There are currently two intrinsic set types:\n\n Sets\n These represent a mutable set. They are created by the built-in\n ``set()`` constructor and can be modified afterwards by several\n methods, such as ``add()``.\n\n Frozen sets\n These represent an immutable set. They are created by the\n built-in ``frozenset()`` constructor. As a frozenset is\n immutable and *hashable*, it can be used again as an element of\n another set, or as a dictionary key.\n\nMappings\n These represent finite sets of objects indexed by arbitrary index\n sets. The subscript notation ``a[k]`` selects the item indexed by\n ``k`` from the mapping ``a``; this can be used in expressions and\n as the target of assignments or ``del`` statements. The built-in\n function ``len()`` returns the number of items in a mapping.\n\n There is currently a single intrinsic mapping type:\n\n Dictionaries\n These represent finite sets of objects indexed by nearly\n arbitrary values. The only types of values not acceptable as\n keys are values containing lists or dictionaries or other\n mutable types that are compared by value rather than by object\n identity, the reason being that the efficient implementation of\n dictionaries requires a key\'s hash value to remain constant.\n Numeric types used for keys obey the normal rules for numeric\n comparison: if two numbers compare equal (e.g., ``1`` and\n ``1.0``) then they can be used interchangeably to index the same\n dictionary entry.\n\n Dictionaries are mutable; they can be created by the ``{...}``\n notation (see section *Dictionary displays*).\n\n The extension modules ``dbm``, ``gdbm``, and ``bsddb`` provide\n additional examples of mapping types.\n\nCallable types\n These are the types to which the function call operation (see\n section *Calls*) can be applied:\n\n User-defined functions\n A user-defined function object is created by a function\n definition (see section *Function definitions*). It should be\n called with an argument list containing the same number of items\n as the function\'s formal parameter list.\n\n Special attributes:\n\n +-------------------------+---------------------------------+-------------+\n | Attribute | Meaning | |\n +=========================+=================================+=============+\n | ``func_doc`` | The function\'s documentation | Writable |\n | | string, or ``None`` if | |\n | | unavailable | |\n +-------------------------+---------------------------------+-------------+\n | ``__doc__`` | Another way of spelling | Writable |\n | | ``func_doc`` | |\n +-------------------------+---------------------------------+-------------+\n | ``func_name`` | The function\'s name | Writable |\n +-------------------------+---------------------------------+-------------+\n | ``__name__`` | Another way of spelling | Writable |\n | | ``func_name`` | |\n +-------------------------+---------------------------------+-------------+\n | ``__module__`` | The name of the module the | Writable |\n | | function was defined in, or | |\n | | ``None`` if unavailable. | |\n +-------------------------+---------------------------------+-------------+\n | ``func_defaults`` | A tuple containing default | Writable |\n | | argument values for those | |\n | | arguments that have defaults, | |\n | | or ``None`` if no arguments | |\n | | have a default value | |\n +-------------------------+---------------------------------+-------------+\n | ``func_code`` | The code object representing | Writable |\n | | the compiled function body. | |\n +-------------------------+---------------------------------+-------------+\n | ``func_globals`` | A reference to the dictionary | Read-only |\n | | that holds the function\'s | |\n | | global variables --- the global | |\n | | namespace of the module in | |\n | | which the function was defined. | |\n +-------------------------+---------------------------------+-------------+\n | ``func_dict`` | The namespace supporting | Writable |\n | | arbitrary function attributes. | |\n +-------------------------+---------------------------------+-------------+\n | ``func_closure`` | ``None`` or a tuple of cells | Read-only |\n | | that contain bindings for the | |\n | | function\'s free variables. | |\n +-------------------------+---------------------------------+-------------+\n\n Most of the attributes labelled "Writable" check the type of the\n assigned value.\n\n Changed in version 2.4: ``func_name`` is now writable.\n\n Function objects also support getting and setting arbitrary\n attributes, which can be used, for example, to attach metadata\n to functions. Regular attribute dot-notation is used to get and\n set such attributes. *Note that the current implementation only\n supports function attributes on user-defined functions. Function\n attributes on built-in functions may be supported in the\n future.*\n\n Additional information about a function\'s definition can be\n retrieved from its code object; see the description of internal\n types below.\n\n User-defined methods\n A user-defined method object combines a class, a class instance\n (or ``None``) and any callable object (normally a user-defined\n function).\n\n Special read-only attributes: ``im_self`` is the class instance\n object, ``im_func`` is the function object; ``im_class`` is the\n class of ``im_self`` for bound methods or the class that asked\n for the method for unbound methods; ``__doc__`` is the method\'s\n documentation (same as ``im_func.__doc__``); ``__name__`` is the\n method name (same as ``im_func.__name__``); ``__module__`` is\n the name of the module the method was defined in, or ``None`` if\n unavailable.\n\n Changed in version 2.2: ``im_self`` used to refer to the class\n that defined the method.\n\n Changed in version 2.6: For 3.0 forward-compatibility,\n ``im_func`` is also available as ``__func__``, and ``im_self``\n as ``__self__``.\n\n Methods also support accessing (but not setting) the arbitrary\n function attributes on the underlying function object.\n\n User-defined method objects may be created when getting an\n attribute of a class (perhaps via an instance of that class), if\n that attribute is a user-defined function object, an unbound\n user-defined method object, or a class method object. When the\n attribute is a user-defined method object, a new method object\n is only created if the class from which it is being retrieved is\n the same as, or a derived class of, the class stored in the\n original method object; otherwise, the original method object is\n used as it is.\n\n When a user-defined method object is created by retrieving a\n user-defined function object from a class, its ``im_self``\n attribute is ``None`` and the method object is said to be\n unbound. When one is created by retrieving a user-defined\n function object from a class via one of its instances, its\n ``im_self`` attribute is the instance, and the method object is\n said to be bound. In either case, the new method\'s ``im_class``\n attribute is the class from which the retrieval takes place, and\n its ``im_func`` attribute is the original function object.\n\n When a user-defined method object is created by retrieving\n another method object from a class or instance, the behaviour is\n the same as for a function object, except that the ``im_func``\n attribute of the new instance is not the original method object\n but its ``im_func`` attribute.\n\n When a user-defined method object is created by retrieving a\n class method object from a class or instance, its ``im_self``\n attribute is the class itself (the same as the ``im_class``\n attribute), and its ``im_func`` attribute is the function object\n underlying the class method.\n\n When an unbound user-defined method object is called, the\n underlying function (``im_func``) is called, with the\n restriction that the first argument must be an instance of the\n proper class (``im_class``) or of a derived class thereof.\n\n When a bound user-defined method object is called, the\n underlying function (``im_func``) is called, inserting the class\n instance (``im_self``) in front of the argument list. For\n instance, when ``C`` is a class which contains a definition for\n a function ``f()``, and ``x`` is an instance of ``C``, calling\n ``x.f(1)`` is equivalent to calling ``C.f(x, 1)``.\n\n When a user-defined method object is derived from a class method\n object, the "class instance" stored in ``im_self`` will actually\n be the class itself, so that calling either ``x.f(1)`` or\n ``C.f(1)`` is equivalent to calling ``f(C,1)`` where ``f`` is\n the underlying function.\n\n Note that the transformation from function object to (unbound or\n bound) method object happens each time the attribute is\n retrieved from the class or instance. In some cases, a fruitful\n optimization is to assign the attribute to a local variable and\n call that local variable. Also notice that this transformation\n only happens for user-defined functions; other callable objects\n (and all non-callable objects) are retrieved without\n transformation. It is also important to note that user-defined\n functions which are attributes of a class instance are not\n converted to bound methods; this *only* happens when the\n function is an attribute of the class.\n\n Generator functions\n A function or method which uses the ``yield`` statement (see\n section *The yield statement*) is called a *generator function*.\n Such a function, when called, always returns an iterator object\n which can be used to execute the body of the function: calling\n the iterator\'s ``next()`` method will cause the function to\n execute until it provides a value using the ``yield`` statement.\n When the function executes a ``return`` statement or falls off\n the end, a ``StopIteration`` exception is raised and the\n iterator will have reached the end of the set of values to be\n returned.\n\n Built-in functions\n A built-in function object is a wrapper around a C function.\n Examples of built-in functions are ``len()`` and ``math.sin()``\n (``math`` is a standard built-in module). The number and type of\n the arguments are determined by the C function. Special read-\n only attributes: ``__doc__`` is the function\'s documentation\n string, or ``None`` if unavailable; ``__name__`` is the\n function\'s name; ``__self__`` is set to ``None`` (but see the\n next item); ``__module__`` is the name of the module the\n function was defined in or ``None`` if unavailable.\n\n Built-in methods\n This is really a different disguise of a built-in function, this\n time containing an object passed to the C function as an\n implicit extra argument. An example of a built-in method is\n ``alist.append()``, assuming *alist* is a list object. In this\n case, the special read-only attribute ``__self__`` is set to the\n object denoted by *list*.\n\n Class Types\n Class types, or "new-style classes," are callable. These\n objects normally act as factories for new instances of\n themselves, but variations are possible for class types that\n override ``__new__()``. The arguments of the call are passed to\n ``__new__()`` and, in the typical case, to ``__init__()`` to\n initialize the new instance.\n\n Classic Classes\n Class objects are described below. When a class object is\n called, a new class instance (also described below) is created\n and returned. This implies a call to the class\'s ``__init__()``\n method if it has one. Any arguments are passed on to the\n ``__init__()`` method. If there is no ``__init__()`` method,\n the class must be called without arguments.\n\n Class instances\n Class instances are described below. Class instances are\n callable only when the class has a ``__call__()`` method;\n ``x(arguments)`` is a shorthand for ``x.__call__(arguments)``.\n\nModules\n Modules are imported by the ``import`` statement (see section *The\n import statement*). A module object has a namespace implemented by\n a dictionary object (this is the dictionary referenced by the\n func_globals attribute of functions defined in the module).\n Attribute references are translated to lookups in this dictionary,\n e.g., ``m.x`` is equivalent to ``m.__dict__["x"]``. A module object\n does not contain the code object used to initialize the module\n (since it isn\'t needed once the initialization is done).\n\n Attribute assignment updates the module\'s namespace dictionary,\n e.g., ``m.x = 1`` is equivalent to ``m.__dict__["x"] = 1``.\n\n Special read-only attribute: ``__dict__`` is the module\'s namespace\n as a dictionary object.\n\n Predefined (writable) attributes: ``__name__`` is the module\'s\n name; ``__doc__`` is the module\'s documentation string, or ``None``\n if unavailable; ``__file__`` is the pathname of the file from which\n the module was loaded, if it was loaded from a file. The\n ``__file__`` attribute is not present for C modules that are\n statically linked into the interpreter; for extension modules\n loaded dynamically from a shared library, it is the pathname of the\n shared library file.\n\nClasses\n Class objects are created by class definitions (see section *Class\n definitions*). A class has a namespace implemented by a dictionary\n object. Class attribute references are translated to lookups in\n this dictionary, e.g., ``C.x`` is translated to\n ``C.__dict__["x"]``. When the attribute name is not found there,\n the attribute search continues in the base classes. The search is\n depth-first, left-to-right in the order of occurrence in the base\n class list.\n\n When a class attribute reference (for class ``C``, say) would yield\n a user-defined function object or an unbound user-defined method\n object whose associated class is either ``C`` or one of its base\n classes, it is transformed into an unbound user-defined method\n object whose ``im_class`` attribute is ``C``. When it would yield a\n class method object, it is transformed into a bound user-defined\n method object whose ``im_class`` and ``im_self`` attributes are\n both ``C``. When it would yield a static method object, it is\n transformed into the object wrapped by the static method object.\n See section *Implementing Descriptors* for another way in which\n attributes retrieved from a class may differ from those actually\n contained in its ``__dict__``.\n\n Class attribute assignments update the class\'s dictionary, never\n the dictionary of a base class.\n\n A class object can be called (see above) to yield a class instance\n (see below).\n\n Special attributes: ``__name__`` is the class name; ``__module__``\n is the module name in which the class was defined; ``__dict__`` is\n the dictionary containing the class\'s namespace; ``__bases__`` is a\n tuple (possibly empty or a singleton) containing the base classes,\n in the order of their occurrence in the base class list;\n ``__doc__`` is the class\'s documentation string, or None if\n undefined.\n\nClass instances\n A class instance is created by calling a class object (see above).\n A class instance has a namespace implemented as a dictionary which\n is the first place in which attribute references are searched.\n When an attribute is not found there, and the instance\'s class has\n an attribute by that name, the search continues with the class\n attributes. If a class attribute is found that is a user-defined\n function object or an unbound user-defined method object whose\n associated class is the class (call it ``C``) of the instance for\n which the attribute reference was initiated or one of its bases, it\n is transformed into a bound user-defined method object whose\n ``im_class`` attribute is ``C`` and whose ``im_self`` attribute is\n the instance. Static method and class method objects are also\n transformed, as if they had been retrieved from class ``C``; see\n above under "Classes". See section *Implementing Descriptors* for\n another way in which attributes of a class retrieved via its\n instances may differ from the objects actually stored in the\n class\'s ``__dict__``. If no class attribute is found, and the\n object\'s class has a ``__getattr__()`` method, that is called to\n satisfy the lookup.\n\n Attribute assignments and deletions update the instance\'s\n dictionary, never a class\'s dictionary. If the class has a\n ``__setattr__()`` or ``__delattr__()`` method, this is called\n instead of updating the instance dictionary directly.\n\n Class instances can pretend to be numbers, sequences, or mappings\n if they have methods with certain special names. See section\n *Special method names*.\n\n Special attributes: ``__dict__`` is the attribute dictionary;\n ``__class__`` is the instance\'s class.\n\nFiles\n A file object represents an open file. File objects are created by\n the ``open()`` built-in function, and also by ``os.popen()``,\n ``os.fdopen()``, and the ``makefile()`` method of socket objects\n (and perhaps by other functions or methods provided by extension\n modules). The objects ``sys.stdin``, ``sys.stdout`` and\n ``sys.stderr`` are initialized to file objects corresponding to the\n interpreter\'s standard input, output and error streams. See *File\n Objects* for complete documentation of file objects.\n\nInternal types\n A few types used internally by the interpreter are exposed to the\n user. Their definitions may change with future versions of the\n interpreter, but they are mentioned here for completeness.\n\n Code objects\n Code objects represent *byte-compiled* executable Python code,\n or *bytecode*. The difference between a code object and a\n function object is that the function object contains an explicit\n reference to the function\'s globals (the module in which it was\n defined), while a code object contains no context; also the\n default argument values are stored in the function object, not\n in the code object (because they represent values calculated at\n run-time). Unlike function objects, code objects are immutable\n and contain no references (directly or indirectly) to mutable\n objects.\n\n Special read-only attributes: ``co_name`` gives the function\n name; ``co_argcount`` is the number of positional arguments\n (including arguments with default values); ``co_nlocals`` is the\n number of local variables used by the function (including\n arguments); ``co_varnames`` is a tuple containing the names of\n the local variables (starting with the argument names);\n ``co_cellvars`` is a tuple containing the names of local\n variables that are referenced by nested functions;\n ``co_freevars`` is a tuple containing the names of free\n variables; ``co_code`` is a string representing the sequence of\n bytecode instructions; ``co_consts`` is a tuple containing the\n literals used by the bytecode; ``co_names`` is a tuple\n containing the names used by the bytecode; ``co_filename`` is\n the filename from which the code was compiled;\n ``co_firstlineno`` is the first line number of the function;\n ``co_lnotab`` is a string encoding the mapping from bytecode\n offsets to line numbers (for details see the source code of the\n interpreter); ``co_stacksize`` is the required stack size\n (including local variables); ``co_flags`` is an integer encoding\n a number of flags for the interpreter.\n\n The following flag bits are defined for ``co_flags``: bit\n ``0x04`` is set if the function uses the ``*arguments`` syntax\n to accept an arbitrary number of positional arguments; bit\n ``0x08`` is set if the function uses the ``**keywords`` syntax\n to accept arbitrary keyword arguments; bit ``0x20`` is set if\n the function is a generator.\n\n Future feature declarations (``from __future__ import\n division``) also use bits in ``co_flags`` to indicate whether a\n code object was compiled with a particular feature enabled: bit\n ``0x2000`` is set if the function was compiled with future\n division enabled; bits ``0x10`` and ``0x1000`` were used in\n earlier versions of Python.\n\n Other bits in ``co_flags`` are reserved for internal use.\n\n If a code object represents a function, the first item in\n ``co_consts`` is the documentation string of the function, or\n ``None`` if undefined.\n\n Frame objects\n Frame objects represent execution frames. They may occur in\n traceback objects (see below).\n\n Special read-only attributes: ``f_back`` is to the previous\n stack frame (towards the caller), or ``None`` if this is the\n bottom stack frame; ``f_code`` is the code object being executed\n in this frame; ``f_locals`` is the dictionary used to look up\n local variables; ``f_globals`` is used for global variables;\n ``f_builtins`` is used for built-in (intrinsic) names;\n ``f_restricted`` is a flag indicating whether the function is\n executing in restricted execution mode; ``f_lasti`` gives the\n precise instruction (this is an index into the bytecode string\n of the code object).\n\n Special writable attributes: ``f_trace``, if not ``None``, is a\n function called at the start of each source code line (this is\n used by the debugger); ``f_exc_type``, ``f_exc_value``,\n ``f_exc_traceback`` represent the last exception raised in the\n parent frame provided another exception was ever raised in the\n current frame (in all other cases they are None); ``f_lineno``\n is the current line number of the frame --- writing to this from\n within a trace function jumps to the given line (only for the\n bottom-most frame). A debugger can implement a Jump command\n (aka Set Next Statement) by writing to f_lineno.\n\n Traceback objects\n Traceback objects represent a stack trace of an exception. A\n traceback object is created when an exception occurs. When the\n search for an exception handler unwinds the execution stack, at\n each unwound level a traceback object is inserted in front of\n the current traceback. When an exception handler is entered,\n the stack trace is made available to the program. (See section\n *The try statement*.) It is accessible as ``sys.exc_traceback``,\n and also as the third item of the tuple returned by\n ``sys.exc_info()``. The latter is the preferred interface,\n since it works correctly when the program is using multiple\n threads. When the program contains no suitable handler, the\n stack trace is written (nicely formatted) to the standard error\n stream; if the interpreter is interactive, it is also made\n available to the user as ``sys.last_traceback``.\n\n Special read-only attributes: ``tb_next`` is the next level in\n the stack trace (towards the frame where the exception\n occurred), or ``None`` if there is no next level; ``tb_frame``\n points to the execution frame of the current level;\n ``tb_lineno`` gives the line number where the exception\n occurred; ``tb_lasti`` indicates the precise instruction. The\n line number and last instruction in the traceback may differ\n from the line number of its frame object if the exception\n occurred in a ``try`` statement with no matching except clause\n or with a finally clause.\n\n Slice objects\n Slice objects are used to represent slices when *extended slice\n syntax* is used. This is a slice using two colons, or multiple\n slices or ellipses separated by commas, e.g., ``a[i:j:step]``,\n ``a[i:j, k:l]``, or ``a[..., i:j]``. They are also created by\n the built-in ``slice()`` function.\n\n Special read-only attributes: ``start`` is the lower bound;\n ``stop`` is the upper bound; ``step`` is the step value; each is\n ``None`` if omitted. These attributes can have any type.\n\n Slice objects support one method:\n\n slice.indices(self, length)\n\n This method takes a single integer argument *length* and\n computes information about the extended slice that the slice\n object would describe if applied to a sequence of *length*\n items. It returns a tuple of three integers; respectively\n these are the *start* and *stop* indices and the *step* or\n stride length of the slice. Missing or out-of-bounds indices\n are handled in a manner consistent with regular slices.\n\n Added in version 2.3.\n\n Static method objects\n Static method objects provide a way of defeating the\n transformation of function objects to method objects described\n above. A static method object is a wrapper around any other\n object, usually a user-defined method object. When a static\n method object is retrieved from a class or a class instance, the\n object actually returned is the wrapped object, which is not\n subject to any further transformation. Static method objects are\n not themselves callable, although the objects they wrap usually\n are. Static method objects are created by the built-in\n ``staticmethod()`` constructor.\n\n Class method objects\n A class method object, like a static method object, is a wrapper\n around another object that alters the way in which that object\n is retrieved from classes and class instances. The behaviour of\n class method objects upon such retrieval is described above,\n under "User-defined methods". Class method objects are created\n by the built-in ``classmethod()`` constructor.\n', + 'types': u'\nThe standard type hierarchy\n***************************\n\nBelow is a list of the types that are built into Python. Extension\nmodules (written in C, Java, or other languages, depending on the\nimplementation) can define additional types. Future versions of\nPython may add types to the type hierarchy (e.g., rational numbers,\nefficiently stored arrays of integers, etc.).\n\nSome of the type descriptions below contain a paragraph listing\n\'special attributes.\' These are attributes that provide access to the\nimplementation and are not intended for general use. Their definition\nmay change in the future.\n\nNone\n This type has a single value. There is a single object with this\n value. This object is accessed through the built-in name ``None``.\n It is used to signify the absence of a value in many situations,\n e.g., it is returned from functions that don\'t explicitly return\n anything. Its truth value is false.\n\nNotImplemented\n This type has a single value. There is a single object with this\n value. This object is accessed through the built-in name\n ``NotImplemented``. Numeric methods and rich comparison methods may\n return this value if they do not implement the operation for the\n operands provided. (The interpreter will then try the reflected\n operation, or some other fallback, depending on the operator.) Its\n truth value is true.\n\nEllipsis\n This type has a single value. There is a single object with this\n value. This object is accessed through the built-in name\n ``Ellipsis``. It is used to indicate the presence of the ``...``\n syntax in a slice. Its truth value is true.\n\n``numbers.Number``\n These are created by numeric literals and returned as results by\n arithmetic operators and arithmetic built-in functions. Numeric\n objects are immutable; once created their value never changes.\n Python numbers are of course strongly related to mathematical\n numbers, but subject to the limitations of numerical representation\n in computers.\n\n Python distinguishes between integers, floating point numbers, and\n complex numbers:\n\n ``numbers.Integral``\n These represent elements from the mathematical set of integers\n (positive and negative).\n\n There are three types of integers:\n\n Plain integers\n These represent numbers in the range -2147483648 through\n 2147483647. (The range may be larger on machines with a\n larger natural word size, but not smaller.) When the result\n of an operation would fall outside this range, the result is\n normally returned as a long integer (in some cases, the\n exception ``OverflowError`` is raised instead). For the\n purpose of shift and mask operations, integers are assumed to\n have a binary, 2\'s complement notation using 32 or more bits,\n and hiding no bits from the user (i.e., all 4294967296\n different bit patterns correspond to different values).\n\n Long integers\n These represent numbers in an unlimited range, subject to\n available (virtual) memory only. For the purpose of shift\n and mask operations, a binary representation is assumed, and\n negative numbers are represented in a variant of 2\'s\n complement which gives the illusion of an infinite string of\n sign bits extending to the left.\n\n Booleans\n These represent the truth values False and True. The two\n objects representing the values False and True are the only\n Boolean objects. The Boolean type is a subtype of plain\n integers, and Boolean values behave like the values 0 and 1,\n respectively, in almost all contexts, the exception being\n that when converted to a string, the strings ``"False"`` or\n ``"True"`` are returned, respectively.\n\n The rules for integer representation are intended to give the\n most meaningful interpretation of shift and mask operations\n involving negative integers and the least surprises when\n switching between the plain and long integer domains. Any\n operation, if it yields a result in the plain integer domain,\n will yield the same result in the long integer domain or when\n using mixed operands. The switch between domains is transparent\n to the programmer.\n\n ``numbers.Real`` (``float``)\n These represent machine-level double precision floating point\n numbers. You are at the mercy of the underlying machine\n architecture (and C or Java implementation) for the accepted\n range and handling of overflow. Python does not support single-\n precision floating point numbers; the savings in processor and\n memory usage that are usually the reason for using these is\n dwarfed by the overhead of using objects in Python, so there is\n no reason to complicate the language with two kinds of floating\n point numbers.\n\n ``numbers.Complex``\n These represent complex numbers as a pair of machine-level\n double precision floating point numbers. The same caveats apply\n as for floating point numbers. The real and imaginary parts of a\n complex number ``z`` can be retrieved through the read-only\n attributes ``z.real`` and ``z.imag``.\n\nSequences\n These represent finite ordered sets indexed by non-negative\n numbers. The built-in function ``len()`` returns the number of\n items of a sequence. When the length of a sequence is *n*, the\n index set contains the numbers 0, 1, ..., *n*-1. Item *i* of\n sequence *a* is selected by ``a[i]``.\n\n Sequences also support slicing: ``a[i:j]`` selects all items with\n index *k* such that *i* ``<=`` *k* ``<`` *j*. When used as an\n expression, a slice is a sequence of the same type. This implies\n that the index set is renumbered so that it starts at 0.\n\n Some sequences also support "extended slicing" with a third "step"\n parameter: ``a[i:j:k]`` selects all items of *a* with index *x*\n where ``x = i + n*k``, *n* ``>=`` ``0`` and *i* ``<=`` *x* ``<``\n *j*.\n\n Sequences are distinguished according to their mutability:\n\n Immutable sequences\n An object of an immutable sequence type cannot change once it is\n created. (If the object contains references to other objects,\n these other objects may be mutable and may be changed; however,\n the collection of objects directly referenced by an immutable\n object cannot change.)\n\n The following types are immutable sequences:\n\n Strings\n The items of a string are characters. There is no separate\n character type; a character is represented by a string of one\n item. Characters represent (at least) 8-bit bytes. The\n built-in functions ``chr()`` and ``ord()`` convert between\n characters and nonnegative integers representing the byte\n values. Bytes with the values 0-127 usually represent the\n corresponding ASCII values, but the interpretation of values\n is up to the program. The string data type is also used to\n represent arrays of bytes, e.g., to hold data read from a\n file.\n\n (On systems whose native character set is not ASCII, strings\n may use EBCDIC in their internal representation, provided the\n functions ``chr()`` and ``ord()`` implement a mapping between\n ASCII and EBCDIC, and string comparison preserves the ASCII\n order. Or perhaps someone can propose a better rule?)\n\n Unicode\n The items of a Unicode object are Unicode code units. A\n Unicode code unit is represented by a Unicode object of one\n item and can hold either a 16-bit or 32-bit value\n representing a Unicode ordinal (the maximum value for the\n ordinal is given in ``sys.maxunicode``, and depends on how\n Python is configured at compile time). Surrogate pairs may\n be present in the Unicode object, and will be reported as two\n separate items. The built-in functions ``unichr()`` and\n ``ord()`` convert between code units and nonnegative integers\n representing the Unicode ordinals as defined in the Unicode\n Standard 3.0. Conversion from and to other encodings are\n possible through the Unicode method ``encode()`` and the\n built-in function ``unicode()``.\n\n Tuples\n The items of a tuple are arbitrary Python objects. Tuples of\n two or more items are formed by comma-separated lists of\n expressions. A tuple of one item (a \'singleton\') can be\n formed by affixing a comma to an expression (an expression by\n itself does not create a tuple, since parentheses must be\n usable for grouping of expressions). An empty tuple can be\n formed by an empty pair of parentheses.\n\n Mutable sequences\n Mutable sequences can be changed after they are created. The\n subscription and slicing notations can be used as the target of\n assignment and ``del`` (delete) statements.\n\n There is currently a single intrinsic mutable sequence type:\n\n Lists\n The items of a list are arbitrary Python objects. Lists are\n formed by placing a comma-separated list of expressions in\n square brackets. (Note that there are no special cases needed\n to form lists of length 0 or 1.)\n\n The extension module ``array`` provides an additional example of\n a mutable sequence type.\n\nSet types\n These represent unordered, finite sets of unique, immutable\n objects. As such, they cannot be indexed by any subscript. However,\n they can be iterated over, and the built-in function ``len()``\n returns the number of items in a set. Common uses for sets are fast\n membership testing, removing duplicates from a sequence, and\n computing mathematical operations such as intersection, union,\n difference, and symmetric difference.\n\n For set elements, the same immutability rules apply as for\n dictionary keys. Note that numeric types obey the normal rules for\n numeric comparison: if two numbers compare equal (e.g., ``1`` and\n ``1.0``), only one of them can be contained in a set.\n\n There are currently two intrinsic set types:\n\n Sets\n These represent a mutable set. They are created by the built-in\n ``set()`` constructor and can be modified afterwards by several\n methods, such as ``add()``.\n\n Frozen sets\n These represent an immutable set. They are created by the\n built-in ``frozenset()`` constructor. As a frozenset is\n immutable and *hashable*, it can be used again as an element of\n another set, or as a dictionary key.\n\nMappings\n These represent finite sets of objects indexed by arbitrary index\n sets. The subscript notation ``a[k]`` selects the item indexed by\n ``k`` from the mapping ``a``; this can be used in expressions and\n as the target of assignments or ``del`` statements. The built-in\n function ``len()`` returns the number of items in a mapping.\n\n There is currently a single intrinsic mapping type:\n\n Dictionaries\n These represent finite sets of objects indexed by nearly\n arbitrary values. The only types of values not acceptable as\n keys are values containing lists or dictionaries or other\n mutable types that are compared by value rather than by object\n identity, the reason being that the efficient implementation of\n dictionaries requires a key\'s hash value to remain constant.\n Numeric types used for keys obey the normal rules for numeric\n comparison: if two numbers compare equal (e.g., ``1`` and\n ``1.0``) then they can be used interchangeably to index the same\n dictionary entry.\n\n Dictionaries are mutable; they can be created by the ``{...}``\n notation (see section *Dictionary displays*).\n\n The extension modules ``dbm``, ``gdbm``, and ``bsddb`` provide\n additional examples of mapping types.\n\nCallable types\n These are the types to which the function call operation (see\n section *Calls*) can be applied:\n\n User-defined functions\n A user-defined function object is created by a function\n definition (see section *Function definitions*). It should be\n called with an argument list containing the same number of items\n as the function\'s formal parameter list.\n\n Special attributes:\n\n +-------------------------+---------------------------------+-------------+\n | Attribute | Meaning | |\n +=========================+=================================+=============+\n | ``func_doc`` | The function\'s documentation | Writable |\n | | string, or ``None`` if | |\n | | unavailable | |\n +-------------------------+---------------------------------+-------------+\n | ``__doc__`` | Another way of spelling | Writable |\n | | ``func_doc`` | |\n +-------------------------+---------------------------------+-------------+\n | ``func_name`` | The function\'s name | Writable |\n +-------------------------+---------------------------------+-------------+\n | ``__name__`` | Another way of spelling | Writable |\n | | ``func_name`` | |\n +-------------------------+---------------------------------+-------------+\n | ``__module__`` | The name of the module the | Writable |\n | | function was defined in, or | |\n | | ``None`` if unavailable. | |\n +-------------------------+---------------------------------+-------------+\n | ``func_defaults`` | A tuple containing default | Writable |\n | | argument values for those | |\n | | arguments that have defaults, | |\n | | or ``None`` if no arguments | |\n | | have a default value | |\n +-------------------------+---------------------------------+-------------+\n | ``func_code`` | The code object representing | Writable |\n | | the compiled function body. | |\n +-------------------------+---------------------------------+-------------+\n | ``func_globals`` | A reference to the dictionary | Read-only |\n | | that holds the function\'s | |\n | | global variables --- the global | |\n | | namespace of the module in | |\n | | which the function was defined. | |\n +-------------------------+---------------------------------+-------------+\n | ``func_dict`` | The namespace supporting | Writable |\n | | arbitrary function attributes. | |\n +-------------------------+---------------------------------+-------------+\n | ``func_closure`` | ``None`` or a tuple of cells | Read-only |\n | | that contain bindings for the | |\n | | function\'s free variables. | |\n +-------------------------+---------------------------------+-------------+\n\n Most of the attributes labelled "Writable" check the type of the\n assigned value.\n\n Changed in version 2.4: ``func_name`` is now writable.\n\n Function objects also support getting and setting arbitrary\n attributes, which can be used, for example, to attach metadata\n to functions. Regular attribute dot-notation is used to get and\n set such attributes. *Note that the current implementation only\n supports function attributes on user-defined functions. Function\n attributes on built-in functions may be supported in the\n future.*\n\n Additional information about a function\'s definition can be\n retrieved from its code object; see the description of internal\n types below.\n\n User-defined methods\n A user-defined method object combines a class, a class instance\n (or ``None``) and any callable object (normally a user-defined\n function).\n\n Special read-only attributes: ``im_self`` is the class instance\n object, ``im_func`` is the function object; ``im_class`` is the\n class of ``im_self`` for bound methods or the class that asked\n for the method for unbound methods; ``__doc__`` is the method\'s\n documentation (same as ``im_func.__doc__``); ``__name__`` is the\n method name (same as ``im_func.__name__``); ``__module__`` is\n the name of the module the method was defined in, or ``None`` if\n unavailable.\n\n Changed in version 2.2: ``im_self`` used to refer to the class\n that defined the method.\n\n Changed in version 2.6: For 3.0 forward-compatibility,\n ``im_func`` is also available as ``__func__``, and ``im_self``\n as ``__self__``.\n\n Methods also support accessing (but not setting) the arbitrary\n function attributes on the underlying function object.\n\n User-defined method objects may be created when getting an\n attribute of a class (perhaps via an instance of that class), if\n that attribute is a user-defined function object, an unbound\n user-defined method object, or a class method object. When the\n attribute is a user-defined method object, a new method object\n is only created if the class from which it is being retrieved is\n the same as, or a derived class of, the class stored in the\n original method object; otherwise, the original method object is\n used as it is.\n\n When a user-defined method object is created by retrieving a\n user-defined function object from a class, its ``im_self``\n attribute is ``None`` and the method object is said to be\n unbound. When one is created by retrieving a user-defined\n function object from a class via one of its instances, its\n ``im_self`` attribute is the instance, and the method object is\n said to be bound. In either case, the new method\'s ``im_class``\n attribute is the class from which the retrieval takes place, and\n its ``im_func`` attribute is the original function object.\n\n When a user-defined method object is created by retrieving\n another method object from a class or instance, the behaviour is\n the same as for a function object, except that the ``im_func``\n attribute of the new instance is not the original method object\n but its ``im_func`` attribute.\n\n When a user-defined method object is created by retrieving a\n class method object from a class or instance, its ``im_self``\n attribute is the class itself (the same as the ``im_class``\n attribute), and its ``im_func`` attribute is the function object\n underlying the class method.\n\n When an unbound user-defined method object is called, the\n underlying function (``im_func``) is called, with the\n restriction that the first argument must be an instance of the\n proper class (``im_class``) or of a derived class thereof.\n\n When a bound user-defined method object is called, the\n underlying function (``im_func``) is called, inserting the class\n instance (``im_self``) in front of the argument list. For\n instance, when ``C`` is a class which contains a definition for\n a function ``f()``, and ``x`` is an instance of ``C``, calling\n ``x.f(1)`` is equivalent to calling ``C.f(x, 1)``.\n\n When a user-defined method object is derived from a class method\n object, the "class instance" stored in ``im_self`` will actually\n be the class itself, so that calling either ``x.f(1)`` or\n ``C.f(1)`` is equivalent to calling ``f(C,1)`` where ``f`` is\n the underlying function.\n\n Note that the transformation from function object to (unbound or\n bound) method object happens each time the attribute is\n retrieved from the class or instance. In some cases, a fruitful\n optimization is to assign the attribute to a local variable and\n call that local variable. Also notice that this transformation\n only happens for user-defined functions; other callable objects\n (and all non-callable objects) are retrieved without\n transformation. It is also important to note that user-defined\n functions which are attributes of a class instance are not\n converted to bound methods; this *only* happens when the\n function is an attribute of the class.\n\n Generator functions\n A function or method which uses the ``yield`` statement (see\n section *The yield statement*) is called a *generator function*.\n Such a function, when called, always returns an iterator object\n which can be used to execute the body of the function: calling\n the iterator\'s ``next()`` method will cause the function to\n execute until it provides a value using the ``yield`` statement.\n When the function executes a ``return`` statement or falls off\n the end, a ``StopIteration`` exception is raised and the\n iterator will have reached the end of the set of values to be\n returned.\n\n Built-in functions\n A built-in function object is a wrapper around a C function.\n Examples of built-in functions are ``len()`` and ``math.sin()``\n (``math`` is a standard built-in module). The number and type of\n the arguments are determined by the C function. Special read-\n only attributes: ``__doc__`` is the function\'s documentation\n string, or ``None`` if unavailable; ``__name__`` is the\n function\'s name; ``__self__`` is set to ``None`` (but see the\n next item); ``__module__`` is the name of the module the\n function was defined in or ``None`` if unavailable.\n\n Built-in methods\n This is really a different disguise of a built-in function, this\n time containing an object passed to the C function as an\n implicit extra argument. An example of a built-in method is\n ``alist.append()``, assuming *alist* is a list object. In this\n case, the special read-only attribute ``__self__`` is set to the\n object denoted by *list*.\n\n Class Types\n Class types, or "new-style classes," are callable. These\n objects normally act as factories for new instances of\n themselves, but variations are possible for class types that\n override ``__new__()``. The arguments of the call are passed to\n ``__new__()`` and, in the typical case, to ``__init__()`` to\n initialize the new instance.\n\n Classic Classes\n Class objects are described below. When a class object is\n called, a new class instance (also described below) is created\n and returned. This implies a call to the class\'s ``__init__()``\n method if it has one. Any arguments are passed on to the\n ``__init__()`` method. If there is no ``__init__()`` method,\n the class must be called without arguments.\n\n Class instances\n Class instances are described below. Class instances are\n callable only when the class has a ``__call__()`` method;\n ``x(arguments)`` is a shorthand for ``x.__call__(arguments)``.\n\nModules\n Modules are imported by the ``import`` statement (see section *The\n import statement*). A module object has a namespace implemented by\n a dictionary object (this is the dictionary referenced by the\n func_globals attribute of functions defined in the module).\n Attribute references are translated to lookups in this dictionary,\n e.g., ``m.x`` is equivalent to ``m.__dict__["x"]``. A module object\n does not contain the code object used to initialize the module\n (since it isn\'t needed once the initialization is done).\n\n Attribute assignment updates the module\'s namespace dictionary,\n e.g., ``m.x = 1`` is equivalent to ``m.__dict__["x"] = 1``.\n\n Special read-only attribute: ``__dict__`` is the module\'s namespace\n as a dictionary object.\n\n Predefined (writable) attributes: ``__name__`` is the module\'s\n name; ``__doc__`` is the module\'s documentation string, or ``None``\n if unavailable; ``__file__`` is the pathname of the file from which\n the module was loaded, if it was loaded from a file. The\n ``__file__`` attribute is not present for C modules that are\n statically linked into the interpreter; for extension modules\n loaded dynamically from a shared library, it is the pathname of the\n shared library file.\n\nClasses\n Both class types (new-style classes) and class objects (old-\n style/classic classes) are typically created by class definitions\n (see section *Class definitions*). A class has a namespace\n implemented by a dictionary object. Class attribute references are\n translated to lookups in this dictionary, e.g., ``C.x`` is\n translated to ``C.__dict__["x"]`` (although for new-style classes\n in particular there are a number of hooks which allow for other\n means of locating attributes). When the attribute name is not found\n there, the attribute search continues in the base classes. For\n old-style classes, the search is depth-first, left-to-right in the\n order of occurrence in the base class list. New-style classes use\n the more complex C3 method resolution order which behaves correctly\n even in the presence of \'diamond\' inheritance structures where\n there are multiple inheritance paths leading back to a common\n ancestor. Additional details on the C3 MRO used by new-style\n classes can be found in the documentation accompanying the 2.3\n release at http://www.python.org/download/releases/2.3/mro/.\n\n When a class attribute reference (for class ``C``, say) would yield\n a user-defined function object or an unbound user-defined method\n object whose associated class is either ``C`` or one of its base\n classes, it is transformed into an unbound user-defined method\n object whose ``im_class`` attribute is ``C``. When it would yield a\n class method object, it is transformed into a bound user-defined\n method object whose ``im_class`` and ``im_self`` attributes are\n both ``C``. When it would yield a static method object, it is\n transformed into the object wrapped by the static method object.\n See section *Implementing Descriptors* for another way in which\n attributes retrieved from a class may differ from those actually\n contained in its ``__dict__`` (note that only new-style classes\n support descriptors).\n\n Class attribute assignments update the class\'s dictionary, never\n the dictionary of a base class.\n\n A class object can be called (see above) to yield a class instance\n (see below).\n\n Special attributes: ``__name__`` is the class name; ``__module__``\n is the module name in which the class was defined; ``__dict__`` is\n the dictionary containing the class\'s namespace; ``__bases__`` is a\n tuple (possibly empty or a singleton) containing the base classes,\n in the order of their occurrence in the base class list;\n ``__doc__`` is the class\'s documentation string, or None if\n undefined.\n\nClass instances\n A class instance is created by calling a class object (see above).\n A class instance has a namespace implemented as a dictionary which\n is the first place in which attribute references are searched.\n When an attribute is not found there, and the instance\'s class has\n an attribute by that name, the search continues with the class\n attributes. If a class attribute is found that is a user-defined\n function object or an unbound user-defined method object whose\n associated class is the class (call it ``C``) of the instance for\n which the attribute reference was initiated or one of its bases, it\n is transformed into a bound user-defined method object whose\n ``im_class`` attribute is ``C`` and whose ``im_self`` attribute is\n the instance. Static method and class method objects are also\n transformed, as if they had been retrieved from class ``C``; see\n above under "Classes". See section *Implementing Descriptors* for\n another way in which attributes of a class retrieved via its\n instances may differ from the objects actually stored in the\n class\'s ``__dict__``. If no class attribute is found, and the\n object\'s class has a ``__getattr__()`` method, that is called to\n satisfy the lookup.\n\n Attribute assignments and deletions update the instance\'s\n dictionary, never a class\'s dictionary. If the class has a\n ``__setattr__()`` or ``__delattr__()`` method, this is called\n instead of updating the instance dictionary directly.\n\n Class instances can pretend to be numbers, sequences, or mappings\n if they have methods with certain special names. See section\n *Special method names*.\n\n Special attributes: ``__dict__`` is the attribute dictionary;\n ``__class__`` is the instance\'s class.\n\nFiles\n A file object represents an open file. File objects are created by\n the ``open()`` built-in function, and also by ``os.popen()``,\n ``os.fdopen()``, and the ``makefile()`` method of socket objects\n (and perhaps by other functions or methods provided by extension\n modules). The objects ``sys.stdin``, ``sys.stdout`` and\n ``sys.stderr`` are initialized to file objects corresponding to the\n interpreter\'s standard input, output and error streams. See *File\n Objects* for complete documentation of file objects.\n\nInternal types\n A few types used internally by the interpreter are exposed to the\n user. Their definitions may change with future versions of the\n interpreter, but they are mentioned here for completeness.\n\n Code objects\n Code objects represent *byte-compiled* executable Python code,\n or *bytecode*. The difference between a code object and a\n function object is that the function object contains an explicit\n reference to the function\'s globals (the module in which it was\n defined), while a code object contains no context; also the\n default argument values are stored in the function object, not\n in the code object (because they represent values calculated at\n run-time). Unlike function objects, code objects are immutable\n and contain no references (directly or indirectly) to mutable\n objects.\n\n Special read-only attributes: ``co_name`` gives the function\n name; ``co_argcount`` is the number of positional arguments\n (including arguments with default values); ``co_nlocals`` is the\n number of local variables used by the function (including\n arguments); ``co_varnames`` is a tuple containing the names of\n the local variables (starting with the argument names);\n ``co_cellvars`` is a tuple containing the names of local\n variables that are referenced by nested functions;\n ``co_freevars`` is a tuple containing the names of free\n variables; ``co_code`` is a string representing the sequence of\n bytecode instructions; ``co_consts`` is a tuple containing the\n literals used by the bytecode; ``co_names`` is a tuple\n containing the names used by the bytecode; ``co_filename`` is\n the filename from which the code was compiled;\n ``co_firstlineno`` is the first line number of the function;\n ``co_lnotab`` is a string encoding the mapping from bytecode\n offsets to line numbers (for details see the source code of the\n interpreter); ``co_stacksize`` is the required stack size\n (including local variables); ``co_flags`` is an integer encoding\n a number of flags for the interpreter.\n\n The following flag bits are defined for ``co_flags``: bit\n ``0x04`` is set if the function uses the ``*arguments`` syntax\n to accept an arbitrary number of positional arguments; bit\n ``0x08`` is set if the function uses the ``**keywords`` syntax\n to accept arbitrary keyword arguments; bit ``0x20`` is set if\n the function is a generator.\n\n Future feature declarations (``from __future__ import\n division``) also use bits in ``co_flags`` to indicate whether a\n code object was compiled with a particular feature enabled: bit\n ``0x2000`` is set if the function was compiled with future\n division enabled; bits ``0x10`` and ``0x1000`` were used in\n earlier versions of Python.\n\n Other bits in ``co_flags`` are reserved for internal use.\n\n If a code object represents a function, the first item in\n ``co_consts`` is the documentation string of the function, or\n ``None`` if undefined.\n\n Frame objects\n Frame objects represent execution frames. They may occur in\n traceback objects (see below).\n\n Special read-only attributes: ``f_back`` is to the previous\n stack frame (towards the caller), or ``None`` if this is the\n bottom stack frame; ``f_code`` is the code object being executed\n in this frame; ``f_locals`` is the dictionary used to look up\n local variables; ``f_globals`` is used for global variables;\n ``f_builtins`` is used for built-in (intrinsic) names;\n ``f_restricted`` is a flag indicating whether the function is\n executing in restricted execution mode; ``f_lasti`` gives the\n precise instruction (this is an index into the bytecode string\n of the code object).\n\n Special writable attributes: ``f_trace``, if not ``None``, is a\n function called at the start of each source code line (this is\n used by the debugger); ``f_exc_type``, ``f_exc_value``,\n ``f_exc_traceback`` represent the last exception raised in the\n parent frame provided another exception was ever raised in the\n current frame (in all other cases they are None); ``f_lineno``\n is the current line number of the frame --- writing to this from\n within a trace function jumps to the given line (only for the\n bottom-most frame). A debugger can implement a Jump command\n (aka Set Next Statement) by writing to f_lineno.\n\n Traceback objects\n Traceback objects represent a stack trace of an exception. A\n traceback object is created when an exception occurs. When the\n search for an exception handler unwinds the execution stack, at\n each unwound level a traceback object is inserted in front of\n the current traceback. When an exception handler is entered,\n the stack trace is made available to the program. (See section\n *The try statement*.) It is accessible as ``sys.exc_traceback``,\n and also as the third item of the tuple returned by\n ``sys.exc_info()``. The latter is the preferred interface,\n since it works correctly when the program is using multiple\n threads. When the program contains no suitable handler, the\n stack trace is written (nicely formatted) to the standard error\n stream; if the interpreter is interactive, it is also made\n available to the user as ``sys.last_traceback``.\n\n Special read-only attributes: ``tb_next`` is the next level in\n the stack trace (towards the frame where the exception\n occurred), or ``None`` if there is no next level; ``tb_frame``\n points to the execution frame of the current level;\n ``tb_lineno`` gives the line number where the exception\n occurred; ``tb_lasti`` indicates the precise instruction. The\n line number and last instruction in the traceback may differ\n from the line number of its frame object if the exception\n occurred in a ``try`` statement with no matching except clause\n or with a finally clause.\n\n Slice objects\n Slice objects are used to represent slices when *extended slice\n syntax* is used. This is a slice using two colons, or multiple\n slices or ellipses separated by commas, e.g., ``a[i:j:step]``,\n ``a[i:j, k:l]``, or ``a[..., i:j]``. They are also created by\n the built-in ``slice()`` function.\n\n Special read-only attributes: ``start`` is the lower bound;\n ``stop`` is the upper bound; ``step`` is the step value; each is\n ``None`` if omitted. These attributes can have any type.\n\n Slice objects support one method:\n\n slice.indices(self, length)\n\n This method takes a single integer argument *length* and\n computes information about the extended slice that the slice\n object would describe if applied to a sequence of *length*\n items. It returns a tuple of three integers; respectively\n these are the *start* and *stop* indices and the *step* or\n stride length of the slice. Missing or out-of-bounds indices\n are handled in a manner consistent with regular slices.\n\n New in version 2.3.\n\n Static method objects\n Static method objects provide a way of defeating the\n transformation of function objects to method objects described\n above. A static method object is a wrapper around any other\n object, usually a user-defined method object. When a static\n method object is retrieved from a class or a class instance, the\n object actually returned is the wrapped object, which is not\n subject to any further transformation. Static method objects are\n not themselves callable, although the objects they wrap usually\n are. Static method objects are created by the built-in\n ``staticmethod()`` constructor.\n\n Class method objects\n A class method object, like a static method object, is a wrapper\n around another object that alters the way in which that object\n is retrieved from classes and class instances. The behaviour of\n class method objects upon such retrieval is described above,\n under "User-defined methods". Class method objects are created\n by the built-in ``classmethod()`` constructor.\n', 'typesfunctions': u'\nFunctions\n*********\n\nFunction objects are created by function definitions. The only\noperation on a function object is to call it: ``func(argument-list)``.\n\nThere are really two flavors of function objects: built-in functions\nand user-defined functions. Both support the same operation (to call\nthe function), but the implementation is different, hence the\ndifferent object types.\n\nSee *Function definitions* for more information.\n', - 'typesmapping': u'\nMapping Types --- ``dict``\n**************************\n\nA *mapping* object maps *hashable* values to arbitrary objects.\nMappings are mutable objects. There is currently only one standard\nmapping type, the *dictionary*. (For other containers see the built\nin ``list``, ``set``, and ``tuple`` classes, and the ``collections``\nmodule.)\n\nA dictionary\'s keys are *almost* arbitrary values. Values that are\nnot *hashable*, that is, values containing lists, dictionaries or\nother mutable types (that are compared by value rather than by object\nidentity) may not be used as keys. Numeric types used for keys obey\nthe normal rules for numeric comparison: if two numbers compare equal\n(such as ``1`` and ``1.0``) then they can be used interchangeably to\nindex the same dictionary entry. (Note however, that since computers\nstore floating-point numbers as approximations it is usually unwise to\nuse them as dictionary keys.)\n\nDictionaries can be created by placing a comma-separated list of\n``key: value`` pairs within braces, for example: ``{\'jack\': 4098,\n\'sjoerd\': 4127}`` or ``{4098: \'jack\', 4127: \'sjoerd\'}``, or by the\n``dict`` constructor.\n\nclass dict([arg])\n\n Return a new dictionary initialized from an optional positional\n argument or from a set of keyword arguments. If no arguments are\n given, return a new empty dictionary. If the positional argument\n *arg* is a mapping object, return a dictionary mapping the same\n keys to the same values as does the mapping object. Otherwise the\n positional argument must be a sequence, a container that supports\n iteration, or an iterator object. The elements of the argument\n must each also be of one of those kinds, and each must in turn\n contain exactly two objects. The first is used as a key in the new\n dictionary, and the second as the key\'s value. If a given key is\n seen more than once, the last value associated with it is retained\n in the new dictionary.\n\n If keyword arguments are given, the keywords themselves with their\n associated values are added as items to the dictionary. If a key is\n specified both in the positional argument and as a keyword\n argument, the value associated with the keyword is retained in the\n dictionary. For example, these all return a dictionary equal to\n ``{"one": 2, "two": 3}``:\n\n * ``dict(one=2, two=3)``\n\n * ``dict({\'one\': 2, \'two\': 3})``\n\n * ``dict(zip((\'one\', \'two\'), (2, 3)))``\n\n * ``dict([[\'two\', 3], [\'one\', 2]])``\n\n The first example only works for keys that are valid Python\n identifiers; the others work with any valid keys.\n\n Added in version 2.2.\n\n Changed in version 2.3: Support for building a dictionary from\n keyword arguments added.\n\n These are the operations that dictionaries support (and therefore,\n custom mapping types should support too):\n\n len(d)\n\n Return the number of items in the dictionary *d*.\n\n d[key]\n\n Return the item of *d* with key *key*. Raises a ``KeyError`` if\n *key* is not in the map.\n\n Added in version 2.5: If a subclass of dict defines a method\n ``__missing__()``, if the key *key* is not present, the\n ``d[key]`` operation calls that method with the key *key* as\n argument. The ``d[key]`` operation then returns or raises\n whatever is returned or raised by the ``__missing__(key)`` call\n if the key is not present. No other operations or methods invoke\n ``__missing__()``. If ``__missing__()`` is not defined,\n ``KeyError`` is raised. ``__missing__()`` must be a method; it\n cannot be an instance variable. For an example, see\n ``collections.defaultdict``.\n\n d[key] = value\n\n Set ``d[key]`` to *value*.\n\n del d[key]\n\n Remove ``d[key]`` from *d*. Raises a ``KeyError`` if *key* is\n not in the map.\n\n key in d\n\n Return ``True`` if *d* has a key *key*, else ``False``.\n\n Added in version 2.2.\n\n key not in d\n\n Equivalent to ``not key in d``.\n\n Added in version 2.2.\n\n clear()\n\n Remove all items from the dictionary.\n\n copy()\n\n Return a shallow copy of the dictionary.\n\n fromkeys(seq[, value])\n\n Create a new dictionary with keys from *seq* and values set to\n *value*.\n\n ``fromkeys()`` is a class method that returns a new dictionary.\n *value* defaults to ``None``.\n\n Added in version 2.3.\n\n get(key[, default])\n\n Return the value for *key* if *key* is in the dictionary, else\n *default*. If *default* is not given, it defaults to ``None``,\n so that this method never raises a ``KeyError``.\n\n has_key(key)\n\n ``dict.has_key(key)`` is equivalent to ``key in d``, but\n deprecated.\n\n items()\n\n Return a copy of the dictionary\'s list of ``(key, value)``\n pairs.\n\n Note: Keys and values are listed in an arbitrary order which is non-\n random, varies across Python implementations, and depends on\n the dictionary\'s history of insertions and deletions. If\n ``items()``, ``keys()``, ``values()``, ``iteritems()``,\n ``iterkeys()``, and ``itervalues()`` are called with no\n intervening modifications to the dictionary, the lists will\n directly correspond. This allows the creation of ``(value,\n key)`` pairs using ``zip()``: ``pairs = zip(d.values(),\n d.keys())``. The same relationship holds for the\n ``iterkeys()`` and ``itervalues()`` methods: ``pairs =\n zip(d.itervalues(), d.iterkeys())`` provides the same value\n for ``pairs``. Another way to create the same list is ``pairs\n = [(v, k) for (k, v) in d.iteritems()]``.\n\n iteritems()\n\n Return an iterator over the dictionary\'s ``(key, value)`` pairs.\n See the note for ``dict.items()``.\n\n Added in version 2.2.\n\n iterkeys()\n\n Return an iterator over the dictionary\'s keys. See the note for\n ``dict.items()``.\n\n Added in version 2.2.\n\n itervalues()\n\n Return an iterator over the dictionary\'s values. See the note\n for ``dict.items()``.\n\n Added in version 2.2.\n\n keys()\n\n Return a copy of the dictionary\'s list of keys. See the note\n for ``dict.items()``.\n\n pop(key[, default])\n\n If *key* is in the dictionary, remove it and return its value,\n else return *default*. If *default* is not given and *key* is\n not in the dictionary, a ``KeyError`` is raised.\n\n Added in version 2.3.\n\n popitem()\n\n Remove and return an arbitrary ``(key, value)`` pair from the\n dictionary.\n\n ``popitem()`` is useful to destructively iterate over a\n dictionary, as often used in set algorithms. If the dictionary\n is empty, calling ``popitem()`` raises a ``KeyError``.\n\n setdefault(key[, default])\n\n If *key* is in the dictionary, return its value. If not, insert\n *key* with a value of *default* and return *default*. *default*\n defaults to ``None``.\n\n update([other])\n\n Update the dictionary with the key/value pairs from *other*,\n overwriting existing keys. Return ``None``.\n\n ``update()`` accepts either another dictionary object or an\n iterable of key/value pairs (as a tuple or other iterable of\n length two). If keyword arguments are specified, the dictionary\n is then is updated with those key/value pairs: ``d.update(red=1,\n blue=2)``.\n\n Changed in version 2.4: Allowed the argument to be an iterable\n of key/value pairs and allowed keyword arguments.\n\n values()\n\n Return a copy of the dictionary\'s list of values. See the note\n for ``dict.items()``.\n', + 'typesmapping': u'\nMapping Types --- ``dict``\n**************************\n\nA *mapping* object maps *hashable* values to arbitrary objects.\nMappings are mutable objects. There is currently only one standard\nmapping type, the *dictionary*. (For other containers see the built\nin ``list``, ``set``, and ``tuple`` classes, and the ``collections``\nmodule.)\n\nA dictionary\'s keys are *almost* arbitrary values. Values that are\nnot *hashable*, that is, values containing lists, dictionaries or\nother mutable types (that are compared by value rather than by object\nidentity) may not be used as keys. Numeric types used for keys obey\nthe normal rules for numeric comparison: if two numbers compare equal\n(such as ``1`` and ``1.0``) then they can be used interchangeably to\nindex the same dictionary entry. (Note however, that since computers\nstore floating-point numbers as approximations it is usually unwise to\nuse them as dictionary keys.)\n\nDictionaries can be created by placing a comma-separated list of\n``key: value`` pairs within braces, for example: ``{\'jack\': 4098,\n\'sjoerd\': 4127}`` or ``{4098: \'jack\', 4127: \'sjoerd\'}``, or by the\n``dict`` constructor.\n\nclass dict([arg])\n\n Return a new dictionary initialized from an optional positional\n argument or from a set of keyword arguments. If no arguments are\n given, return a new empty dictionary. If the positional argument\n *arg* is a mapping object, return a dictionary mapping the same\n keys to the same values as does the mapping object. Otherwise the\n positional argument must be a sequence, a container that supports\n iteration, or an iterator object. The elements of the argument\n must each also be of one of those kinds, and each must in turn\n contain exactly two objects. The first is used as a key in the new\n dictionary, and the second as the key\'s value. If a given key is\n seen more than once, the last value associated with it is retained\n in the new dictionary.\n\n If keyword arguments are given, the keywords themselves with their\n associated values are added as items to the dictionary. If a key is\n specified both in the positional argument and as a keyword\n argument, the value associated with the keyword is retained in the\n dictionary. For example, these all return a dictionary equal to\n ``{"one": 2, "two": 3}``:\n\n * ``dict(one=2, two=3)``\n\n * ``dict({\'one\': 2, \'two\': 3})``\n\n * ``dict(zip((\'one\', \'two\'), (2, 3)))``\n\n * ``dict([[\'two\', 3], [\'one\', 2]])``\n\n The first example only works for keys that are valid Python\n identifiers; the others work with any valid keys.\n\n New in version 2.2.\n\n Changed in version 2.3: Support for building a dictionary from\n keyword arguments added.\n\n These are the operations that dictionaries support (and therefore,\n custom mapping types should support too):\n\n len(d)\n\n Return the number of items in the dictionary *d*.\n\n d[key]\n\n Return the item of *d* with key *key*. Raises a ``KeyError`` if\n *key* is not in the map.\n\n New in version 2.5: If a subclass of dict defines a method\n ``__missing__()``, if the key *key* is not present, the\n ``d[key]`` operation calls that method with the key *key* as\n argument. The ``d[key]`` operation then returns or raises\n whatever is returned or raised by the ``__missing__(key)`` call\n if the key is not present. No other operations or methods invoke\n ``__missing__()``. If ``__missing__()`` is not defined,\n ``KeyError`` is raised. ``__missing__()`` must be a method; it\n cannot be an instance variable. For an example, see\n ``collections.defaultdict``.\n\n d[key] = value\n\n Set ``d[key]`` to *value*.\n\n del d[key]\n\n Remove ``d[key]`` from *d*. Raises a ``KeyError`` if *key* is\n not in the map.\n\n key in d\n\n Return ``True`` if *d* has a key *key*, else ``False``.\n\n New in version 2.2.\n\n key not in d\n\n Equivalent to ``not key in d``.\n\n New in version 2.2.\n\n clear()\n\n Remove all items from the dictionary.\n\n copy()\n\n Return a shallow copy of the dictionary.\n\n fromkeys(seq[, value])\n\n Create a new dictionary with keys from *seq* and values set to\n *value*.\n\n ``fromkeys()`` is a class method that returns a new dictionary.\n *value* defaults to ``None``.\n\n New in version 2.3.\n\n get(key[, default])\n\n Return the value for *key* if *key* is in the dictionary, else\n *default*. If *default* is not given, it defaults to ``None``,\n so that this method never raises a ``KeyError``.\n\n has_key(key)\n\n ``dict.has_key(key)`` is equivalent to ``key in d``, but\n deprecated.\n\n items()\n\n Return a copy of the dictionary\'s list of ``(key, value)``\n pairs.\n\n Note: Keys and values are listed in an arbitrary order which is non-\n random, varies across Python implementations, and depends on\n the dictionary\'s history of insertions and deletions. If\n ``items()``, ``keys()``, ``values()``, ``iteritems()``,\n ``iterkeys()``, and ``itervalues()`` are called with no\n intervening modifications to the dictionary, the lists will\n directly correspond. This allows the creation of ``(value,\n key)`` pairs using ``zip()``: ``pairs = zip(d.values(),\n d.keys())``. The same relationship holds for the\n ``iterkeys()`` and ``itervalues()`` methods: ``pairs =\n zip(d.itervalues(), d.iterkeys())`` provides the same value\n for ``pairs``. Another way to create the same list is ``pairs\n = [(v, k) for (k, v) in d.iteritems()]``.\n\n iteritems()\n\n Return an iterator over the dictionary\'s ``(key, value)`` pairs.\n See the note for ``dict.items()``.\n\n New in version 2.2.\n\n iterkeys()\n\n Return an iterator over the dictionary\'s keys. See the note for\n ``dict.items()``.\n\n New in version 2.2.\n\n itervalues()\n\n Return an iterator over the dictionary\'s values. See the note\n for ``dict.items()``.\n\n New in version 2.2.\n\n keys()\n\n Return a copy of the dictionary\'s list of keys. See the note\n for ``dict.items()``.\n\n pop(key[, default])\n\n If *key* is in the dictionary, remove it and return its value,\n else return *default*. If *default* is not given and *key* is\n not in the dictionary, a ``KeyError`` is raised.\n\n New in version 2.3.\n\n popitem()\n\n Remove and return an arbitrary ``(key, value)`` pair from the\n dictionary.\n\n ``popitem()`` is useful to destructively iterate over a\n dictionary, as often used in set algorithms. If the dictionary\n is empty, calling ``popitem()`` raises a ``KeyError``.\n\n setdefault(key[, default])\n\n If *key* is in the dictionary, return its value. If not, insert\n *key* with a value of *default* and return *default*. *default*\n defaults to ``None``.\n\n update([other])\n\n Update the dictionary with the key/value pairs from *other*,\n overwriting existing keys. Return ``None``.\n\n ``update()`` accepts either another dictionary object or an\n iterable of key/value pairs (as a tuple or other iterable of\n length two). If keyword arguments are specified, the dictionary\n is then is updated with those key/value pairs: ``d.update(red=1,\n blue=2)``.\n\n Changed in version 2.4: Allowed the argument to be an iterable\n of key/value pairs and allowed keyword arguments.\n\n values()\n\n Return a copy of the dictionary\'s list of values. See the note\n for ``dict.items()``.\n', 'typesmethods': u"\nMethods\n*******\n\nMethods are functions that are called using the attribute notation.\nThere are two flavors: built-in methods (such as ``append()`` on\nlists) and class instance methods. Built-in methods are described\nwith the types that support them.\n\nThe implementation adds two special read-only attributes to class\ninstance methods: ``m.im_self`` is the object on which the method\noperates, and ``m.im_func`` is the function implementing the method.\nCalling ``m(arg-1, arg-2, ..., arg-n)`` is completely equivalent to\ncalling ``m.im_func(m.im_self, arg-1, arg-2, ..., arg-n)``.\n\nClass instance methods are either *bound* or *unbound*, referring to\nwhether the method was accessed through an instance or a class,\nrespectively. When a method is unbound, its ``im_self`` attribute\nwill be ``None`` and if called, an explicit ``self`` object must be\npassed as the first argument. In this case, ``self`` must be an\ninstance of the unbound method's class (or a subclass of that class),\notherwise a ``TypeError`` is raised.\n\nLike function objects, methods objects support getting arbitrary\nattributes. However, since method attributes are actually stored on\nthe underlying function object (``meth.im_func``), setting method\nattributes on either bound or unbound methods is disallowed.\nAttempting to set a method attribute results in a ``TypeError`` being\nraised. In order to set a method attribute, you need to explicitly\nset it on the underlying function object:\n\n class C:\n def method(self):\n pass\n\n c = C()\n c.method.im_func.whoami = 'my name is c'\n\nSee *The standard type hierarchy* for more information.\n", 'typesmodules': u"\nModules\n*******\n\nThe only special operation on a module is attribute access:\n``m.name``, where *m* is a module and *name* accesses a name defined\nin *m*'s symbol table. Module attributes can be assigned to. (Note\nthat the ``import`` statement is not, strictly speaking, an operation\non a module object; ``import foo`` does not require a module object\nnamed *foo* to exist, rather it requires an (external) *definition*\nfor a module named *foo* somewhere.)\n\nA special member of every module is ``__dict__``. This is the\ndictionary containing the module's symbol table. Modifying this\ndictionary will actually change the module's symbol table, but direct\nassignment to the ``__dict__`` attribute is not possible (you can\nwrite ``m.__dict__['a'] = 1``, which defines ``m.a`` to be ``1``, but\nyou can't write ``m.__dict__ = {}``). Modifying ``__dict__`` directly\nis not recommended.\n\nModules built into the interpreter are written like this: ````. If loaded from a file, they are written as\n````.\n", - 'typesseq': u'\nSequence Types --- ``str``, ``unicode``, ``list``, ``tuple``, ``buffer``, ``xrange``\n************************************************************************************\n\nThere are six sequence types: strings, Unicode strings, lists, tuples,\nbuffers, and xrange objects. (For other containers see the built in\n``dict``, ``list``, ``set``, and ``tuple`` classes, and the\n``collections`` module.)\n\nString literals are written in single or double quotes: ``\'xyzzy\'``,\n``"frobozz"``. See *String literals* for more about string literals.\nUnicode strings are much like strings, but are specified in the syntax\nusing a preceding ``\'u\'`` character: ``u\'abc\'``, ``u"def"``. In\naddition to the functionality described here, there are also string-\nspecific methods described in the *String Methods* section. Lists are\nconstructed with square brackets, separating items with commas: ``[a,\nb, c]``. Tuples are constructed by the comma operator (not within\nsquare brackets), with or without enclosing parentheses, but an empty\ntuple must have the enclosing parentheses, such as ``a, b, c`` or\n``()``. A single item tuple must have a trailing comma, such as\n``(d,)``.\n\nBuffer objects are not directly supported by Python syntax, but can be\ncreated by calling the builtin function ``buffer()``. They don\'t\nsupport concatenation or repetition.\n\nObjects of type xrange are similar to buffers in that there is no\nspecific syntax to create them, but they are created using the\n``xrange()`` function. They don\'t support slicing, concatenation or\nrepetition, and using ``in``, ``not in``, ``min()`` or ``max()`` on\nthem is inefficient.\n\nMost sequence types support the following operations. The ``in`` and\n``not in`` operations have the same priorities as the comparison\noperations. The ``+`` and ``*`` operations have the same priority as\nthe corresponding numeric operations. [3] Additional methods are\nprovided for *Mutable Sequence Types*.\n\nThis table lists the sequence operations sorted in ascending priority\n(operations in the same box have the same priority). In the table,\n*s* and *t* are sequences of the same type; *n*, *i* and *j* are\nintegers:\n\n+--------------------+----------------------------------+------------+\n| Operation | Result | Notes |\n+====================+==================================+============+\n| ``x in s`` | ``True`` if an item of *s* is | (1) |\n| | equal to *x*, else ``False`` | |\n+--------------------+----------------------------------+------------+\n| ``x not in s`` | ``False`` if an item of *s* is | (1) |\n| | equal to *x*, else ``True`` | |\n+--------------------+----------------------------------+------------+\n| ``s + t`` | the concatenation of *s* and *t* | (6) |\n+--------------------+----------------------------------+------------+\n| ``s * n, n * s`` | *n* shallow copies of *s* | (2) |\n| | concatenated | |\n+--------------------+----------------------------------+------------+\n| ``s[i]`` | *i*\'th item of *s*, origin 0 | (3) |\n+--------------------+----------------------------------+------------+\n| ``s[i:j]`` | slice of *s* from *i* to *j* | (3)(4) |\n+--------------------+----------------------------------+------------+\n| ``s[i:j:k]`` | slice of *s* from *i* to *j* | (3)(5) |\n| | with step *k* | |\n+--------------------+----------------------------------+------------+\n| ``len(s)`` | length of *s* | |\n+--------------------+----------------------------------+------------+\n| ``min(s)`` | smallest item of *s* | |\n+--------------------+----------------------------------+------------+\n| ``max(s)`` | largest item of *s* | |\n+--------------------+----------------------------------+------------+\n\nSequence types also support comparisons. In particular, tuples and\nlists are compared lexicographically by comparing corresponding\nelements. This means that to compare equal, every element must compare\nequal and the two sequences must be of the same type and have the same\nlength. (For full details see *Comparisons* in the language\nreference.)\n\nNotes:\n\n1. When *s* is a string or Unicode string object the ``in`` and ``not\n in`` operations act like a substring test. In Python versions\n before 2.3, *x* had to be a string of length 1. In Python 2.3 and\n beyond, *x* may be a string of any length.\n\n2. Values of *n* less than ``0`` are treated as ``0`` (which yields an\n empty sequence of the same type as *s*). Note also that the copies\n are shallow; nested structures are not copied. This often haunts\n new Python programmers; consider:\n\n >>> lists = [[]] * 3\n >>> lists\n [[], [], []]\n >>> lists[0].append(3)\n >>> lists\n [[3], [3], [3]]\n\n What has happened is that ``[[]]`` is a one-element list containing\n an empty list, so all three elements of ``[[]] * 3`` are (pointers\n to) this single empty list. Modifying any of the elements of\n ``lists`` modifies this single list. You can create a list of\n different lists this way:\n\n >>> lists = [[] for i in range(3)]\n >>> lists[0].append(3)\n >>> lists[1].append(5)\n >>> lists[2].append(7)\n >>> lists\n [[3], [5], [7]]\n\n3. If *i* or *j* is negative, the index is relative to the end of the\n string: ``len(s) + i`` or ``len(s) + j`` is substituted. But note\n that ``-0`` is still ``0``.\n\n4. The slice of *s* from *i* to *j* is defined as the sequence of\n items with index *k* such that ``i <= k < j``. If *i* or *j* is\n greater than ``len(s)``, use ``len(s)``. If *i* is omitted or\n ``None``, use ``0``. If *j* is omitted or ``None``, use\n ``len(s)``. If *i* is greater than or equal to *j*, the slice is\n empty.\n\n5. The slice of *s* from *i* to *j* with step *k* is defined as the\n sequence of items with index ``x = i + n*k`` such that ``0 <= n <\n (j-i)/k``. In other words, the indices are ``i``, ``i+k``,\n ``i+2*k``, ``i+3*k`` and so on, stopping when *j* is reached (but\n never including *j*). If *i* or *j* is greater than ``len(s)``,\n use ``len(s)``. If *i* or *j* are omitted or ``None``, they become\n "end" values (which end depends on the sign of *k*). Note, *k*\n cannot be zero. If *k* is ``None``, it is treated like ``1``.\n\n6. If *s* and *t* are both strings, some Python implementations such\n as CPython can usually perform an in-place optimization for\n assignments of the form ``s=s+t`` or ``s+=t``. When applicable,\n this optimization makes quadratic run-time much less likely. This\n optimization is both version and implementation dependent. For\n performance sensitive code, it is preferable to use the\n ``str.join()`` method which assures consistent linear concatenation\n performance across versions and implementations.\n\n Changed in version 2.4: Formerly, string concatenation never\n occurred in-place.\n\n\nString Methods\n==============\n\nBelow are listed the string methods which both 8-bit strings and\nUnicode objects support. Note that none of these methods take keyword\narguments.\n\nIn addition, Python\'s strings support the sequence type methods\ndescribed in the *Sequence Types --- str, unicode, list, tuple,\nbuffer, xrange* section. To output formatted strings use template\nstrings or the ``%`` operator described in the *String Formatting\nOperations* section. Also, see the ``re`` module for string functions\nbased on regular expressions.\n\nstr.capitalize()\n\n Return a copy of the string with only its first character\n capitalized.\n\n For 8-bit strings, this method is locale-dependent.\n\nstr.center(width[, fillchar])\n\n Return centered in a string of length *width*. Padding is done\n using the specified *fillchar* (default is a space).\n\n Changed in version 2.4: Support for the *fillchar* argument.\n\nstr.count(sub[, start[, end]])\n\n Return the number of occurrences of substring *sub* in the range\n [*start*, *end*]. Optional arguments *start* and *end* are\n interpreted as in slice notation.\n\nstr.decode([encoding[, errors]])\n\n Decodes the string using the codec registered for *encoding*.\n *encoding* defaults to the default string encoding. *errors* may\n be given to set a different error handling scheme. The default is\n ``\'strict\'``, meaning that encoding errors raise ``UnicodeError``.\n Other possible values are ``\'ignore\'``, ``\'replace\'`` and any other\n name registered via ``codecs.register_error()``, see section *Codec\n Base Classes*.\n\n Added in version 2.2.\n\n Changed in version 2.3: Support for other error handling schemes\n added.\n\nstr.encode([encoding[, errors]])\n\n Return an encoded version of the string. Default encoding is the\n current default string encoding. *errors* may be given to set a\n different error handling scheme. The default for *errors* is\n ``\'strict\'``, meaning that encoding errors raise a\n ``UnicodeError``. Other possible values are ``\'ignore\'``,\n ``\'replace\'``, ``\'xmlcharrefreplace\'``, ``\'backslashreplace\'`` and\n any other name registered via ``codecs.register_error()``, see\n section *Codec Base Classes*. For a list of possible encodings, see\n section *Standard Encodings*.\n\n Added in version 2.0.\n\n Changed in version 2.3: Support for ``\'xmlcharrefreplace\'`` and\n ``\'backslashreplace\'`` and other error handling schemes added.\n\nstr.endswith(suffix[, start[, end]])\n\n Return ``True`` if the string ends with the specified *suffix*,\n otherwise return ``False``. *suffix* can also be a tuple of\n suffixes to look for. With optional *start*, test beginning at\n that position. With optional *end*, stop comparing at that\n position.\n\n Changed in version 2.5: Accept tuples as *suffix*.\n\nstr.expandtabs([tabsize])\n\n Return a copy of the string where all tab characters are replaced\n by one or more spaces, depending on the current column and the\n given tab size. The column number is reset to zero after each\n newline occurring in the string. If *tabsize* is not given, a tab\n size of ``8`` characters is assumed. This doesn\'t understand other\n non-printing characters or escape sequences.\n\nstr.find(sub[, start[, end]])\n\n Return the lowest index in the string where substring *sub* is\n found, such that *sub* is contained in the range [*start*, *end*].\n Optional arguments *start* and *end* are interpreted as in slice\n notation. Return ``-1`` if *sub* is not found.\n\nstr.format(format_string, *args, **kwargs)\n\n Perform a string formatting operation. The *format_string*\n argument can contain literal text or replacement fields delimited\n by braces ``{}``. Each replacement field contains either the\n numeric index of a positional argument, or the name of a keyword\n argument. Returns a copy of *format_string* where each replacement\n field is replaced with the string value of the corresponding\n argument.\n\n >>> "The sum of 1 + 2 is {0}".format(1+2)\n \'The sum of 1 + 2 is 3\'\n\n See *Format String Syntax* for a description of the various\n formatting options that can be specified in format strings.\n\n This method of string formatting is the new standard in Python 3.0,\n and should be preferred to the ``%`` formatting described in\n *String Formatting Operations* in new code.\n\n Added in version 2.6.\n\nstr.index(sub[, start[, end]])\n\n Like ``find()``, but raise ``ValueError`` when the substring is not\n found.\n\nstr.isalnum()\n\n Return true if all characters in the string are alphanumeric and\n there is at least one character, false otherwise.\n\n For 8-bit strings, this method is locale-dependent.\n\nstr.isalpha()\n\n Return true if all characters in the string are alphabetic and\n there is at least one character, false otherwise.\n\n For 8-bit strings, this method is locale-dependent.\n\nstr.isdigit()\n\n Return true if all characters in the string are digits and there is\n at least one character, false otherwise.\n\n For 8-bit strings, this method is locale-dependent.\n\nstr.islower()\n\n Return true if all cased characters in the string are lowercase and\n there is at least one cased character, false otherwise.\n\n For 8-bit strings, this method is locale-dependent.\n\nstr.isspace()\n\n Return true if there are only whitespace characters in the string\n and there is at least one character, false otherwise.\n\n For 8-bit strings, this method is locale-dependent.\n\nstr.istitle()\n\n Return true if the string is a titlecased string and there is at\n least one character, for example uppercase characters may only\n follow uncased characters and lowercase characters only cased ones.\n Return false otherwise.\n\n For 8-bit strings, this method is locale-dependent.\n\nstr.isupper()\n\n Return true if all cased characters in the string are uppercase and\n there is at least one cased character, false otherwise.\n\n For 8-bit strings, this method is locale-dependent.\n\nstr.join(seq)\n\n Return a string which is the concatenation of the strings in the\n sequence *seq*. The separator between elements is the string\n providing this method.\n\nstr.ljust(width[, fillchar])\n\n Return the string left justified in a string of length *width*.\n Padding is done using the specified *fillchar* (default is a\n space). The original string is returned if *width* is less than\n ``len(s)``.\n\n Changed in version 2.4: Support for the *fillchar* argument.\n\nstr.lower()\n\n Return a copy of the string converted to lowercase.\n\n For 8-bit strings, this method is locale-dependent.\n\nstr.lstrip([chars])\n\n Return a copy of the string with leading characters removed. The\n *chars* argument is a string specifying the set of characters to be\n removed. If omitted or ``None``, the *chars* argument defaults to\n removing whitespace. The *chars* argument is not a prefix; rather,\n all combinations of its values are stripped:\n\n >>> \' spacious \'.lstrip()\n \'spacious \'\n >>> \'www.example.com\'.lstrip(\'cmowz.\')\n \'example.com\'\n\n Changed in version 2.2.2: Support for the *chars* argument.\n\nstr.partition(sep)\n\n Split the string at the first occurrence of *sep*, and return a\n 3-tuple containing the part before the separator, the separator\n itself, and the part after the separator. If the separator is not\n found, return a 3-tuple containing the string itself, followed by\n two empty strings.\n\n Added in version 2.5.\n\nstr.replace(old, new[, count])\n\n Return a copy of the string with all occurrences of substring *old*\n replaced by *new*. If the optional argument *count* is given, only\n the first *count* occurrences are replaced.\n\nstr.rfind(sub[, start[, end]])\n\n Return the highest index in the string where substring *sub* is\n found, such that *sub* is contained within s[start,end]. Optional\n arguments *start* and *end* are interpreted as in slice notation.\n Return ``-1`` on failure.\n\nstr.rindex(sub[, start[, end]])\n\n Like ``rfind()`` but raises ``ValueError`` when the substring *sub*\n is not found.\n\nstr.rjust(width[, fillchar])\n\n Return the string right justified in a string of length *width*.\n Padding is done using the specified *fillchar* (default is a\n space). The original string is returned if *width* is less than\n ``len(s)``.\n\n Changed in version 2.4: Support for the *fillchar* argument.\n\nstr.rpartition(sep)\n\n Split the string at the last occurrence of *sep*, and return a\n 3-tuple containing the part before the separator, the separator\n itself, and the part after the separator. If the separator is not\n found, return a 3-tuple containing two empty strings, followed by\n the string itself.\n\n Added in version 2.5.\n\nstr.rsplit([sep[, maxsplit]])\n\n Return a list of the words in the string, using *sep* as the\n delimiter string. If *maxsplit* is given, at most *maxsplit* splits\n are done, the *rightmost* ones. If *sep* is not specified or\n ``None``, any whitespace string is a separator. Except for\n splitting from the right, ``rsplit()`` behaves like ``split()``\n which is described in detail below.\n\n Added in version 2.4.\n\nstr.rstrip([chars])\n\n Return a copy of the string with trailing characters removed. The\n *chars* argument is a string specifying the set of characters to be\n removed. If omitted or ``None``, the *chars* argument defaults to\n removing whitespace. The *chars* argument is not a suffix; rather,\n all combinations of its values are stripped:\n\n >>> \' spacious \'.rstrip()\n \' spacious\'\n >>> \'mississippi\'.rstrip(\'ipz\')\n \'mississ\'\n\n Changed in version 2.2.2: Support for the *chars* argument.\n\nstr.split([sep[, maxsplit]])\n\n Return a list of the words in the string, using *sep* as the\n delimiter string. If *maxsplit* is given, at most *maxsplit*\n splits are done (thus, the list will have at most ``maxsplit+1``\n elements). If *maxsplit* is not specified, then there is no limit\n on the number of splits (all possible splits are made).\n\n If *sep* is given, consecutive delimiters are not grouped together\n and are deemed to delimit empty strings (for example,\n ``\'1,,2\'.split(\',\')`` returns ``[\'1\', \'\', \'2\']``). The *sep*\n argument may consist of multiple characters (for example,\n ``\'1<>2<>3\'.split(\'<>\')`` returns ``[\'1\', \'2\', \'3\']``). Splitting\n an empty string with a specified separator returns ``[\'\']``.\n\n If *sep* is not specified or is ``None``, a different splitting\n algorithm is applied: runs of consecutive whitespace are regarded\n as a single separator, and the result will contain no empty strings\n at the start or end if the string has leading or trailing\n whitespace. Consequently, splitting an empty string or a string\n consisting of just whitespace with a ``None`` separator returns\n ``[]``.\n\n For example, ``\' 1 2 3 \'.split()`` returns ``[\'1\', \'2\', \'3\']``,\n and ``\' 1 2 3 \'.split(None, 1)`` returns ``[\'1\', \'2 3 \']``.\n\nstr.splitlines([keepends])\n\n Return a list of the lines in the string, breaking at line\n boundaries. Line breaks are not included in the resulting list\n unless *keepends* is given and true.\n\nstr.startswith(prefix[, start[, end]])\n\n Return ``True`` if string starts with the *prefix*, otherwise\n return ``False``. *prefix* can also be a tuple of prefixes to look\n for. With optional *start*, test string beginning at that\n position. With optional *end*, stop comparing string at that\n position.\n\n Changed in version 2.5: Accept tuples as *prefix*.\n\nstr.strip([chars])\n\n Return a copy of the string with the leading and trailing\n characters removed. The *chars* argument is a string specifying the\n set of characters to be removed. If omitted or ``None``, the\n *chars* argument defaults to removing whitespace. The *chars*\n argument is not a prefix or suffix; rather, all combinations of its\n values are stripped:\n\n >>> \' spacious \'.strip()\n \'spacious\'\n >>> \'www.example.com\'.strip(\'cmowz.\')\n \'example\'\n\n Changed in version 2.2.2: Support for the *chars* argument.\n\nstr.swapcase()\n\n Return a copy of the string with uppercase characters converted to\n lowercase and vice versa.\n\n For 8-bit strings, this method is locale-dependent.\n\nstr.title()\n\n Return a titlecased version of the string: words start with\n uppercase characters, all remaining cased characters are lowercase.\n\n For 8-bit strings, this method is locale-dependent.\n\nstr.translate(table[, deletechars])\n\n Return a copy of the string where all characters occurring in the\n optional argument *deletechars* are removed, and the remaining\n characters have been mapped through the given translation table,\n which must be a string of length 256.\n\n You can use the ``maketrans()`` helper function in the ``string``\n module to create a translation table. For string objects, set the\n *table* argument to ``None`` for translations that only delete\n characters:\n\n >>> \'read this short text\'.translate(None, \'aeiou\')\n \'rd ths shrt txt\'\n\n Added in version 2.6: Support for a ``None`` *table* argument.\n\n For Unicode objects, the ``translate()`` method does not accept the\n optional *deletechars* argument. Instead, it returns a copy of the\n *s* where all characters have been mapped through the given\n translation table which must be a mapping of Unicode ordinals to\n Unicode ordinals, Unicode strings or ``None``. Unmapped characters\n are left untouched. Characters mapped to ``None`` are deleted.\n Note, a more flexible approach is to create a custom character\n mapping codec using the ``codecs`` module (see ``encodings.cp1251``\n for an example).\n\nstr.upper()\n\n Return a copy of the string converted to uppercase.\n\n For 8-bit strings, this method is locale-dependent.\n\nstr.zfill(width)\n\n Return the numeric string left filled with zeros in a string of\n length *width*. A sign prefix is handled correctly. The original\n string is returned if *width* is less than ``len(s)``.\n\n Added in version 2.2.2.\n\nThe following methods are present only on unicode objects:\n\nunicode.isnumeric()\n\n Return ``True`` if there are only numeric characters in S,\n ``False`` otherwise. Numeric characters include digit characters,\n and all characters that have the Unicode numeric value property,\n e.g. U+2155, VULGAR FRACTION ONE FIFTH.\n\nunicode.isdecimal()\n\n Return ``True`` if there are only decimal characters in S,\n ``False`` otherwise. Decimal characters include digit characters,\n and all characters that that can be used to form decimal-radix\n numbers, e.g. U+0660, ARABIC-INDIC DIGIT ZERO.\n\n\nString Formatting Operations\n============================\n\nString and Unicode objects have one unique built-in operation: the\n``%`` operator (modulo). This is also known as the string\n*formatting* or *interpolation* operator. Given ``format % values``\n(where *format* is a string or Unicode object), ``%`` conversion\nspecifications in *format* are replaced with zero or more elements of\n*values*. The effect is similar to the using ``sprintf`` in the C\nlanguage. If *format* is a Unicode object, or if any of the objects\nbeing converted using the ``%s`` conversion are Unicode objects, the\nresult will also be a Unicode object.\n\nIf *format* requires a single argument, *values* may be a single non-\ntuple object. [4] Otherwise, *values* must be a tuple with exactly\nthe number of items specified by the format string, or a single\nmapping object (for example, a dictionary).\n\nA conversion specifier contains two or more characters and has the\nfollowing components, which must occur in this order:\n\n1. The ``\'%\'`` character, which marks the start of the specifier.\n\n2. Mapping key (optional), consisting of a parenthesised sequence of\n characters (for example, ``(somename)``).\n\n3. Conversion flags (optional), which affect the result of some\n conversion types.\n\n4. Minimum field width (optional). If specified as an ``\'*\'``\n (asterisk), the actual width is read from the next element of the\n tuple in *values*, and the object to convert comes after the\n minimum field width and optional precision.\n\n5. Precision (optional), given as a ``\'.\'`` (dot) followed by the\n precision. If specified as ``\'*\'`` (an asterisk), the actual width\n is read from the next element of the tuple in *values*, and the\n value to convert comes after the precision.\n\n6. Length modifier (optional).\n\n7. Conversion type.\n\nWhen the right argument is a dictionary (or other mapping type), then\nthe formats in the string *must* include a parenthesised mapping key\ninto that dictionary inserted immediately after the ``\'%\'`` character.\nThe mapping key selects the value to be formatted from the mapping.\nFor example:\n\n>>> print \'%(language)s has %(#)03d quote types.\' % \\\n... {\'language\': "Python", "#": 2}\nPython has 002 quote types.\n\nIn this case no ``*`` specifiers may occur in a format (since they\nrequire a sequential parameter list).\n\nThe conversion flag characters are:\n\n+-----------+-----------------------------------------------------------------------+\n| Flag | Meaning |\n+===========+=======================================================================+\n| ``\'#\'`` | The value conversion will use the "alternate form" (where defined |\n| | below). |\n+-----------+-----------------------------------------------------------------------+\n| ``\'0\'`` | The conversion will be zero padded for numeric values. |\n+-----------+-----------------------------------------------------------------------+\n| ``\'-\'`` | The converted value is left adjusted (overrides the ``\'0\'`` |\n| | conversion if both are given). |\n+-----------+-----------------------------------------------------------------------+\n| ``\' \'`` | (a space) A blank should be left before a positive number (or empty |\n| | string) produced by a signed conversion. |\n+-----------+-----------------------------------------------------------------------+\n| ``\'+\'`` | A sign character (``\'+\'`` or ``\'-\'``) will precede the conversion |\n| | (overrides a "space" flag). |\n+-----------+-----------------------------------------------------------------------+\n\nA length modifier (``h``, ``l``, or ``L``) may be present, but is\nignored as it is not necessary for Python -- so e.g. ``%ld`` is\nidentical to ``%d``.\n\nThe conversion types are:\n\n+--------------+-------------------------------------------------------+---------+\n| Conversion | Meaning | Notes |\n+==============+=======================================================+=========+\n| ``\'d\'`` | Signed integer decimal. | |\n+--------------+-------------------------------------------------------+---------+\n| ``\'i\'`` | Signed integer decimal. | |\n+--------------+-------------------------------------------------------+---------+\n| ``\'o\'`` | Signed octal value. | (1) |\n+--------------+-------------------------------------------------------+---------+\n| ``\'u\'`` | Obselete type -- it is identical to ``\'d\'``. | (7) |\n+--------------+-------------------------------------------------------+---------+\n| ``\'x\'`` | Signed hexadecimal (lowercase). | (2) |\n+--------------+-------------------------------------------------------+---------+\n| ``\'X\'`` | Signed hexadecimal (uppercase). | (2) |\n+--------------+-------------------------------------------------------+---------+\n| ``\'e\'`` | Floating point exponential format (lowercase). | (3) |\n+--------------+-------------------------------------------------------+---------+\n| ``\'E\'`` | Floating point exponential format (uppercase). | (3) |\n+--------------+-------------------------------------------------------+---------+\n| ``\'f\'`` | Floating point decimal format. | (3) |\n+--------------+-------------------------------------------------------+---------+\n| ``\'F\'`` | Floating point decimal format. | (3) |\n+--------------+-------------------------------------------------------+---------+\n| ``\'g\'`` | Floating point format. Uses lowercase exponential | (4) |\n| | format if exponent is less than -4 or not less than | |\n| | precision, decimal format otherwise. | |\n+--------------+-------------------------------------------------------+---------+\n| ``\'G\'`` | Floating point format. Uses uppercase exponential | (4) |\n| | format if exponent is less than -4 or not less than | |\n| | precision, decimal format otherwise. | |\n+--------------+-------------------------------------------------------+---------+\n| ``\'c\'`` | Single character (accepts integer or single character | |\n| | string). | |\n+--------------+-------------------------------------------------------+---------+\n| ``\'r\'`` | String (converts any python object using ``repr()``). | (5) |\n+--------------+-------------------------------------------------------+---------+\n| ``\'s\'`` | String (converts any python object using ``str()``). | (6) |\n+--------------+-------------------------------------------------------+---------+\n| ``\'%\'`` | No argument is converted, results in a ``\'%\'`` | |\n| | character in the result. | |\n+--------------+-------------------------------------------------------+---------+\n\nNotes:\n\n1. The alternate form causes a leading zero (``\'0\'``) to be inserted\n between left-hand padding and the formatting of the number if the\n leading character of the result is not already a zero.\n\n2. The alternate form causes a leading ``\'0x\'`` or ``\'0X\'`` (depending\n on whether the ``\'x\'`` or ``\'X\'`` format was used) to be inserted\n between left-hand padding and the formatting of the number if the\n leading character of the result is not already a zero.\n\n3. The alternate form causes the result to always contain a decimal\n point, even if no digits follow it.\n\n The precision determines the number of digits after the decimal\n point and defaults to 6.\n\n4. The alternate form causes the result to always contain a decimal\n point, and trailing zeroes are not removed as they would otherwise\n be.\n\n The precision determines the number of significant digits before\n and after the decimal point and defaults to 6.\n\n5. The ``%r`` conversion was added in Python 2.0.\n\n The precision determines the maximal number of characters used.\n\n6. If the object or format provided is a ``unicode`` string, the\n resulting string will also be ``unicode``.\n\n The precision determines the maximal number of characters used.\n\n7. See **PEP 237**.\n\nSince Python strings have an explicit length, ``%s`` conversions do\nnot assume that ``\'\\0\'`` is the end of the string.\n\nFor safety reasons, floating point precisions are clipped to 50;\n``%f`` conversions for numbers whose absolute value is over 1e25 are\nreplaced by ``%g`` conversions. [5] All other errors raise\nexceptions.\n\nAdditional string operations are defined in standard modules\n``string`` and ``re``.\n\n\nXRange Type\n===========\n\nThe ``xrange`` type is an immutable sequence which is commonly used\nfor looping. The advantage of the ``xrange`` type is that an\n``xrange`` object will always take the same amount of memory, no\nmatter the size of the range it represents. There are no consistent\nperformance advantages.\n\nXRange objects have very little behavior: they only support indexing,\niteration, and the ``len()`` function.\n\n\nMutable Sequence Types\n======================\n\nList objects support additional operations that allow in-place\nmodification of the object. Other mutable sequence types (when added\nto the language) should also support these operations. Strings and\ntuples are immutable sequence types: such objects cannot be modified\nonce created. The following operations are defined on mutable sequence\ntypes (where *x* is an arbitrary object):\n\n+--------------------------------+----------------------------------+-----------------------+\n| Operation | Result | Notes |\n+================================+==================================+=======================+\n| ``s[i] = x`` | item *i* of *s* is replaced by | |\n| | *x* | |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s[i:j] = t`` | slice of *s* from *i* to *j* is | |\n| | replaced by the contents of the | |\n| | iterable *t* | |\n+--------------------------------+----------------------------------+-----------------------+\n| ``del s[i:j]`` | same as ``s[i:j] = []`` | |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s[i:j:k] = t`` | the elements of ``s[i:j:k]`` are | (1) |\n| | replaced by those of *t* | |\n+--------------------------------+----------------------------------+-----------------------+\n| ``del s[i:j:k]`` | removes the elements of | |\n| | ``s[i:j:k]`` from the list | |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s.append(x)`` | same as ``s[len(s):len(s)] = | (2) |\n| | [x]`` | |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s.extend(x)`` | same as ``s[len(s):len(s)] = x`` | (3) |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s.count(x)`` | return number of *i*\'s for which | |\n| | ``s[i] == x`` | |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s.index(x[, i[, j]])`` | return smallest *k* such that | (4) |\n| | ``s[k] == x`` and ``i <= k < j`` | |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s.insert(i, x)`` | same as ``s[i:i] = [x]`` | (5) |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s.pop([i])`` | same as ``x = s[i]; del s[i]; | (6) |\n| | return x`` | |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s.remove(x)`` | same as ``del s[s.index(x)]`` | (4) |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s.reverse()`` | reverses the items of *s* in | (7) |\n| | place | |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s.sort([cmp[, key[, | sort the items of *s* in place | (7)(8)(9)(10) |\n| reverse]]])`` | | |\n+--------------------------------+----------------------------------+-----------------------+\n\nNotes:\n\n1. *t* must have the same length as the slice it is replacing.\n\n2. The C implementation of Python has historically accepted multiple\n parameters and implicitly joined them into a tuple; this no longer\n works in Python 2.0. Use of this misfeature has been deprecated\n since Python 1.4.\n\n3. *x* can be any iterable object.\n\n4. Raises ``ValueError`` when *x* is not found in *s*. When a negative\n index is passed as the second or third parameter to the ``index()``\n method, the list length is added, as for slice indices. If it is\n still negative, it is truncated to zero, as for slice indices.\n\n Changed in version 2.3: Previously, ``index()`` didn\'t have\n arguments for specifying start and stop positions.\n\n5. When a negative index is passed as the first parameter to the\n ``insert()`` method, the list length is added, as for slice\n indices. If it is still negative, it is truncated to zero, as for\n slice indices.\n\n Changed in version 2.3: Previously, all negative indices were\n truncated to zero.\n\n6. The ``pop()`` method is only supported by the list and array types.\n The optional argument *i* defaults to ``-1``, so that by default\n the last item is removed and returned.\n\n7. The ``sort()`` and ``reverse()`` methods modify the list in place\n for economy of space when sorting or reversing a large list. To\n remind you that they operate by side effect, they don\'t return the\n sorted or reversed list.\n\n8. The ``sort()`` method takes optional arguments for controlling the\n comparisons.\n\n *cmp* specifies a custom comparison function of two arguments (list\n items) which should return a negative, zero or positive number\n depending on whether the first argument is considered smaller than,\n equal to, or larger than the second argument: ``cmp=lambda x,y:\n cmp(x.lower(), y.lower())``. The default value is ``None``.\n\n *key* specifies a function of one argument that is used to extract\n a comparison key from each list element: ``key=str.lower``. The\n default value is ``None``.\n\n *reverse* is a boolean value. If set to ``True``, then the list\n elements are sorted as if each comparison were reversed.\n\n In general, the *key* and *reverse* conversion processes are much\n faster than specifying an equivalent *cmp* function. This is\n because *cmp* is called multiple times for each list element while\n *key* and *reverse* touch each element only once.\n\n Changed in version 2.3: Support for ``None`` as an equivalent to\n omitting *cmp* was added.\n\n Changed in version 2.4: Support for *key* and *reverse* was added.\n\n9. Starting with Python 2.3, the ``sort()`` method is guaranteed to be\n stable. A sort is stable if it guarantees not to change the\n relative order of elements that compare equal --- this is helpful\n for sorting in multiple passes (for example, sort by department,\n then by salary grade).\n\n10. While a list is being sorted, the effect of attempting to mutate,\n or even inspect, the list is undefined. The C implementation of\n Python 2.3 and newer makes the list appear empty for the duration,\n and raises ``ValueError`` if it can detect that the list has been\n mutated during a sort.\n', + 'typesseq': u'\nSequence Types --- ``str``, ``unicode``, ``list``, ``tuple``, ``buffer``, ``xrange``\n************************************************************************************\n\nThere are six sequence types: strings, Unicode strings, lists, tuples,\nbuffers, and xrange objects. (For other containers see the built in\n``dict``, ``list``, ``set``, and ``tuple`` classes, and the\n``collections`` module.)\n\nString literals are written in single or double quotes: ``\'xyzzy\'``,\n``"frobozz"``. See *String literals* for more about string literals.\nUnicode strings are much like strings, but are specified in the syntax\nusing a preceding ``\'u\'`` character: ``u\'abc\'``, ``u"def"``. In\naddition to the functionality described here, there are also string-\nspecific methods described in the *String Methods* section. Lists are\nconstructed with square brackets, separating items with commas: ``[a,\nb, c]``. Tuples are constructed by the comma operator (not within\nsquare brackets), with or without enclosing parentheses, but an empty\ntuple must have the enclosing parentheses, such as ``a, b, c`` or\n``()``. A single item tuple must have a trailing comma, such as\n``(d,)``.\n\nBuffer objects are not directly supported by Python syntax, but can be\ncreated by calling the builtin function ``buffer()``. They don\'t\nsupport concatenation or repetition.\n\nObjects of type xrange are similar to buffers in that there is no\nspecific syntax to create them, but they are created using the\n``xrange()`` function. They don\'t support slicing, concatenation or\nrepetition, and using ``in``, ``not in``, ``min()`` or ``max()`` on\nthem is inefficient.\n\nMost sequence types support the following operations. The ``in`` and\n``not in`` operations have the same priorities as the comparison\noperations. The ``+`` and ``*`` operations have the same priority as\nthe corresponding numeric operations. [3] Additional methods are\nprovided for *Mutable Sequence Types*.\n\nThis table lists the sequence operations sorted in ascending priority\n(operations in the same box have the same priority). In the table,\n*s* and *t* are sequences of the same type; *n*, *i* and *j* are\nintegers:\n\n+--------------------+----------------------------------+------------+\n| Operation | Result | Notes |\n+====================+==================================+============+\n| ``x in s`` | ``True`` if an item of *s* is | (1) |\n| | equal to *x*, else ``False`` | |\n+--------------------+----------------------------------+------------+\n| ``x not in s`` | ``False`` if an item of *s* is | (1) |\n| | equal to *x*, else ``True`` | |\n+--------------------+----------------------------------+------------+\n| ``s + t`` | the concatenation of *s* and *t* | (6) |\n+--------------------+----------------------------------+------------+\n| ``s * n, n * s`` | *n* shallow copies of *s* | (2) |\n| | concatenated | |\n+--------------------+----------------------------------+------------+\n| ``s[i]`` | *i*\'th item of *s*, origin 0 | (3) |\n+--------------------+----------------------------------+------------+\n| ``s[i:j]`` | slice of *s* from *i* to *j* | (3)(4) |\n+--------------------+----------------------------------+------------+\n| ``s[i:j:k]`` | slice of *s* from *i* to *j* | (3)(5) |\n| | with step *k* | |\n+--------------------+----------------------------------+------------+\n| ``len(s)`` | length of *s* | |\n+--------------------+----------------------------------+------------+\n| ``min(s)`` | smallest item of *s* | |\n+--------------------+----------------------------------+------------+\n| ``max(s)`` | largest item of *s* | |\n+--------------------+----------------------------------+------------+\n\nSequence types also support comparisons. In particular, tuples and\nlists are compared lexicographically by comparing corresponding\nelements. This means that to compare equal, every element must compare\nequal and the two sequences must be of the same type and have the same\nlength. (For full details see *Comparisons* in the language\nreference.)\n\nNotes:\n\n1. When *s* is a string or Unicode string object the ``in`` and ``not\n in`` operations act like a substring test. In Python versions\n before 2.3, *x* had to be a string of length 1. In Python 2.3 and\n beyond, *x* may be a string of any length.\n\n2. Values of *n* less than ``0`` are treated as ``0`` (which yields an\n empty sequence of the same type as *s*). Note also that the copies\n are shallow; nested structures are not copied. This often haunts\n new Python programmers; consider:\n\n >>> lists = [[]] * 3\n >>> lists\n [[], [], []]\n >>> lists[0].append(3)\n >>> lists\n [[3], [3], [3]]\n\n What has happened is that ``[[]]`` is a one-element list containing\n an empty list, so all three elements of ``[[]] * 3`` are (pointers\n to) this single empty list. Modifying any of the elements of\n ``lists`` modifies this single list. You can create a list of\n different lists this way:\n\n >>> lists = [[] for i in range(3)]\n >>> lists[0].append(3)\n >>> lists[1].append(5)\n >>> lists[2].append(7)\n >>> lists\n [[3], [5], [7]]\n\n3. If *i* or *j* is negative, the index is relative to the end of the\n string: ``len(s) + i`` or ``len(s) + j`` is substituted. But note\n that ``-0`` is still ``0``.\n\n4. The slice of *s* from *i* to *j* is defined as the sequence of\n items with index *k* such that ``i <= k < j``. If *i* or *j* is\n greater than ``len(s)``, use ``len(s)``. If *i* is omitted or\n ``None``, use ``0``. If *j* is omitted or ``None``, use\n ``len(s)``. If *i* is greater than or equal to *j*, the slice is\n empty.\n\n5. The slice of *s* from *i* to *j* with step *k* is defined as the\n sequence of items with index ``x = i + n*k`` such that ``0 <= n <\n (j-i)/k``. In other words, the indices are ``i``, ``i+k``,\n ``i+2*k``, ``i+3*k`` and so on, stopping when *j* is reached (but\n never including *j*). If *i* or *j* is greater than ``len(s)``,\n use ``len(s)``. If *i* or *j* are omitted or ``None``, they become\n "end" values (which end depends on the sign of *k*). Note, *k*\n cannot be zero. If *k* is ``None``, it is treated like ``1``.\n\n6. If *s* and *t* are both strings, some Python implementations such\n as CPython can usually perform an in-place optimization for\n assignments of the form ``s=s+t`` or ``s+=t``. When applicable,\n this optimization makes quadratic run-time much less likely. This\n optimization is both version and implementation dependent. For\n performance sensitive code, it is preferable to use the\n ``str.join()`` method which assures consistent linear concatenation\n performance across versions and implementations.\n\n Changed in version 2.4: Formerly, string concatenation never\n occurred in-place.\n\n\nString Methods\n==============\n\nBelow are listed the string methods which both 8-bit strings and\nUnicode objects support. Note that none of these methods take keyword\narguments.\n\nIn addition, Python\'s strings support the sequence type methods\ndescribed in the *Sequence Types --- str, unicode, list, tuple,\nbuffer, xrange* section. To output formatted strings use template\nstrings or the ``%`` operator described in the *String Formatting\nOperations* section. Also, see the ``re`` module for string functions\nbased on regular expressions.\n\nstr.capitalize()\n\n Return a copy of the string with only its first character\n capitalized.\n\n For 8-bit strings, this method is locale-dependent.\n\nstr.center(width[, fillchar])\n\n Return centered in a string of length *width*. Padding is done\n using the specified *fillchar* (default is a space).\n\n Changed in version 2.4: Support for the *fillchar* argument.\n\nstr.count(sub[, start[, end]])\n\n Return the number of occurrences of substring *sub* in the range\n [*start*, *end*]. Optional arguments *start* and *end* are\n interpreted as in slice notation.\n\nstr.decode([encoding[, errors]])\n\n Decodes the string using the codec registered for *encoding*.\n *encoding* defaults to the default string encoding. *errors* may\n be given to set a different error handling scheme. The default is\n ``\'strict\'``, meaning that encoding errors raise ``UnicodeError``.\n Other possible values are ``\'ignore\'``, ``\'replace\'`` and any other\n name registered via ``codecs.register_error()``, see section *Codec\n Base Classes*.\n\n New in version 2.2.\n\n Changed in version 2.3: Support for other error handling schemes\n added.\n\nstr.encode([encoding[, errors]])\n\n Return an encoded version of the string. Default encoding is the\n current default string encoding. *errors* may be given to set a\n different error handling scheme. The default for *errors* is\n ``\'strict\'``, meaning that encoding errors raise a\n ``UnicodeError``. Other possible values are ``\'ignore\'``,\n ``\'replace\'``, ``\'xmlcharrefreplace\'``, ``\'backslashreplace\'`` and\n any other name registered via ``codecs.register_error()``, see\n section *Codec Base Classes*. For a list of possible encodings, see\n section *Standard Encodings*.\n\n New in version 2.0.\n\n Changed in version 2.3: Support for ``\'xmlcharrefreplace\'`` and\n ``\'backslashreplace\'`` and other error handling schemes added.\n\nstr.endswith(suffix[, start[, end]])\n\n Return ``True`` if the string ends with the specified *suffix*,\n otherwise return ``False``. *suffix* can also be a tuple of\n suffixes to look for. With optional *start*, test beginning at\n that position. With optional *end*, stop comparing at that\n position.\n\n Changed in version 2.5: Accept tuples as *suffix*.\n\nstr.expandtabs([tabsize])\n\n Return a copy of the string where all tab characters are replaced\n by one or more spaces, depending on the current column and the\n given tab size. The column number is reset to zero after each\n newline occurring in the string. If *tabsize* is not given, a tab\n size of ``8`` characters is assumed. This doesn\'t understand other\n non-printing characters or escape sequences.\n\nstr.find(sub[, start[, end]])\n\n Return the lowest index in the string where substring *sub* is\n found, such that *sub* is contained in the range [*start*, *end*].\n Optional arguments *start* and *end* are interpreted as in slice\n notation. Return ``-1`` if *sub* is not found.\n\nstr.format(format_string, *args, **kwargs)\n\n Perform a string formatting operation. The *format_string*\n argument can contain literal text or replacement fields delimited\n by braces ``{}``. Each replacement field contains either the\n numeric index of a positional argument, or the name of a keyword\n argument. Returns a copy of *format_string* where each replacement\n field is replaced with the string value of the corresponding\n argument.\n\n >>> "The sum of 1 + 2 is {0}".format(1+2)\n \'The sum of 1 + 2 is 3\'\n\n See *Format String Syntax* for a description of the various\n formatting options that can be specified in format strings.\n\n This method of string formatting is the new standard in Python 3.0,\n and should be preferred to the ``%`` formatting described in\n *String Formatting Operations* in new code.\n\n New in version 2.6.\n\nstr.index(sub[, start[, end]])\n\n Like ``find()``, but raise ``ValueError`` when the substring is not\n found.\n\nstr.isalnum()\n\n Return true if all characters in the string are alphanumeric and\n there is at least one character, false otherwise.\n\n For 8-bit strings, this method is locale-dependent.\n\nstr.isalpha()\n\n Return true if all characters in the string are alphabetic and\n there is at least one character, false otherwise.\n\n For 8-bit strings, this method is locale-dependent.\n\nstr.isdigit()\n\n Return true if all characters in the string are digits and there is\n at least one character, false otherwise.\n\n For 8-bit strings, this method is locale-dependent.\n\nstr.islower()\n\n Return true if all cased characters in the string are lowercase and\n there is at least one cased character, false otherwise.\n\n For 8-bit strings, this method is locale-dependent.\n\nstr.isspace()\n\n Return true if there are only whitespace characters in the string\n and there is at least one character, false otherwise.\n\n For 8-bit strings, this method is locale-dependent.\n\nstr.istitle()\n\n Return true if the string is a titlecased string and there is at\n least one character, for example uppercase characters may only\n follow uncased characters and lowercase characters only cased ones.\n Return false otherwise.\n\n For 8-bit strings, this method is locale-dependent.\n\nstr.isupper()\n\n Return true if all cased characters in the string are uppercase and\n there is at least one cased character, false otherwise.\n\n For 8-bit strings, this method is locale-dependent.\n\nstr.join(seq)\n\n Return a string which is the concatenation of the strings in the\n sequence *seq*. The separator between elements is the string\n providing this method.\n\nstr.ljust(width[, fillchar])\n\n Return the string left justified in a string of length *width*.\n Padding is done using the specified *fillchar* (default is a\n space). The original string is returned if *width* is less than\n ``len(s)``.\n\n Changed in version 2.4: Support for the *fillchar* argument.\n\nstr.lower()\n\n Return a copy of the string converted to lowercase.\n\n For 8-bit strings, this method is locale-dependent.\n\nstr.lstrip([chars])\n\n Return a copy of the string with leading characters removed. The\n *chars* argument is a string specifying the set of characters to be\n removed. If omitted or ``None``, the *chars* argument defaults to\n removing whitespace. The *chars* argument is not a prefix; rather,\n all combinations of its values are stripped:\n\n >>> \' spacious \'.lstrip()\n \'spacious \'\n >>> \'www.example.com\'.lstrip(\'cmowz.\')\n \'example.com\'\n\n Changed in version 2.2.2: Support for the *chars* argument.\n\nstr.partition(sep)\n\n Split the string at the first occurrence of *sep*, and return a\n 3-tuple containing the part before the separator, the separator\n itself, and the part after the separator. If the separator is not\n found, return a 3-tuple containing the string itself, followed by\n two empty strings.\n\n New in version 2.5.\n\nstr.replace(old, new[, count])\n\n Return a copy of the string with all occurrences of substring *old*\n replaced by *new*. If the optional argument *count* is given, only\n the first *count* occurrences are replaced.\n\nstr.rfind(sub[, start[, end]])\n\n Return the highest index in the string where substring *sub* is\n found, such that *sub* is contained within s[start,end]. Optional\n arguments *start* and *end* are interpreted as in slice notation.\n Return ``-1`` on failure.\n\nstr.rindex(sub[, start[, end]])\n\n Like ``rfind()`` but raises ``ValueError`` when the substring *sub*\n is not found.\n\nstr.rjust(width[, fillchar])\n\n Return the string right justified in a string of length *width*.\n Padding is done using the specified *fillchar* (default is a\n space). The original string is returned if *width* is less than\n ``len(s)``.\n\n Changed in version 2.4: Support for the *fillchar* argument.\n\nstr.rpartition(sep)\n\n Split the string at the last occurrence of *sep*, and return a\n 3-tuple containing the part before the separator, the separator\n itself, and the part after the separator. If the separator is not\n found, return a 3-tuple containing two empty strings, followed by\n the string itself.\n\n New in version 2.5.\n\nstr.rsplit([sep[, maxsplit]])\n\n Return a list of the words in the string, using *sep* as the\n delimiter string. If *maxsplit* is given, at most *maxsplit* splits\n are done, the *rightmost* ones. If *sep* is not specified or\n ``None``, any whitespace string is a separator. Except for\n splitting from the right, ``rsplit()`` behaves like ``split()``\n which is described in detail below.\n\n New in version 2.4.\n\nstr.rstrip([chars])\n\n Return a copy of the string with trailing characters removed. The\n *chars* argument is a string specifying the set of characters to be\n removed. If omitted or ``None``, the *chars* argument defaults to\n removing whitespace. The *chars* argument is not a suffix; rather,\n all combinations of its values are stripped:\n\n >>> \' spacious \'.rstrip()\n \' spacious\'\n >>> \'mississippi\'.rstrip(\'ipz\')\n \'mississ\'\n\n Changed in version 2.2.2: Support for the *chars* argument.\n\nstr.split([sep[, maxsplit]])\n\n Return a list of the words in the string, using *sep* as the\n delimiter string. If *maxsplit* is given, at most *maxsplit*\n splits are done (thus, the list will have at most ``maxsplit+1``\n elements). If *maxsplit* is not specified, then there is no limit\n on the number of splits (all possible splits are made).\n\n If *sep* is given, consecutive delimiters are not grouped together\n and are deemed to delimit empty strings (for example,\n ``\'1,,2\'.split(\',\')`` returns ``[\'1\', \'\', \'2\']``). The *sep*\n argument may consist of multiple characters (for example,\n ``\'1<>2<>3\'.split(\'<>\')`` returns ``[\'1\', \'2\', \'3\']``). Splitting\n an empty string with a specified separator returns ``[\'\']``.\n\n If *sep* is not specified or is ``None``, a different splitting\n algorithm is applied: runs of consecutive whitespace are regarded\n as a single separator, and the result will contain no empty strings\n at the start or end if the string has leading or trailing\n whitespace. Consequently, splitting an empty string or a string\n consisting of just whitespace with a ``None`` separator returns\n ``[]``.\n\n For example, ``\' 1 2 3 \'.split()`` returns ``[\'1\', \'2\', \'3\']``,\n and ``\' 1 2 3 \'.split(None, 1)`` returns ``[\'1\', \'2 3 \']``.\n\nstr.splitlines([keepends])\n\n Return a list of the lines in the string, breaking at line\n boundaries. Line breaks are not included in the resulting list\n unless *keepends* is given and true.\n\nstr.startswith(prefix[, start[, end]])\n\n Return ``True`` if string starts with the *prefix*, otherwise\n return ``False``. *prefix* can also be a tuple of prefixes to look\n for. With optional *start*, test string beginning at that\n position. With optional *end*, stop comparing string at that\n position.\n\n Changed in version 2.5: Accept tuples as *prefix*.\n\nstr.strip([chars])\n\n Return a copy of the string with the leading and trailing\n characters removed. The *chars* argument is a string specifying the\n set of characters to be removed. If omitted or ``None``, the\n *chars* argument defaults to removing whitespace. The *chars*\n argument is not a prefix or suffix; rather, all combinations of its\n values are stripped:\n\n >>> \' spacious \'.strip()\n \'spacious\'\n >>> \'www.example.com\'.strip(\'cmowz.\')\n \'example\'\n\n Changed in version 2.2.2: Support for the *chars* argument.\n\nstr.swapcase()\n\n Return a copy of the string with uppercase characters converted to\n lowercase and vice versa.\n\n For 8-bit strings, this method is locale-dependent.\n\nstr.title()\n\n Return a titlecased version of the string: words start with\n uppercase characters, all remaining cased characters are lowercase.\n\n For 8-bit strings, this method is locale-dependent.\n\nstr.translate(table[, deletechars])\n\n Return a copy of the string where all characters occurring in the\n optional argument *deletechars* are removed, and the remaining\n characters have been mapped through the given translation table,\n which must be a string of length 256.\n\n You can use the ``maketrans()`` helper function in the ``string``\n module to create a translation table. For string objects, set the\n *table* argument to ``None`` for translations that only delete\n characters:\n\n >>> \'read this short text\'.translate(None, \'aeiou\')\n \'rd ths shrt txt\'\n\n New in version 2.6: Support for a ``None`` *table* argument.\n\n For Unicode objects, the ``translate()`` method does not accept the\n optional *deletechars* argument. Instead, it returns a copy of the\n *s* where all characters have been mapped through the given\n translation table which must be a mapping of Unicode ordinals to\n Unicode ordinals, Unicode strings or ``None``. Unmapped characters\n are left untouched. Characters mapped to ``None`` are deleted.\n Note, a more flexible approach is to create a custom character\n mapping codec using the ``codecs`` module (see ``encodings.cp1251``\n for an example).\n\nstr.upper()\n\n Return a copy of the string converted to uppercase.\n\n For 8-bit strings, this method is locale-dependent.\n\nstr.zfill(width)\n\n Return the numeric string left filled with zeros in a string of\n length *width*. A sign prefix is handled correctly. The original\n string is returned if *width* is less than ``len(s)``.\n\n New in version 2.2.2.\n\nThe following methods are present only on unicode objects:\n\nunicode.isnumeric()\n\n Return ``True`` if there are only numeric characters in S,\n ``False`` otherwise. Numeric characters include digit characters,\n and all characters that have the Unicode numeric value property,\n e.g. U+2155, VULGAR FRACTION ONE FIFTH.\n\nunicode.isdecimal()\n\n Return ``True`` if there are only decimal characters in S,\n ``False`` otherwise. Decimal characters include digit characters,\n and all characters that that can be used to form decimal-radix\n numbers, e.g. U+0660, ARABIC-INDIC DIGIT ZERO.\n\n\nString Formatting Operations\n============================\n\nString and Unicode objects have one unique built-in operation: the\n``%`` operator (modulo). This is also known as the string\n*formatting* or *interpolation* operator. Given ``format % values``\n(where *format* is a string or Unicode object), ``%`` conversion\nspecifications in *format* are replaced with zero or more elements of\n*values*. The effect is similar to the using ``sprintf`` in the C\nlanguage. If *format* is a Unicode object, or if any of the objects\nbeing converted using the ``%s`` conversion are Unicode objects, the\nresult will also be a Unicode object.\n\nIf *format* requires a single argument, *values* may be a single non-\ntuple object. [4] Otherwise, *values* must be a tuple with exactly\nthe number of items specified by the format string, or a single\nmapping object (for example, a dictionary).\n\nA conversion specifier contains two or more characters and has the\nfollowing components, which must occur in this order:\n\n1. The ``\'%\'`` character, which marks the start of the specifier.\n\n2. Mapping key (optional), consisting of a parenthesised sequence of\n characters (for example, ``(somename)``).\n\n3. Conversion flags (optional), which affect the result of some\n conversion types.\n\n4. Minimum field width (optional). If specified as an ``\'*\'``\n (asterisk), the actual width is read from the next element of the\n tuple in *values*, and the object to convert comes after the\n minimum field width and optional precision.\n\n5. Precision (optional), given as a ``\'.\'`` (dot) followed by the\n precision. If specified as ``\'*\'`` (an asterisk), the actual width\n is read from the next element of the tuple in *values*, and the\n value to convert comes after the precision.\n\n6. Length modifier (optional).\n\n7. Conversion type.\n\nWhen the right argument is a dictionary (or other mapping type), then\nthe formats in the string *must* include a parenthesised mapping key\ninto that dictionary inserted immediately after the ``\'%\'`` character.\nThe mapping key selects the value to be formatted from the mapping.\nFor example:\n\n>>> print \'%(language)s has %(#)03d quote types.\' % \\\n... {\'language\': "Python", "#": 2}\nPython has 002 quote types.\n\nIn this case no ``*`` specifiers may occur in a format (since they\nrequire a sequential parameter list).\n\nThe conversion flag characters are:\n\n+-----------+-----------------------------------------------------------------------+\n| Flag | Meaning |\n+===========+=======================================================================+\n| ``\'#\'`` | The value conversion will use the "alternate form" (where defined |\n| | below). |\n+-----------+-----------------------------------------------------------------------+\n| ``\'0\'`` | The conversion will be zero padded for numeric values. |\n+-----------+-----------------------------------------------------------------------+\n| ``\'-\'`` | The converted value is left adjusted (overrides the ``\'0\'`` |\n| | conversion if both are given). |\n+-----------+-----------------------------------------------------------------------+\n| ``\' \'`` | (a space) A blank should be left before a positive number (or empty |\n| | string) produced by a signed conversion. |\n+-----------+-----------------------------------------------------------------------+\n| ``\'+\'`` | A sign character (``\'+\'`` or ``\'-\'``) will precede the conversion |\n| | (overrides a "space" flag). |\n+-----------+-----------------------------------------------------------------------+\n\nA length modifier (``h``, ``l``, or ``L``) may be present, but is\nignored as it is not necessary for Python -- so e.g. ``%ld`` is\nidentical to ``%d``.\n\nThe conversion types are:\n\n+--------------+-------------------------------------------------------+---------+\n| Conversion | Meaning | Notes |\n+==============+=======================================================+=========+\n| ``\'d\'`` | Signed integer decimal. | |\n+--------------+-------------------------------------------------------+---------+\n| ``\'i\'`` | Signed integer decimal. | |\n+--------------+-------------------------------------------------------+---------+\n| ``\'o\'`` | Signed octal value. | (1) |\n+--------------+-------------------------------------------------------+---------+\n| ``\'u\'`` | Obselete type -- it is identical to ``\'d\'``. | (7) |\n+--------------+-------------------------------------------------------+---------+\n| ``\'x\'`` | Signed hexadecimal (lowercase). | (2) |\n+--------------+-------------------------------------------------------+---------+\n| ``\'X\'`` | Signed hexadecimal (uppercase). | (2) |\n+--------------+-------------------------------------------------------+---------+\n| ``\'e\'`` | Floating point exponential format (lowercase). | (3) |\n+--------------+-------------------------------------------------------+---------+\n| ``\'E\'`` | Floating point exponential format (uppercase). | (3) |\n+--------------+-------------------------------------------------------+---------+\n| ``\'f\'`` | Floating point decimal format. | (3) |\n+--------------+-------------------------------------------------------+---------+\n| ``\'F\'`` | Floating point decimal format. | (3) |\n+--------------+-------------------------------------------------------+---------+\n| ``\'g\'`` | Floating point format. Uses lowercase exponential | (4) |\n| | format if exponent is less than -4 or not less than | |\n| | precision, decimal format otherwise. | |\n+--------------+-------------------------------------------------------+---------+\n| ``\'G\'`` | Floating point format. Uses uppercase exponential | (4) |\n| | format if exponent is less than -4 or not less than | |\n| | precision, decimal format otherwise. | |\n+--------------+-------------------------------------------------------+---------+\n| ``\'c\'`` | Single character (accepts integer or single character | |\n| | string). | |\n+--------------+-------------------------------------------------------+---------+\n| ``\'r\'`` | String (converts any python object using ``repr()``). | (5) |\n+--------------+-------------------------------------------------------+---------+\n| ``\'s\'`` | String (converts any python object using ``str()``). | (6) |\n+--------------+-------------------------------------------------------+---------+\n| ``\'%\'`` | No argument is converted, results in a ``\'%\'`` | |\n| | character in the result. | |\n+--------------+-------------------------------------------------------+---------+\n\nNotes:\n\n1. The alternate form causes a leading zero (``\'0\'``) to be inserted\n between left-hand padding and the formatting of the number if the\n leading character of the result is not already a zero.\n\n2. The alternate form causes a leading ``\'0x\'`` or ``\'0X\'`` (depending\n on whether the ``\'x\'`` or ``\'X\'`` format was used) to be inserted\n between left-hand padding and the formatting of the number if the\n leading character of the result is not already a zero.\n\n3. The alternate form causes the result to always contain a decimal\n point, even if no digits follow it.\n\n The precision determines the number of digits after the decimal\n point and defaults to 6.\n\n4. The alternate form causes the result to always contain a decimal\n point, and trailing zeroes are not removed as they would otherwise\n be.\n\n The precision determines the number of significant digits before\n and after the decimal point and defaults to 6.\n\n5. The ``%r`` conversion was added in Python 2.0.\n\n The precision determines the maximal number of characters used.\n\n6. If the object or format provided is a ``unicode`` string, the\n resulting string will also be ``unicode``.\n\n The precision determines the maximal number of characters used.\n\n7. See **PEP 237**.\n\nSince Python strings have an explicit length, ``%s`` conversions do\nnot assume that ``\'\\0\'`` is the end of the string.\n\nFor safety reasons, floating point precisions are clipped to 50;\n``%f`` conversions for numbers whose absolute value is over 1e25 are\nreplaced by ``%g`` conversions. [5] All other errors raise\nexceptions.\n\nAdditional string operations are defined in standard modules\n``string`` and ``re``.\n\n\nXRange Type\n===========\n\nThe ``xrange`` type is an immutable sequence which is commonly used\nfor looping. The advantage of the ``xrange`` type is that an\n``xrange`` object will always take the same amount of memory, no\nmatter the size of the range it represents. There are no consistent\nperformance advantages.\n\nXRange objects have very little behavior: they only support indexing,\niteration, and the ``len()`` function.\n\n\nMutable Sequence Types\n======================\n\nList objects support additional operations that allow in-place\nmodification of the object. Other mutable sequence types (when added\nto the language) should also support these operations. Strings and\ntuples are immutable sequence types: such objects cannot be modified\nonce created. The following operations are defined on mutable sequence\ntypes (where *x* is an arbitrary object):\n\n+--------------------------------+----------------------------------+-----------------------+\n| Operation | Result | Notes |\n+================================+==================================+=======================+\n| ``s[i] = x`` | item *i* of *s* is replaced by | |\n| | *x* | |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s[i:j] = t`` | slice of *s* from *i* to *j* is | |\n| | replaced by the contents of the | |\n| | iterable *t* | |\n+--------------------------------+----------------------------------+-----------------------+\n| ``del s[i:j]`` | same as ``s[i:j] = []`` | |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s[i:j:k] = t`` | the elements of ``s[i:j:k]`` are | (1) |\n| | replaced by those of *t* | |\n+--------------------------------+----------------------------------+-----------------------+\n| ``del s[i:j:k]`` | removes the elements of | |\n| | ``s[i:j:k]`` from the list | |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s.append(x)`` | same as ``s[len(s):len(s)] = | (2) |\n| | [x]`` | |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s.extend(x)`` | same as ``s[len(s):len(s)] = x`` | (3) |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s.count(x)`` | return number of *i*\'s for which | |\n| | ``s[i] == x`` | |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s.index(x[, i[, j]])`` | return smallest *k* such that | (4) |\n| | ``s[k] == x`` and ``i <= k < j`` | |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s.insert(i, x)`` | same as ``s[i:i] = [x]`` | (5) |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s.pop([i])`` | same as ``x = s[i]; del s[i]; | (6) |\n| | return x`` | |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s.remove(x)`` | same as ``del s[s.index(x)]`` | (4) |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s.reverse()`` | reverses the items of *s* in | (7) |\n| | place | |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s.sort([cmp[, key[, | sort the items of *s* in place | (7)(8)(9)(10) |\n| reverse]]])`` | | |\n+--------------------------------+----------------------------------+-----------------------+\n\nNotes:\n\n1. *t* must have the same length as the slice it is replacing.\n\n2. The C implementation of Python has historically accepted multiple\n parameters and implicitly joined them into a tuple; this no longer\n works in Python 2.0. Use of this misfeature has been deprecated\n since Python 1.4.\n\n3. *x* can be any iterable object.\n\n4. Raises ``ValueError`` when *x* is not found in *s*. When a negative\n index is passed as the second or third parameter to the ``index()``\n method, the list length is added, as for slice indices. If it is\n still negative, it is truncated to zero, as for slice indices.\n\n Changed in version 2.3: Previously, ``index()`` didn\'t have\n arguments for specifying start and stop positions.\n\n5. When a negative index is passed as the first parameter to the\n ``insert()`` method, the list length is added, as for slice\n indices. If it is still negative, it is truncated to zero, as for\n slice indices.\n\n Changed in version 2.3: Previously, all negative indices were\n truncated to zero.\n\n6. The ``pop()`` method is only supported by the list and array types.\n The optional argument *i* defaults to ``-1``, so that by default\n the last item is removed and returned.\n\n7. The ``sort()`` and ``reverse()`` methods modify the list in place\n for economy of space when sorting or reversing a large list. To\n remind you that they operate by side effect, they don\'t return the\n sorted or reversed list.\n\n8. The ``sort()`` method takes optional arguments for controlling the\n comparisons.\n\n *cmp* specifies a custom comparison function of two arguments (list\n items) which should return a negative, zero or positive number\n depending on whether the first argument is considered smaller than,\n equal to, or larger than the second argument: ``cmp=lambda x,y:\n cmp(x.lower(), y.lower())``. The default value is ``None``.\n\n *key* specifies a function of one argument that is used to extract\n a comparison key from each list element: ``key=str.lower``. The\n default value is ``None``.\n\n *reverse* is a boolean value. If set to ``True``, then the list\n elements are sorted as if each comparison were reversed.\n\n In general, the *key* and *reverse* conversion processes are much\n faster than specifying an equivalent *cmp* function. This is\n because *cmp* is called multiple times for each list element while\n *key* and *reverse* touch each element only once.\n\n Changed in version 2.3: Support for ``None`` as an equivalent to\n omitting *cmp* was added.\n\n Changed in version 2.4: Support for *key* and *reverse* was added.\n\n9. Starting with Python 2.3, the ``sort()`` method is guaranteed to be\n stable. A sort is stable if it guarantees not to change the\n relative order of elements that compare equal --- this is helpful\n for sorting in multiple passes (for example, sort by department,\n then by salary grade).\n\n10. While a list is being sorted, the effect of attempting to mutate,\n or even inspect, the list is undefined. The C implementation of\n Python 2.3 and newer makes the list appear empty for the duration,\n and raises ``ValueError`` if it can detect that the list has been\n mutated during a sort.\n', 'typesseq-mutable': u"\nMutable Sequence Types\n**********************\n\nList objects support additional operations that allow in-place\nmodification of the object. Other mutable sequence types (when added\nto the language) should also support these operations. Strings and\ntuples are immutable sequence types: such objects cannot be modified\nonce created. The following operations are defined on mutable sequence\ntypes (where *x* is an arbitrary object):\n\n+--------------------------------+----------------------------------+-----------------------+\n| Operation | Result | Notes |\n+================================+==================================+=======================+\n| ``s[i] = x`` | item *i* of *s* is replaced by | |\n| | *x* | |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s[i:j] = t`` | slice of *s* from *i* to *j* is | |\n| | replaced by the contents of the | |\n| | iterable *t* | |\n+--------------------------------+----------------------------------+-----------------------+\n| ``del s[i:j]`` | same as ``s[i:j] = []`` | |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s[i:j:k] = t`` | the elements of ``s[i:j:k]`` are | (1) |\n| | replaced by those of *t* | |\n+--------------------------------+----------------------------------+-----------------------+\n| ``del s[i:j:k]`` | removes the elements of | |\n| | ``s[i:j:k]`` from the list | |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s.append(x)`` | same as ``s[len(s):len(s)] = | (2) |\n| | [x]`` | |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s.extend(x)`` | same as ``s[len(s):len(s)] = x`` | (3) |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s.count(x)`` | return number of *i*'s for which | |\n| | ``s[i] == x`` | |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s.index(x[, i[, j]])`` | return smallest *k* such that | (4) |\n| | ``s[k] == x`` and ``i <= k < j`` | |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s.insert(i, x)`` | same as ``s[i:i] = [x]`` | (5) |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s.pop([i])`` | same as ``x = s[i]; del s[i]; | (6) |\n| | return x`` | |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s.remove(x)`` | same as ``del s[s.index(x)]`` | (4) |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s.reverse()`` | reverses the items of *s* in | (7) |\n| | place | |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s.sort([cmp[, key[, | sort the items of *s* in place | (7)(8)(9)(10) |\n| reverse]]])`` | | |\n+--------------------------------+----------------------------------+-----------------------+\n\nNotes:\n\n1. *t* must have the same length as the slice it is replacing.\n\n2. The C implementation of Python has historically accepted multiple\n parameters and implicitly joined them into a tuple; this no longer\n works in Python 2.0. Use of this misfeature has been deprecated\n since Python 1.4.\n\n3. *x* can be any iterable object.\n\n4. Raises ``ValueError`` when *x* is not found in *s*. When a negative\n index is passed as the second or third parameter to the ``index()``\n method, the list length is added, as for slice indices. If it is\n still negative, it is truncated to zero, as for slice indices.\n\n Changed in version 2.3: Previously, ``index()`` didn't have\n arguments for specifying start and stop positions.\n\n5. When a negative index is passed as the first parameter to the\n ``insert()`` method, the list length is added, as for slice\n indices. If it is still negative, it is truncated to zero, as for\n slice indices.\n\n Changed in version 2.3: Previously, all negative indices were\n truncated to zero.\n\n6. The ``pop()`` method is only supported by the list and array types.\n The optional argument *i* defaults to ``-1``, so that by default\n the last item is removed and returned.\n\n7. The ``sort()`` and ``reverse()`` methods modify the list in place\n for economy of space when sorting or reversing a large list. To\n remind you that they operate by side effect, they don't return the\n sorted or reversed list.\n\n8. The ``sort()`` method takes optional arguments for controlling the\n comparisons.\n\n *cmp* specifies a custom comparison function of two arguments (list\n items) which should return a negative, zero or positive number\n depending on whether the first argument is considered smaller than,\n equal to, or larger than the second argument: ``cmp=lambda x,y:\n cmp(x.lower(), y.lower())``. The default value is ``None``.\n\n *key* specifies a function of one argument that is used to extract\n a comparison key from each list element: ``key=str.lower``. The\n default value is ``None``.\n\n *reverse* is a boolean value. If set to ``True``, then the list\n elements are sorted as if each comparison were reversed.\n\n In general, the *key* and *reverse* conversion processes are much\n faster than specifying an equivalent *cmp* function. This is\n because *cmp* is called multiple times for each list element while\n *key* and *reverse* touch each element only once.\n\n Changed in version 2.3: Support for ``None`` as an equivalent to\n omitting *cmp* was added.\n\n Changed in version 2.4: Support for *key* and *reverse* was added.\n\n9. Starting with Python 2.3, the ``sort()`` method is guaranteed to be\n stable. A sort is stable if it guarantees not to change the\n relative order of elements that compare equal --- this is helpful\n for sorting in multiple passes (for example, sort by department,\n then by salary grade).\n\n10. While a list is being sorted, the effect of attempting to mutate,\n or even inspect, the list is undefined. The C implementation of\n Python 2.3 and newer makes the list appear empty for the duration,\n and raises ``ValueError`` if it can detect that the list has been\n mutated during a sort.\n", 'unary': u'\nUnary arithmetic operations\n***************************\n\nAll unary arithmetic (and bitwise) operations have the same priority:\n\n u_expr ::= power | "-" u_expr | "+" u_expr | "~" u_expr\n\nThe unary ``-`` (minus) operator yields the negation of its numeric\nargument.\n\nThe unary ``+`` (plus) operator yields its numeric argument unchanged.\n\nThe unary ``~`` (invert) operator yields the bitwise inversion of its\nplain or long integer argument. The bitwise inversion of ``x`` is\ndefined as ``-(x+1)``. It only applies to integral numbers.\n\nIn all three cases, if the argument does not have the proper type, a\n``TypeError`` exception is raised.\n', 'while': u'\nThe ``while`` statement\n***********************\n\nThe ``while`` statement is used for repeated execution as long as an\nexpression is true:\n\n while_stmt ::= "while" expression ":" suite\n ["else" ":" suite]\n\nThis repeatedly tests the expression and, if it is true, executes the\nfirst suite; if the expression is false (which may be the first time\nit is tested) the suite of the ``else`` clause, if present, is\nexecuted and the loop terminates.\n\nA ``break`` statement executed in the first suite terminates the loop\nwithout executing the ``else`` clause\'s suite. A ``continue``\nstatement executed in the first suite skips the rest of the suite and\ngoes back to testing the expression.\n', - 'with': u'\nThe ``with`` statement\n**********************\n\nAdded in version 2.5.\n\nThe ``with`` statement is used to wrap the execution of a block with\nmethods defined by a context manager (see section *With Statement\nContext Managers*). This allows common\n``try``...``except``...``finally`` usage patterns to be encapsulated\nfor convenient reuse.\n\n with_stmt ::= "with" expression ["as" target] ":" suite\n\nThe execution of the ``with`` statement proceeds as follows:\n\n1. The context expression is evaluated to obtain a context manager.\n\n2. The context manager\'s ``__enter__()`` method is invoked.\n\n3. If a target was included in the ``with`` statement, the return\n value from ``__enter__()`` is assigned to it.\n\n Note: The ``with`` statement guarantees that if the ``__enter__()``\n method returns without an error, then ``__exit__()`` will always\n be called. Thus, if an error occurs during the assignment to the\n target list, it will be treated the same as an error occurring\n within the suite would be. See step 5 below.\n\n4. The suite is executed.\n\n5. The context manager\'s ``__exit__()`` method is invoked. If an\n exception caused the suite to be exited, its type, value, and\n traceback are passed as arguments to ``__exit__()``. Otherwise,\n three ``None`` arguments are supplied.\n\n If the suite was exited due to an exception, and the return value\n from the ``__exit__()`` method was false, the exception is\n reraised. If the return value was true, the exception is\n suppressed, and execution continues with the statement following\n the ``with`` statement.\n\n If the suite was exited for any reason other than an exception, the\n return value from ``__exit__()`` is ignored, and execution proceeds\n at the normal location for the kind of exit that was taken.\n\nNote: In Python 2.5, the ``with`` statement is only allowed when the\n ``with_statement`` feature has been enabled. It is always enabled\n in Python 2.6.\n\nSee also:\n\n **PEP 0343** - The "with" statement\n The specification, background, and examples for the Python\n ``with`` statement.\n', + 'with': u'\nThe ``with`` statement\n**********************\n\nNew in version 2.5.\n\nThe ``with`` statement is used to wrap the execution of a block with\nmethods defined by a context manager (see section *With Statement\nContext Managers*). This allows common\n``try``...``except``...``finally`` usage patterns to be encapsulated\nfor convenient reuse.\n\n with_stmt ::= "with" expression ["as" target] ":" suite\n\nThe execution of the ``with`` statement proceeds as follows:\n\n1. The context expression is evaluated to obtain a context manager.\n\n2. The context manager\'s ``__enter__()`` method is invoked.\n\n3. If a target was included in the ``with`` statement, the return\n value from ``__enter__()`` is assigned to it.\n\n Note: The ``with`` statement guarantees that if the ``__enter__()``\n method returns without an error, then ``__exit__()`` will always\n be called. Thus, if an error occurs during the assignment to the\n target list, it will be treated the same as an error occurring\n within the suite would be. See step 5 below.\n\n4. The suite is executed.\n\n5. The context manager\'s ``__exit__()`` method is invoked. If an\n exception caused the suite to be exited, its type, value, and\n traceback are passed as arguments to ``__exit__()``. Otherwise,\n three ``None`` arguments are supplied.\n\n If the suite was exited due to an exception, and the return value\n from the ``__exit__()`` method was false, the exception is\n reraised. If the return value was true, the exception is\n suppressed, and execution continues with the statement following\n the ``with`` statement.\n\n If the suite was exited for any reason other than an exception, the\n return value from ``__exit__()`` is ignored, and execution proceeds\n at the normal location for the kind of exit that was taken.\n\nNote: In Python 2.5, the ``with`` statement is only allowed when the\n ``with_statement`` feature has been enabled. It is always enabled\n in Python 2.6.\n\nSee also:\n\n **PEP 0343** - The "with" statement\n The specification, background, and examples for the Python\n ``with`` statement.\n', 'yield': u'\nThe ``yield`` statement\n***********************\n\n yield_stmt ::= yield_expression\n\nThe ``yield`` statement is only used when defining a generator\nfunction, and is only used in the body of the generator function.\nUsing a ``yield`` statement in a function definition is sufficient to\ncause that definition to create a generator function instead of a\nnormal function.\n\nWhen a generator function is called, it returns an iterator known as a\ngenerator iterator, or more commonly, a generator. The body of the\ngenerator function is executed by calling the generator\'s ``next()``\nmethod repeatedly until it raises an exception.\n\nWhen a ``yield`` statement is executed, the state of the generator is\nfrozen and the value of **expression_list** is returned to\n``next()``\'s caller. By "frozen" we mean that all local state is\nretained, including the current bindings of local variables, the\ninstruction pointer, and the internal evaluation stack: enough\ninformation is saved so that the next time ``next()`` is invoked, the\nfunction can proceed exactly as if the ``yield`` statement were just\nanother external call.\n\nAs of Python version 2.5, the ``yield`` statement is now allowed in\nthe ``try`` clause of a ``try`` ... ``finally`` construct. If the\ngenerator is not resumed before it is finalized (by reaching a zero\nreference count or by being garbage collected), the generator-\niterator\'s ``close()`` method will be called, allowing any pending\n``finally`` clauses to execute.\n\nNote: In Python 2.2, the ``yield`` statement was only allowed when the\n ``generators`` feature has been enabled. This ``__future__`` import\n statement was used to enable the feature:\n\n from __future__ import generators\n\nSee also:\n\n **PEP 0255** - Simple Generators\n The proposal for adding generators and the ``yield`` statement\n to Python.\n\n **PEP 0342** - Coroutines via Enhanced Generators\n The proposal that, among other generator enhancements, proposed\n allowing ``yield`` to appear inside a ``try`` ... ``finally``\n block.\n'} From nnorwitz at gmail.com Thu Oct 2 22:53:02 2008 From: nnorwitz at gmail.com (Neal Norwitz) Date: Thu, 2 Oct 2008 16:53:02 -0400 Subject: [Python-checkins] Python Regression Test Failures basics (1) Message-ID: <20081002205302.GA13036@python.psfb.org> 326 tests OK. 1 test failed: test_distutils 33 tests skipped: test_aepack test_al test_applesingle test_bsddb185 test_bsddb3 test_cd test_cl test_curses test_epoll test_gl test_imgfile test_ioctl test_kqueue test_lib2to3 test_linuxaudiodev test_macos test_macostools test_multiprocessing test_ossaudiodev test_pep277 test_py3kwarn test_scriptpackages test_socketserver test_startfile test_sunaudiodev test_tcl test_timeout test_unicode_file test_urllib2net test_urllibnet test_winreg test_winsound test_zipfile64 4 skips unexpected on linux2: test_epoll test_multiprocessing test_lib2to3 test_ioctl test_grammar test_opcodes test_dict test_builtin test_exceptions test_types test_unittest test_doctest test_doctest2 test_MimeWriter test_SimpleHTTPServer test_StringIO test___all__ test___future__ test__locale test_abc test_abstract_numbers test_aepack test_aepack skipped -- No module named aepack test_al test_al skipped -- No module named al test_anydbm test_applesingle test_applesingle skipped -- No module named macostools test_array test_ast test_asynchat test_asyncore test_atexit test_audioop test_augassign test_base64 test_bastion test_bigaddrspace test_bigmem test_binascii test_binhex test_binop test_bisect test_bool test_bsddb test_bsddb185 test_bsddb185 skipped -- No module named bsddb185 test_bsddb3 test_bsddb3 skipped -- Use of the `bsddb' resource not enabled test_buffer test_bufio test_bytes test_bz2 test_calendar test_call test_capi test_cd test_cd skipped -- No module named cd test_cfgparser test_cgi test_charmapcodec test_cl test_cl skipped -- No module named cl test_class test_cmath test_cmd test_cmd_line test_cmd_line_script test_code test_codeccallbacks test_codecencodings_cn test_codecencodings_hk test_codecencodings_jp test_codecencodings_kr test_codecencodings_tw test_codecmaps_cn test_codecmaps_hk test_codecmaps_jp test_codecmaps_kr test_codecmaps_tw test_codecs test_codeop test_coding test_coercion test_collections test_colorsys test_commands test_compare test_compile test_compiler test_complex test_complex_args test_contains test_contextlib test_cookie test_cookielib test_copy test_copy_reg test_cpickle test_cprofile test_crypt test_csv test_ctypes test_curses test_curses skipped -- Use of the `curses' resource not enabled test_datetime test_dbm test_decimal test_decorators test_defaultdict test_deque test_descr test_descrtut test_difflib test_dircache test_dis test_distutils test test_distutils failed -- errors occurred; run in verbose mode for details test_dl test_docxmlrpc test_dumbdbm test_dummy_thread test_dummy_threading test_email test_email_codecs test_email_renamed test_enumerate test_eof test_epoll test_epoll skipped -- kernel doesn't support epoll() test_errno test_exception_variations test_extcall test_fcntl test_file test_filecmp test_fileinput test_fileio test_float test_fnmatch test_fork1 test_format test_fpformat test_fractions test_frozen test_ftplib test_funcattrs test_functools test_future test_future3 test_future4 test_future_builtins test_gc test_gdbm test_generators test_genericpath test_genexps test_getargs test_getargs2 test_getopt test_gettext test_gl test_gl skipped -- No module named gl test_glob test_global test_grp test_gzip test_hash test_hashlib test_heapq test_hmac test_hotshot test_htmllib test_htmlparser test_httplib test_httpservers [12826 refs] [12826 refs] [21355 refs] test_imageop test_imaplib test_imgfile test_imgfile skipped -- No module named imgfile test_imp test_import test_importhooks test_index test_inspect test_int test_int_literal test_io test_ioctl test_ioctl skipped -- Unable to open /dev/tty test_isinstance test_iter test_iterlen test_itertools test_json test_kqueue test_kqueue skipped -- test works only on BSD test_largefile test_lib2to3 test_lib2to3 skipped -- No module named myfixes test_linuxaudiodev test_linuxaudiodev skipped -- Use of the `audio' resource not enabled test_list test_locale test_logging test_long test_long_future test_longexp test_macos test_macos skipped -- No module named MacOS test_macostools test_macostools skipped -- No module named macostools test_macpath test_mailbox test_marshal test_math test_md5 test_memoryio test_mhlib test_mimetools test_mimetypes test_minidom test_mmap test_module test_modulefinder test_multibytecodec test_multibytecodec_support test_multifile test_multiprocessing test_multiprocessing skipped -- OSError raises on RLock creation, see issue 3111! test_mutants test_mutex test_netrc test_new test_nis test_normalization test_ntpath test_old_mailbox test_openpty test_operator test_optparse test_os /tmp/python-test/local/lib/python2.6/os.py:759: DeprecationWarning: integer argument expected, got float bs += read(_urandomfd, n - len(bs)) test_ossaudiodev test_ossaudiodev skipped -- Use of the `audio' resource not enabled test_parser Expecting 's_push: parser stack overflow' in next line s_push: parser stack overflow test_peepholer test_pep247 test_pep263 test_pep277 test_pep277 skipped -- test works only on NT+ test_pep292 test_pep352 test_pickle test_pickletools test_pipes test_pkg test_pkgimport test_pkgutil test_platform test_plistlib test_poll test_popen [12831 refs] [12831 refs] [12831 refs] test_popen2 test_poplib test_posix test_posixpath test_pow test_pprint test_print test_profile test_profilehooks test_property test_pstats test_pty test_pwd test_py3kwarn test_py3kwarn skipped -- test.test_py3kwarn must be run with the -3 flag test_pyclbr test_pydoc [17360 refs] test_pyexpat test_queue test_quopri [15345 refs] [15345 refs] test_random test_re test_repr test_resource test_rfc822 test_richcmp test_robotparser test_runpy test_sax test_scope test_scriptpackages test_scriptpackages skipped -- No module named aetools test_select test_set test_sets test_sgmllib test_sha test_shelve test_shlex test_shutil test_signal test_site [12826 refs] [12826 refs] [12829 refs] [12826 refs] test_slice test_smtplib test_socket test_socketserver test_socketserver skipped -- Use of the `network' resource not enabled test_softspace test_sort test_sqlite test_ssl test_startfile test_startfile skipped -- cannot import name startfile test_str test_strftime test_string test_stringprep test_strop test_strptime test_struct test_structmembers test_structseq test_subprocess [12826 refs] [12826 refs] [12826 refs] [12826 refs] [12826 refs] [12826 refs] [12826 refs] [12826 refs] [12826 refs] [12826 refs] [12826 refs] [12826 refs] [14726 refs] [13041 refs] [12826 refs] [12826 refs] [12826 refs] [12826 refs] [12826 refs] [12826 refs] . [12826 refs] [12826 refs] this bit of output is from a test of stdout in a different process ... [12826 refs] [12826 refs] [13041 refs] test_sunaudiodev test_sunaudiodev skipped -- No module named sunaudiodev test_sundry /tmp/python-test/local/lib/python2.6/test/test_sundry.py:67: DeprecationWarning: The posixfile module is deprecated; fcntl.lockf() provides better locking import posixfile test_symtable test_syntax test_sys [12826 refs] [12826 refs] [13055 refs] [12849 refs] test_tarfile test_tcl test_tcl skipped -- No module named _tkinter test_telnetlib test_tempfile [12829 refs] test_textwrap test_thread test_threaded_import test_threadedtempfile test_threading [16318 refs] [15967 refs] [15783 refs] [15783 refs] [15783 refs] [15783 refs] test_threading_local test_threadsignals test_time test_timeout test_timeout skipped -- Use of the `network' resource not enabled test_tokenize test_trace test_traceback test_transformer test_tuple test_typechecks test_ucn test_unary test_undocumented_details test_unicode test_unicode_file test_unicode_file skipped -- No Unicode filesystem semantics on this platform. test_unicodedata test_univnewlines test_unpack test_urllib test_urllib2 test_urllib2_localnet test_urllib2net test_urllib2net skipped -- Use of the `network' resource not enabled test_urllibnet test_urllibnet skipped -- Use of the `network' resource not enabled test_urlparse test_userdict test_userlist test_userstring test_uu test_uuid WARNING: uuid.getnode is unreliable on many platforms. It is disabled until the code and/or test can be fixed properly. WARNING: uuid._ifconfig_getnode is unreliable on many platforms. It is disabled until the code and/or test can be fixed properly. WARNING: uuid._unixdll_getnode is unreliable on many platforms. It is disabled until the code and/or test can be fixed properly. test_wait3 test_wait4 test_warnings test_wave test_weakref test_whichdb test_winreg test_winreg skipped -- No module named _winreg test_winsound test_winsound skipped -- No module named winsound test_with test_wsgiref test_xdrlib test_xml_etree test_xml_etree_c test_xmllib test_xmlrpc test_xpickle test_xrange test_zipfile test_zipfile64 test_zipfile64 skipped -- test requires loads of disk-space bytes and a long time to run test_zipimport test_zlib 326 tests OK. 1 test failed: test_distutils 33 tests skipped: test_aepack test_al test_applesingle test_bsddb185 test_bsddb3 test_cd test_cl test_curses test_epoll test_gl test_imgfile test_ioctl test_kqueue test_lib2to3 test_linuxaudiodev test_macos test_macostools test_multiprocessing test_ossaudiodev test_pep277 test_py3kwarn test_scriptpackages test_socketserver test_startfile test_sunaudiodev test_tcl test_timeout test_unicode_file test_urllib2net test_urllibnet test_winreg test_winsound test_zipfile64 4 skips unexpected on linux2: test_epoll test_multiprocessing test_lib2to3 test_ioctl [647821 refs] From buildbot at python.org Thu Oct 2 22:55:03 2008 From: buildbot at python.org (buildbot at python.org) Date: Thu, 02 Oct 2008 20:55:03 +0000 Subject: [Python-checkins] buildbot failure in PPC64 Debian 3.0 Message-ID: <20081002205503.7658F1E4019@bag.python.org> The Buildbot has detected a new failure of PPC64 Debian 3.0. Full details are available at: http://www.python.org/dev/buildbot/all/PPC64%20Debian%203.0/builds/1714 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-debian-ppc64 Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: benjamin.peterson,guido.van.rossum BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_fnmatch ====================================================================== ERROR: test_mix_bytes_str (test.test_fnmatch.FnmatchTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/pybot/buildarea64/3.0.klose-debian-ppc64/build/Lib/test/test_fnmatch.py", line 41, in test_mix_bytes_str self.assertRaises(TypeError, fnmatch, 'test', b'*') File "/home/pybot/buildarea64/3.0.klose-debian-ppc64/build/Lib/unittest.py", line 311, in failUnlessRaises callableObj(*args, **kwargs) File "/home/pybot/buildarea64/3.0.klose-debian-ppc64/build/Lib/fnmatch.py", line 38, in fnmatch return fnmatchcase(name, pat) File "/home/pybot/buildarea64/3.0.klose-debian-ppc64/build/Lib/fnmatch.py", line 76, in fnmatchcase match = _compile_pattern(pat) File "/home/pybot/buildarea64/3.0.klose-debian-ppc64/build/Lib/fnmatch.py", line 41, in _compile_pattern regex = _cache.get(pat) BytesWarning: Comparison between bytes and string make: *** [buildbottest] Error 1 sincerely, -The Buildbot From nnorwitz at gmail.com Thu Oct 2 23:23:46 2008 From: nnorwitz at gmail.com (Neal Norwitz) Date: Thu, 2 Oct 2008 17:23:46 -0400 Subject: [Python-checkins] Python Regression Test Failures opt (1) Message-ID: <20081002212345.GA25328@python.psfb.org> 326 tests OK. 1 test failed: test_distutils 33 tests skipped: test_aepack test_al test_applesingle test_bsddb185 test_bsddb3 test_cd test_cl test_curses test_epoll test_gl test_imgfile test_ioctl test_kqueue test_lib2to3 test_linuxaudiodev test_macos test_macostools test_multiprocessing test_ossaudiodev test_pep277 test_py3kwarn test_scriptpackages test_socketserver test_startfile test_sunaudiodev test_tcl test_timeout test_unicode_file test_urllib2net test_urllibnet test_winreg test_winsound test_zipfile64 4 skips unexpected on linux2: test_epoll test_multiprocessing test_lib2to3 test_ioctl test_grammar test_opcodes test_dict test_builtin test_exceptions test_types test_unittest test_doctest test_doctest2 test_MimeWriter test_SimpleHTTPServer test_StringIO test___all__ test___future__ test__locale test_abc test_abstract_numbers test_aepack test_aepack skipped -- No module named aepack test_al test_al skipped -- No module named al test_anydbm test_applesingle test_applesingle skipped -- No module named macostools test_array test_ast test_asynchat test_asyncore test_atexit test_audioop test_augassign test_base64 test_bastion test_bigaddrspace test_bigmem test_binascii test_binhex test_binop test_bisect test_bool test_bsddb test_bsddb185 test_bsddb185 skipped -- No module named bsddb185 test_bsddb3 test_bsddb3 skipped -- Use of the `bsddb' resource not enabled test_buffer test_bufio test_bytes test_bz2 test_calendar test_call test_capi test_cd test_cd skipped -- No module named cd test_cfgparser test_cgi test_charmapcodec test_cl test_cl skipped -- No module named cl test_class test_cmath test_cmd test_cmd_line test_cmd_line_script test_code test_codeccallbacks test_codecencodings_cn test_codecencodings_hk test_codecencodings_jp test_codecencodings_kr test_codecencodings_tw test_codecmaps_cn test_codecmaps_hk test_codecmaps_jp test_codecmaps_kr test_codecmaps_tw test_codecs test_codeop test_coding test_coercion test_collections test_colorsys test_commands test_compare test_compile test_compiler test_complex test_complex_args test_contains test_contextlib test_cookie test_cookielib test_copy test_copy_reg test_cpickle test_cprofile test_crypt test_csv test_ctypes test_curses test_curses skipped -- Use of the `curses' resource not enabled test_datetime test_dbm test_decimal test_decorators test_defaultdict test_deque test_descr test_descrtut test_difflib test_dircache test_dis test_distutils [17000 refs] test test_distutils failed -- errors occurred; run in verbose mode for details test_dl test_docxmlrpc test_dumbdbm test_dummy_thread test_dummy_threading test_email test_email_codecs test_email_renamed test_enumerate test_eof test_epoll test_epoll skipped -- kernel doesn't support epoll() test_errno test_exception_variations test_extcall test_fcntl test_file test_filecmp test_fileinput test_fileio test_float test_fnmatch test_fork1 test_format test_fpformat test_fractions test_frozen test_ftplib test_funcattrs test_functools test_future test_future3 test_future4 test_future_builtins test_gc test_gdbm test_generators test_genericpath test_genexps test_getargs test_getargs2 test_getopt test_gettext test_gl test_gl skipped -- No module named gl test_glob test_global test_grp test_gzip test_hash test_hashlib test_heapq test_hmac test_hotshot test_htmllib test_htmlparser test_httplib test_httpservers [12826 refs] [12826 refs] [21355 refs] test_imageop test_imaplib test_imgfile test_imgfile skipped -- No module named imgfile test_imp test_import test_importhooks test_index test_inspect test_int test_int_literal test_io test_ioctl test_ioctl skipped -- Unable to open /dev/tty test_isinstance test_iter test_iterlen test_itertools test_json test_kqueue test_kqueue skipped -- test works only on BSD test_largefile test_lib2to3 test_lib2to3 skipped -- No module named myfixes test_linuxaudiodev test_linuxaudiodev skipped -- Use of the `audio' resource not enabled test_list test_locale test_logging test_long test_long_future test_longexp test_macos test_macos skipped -- No module named MacOS test_macostools test_macostools skipped -- No module named macostools test_macpath test_mailbox test_marshal test_math test_md5 test_memoryio test_mhlib test_mimetools test_mimetypes test_minidom test_mmap test_module test_modulefinder test_multibytecodec test_multibytecodec_support test_multifile test_multiprocessing test_multiprocessing skipped -- OSError raises on RLock creation, see issue 3111! test_mutants test_mutex test_netrc test_new test_nis test_normalization test_ntpath test_old_mailbox test_openpty test_operator test_optparse test_os /tmp/python-test/local/lib/python2.6/os.py:759: DeprecationWarning: integer argument expected, got float bs += read(_urandomfd, n - len(bs)) test_ossaudiodev test_ossaudiodev skipped -- Use of the `audio' resource not enabled test_parser Expecting 's_push: parser stack overflow' in next line s_push: parser stack overflow test_peepholer test_pep247 test_pep263 test_pep277 test_pep277 skipped -- test works only on NT+ test_pep292 test_pep352 test_pickle test_pickletools test_pipes test_pkg test_pkgimport test_pkgutil test_platform test_plistlib test_poll test_popen [12831 refs] [12831 refs] [12831 refs] test_popen2 test_poplib test_posix test_posixpath test_pow test_pprint test_print test_profile test_profilehooks test_property test_pstats test_pty test_pwd test_py3kwarn test_py3kwarn skipped -- test.test_py3kwarn must be run with the -3 flag test_pyclbr test_pydoc [17360 refs] test_pyexpat test_queue test_quopri [15345 refs] [15345 refs] test_random test_re test_repr test_resource test_rfc822 test_richcmp test_robotparser test_runpy test_sax test_scope test_scriptpackages test_scriptpackages skipped -- No module named aetools test_select test_set test_sets test_sgmllib test_sha test_shelve test_shlex test_shutil test_signal test_site [12826 refs] [12826 refs] [12829 refs] [12826 refs] test_slice test_smtplib test_socket test_socketserver test_socketserver skipped -- Use of the `network' resource not enabled test_softspace test_sort test_sqlite test_ssl test_startfile test_startfile skipped -- cannot import name startfile test_str test_strftime test_string test_stringprep test_strop test_strptime test_struct test_structmembers test_structseq test_subprocess [12826 refs] [12826 refs] [12826 refs] [12826 refs] [12826 refs] [12826 refs] [12826 refs] [12826 refs] [12826 refs] [12826 refs] [12826 refs] [12826 refs] [14726 refs] [13041 refs] [12826 refs] [12826 refs] [12826 refs] [12826 refs] [12826 refs] [12826 refs] . [12826 refs] [12826 refs] this bit of output is from a test of stdout in a different process ... [12826 refs] [12826 refs] [13041 refs] test_sunaudiodev test_sunaudiodev skipped -- No module named sunaudiodev test_sundry /tmp/python-test/local/lib/python2.6/test/test_sundry.py:67: DeprecationWarning: The posixfile module is deprecated; fcntl.lockf() provides better locking import posixfile test_symtable test_syntax test_sys [12826 refs] [12826 refs] [13055 refs] [12849 refs] test_tarfile test_tcl test_tcl skipped -- No module named _tkinter test_telnetlib test_tempfile [12829 refs] test_textwrap test_thread test_threaded_import test_threadedtempfile test_threading [16318 refs] [16812 refs] [15783 refs] [15783 refs] [15783 refs] [15783 refs] test_threading_local test_threadsignals test_time test_timeout test_timeout skipped -- Use of the `network' resource not enabled test_tokenize test_trace test_traceback test_transformer test_tuple test_typechecks test_ucn test_unary test_undocumented_details test_unicode test_unicode_file test_unicode_file skipped -- No Unicode filesystem semantics on this platform. test_unicodedata test_univnewlines test_unpack test_urllib test_urllib2 test_urllib2_localnet test_urllib2net test_urllib2net skipped -- Use of the `network' resource not enabled test_urllibnet test_urllibnet skipped -- Use of the `network' resource not enabled test_urlparse test_userdict test_userlist test_userstring test_uu test_uuid WARNING: uuid.getnode is unreliable on many platforms. It is disabled until the code and/or test can be fixed properly. WARNING: uuid._ifconfig_getnode is unreliable on many platforms. It is disabled until the code and/or test can be fixed properly. WARNING: uuid._unixdll_getnode is unreliable on many platforms. It is disabled until the code and/or test can be fixed properly. test_wait3 test_wait4 test_warnings test_wave test_weakref test_whichdb test_winreg test_winreg skipped -- No module named _winreg test_winsound test_winsound skipped -- No module named winsound test_with test_wsgiref test_xdrlib test_xml_etree test_xml_etree_c test_xmllib test_xmlrpc test_xpickle test_xrange test_zipfile test_zipfile64 test_zipfile64 skipped -- test requires loads of disk-space bytes and a long time to run test_zipimport test_zlib 326 tests OK. 1 test failed: test_distutils 33 tests skipped: test_aepack test_al test_applesingle test_bsddb185 test_bsddb3 test_cd test_cl test_curses test_epoll test_gl test_imgfile test_ioctl test_kqueue test_lib2to3 test_linuxaudiodev test_macos test_macostools test_multiprocessing test_ossaudiodev test_pep277 test_py3kwarn test_scriptpackages test_socketserver test_startfile test_sunaudiodev test_tcl test_timeout test_unicode_file test_urllib2net test_urllibnet test_winreg test_winsound test_zipfile64 4 skips unexpected on linux2: test_epoll test_multiprocessing test_lib2to3 test_ioctl [647096 refs] From buildbot at python.org Thu Oct 2 23:34:00 2008 From: buildbot at python.org (buildbot at python.org) Date: Thu, 02 Oct 2008 21:34:00 +0000 Subject: [Python-checkins] buildbot failure in PPC64 Debian trunk Message-ID: <20081002213400.B0BAF1E4002@bag.python.org> The Buildbot has detected a new failure of PPC64 Debian trunk. Full details are available at: http://www.python.org/dev/buildbot/all/PPC64%20Debian%20trunk/builds/1510 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-debian-ppc64 Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: christian.heimes,georg.brandl,martin.v.loewis BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_tarfile make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Thu Oct 2 23:34:56 2008 From: buildbot at python.org (buildbot at python.org) Date: Thu, 02 Oct 2008 21:34:56 +0000 Subject: [Python-checkins] buildbot failure in ia64 Ubuntu 3.0 Message-ID: <20081002213456.6728A1E4002@bag.python.org> The Buildbot has detected a new failure of ia64 Ubuntu 3.0. Full details are available at: http://www.python.org/dev/buildbot/all/ia64%20Ubuntu%203.0/builds/629 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-debian-ia64 Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: benjamin.peterson,guido.van.rossum BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_fnmatch ====================================================================== ERROR: test_mix_bytes_str (test.test_fnmatch.FnmatchTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/pybot/buildarea/3.0.klose-debian-ia64/build/Lib/test/test_fnmatch.py", line 41, in test_mix_bytes_str self.assertRaises(TypeError, fnmatch, 'test', b'*') File "/home/pybot/buildarea/3.0.klose-debian-ia64/build/Lib/unittest.py", line 311, in failUnlessRaises callableObj(*args, **kwargs) File "/home/pybot/buildarea/3.0.klose-debian-ia64/build/Lib/fnmatch.py", line 38, in fnmatch return fnmatchcase(name, pat) File "/home/pybot/buildarea/3.0.klose-debian-ia64/build/Lib/fnmatch.py", line 76, in fnmatchcase match = _compile_pattern(pat) File "/home/pybot/buildarea/3.0.klose-debian-ia64/build/Lib/fnmatch.py", line 41, in _compile_pattern regex = _cache.get(pat) BytesWarning: Comparison between bytes and string make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Thu Oct 2 23:41:36 2008 From: buildbot at python.org (buildbot at python.org) Date: Thu, 02 Oct 2008 21:41:36 +0000 Subject: [Python-checkins] buildbot failure in sparc Ubuntu 3.0 Message-ID: <20081002214136.61AF51E4002@bag.python.org> The Buildbot has detected a new failure of sparc Ubuntu 3.0. Full details are available at: http://www.python.org/dev/buildbot/all/sparc%20Ubuntu%203.0/builds/670 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-ubuntu-sparc Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: benjamin.peterson,christian.heimes,guido.van.rossum BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_fnmatch ====================================================================== ERROR: test_mix_bytes_str (test.test_fnmatch.FnmatchTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/pybot/buildarea/3.0.klose-ubuntu-sparc/build/Lib/test/test_fnmatch.py", line 41, in test_mix_bytes_str self.assertRaises(TypeError, fnmatch, 'test', b'*') File "/home/pybot/buildarea/3.0.klose-ubuntu-sparc/build/Lib/unittest.py", line 311, in failUnlessRaises callableObj(*args, **kwargs) File "/home/pybot/buildarea/3.0.klose-ubuntu-sparc/build/Lib/fnmatch.py", line 38, in fnmatch return fnmatchcase(name, pat) File "/home/pybot/buildarea/3.0.klose-ubuntu-sparc/build/Lib/fnmatch.py", line 76, in fnmatchcase match = _compile_pattern(pat) File "/home/pybot/buildarea/3.0.klose-ubuntu-sparc/build/Lib/fnmatch.py", line 41, in _compile_pattern regex = _cache.get(pat) BytesWarning: Comparison between bytes and string make: *** [buildbottest] Error 1 sincerely, -The Buildbot From python-checkins at python.org Thu Oct 2 23:51:11 2008 From: python-checkins at python.org (benjamin.peterson) Date: Thu, 2 Oct 2008 23:51:11 +0200 (CEST) Subject: [Python-checkins] r66759 - peps/trunk/pep-0101.txt Message-ID: <20081002215111.ABED71E400D@bag.python.org> Author: benjamin.peterson Date: Thu Oct 2 23:51:11 2008 New Revision: 66759 Log: pydoc-topics needs to be updated before releases Modified: peps/trunk/pep-0101.txt Modified: peps/trunk/pep-0101.txt ============================================================================== --- peps/trunk/pep-0101.txt (original) +++ peps/trunk/pep-0101.txt Thu Oct 2 23:51:11 2008 @@ -122,6 +122,11 @@ use your judgement, taking into account whether you are making an alpha, beta, or final release. + --- Regenerate Lib/pydoc-topics.py + + cd to the Doc directory and type ``make pydoc-topics``. Then copy + ``build/pydoc-topics/pydoc-topics.py`` to ``Lib/pydoc-topics.py``. + ___ Bump version numbers via the release script. .../sandbox/release/release.py --bump X.YaZ From python-checkins at python.org Thu Oct 2 23:57:21 2008 From: python-checkins at python.org (benjamin.peterson) Date: Thu, 2 Oct 2008 23:57:21 +0200 (CEST) Subject: [Python-checkins] r66760 - peps/trunk/pep-0101.txt Message-ID: <20081002215721.3FC061E4002@bag.python.org> Author: benjamin.peterson Date: Thu Oct 2 23:57:20 2008 New Revision: 66760 Log: fix markup Modified: peps/trunk/pep-0101.txt Modified: peps/trunk/pep-0101.txt ============================================================================== --- peps/trunk/pep-0101.txt (original) +++ peps/trunk/pep-0101.txt Thu Oct 2 23:57:20 2008 @@ -122,7 +122,7 @@ use your judgement, taking into account whether you are making an alpha, beta, or final release. - --- Regenerate Lib/pydoc-topics.py + ___ Regenerate Lib/pydoc-topics.py cd to the Doc directory and type ``make pydoc-topics``. Then copy ``build/pydoc-topics/pydoc-topics.py`` to ``Lib/pydoc-topics.py``. From buildbot at python.org Fri Oct 3 00:13:38 2008 From: buildbot at python.org (buildbot at python.org) Date: Thu, 02 Oct 2008 22:13:38 +0000 Subject: [Python-checkins] buildbot failure in g4 osx.4 3.0 Message-ID: <20081002221338.C4FC11E4050@bag.python.org> The Buildbot has detected a new failure of g4 osx.4 3.0. Full details are available at: http://www.python.org/dev/buildbot/all/g4%20osx.4%203.0/builds/1471 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: psf-g4 Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: benjamin.peterson,christian.heimes,guido.van.rossum,martin.v.loewis BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_fnmatch ====================================================================== ERROR: test_mix_bytes_str (test.test_fnmatch.FnmatchTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildslave/bb/3.0.psf-g4/build/Lib/test/test_fnmatch.py", line 41, in test_mix_bytes_str self.assertRaises(TypeError, fnmatch, 'test', b'*') File "/Users/buildslave/bb/3.0.psf-g4/build/Lib/unittest.py", line 311, in failUnlessRaises callableObj(*args, **kwargs) File "/Users/buildslave/bb/3.0.psf-g4/build/Lib/fnmatch.py", line 38, in fnmatch return fnmatchcase(name, pat) File "/Users/buildslave/bb/3.0.psf-g4/build/Lib/fnmatch.py", line 76, in fnmatchcase match = _compile_pattern(pat) File "/Users/buildslave/bb/3.0.psf-g4/build/Lib/fnmatch.py", line 41, in _compile_pattern regex = _cache.get(pat) BytesWarning: Comparison between bytes and string make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Fri Oct 3 00:18:31 2008 From: buildbot at python.org (buildbot at python.org) Date: Thu, 02 Oct 2008 22:18:31 +0000 Subject: [Python-checkins] buildbot failure in sparc Debian 3.0 Message-ID: <20081002221831.2ACBB1E4002@bag.python.org> The Buildbot has detected a new failure of sparc Debian 3.0. Full details are available at: http://www.python.org/dev/buildbot/all/sparc%20Debian%203.0/builds/593 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-debian-sparc Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: benjamin.peterson,christian.heimes,guido.van.rossum,martin.v.loewis BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_fnmatch ====================================================================== ERROR: test_mix_bytes_str (test.test_fnmatch.FnmatchTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/pybot/buildarea-sid/3.0.klose-debian-sparc/build/Lib/test/test_fnmatch.py", line 41, in test_mix_bytes_str self.assertRaises(TypeError, fnmatch, 'test', b'*') File "/home/pybot/buildarea-sid/3.0.klose-debian-sparc/build/Lib/unittest.py", line 311, in failUnlessRaises callableObj(*args, **kwargs) File "/home/pybot/buildarea-sid/3.0.klose-debian-sparc/build/Lib/fnmatch.py", line 38, in fnmatch return fnmatchcase(name, pat) File "/home/pybot/buildarea-sid/3.0.klose-debian-sparc/build/Lib/fnmatch.py", line 76, in fnmatchcase match = _compile_pattern(pat) File "/home/pybot/buildarea-sid/3.0.klose-debian-sparc/build/Lib/fnmatch.py", line 41, in _compile_pattern regex = _cache.get(pat) BytesWarning: Comparison between bytes and string make: *** [buildbottest] Error 1 sincerely, -The Buildbot From python-checkins at python.org Fri Oct 3 00:26:17 2008 From: python-checkins at python.org (benjamin.peterson) Date: Fri, 3 Oct 2008 00:26:17 +0200 (CEST) Subject: [Python-checkins] r66761 - python/branches/release26-maint/Lib/pydoc_topics.py Message-ID: <20081002222617.23E1F1E4006@bag.python.org> Author: benjamin.peterson Date: Fri Oct 3 00:26:15 2008 New Revision: 66761 Log: update pydoc-topics here, too Modified: python/branches/release26-maint/Lib/pydoc_topics.py Modified: python/branches/release26-maint/Lib/pydoc_topics.py ============================================================================== --- python/branches/release26-maint/Lib/pydoc_topics.py (original) +++ python/branches/release26-maint/Lib/pydoc_topics.py Fri Oct 3 00:26:15 2008 @@ -1,31 +1,31 @@ -# Autogenerated by Sphinx on Sun Jun 1 22:23:15 2008 +# Autogenerated by Sphinx on Thu Oct 2 17:24:06 2008 topics = {'assert': u'\nThe ``assert`` statement\n************************\n\nAssert statements are a convenient way to insert debugging assertions\ninto a program:\n\n assert_stmt ::= "assert" expression ["," expression]\n\nThe simple form, ``assert expression``, is equivalent to\n\n if __debug__:\n if not expression: raise AssertionError\n\nThe extended form, ``assert expression1, expression2``, is equivalent\nto\n\n if __debug__:\n if not expression1: raise AssertionError, expression2\n\nThese equivalences assume that ``__debug__`` and ``AssertionError``\nrefer to the built-in variables with those names. In the current\nimplementation, the built-in variable ``__debug__`` is ``True`` under\nnormal circumstances, ``False`` when optimization is requested\n(command line option -O). The current code generator emits no code\nfor an assert statement when optimization is requested at compile\ntime. Note that it is unnecessary to include the source code for the\nexpression that failed in the error message; it will be displayed as\npart of the stack trace.\n\nAssignments to ``__debug__`` are illegal. The value for the built-in\nvariable is determined when the interpreter starts.\n', - 'assignment': u'\nAssignment statements\n*********************\n\nAssignment statements are used to (re)bind names to values and to\nmodify attributes or items of mutable objects:\n\n assignment_stmt ::= (target_list "=")+ (expression_list | yield_expression)\n target_list ::= target ("," target)* [","]\n target ::= identifier\n | "(" target_list ")"\n | "[" target_list "]"\n | attributeref\n | subscription\n | slicing\n\n(See section *Primaries* for the syntax definitions for the last three\nsymbols.)\n\nAn assignment statement evaluates the expression list (remember that\nthis can be a single expression or a comma-separated list, the latter\nyielding a tuple) and assigns the single resulting object to each of\nthe target lists, from left to right.\n\nAssignment is defined recursively depending on the form of the target\n(list). When a target is part of a mutable object (an attribute\nreference, subscription or slicing), the mutable object must\nultimately perform the assignment and decide about its validity, and\nmay raise an exception if the assignment is unacceptable. The rules\nobserved by various types and the exceptions raised are given with the\ndefinition of the object types (see section *The standard type\nhierarchy*).\n\nAssignment of an object to a target list is recursively defined as\nfollows.\n\n* If the target list is a single target: The object is assigned to\n that target.\n\n* If the target list is a comma-separated list of targets: The object\n must be a sequence with the same number of items as there are\n targets in the target list, and the items are assigned, from left to\n right, to the corresponding targets. (This rule is relaxed as of\n Python 1.5; in earlier versions, the object had to be a tuple.\n Since strings are sequences, an assignment like ``a, b = "xy"`` is\n now legal as long as the string has the right length.)\n\nAssignment of an object to a single target is recursively defined as\nfollows.\n\n* If the target is an identifier (name):\n\n * If the name does not occur in a ``global`` statement in the\n current code block: the name is bound to the object in the current\n local namespace.\n\n * Otherwise: the name is bound to the object in the current global\n namespace.\n\n The name is rebound if it was already bound. This may cause the\n reference count for the object previously bound to the name to reach\n zero, causing the object to be deallocated and its destructor (if it\n has one) to be called.\n\n* If the target is a target list enclosed in parentheses or in square\n brackets: The object must be a sequence with the same number of\n items as there are targets in the target list, and its items are\n assigned, from left to right, to the corresponding targets.\n\n* If the target is an attribute reference: The primary expression in\n the reference is evaluated. It should yield an object with\n assignable attributes; if this is not the case, ``TypeError`` is\n raised. That object is then asked to assign the assigned object to\n the given attribute; if it cannot perform the assignment, it raises\n an exception (usually but not necessarily ``AttributeError``).\n\n* If the target is a subscription: The primary expression in the\n reference is evaluated. It should yield either a mutable sequence\n object (such as a list) or a mapping object (such as a dictionary).\n Next, the subscript expression is evaluated.\n\n If the primary is a mutable sequence object (such as a list), the\n subscript must yield a plain integer. If it is negative, the\n sequence\'s length is added to it. The resulting value must be a\n nonnegative integer less than the sequence\'s length, and the\n sequence is asked to assign the assigned object to its item with\n that index. If the index is out of range, ``IndexError`` is raised\n (assignment to a subscripted sequence cannot add new items to a\n list).\n\n If the primary is a mapping object (such as a dictionary), the\n subscript must have a type compatible with the mapping\'s key type,\n and the mapping is then asked to create a key/datum pair which maps\n the subscript to the assigned object. This can either replace an\n existing key/value pair with the same key value, or insert a new\n key/value pair (if no key with the same value existed).\n\n* If the target is a slicing: The primary expression in the reference\n is evaluated. It should yield a mutable sequence object (such as a\n list). The assigned object should be a sequence object of the same\n type. Next, the lower and upper bound expressions are evaluated,\n insofar they are present; defaults are zero and the sequence\'s\n length. The bounds should evaluate to (small) integers. If either\n bound is negative, the sequence\'s length is added to it. The\n resulting bounds are clipped to lie between zero and the sequence\'s\n length, inclusive. Finally, the sequence object is asked to replace\n the slice with the items of the assigned sequence. The length of\n the slice may be different from the length of the assigned sequence,\n thus changing the length of the target sequence, if the object\n allows it.\n\n(In the current implementation, the syntax for targets is taken to be\nthe same as for expressions, and invalid syntax is rejected during the\ncode generation phase, causing less detailed error messages.)\n\nWARNING: Although the definition of assignment implies that overlaps\nbetween the left-hand side and the right-hand side are \'safe\' (for\nexample ``a, b = b, a`` swaps two variables), overlaps *within* the\ncollection of assigned-to variables are not safe! For instance, the\nfollowing program prints ``[0, 2]``:\n\n x = [0, 1]\n i = 0\n i, x[i] = 1, 2\n print x\n\n\nAugmented assignment statements\n===============================\n\nAugmented assignment is the combination, in a single statement, of a\nbinary operation and an assignment statement:\n\n augmented_assignment_stmt ::= target augop (expression_list | yield_expression)\n augop ::= "+=" | "-=" | "*=" | "/=" | "%=" | "**="\n | ">>=" | "<<=" | "&=" | "^=" | "|="\n\n(See section *Primaries* for the syntax definitions for the last three\nsymbols.)\n\nAn augmented assignment evaluates the target (which, unlike normal\nassignment statements, cannot be an unpacking) and the expression\nlist, performs the binary operation specific to the type of assignment\non the two operands, and assigns the result to the original target.\nThe target is only evaluated once.\n\nAn augmented assignment expression like ``x += 1`` can be rewritten as\n``x = x + 1`` to achieve a similar, but not exactly equal effect. In\nthe augmented version, ``x`` is only evaluated once. Also, when\npossible, the actual operation is performed *in-place*, meaning that\nrather than creating a new object and assigning that to the target,\nthe old object is modified instead.\n\nWith the exception of assigning to tuples and multiple targets in a\nsingle statement, the assignment done by augmented assignment\nstatements is handled the same way as normal assignments. Similarly,\nwith the exception of the possible *in-place* behavior, the binary\noperation performed by augmented assignment is the same as the normal\nbinary operations.\n\nFor targets which are attribute references, the initial value is\nretrieved with a ``getattr()`` and the result is assigned with a\n``setattr()``. Notice that the two methods do not necessarily refer\nto the same variable. When ``getattr()`` refers to a class variable,\n``setattr()`` still writes to an instance variable. For example:\n\n class A:\n x = 3 # class variable\n a = A()\n a.x += 1 # writes a.x as 4 leaving A.x as 3\n', + 'assignment': u'\nAssignment statements\n*********************\n\nAssignment statements are used to (re)bind names to values and to\nmodify attributes or items of mutable objects:\n\n assignment_stmt ::= (target_list "=")+ (expression_list | yield_expression)\n target_list ::= target ("," target)* [","]\n target ::= identifier\n | "(" target_list ")"\n | "[" target_list "]"\n | attributeref\n | subscription\n | slicing\n\n(See section *Primaries* for the syntax definitions for the last three\nsymbols.)\n\nAn assignment statement evaluates the expression list (remember that\nthis can be a single expression or a comma-separated list, the latter\nyielding a tuple) and assigns the single resulting object to each of\nthe target lists, from left to right.\n\nAssignment is defined recursively depending on the form of the target\n(list). When a target is part of a mutable object (an attribute\nreference, subscription or slicing), the mutable object must\nultimately perform the assignment and decide about its validity, and\nmay raise an exception if the assignment is unacceptable. The rules\nobserved by various types and the exceptions raised are given with the\ndefinition of the object types (see section *The standard type\nhierarchy*).\n\nAssignment of an object to a target list is recursively defined as\nfollows.\n\n* If the target list is a single target: The object is assigned to\n that target.\n\n* If the target list is a comma-separated list of targets: The object\n must be a sequence with the same number of items as there are\n targets in the target list, and the items are assigned, from left to\n right, to the corresponding targets. (This rule is relaxed as of\n Python 1.5; in earlier versions, the object had to be a tuple.\n Since strings are sequences, an assignment like ``a, b = "xy"`` is\n now legal as long as the string has the right length.)\n\nAssignment of an object to a single target is recursively defined as\nfollows.\n\n* If the target is an identifier (name):\n\n * If the name does not occur in a ``global`` statement in the\n current code block: the name is bound to the object in the current\n local namespace.\n\n * Otherwise: the name is bound to the object in the current global\n namespace.\n\n The name is rebound if it was already bound. This may cause the\n reference count for the object previously bound to the name to reach\n zero, causing the object to be deallocated and its destructor (if it\n has one) to be called.\n\n* If the target is a target list enclosed in parentheses or in square\n brackets: The object must be a sequence with the same number of\n items as there are targets in the target list, and its items are\n assigned, from left to right, to the corresponding targets.\n\n* If the target is an attribute reference: The primary expression in\n the reference is evaluated. It should yield an object with\n assignable attributes; if this is not the case, ``TypeError`` is\n raised. That object is then asked to assign the assigned object to\n the given attribute; if it cannot perform the assignment, it raises\n an exception (usually but not necessarily ``AttributeError``).\n\n* If the target is a subscription: The primary expression in the\n reference is evaluated. It should yield either a mutable sequence\n object (such as a list) or a mapping object (such as a dictionary).\n Next, the subscript expression is evaluated.\n\n If the primary is a mutable sequence object (such as a list), the\n subscript must yield a plain integer. If it is negative, the\n sequence\'s length is added to it. The resulting value must be a\n nonnegative integer less than the sequence\'s length, and the\n sequence is asked to assign the assigned object to its item with\n that index. If the index is out of range, ``IndexError`` is raised\n (assignment to a subscripted sequence cannot add new items to a\n list).\n\n If the primary is a mapping object (such as a dictionary), the\n subscript must have a type compatible with the mapping\'s key type,\n and the mapping is then asked to create a key/datum pair which maps\n the subscript to the assigned object. This can either replace an\n existing key/value pair with the same key value, or insert a new\n key/value pair (if no key with the same value existed).\n\n* If the target is a slicing: The primary expression in the reference\n is evaluated. It should yield a mutable sequence object (such as a\n list). The assigned object should be a sequence object of the same\n type. Next, the lower and upper bound expressions are evaluated,\n insofar they are present; defaults are zero and the sequence\'s\n length. The bounds should evaluate to (small) integers. If either\n bound is negative, the sequence\'s length is added to it. The\n resulting bounds are clipped to lie between zero and the sequence\'s\n length, inclusive. Finally, the sequence object is asked to replace\n the slice with the items of the assigned sequence. The length of\n the slice may be different from the length of the assigned sequence,\n thus changing the length of the target sequence, if the object\n allows it.\n\n(In the current implementation, the syntax for targets is taken to be\nthe same as for expressions, and invalid syntax is rejected during the\ncode generation phase, causing less detailed error messages.)\n\nWARNING: Although the definition of assignment implies that overlaps\nbetween the left-hand side and the right-hand side are \'safe\' (for\nexample ``a, b = b, a`` swaps two variables), overlaps *within* the\ncollection of assigned-to variables are not safe! For instance, the\nfollowing program prints ``[0, 2]``:\n\n x = [0, 1]\n i = 0\n i, x[i] = 1, 2\n print x\n\n\nAugmented assignment statements\n===============================\n\nAugmented assignment is the combination, in a single statement, of a\nbinary operation and an assignment statement:\n\n augmented_assignment_stmt ::= target augop (expression_list | yield_expression)\n augop ::= "+=" | "-=" | "*=" | "/=" | "//=" | "%=" | "**="\n | ">>=" | "<<=" | "&=" | "^=" | "|="\n\n(See section *Primaries* for the syntax definitions for the last three\nsymbols.)\n\nAn augmented assignment evaluates the target (which, unlike normal\nassignment statements, cannot be an unpacking) and the expression\nlist, performs the binary operation specific to the type of assignment\non the two operands, and assigns the result to the original target.\nThe target is only evaluated once.\n\nAn augmented assignment expression like ``x += 1`` can be rewritten as\n``x = x + 1`` to achieve a similar, but not exactly equal effect. In\nthe augmented version, ``x`` is only evaluated once. Also, when\npossible, the actual operation is performed *in-place*, meaning that\nrather than creating a new object and assigning that to the target,\nthe old object is modified instead.\n\nWith the exception of assigning to tuples and multiple targets in a\nsingle statement, the assignment done by augmented assignment\nstatements is handled the same way as normal assignments. Similarly,\nwith the exception of the possible *in-place* behavior, the binary\noperation performed by augmented assignment is the same as the normal\nbinary operations.\n\nFor targets which are attribute references, the initial value is\nretrieved with a ``getattr()`` and the result is assigned with a\n``setattr()``. Notice that the two methods do not necessarily refer\nto the same variable. When ``getattr()`` refers to a class variable,\n``setattr()`` still writes to an instance variable. For example:\n\n class A:\n x = 3 # class variable\n a = A()\n a.x += 1 # writes a.x as 4 leaving A.x as 3\n', 'atom-identifiers': u'\nIdentifiers (Names)\n*******************\n\nAn identifier occurring as an atom is a name. See section\n*Identifiers and keywords* for lexical definition and section *Naming\nand binding* for documentation of naming and binding.\n\nWhen the name is bound to an object, evaluation of the atom yields\nthat object. When a name is not bound, an attempt to evaluate it\nraises a ``NameError`` exception.\n\n**Private name mangling:** When an identifier that textually occurs in\na class definition begins with two or more underscore characters and\ndoes not end in two or more underscores, it is considered a *private\nname* of that class. Private names are transformed to a longer form\nbefore code is generated for them. The transformation inserts the\nclass name in front of the name, with leading underscores removed, and\na single underscore inserted in front of the class name. For example,\nthe identifier ``__spam`` occurring in a class named ``Ham`` will be\ntransformed to ``_Ham__spam``. This transformation is independent of\nthe syntactical context in which the identifier is used. If the\ntransformed name is extremely long (longer than 255 characters),\nimplementation defined truncation may happen. If the class name\nconsists only of underscores, no transformation is done.\n', 'atom-literals': u"\nLiterals\n********\n\nPython supports string literals and various numeric literals:\n\n literal ::= stringliteral | integer | longinteger\n | floatnumber | imagnumber\n\nEvaluation of a literal yields an object of the given type (string,\ninteger, long integer, floating point number, complex number) with the\ngiven value. The value may be approximated in the case of floating\npoint and imaginary (complex) literals. See section *Literals* for\ndetails.\n\nAll literals correspond to immutable data types, and hence the\nobject's identity is less important than its value. Multiple\nevaluations of literals with the same value (either the same\noccurrence in the program text or a different occurrence) may obtain\nthe same object or a different object with the same value.\n", - 'attribute-access': u'\nCustomizing attribute access\n****************************\n\nThe following methods can be defined to customize the meaning of\nattribute access (use of, assignment to, or deletion of ``x.name``)\nfor class instances.\n\nobject.__getattr__(self, name)\n\n Called when an attribute lookup has not found the attribute in the\n usual places (i.e. it is not an instance attribute nor is it found\n in the class tree for ``self``). ``name`` is the attribute name.\n This method should return the (computed) attribute value or raise\n an ``AttributeError`` exception.\n\n Note that if the attribute is found through the normal mechanism,\n ``__getattr__()`` is not called. (This is an intentional asymmetry\n between ``__getattr__()`` and ``__setattr__()``.) This is done both\n for efficiency reasons and because otherwise ``__setattr__()``\n would have no way to access other attributes of the instance. Note\n that at least for instance variables, you can fake total control by\n not inserting any values in the instance attribute dictionary (but\n instead inserting them in another object). See the\n ``__getattribute__()`` method below for a way to actually get total\n control in new-style classes.\n\nobject.__setattr__(self, name, value)\n\n Called when an attribute assignment is attempted. This is called\n instead of the normal mechanism (i.e. store the value in the\n instance dictionary). *name* is the attribute name, *value* is the\n value to be assigned to it.\n\n If ``__setattr__()`` wants to assign to an instance attribute, it\n should not simply execute ``self.name = value`` --- this would\n cause a recursive call to itself. Instead, it should insert the\n value in the dictionary of instance attributes, e.g.,\n ``self.__dict__[name] = value``. For new-style classes, rather\n than accessing the instance dictionary, it should call the base\n class method with the same name, for example,\n ``object.__setattr__(self, name, value)``.\n\nobject.__delattr__(self, name)\n\n Like ``__setattr__()`` but for attribute deletion instead of\n assignment. This should only be implemented if ``del obj.name`` is\n meaningful for the object.\n\n\nMore attribute access for new-style classes\n===========================================\n\nThe following methods only apply to new-style classes.\n\nobject.__getattribute__(self, name)\n\n Called unconditionally to implement attribute accesses for\n instances of the class. If the class also defines\n ``__getattr__()``, the latter will not be called unless\n ``__getattribute__()`` either calls it explicitly or raises an\n ``AttributeError``. This method should return the (computed)\n attribute value or raise an ``AttributeError`` exception. In order\n to avoid infinite recursion in this method, its implementation\n should always call the base class method with the same name to\n access any attributes it needs, for example,\n ``object.__getattribute__(self, name)``.\n\n\nImplementing Descriptors\n========================\n\nThe following methods only apply when an instance of the class\ncontaining the method (a so-called *descriptor* class) appears in the\nclass dictionary of another new-style class, known as the *owner*\nclass. In the examples below, "the attribute" refers to the attribute\nwhose name is the key of the property in the owner class\'\n``__dict__``. Descriptors can only be implemented as new-style\nclasses themselves.\n\nobject.__get__(self, instance, owner)\n\n Called to get the attribute of the owner class (class attribute\n access) or of an instance of that class (instance attribute\n access). *owner* is always the owner class, while *instance* is the\n instance that the attribute was accessed through, or ``None`` when\n the attribute is accessed through the *owner*. This method should\n return the (computed) attribute value or raise an\n ``AttributeError`` exception.\n\nobject.__set__(self, instance, value)\n\n Called to set the attribute on an instance *instance* of the owner\n class to a new value, *value*.\n\nobject.__delete__(self, instance)\n\n Called to delete the attribute on an instance *instance* of the\n owner class.\n\n\nInvoking Descriptors\n====================\n\nIn general, a descriptor is an object attribute with "binding\nbehavior", one whose attribute access has been overridden by methods\nin the descriptor protocol: ``__get__()``, ``__set__()``, and\n``__delete__()``. If any of those methods are defined for an object,\nit is said to be a descriptor.\n\nThe default behavior for attribute access is to get, set, or delete\nthe attribute from an object\'s dictionary. For instance, ``a.x`` has a\nlookup chain starting with ``a.__dict__[\'x\']``, then\n``type(a).__dict__[\'x\']``, and continuing through the base classes of\n``type(a)`` excluding metaclasses.\n\nHowever, if the looked-up value is an object defining one of the\ndescriptor methods, then Python may override the default behavior and\ninvoke the descriptor method instead. Where this occurs in the\nprecedence chain depends on which descriptor methods were defined and\nhow they were called. Note that descriptors are only invoked for new\nstyle objects or classes (ones that subclass ``object()`` or\n``type()``).\n\nThe starting point for descriptor invocation is a binding, ``a.x``.\nHow the arguments are assembled depends on ``a``:\n\nDirect Call\n The simplest and least common call is when user code directly\n invokes a descriptor method: ``x.__get__(a)``.\n\nInstance Binding\n If binding to a new-style object instance, ``a.x`` is transformed\n into the call: ``type(a).__dict__[\'x\'].__get__(a, type(a))``.\n\nClass Binding\n If binding to a new-style class, ``A.x`` is transformed into the\n call: ``A.__dict__[\'x\'].__get__(None, A)``.\n\nSuper Binding\n If ``a`` is an instance of ``super``, then the binding ``super(B,\n obj).m()`` searches ``obj.__class__.__mro__`` for the base class\n ``A`` immediately preceding ``B`` and then invokes the descriptor\n with the call: ``A.__dict__[\'m\'].__get__(obj, A)``.\n\nFor instance bindings, the precedence of descriptor invocation depends\non the which descriptor methods are defined. Normally, data\ndescriptors define both ``__get__()`` and ``__set__()``, while non-\ndata descriptors have just the ``__get__()`` method. Data descriptors\nalways override a redefinition in an instance dictionary. In\ncontrast, non-data descriptors can be overridden by instances. [3]\n\nPython methods (including ``staticmethod()`` and ``classmethod()``)\nare implemented as non-data descriptors. Accordingly, instances can\nredefine and override methods. This allows individual instances to\nacquire behaviors that differ from other instances of the same class.\n\nThe ``property()`` function is implemented as a data descriptor.\nAccordingly, instances cannot override the behavior of a property.\n\n\n__slots__\n=========\n\nBy default, instances of both old and new-style classes have a\ndictionary for attribute storage. This wastes space for objects\nhaving very few instance variables. The space consumption can become\nacute when creating large numbers of instances.\n\nThe default can be overridden by defining *__slots__* in a new-style\nclass definition. The *__slots__* declaration takes a sequence of\ninstance variables and reserves just enough space in each instance to\nhold a value for each variable. Space is saved because *__dict__* is\nnot created for each instance.\n\n__slots__\n\n This class variable can be assigned a string, iterable, or sequence\n of strings with variable names used by instances. If defined in a\n new-style class, *__slots__* reserves space for the declared\n variables and prevents the automatic creation of *__dict__* and\n *__weakref__* for each instance.\n\n Added in version 2.2.\n\nNotes on using *__slots__*\n\n* Without a *__dict__* variable, instances cannot be assigned new\n variables not listed in the *__slots__* definition. Attempts to\n assign to an unlisted variable name raises ``AttributeError``. If\n dynamic assignment of new variables is desired, then add\n ``\'__dict__\'`` to the sequence of strings in the *__slots__*\n declaration.\n\n Changed in version 2.3: Previously, adding ``\'__dict__\'`` to the\n *__slots__* declaration would not enable the assignment of new\n attributes not specifically listed in the sequence of instance\n variable names.\n\n* Without a *__weakref__* variable for each instance, classes defining\n *__slots__* do not support weak references to its instances. If weak\n reference support is needed, then add ``\'__weakref__\'`` to the\n sequence of strings in the *__slots__* declaration.\n\n Changed in version 2.3: Previously, adding ``\'__weakref__\'`` to the\n *__slots__* declaration would not enable support for weak\n references.\n\n* *__slots__* are implemented at the class level by creating\n descriptors (*Implementing Descriptors*) for each variable name. As\n a result, class attributes cannot be used to set default values for\n instance variables defined by *__slots__*; otherwise, the class\n attribute would overwrite the descriptor assignment.\n\n* If a class defines a slot also defined in a base class, the instance\n variable defined by the base class slot is inaccessible (except by\n retrieving its descriptor directly from the base class). This\n renders the meaning of the program undefined. In the future, a\n check may be added to prevent this.\n\n* The action of a *__slots__* declaration is limited to the class\n where it is defined. As a result, subclasses will have a *__dict__*\n unless they also define *__slots__*.\n\n* *__slots__* do not work for classes derived from "variable-length"\n built-in types such as ``long``, ``str`` and ``tuple``.\n\n* Any non-string iterable may be assigned to *__slots__*. Mappings may\n also be used; however, in the future, special meaning may be\n assigned to the values corresponding to each key.\n\n* *__class__* assignment works only if both classes have the same\n *__slots__*.\n\n Changed in version 2.6: Previously, *__class__* assignment raised an\n error if either new or old class had *__slots__*.\n', + 'attribute-access': u'\nCustomizing attribute access\n****************************\n\nThe following methods can be defined to customize the meaning of\nattribute access (use of, assignment to, or deletion of ``x.name``)\nfor class instances.\n\nobject.__getattr__(self, name)\n\n Called when an attribute lookup has not found the attribute in the\n usual places (i.e. it is not an instance attribute nor is it found\n in the class tree for ``self``). ``name`` is the attribute name.\n This method should return the (computed) attribute value or raise\n an ``AttributeError`` exception.\n\n Note that if the attribute is found through the normal mechanism,\n ``__getattr__()`` is not called. (This is an intentional asymmetry\n between ``__getattr__()`` and ``__setattr__()``.) This is done both\n for efficiency reasons and because otherwise ``__getattr__()``\n would have no way to access other attributes of the instance. Note\n that at least for instance variables, you can fake total control by\n not inserting any values in the instance attribute dictionary (but\n instead inserting them in another object). See the\n ``__getattribute__()`` method below for a way to actually get total\n control in new-style classes.\n\nobject.__setattr__(self, name, value)\n\n Called when an attribute assignment is attempted. This is called\n instead of the normal mechanism (i.e. store the value in the\n instance dictionary). *name* is the attribute name, *value* is the\n value to be assigned to it.\n\n If ``__setattr__()`` wants to assign to an instance attribute, it\n should not simply execute ``self.name = value`` --- this would\n cause a recursive call to itself. Instead, it should insert the\n value in the dictionary of instance attributes, e.g.,\n ``self.__dict__[name] = value``. For new-style classes, rather\n than accessing the instance dictionary, it should call the base\n class method with the same name, for example,\n ``object.__setattr__(self, name, value)``.\n\nobject.__delattr__(self, name)\n\n Like ``__setattr__()`` but for attribute deletion instead of\n assignment. This should only be implemented if ``del obj.name`` is\n meaningful for the object.\n\n\nMore attribute access for new-style classes\n===========================================\n\nThe following methods only apply to new-style classes.\n\nobject.__getattribute__(self, name)\n\n Called unconditionally to implement attribute accesses for\n instances of the class. If the class also defines\n ``__getattr__()``, the latter will not be called unless\n ``__getattribute__()`` either calls it explicitly or raises an\n ``AttributeError``. This method should return the (computed)\n attribute value or raise an ``AttributeError`` exception. In order\n to avoid infinite recursion in this method, its implementation\n should always call the base class method with the same name to\n access any attributes it needs, for example,\n ``object.__getattribute__(self, name)``.\n\n Note: This method may still be bypassed when looking up special methods\n as the result of implicit invocation via language syntax or\n builtin functions. See *Special method lookup for new-style\n classes*.\n\n\nImplementing Descriptors\n========================\n\nThe following methods only apply when an instance of the class\ncontaining the method (a so-called *descriptor* class) appears in the\nclass dictionary of another new-style class, known as the *owner*\nclass. In the examples below, "the attribute" refers to the attribute\nwhose name is the key of the property in the owner class\'\n``__dict__``. Descriptors can only be implemented as new-style\nclasses themselves.\n\nobject.__get__(self, instance, owner)\n\n Called to get the attribute of the owner class (class attribute\n access) or of an instance of that class (instance attribute\n access). *owner* is always the owner class, while *instance* is the\n instance that the attribute was accessed through, or ``None`` when\n the attribute is accessed through the *owner*. This method should\n return the (computed) attribute value or raise an\n ``AttributeError`` exception.\n\nobject.__set__(self, instance, value)\n\n Called to set the attribute on an instance *instance* of the owner\n class to a new value, *value*.\n\nobject.__delete__(self, instance)\n\n Called to delete the attribute on an instance *instance* of the\n owner class.\n\n\nInvoking Descriptors\n====================\n\nIn general, a descriptor is an object attribute with "binding\nbehavior", one whose attribute access has been overridden by methods\nin the descriptor protocol: ``__get__()``, ``__set__()``, and\n``__delete__()``. If any of those methods are defined for an object,\nit is said to be a descriptor.\n\nThe default behavior for attribute access is to get, set, or delete\nthe attribute from an object\'s dictionary. For instance, ``a.x`` has a\nlookup chain starting with ``a.__dict__[\'x\']``, then\n``type(a).__dict__[\'x\']``, and continuing through the base classes of\n``type(a)`` excluding metaclasses.\n\nHowever, if the looked-up value is an object defining one of the\ndescriptor methods, then Python may override the default behavior and\ninvoke the descriptor method instead. Where this occurs in the\nprecedence chain depends on which descriptor methods were defined and\nhow they were called. Note that descriptors are only invoked for new\nstyle objects or classes (ones that subclass ``object()`` or\n``type()``).\n\nThe starting point for descriptor invocation is a binding, ``a.x``.\nHow the arguments are assembled depends on ``a``:\n\nDirect Call\n The simplest and least common call is when user code directly\n invokes a descriptor method: ``x.__get__(a)``.\n\nInstance Binding\n If binding to a new-style object instance, ``a.x`` is transformed\n into the call: ``type(a).__dict__[\'x\'].__get__(a, type(a))``.\n\nClass Binding\n If binding to a new-style class, ``A.x`` is transformed into the\n call: ``A.__dict__[\'x\'].__get__(None, A)``.\n\nSuper Binding\n If ``a`` is an instance of ``super``, then the binding ``super(B,\n obj).m()`` searches ``obj.__class__.__mro__`` for the base class\n ``A`` immediately preceding ``B`` and then invokes the descriptor\n with the call: ``A.__dict__[\'m\'].__get__(obj, A)``.\n\nFor instance bindings, the precedence of descriptor invocation depends\non the which descriptor methods are defined. Normally, data\ndescriptors define both ``__get__()`` and ``__set__()``, while non-\ndata descriptors have just the ``__get__()`` method. Data descriptors\nalways override a redefinition in an instance dictionary. In\ncontrast, non-data descriptors can be overridden by instances. [2]\n\nPython methods (including ``staticmethod()`` and ``classmethod()``)\nare implemented as non-data descriptors. Accordingly, instances can\nredefine and override methods. This allows individual instances to\nacquire behaviors that differ from other instances of the same class.\n\nThe ``property()`` function is implemented as a data descriptor.\nAccordingly, instances cannot override the behavior of a property.\n\n\n__slots__\n=========\n\nBy default, instances of both old and new-style classes have a\ndictionary for attribute storage. This wastes space for objects\nhaving very few instance variables. The space consumption can become\nacute when creating large numbers of instances.\n\nThe default can be overridden by defining *__slots__* in a new-style\nclass definition. The *__slots__* declaration takes a sequence of\ninstance variables and reserves just enough space in each instance to\nhold a value for each variable. Space is saved because *__dict__* is\nnot created for each instance.\n\n__slots__\n\n This class variable can be assigned a string, iterable, or sequence\n of strings with variable names used by instances. If defined in a\n new-style class, *__slots__* reserves space for the declared\n variables and prevents the automatic creation of *__dict__* and\n *__weakref__* for each instance.\n\n New in version 2.2.\n\nNotes on using *__slots__*\n\n* When inheriting from a class without *__slots__*, the *__dict__*\n attribute of that class will always be accessible, so a *__slots__*\n definition in the subclass is meaningless.\n\n* Without a *__dict__* variable, instances cannot be assigned new\n variables not listed in the *__slots__* definition. Attempts to\n assign to an unlisted variable name raises ``AttributeError``. If\n dynamic assignment of new variables is desired, then add\n ``\'__dict__\'`` to the sequence of strings in the *__slots__*\n declaration.\n\n Changed in version 2.3: Previously, adding ``\'__dict__\'`` to the\n *__slots__* declaration would not enable the assignment of new\n attributes not specifically listed in the sequence of instance\n variable names.\n\n* Without a *__weakref__* variable for each instance, classes defining\n *__slots__* do not support weak references to its instances. If weak\n reference support is needed, then add ``\'__weakref__\'`` to the\n sequence of strings in the *__slots__* declaration.\n\n Changed in version 2.3: Previously, adding ``\'__weakref__\'`` to the\n *__slots__* declaration would not enable support for weak\n references.\n\n* *__slots__* are implemented at the class level by creating\n descriptors (*Implementing Descriptors*) for each variable name. As\n a result, class attributes cannot be used to set default values for\n instance variables defined by *__slots__*; otherwise, the class\n attribute would overwrite the descriptor assignment.\n\n* If a class defines a slot also defined in a base class, the instance\n variable defined by the base class slot is inaccessible (except by\n retrieving its descriptor directly from the base class). This\n renders the meaning of the program undefined. In the future, a\n check may be added to prevent this.\n\n* The action of a *__slots__* declaration is limited to the class\n where it is defined. As a result, subclasses will have a *__dict__*\n unless they also define *__slots__*.\n\n* *__slots__* do not work for classes derived from "variable-length"\n built-in types such as ``long``, ``str`` and ``tuple``.\n\n* Any non-string iterable may be assigned to *__slots__*. Mappings may\n also be used; however, in the future, special meaning may be\n assigned to the values corresponding to each key.\n\n* *__class__* assignment works only if both classes have the same\n *__slots__*.\n\n Changed in version 2.6: Previously, *__class__* assignment raised an\n error if either new or old class had *__slots__*.\n', 'attribute-references': u'\nAttribute references\n********************\n\nAn attribute reference is a primary followed by a period and a name:\n\n attributeref ::= primary "." identifier\n\nThe primary must evaluate to an object of a type that supports\nattribute references, e.g., a module, list, or an instance. This\nobject is then asked to produce the attribute whose name is the\nidentifier. If this attribute is not available, the exception\n``AttributeError`` is raised. Otherwise, the type and value of the\nobject produced is determined by the object. Multiple evaluations of\nthe same attribute reference may yield different objects.\n', - 'augassign': u'\nAugmented assignment statements\n*******************************\n\nAugmented assignment is the combination, in a single statement, of a\nbinary operation and an assignment statement:\n\n augmented_assignment_stmt ::= target augop (expression_list | yield_expression)\n augop ::= "+=" | "-=" | "*=" | "/=" | "%=" | "**="\n | ">>=" | "<<=" | "&=" | "^=" | "|="\n\n(See section *Primaries* for the syntax definitions for the last three\nsymbols.)\n\nAn augmented assignment evaluates the target (which, unlike normal\nassignment statements, cannot be an unpacking) and the expression\nlist, performs the binary operation specific to the type of assignment\non the two operands, and assigns the result to the original target.\nThe target is only evaluated once.\n\nAn augmented assignment expression like ``x += 1`` can be rewritten as\n``x = x + 1`` to achieve a similar, but not exactly equal effect. In\nthe augmented version, ``x`` is only evaluated once. Also, when\npossible, the actual operation is performed *in-place*, meaning that\nrather than creating a new object and assigning that to the target,\nthe old object is modified instead.\n\nWith the exception of assigning to tuples and multiple targets in a\nsingle statement, the assignment done by augmented assignment\nstatements is handled the same way as normal assignments. Similarly,\nwith the exception of the possible *in-place* behavior, the binary\noperation performed by augmented assignment is the same as the normal\nbinary operations.\n\nFor targets which are attribute references, the initial value is\nretrieved with a ``getattr()`` and the result is assigned with a\n``setattr()``. Notice that the two methods do not necessarily refer\nto the same variable. When ``getattr()`` refers to a class variable,\n``setattr()`` still writes to an instance variable. For example:\n\n class A:\n x = 3 # class variable\n a = A()\n a.x += 1 # writes a.x as 4 leaving A.x as 3\n', - 'binary': u'\nBinary arithmetic operations\n****************************\n\nThe binary arithmetic operations have the conventional priority\nlevels. Note that some of these operations also apply to certain non-\nnumeric types. Apart from the power operator, there are only two\nlevels, one for multiplicative operators and one for additive\noperators:\n\n m_expr ::= u_expr | m_expr "*" u_expr | m_expr "//" u_expr | m_expr "/" u_expr\n | m_expr "%" u_expr\n a_expr ::= m_expr | a_expr "+" m_expr | a_expr "-" m_expr\n\nThe ``*`` (multiplication) operator yields the product of its\narguments. The arguments must either both be numbers, or one argument\nmust be an integer (plain or long) and the other must be a sequence.\nIn the former case, the numbers are converted to a common type and\nthen multiplied together. In the latter case, sequence repetition is\nperformed; a negative repetition factor yields an empty sequence.\n\nThe ``/`` (division) and ``//`` (floor division) operators yield the\nquotient of their arguments. The numeric arguments are first\nconverted to a common type. Plain or long integer division yields an\ninteger of the same type; the result is that of mathematical division\nwith the \'floor\' function applied to the result. Division by zero\nraises the ``ZeroDivisionError`` exception.\n\nThe ``%`` (modulo) operator yields the remainder from the division of\nthe first argument by the second. The numeric arguments are first\nconverted to a common type. A zero right argument raises the\n``ZeroDivisionError`` exception. The arguments may be floating point\nnumbers, e.g., ``3.14%0.7`` equals ``0.34`` (since ``3.14`` equals\n``4*0.7 + 0.34``.) The modulo operator always yields a result with\nthe same sign as its second operand (or zero); the absolute value of\nthe result is strictly smaller than the absolute value of the second\noperand [2].\n\nThe integer division and modulo operators are connected by the\nfollowing identity: ``x == (x/y)*y + (x%y)``. Integer division and\nmodulo are also connected with the built-in function ``divmod()``:\n``divmod(x, y) == (x/y, x%y)``. These identities don\'t hold for\nfloating point numbers; there similar identities hold approximately\nwhere ``x/y`` is replaced by ``floor(x/y)`` or ``floor(x/y) - 1`` [3].\n\nIn addition to performing the modulo operation on numbers, the ``%``\noperator is also overloaded by string and unicode objects to perform\nstring formatting (also known as interpolation). The syntax for string\nformatting is described in the Python Library Reference, section\n*String Formatting Operations*.\n\nDeprecated in version 2.3: The floor division operator, the modulo\noperator, and the ``divmod()`` function are no longer defined for\ncomplex numbers. Instead, convert to a floating point number using\nthe ``abs()`` function if appropriate.\n\nThe ``+`` (addition) operator yields the sum of its arguments. The\narguments must either both be numbers or both sequences of the same\ntype. In the former case, the numbers are converted to a common type\nand then added together. In the latter case, the sequences are\nconcatenated.\n\nThe ``-`` (subtraction) operator yields the difference of its\narguments. The numeric arguments are first converted to a common\ntype.\n', + 'augassign': u'\nAugmented assignment statements\n*******************************\n\nAugmented assignment is the combination, in a single statement, of a\nbinary operation and an assignment statement:\n\n augmented_assignment_stmt ::= target augop (expression_list | yield_expression)\n augop ::= "+=" | "-=" | "*=" | "/=" | "//=" | "%=" | "**="\n | ">>=" | "<<=" | "&=" | "^=" | "|="\n\n(See section *Primaries* for the syntax definitions for the last three\nsymbols.)\n\nAn augmented assignment evaluates the target (which, unlike normal\nassignment statements, cannot be an unpacking) and the expression\nlist, performs the binary operation specific to the type of assignment\non the two operands, and assigns the result to the original target.\nThe target is only evaluated once.\n\nAn augmented assignment expression like ``x += 1`` can be rewritten as\n``x = x + 1`` to achieve a similar, but not exactly equal effect. In\nthe augmented version, ``x`` is only evaluated once. Also, when\npossible, the actual operation is performed *in-place*, meaning that\nrather than creating a new object and assigning that to the target,\nthe old object is modified instead.\n\nWith the exception of assigning to tuples and multiple targets in a\nsingle statement, the assignment done by augmented assignment\nstatements is handled the same way as normal assignments. Similarly,\nwith the exception of the possible *in-place* behavior, the binary\noperation performed by augmented assignment is the same as the normal\nbinary operations.\n\nFor targets which are attribute references, the initial value is\nretrieved with a ``getattr()`` and the result is assigned with a\n``setattr()``. Notice that the two methods do not necessarily refer\nto the same variable. When ``getattr()`` refers to a class variable,\n``setattr()`` still writes to an instance variable. For example:\n\n class A:\n x = 3 # class variable\n a = A()\n a.x += 1 # writes a.x as 4 leaving A.x as 3\n', + 'binary': u'\nBinary arithmetic operations\n****************************\n\nThe binary arithmetic operations have the conventional priority\nlevels. Note that some of these operations also apply to certain non-\nnumeric types. Apart from the power operator, there are only two\nlevels, one for multiplicative operators and one for additive\noperators:\n\n m_expr ::= u_expr | m_expr "*" u_expr | m_expr "//" u_expr | m_expr "/" u_expr\n | m_expr "%" u_expr\n a_expr ::= m_expr | a_expr "+" m_expr | a_expr "-" m_expr\n\nThe ``*`` (multiplication) operator yields the product of its\narguments. The arguments must either both be numbers, or one argument\nmust be an integer (plain or long) and the other must be a sequence.\nIn the former case, the numbers are converted to a common type and\nthen multiplied together. In the latter case, sequence repetition is\nperformed; a negative repetition factor yields an empty sequence.\n\nThe ``/`` (division) and ``//`` (floor division) operators yield the\nquotient of their arguments. The numeric arguments are first\nconverted to a common type. Plain or long integer division yields an\ninteger of the same type; the result is that of mathematical division\nwith the \'floor\' function applied to the result. Division by zero\nraises the ``ZeroDivisionError`` exception.\n\nThe ``%`` (modulo) operator yields the remainder from the division of\nthe first argument by the second. The numeric arguments are first\nconverted to a common type. A zero right argument raises the\n``ZeroDivisionError`` exception. The arguments may be floating point\nnumbers, e.g., ``3.14%0.7`` equals ``0.34`` (since ``3.14`` equals\n``4*0.7 + 0.34``.) The modulo operator always yields a result with\nthe same sign as its second operand (or zero); the absolute value of\nthe result is strictly smaller than the absolute value of the second\noperand [2].\n\nThe integer division and modulo operators are connected by the\nfollowing identity: ``x == (x/y)*y + (x%y)``. Integer division and\nmodulo are also connected with the built-in function ``divmod()``:\n``divmod(x, y) == (x/y, x%y)``. These identities don\'t hold for\nfloating point numbers; there similar identities hold approximately\nwhere ``x/y`` is replaced by ``floor(x/y)`` or ``floor(x/y) - 1`` [3].\n\nIn addition to performing the modulo operation on numbers, the ``%``\noperator is also overloaded by string and unicode objects to perform\nstring formatting (also known as interpolation). The syntax for string\nformatting is described in the Python Library Reference, section\n*String Formatting Operations*.\n\nDeprecated since version 2.3: The floor division operator, the modulo\noperator, and the ``divmod()`` function are no longer defined for\ncomplex numbers. Instead, convert to a floating point number using\nthe ``abs()`` function if appropriate.\n\nThe ``+`` (addition) operator yields the sum of its arguments. The\narguments must either both be numbers or both sequences of the same\ntype. In the former case, the numbers are converted to a common type\nand then added together. In the latter case, the sequences are\nconcatenated.\n\nThe ``-`` (subtraction) operator yields the difference of its\narguments. The numeric arguments are first converted to a common\ntype.\n', 'bitwise': u'\nBinary bitwise operations\n*************************\n\nEach of the three bitwise operations has a different priority level:\n\n and_expr ::= shift_expr | and_expr "&" shift_expr\n xor_expr ::= and_expr | xor_expr "^" and_expr\n or_expr ::= xor_expr | or_expr "|" xor_expr\n\nThe ``&`` operator yields the bitwise AND of its arguments, which must\nbe plain or long integers. The arguments are converted to a common\ntype.\n\nThe ``^`` operator yields the bitwise XOR (exclusive OR) of its\narguments, which must be plain or long integers. The arguments are\nconverted to a common type.\n\nThe ``|`` operator yields the bitwise (inclusive) OR of its arguments,\nwhich must be plain or long integers. The arguments are converted to\na common type.\n', 'bltin-code-objects': u'\nCode Objects\n************\n\nCode objects are used by the implementation to represent "pseudo-\ncompiled" executable Python code such as a function body. They differ\nfrom function objects because they don\'t contain a reference to their\nglobal execution environment. Code objects are returned by the built-\nin ``compile()`` function and can be extracted from function objects\nthrough their ``func_code`` attribute. See also the ``code`` module.\n\nA code object can be executed or evaluated by passing it (instead of a\nsource string) to the ``exec`` statement or the built-in ``eval()``\nfunction.\n\nSee *The standard type hierarchy* for more information.\n', 'bltin-ellipsis-object': u'\nThe Ellipsis Object\n*******************\n\nThis object is used by extended slice notation (see *Slicings*). It\nsupports no special operations. There is exactly one ellipsis object,\nnamed ``Ellipsis`` (a built-in name).\n\nIt is written as ``Ellipsis``.\n', - 'bltin-file-objects': u'\nFile Objects\n************\n\nFile objects are implemented using C\'s ``stdio`` package and can be\ncreated with the built-in ``open()`` function. File objects are also\nreturned by some other built-in functions and methods, such as\n``os.popen()`` and ``os.fdopen()`` and the ``makefile()`` method of\nsocket objects. Temporary files can be created using the ``tempfile``\nmodule, and high-level file operations such as copying, moving, and\ndeleting files and directories can be achieved with the ``shutil``\nmodule.\n\nWhen a file operation fails for an I/O-related reason, the exception\n``IOError`` is raised. This includes situations where the operation\nis not defined for some reason, like ``seek()`` on a tty device or\nwriting a file opened for reading.\n\nFiles have the following methods:\n\nfile.close()\n\n Close the file. A closed file cannot be read or written any more.\n Any operation which requires that the file be open will raise a\n ``ValueError`` after the file has been closed. Calling ``close()``\n more than once is allowed.\n\n As of Python 2.5, you can avoid having to call this method\n explicitly if you use the ``with`` statement. For example, the\n following code will automatically close *f* when the ``with`` block\n is exited:\n\n from __future__ import with_statement\n\n with open("hello.txt") as f:\n for line in f:\n print line\n\n In older versions of Python, you would have needed to do this to\n get the same effect:\n\n f = open("hello.txt")\n try:\n for line in f:\n print line\n finally:\n f.close()\n\n Note: Not all "file-like" types in Python support use as a context\n manager for the ``with`` statement. If your code is intended to\n work with any file-like object, you can use the function\n ``contextlib.closing()`` instead of using the object directly.\n\nfile.flush()\n\n Flush the internal buffer, like ``stdio``\'s ``fflush``. This may\n be a no-op on some file-like objects.\n\nfile.fileno()\n\n Return the integer "file descriptor" that is used by the underlying\n implementation to request I/O operations from the operating system.\n This can be useful for other, lower level interfaces that use file\n descriptors, such as the ``fcntl`` module or ``os.read()`` and\n friends.\n\n Note: File-like objects which do not have a real file descriptor should\n *not* provide this method!\n\nfile.isatty()\n\n Return ``True`` if the file is connected to a tty(-like) device,\n else ``False``.\n\n Note: If a file-like object is not associated with a real file, this\n method should *not* be implemented.\n\nfile.next()\n\n A file object is its own iterator, for example ``iter(f)`` returns\n *f* (unless *f* is closed). When a file is used as an iterator,\n typically in a ``for`` loop (for example, ``for line in f: print\n line``), the ``next()`` method is called repeatedly. This method\n returns the next input line, or raises ``StopIteration`` when EOF\n is hit when the file is open for reading (behavior is undefined\n when the file is open for writing). In order to make a ``for``\n loop the most efficient way of looping over the lines of a file (a\n very common operation), the ``next()`` method uses a hidden read-\n ahead buffer. As a consequence of using a read-ahead buffer,\n combining ``next()`` with other file methods (like ``readline()``)\n does not work right. However, using ``seek()`` to reposition the\n file to an absolute position will flush the read-ahead buffer.\n\n Added in version 2.3.\n\nfile.read([size])\n\n Read at most *size* bytes from the file (less if the read hits EOF\n before obtaining *size* bytes). If the *size* argument is negative\n or omitted, read all data until EOF is reached. The bytes are\n returned as a string object. An empty string is returned when EOF\n is encountered immediately. (For certain files, like ttys, it\n makes sense to continue reading after an EOF is hit.) Note that\n this method may call the underlying C function ``fread`` more than\n once in an effort to acquire as close to *size* bytes as possible.\n Also note that when in non-blocking mode, less data than what was\n requested may be returned, even if no *size* parameter was given.\n\nfile.readline([size])\n\n Read one entire line from the file. A trailing newline character\n is kept in the string (but may be absent when a file ends with an\n incomplete line). [6] If the *size* argument is present and non-\n negative, it is a maximum byte count (including the trailing\n newline) and an incomplete line may be returned. An empty string is\n returned *only* when EOF is encountered immediately.\n\n Note: Unlike ``stdio``\'s ``fgets``, the returned string contains null\n characters (``\'\\0\'``) if they occurred in the input.\n\nfile.readlines([sizehint])\n\n Read until EOF using ``readline()`` and return a list containing\n the lines thus read. If the optional *sizehint* argument is\n present, instead of reading up to EOF, whole lines totalling\n approximately *sizehint* bytes (possibly after rounding up to an\n internal buffer size) are read. Objects implementing a file-like\n interface may choose to ignore *sizehint* if it cannot be\n implemented, or cannot be implemented efficiently.\n\nfile.xreadlines()\n\n This method returns the same thing as ``iter(f)``.\n\n Added in version 2.1.\n\n Deprecated in version 2.3: Use ``for line in file`` instead.\n\nfile.seek(offset[, whence])\n\n Set the file\'s current position, like ``stdio``\'s ``fseek``. The\n *whence* argument is optional and defaults to ``os.SEEK_SET`` or\n ``0`` (absolute file positioning); other values are ``os.SEEK_CUR``\n or ``1`` (seek relative to the current position) and\n ``os.SEEK_END`` or ``2`` (seek relative to the file\'s end). There\n is no return value.\n\n For example, ``f.seek(2, os.SEEK_CUR)`` advances the position by\n two and ``f.seek(-3, os.SEEK_END)`` sets the position to the third\n to last.\n\n Note that if the file is opened for appending (mode ``\'a\'`` or\n ``\'a+\'``), any ``seek()`` operations will be undone at the next\n write. If the file is only opened for writing in append mode (mode\n ``\'a\'``), this method is essentially a no-op, but it remains useful\n for files opened in append mode with reading enabled (mode\n ``\'a+\'``). If the file is opened in text mode (without ``\'b\'``),\n only offsets returned by ``tell()`` are legal. Use of other\n offsets causes undefined behavior.\n\n Note that not all file objects are seekable.\n\n Changed in version 2.6: Passing float values as offset has been\n deprecated.\n\nfile.tell()\n\n Return the file\'s current position, like ``stdio``\'s ``ftell``.\n\n Note: On Windows, ``tell()`` can return illegal values (after an\n ``fgets``) when reading files with Unix-style line-endings. Use\n binary mode (``\'rb\'``) to circumvent this problem.\n\nfile.truncate([size])\n\n Truncate the file\'s size. If the optional *size* argument is\n present, the file is truncated to (at most) that size. The size\n defaults to the current position. The current file position is not\n changed. Note that if a specified size exceeds the file\'s current\n size, the result is platform-dependent: possibilities include that\n the file may remain unchanged, increase to the specified size as if\n zero-filled, or increase to the specified size with undefined new\n content. Availability: Windows, many Unix variants.\n\nfile.write(str)\n\n Write a string to the file. There is no return value. Due to\n buffering, the string may not actually show up in the file until\n the ``flush()`` or ``close()`` method is called.\n\nfile.writelines(sequence)\n\n Write a sequence of strings to the file. The sequence can be any\n iterable object producing strings, typically a list of strings.\n There is no return value. (The name is intended to match\n ``readlines()``; ``writelines()`` does not add line separators.)\n\nFiles support the iterator protocol. Each iteration returns the same\nresult as ``file.readline()``, and iteration ends when the\n``readline()`` method returns an empty string.\n\nFile objects also offer a number of other interesting attributes.\nThese are not required for file-like objects, but should be\nimplemented if they make sense for the particular object.\n\nfile.closed\n\n bool indicating the current state of the file object. This is a\n read-only attribute; the ``close()`` method changes the value. It\n may not be available on all file-like objects.\n\nfile.encoding\n\n The encoding that this file uses. When Unicode strings are written\n to a file, they will be converted to byte strings using this\n encoding. In addition, when the file is connected to a terminal,\n the attribute gives the encoding that the terminal is likely to use\n (that information might be incorrect if the user has misconfigured\n the terminal). The attribute is read-only and may not be present\n on all file-like objects. It may also be ``None``, in which case\n the file uses the system default encoding for converting Unicode\n strings.\n\n Added in version 2.3.\n\nfile.errors\n\n The Unicode error handler used to along with the encoding.\n\n Added in version 2.6.\n\nfile.mode\n\n The I/O mode for the file. If the file was created using the\n ``open()`` built-in function, this will be the value of the *mode*\n parameter. This is a read-only attribute and may not be present on\n all file-like objects.\n\nfile.name\n\n If the file object was created using ``open()``, the name of the\n file. Otherwise, some string that indicates the source of the file\n object, of the form ``<...>``. This is a read-only attribute and\n may not be present on all file-like objects.\n\nfile.newlines\n\n If Python was built with the *--with-universal-newlines* option to\n **configure** (the default) this read-only attribute exists, and\n for files opened in universal newline read mode it keeps track of\n the types of newlines encountered while reading the file. The\n values it can take are ``\'\\r\'``, ``\'\\n\'``, ``\'\\r\\n\'``, ``None``\n (unknown, no newlines read yet) or a tuple containing all the\n newline types seen, to indicate that multiple newline conventions\n were encountered. For files not opened in universal newline read\n mode the value of this attribute will be ``None``.\n\nfile.softspace\n\n Boolean that indicates whether a space character needs to be\n printed before another value when using the ``print`` statement.\n Classes that are trying to simulate a file object should also have\n a writable ``softspace`` attribute, which should be initialized to\n zero. This will be automatic for most classes implemented in\n Python (care may be needed for objects that override attribute\n access); types implemented in C will have to provide a writable\n ``softspace`` attribute.\n\n Note: This attribute is not used to control the ``print`` statement,\n but to allow the implementation of ``print`` to keep track of its\n internal state.\n', + 'bltin-file-objects': u'\nFile Objects\n************\n\nFile objects are implemented using C\'s ``stdio`` package and can be\ncreated with the built-in ``open()`` function. File objects are also\nreturned by some other built-in functions and methods, such as\n``os.popen()`` and ``os.fdopen()`` and the ``makefile()`` method of\nsocket objects. Temporary files can be created using the ``tempfile``\nmodule, and high-level file operations such as copying, moving, and\ndeleting files and directories can be achieved with the ``shutil``\nmodule.\n\nWhen a file operation fails for an I/O-related reason, the exception\n``IOError`` is raised. This includes situations where the operation\nis not defined for some reason, like ``seek()`` on a tty device or\nwriting a file opened for reading.\n\nFiles have the following methods:\n\nfile.close()\n\n Close the file. A closed file cannot be read or written any more.\n Any operation which requires that the file be open will raise a\n ``ValueError`` after the file has been closed. Calling ``close()``\n more than once is allowed.\n\n As of Python 2.5, you can avoid having to call this method\n explicitly if you use the ``with`` statement. For example, the\n following code will automatically close *f* when the ``with`` block\n is exited:\n\n from __future__ import with_statement # This isn\'t required in Python 2.6\n\n with open("hello.txt") as f:\n for line in f:\n print line\n\n In older versions of Python, you would have needed to do this to\n get the same effect:\n\n f = open("hello.txt")\n try:\n for line in f:\n print line\n finally:\n f.close()\n\n Note: Not all "file-like" types in Python support use as a context\n manager for the ``with`` statement. If your code is intended to\n work with any file-like object, you can use the function\n ``contextlib.closing()`` instead of using the object directly.\n\nfile.flush()\n\n Flush the internal buffer, like ``stdio``\'s ``fflush``. This may\n be a no-op on some file-like objects.\n\nfile.fileno()\n\n Return the integer "file descriptor" that is used by the underlying\n implementation to request I/O operations from the operating system.\n This can be useful for other, lower level interfaces that use file\n descriptors, such as the ``fcntl`` module or ``os.read()`` and\n friends.\n\n Note: File-like objects which do not have a real file descriptor should\n *not* provide this method!\n\nfile.isatty()\n\n Return ``True`` if the file is connected to a tty(-like) device,\n else ``False``.\n\n Note: If a file-like object is not associated with a real file, this\n method should *not* be implemented.\n\nfile.next()\n\n A file object is its own iterator, for example ``iter(f)`` returns\n *f* (unless *f* is closed). When a file is used as an iterator,\n typically in a ``for`` loop (for example, ``for line in f: print\n line``), the ``next()`` method is called repeatedly. This method\n returns the next input line, or raises ``StopIteration`` when EOF\n is hit when the file is open for reading (behavior is undefined\n when the file is open for writing). In order to make a ``for``\n loop the most efficient way of looping over the lines of a file (a\n very common operation), the ``next()`` method uses a hidden read-\n ahead buffer. As a consequence of using a read-ahead buffer,\n combining ``next()`` with other file methods (like ``readline()``)\n does not work right. However, using ``seek()`` to reposition the\n file to an absolute position will flush the read-ahead buffer.\n\n New in version 2.3.\n\nfile.read([size])\n\n Read at most *size* bytes from the file (less if the read hits EOF\n before obtaining *size* bytes). If the *size* argument is negative\n or omitted, read all data until EOF is reached. The bytes are\n returned as a string object. An empty string is returned when EOF\n is encountered immediately. (For certain files, like ttys, it\n makes sense to continue reading after an EOF is hit.) Note that\n this method may call the underlying C function ``fread`` more than\n once in an effort to acquire as close to *size* bytes as possible.\n Also note that when in non-blocking mode, less data than was\n requested may be returned, even if no *size* parameter was given.\n\n Note: This function is simply a wrapper for the underlying ``fread`` C\n function, and will behave the same in corner cases, such as\n whether the EOF value is cached.\n\nfile.readline([size])\n\n Read one entire line from the file. A trailing newline character\n is kept in the string (but may be absent when a file ends with an\n incomplete line). [6] If the *size* argument is present and non-\n negative, it is a maximum byte count (including the trailing\n newline) and an incomplete line may be returned. An empty string is\n returned *only* when EOF is encountered immediately.\n\n Note: Unlike ``stdio``\'s ``fgets``, the returned string contains null\n characters (``\'\\0\'``) if they occurred in the input.\n\nfile.readlines([sizehint])\n\n Read until EOF using ``readline()`` and return a list containing\n the lines thus read. If the optional *sizehint* argument is\n present, instead of reading up to EOF, whole lines totalling\n approximately *sizehint* bytes (possibly after rounding up to an\n internal buffer size) are read. Objects implementing a file-like\n interface may choose to ignore *sizehint* if it cannot be\n implemented, or cannot be implemented efficiently.\n\nfile.xreadlines()\n\n This method returns the same thing as ``iter(f)``.\n\n New in version 2.1.\n\n Deprecated since version 2.3: Use ``for line in file`` instead.\n\nfile.seek(offset[, whence])\n\n Set the file\'s current position, like ``stdio``\'s ``fseek``. The\n *whence* argument is optional and defaults to ``os.SEEK_SET`` or\n ``0`` (absolute file positioning); other values are ``os.SEEK_CUR``\n or ``1`` (seek relative to the current position) and\n ``os.SEEK_END`` or ``2`` (seek relative to the file\'s end). There\n is no return value.\n\n For example, ``f.seek(2, os.SEEK_CUR)`` advances the position by\n two and ``f.seek(-3, os.SEEK_END)`` sets the position to the third\n to last.\n\n Note that if the file is opened for appending (mode ``\'a\'`` or\n ``\'a+\'``), any ``seek()`` operations will be undone at the next\n write. If the file is only opened for writing in append mode (mode\n ``\'a\'``), this method is essentially a no-op, but it remains useful\n for files opened in append mode with reading enabled (mode\n ``\'a+\'``). If the file is opened in text mode (without ``\'b\'``),\n only offsets returned by ``tell()`` are legal. Use of other\n offsets causes undefined behavior.\n\n Note that not all file objects are seekable.\n\n Changed in version 2.6: Passing float values as offset has been\n deprecated.\n\nfile.tell()\n\n Return the file\'s current position, like ``stdio``\'s ``ftell``.\n\n Note: On Windows, ``tell()`` can return illegal values (after an\n ``fgets``) when reading files with Unix-style line-endings. Use\n binary mode (``\'rb\'``) to circumvent this problem.\n\nfile.truncate([size])\n\n Truncate the file\'s size. If the optional *size* argument is\n present, the file is truncated to (at most) that size. The size\n defaults to the current position. The current file position is not\n changed. Note that if a specified size exceeds the file\'s current\n size, the result is platform-dependent: possibilities include that\n the file may remain unchanged, increase to the specified size as if\n zero-filled, or increase to the specified size with undefined new\n content. Availability: Windows, many Unix variants.\n\nfile.write(str)\n\n Write a string to the file. There is no return value. Due to\n buffering, the string may not actually show up in the file until\n the ``flush()`` or ``close()`` method is called.\n\nfile.writelines(sequence)\n\n Write a sequence of strings to the file. The sequence can be any\n iterable object producing strings, typically a list of strings.\n There is no return value. (The name is intended to match\n ``readlines()``; ``writelines()`` does not add line separators.)\n\nFiles support the iterator protocol. Each iteration returns the same\nresult as ``file.readline()``, and iteration ends when the\n``readline()`` method returns an empty string.\n\nFile objects also offer a number of other interesting attributes.\nThese are not required for file-like objects, but should be\nimplemented if they make sense for the particular object.\n\nfile.closed\n\n bool indicating the current state of the file object. This is a\n read-only attribute; the ``close()`` method changes the value. It\n may not be available on all file-like objects.\n\nfile.encoding\n\n The encoding that this file uses. When Unicode strings are written\n to a file, they will be converted to byte strings using this\n encoding. In addition, when the file is connected to a terminal,\n the attribute gives the encoding that the terminal is likely to use\n (that information might be incorrect if the user has misconfigured\n the terminal). The attribute is read-only and may not be present\n on all file-like objects. It may also be ``None``, in which case\n the file uses the system default encoding for converting Unicode\n strings.\n\n New in version 2.3.\n\nfile.errors\n\n The Unicode error handler used along with the encoding.\n\n New in version 2.6.\n\nfile.mode\n\n The I/O mode for the file. If the file was created using the\n ``open()`` built-in function, this will be the value of the *mode*\n parameter. This is a read-only attribute and may not be present on\n all file-like objects.\n\nfile.name\n\n If the file object was created using ``open()``, the name of the\n file. Otherwise, some string that indicates the source of the file\n object, of the form ``<...>``. This is a read-only attribute and\n may not be present on all file-like objects.\n\nfile.newlines\n\n If Python was built with the *--with-universal-newlines* option to\n **configure** (the default) this read-only attribute exists, and\n for files opened in universal newline read mode it keeps track of\n the types of newlines encountered while reading the file. The\n values it can take are ``\'\\r\'``, ``\'\\n\'``, ``\'\\r\\n\'``, ``None``\n (unknown, no newlines read yet) or a tuple containing all the\n newline types seen, to indicate that multiple newline conventions\n were encountered. For files not opened in universal newline read\n mode the value of this attribute will be ``None``.\n\nfile.softspace\n\n Boolean that indicates whether a space character needs to be\n printed before another value when using the ``print`` statement.\n Classes that are trying to simulate a file object should also have\n a writable ``softspace`` attribute, which should be initialized to\n zero. This will be automatic for most classes implemented in\n Python (care may be needed for objects that override attribute\n access); types implemented in C will have to provide a writable\n ``softspace`` attribute.\n\n Note: This attribute is not used to control the ``print`` statement,\n but to allow the implementation of ``print`` to keep track of its\n internal state.\n', 'bltin-null-object': u"\nThe Null Object\n***************\n\nThis object is returned by functions that don't explicitly return a\nvalue. It supports no special operations. There is exactly one null\nobject, named ``None`` (a built-in name).\n\nIt is written as ``None``.\n", 'bltin-type-objects': u"\nType Objects\n************\n\nType objects represent the various object types. An object's type is\naccessed by the built-in function ``type()``. There are no special\noperations on types. The standard module ``types`` defines names for\nall standard built-in types.\n\nTypes are written like this: ````.\n", - 'booleans': u'\nBoolean operations\n******************\n\nBoolean operations have the lowest priority of all Python operations:\n\n expression ::= conditional_expression | lambda_form\n old_expression ::= or_test | old_lambda_form\n conditional_expression ::= or_test ["if" or_test "else" expression]\n or_test ::= and_test | or_test "or" and_test\n and_test ::= not_test | and_test "and" not_test\n not_test ::= comparison | "not" not_test\n\nIn the context of Boolean operations, and also when expressions are\nused by control flow statements, the following values are interpreted\nas false: ``False``, ``None``, numeric zero of all types, and empty\nstrings and containers (including strings, tuples, lists,\ndictionaries, sets and frozensets). All other values are interpreted\nas true.\n\nThe operator ``not`` yields ``True`` if its argument is false,\n``False`` otherwise.\n\nThe expression ``x if C else y`` first evaluates *C* (*not* *x*); if\n*C* is true, *x* is evaluated and its value is returned; otherwise,\n*y* is evaluated and its value is returned.\n\nAdded in version 2.5.\n\nThe expression ``x and y`` first evaluates *x*; if *x* is false, its\nvalue is returned; otherwise, *y* is evaluated and the resulting value\nis returned.\n\nThe expression ``x or y`` first evaluates *x*; if *x* is true, its\nvalue is returned; otherwise, *y* is evaluated and the resulting value\nis returned.\n\n(Note that neither ``and`` nor ``or`` restrict the value and type they\nreturn to ``False`` and ``True``, but rather return the last evaluated\nargument. This is sometimes useful, e.g., if ``s`` is a string that\nshould be replaced by a default value if it is empty, the expression\n``s or \'foo\'`` yields the desired value. Because ``not`` has to\ninvent a value anyway, it does not bother to return a value of the\nsame type as its argument, so e.g., ``not \'foo\'`` yields ``False``,\nnot ``\'\'``.)\n', + 'booleans': u'\nBoolean operations\n******************\n\nBoolean operations have the lowest priority of all Python operations:\n\n expression ::= conditional_expression | lambda_form\n old_expression ::= or_test | old_lambda_form\n conditional_expression ::= or_test ["if" or_test "else" expression]\n or_test ::= and_test | or_test "or" and_test\n and_test ::= not_test | and_test "and" not_test\n not_test ::= comparison | "not" not_test\n\nIn the context of Boolean operations, and also when expressions are\nused by control flow statements, the following values are interpreted\nas false: ``False``, ``None``, numeric zero of all types, and empty\nstrings and containers (including strings, tuples, lists,\ndictionaries, sets and frozensets). All other values are interpreted\nas true. (See the ``__nonzero__()`` special method for a way to\nchange this.)\n\nThe operator ``not`` yields ``True`` if its argument is false,\n``False`` otherwise.\n\nThe expression ``x if C else y`` first evaluates *C* (*not* *x*); if\n*C* is true, *x* is evaluated and its value is returned; otherwise,\n*y* is evaluated and its value is returned.\n\nNew in version 2.5.\n\nThe expression ``x and y`` first evaluates *x*; if *x* is false, its\nvalue is returned; otherwise, *y* is evaluated and the resulting value\nis returned.\n\nThe expression ``x or y`` first evaluates *x*; if *x* is true, its\nvalue is returned; otherwise, *y* is evaluated and the resulting value\nis returned.\n\n(Note that neither ``and`` nor ``or`` restrict the value and type they\nreturn to ``False`` and ``True``, but rather return the last evaluated\nargument. This is sometimes useful, e.g., if ``s`` is a string that\nshould be replaced by a default value if it is empty, the expression\n``s or \'foo\'`` yields the desired value. Because ``not`` has to\ninvent a value anyway, it does not bother to return a value of the\nsame type as its argument, so e.g., ``not \'foo\'`` yields ``False``,\nnot ``\'\'``.)\n', 'break': u'\nThe ``break`` statement\n***********************\n\n break_stmt ::= "break"\n\n``break`` may only occur syntactically nested in a ``for`` or\n``while`` loop, but not nested in a function or class definition\nwithin that loop.\n\nIt terminates the nearest enclosing loop, skipping the optional\n``else`` clause if the loop has one.\n\nIf a ``for`` loop is terminated by ``break``, the loop control target\nkeeps its current value.\n\nWhen ``break`` passes control out of a ``try`` statement with a\n``finally`` clause, that ``finally`` clause is executed before really\nleaving the loop.\n', 'callable-types': u'\nEmulating callable objects\n**************************\n\nobject.__call__(self[, args...])\n\n Called when the instance is "called" as a function; if this method\n is defined, ``x(arg1, arg2, ...)`` is a shorthand for\n ``x.__call__(arg1, arg2, ...)``.\n', - 'calls': u'\nCalls\n*****\n\nA call calls a callable object (e.g., a function) with a possibly\nempty series of arguments:\n\n call ::= primary "(" [argument_list [","]\n | expression genexpr_for] ")"\n argument_list ::= positional_arguments ["," keyword_arguments]\n ["," "*" expression]\n ["," "**" expression]\n | keyword_arguments ["," "*" expression]\n ["," "**" expression]\n | "*" expression ["," "**" expression]\n | "**" expression\n positional_arguments ::= expression ("," expression)*\n keyword_arguments ::= keyword_item ("," keyword_item)*\n keyword_item ::= identifier "=" expression\n\nA trailing comma may be present after the positional and keyword\narguments but does not affect the semantics.\n\nThe primary must evaluate to a callable object (user-defined\nfunctions, built-in functions, methods of built-in objects, class\nobjects, methods of class instances, and certain class instances\nthemselves are callable; extensions may define additional callable\nobject types). All argument expressions are evaluated before the call\nis attempted. Please refer to section *Function definitions* for the\nsyntax of formal parameter lists.\n\nIf keyword arguments are present, they are first converted to\npositional arguments, as follows. First, a list of unfilled slots is\ncreated for the formal parameters. If there are N positional\narguments, they are placed in the first N slots. Next, for each\nkeyword argument, the identifier is used to determine the\ncorresponding slot (if the identifier is the same as the first formal\nparameter name, the first slot is used, and so on). If the slot is\nalready filled, a ``TypeError`` exception is raised. Otherwise, the\nvalue of the argument is placed in the slot, filling it (even if the\nexpression is ``None``, it fills the slot). When all arguments have\nbeen processed, the slots that are still unfilled are filled with the\ncorresponding default value from the function definition. (Default\nvalues are calculated, once, when the function is defined; thus, a\nmutable object such as a list or dictionary used as default value will\nbe shared by all calls that don\'t specify an argument value for the\ncorresponding slot; this should usually be avoided.) If there are any\nunfilled slots for which no default value is specified, a\n``TypeError`` exception is raised. Otherwise, the list of filled\nslots is used as the argument list for the call.\n\nNote: An implementation may provide builtin functions whose positional\n parameters do not have names, even if they are \'named\' for the\n purpose of documentation, and which therefore cannot be supplied by\n keyword. In CPython, this is the case for functions implemented in\n C that use ``PyArg_ParseTuple`` to parse their arguments.\n\nIf there are more positional arguments than there are formal parameter\nslots, a ``TypeError`` exception is raised, unless a formal parameter\nusing the syntax ``*identifier`` is present; in this case, that formal\nparameter receives a tuple containing the excess positional arguments\n(or an empty tuple if there were no excess positional arguments).\n\nIf any keyword argument does not correspond to a formal parameter\nname, a ``TypeError`` exception is raised, unless a formal parameter\nusing the syntax ``**identifier`` is present; in this case, that\nformal parameter receives a dictionary containing the excess keyword\narguments (using the keywords as keys and the argument values as\ncorresponding values), or a (new) empty dictionary if there were no\nexcess keyword arguments.\n\nIf the syntax ``*expression`` appears in the function call,\n``expression`` must evaluate to a sequence. Elements from this\nsequence are treated as if they were additional positional arguments;\nif there are positional arguments *x1*,...,*xN* , and ``expression``\nevaluates to a sequence *y1*,...,*yM*, this is equivalent to a call\nwith M+N positional arguments *x1*,...,*xN*,*y1*,...,*yM*.\n\nA consequence of this is that although the ``*expression`` syntax\nappears *after* any keyword arguments, it is processed *before* the\nkeyword arguments (and the ``**expression`` argument, if any -- see\nbelow). So:\n\n >>> def f(a, b):\n ... print a, b\n ...\n >>> f(b=1, *(2,))\n 2 1\n >>> f(a=1, *(2,))\n Traceback (most recent call last):\n File "", line 1, in ?\n TypeError: f() got multiple values for keyword argument \'a\'\n >>> f(1, *(2,))\n 1 2\n\nIt is unusual for both keyword arguments and the ``*expression``\nsyntax to be used in the same call, so in practice this confusion does\nnot arise.\n\nIf the syntax ``**expression`` appears in the function call,\n``expression`` must evaluate to a mapping, the contents of which are\ntreated as additional keyword arguments. In the case of a keyword\nappearing in both ``expression`` and as an explicit keyword argument,\na ``TypeError`` exception is raised.\n\nFormal parameters using the syntax ``*identifier`` or ``**identifier``\ncannot be used as positional argument slots or as keyword argument\nnames. Formal parameters using the syntax ``(sublist)`` cannot be\nused as keyword argument names; the outermost sublist corresponds to a\nsingle unnamed argument slot, and the argument value is assigned to\nthe sublist using the usual tuple assignment rules after all other\nparameter processing is done.\n\nA call always returns some value, possibly ``None``, unless it raises\nan exception. How this value is computed depends on the type of the\ncallable object.\n\nIf it is---\n\na user-defined function:\n The code block for the function is executed, passing it the\n argument list. The first thing the code block will do is bind the\n formal parameters to the arguments; this is described in section\n *Function definitions*. When the code block executes a ``return``\n statement, this specifies the return value of the function call.\n\na built-in function or method:\n The result is up to the interpreter; see *Built-in Functions* for\n the descriptions of built-in functions and methods.\n\na class object:\n A new instance of that class is returned.\n\na class instance method:\n The corresponding user-defined function is called, with an argument\n list that is one longer than the argument list of the call: the\n instance becomes the first argument.\n\na class instance:\n The class must define a ``__call__()`` method; the effect is then\n the same as if that method was called.\n', - 'class': u'\nClass definitions\n*****************\n\nA class definition defines a class object (see section *The standard\ntype hierarchy*):\n\n classdef ::= "class" classname [inheritance] ":" suite\n inheritance ::= "(" [expression_list] ")"\n classname ::= identifier\n\nA class definition is an executable statement. It first evaluates the\ninheritance list, if present. Each item in the inheritance list\nshould evaluate to a class object or class type which allows\nsubclassing. The class\'s suite is then executed in a new execution\nframe (see section *Naming and binding*), using a newly created local\nnamespace and the original global namespace. (Usually, the suite\ncontains only function definitions.) When the class\'s suite finishes\nexecution, its execution frame is discarded but its local namespace is\nsaved. A class object is then created using the inheritance list for\nthe base classes and the saved local namespace for the attribute\ndictionary. The class name is bound to this class object in the\noriginal local namespace.\n\n**Programmer\'s note:** Variables defined in the class definition are\nclass variables; they are shared by all instances. To create instance\nvariables, they can be set in a method with ``self.name = value``.\nBoth class and instance variables are accessible through the notation\n"``self.name``", and an instance variable hides a class variable with\nthe same name when accessed in this way. Class variables can be used\nas defaults for instance variables, but using mutable values there can\nlead to unexpected results. For *new-style class*es, descriptors can\nbe used to create instance variables with different implementation\ndetails.\n\nClass definitions, like function definitions, may be wrapped by one or\nmore *decorator* expressions. The evaluation rules for the decorator\nexpressions are the same as for functions. The result must be a class\nobject, which is then bound to the class name.\n\n-[ Footnotes ]-\n\n[1] The exception is propagated to the invocation stack only if there\n is no ``finally`` clause that negates the exception.\n\n[2] Currently, control "flows off the end" except in the case of an\n exception or the execution of a ``return``, ``continue``, or\n ``break`` statement.\n', - 'coercion-rules': u"\nCoercion rules\n**************\n\nThis section used to document the rules for coercion. As the language\nhas evolved, the coercion rules have become hard to document\nprecisely; documenting what one version of one particular\nimplementation does is undesirable. Instead, here are some informal\nguidelines regarding coercion. In Python 3.0, coercion will not be\nsupported.\n\n* If the left operand of a % operator is a string or Unicode object,\n no coercion takes place and the string formatting operation is\n invoked instead.\n\n* It is no longer recommended to define a coercion operation. Mixed-\n mode operations on types that don't define coercion pass the\n original arguments to the operation.\n\n* New-style classes (those derived from ``object``) never invoke the\n ``__coerce__()`` method in response to a binary operator; the only\n time ``__coerce__()`` is invoked is when the built-in function\n ``coerce()`` is called.\n\n* For most intents and purposes, an operator that returns\n ``NotImplemented`` is treated the same as one that is not\n implemented at all.\n\n* Below, ``__op__()`` and ``__rop__()`` are used to signify the\n generic method names corresponding to an operator; ``__iop__()`` is\n used for the corresponding in-place operator. For example, for the\n operator '``+``', ``__add__()`` and ``__radd__()`` are used for the\n left and right variant of the binary operator, and ``__iadd__()``\n for the in-place variant.\n\n* For objects *x* and *y*, first ``x.__op__(y)`` is tried. If this is\n not implemented or returns ``NotImplemented``, ``y.__rop__(x)`` is\n tried. If this is also not implemented or returns\n ``NotImplemented``, a ``TypeError`` exception is raised. But see\n the following exception:\n\n* Exception to the previous item: if the left operand is an instance\n of a built-in type or a new-style class, and the right operand is an\n instance of a proper subclass of that type or class and overrides\n the base's ``__rop__()`` method, the right operand's ``__rop__()``\n method is tried *before* the left operand's ``__op__()`` method.\n\n This is done so that a subclass can completely override binary\n operators. Otherwise, the left operand's ``__op__()`` method would\n always accept the right operand: when an instance of a given class\n is expected, an instance of a subclass of that class is always\n acceptable.\n\n* When either operand type defines a coercion, this coercion is called\n before that type's ``__op__()`` or ``__rop__()`` method is called,\n but no sooner. If the coercion returns an object of a different\n type for the operand whose coercion is invoked, part of the process\n is redone using the new object.\n\n* When an in-place operator (like '``+=``') is used, if the left\n operand implements ``__iop__()``, it is invoked without any\n coercion. When the operation falls back to ``__op__()`` and/or\n ``__rop__()``, the normal coercion rules apply.\n\n* In *x*``+``*y*, if *x* is a sequence that implements sequence\n concatenation, sequence concatenation is invoked.\n\n* In *x*``*``*y*, if one operator is a sequence that implements\n sequence repetition, and the other is an integer (``int`` or\n ``long``), sequence repetition is invoked.\n\n* Rich comparisons (implemented by methods ``__eq__()`` and so on)\n never use coercion. Three-way comparison (implemented by\n ``__cmp__()``) does use coercion under the same conditions as other\n binary operations use it.\n\n* In the current implementation, the built-in numeric types ``int``,\n ``long`` and ``float`` do not use coercion; the type ``complex``\n however does use it. The difference can become apparent when\n subclassing these types. Over time, the type ``complex`` may be\n fixed to avoid coercion. All these types implement a\n ``__coerce__()`` method, for use by the built-in ``coerce()``\n function.\n", - 'comparisons': u'\nComparisons\n***********\n\nUnlike C, all comparison operations in Python have the same priority,\nwhich is lower than that of any arithmetic, shifting or bitwise\noperation. Also unlike C, expressions like ``a < b < c`` have the\ninterpretation that is conventional in mathematics:\n\n comparison ::= or_expr ( comp_operator or_expr )*\n comp_operator ::= "<" | ">" | "==" | ">=" | "<=" | "<>" | "!="\n | "is" ["not"] | ["not"] "in"\n\nComparisons yield boolean values: ``True`` or ``False``.\n\nComparisons can be chained arbitrarily, e.g., ``x < y <= z`` is\nequivalent to ``x < y and y <= z``, except that ``y`` is evaluated\nonly once (but in both cases ``z`` is not evaluated at all when ``x <\ny`` is found to be false).\n\nFormally, if *a*, *b*, *c*, ..., *y*, *z* are expressions and *op1*,\n*op2*, ..., *opN* are comparison operators, then ``a op1 b op2 c ... y\nopN z`` is equivalent to ``a op1 b and b op2 c and ... y opN z``,\nexcept that each expression is evaluated at most once.\n\nNote that ``a op1 b op2 c`` doesn\'t imply any kind of comparison\nbetween *a* and *c*, so that, e.g., ``x < y > z`` is perfectly legal\n(though perhaps not pretty).\n\nThe forms ``<>`` and ``!=`` are equivalent; for consistency with C,\n``!=`` is preferred; where ``!=`` is mentioned below ``<>`` is also\naccepted. The ``<>`` spelling is considered obsolescent.\n\nThe operators ``<``, ``>``, ``==``, ``>=``, ``<=``, and ``!=`` compare\nthe values of two objects. The objects need not have the same type.\nIf both are numbers, they are converted to a common type. Otherwise,\nobjects of different types *always* compare unequal, and are ordered\nconsistently but arbitrarily. You can control comparison behavior of\nobjects of non-builtin types by defining a ``__cmp__`` method or rich\ncomparison methods like ``__gt__``, described in section *Special\nmethod names*.\n\n(This unusual definition of comparison was used to simplify the\ndefinition of operations like sorting and the ``in`` and ``not in``\noperators. In the future, the comparison rules for objects of\ndifferent types are likely to change.)\n\nComparison of objects of the same type depends on the type:\n\n* Numbers are compared arithmetically.\n\n* Strings are compared lexicographically using the numeric equivalents\n (the result of the built-in function ``ord()``) of their characters.\n Unicode and 8-bit strings are fully interoperable in this behavior.\n [4]\n\n* Tuples and lists are compared lexicographically using comparison of\n corresponding elements. This means that to compare equal, each\n element must compare equal and the two sequences must be of the same\n type and have the same length.\n\n If not equal, the sequences are ordered the same as their first\n differing elements. For example, ``cmp([1,2,x], [1,2,y])`` returns\n the same as ``cmp(x,y)``. If the corresponding element does not\n exist, the shorter sequence is ordered first (for example, ``[1,2] <\n [1,2,3]``).\n\n* Mappings (dictionaries) compare equal if and only if their sorted\n (key, value) lists compare equal. [5] Outcomes other than equality\n are resolved consistently, but are not otherwise defined. [6]\n\n* Most other objects of builtin types compare unequal unless they are\n the same object; the choice whether one object is considered smaller\n or larger than another one is made arbitrarily but consistently\n within one execution of a program.\n\nThe operators ``in`` and ``not in`` test for collection membership.\n``x in s`` evaluates to true if *x* is a member of the collection *s*,\nand false otherwise. ``x not in s`` returns the negation of ``x in\ns``. The collection membership test has traditionally been bound to\nsequences; an object is a member of a collection if the collection is\na sequence and contains an element equal to that object. However, it\nmake sense for many other object types to support membership tests\nwithout being a sequence. In particular, dictionaries (for keys) and\nsets support membership testing.\n\nFor the list and tuple types, ``x in y`` is true if and only if there\nexists an index *i* such that ``x == y[i]`` is true.\n\nFor the Unicode and string types, ``x in y`` is true if and only if\n*x* is a substring of *y*. An equivalent test is ``y.find(x) != -1``.\nNote, *x* and *y* need not be the same type; consequently, ``u\'ab\' in\n\'abc\'`` will return ``True``. Empty strings are always considered to\nbe a substring of any other string, so ``"" in "abc"`` will return\n``True``.\n\nChanged in version 2.3: Previously, *x* was required to be a string of\nlength ``1``.\n\nFor user-defined classes which define the ``__contains__()`` method,\n``x in y`` is true if and only if ``y.__contains__(x)`` is true.\n\nFor user-defined classes which do not define ``__contains__()`` and do\ndefine ``__getitem__()``, ``x in y`` is true if and only if there is a\nnon-negative integer index *i* such that ``x == y[i]``, and all lower\ninteger indices do not raise ``IndexError`` exception. (If any other\nexception is raised, it is as if ``in`` raised that exception).\n\nThe operator ``not in`` is defined to have the inverse true value of\n``in``.\n\nThe operators ``is`` and ``is not`` test for object identity: ``x is\ny`` is true if and only if *x* and *y* are the same object. ``x is\nnot y`` yields the inverse truth value.\n', - 'compound': u'\nCompound statements\n*******************\n\nCompound statements contain (groups of) other statements; they affect\nor control the execution of those other statements in some way. In\ngeneral, compound statements span multiple lines, although in simple\nincarnations a whole compound statement may be contained in one line.\n\nThe ``if``, ``while`` and ``for`` statements implement traditional\ncontrol flow constructs. ``try`` specifies exception handlers and/or\ncleanup code for a group of statements. Function and class\ndefinitions are also syntactically compound statements.\n\nCompound statements consist of one or more \'clauses.\' A clause\nconsists of a header and a \'suite.\' The clause headers of a\nparticular compound statement are all at the same indentation level.\nEach clause header begins with a uniquely identifying keyword and ends\nwith a colon. A suite is a group of statements controlled by a\nclause. A suite can be one or more semicolon-separated simple\nstatements on the same line as the header, following the header\'s\ncolon, or it can be one or more indented statements on subsequent\nlines. Only the latter form of suite can contain nested compound\nstatements; the following is illegal, mostly because it wouldn\'t be\nclear to which ``if`` clause a following ``else`` clause would belong:\n\n if test1: if test2: print x\n\nAlso note that the semicolon binds tighter than the colon in this\ncontext, so that in the following example, either all or none of the\n``print`` statements are executed:\n\n if x < y < z: print x; print y; print z\n\nSummarizing:\n\n compound_stmt ::= if_stmt\n | while_stmt\n | for_stmt\n | try_stmt\n | with_stmt\n | funcdef\n | classdef\n | decorated\n suite ::= stmt_list NEWLINE | NEWLINE INDENT statement+ DEDENT\n statement ::= stmt_list NEWLINE | compound_stmt\n stmt_list ::= simple_stmt (";" simple_stmt)* [";"]\n\nNote that statements always end in a ``NEWLINE`` possibly followed by\na ``DEDENT``. Also note that optional continuation clauses always\nbegin with a keyword that cannot start a statement, thus there are no\nambiguities (the \'dangling ``else``\' problem is solved in Python by\nrequiring nested ``if`` statements to be indented).\n\nThe formatting of the grammar rules in the following sections places\neach clause on a separate line for clarity.\n\n\nThe ``if`` statement\n====================\n\nThe ``if`` statement is used for conditional execution:\n\n if_stmt ::= "if" expression ":" suite\n ( "elif" expression ":" suite )*\n ["else" ":" suite]\n\nIt selects exactly one of the suites by evaluating the expressions one\nby one until one is found to be true (see section *Boolean operations*\nfor the definition of true and false); then that suite is executed\n(and no other part of the ``if`` statement is executed or evaluated).\nIf all expressions are false, the suite of the ``else`` clause, if\npresent, is executed.\n\n\nThe ``while`` statement\n=======================\n\nThe ``while`` statement is used for repeated execution as long as an\nexpression is true:\n\n while_stmt ::= "while" expression ":" suite\n ["else" ":" suite]\n\nThis repeatedly tests the expression and, if it is true, executes the\nfirst suite; if the expression is false (which may be the first time\nit is tested) the suite of the ``else`` clause, if present, is\nexecuted and the loop terminates.\n\nA ``break`` statement executed in the first suite terminates the loop\nwithout executing the ``else`` clause\'s suite. A ``continue``\nstatement executed in the first suite skips the rest of the suite and\ngoes back to testing the expression.\n\n\nThe ``for`` statement\n=====================\n\nThe ``for`` statement is used to iterate over the elements of a\nsequence (such as a string, tuple or list) or other iterable object:\n\n for_stmt ::= "for" target_list "in" expression_list ":" suite\n ["else" ":" suite]\n\nThe expression list is evaluated once; it should yield an iterable\nobject. An iterator is created for the result of the\n``expression_list``. The suite is then executed once for each item\nprovided by the iterator, in the order of ascending indices. Each\nitem in turn is assigned to the target list using the standard rules\nfor assignments, and then the suite is executed. When the items are\nexhausted (which is immediately when the sequence is empty), the suite\nin the ``else`` clause, if present, is executed, and the loop\nterminates.\n\nA ``break`` statement executed in the first suite terminates the loop\nwithout executing the ``else`` clause\'s suite. A ``continue``\nstatement executed in the first suite skips the rest of the suite and\ncontinues with the next item, or with the ``else`` clause if there was\nno next item.\n\nThe suite may assign to the variable(s) in the target list; this does\nnot affect the next item assigned to it.\n\nThe target list is not deleted when the loop is finished, but if the\nsequence is empty, it will not have been assigned to at all by the\nloop. Hint: the built-in function ``range()`` returns a sequence of\nintegers suitable to emulate the effect of Pascal\'s ``for i := a to b\ndo``; e.g., ``range(3)`` returns the list ``[0, 1, 2]``.\n\nWarning: There is a subtlety when the sequence is being modified by the loop\n (this can only occur for mutable sequences, i.e. lists). An internal\n counter is used to keep track of which item is used next, and this\n is incremented on each iteration. When this counter has reached the\n length of the sequence the loop terminates. This means that if the\n suite deletes the current (or a previous) item from the sequence,\n the next item will be skipped (since it gets the index of the\n current item which has already been treated). Likewise, if the\n suite inserts an item in the sequence before the current item, the\n current item will be treated again the next time through the loop.\n This can lead to nasty bugs that can be avoided by making a\n temporary copy using a slice of the whole sequence, e.g.,\n\n for x in a[:]:\n if x < 0: a.remove(x)\n\n\nThe ``try`` statement\n=====================\n\nThe ``try`` statement specifies exception handlers and/or cleanup code\nfor a group of statements:\n\n try_stmt ::= try1_stmt | try2_stmt\n try1_stmt ::= "try" ":" suite\n ("except" [expression ["," target]] ":" suite)+\n ["else" ":" suite]\n ["finally" ":" suite]\n try2_stmt ::= "try" ":" suite\n "finally" ":" suite\n\nChanged in version 2.5: In previous versions of Python,\n``try``...``except``...``finally`` did not work. ``try``...``except``\nhad to be nested in ``try``...``finally``.\n\nThe ``except`` clause(s) specify one or more exception handlers. When\nno exception occurs in the ``try`` clause, no exception handler is\nexecuted. When an exception occurs in the ``try`` suite, a search for\nan exception handler is started. This search inspects the except\nclauses in turn until one is found that matches the exception. An\nexpression-less except clause, if present, must be last; it matches\nany exception. For an except clause with an expression, that\nexpression is evaluated, and the clause matches the exception if the\nresulting object is "compatible" with the exception. An object is\ncompatible with an exception if it is the class or a base class of the\nexception object, a tuple containing an item compatible with the\nexception, or, in the (deprecated) case of string exceptions, is the\nraised string itself (note that the object identities must match, i.e.\nit must be the same string object, not just a string with the same\nvalue).\n\nIf no except clause matches the exception, the search for an exception\nhandler continues in the surrounding code and on the invocation stack.\n[1]\n\nIf the evaluation of an expression in the header of an except clause\nraises an exception, the original search for a handler is canceled and\na search starts for the new exception in the surrounding code and on\nthe call stack (it is treated as if the entire ``try`` statement\nraised the exception).\n\nWhen a matching except clause is found, the exception is assigned to\nthe target specified in that except clause, if present, and the except\nclause\'s suite is executed. All except clauses must have an\nexecutable block. When the end of this block is reached, execution\ncontinues normally after the entire try statement. (This means that\nif two nested handlers exist for the same exception, and the exception\noccurs in the try clause of the inner handler, the outer handler will\nnot handle the exception.)\n\nBefore an except clause\'s suite is executed, details about the\nexception are assigned to three variables in the ``sys`` module:\n``sys.exc_type`` receives the object identifying the exception;\n``sys.exc_value`` receives the exception\'s parameter;\n``sys.exc_traceback`` receives a traceback object (see section *The\nstandard type hierarchy*) identifying the point in the program where\nthe exception occurred. These details are also available through the\n``sys.exc_info()`` function, which returns a tuple ``(exc_type,\nexc_value, exc_traceback)``. Use of the corresponding variables is\ndeprecated in favor of this function, since their use is unsafe in a\nthreaded program. As of Python 1.5, the variables are restored to\ntheir previous values (before the call) when returning from a function\nthat handled an exception.\n\nThe optional ``else`` clause is executed if and when control flows off\nthe end of the ``try`` clause. [2] Exceptions in the ``else`` clause\nare not handled by the preceding ``except`` clauses.\n\nIf ``finally`` is present, it specifies a \'cleanup\' handler. The\n``try`` clause is executed, including any ``except`` and ``else``\nclauses. If an exception occurs in any of the clauses and is not\nhandled, the exception is temporarily saved. The ``finally`` clause is\nexecuted. If there is a saved exception, it is re-raised at the end\nof the ``finally`` clause. If the ``finally`` clause raises another\nexception or executes a ``return`` or ``break`` statement, the saved\nexception is lost. The exception information is not available to the\nprogram during execution of the ``finally`` clause.\n\nWhen a ``return``, ``break`` or ``continue`` statement is executed in\nthe ``try`` suite of a ``try``...``finally`` statement, the\n``finally`` clause is also executed \'on the way out.\' A ``continue``\nstatement is illegal in the ``finally`` clause. (The reason is a\nproblem with the current implementation --- this restriction may be\nlifted in the future).\n\nAdditional information on exceptions can be found in section\n*Exceptions*, and information on using the ``raise`` statement to\ngenerate exceptions may be found in section *The raise statement*.\n\n\nThe ``with`` statement\n======================\n\nAdded in version 2.5.\n\nThe ``with`` statement is used to wrap the execution of a block with\nmethods defined by a context manager (see section *With Statement\nContext Managers*). This allows common\n``try``...``except``...``finally`` usage patterns to be encapsulated\nfor convenient reuse.\n\n with_stmt ::= "with" expression ["as" target] ":" suite\n\nThe execution of the ``with`` statement proceeds as follows:\n\n1. The context expression is evaluated to obtain a context manager.\n\n2. The context manager\'s ``__enter__()`` method is invoked.\n\n3. If a target was included in the ``with`` statement, the return\n value from ``__enter__()`` is assigned to it.\n\n Note: The ``with`` statement guarantees that if the ``__enter__()``\n method returns without an error, then ``__exit__()`` will always\n be called. Thus, if an error occurs during the assignment to the\n target list, it will be treated the same as an error occurring\n within the suite would be. See step 5 below.\n\n4. The suite is executed.\n\n5. The context manager\'s ``__exit__()`` method is invoked. If an\n exception caused the suite to be exited, its type, value, and\n traceback are passed as arguments to ``__exit__()``. Otherwise,\n three ``None`` arguments are supplied.\n\n If the suite was exited due to an exception, and the return value\n from the ``__exit__()`` method was false, the exception is\n reraised. If the return value was true, the exception is\n suppressed, and execution continues with the statement following\n the ``with`` statement.\n\n If the suite was exited for any reason other than an exception, the\n return value from ``__exit__()`` is ignored, and execution proceeds\n at the normal location for the kind of exit that was taken.\n\nNote: In Python 2.5, the ``with`` statement is only allowed when the\n ``with_statement`` feature has been enabled. It is always enabled\n in Python 2.6.\n\nSee also:\n\n **PEP 0343** - The "with" statement\n The specification, background, and examples for the Python\n ``with`` statement.\n\n\nFunction definitions\n====================\n\nA function definition defines a user-defined function object (see\nsection *The standard type hierarchy*):\n\n decorated ::= decorators (classdef | funcdef)\n decorators ::= decorator+\n decorator ::= "@" dotted_name ["(" [argument_list [","]] ")"] NEWLINE\n funcdef ::= "def" funcname "(" [parameter_list] ")" ":" suite\n dotted_name ::= identifier ("." identifier)*\n parameter_list ::= (defparameter ",")*\n ( "*" identifier [, "**" identifier]\n | "**" identifier\n | defparameter [","] )\n defparameter ::= parameter ["=" expression]\n sublist ::= parameter ("," parameter)* [","]\n parameter ::= identifier | "(" sublist ")"\n funcname ::= identifier\n\nA function definition is an executable statement. Its execution binds\nthe function name in the current local namespace to a function object\n(a wrapper around the executable code for the function). This\nfunction object contains a reference to the current global namespace\nas the global namespace to be used when the function is called.\n\nThe function definition does not execute the function body; this gets\nexecuted only when the function is called.\n\nA function definition may be wrapped by one or more *decorator*\nexpressions. Decorator expressions are evaluated when the function is\ndefined, in the scope that contains the function definition. The\nresult must be a callable, which is invoked with the function object\nas the only argument. The returned value is bound to the function name\ninstead of the function object. Multiple decorators are applied in\nnested fashion. For example, the following code:\n\n @f1(arg)\n @f2\n def func(): pass\n\nis equivalent to:\n\n def func(): pass\n func = f1(arg)(f2(func))\n\nWhen one or more top-level parameters have the form *parameter* ``=``\n*expression*, the function is said to have "default parameter values."\nFor a parameter with a default value, the corresponding argument may\nbe omitted from a call, in which case the parameter\'s default value is\nsubstituted. If a parameter has a default value, all following\nparameters must also have a default value --- this is a syntactic\nrestriction that is not expressed by the grammar.\n\n**Default parameter values are evaluated when the function definition\nis executed.** This means that the expression is evaluated once, when\nthe function is defined, and that that same "pre-computed" value is\nused for each call. This is especially important to understand when a\ndefault parameter is a mutable object, such as a list or a dictionary:\nif the function modifies the object (e.g. by appending an item to a\nlist), the default value is in effect modified. This is generally not\nwhat was intended. A way around this is to use ``None`` as the\ndefault, and explicitly test for it in the body of the function, e.g.:\n\n def whats_on_the_telly(penguin=None):\n if penguin is None:\n penguin = []\n penguin.append("property of the zoo")\n return penguin\n\nFunction call semantics are described in more detail in section\n*Calls*. A function call always assigns values to all parameters\nmentioned in the parameter list, either from position arguments, from\nkeyword arguments, or from default values. If the form\n"``*identifier``" is present, it is initialized to a tuple receiving\nany excess positional parameters, defaulting to the empty tuple. If\nthe form "``**identifier``" is present, it is initialized to a new\ndictionary receiving any excess keyword arguments, defaulting to a new\nempty dictionary.\n\nIt is also possible to create anonymous functions (functions not bound\nto a name), for immediate use in expressions. This uses lambda forms,\ndescribed in section *Expression lists*. Note that the lambda form is\nmerely a shorthand for a simplified function definition; a function\ndefined in a "``def``" statement can be passed around or assigned to\nanother name just like a function defined by a lambda form. The\n"``def``" form is actually more powerful since it allows the execution\nof multiple statements.\n\n**Programmer\'s note:** Functions are first-class objects. A "``def``"\nform executed inside a function definition defines a local function\nthat can be returned or passed around. Free variables used in the\nnested function can access the local variables of the function\ncontaining the def. See section *Naming and binding* for details.\n\n\nClass definitions\n=================\n\nA class definition defines a class object (see section *The standard\ntype hierarchy*):\n\n classdef ::= "class" classname [inheritance] ":" suite\n inheritance ::= "(" [expression_list] ")"\n classname ::= identifier\n\nA class definition is an executable statement. It first evaluates the\ninheritance list, if present. Each item in the inheritance list\nshould evaluate to a class object or class type which allows\nsubclassing. The class\'s suite is then executed in a new execution\nframe (see section *Naming and binding*), using a newly created local\nnamespace and the original global namespace. (Usually, the suite\ncontains only function definitions.) When the class\'s suite finishes\nexecution, its execution frame is discarded but its local namespace is\nsaved. A class object is then created using the inheritance list for\nthe base classes and the saved local namespace for the attribute\ndictionary. The class name is bound to this class object in the\noriginal local namespace.\n\n**Programmer\'s note:** Variables defined in the class definition are\nclass variables; they are shared by all instances. To create instance\nvariables, they can be set in a method with ``self.name = value``.\nBoth class and instance variables are accessible through the notation\n"``self.name``", and an instance variable hides a class variable with\nthe same name when accessed in this way. Class variables can be used\nas defaults for instance variables, but using mutable values there can\nlead to unexpected results. For *new-style class*es, descriptors can\nbe used to create instance variables with different implementation\ndetails.\n\nClass definitions, like function definitions, may be wrapped by one or\nmore *decorator* expressions. The evaluation rules for the decorator\nexpressions are the same as for functions. The result must be a class\nobject, which is then bound to the class name.\n\n-[ Footnotes ]-\n\n[1] The exception is propagated to the invocation stack only if there\n is no ``finally`` clause that negates the exception.\n\n[2] Currently, control "flows off the end" except in the case of an\n exception or the execution of a ``return``, ``continue``, or\n ``break`` statement.\n', - 'context-managers': u'\nWith Statement Context Managers\n*******************************\n\nAdded in version 2.5.\n\nA *context manager* is an object that defines the runtime context to\nbe established when executing a ``with`` statement. The context\nmanager handles the entry into, and the exit from, the desired runtime\ncontext for the execution of the block of code. Context managers are\nnormally invoked using the ``with`` statement (described in section\n*The with statement*), but can also be used by directly invoking their\nmethods.\n\nTypical uses of context managers include saving and restoring various\nkinds of global state, locking and unlocking resources, closing opened\nfiles, etc.\n\nFor more information on context managers, see *Context Manager Types*.\n\nobject.__enter__(self)\n\n Enter the runtime context related to this object. The ``with``\n statement will bind this method\'s return value to the target(s)\n specified in the ``as`` clause of the statement, if any.\n\nobject.__exit__(self, exc_type, exc_value, traceback)\n\n Exit the runtime context related to this object. The parameters\n describe the exception that caused the context to be exited. If the\n context was exited without an exception, all three arguments will\n be ``None``.\n\n If an exception is supplied, and the method wishes to suppress the\n exception (i.e., prevent it from being propagated), it should\n return a true value. Otherwise, the exception will be processed\n normally upon exit from this method.\n\n Note that ``__exit__()`` methods should not reraise the passed-in\n exception; this is the caller\'s responsibility.\n\nSee also:\n\n **PEP 0343** - The "with" statement\n The specification, background, and examples for the Python\n ``with`` statement.\n\n-[ Footnotes ]-\n\n[1] Since Python 2.2, a gradual merging of types and classes has been\n started that makes this and a few other assertions made in this\n manual not 100% accurate and complete: for example, it *is* now\n possible in some cases to change an object\'s type, under certain\n controlled conditions. Until this manual undergoes extensive\n revision, it must now be taken as authoritative only regarding\n "classic classes", that are still the default, for compatibility\n purposes, in Python 2.2 and 2.3. For more information, see\n http://www.python.org/doc/newstyle/.\n\n[2] This, and other statements, are only roughly true for instances of\n new-style classes.\n\n[3] A descriptor can define any combination of ``__get__()``,\n ``__set__()`` and ``__delete__()``. If it does not define\n ``__get__()``, then accessing the attribute even on an instance\n will return the descriptor object itself. If the descriptor\n defines ``__set__()`` and/or ``__delete__()``, it is a data\n descriptor; if it defines neither, it is a non-data descriptor.\n\n[4] For operands of the same type, it is assumed that if the non-\n reflected method (such as ``__add__()``) fails the operation is\n not supported, which is why the reflected method is not called.\n', + 'calls': u'\nCalls\n*****\n\nA call calls a callable object (e.g., a function) with a possibly\nempty series of arguments:\n\n call ::= primary "(" [argument_list [","]\n | expression genexpr_for] ")"\n argument_list ::= positional_arguments ["," keyword_arguments]\n ["," "*" expression] ["," keyword_arguments]\n ["," "**" expression]\n | keyword_arguments ["," "*" expression]\n ["," "**" expression]\n | "*" expression ["," "*" expression] ["," "**" expression]\n | "**" expression\n positional_arguments ::= expression ("," expression)*\n keyword_arguments ::= keyword_item ("," keyword_item)*\n keyword_item ::= identifier "=" expression\n\nA trailing comma may be present after the positional and keyword\narguments but does not affect the semantics.\n\nThe primary must evaluate to a callable object (user-defined\nfunctions, built-in functions, methods of built-in objects, class\nobjects, methods of class instances, and certain class instances\nthemselves are callable; extensions may define additional callable\nobject types). All argument expressions are evaluated before the call\nis attempted. Please refer to section *Function definitions* for the\nsyntax of formal parameter lists.\n\nIf keyword arguments are present, they are first converted to\npositional arguments, as follows. First, a list of unfilled slots is\ncreated for the formal parameters. If there are N positional\narguments, they are placed in the first N slots. Next, for each\nkeyword argument, the identifier is used to determine the\ncorresponding slot (if the identifier is the same as the first formal\nparameter name, the first slot is used, and so on). If the slot is\nalready filled, a ``TypeError`` exception is raised. Otherwise, the\nvalue of the argument is placed in the slot, filling it (even if the\nexpression is ``None``, it fills the slot). When all arguments have\nbeen processed, the slots that are still unfilled are filled with the\ncorresponding default value from the function definition. (Default\nvalues are calculated, once, when the function is defined; thus, a\nmutable object such as a list or dictionary used as default value will\nbe shared by all calls that don\'t specify an argument value for the\ncorresponding slot; this should usually be avoided.) If there are any\nunfilled slots for which no default value is specified, a\n``TypeError`` exception is raised. Otherwise, the list of filled\nslots is used as the argument list for the call.\n\nNote: An implementation may provide builtin functions whose positional\n parameters do not have names, even if they are \'named\' for the\n purpose of documentation, and which therefore cannot be supplied by\n keyword. In CPython, this is the case for functions implemented in\n C that use ``PyArg_ParseTuple`` to parse their arguments.\n\nIf there are more positional arguments than there are formal parameter\nslots, a ``TypeError`` exception is raised, unless a formal parameter\nusing the syntax ``*identifier`` is present; in this case, that formal\nparameter receives a tuple containing the excess positional arguments\n(or an empty tuple if there were no excess positional arguments).\n\nIf any keyword argument does not correspond to a formal parameter\nname, a ``TypeError`` exception is raised, unless a formal parameter\nusing the syntax ``**identifier`` is present; in this case, that\nformal parameter receives a dictionary containing the excess keyword\narguments (using the keywords as keys and the argument values as\ncorresponding values), or a (new) empty dictionary if there were no\nexcess keyword arguments.\n\nIf the syntax ``*expression`` appears in the function call,\n``expression`` must evaluate to a sequence. Elements from this\nsequence are treated as if they were additional positional arguments;\nif there are positional arguments *x1*,..., *xN*, and ``expression``\nevaluates to a sequence *y1*, ..., *yM*, this is equivalent to a call\nwith M+N positional arguments *x1*, ..., *xN*, *y1*, ..., *yM*.\n\nA consequence of this is that although the ``*expression`` syntax may\nappear *after* some keyword arguments, it is processed *before* the\nkeyword arguments (and the ``**expression`` argument, if any -- see\nbelow). So:\n\n >>> def f(a, b):\n ... print a, b\n ...\n >>> f(b=1, *(2,))\n 2 1\n >>> f(a=1, *(2,))\n Traceback (most recent call last):\n File "", line 1, in ?\n TypeError: f() got multiple values for keyword argument \'a\'\n >>> f(1, *(2,))\n 1 2\n\nIt is unusual for both keyword arguments and the ``*expression``\nsyntax to be used in the same call, so in practice this confusion does\nnot arise.\n\nIf the syntax ``**expression`` appears in the function call,\n``expression`` must evaluate to a mapping, the contents of which are\ntreated as additional keyword arguments. In the case of a keyword\nappearing in both ``expression`` and as an explicit keyword argument,\na ``TypeError`` exception is raised.\n\nFormal parameters using the syntax ``*identifier`` or ``**identifier``\ncannot be used as positional argument slots or as keyword argument\nnames. Formal parameters using the syntax ``(sublist)`` cannot be\nused as keyword argument names; the outermost sublist corresponds to a\nsingle unnamed argument slot, and the argument value is assigned to\nthe sublist using the usual tuple assignment rules after all other\nparameter processing is done.\n\nA call always returns some value, possibly ``None``, unless it raises\nan exception. How this value is computed depends on the type of the\ncallable object.\n\nIf it is---\n\na user-defined function:\n The code block for the function is executed, passing it the\n argument list. The first thing the code block will do is bind the\n formal parameters to the arguments; this is described in section\n *Function definitions*. When the code block executes a ``return``\n statement, this specifies the return value of the function call.\n\na built-in function or method:\n The result is up to the interpreter; see *Built-in Functions* for\n the descriptions of built-in functions and methods.\n\na class object:\n A new instance of that class is returned.\n\na class instance method:\n The corresponding user-defined function is called, with an argument\n list that is one longer than the argument list of the call: the\n instance becomes the first argument.\n\na class instance:\n The class must define a ``__call__()`` method; the effect is then\n the same as if that method was called.\n', + 'class': u'\nClass definitions\n*****************\n\nA class definition defines a class object (see section *The standard\ntype hierarchy*):\n\n classdef ::= "class" classname [inheritance] ":" suite\n inheritance ::= "(" [expression_list] ")"\n classname ::= identifier\n\nA class definition is an executable statement. It first evaluates the\ninheritance list, if present. Each item in the inheritance list\nshould evaluate to a class object or class type which allows\nsubclassing. The class\'s suite is then executed in a new execution\nframe (see section *Naming and binding*), using a newly created local\nnamespace and the original global namespace. (Usually, the suite\ncontains only function definitions.) When the class\'s suite finishes\nexecution, its execution frame is discarded but its local namespace is\nsaved. [4] A class object is then created using the inheritance list\nfor the base classes and the saved local namespace for the attribute\ndictionary. The class name is bound to this class object in the\noriginal local namespace.\n\n**Programmer\'s note:** Variables defined in the class definition are\nclass variables; they are shared by all instances. To create instance\nvariables, they can be set in a method with ``self.name = value``.\nBoth class and instance variables are accessible through the notation\n"``self.name``", and an instance variable hides a class variable with\nthe same name when accessed in this way. Class variables can be used\nas defaults for instance variables, but using mutable values there can\nlead to unexpected results. For *new-style class*es, descriptors can\nbe used to create instance variables with different implementation\ndetails.\n\nClass definitions, like function definitions, may be wrapped by one or\nmore *decorator* expressions. The evaluation rules for the decorator\nexpressions are the same as for functions. The result must be a class\nobject, which is then bound to the class name.\n\n-[ Footnotes ]-\n\n[1] The exception is propagated to the invocation stack only if there\n is no ``finally`` clause that negates the exception.\n\n[2] Currently, control "flows off the end" except in the case of an\n exception or the execution of a ``return``, ``continue``, or\n ``break`` statement.\n\n[3] A string literal appearing as the first statement in the function\n body is transformed into the function\'s ``__doc__`` attribute and\n therefore the function\'s *docstring*.\n\n[4] A string literal appearing as the first statement in the class\n body is transformed into the namespace\'s ``__doc__`` item and\n therefore the class\'s *docstring*.\n', + 'coercion-rules': u"\nCoercion rules\n**************\n\nThis section used to document the rules for coercion. As the language\nhas evolved, the coercion rules have become hard to document\nprecisely; documenting what one version of one particular\nimplementation does is undesirable. Instead, here are some informal\nguidelines regarding coercion. In Python 3.0, coercion will not be\nsupported.\n\n* If the left operand of a % operator is a string or Unicode object,\n no coercion takes place and the string formatting operation is\n invoked instead.\n\n* It is no longer recommended to define a coercion operation. Mixed-\n mode operations on types that don't define coercion pass the\n original arguments to the operation.\n\n* New-style classes (those derived from ``object``) never invoke the\n ``__coerce__()`` method in response to a binary operator; the only\n time ``__coerce__()`` is invoked is when the built-in function\n ``coerce()`` is called.\n\n* For most intents and purposes, an operator that returns\n ``NotImplemented`` is treated the same as one that is not\n implemented at all.\n\n* Below, ``__op__()`` and ``__rop__()`` are used to signify the\n generic method names corresponding to an operator; ``__iop__()`` is\n used for the corresponding in-place operator. For example, for the\n operator '``+``', ``__add__()`` and ``__radd__()`` are used for the\n left and right variant of the binary operator, and ``__iadd__()``\n for the in-place variant.\n\n* For objects *x* and *y*, first ``x.__op__(y)`` is tried. If this is\n not implemented or returns ``NotImplemented``, ``y.__rop__(x)`` is\n tried. If this is also not implemented or returns\n ``NotImplemented``, a ``TypeError`` exception is raised. But see\n the following exception:\n\n* Exception to the previous item: if the left operand is an instance\n of a built-in type or a new-style class, and the right operand is an\n instance of a proper subclass of that type or class and overrides\n the base's ``__rop__()`` method, the right operand's ``__rop__()``\n method is tried *before* the left operand's ``__op__()`` method.\n\n This is done so that a subclass can completely override binary\n operators. Otherwise, the left operand's ``__op__()`` method would\n always accept the right operand: when an instance of a given class\n is expected, an instance of a subclass of that class is always\n acceptable.\n\n* When either operand type defines a coercion, this coercion is called\n before that type's ``__op__()`` or ``__rop__()`` method is called,\n but no sooner. If the coercion returns an object of a different\n type for the operand whose coercion is invoked, part of the process\n is redone using the new object.\n\n* When an in-place operator (like '``+=``') is used, if the left\n operand implements ``__iop__()``, it is invoked without any\n coercion. When the operation falls back to ``__op__()`` and/or\n ``__rop__()``, the normal coercion rules apply.\n\n* In ``x + y``, if *x* is a sequence that implements sequence\n concatenation, sequence concatenation is invoked.\n\n* In ``x * y``, if one operator is a sequence that implements sequence\n repetition, and the other is an integer (``int`` or ``long``),\n sequence repetition is invoked.\n\n* Rich comparisons (implemented by methods ``__eq__()`` and so on)\n never use coercion. Three-way comparison (implemented by\n ``__cmp__()``) does use coercion under the same conditions as other\n binary operations use it.\n\n* In the current implementation, the built-in numeric types ``int``,\n ``long`` and ``float`` do not use coercion; the type ``complex``\n however does use it. The difference can become apparent when\n subclassing these types. Over time, the type ``complex`` may be\n fixed to avoid coercion. All these types implement a\n ``__coerce__()`` method, for use by the built-in ``coerce()``\n function.\n", + 'comparisons': u'\nComparisons\n***********\n\nUnlike C, all comparison operations in Python have the same priority,\nwhich is lower than that of any arithmetic, shifting or bitwise\noperation. Also unlike C, expressions like ``a < b < c`` have the\ninterpretation that is conventional in mathematics:\n\n comparison ::= or_expr ( comp_operator or_expr )*\n comp_operator ::= "<" | ">" | "==" | ">=" | "<=" | "<>" | "!="\n | "is" ["not"] | ["not"] "in"\n\nComparisons yield boolean values: ``True`` or ``False``.\n\nComparisons can be chained arbitrarily, e.g., ``x < y <= z`` is\nequivalent to ``x < y and y <= z``, except that ``y`` is evaluated\nonly once (but in both cases ``z`` is not evaluated at all when ``x <\ny`` is found to be false).\n\nFormally, if *a*, *b*, *c*, ..., *y*, *z* are expressions and *op1*,\n*op2*, ..., *opN* are comparison operators, then ``a op1 b op2 c ... y\nopN z`` is equivalent to ``a op1 b and b op2 c and ... y opN z``,\nexcept that each expression is evaluated at most once.\n\nNote that ``a op1 b op2 c`` doesn\'t imply any kind of comparison\nbetween *a* and *c*, so that, e.g., ``x < y > z`` is perfectly legal\n(though perhaps not pretty).\n\nThe forms ``<>`` and ``!=`` are equivalent; for consistency with C,\n``!=`` is preferred; where ``!=`` is mentioned below ``<>`` is also\naccepted. The ``<>`` spelling is considered obsolescent.\n\nThe operators ``<``, ``>``, ``==``, ``>=``, ``<=``, and ``!=`` compare\nthe values of two objects. The objects need not have the same type.\nIf both are numbers, they are converted to a common type. Otherwise,\nobjects of different types *always* compare unequal, and are ordered\nconsistently but arbitrarily. You can control comparison behavior of\nobjects of non-builtin types by defining a ``__cmp__`` method or rich\ncomparison methods like ``__gt__``, described in section *Special\nmethod names*.\n\n(This unusual definition of comparison was used to simplify the\ndefinition of operations like sorting and the ``in`` and ``not in``\noperators. In the future, the comparison rules for objects of\ndifferent types are likely to change.)\n\nComparison of objects of the same type depends on the type:\n\n* Numbers are compared arithmetically.\n\n* Strings are compared lexicographically using the numeric equivalents\n (the result of the built-in function ``ord()``) of their characters.\n Unicode and 8-bit strings are fully interoperable in this behavior.\n [4]\n\n* Tuples and lists are compared lexicographically using comparison of\n corresponding elements. This means that to compare equal, each\n element must compare equal and the two sequences must be of the same\n type and have the same length.\n\n If not equal, the sequences are ordered the same as their first\n differing elements. For example, ``cmp([1,2,x], [1,2,y])`` returns\n the same as ``cmp(x,y)``. If the corresponding element does not\n exist, the shorter sequence is ordered first (for example, ``[1,2] <\n [1,2,3]``).\n\n* Mappings (dictionaries) compare equal if and only if their sorted\n (key, value) lists compare equal. [5] Outcomes other than equality\n are resolved consistently, but are not otherwise defined. [6]\n\n* Most other objects of builtin types compare unequal unless they are\n the same object; the choice whether one object is considered smaller\n or larger than another one is made arbitrarily but consistently\n within one execution of a program.\n\nThe operators ``in`` and ``not in`` test for collection membership.\n``x in s`` evaluates to true if *x* is a member of the collection *s*,\nand false otherwise. ``x not in s`` returns the negation of ``x in\ns``. The collection membership test has traditionally been bound to\nsequences; an object is a member of a collection if the collection is\na sequence and contains an element equal to that object. However, it\nmake sense for many other object types to support membership tests\nwithout being a sequence. In particular, dictionaries (for keys) and\nsets support membership testing.\n\nFor the list and tuple types, ``x in y`` is true if and only if there\nexists an index *i* such that ``x == y[i]`` is true.\n\nFor the Unicode and string types, ``x in y`` is true if and only if\n*x* is a substring of *y*. An equivalent test is ``y.find(x) != -1``.\nNote, *x* and *y* need not be the same type; consequently, ``u\'ab\' in\n\'abc\'`` will return ``True``. Empty strings are always considered to\nbe a substring of any other string, so ``"" in "abc"`` will return\n``True``.\n\nChanged in version 2.3: Previously, *x* was required to be a string of\nlength ``1``.\n\nFor user-defined classes which define the ``__contains__()`` method,\n``x in y`` is true if and only if ``y.__contains__(x)`` is true.\n\nFor user-defined classes which do not define ``__contains__()`` and do\ndefine ``__getitem__()``, ``x in y`` is true if and only if there is a\nnon-negative integer index *i* such that ``x == y[i]``, and all lower\ninteger indices do not raise ``IndexError`` exception. (If any other\nexception is raised, it is as if ``in`` raised that exception).\n\nThe operator ``not in`` is defined to have the inverse true value of\n``in``.\n\nThe operators ``is`` and ``is not`` test for object identity: ``x is\ny`` is true if and only if *x* and *y* are the same object. ``x is\nnot y`` yields the inverse truth value. [7]\n', + 'compound': u'\nCompound statements\n*******************\n\nCompound statements contain (groups of) other statements; they affect\nor control the execution of those other statements in some way. In\ngeneral, compound statements span multiple lines, although in simple\nincarnations a whole compound statement may be contained in one line.\n\nThe ``if``, ``while`` and ``for`` statements implement traditional\ncontrol flow constructs. ``try`` specifies exception handlers and/or\ncleanup code for a group of statements. Function and class\ndefinitions are also syntactically compound statements.\n\nCompound statements consist of one or more \'clauses.\' A clause\nconsists of a header and a \'suite.\' The clause headers of a\nparticular compound statement are all at the same indentation level.\nEach clause header begins with a uniquely identifying keyword and ends\nwith a colon. A suite is a group of statements controlled by a\nclause. A suite can be one or more semicolon-separated simple\nstatements on the same line as the header, following the header\'s\ncolon, or it can be one or more indented statements on subsequent\nlines. Only the latter form of suite can contain nested compound\nstatements; the following is illegal, mostly because it wouldn\'t be\nclear to which ``if`` clause a following ``else`` clause would belong:\n\n if test1: if test2: print x\n\nAlso note that the semicolon binds tighter than the colon in this\ncontext, so that in the following example, either all or none of the\n``print`` statements are executed:\n\n if x < y < z: print x; print y; print z\n\nSummarizing:\n\n compound_stmt ::= if_stmt\n | while_stmt\n | for_stmt\n | try_stmt\n | with_stmt\n | funcdef\n | classdef\n | decorated\n suite ::= stmt_list NEWLINE | NEWLINE INDENT statement+ DEDENT\n statement ::= stmt_list NEWLINE | compound_stmt\n stmt_list ::= simple_stmt (";" simple_stmt)* [";"]\n\nNote that statements always end in a ``NEWLINE`` possibly followed by\na ``DEDENT``. Also note that optional continuation clauses always\nbegin with a keyword that cannot start a statement, thus there are no\nambiguities (the \'dangling ``else``\' problem is solved in Python by\nrequiring nested ``if`` statements to be indented).\n\nThe formatting of the grammar rules in the following sections places\neach clause on a separate line for clarity.\n\n\nThe ``if`` statement\n====================\n\nThe ``if`` statement is used for conditional execution:\n\n if_stmt ::= "if" expression ":" suite\n ( "elif" expression ":" suite )*\n ["else" ":" suite]\n\nIt selects exactly one of the suites by evaluating the expressions one\nby one until one is found to be true (see section *Boolean operations*\nfor the definition of true and false); then that suite is executed\n(and no other part of the ``if`` statement is executed or evaluated).\nIf all expressions are false, the suite of the ``else`` clause, if\npresent, is executed.\n\n\nThe ``while`` statement\n=======================\n\nThe ``while`` statement is used for repeated execution as long as an\nexpression is true:\n\n while_stmt ::= "while" expression ":" suite\n ["else" ":" suite]\n\nThis repeatedly tests the expression and, if it is true, executes the\nfirst suite; if the expression is false (which may be the first time\nit is tested) the suite of the ``else`` clause, if present, is\nexecuted and the loop terminates.\n\nA ``break`` statement executed in the first suite terminates the loop\nwithout executing the ``else`` clause\'s suite. A ``continue``\nstatement executed in the first suite skips the rest of the suite and\ngoes back to testing the expression.\n\n\nThe ``for`` statement\n=====================\n\nThe ``for`` statement is used to iterate over the elements of a\nsequence (such as a string, tuple or list) or other iterable object:\n\n for_stmt ::= "for" target_list "in" expression_list ":" suite\n ["else" ":" suite]\n\nThe expression list is evaluated once; it should yield an iterable\nobject. An iterator is created for the result of the\n``expression_list``. The suite is then executed once for each item\nprovided by the iterator, in the order of ascending indices. Each\nitem in turn is assigned to the target list using the standard rules\nfor assignments, and then the suite is executed. When the items are\nexhausted (which is immediately when the sequence is empty), the suite\nin the ``else`` clause, if present, is executed, and the loop\nterminates.\n\nA ``break`` statement executed in the first suite terminates the loop\nwithout executing the ``else`` clause\'s suite. A ``continue``\nstatement executed in the first suite skips the rest of the suite and\ncontinues with the next item, or with the ``else`` clause if there was\nno next item.\n\nThe suite may assign to the variable(s) in the target list; this does\nnot affect the next item assigned to it.\n\nThe target list is not deleted when the loop is finished, but if the\nsequence is empty, it will not have been assigned to at all by the\nloop. Hint: the built-in function ``range()`` returns a sequence of\nintegers suitable to emulate the effect of Pascal\'s ``for i := a to b\ndo``; e.g., ``range(3)`` returns the list ``[0, 1, 2]``.\n\nWarning: There is a subtlety when the sequence is being modified by the loop\n (this can only occur for mutable sequences, i.e. lists). An internal\n counter is used to keep track of which item is used next, and this\n is incremented on each iteration. When this counter has reached the\n length of the sequence the loop terminates. This means that if the\n suite deletes the current (or a previous) item from the sequence,\n the next item will be skipped (since it gets the index of the\n current item which has already been treated). Likewise, if the\n suite inserts an item in the sequence before the current item, the\n current item will be treated again the next time through the loop.\n This can lead to nasty bugs that can be avoided by making a\n temporary copy using a slice of the whole sequence, e.g.,\n\n for x in a[:]:\n if x < 0: a.remove(x)\n\n\nThe ``try`` statement\n=====================\n\nThe ``try`` statement specifies exception handlers and/or cleanup code\nfor a group of statements:\n\n try_stmt ::= try1_stmt | try2_stmt\n try1_stmt ::= "try" ":" suite\n ("except" [expression ["," target]] ":" suite)+\n ["else" ":" suite]\n ["finally" ":" suite]\n try2_stmt ::= "try" ":" suite\n "finally" ":" suite\n\nChanged in version 2.5: In previous versions of Python,\n``try``...``except``...``finally`` did not work. ``try``...``except``\nhad to be nested in ``try``...``finally``.\n\nThe ``except`` clause(s) specify one or more exception handlers. When\nno exception occurs in the ``try`` clause, no exception handler is\nexecuted. When an exception occurs in the ``try`` suite, a search for\nan exception handler is started. This search inspects the except\nclauses in turn until one is found that matches the exception. An\nexpression-less except clause, if present, must be last; it matches\nany exception. For an except clause with an expression, that\nexpression is evaluated, and the clause matches the exception if the\nresulting object is "compatible" with the exception. An object is\ncompatible with an exception if it is the class or a base class of the\nexception object, a tuple containing an item compatible with the\nexception, or, in the (deprecated) case of string exceptions, is the\nraised string itself (note that the object identities must match, i.e.\nit must be the same string object, not just a string with the same\nvalue).\n\nIf no except clause matches the exception, the search for an exception\nhandler continues in the surrounding code and on the invocation stack.\n[1]\n\nIf the evaluation of an expression in the header of an except clause\nraises an exception, the original search for a handler is canceled and\na search starts for the new exception in the surrounding code and on\nthe call stack (it is treated as if the entire ``try`` statement\nraised the exception).\n\nWhen a matching except clause is found, the exception is assigned to\nthe target specified in that except clause, if present, and the except\nclause\'s suite is executed. All except clauses must have an\nexecutable block. When the end of this block is reached, execution\ncontinues normally after the entire try statement. (This means that\nif two nested handlers exist for the same exception, and the exception\noccurs in the try clause of the inner handler, the outer handler will\nnot handle the exception.)\n\nBefore an except clause\'s suite is executed, details about the\nexception are assigned to three variables in the ``sys`` module:\n``sys.exc_type`` receives the object identifying the exception;\n``sys.exc_value`` receives the exception\'s parameter;\n``sys.exc_traceback`` receives a traceback object (see section *The\nstandard type hierarchy*) identifying the point in the program where\nthe exception occurred. These details are also available through the\n``sys.exc_info()`` function, which returns a tuple ``(exc_type,\nexc_value, exc_traceback)``. Use of the corresponding variables is\ndeprecated in favor of this function, since their use is unsafe in a\nthreaded program. As of Python 1.5, the variables are restored to\ntheir previous values (before the call) when returning from a function\nthat handled an exception.\n\nThe optional ``else`` clause is executed if and when control flows off\nthe end of the ``try`` clause. [2] Exceptions in the ``else`` clause\nare not handled by the preceding ``except`` clauses.\n\nIf ``finally`` is present, it specifies a \'cleanup\' handler. The\n``try`` clause is executed, including any ``except`` and ``else``\nclauses. If an exception occurs in any of the clauses and is not\nhandled, the exception is temporarily saved. The ``finally`` clause is\nexecuted. If there is a saved exception, it is re-raised at the end\nof the ``finally`` clause. If the ``finally`` clause raises another\nexception or executes a ``return`` or ``break`` statement, the saved\nexception is lost. The exception information is not available to the\nprogram during execution of the ``finally`` clause.\n\nWhen a ``return``, ``break`` or ``continue`` statement is executed in\nthe ``try`` suite of a ``try``...``finally`` statement, the\n``finally`` clause is also executed \'on the way out.\' A ``continue``\nstatement is illegal in the ``finally`` clause. (The reason is a\nproblem with the current implementation --- this restriction may be\nlifted in the future).\n\nAdditional information on exceptions can be found in section\n*Exceptions*, and information on using the ``raise`` statement to\ngenerate exceptions may be found in section *The raise statement*.\n\n\nThe ``with`` statement\n======================\n\nNew in version 2.5.\n\nThe ``with`` statement is used to wrap the execution of a block with\nmethods defined by a context manager (see section *With Statement\nContext Managers*). This allows common\n``try``...``except``...``finally`` usage patterns to be encapsulated\nfor convenient reuse.\n\n with_stmt ::= "with" expression ["as" target] ":" suite\n\nThe execution of the ``with`` statement proceeds as follows:\n\n1. The context expression is evaluated to obtain a context manager.\n\n2. The context manager\'s ``__enter__()`` method is invoked.\n\n3. If a target was included in the ``with`` statement, the return\n value from ``__enter__()`` is assigned to it.\n\n Note: The ``with`` statement guarantees that if the ``__enter__()``\n method returns without an error, then ``__exit__()`` will always\n be called. Thus, if an error occurs during the assignment to the\n target list, it will be treated the same as an error occurring\n within the suite would be. See step 5 below.\n\n4. The suite is executed.\n\n5. The context manager\'s ``__exit__()`` method is invoked. If an\n exception caused the suite to be exited, its type, value, and\n traceback are passed as arguments to ``__exit__()``. Otherwise,\n three ``None`` arguments are supplied.\n\n If the suite was exited due to an exception, and the return value\n from the ``__exit__()`` method was false, the exception is\n reraised. If the return value was true, the exception is\n suppressed, and execution continues with the statement following\n the ``with`` statement.\n\n If the suite was exited for any reason other than an exception, the\n return value from ``__exit__()`` is ignored, and execution proceeds\n at the normal location for the kind of exit that was taken.\n\nNote: In Python 2.5, the ``with`` statement is only allowed when the\n ``with_statement`` feature has been enabled. It is always enabled\n in Python 2.6.\n\nSee also:\n\n **PEP 0343** - The "with" statement\n The specification, background, and examples for the Python\n ``with`` statement.\n\n\nFunction definitions\n====================\n\nA function definition defines a user-defined function object (see\nsection *The standard type hierarchy*):\n\n decorated ::= decorators (classdef | funcdef)\n decorators ::= decorator+\n decorator ::= "@" dotted_name ["(" [argument_list [","]] ")"] NEWLINE\n funcdef ::= "def" funcname "(" [parameter_list] ")" ":" suite\n dotted_name ::= identifier ("." identifier)*\n parameter_list ::= (defparameter ",")*\n ( "*" identifier [, "**" identifier]\n | "**" identifier\n | defparameter [","] )\n defparameter ::= parameter ["=" expression]\n sublist ::= parameter ("," parameter)* [","]\n parameter ::= identifier | "(" sublist ")"\n funcname ::= identifier\n\nA function definition is an executable statement. Its execution binds\nthe function name in the current local namespace to a function object\n(a wrapper around the executable code for the function). This\nfunction object contains a reference to the current global namespace\nas the global namespace to be used when the function is called.\n\nThe function definition does not execute the function body; this gets\nexecuted only when the function is called. [3]\n\nA function definition may be wrapped by one or more *decorator*\nexpressions. Decorator expressions are evaluated when the function is\ndefined, in the scope that contains the function definition. The\nresult must be a callable, which is invoked with the function object\nas the only argument. The returned value is bound to the function name\ninstead of the function object. Multiple decorators are applied in\nnested fashion. For example, the following code:\n\n @f1(arg)\n @f2\n def func(): pass\n\nis equivalent to:\n\n def func(): pass\n func = f1(arg)(f2(func))\n\nWhen one or more top-level parameters have the form *parameter* ``=``\n*expression*, the function is said to have "default parameter values."\nFor a parameter with a default value, the corresponding argument may\nbe omitted from a call, in which case the parameter\'s default value is\nsubstituted. If a parameter has a default value, all following\nparameters must also have a default value --- this is a syntactic\nrestriction that is not expressed by the grammar.\n\n**Default parameter values are evaluated when the function definition\nis executed.** This means that the expression is evaluated once, when\nthe function is defined, and that that same "pre-computed" value is\nused for each call. This is especially important to understand when a\ndefault parameter is a mutable object, such as a list or a dictionary:\nif the function modifies the object (e.g. by appending an item to a\nlist), the default value is in effect modified. This is generally not\nwhat was intended. A way around this is to use ``None`` as the\ndefault, and explicitly test for it in the body of the function, e.g.:\n\n def whats_on_the_telly(penguin=None):\n if penguin is None:\n penguin = []\n penguin.append("property of the zoo")\n return penguin\n\nFunction call semantics are described in more detail in section\n*Calls*. A function call always assigns values to all parameters\nmentioned in the parameter list, either from position arguments, from\nkeyword arguments, or from default values. If the form\n"``*identifier``" is present, it is initialized to a tuple receiving\nany excess positional parameters, defaulting to the empty tuple. If\nthe form "``**identifier``" is present, it is initialized to a new\ndictionary receiving any excess keyword arguments, defaulting to a new\nempty dictionary.\n\nIt is also possible to create anonymous functions (functions not bound\nto a name), for immediate use in expressions. This uses lambda forms,\ndescribed in section *Expression lists*. Note that the lambda form is\nmerely a shorthand for a simplified function definition; a function\ndefined in a "``def``" statement can be passed around or assigned to\nanother name just like a function defined by a lambda form. The\n"``def``" form is actually more powerful since it allows the execution\nof multiple statements.\n\n**Programmer\'s note:** Functions are first-class objects. A "``def``"\nform executed inside a function definition defines a local function\nthat can be returned or passed around. Free variables used in the\nnested function can access the local variables of the function\ncontaining the def. See section *Naming and binding* for details.\n\n\nClass definitions\n=================\n\nA class definition defines a class object (see section *The standard\ntype hierarchy*):\n\n classdef ::= "class" classname [inheritance] ":" suite\n inheritance ::= "(" [expression_list] ")"\n classname ::= identifier\n\nA class definition is an executable statement. It first evaluates the\ninheritance list, if present. Each item in the inheritance list\nshould evaluate to a class object or class type which allows\nsubclassing. The class\'s suite is then executed in a new execution\nframe (see section *Naming and binding*), using a newly created local\nnamespace and the original global namespace. (Usually, the suite\ncontains only function definitions.) When the class\'s suite finishes\nexecution, its execution frame is discarded but its local namespace is\nsaved. [4] A class object is then created using the inheritance list\nfor the base classes and the saved local namespace for the attribute\ndictionary. The class name is bound to this class object in the\noriginal local namespace.\n\n**Programmer\'s note:** Variables defined in the class definition are\nclass variables; they are shared by all instances. To create instance\nvariables, they can be set in a method with ``self.name = value``.\nBoth class and instance variables are accessible through the notation\n"``self.name``", and an instance variable hides a class variable with\nthe same name when accessed in this way. Class variables can be used\nas defaults for instance variables, but using mutable values there can\nlead to unexpected results. For *new-style class*es, descriptors can\nbe used to create instance variables with different implementation\ndetails.\n\nClass definitions, like function definitions, may be wrapped by one or\nmore *decorator* expressions. The evaluation rules for the decorator\nexpressions are the same as for functions. The result must be a class\nobject, which is then bound to the class name.\n\n-[ Footnotes ]-\n\n[1] The exception is propagated to the invocation stack only if there\n is no ``finally`` clause that negates the exception.\n\n[2] Currently, control "flows off the end" except in the case of an\n exception or the execution of a ``return``, ``continue``, or\n ``break`` statement.\n\n[3] A string literal appearing as the first statement in the function\n body is transformed into the function\'s ``__doc__`` attribute and\n therefore the function\'s *docstring*.\n\n[4] A string literal appearing as the first statement in the class\n body is transformed into the namespace\'s ``__doc__`` item and\n therefore the class\'s *docstring*.\n', + 'context-managers': u'\nWith Statement Context Managers\n*******************************\n\nNew in version 2.5.\n\nA *context manager* is an object that defines the runtime context to\nbe established when executing a ``with`` statement. The context\nmanager handles the entry into, and the exit from, the desired runtime\ncontext for the execution of the block of code. Context managers are\nnormally invoked using the ``with`` statement (described in section\n*The with statement*), but can also be used by directly invoking their\nmethods.\n\nTypical uses of context managers include saving and restoring various\nkinds of global state, locking and unlocking resources, closing opened\nfiles, etc.\n\nFor more information on context managers, see *Context Manager Types*.\n\nobject.__enter__(self)\n\n Enter the runtime context related to this object. The ``with``\n statement will bind this method\'s return value to the target(s)\n specified in the ``as`` clause of the statement, if any.\n\nobject.__exit__(self, exc_type, exc_value, traceback)\n\n Exit the runtime context related to this object. The parameters\n describe the exception that caused the context to be exited. If the\n context was exited without an exception, all three arguments will\n be ``None``.\n\n If an exception is supplied, and the method wishes to suppress the\n exception (i.e., prevent it from being propagated), it should\n return a true value. Otherwise, the exception will be processed\n normally upon exit from this method.\n\n Note that ``__exit__()`` methods should not reraise the passed-in\n exception; this is the caller\'s responsibility.\n\nSee also:\n\n **PEP 0343** - The "with" statement\n The specification, background, and examples for the Python\n ``with`` statement.\n', 'continue': u'\nThe ``continue`` statement\n**************************\n\n continue_stmt ::= "continue"\n\n``continue`` may only occur syntactically nested in a ``for`` or\n``while`` loop, but not nested in a function or class definition or\n``finally`` clause within that loop. It continues with the next cycle\nof the nearest enclosing loop.\n\nWhen ``continue`` passes control out of a ``try`` statement with a\n``finally`` clause, that ``finally`` clause is executed before really\nstarting the next loop cycle.\n', 'conversions': u'\nArithmetic conversions\n**********************\n\nWhen a description of an arithmetic operator below uses the phrase\n"the numeric arguments are converted to a common type," the arguments\nare coerced using the coercion rules listed at *Coercion rules*. If\nboth arguments are standard numeric types, the following coercions are\napplied:\n\n* If either argument is a complex number, the other is converted to\n complex;\n\n* otherwise, if either argument is a floating point number, the other\n is converted to floating point;\n\n* otherwise, if either argument is a long integer, the other is\n converted to long integer;\n\n* otherwise, both must be plain integers and no conversion is\n necessary.\n\nSome additional rules apply for certain operators (e.g., a string left\nargument to the \'%\' operator). Extensions can define their own\ncoercions.\n', - 'customization': u'\nBasic customization\n*******************\n\nobject.__new__(cls[, ...])\n\n Called to create a new instance of class *cls*. ``__new__()`` is a\n static method (special-cased so you need not declare it as such)\n that takes the class of which an instance was requested as its\n first argument. The remaining arguments are those passed to the\n object constructor expression (the call to the class). The return\n value of ``__new__()`` should be the new object instance (usually\n an instance of *cls*).\n\n Typical implementations create a new instance of the class by\n invoking the superclass\'s ``__new__()`` method using\n ``super(currentclass, cls).__new__(cls[, ...])`` with appropriate\n arguments and then modifying the newly-created instance as\n necessary before returning it.\n\n If ``__new__()`` returns an instance of *cls*, then the new\n instance\'s ``__init__()`` method will be invoked like\n ``__init__(self[, ...])``, where *self* is the new instance and the\n remaining arguments are the same as were passed to ``__new__()``.\n\n If ``__new__()`` does not return an instance of *cls*, then the new\n instance\'s ``__init__()`` method will not be invoked.\n\n ``__new__()`` is intended mainly to allow subclasses of immutable\n types (like int, str, or tuple) to customize instance creation. It\n is also commonly overridden in custom metaclasses in order to\n customize class creation.\n\nobject.__init__(self[, ...])\n\n Called when the instance is created. The arguments are those\n passed to the class constructor expression. If a base class has an\n ``__init__()`` method, the derived class\'s ``__init__()`` method,\n if any, must explicitly call it to ensure proper initialization of\n the base class part of the instance; for example:\n ``BaseClass.__init__(self, [args...])``. As a special constraint\n on constructors, no value may be returned; doing so will cause a\n ``TypeError`` to be raised at runtime.\n\nobject.__del__(self)\n\n Called when the instance is about to be destroyed. This is also\n called a destructor. If a base class has a ``__del__()`` method,\n the derived class\'s ``__del__()`` method, if any, must explicitly\n call it to ensure proper deletion of the base class part of the\n instance. Note that it is possible (though not recommended!) for\n the ``__del__()`` method to postpone destruction of the instance by\n creating a new reference to it. It may then be called at a later\n time when this new reference is deleted. It is not guaranteed that\n ``__del__()`` methods are called for objects that still exist when\n the interpreter exits.\n\n Note: ``del x`` doesn\'t directly call ``x.__del__()`` --- the former\n decrements the reference count for ``x`` by one, and the latter\n is only called when ``x``\'s reference count reaches zero. Some\n common situations that may prevent the reference count of an\n object from going to zero include: circular references between\n objects (e.g., a doubly-linked list or a tree data structure with\n parent and child pointers); a reference to the object on the\n stack frame of a function that caught an exception (the traceback\n stored in ``sys.exc_traceback`` keeps the stack frame alive); or\n a reference to the object on the stack frame that raised an\n unhandled exception in interactive mode (the traceback stored in\n ``sys.last_traceback`` keeps the stack frame alive). The first\n situation can only be remedied by explicitly breaking the cycles;\n the latter two situations can be resolved by storing ``None`` in\n ``sys.exc_traceback`` or ``sys.last_traceback``. Circular\n references which are garbage are detected when the option cycle\n detector is enabled (it\'s on by default), but can only be cleaned\n up if there are no Python-level ``__del__()`` methods involved.\n Refer to the documentation for the ``gc`` module for more\n information about how ``__del__()`` methods are handled by the\n cycle detector, particularly the description of the ``garbage``\n value.\n\n Warning: Due to the precarious circumstances under which ``__del__()``\n methods are invoked, exceptions that occur during their execution\n are ignored, and a warning is printed to ``sys.stderr`` instead.\n Also, when ``__del__()`` is invoked in response to a module being\n deleted (e.g., when execution of the program is done), other\n globals referenced by the ``__del__()`` method may already have\n been deleted. For this reason, ``__del__()`` methods should do\n the absolute minimum needed to maintain external invariants.\n Starting with version 1.5, Python guarantees that globals whose\n name begins with a single underscore are deleted from their\n module before other globals are deleted; if no other references\n to such globals exist, this may help in assuring that imported\n modules are still available at the time when the ``__del__()``\n method is called.\n\nobject.__repr__(self)\n\n Called by the ``repr()`` built-in function and by string\n conversions (reverse quotes) to compute the "official" string\n representation of an object. If at all possible, this should look\n like a valid Python expression that could be used to recreate an\n object with the same value (given an appropriate environment). If\n this is not possible, a string of the form ``<...some useful\n description...>`` should be returned. The return value must be a\n string object. If a class defines ``__repr__()`` but not\n ``__str__()``, then ``__repr__()`` is also used when an "informal"\n string representation of instances of that class is required.\n\n This is typically used for debugging, so it is important that the\n representation is information-rich and unambiguous.\n\nobject.__str__(self)\n\n Called by the ``str()`` built-in function and by the ``print``\n statement to compute the "informal" string representation of an\n object. This differs from ``__repr__()`` in that it does not have\n to be a valid Python expression: a more convenient or concise\n representation may be used instead. The return value must be a\n string object.\n\nobject.__lt__(self, other)\nobject.__le__(self, other)\nobject.__eq__(self, other)\nobject.__ne__(self, other)\nobject.__gt__(self, other)\nobject.__ge__(self, other)\n\n Added in version 2.1.\n\n These are the so-called "rich comparison" methods, and are called\n for comparison operators in preference to ``__cmp__()`` below. The\n correspondence between operator symbols and method names is as\n follows: ``xy`` call ``x.__ne__(y)``, ``x>y`` calls ``x.__gt__(y)``, and\n ``x>=y`` calls ``x.__ge__(y)``.\n\n A rich comparison method may return the singleton\n ``NotImplemented`` if it does not implement the operation for a\n given pair of arguments. By convention, ``False`` and ``True`` are\n returned for a successful comparison. However, these methods can\n return any value, so if the comparison operator is used in a\n Boolean context (e.g., in the condition of an ``if`` statement),\n Python will call ``bool()`` on the value to determine if the result\n is true or false.\n\n There are no implied relationships among the comparison operators.\n The truth of ``x==y`` does not imply that ``x!=y`` is false.\n Accordingly, when defining ``__eq__()``, one should also define\n ``__ne__()`` so that the operators will behave as expected. See\n the paragraph on ``__hash__()`` for some important notes on\n creating *hashable* objects which support custom comparison\n operations and are usable as dictionary keys.\n\n There are no swapped-argument versions of these methods (to be used\n when the left argument does not support the operation but the right\n argument does); rather, ``__lt__()`` and ``__gt__()`` are each\n other\'s reflection, ``__le__()`` and ``__ge__()`` are each other\'s\n reflection, and ``__eq__()`` and ``__ne__()`` are their own\n reflection.\n\n Arguments to rich comparison methods are never coerced.\n\nobject.__cmp__(self, other)\n\n Called by comparison operations if rich comparison (see above) is\n not defined. Should return a negative integer if ``self < other``,\n zero if ``self == other``, a positive integer if ``self > other``.\n If no ``__cmp__()``, ``__eq__()`` or ``__ne__()`` operation is\n defined, class instances are compared by object identity\n ("address"). See also the description of ``__hash__()`` for some\n important notes on creating *hashable* objects which support custom\n comparison operations and are usable as dictionary keys. (Note: the\n restriction that exceptions are not propagated by ``__cmp__()`` has\n been removed since Python 1.5.)\n\nobject.__rcmp__(self, other)\n\n Changed in version 2.1: No longer supported.\n\nobject.__hash__(self)\n\n Called for the key object for dictionary operations, and by the\n built-in function ``hash()``. Should return an integer usable as a\n hash value for dictionary operations. The only required property\n is that objects which compare equal have the same hash value; it is\n advised to somehow mix together (e.g., using exclusive or) the hash\n values for the components of the object that also play a part in\n comparison of objects.\n\n If a class does not define a ``__cmp__()`` or ``__eq__()`` method\n it should not define a ``__hash__()`` operation either; if it\n defines ``__cmp__()`` or ``__eq__()`` but not ``__hash__()``, its\n instances will not be usable as dictionary keys. If a class\n defines mutable objects and implements a ``__cmp__()`` or\n ``__eq__()`` method, it should not implement ``__hash__()``, since\n the dictionary implementation requires that a key\'s hash value is\n immutable (if the object\'s hash value changes, it will be in the\n wrong hash bucket).\n\n User-defined classes have ``__cmp__()`` and ``__hash__()`` methods\n by default; with them, all objects compare unequal and\n ``x.__hash__()`` returns ``id(x)``.\n\n Changed in version 2.5: ``__hash__()`` may now also return a long\n integer object; the 32-bit integer is then derived from the hash of\n that object.\n\nobject.__nonzero__(self)\n\n Called to implement truth value testing, and the built-in operation\n ``bool()``; should return ``False`` or ``True``, or their integer\n equivalents ``0`` or ``1``. When this method is not defined,\n ``__len__()`` is called, if it is defined (see below). If a class\n defines neither ``__len__()`` nor ``__nonzero__()``, all its\n instances are considered true.\n\nobject.__unicode__(self)\n\n Called to implement ``unicode()`` builtin; should return a Unicode\n object. When this method is not defined, string conversion is\n attempted, and the result of string conversion is converted to\n Unicode using the system default encoding.\n', - 'debugger': u'\n``pdb`` --- The Python Debugger\n*******************************\n\nThe module ``pdb`` defines an interactive source code debugger for\nPython programs. It supports setting (conditional) breakpoints and\nsingle stepping at the source line level, inspection of stack frames,\nsource code listing, and evaluation of arbitrary Python code in the\ncontext of any stack frame. It also supports post-mortem debugging\nand can be called under program control.\n\nThe debugger is extensible --- it is actually defined as the class\n``Pdb``. This is currently undocumented but easily understood by\nreading the source. The extension interface uses the modules ``bdb``\n(undocumented) and ``cmd``.\n\nThe debugger\'s prompt is ``(Pdb)``. Typical usage to run a program\nunder control of the debugger is:\n\n >>> import pdb\n >>> import mymodule\n >>> pdb.run(\'mymodule.test()\')\n > (0)?()\n (Pdb) continue\n > (1)?()\n (Pdb) continue\n NameError: \'spam\'\n > (1)?()\n (Pdb)\n\n``pdb.py`` can also be invoked as a script to debug other scripts.\nFor example:\n\n python -m pdb myscript.py\n\nWhen invoked as a script, pdb will automatically enter post-mortem\ndebugging if the program being debugged exits abnormally. After post-\nmortem debugging (or after normal exit of the program), pdb will\nrestart the program. Automatic restarting preserves pdb\'s state (such\nas breakpoints) and in most cases is more useful than quitting the\ndebugger upon program\'s exit.\n\nAdded in version 2.4: Restarting post-mortem behavior added.\n\nTypical usage to inspect a crashed program is:\n\n >>> import pdb\n >>> import mymodule\n >>> mymodule.test()\n Traceback (most recent call last):\n File "", line 1, in ?\n File "./mymodule.py", line 4, in test\n test2()\n File "./mymodule.py", line 3, in test2\n print spam\n NameError: spam\n >>> pdb.pm()\n > ./mymodule.py(3)test2()\n -> print spam\n (Pdb)\n\nThe module defines the following functions; each enters the debugger\nin a slightly different way:\n\npdb.run(statement[, globals[, locals]])\n\n Execute the *statement* (given as a string) under debugger control.\n The debugger prompt appears before any code is executed; you can\n set breakpoints and type ``continue``, or you can step through the\n statement using ``step`` or ``next`` (all these commands are\n explained below). The optional *globals* and *locals* arguments\n specify the environment in which the code is executed; by default\n the dictionary of the module ``__main__`` is used. (See the\n explanation of the ``exec`` statement or the ``eval()`` built-in\n function.)\n\npdb.runeval(expression[, globals[, locals]])\n\n Evaluate the *expression* (given as a string) under debugger\n control. When ``runeval()`` returns, it returns the value of the\n expression. Otherwise this function is similar to ``run()``.\n\npdb.runcall(function[, argument, ...])\n\n Call the *function* (a function or method object, not a string)\n with the given arguments. When ``runcall()`` returns, it returns\n whatever the function call returned. The debugger prompt appears\n as soon as the function is entered.\n\npdb.set_trace()\n\n Enter the debugger at the calling stack frame. This is useful to\n hard-code a breakpoint at a given point in a program, even if the\n code is not otherwise being debugged (e.g. when an assertion\n fails).\n\npdb.post_mortem([traceback])\n\n Enter post-mortem debugging of the given *traceback* object. If no\n *traceback* is given, it uses the one of the exception that is\n currently being handled (an exception must be being handled if the\n default is to be used).\n\npdb.pm()\n\n Enter post-mortem debugging of the traceback found in\n ``sys.last_traceback``.\n', + 'customization': u'\nBasic customization\n*******************\n\nobject.__new__(cls[, ...])\n\n Called to create a new instance of class *cls*. ``__new__()`` is a\n static method (special-cased so you need not declare it as such)\n that takes the class of which an instance was requested as its\n first argument. The remaining arguments are those passed to the\n object constructor expression (the call to the class). The return\n value of ``__new__()`` should be the new object instance (usually\n an instance of *cls*).\n\n Typical implementations create a new instance of the class by\n invoking the superclass\'s ``__new__()`` method using\n ``super(currentclass, cls).__new__(cls[, ...])`` with appropriate\n arguments and then modifying the newly-created instance as\n necessary before returning it.\n\n If ``__new__()`` returns an instance of *cls*, then the new\n instance\'s ``__init__()`` method will be invoked like\n ``__init__(self[, ...])``, where *self* is the new instance and the\n remaining arguments are the same as were passed to ``__new__()``.\n\n If ``__new__()`` does not return an instance of *cls*, then the new\n instance\'s ``__init__()`` method will not be invoked.\n\n ``__new__()`` is intended mainly to allow subclasses of immutable\n types (like int, str, or tuple) to customize instance creation. It\n is also commonly overridden in custom metaclasses in order to\n customize class creation.\n\nobject.__init__(self[, ...])\n\n Called when the instance is created. The arguments are those\n passed to the class constructor expression. If a base class has an\n ``__init__()`` method, the derived class\'s ``__init__()`` method,\n if any, must explicitly call it to ensure proper initialization of\n the base class part of the instance; for example:\n ``BaseClass.__init__(self, [args...])``. As a special constraint\n on constructors, no value may be returned; doing so will cause a\n ``TypeError`` to be raised at runtime.\n\nobject.__del__(self)\n\n Called when the instance is about to be destroyed. This is also\n called a destructor. If a base class has a ``__del__()`` method,\n the derived class\'s ``__del__()`` method, if any, must explicitly\n call it to ensure proper deletion of the base class part of the\n instance. Note that it is possible (though not recommended!) for\n the ``__del__()`` method to postpone destruction of the instance by\n creating a new reference to it. It may then be called at a later\n time when this new reference is deleted. It is not guaranteed that\n ``__del__()`` methods are called for objects that still exist when\n the interpreter exits.\n\n Note: ``del x`` doesn\'t directly call ``x.__del__()`` --- the former\n decrements the reference count for ``x`` by one, and the latter\n is only called when ``x``\'s reference count reaches zero. Some\n common situations that may prevent the reference count of an\n object from going to zero include: circular references between\n objects (e.g., a doubly-linked list or a tree data structure with\n parent and child pointers); a reference to the object on the\n stack frame of a function that caught an exception (the traceback\n stored in ``sys.exc_traceback`` keeps the stack frame alive); or\n a reference to the object on the stack frame that raised an\n unhandled exception in interactive mode (the traceback stored in\n ``sys.last_traceback`` keeps the stack frame alive). The first\n situation can only be remedied by explicitly breaking the cycles;\n the latter two situations can be resolved by storing ``None`` in\n ``sys.exc_traceback`` or ``sys.last_traceback``. Circular\n references which are garbage are detected when the option cycle\n detector is enabled (it\'s on by default), but can only be cleaned\n up if there are no Python-level ``__del__()`` methods involved.\n Refer to the documentation for the ``gc`` module for more\n information about how ``__del__()`` methods are handled by the\n cycle detector, particularly the description of the ``garbage``\n value.\n\n Warning: Due to the precarious circumstances under which ``__del__()``\n methods are invoked, exceptions that occur during their execution\n are ignored, and a warning is printed to ``sys.stderr`` instead.\n Also, when ``__del__()`` is invoked in response to a module being\n deleted (e.g., when execution of the program is done), other\n globals referenced by the ``__del__()`` method may already have\n been deleted. For this reason, ``__del__()`` methods should do\n the absolute minimum needed to maintain external invariants.\n Starting with version 1.5, Python guarantees that globals whose\n name begins with a single underscore are deleted from their\n module before other globals are deleted; if no other references\n to such globals exist, this may help in assuring that imported\n modules are still available at the time when the ``__del__()``\n method is called.\n\nobject.__repr__(self)\n\n Called by the ``repr()`` built-in function and by string\n conversions (reverse quotes) to compute the "official" string\n representation of an object. If at all possible, this should look\n like a valid Python expression that could be used to recreate an\n object with the same value (given an appropriate environment). If\n this is not possible, a string of the form ``<...some useful\n description...>`` should be returned. The return value must be a\n string object. If a class defines ``__repr__()`` but not\n ``__str__()``, then ``__repr__()`` is also used when an "informal"\n string representation of instances of that class is required.\n\n This is typically used for debugging, so it is important that the\n representation is information-rich and unambiguous.\n\nobject.__str__(self)\n\n Called by the ``str()`` built-in function and by the ``print``\n statement to compute the "informal" string representation of an\n object. This differs from ``__repr__()`` in that it does not have\n to be a valid Python expression: a more convenient or concise\n representation may be used instead. The return value must be a\n string object.\n\nobject.__lt__(self, other)\nobject.__le__(self, other)\nobject.__eq__(self, other)\nobject.__ne__(self, other)\nobject.__gt__(self, other)\nobject.__ge__(self, other)\n\n New in version 2.1.\n\n These are the so-called "rich comparison" methods, and are called\n for comparison operators in preference to ``__cmp__()`` below. The\n correspondence between operator symbols and method names is as\n follows: ``xy`` call ``x.__ne__(y)``, ``x>y`` calls ``x.__gt__(y)``, and\n ``x>=y`` calls ``x.__ge__(y)``.\n\n A rich comparison method may return the singleton\n ``NotImplemented`` if it does not implement the operation for a\n given pair of arguments. By convention, ``False`` and ``True`` are\n returned for a successful comparison. However, these methods can\n return any value, so if the comparison operator is used in a\n Boolean context (e.g., in the condition of an ``if`` statement),\n Python will call ``bool()`` on the value to determine if the result\n is true or false.\n\n There are no implied relationships among the comparison operators.\n The truth of ``x==y`` does not imply that ``x!=y`` is false.\n Accordingly, when defining ``__eq__()``, one should also define\n ``__ne__()`` so that the operators will behave as expected. See\n the paragraph on ``__hash__()`` for some important notes on\n creating *hashable* objects which support custom comparison\n operations and are usable as dictionary keys.\n\n There are no swapped-argument versions of these methods (to be used\n when the left argument does not support the operation but the right\n argument does); rather, ``__lt__()`` and ``__gt__()`` are each\n other\'s reflection, ``__le__()`` and ``__ge__()`` are each other\'s\n reflection, and ``__eq__()`` and ``__ne__()`` are their own\n reflection.\n\n Arguments to rich comparison methods are never coerced.\n\nobject.__cmp__(self, other)\n\n Called by comparison operations if rich comparison (see above) is\n not defined. Should return a negative integer if ``self < other``,\n zero if ``self == other``, a positive integer if ``self > other``.\n If no ``__cmp__()``, ``__eq__()`` or ``__ne__()`` operation is\n defined, class instances are compared by object identity\n ("address"). See also the description of ``__hash__()`` for some\n important notes on creating *hashable* objects which support custom\n comparison operations and are usable as dictionary keys. (Note: the\n restriction that exceptions are not propagated by ``__cmp__()`` has\n been removed since Python 1.5.)\n\nobject.__rcmp__(self, other)\n\n Changed in version 2.1: No longer supported.\n\nobject.__hash__(self)\n\n Called for the key object for dictionary operations, and by the\n built-in function ``hash()``. Should return an integer usable as a\n hash value for dictionary operations. The only required property\n is that objects which compare equal have the same hash value; it is\n advised to somehow mix together (e.g., using exclusive or) the hash\n values for the components of the object that also play a part in\n comparison of objects.\n\n If a class does not define a ``__cmp__()`` or ``__eq__()`` method\n it should not define a ``__hash__()`` operation either; if it\n defines ``__cmp__()`` or ``__eq__()`` but not ``__hash__()``, its\n instances will not be usable as dictionary keys. If a class\n defines mutable objects and implements a ``__cmp__()`` or\n ``__eq__()`` method, it should not implement ``__hash__()``, since\n the dictionary implementation requires that a key\'s hash value is\n immutable (if the object\'s hash value changes, it will be in the\n wrong hash bucket).\n\n User-defined classes have ``__cmp__()`` and ``__hash__()`` methods\n by default; with them, all objects compare unequal (except with\n themselves) and ``x.__hash__()`` returns ``id(x)``.\n\n Classes which inherit a ``__hash__()`` method from a parent class\n but change the meaning of ``__cmp__()`` or ``__eq__()`` such that\n the hash value returned is no longer appropriate (e.g. by switching\n to a value-based concept of equality instead of the default\n identity based equality) can explicitly flag themselves as being\n unhashable by setting ``__hash__ = None`` in the class definition.\n Doing so means that not only will instances of the class raise an\n appropriate ``TypeError`` when a program attempts to retrieve their\n hash value, but they will also be correctly identified as\n unhashable when checking ``isinstance(obj, collections.Hashable)``\n (unlike classes which define their own ``__hash__()`` to explicitly\n raise ``TypeError``).\n\n Changed in version 2.5: ``__hash__()`` may now also return a long\n integer object; the 32-bit integer is then derived from the hash of\n that object.\n\n Changed in version 2.6: ``__hash__`` may now be set to ``None`` to\n explicitly flag instances of a class as unhashable.\n\nobject.__nonzero__(self)\n\n Called to implement truth value testing, and the built-in operation\n ``bool()``; should return ``False`` or ``True``, or their integer\n equivalents ``0`` or ``1``. When this method is not defined,\n ``__len__()`` is called, if it is defined (see below). If a class\n defines neither ``__len__()`` nor ``__nonzero__()``, all its\n instances are considered true.\n\nobject.__unicode__(self)\n\n Called to implement ``unicode()`` builtin; should return a Unicode\n object. When this method is not defined, string conversion is\n attempted, and the result of string conversion is converted to\n Unicode using the system default encoding.\n', + 'debugger': u'\n``pdb`` --- The Python Debugger\n*******************************\n\nThe module ``pdb`` defines an interactive source code debugger for\nPython programs. It supports setting (conditional) breakpoints and\nsingle stepping at the source line level, inspection of stack frames,\nsource code listing, and evaluation of arbitrary Python code in the\ncontext of any stack frame. It also supports post-mortem debugging\nand can be called under program control.\n\nThe debugger is extensible --- it is actually defined as the class\n``Pdb``. This is currently undocumented but easily understood by\nreading the source. The extension interface uses the modules ``bdb``\n(undocumented) and ``cmd``.\n\nThe debugger\'s prompt is ``(Pdb)``. Typical usage to run a program\nunder control of the debugger is:\n\n >>> import pdb\n >>> import mymodule\n >>> pdb.run(\'mymodule.test()\')\n > (0)?()\n (Pdb) continue\n > (1)?()\n (Pdb) continue\n NameError: \'spam\'\n > (1)?()\n (Pdb)\n\n``pdb.py`` can also be invoked as a script to debug other scripts.\nFor example:\n\n python -m pdb myscript.py\n\nWhen invoked as a script, pdb will automatically enter post-mortem\ndebugging if the program being debugged exits abnormally. After post-\nmortem debugging (or after normal exit of the program), pdb will\nrestart the program. Automatic restarting preserves pdb\'s state (such\nas breakpoints) and in most cases is more useful than quitting the\ndebugger upon program\'s exit.\n\nNew in version 2.4: Restarting post-mortem behavior added.\n\nTypical usage to inspect a crashed program is:\n\n >>> import pdb\n >>> import mymodule\n >>> mymodule.test()\n Traceback (most recent call last):\n File "", line 1, in ?\n File "./mymodule.py", line 4, in test\n test2()\n File "./mymodule.py", line 3, in test2\n print spam\n NameError: spam\n >>> pdb.pm()\n > ./mymodule.py(3)test2()\n -> print spam\n (Pdb)\n\nThe module defines the following functions; each enters the debugger\nin a slightly different way:\n\npdb.run(statement[, globals[, locals]])\n\n Execute the *statement* (given as a string) under debugger control.\n The debugger prompt appears before any code is executed; you can\n set breakpoints and type ``continue``, or you can step through the\n statement using ``step`` or ``next`` (all these commands are\n explained below). The optional *globals* and *locals* arguments\n specify the environment in which the code is executed; by default\n the dictionary of the module ``__main__`` is used. (See the\n explanation of the ``exec`` statement or the ``eval()`` built-in\n function.)\n\npdb.runeval(expression[, globals[, locals]])\n\n Evaluate the *expression* (given as a string) under debugger\n control. When ``runeval()`` returns, it returns the value of the\n expression. Otherwise this function is similar to ``run()``.\n\npdb.runcall(function[, argument, ...])\n\n Call the *function* (a function or method object, not a string)\n with the given arguments. When ``runcall()`` returns, it returns\n whatever the function call returned. The debugger prompt appears\n as soon as the function is entered.\n\npdb.set_trace()\n\n Enter the debugger at the calling stack frame. This is useful to\n hard-code a breakpoint at a given point in a program, even if the\n code is not otherwise being debugged (e.g. when an assertion\n fails).\n\npdb.post_mortem([traceback])\n\n Enter post-mortem debugging of the given *traceback* object. If no\n *traceback* is given, it uses the one of the exception that is\n currently being handled (an exception must be being handled if the\n default is to be used).\n\npdb.pm()\n\n Enter post-mortem debugging of the traceback found in\n ``sys.last_traceback``.\n', 'del': u'\nThe ``del`` statement\n*********************\n\n del_stmt ::= "del" target_list\n\nDeletion is recursively defined very similar to the way assignment is\ndefined. Rather that spelling it out in full details, here are some\nhints.\n\nDeletion of a target list recursively deletes each target, from left\nto right.\n\nDeletion of a name removes the binding of that name from the local or\nglobal namespace, depending on whether the name occurs in a ``global``\nstatement in the same code block. If the name is unbound, a\n``NameError`` exception will be raised.\n\nIt is illegal to delete a name from the local namespace if it occurs\nas a free variable in a nested block.\n\nDeletion of attribute references, subscriptions and slicings is passed\nto the primary object involved; deletion of a slicing is in general\nequivalent to assignment of an empty slice of the right type (but even\nthis is determined by the sliced object).\n', 'dict': u'\nDictionary displays\n*******************\n\nA dictionary display is a possibly empty series of key/datum pairs\nenclosed in curly braces:\n\n dict_display ::= "{" [key_datum_list] "}"\n key_datum_list ::= key_datum ("," key_datum)* [","]\n key_datum ::= expression ":" expression\n\nA dictionary display yields a new dictionary object.\n\nThe key/datum pairs are evaluated from left to right to define the\nentries of the dictionary: each key object is used as a key into the\ndictionary to store the corresponding datum.\n\nRestrictions on the types of the key values are listed earlier in\nsection *The standard type hierarchy*. (To summarize, the key type\nshould be *hashable*, which excludes all mutable objects.) Clashes\nbetween duplicate keys are not detected; the last datum (textually\nrightmost in the display) stored for a given key value prevails.\n', 'dynamic-features': u'\nInteraction with dynamic features\n*********************************\n\nThere are several cases where Python statements are illegal when used\nin conjunction with nested scopes that contain free variables.\n\nIf a variable is referenced in an enclosing scope, it is illegal to\ndelete the name. An error will be reported at compile time.\n\nIf the wild card form of import --- ``import *`` --- is used in a\nfunction and the function contains or is a nested block with free\nvariables, the compiler will raise a ``SyntaxError``.\n\nIf ``exec`` is used in a function and the function contains or is a\nnested block with free variables, the compiler will raise a\n``SyntaxError`` unless the exec explicitly specifies the local\nnamespace for the ``exec``. (In other words, ``exec obj`` would be\nillegal, but ``exec obj in ns`` would be legal.)\n\nThe ``eval()``, ``execfile()``, and ``input()`` functions and the\n``exec`` statement do not have access to the full environment for\nresolving names. Names may be resolved in the local and global\nnamespaces of the caller. Free variables are not resolved in the\nnearest enclosing namespace, but in the global namespace. [1] The\n``exec`` statement and the ``eval()`` and ``execfile()`` functions\nhave optional arguments to override the global and local namespace.\nIf only one namespace is specified, it is used for both.\n', @@ -36,48 +36,48 @@ 'exprlists': u'\nExpression lists\n****************\n\n expression_list ::= expression ( "," expression )* [","]\n\nAn expression list containing at least one comma yields a tuple. The\nlength of the tuple is the number of expressions in the list. The\nexpressions are evaluated from left to right.\n\nThe trailing comma is required only to create a single tuple (a.k.a. a\n*singleton*); it is optional in all other cases. A single expression\nwithout a trailing comma doesn\'t create a tuple, but rather yields the\nvalue of that expression. (To create an empty tuple, use an empty pair\nof parentheses: ``()``.)\n', 'floating': u'\nFloating point literals\n***********************\n\nFloating point literals are described by the following lexical\ndefinitions:\n\n floatnumber ::= pointfloat | exponentfloat\n pointfloat ::= [intpart] fraction | intpart "."\n exponentfloat ::= (intpart | pointfloat) exponent\n intpart ::= digit+\n fraction ::= "." digit+\n exponent ::= ("e" | "E") ["+" | "-"] digit+\n\nNote that the integer and exponent parts of floating point numbers can\nlook like octal integers, but are interpreted using radix 10. For\nexample, ``077e010`` is legal, and denotes the same number as\n``77e10``. The allowed range of floating point literals is\nimplementation-dependent. Some examples of floating point literals:\n\n 3.14 10. .001 1e100 3.14e-10 0e0\n\nNote that numeric literals do not include a sign; a phrase like ``-1``\nis actually an expression composed of the unary operator ``-`` and the\nliteral ``1``.\n', 'for': u'\nThe ``for`` statement\n*********************\n\nThe ``for`` statement is used to iterate over the elements of a\nsequence (such as a string, tuple or list) or other iterable object:\n\n for_stmt ::= "for" target_list "in" expression_list ":" suite\n ["else" ":" suite]\n\nThe expression list is evaluated once; it should yield an iterable\nobject. An iterator is created for the result of the\n``expression_list``. The suite is then executed once for each item\nprovided by the iterator, in the order of ascending indices. Each\nitem in turn is assigned to the target list using the standard rules\nfor assignments, and then the suite is executed. When the items are\nexhausted (which is immediately when the sequence is empty), the suite\nin the ``else`` clause, if present, is executed, and the loop\nterminates.\n\nA ``break`` statement executed in the first suite terminates the loop\nwithout executing the ``else`` clause\'s suite. A ``continue``\nstatement executed in the first suite skips the rest of the suite and\ncontinues with the next item, or with the ``else`` clause if there was\nno next item.\n\nThe suite may assign to the variable(s) in the target list; this does\nnot affect the next item assigned to it.\n\nThe target list is not deleted when the loop is finished, but if the\nsequence is empty, it will not have been assigned to at all by the\nloop. Hint: the built-in function ``range()`` returns a sequence of\nintegers suitable to emulate the effect of Pascal\'s ``for i := a to b\ndo``; e.g., ``range(3)`` returns the list ``[0, 1, 2]``.\n\nWarning: There is a subtlety when the sequence is being modified by the loop\n (this can only occur for mutable sequences, i.e. lists). An internal\n counter is used to keep track of which item is used next, and this\n is incremented on each iteration. When this counter has reached the\n length of the sequence the loop terminates. This means that if the\n suite deletes the current (or a previous) item from the sequence,\n the next item will be skipped (since it gets the index of the\n current item which has already been treated). Likewise, if the\n suite inserts an item in the sequence before the current item, the\n current item will be treated again the next time through the loop.\n This can lead to nasty bugs that can be avoided by making a\n temporary copy using a slice of the whole sequence, e.g.,\n\n for x in a[:]:\n if x < 0: a.remove(x)\n', - 'formatstrings': u'\nFormat String Syntax\n********************\n\nThe ``str.format()`` method and the ``Formatter`` class share the same\nsyntax for format strings (although in the case of ``Formatter``,\nsubclasses can define their own format string syntax.)\n\nFormat strings contain "replacement fields" surrounded by curly braces\n``{}``. Anything that is not contained in braces is considered literal\ntext, which is copied unchanged to the output. If you need to include\na brace character in the literal text, it can be escaped by doubling:\n``{{`` and ``}}``.\n\nThe grammar for a replacement field is as follows:\n\n replacement_field ::= "{" field_name ["!" conversion] [":" format_spec] "}"\n field_name ::= (identifier | integer) ("." attribute_name | "[" element_index "]")*\n attribute_name ::= identifier\n element_index ::= integer\n conversion ::= "r" | "s"\n format_spec ::= \n\nIn less formal terms, the replacement field starts with a\n*field_name*, which can either be a number (for a positional\nargument), or an identifier (for keyword arguments). Following this\nis an optional *conversion* field, which is preceded by an exclamation\npoint ``\'!\'``, and a *format_spec*, which is preceded by a colon\n``\':\'``.\n\nThe *field_name* itself begins with either a number or a keyword. If\nit\'s a number, it refers to a positional argument, and if it\'s a\nkeyword it refers to a named keyword argument. This can be followed\nby any number of index or attribute expressions. An expression of the\nform ``\'.name\'`` selects the named attribute using ``getattr()``,\nwhile an expression of the form ``\'[index]\'`` does an index lookup\nusing ``__getitem__()``.\n\nSome simple format string examples:\n\n "First, thou shalt count to {0}" # References first positional argument\n "My quest is {name}" # References keyword argument \'name\'\n "Weight in tons {0.weight}" # \'weight\' attribute of first positional arg\n "Units destroyed: {players[0]}" # First element of keyword argument \'players\'.\n\nThe *conversion* field causes a type coercion before formatting.\nNormally, the job of formatting a value is done by the\n``__format__()`` method of the value itself. However, in some cases\nit is desirable to force a type to be formatted as a string,\noverriding its own definition of formatting. By converting the value\nto a string before calling ``__format__()``, the normal formatting\nlogic is bypassed.\n\nTwo conversion flags are currently supported: ``\'!s\'`` which calls\n``str()`` on the value, and ``\'!r\'`` which calls ``repr()``.\n\nSome examples:\n\n "Harold\'s a clever {0!s}" # Calls str() on the argument first\n "Bring out the holy {name!r}" # Calls repr() on the argument first\n\nThe *format_spec* field contains a specification of how the value\nshould be presented, including such details as field width, alignment,\npadding, decimal precision and so on. Each value type can define it\'s\nown "formatting mini-language" or interpretation of the *format_spec*.\n\nMost built-in types support a common formatting mini-language, which\nis described in the next section.\n\nA *format_spec* field can also include nested replacement fields\nwithin it. These nested replacement fields can contain only a field\nname; conversion flags and format specifications are not allowed. The\nreplacement fields within the format_spec are substituted before the\n*format_spec* string is interpreted. This allows the formatting of a\nvalue to be dynamically specified.\n\nFor example, suppose you wanted to have a replacement field whose\nfield width is determined by another variable:\n\n "A man with two {0:{1}}".format("noses", 10)\n\nThis would first evaluate the inner replacement field, making the\nformat string effectively:\n\n "A man with two {0:10}"\n\nThen the outer replacement field would be evaluated, producing:\n\n "noses "\n\nWhich is subsitituted into the string, yielding:\n\n "A man with two noses "\n\n(The extra space is because we specified a field width of 10, and\nbecause left alignment is the default for strings.)\n\n\nFormat Specification Mini-Language\n==================================\n\n"Format specifications" are used within replacement fields contained\nwithin a format string to define how individual values are presented\n(see *Format String Syntax*.) They can also be passed directly to the\nbuiltin ``format()`` function. Each formattable type may define how\nthe format specification is to be interpreted.\n\nMost built-in types implement the following options for format\nspecifications, although some of the formatting options are only\nsupported by the numeric types.\n\nA general convention is that an empty format string (``""``) produces\nthe same result as if you had called ``str()`` on the value.\n\nThe general form of a *standard format specifier* is:\n\n format_spec ::= [[fill]align][sign][0][width][.precision][type]\n fill ::= \n align ::= "<" | ">" | "=" | "^"\n sign ::= "+" | "-" | " "\n width ::= integer\n precision ::= integer\n type ::= "b" | "c" | "d" | "e" | "E" | "f" | "F" | "g" | "G" | "n" | "o" | "x" | "X" | "%"\n\nThe *fill* character can be any character other than \'}\' (which\nsignifies the end of the field). The presence of a fill character is\nsignaled by the *next* character, which must be one of the alignment\noptions. If the second character of *format_spec* is not a valid\nalignment option, then it is assumed that both the fill character and\nthe alignment option are absent.\n\nThe meaning of the various alignment options is as follows:\n\n +-----------+------------------------------------------------------------+\n | Option | Meaning |\n +===========+============================================================+\n | ``\'<\'`` | Forces the field to be left-aligned within the available |\n | | space (This is the default.) |\n +-----------+------------------------------------------------------------+\n | ``\'>\'`` | Forces the field to be right-aligned within the available |\n | | space. |\n +-----------+------------------------------------------------------------+\n | ``\'=\'`` | Forces the padding to be placed after the sign (if any) |\n | | but before the digits. This is used for printing fields |\n | | in the form \'+000000120\'. This alignment option is only |\n | | valid for numeric types. |\n +-----------+------------------------------------------------------------+\n | ``\'^\'`` | Forces the field to be centered within the available |\n | | space. |\n +-----------+------------------------------------------------------------+\n\nNote that unless a minimum field width is defined, the field width\nwill always be the same size as the data to fill it, so that the\nalignment option has no meaning in this case.\n\nThe *sign* option is only valid for number types, and can be one of\nthe following:\n\n +-----------+------------------------------------------------------------+\n | Option | Meaning |\n +===========+============================================================+\n | ``\'+\'`` | indicates that a sign should be used for both positive as |\n | | well as negative numbers. |\n +-----------+------------------------------------------------------------+\n | ``\'-\'`` | indicates that a sign should be used only for negative |\n | | numbers (this is the default behavior). |\n +-----------+------------------------------------------------------------+\n | space | indicates that a leading space should be used on positive |\n | | numbers, and a minus sign on negative numbers. |\n +-----------+------------------------------------------------------------+\n\n*width* is a decimal integer defining the minimum field width. If not\nspecified, then the field width will be determined by the content.\n\nIf the *width* field is preceded by a zero (``\'0\'``) character, this\nenables zero-padding. This is equivalent to an *alignment* type of\n``\'=\'`` and a *fill* character of ``\'0\'``.\n\nThe *precision* is a decimal number indicating how many digits should\nbe displayed after the decimal point for a floating point value. For\nnon-number types the field indicates the maximum field size - in other\nwords, how many characters will be used from the field content. The\n*precision* is ignored for integer values.\n\nFinally, the *type* determines how the data should be presented.\n\nThe available integer presentation types are:\n\n +-----------+------------------------------------------------------------+\n | Type | Meaning |\n +===========+============================================================+\n | ``\'b\'`` | Binary. Outputs the number in base 2. |\n +-----------+------------------------------------------------------------+\n | ``\'c\'`` | Character. Converts the integer to the corresponding |\n | | unicode character before printing. |\n +-----------+------------------------------------------------------------+\n | ``\'d\'`` | Decimal Integer. Outputs the number in base 10. |\n +-----------+------------------------------------------------------------+\n | ``\'o\'`` | Octal format. Outputs the number in base 8. |\n +-----------+------------------------------------------------------------+\n | ``\'x\'`` | Hex format. Outputs the number in base 16, using lower- |\n | | case letters for the digits above 9. |\n +-----------+------------------------------------------------------------+\n | ``\'X\'`` | Hex format. Outputs the number in base 16, using upper- |\n | | case letters for the digits above 9. |\n +-----------+------------------------------------------------------------+\n | ``\'n\'`` | Number. This is the same as ``\'d\'``, except that it uses |\n | | the current locale setting to insert the appropriate |\n | | number separator characters. |\n +-----------+------------------------------------------------------------+\n | None | the same as ``\'d\'`` |\n +-----------+------------------------------------------------------------+\n\nThe available presentation types for floating point and decimal values\nare:\n\n +-----------+------------------------------------------------------------+\n | Type | Meaning |\n +===========+============================================================+\n | ``\'e\'`` | Exponent notation. Prints the number in scientific |\n | | notation using the letter \'e\' to indicate the exponent. |\n +-----------+------------------------------------------------------------+\n | ``\'E\'`` | Exponent notation. Same as ``\'e\'`` except it uses an upper |\n | | case \'E\' as the separator character. |\n +-----------+------------------------------------------------------------+\n | ``\'f\'`` | Fixed point. Displays the number as a fixed-point number. |\n +-----------+------------------------------------------------------------+\n | ``\'F\'`` | Fixed point. Same as ``\'f\'``. |\n +-----------+------------------------------------------------------------+\n | ``\'g\'`` | General format. This prints the number as a fixed-point |\n | | number, unless the number is too large, in which case it |\n | | switches to ``\'e\'`` exponent notation. |\n +-----------+------------------------------------------------------------+\n | ``\'G\'`` | General format. Same as ``\'g\'`` except switches to ``\'E\'`` |\n | | if the number gets to large. |\n +-----------+------------------------------------------------------------+\n | ``\'n\'`` | Number. This is the same as ``\'g\'``, except that it uses |\n | | the current locale setting to insert the appropriate |\n | | number separator characters. |\n +-----------+------------------------------------------------------------+\n | ``\'%\'`` | Percentage. Multiplies the number by 100 and displays in |\n | | fixed (``\'f\'``) format, followed by a percent sign. |\n +-----------+------------------------------------------------------------+\n | None | the same as ``\'g\'`` |\n +-----------+------------------------------------------------------------+\n', - 'function': u'\nFunction definitions\n********************\n\nA function definition defines a user-defined function object (see\nsection *The standard type hierarchy*):\n\n decorated ::= decorators (classdef | funcdef)\n decorators ::= decorator+\n decorator ::= "@" dotted_name ["(" [argument_list [","]] ")"] NEWLINE\n funcdef ::= "def" funcname "(" [parameter_list] ")" ":" suite\n dotted_name ::= identifier ("." identifier)*\n parameter_list ::= (defparameter ",")*\n ( "*" identifier [, "**" identifier]\n | "**" identifier\n | defparameter [","] )\n defparameter ::= parameter ["=" expression]\n sublist ::= parameter ("," parameter)* [","]\n parameter ::= identifier | "(" sublist ")"\n funcname ::= identifier\n\nA function definition is an executable statement. Its execution binds\nthe function name in the current local namespace to a function object\n(a wrapper around the executable code for the function). This\nfunction object contains a reference to the current global namespace\nas the global namespace to be used when the function is called.\n\nThe function definition does not execute the function body; this gets\nexecuted only when the function is called.\n\nA function definition may be wrapped by one or more *decorator*\nexpressions. Decorator expressions are evaluated when the function is\ndefined, in the scope that contains the function definition. The\nresult must be a callable, which is invoked with the function object\nas the only argument. The returned value is bound to the function name\ninstead of the function object. Multiple decorators are applied in\nnested fashion. For example, the following code:\n\n @f1(arg)\n @f2\n def func(): pass\n\nis equivalent to:\n\n def func(): pass\n func = f1(arg)(f2(func))\n\nWhen one or more top-level parameters have the form *parameter* ``=``\n*expression*, the function is said to have "default parameter values."\nFor a parameter with a default value, the corresponding argument may\nbe omitted from a call, in which case the parameter\'s default value is\nsubstituted. If a parameter has a default value, all following\nparameters must also have a default value --- this is a syntactic\nrestriction that is not expressed by the grammar.\n\n**Default parameter values are evaluated when the function definition\nis executed.** This means that the expression is evaluated once, when\nthe function is defined, and that that same "pre-computed" value is\nused for each call. This is especially important to understand when a\ndefault parameter is a mutable object, such as a list or a dictionary:\nif the function modifies the object (e.g. by appending an item to a\nlist), the default value is in effect modified. This is generally not\nwhat was intended. A way around this is to use ``None`` as the\ndefault, and explicitly test for it in the body of the function, e.g.:\n\n def whats_on_the_telly(penguin=None):\n if penguin is None:\n penguin = []\n penguin.append("property of the zoo")\n return penguin\n\nFunction call semantics are described in more detail in section\n*Calls*. A function call always assigns values to all parameters\nmentioned in the parameter list, either from position arguments, from\nkeyword arguments, or from default values. If the form\n"``*identifier``" is present, it is initialized to a tuple receiving\nany excess positional parameters, defaulting to the empty tuple. If\nthe form "``**identifier``" is present, it is initialized to a new\ndictionary receiving any excess keyword arguments, defaulting to a new\nempty dictionary.\n\nIt is also possible to create anonymous functions (functions not bound\nto a name), for immediate use in expressions. This uses lambda forms,\ndescribed in section *Expression lists*. Note that the lambda form is\nmerely a shorthand for a simplified function definition; a function\ndefined in a "``def``" statement can be passed around or assigned to\nanother name just like a function defined by a lambda form. The\n"``def``" form is actually more powerful since it allows the execution\nof multiple statements.\n\n**Programmer\'s note:** Functions are first-class objects. A "``def``"\nform executed inside a function definition defines a local function\nthat can be returned or passed around. Free variables used in the\nnested function can access the local variables of the function\ncontaining the def. See section *Naming and binding* for details.\n', + 'formatstrings': u'\nFormat String Syntax\n********************\n\nThe ``str.format()`` method and the ``Formatter`` class share the same\nsyntax for format strings (although in the case of ``Formatter``,\nsubclasses can define their own format string syntax.)\n\nFormat strings contain "replacement fields" surrounded by curly braces\n``{}``. Anything that is not contained in braces is considered literal\ntext, which is copied unchanged to the output. If you need to include\na brace character in the literal text, it can be escaped by doubling:\n``{{`` and ``}}``.\n\nThe grammar for a replacement field is as follows:\n\n replacement_field ::= "{" field_name ["!" conversion] [":" format_spec] "}"\n field_name ::= (identifier | integer) ("." attribute_name | "[" element_index "]")*\n attribute_name ::= identifier\n element_index ::= integer\n conversion ::= "r" | "s"\n format_spec ::= \n\nIn less formal terms, the replacement field starts with a\n*field_name*, which can either be a number (for a positional\nargument), or an identifier (for keyword arguments). Following this\nis an optional *conversion* field, which is preceded by an exclamation\npoint ``\'!\'``, and a *format_spec*, which is preceded by a colon\n``\':\'``.\n\nThe *field_name* itself begins with either a number or a keyword. If\nit\'s a number, it refers to a positional argument, and if it\'s a\nkeyword it refers to a named keyword argument. This can be followed\nby any number of index or attribute expressions. An expression of the\nform ``\'.name\'`` selects the named attribute using ``getattr()``,\nwhile an expression of the form ``\'[index]\'`` does an index lookup\nusing ``__getitem__()``.\n\nSome simple format string examples:\n\n "First, thou shalt count to {0}" # References first positional argument\n "My quest is {name}" # References keyword argument \'name\'\n "Weight in tons {0.weight}" # \'weight\' attribute of first positional arg\n "Units destroyed: {players[0]}" # First element of keyword argument \'players\'.\n\nThe *conversion* field causes a type coercion before formatting.\nNormally, the job of formatting a value is done by the\n``__format__()`` method of the value itself. However, in some cases\nit is desirable to force a type to be formatted as a string,\noverriding its own definition of formatting. By converting the value\nto a string before calling ``__format__()``, the normal formatting\nlogic is bypassed.\n\nTwo conversion flags are currently supported: ``\'!s\'`` which calls\n``str()`` on the value, and ``\'!r\'`` which calls ``repr()``.\n\nSome examples:\n\n "Harold\'s a clever {0!s}" # Calls str() on the argument first\n "Bring out the holy {name!r}" # Calls repr() on the argument first\n\nThe *format_spec* field contains a specification of how the value\nshould be presented, including such details as field width, alignment,\npadding, decimal precision and so on. Each value type can define it\'s\nown "formatting mini-language" or interpretation of the *format_spec*.\n\nMost built-in types support a common formatting mini-language, which\nis described in the next section.\n\nA *format_spec* field can also include nested replacement fields\nwithin it. These nested replacement fields can contain only a field\nname; conversion flags and format specifications are not allowed. The\nreplacement fields within the format_spec are substituted before the\n*format_spec* string is interpreted. This allows the formatting of a\nvalue to be dynamically specified.\n\nFor example, suppose you wanted to have a replacement field whose\nfield width is determined by another variable:\n\n "A man with two {0:{1}}".format("noses", 10)\n\nThis would first evaluate the inner replacement field, making the\nformat string effectively:\n\n "A man with two {0:10}"\n\nThen the outer replacement field would be evaluated, producing:\n\n "noses "\n\nWhich is substituted into the string, yielding:\n\n "A man with two noses "\n\n(The extra space is because we specified a field width of 10, and\nbecause left alignment is the default for strings.)\n\n\nFormat Specification Mini-Language\n==================================\n\n"Format specifications" are used within replacement fields contained\nwithin a format string to define how individual values are presented\n(see *Format String Syntax*.) They can also be passed directly to the\nbuiltin ``format()`` function. Each formattable type may define how\nthe format specification is to be interpreted.\n\nMost built-in types implement the following options for format\nspecifications, although some of the formatting options are only\nsupported by the numeric types.\n\nA general convention is that an empty format string (``""``) produces\nthe same result as if you had called ``str()`` on the value.\n\nThe general form of a *standard format specifier* is:\n\n format_spec ::= [[fill]align][sign][#][0][width][.precision][type]\n fill ::= \n align ::= "<" | ">" | "=" | "^"\n sign ::= "+" | "-" | " "\n width ::= integer\n precision ::= integer\n type ::= "b" | "c" | "d" | "e" | "E" | "f" | "F" | "g" | "G" | "n" | "o" | "x" | "X" | "%"\n\nThe *fill* character can be any character other than \'}\' (which\nsignifies the end of the field). The presence of a fill character is\nsignaled by the *next* character, which must be one of the alignment\noptions. If the second character of *format_spec* is not a valid\nalignment option, then it is assumed that both the fill character and\nthe alignment option are absent.\n\nThe meaning of the various alignment options is as follows:\n\n +-----------+------------------------------------------------------------+\n | Option | Meaning |\n +===========+============================================================+\n | ``\'<\'`` | Forces the field to be left-aligned within the available |\n | | space (This is the default.) |\n +-----------+------------------------------------------------------------+\n | ``\'>\'`` | Forces the field to be right-aligned within the available |\n | | space. |\n +-----------+------------------------------------------------------------+\n | ``\'=\'`` | Forces the padding to be placed after the sign (if any) |\n | | but before the digits. This is used for printing fields |\n | | in the form \'+000000120\'. This alignment option is only |\n | | valid for numeric types. |\n +-----------+------------------------------------------------------------+\n | ``\'^\'`` | Forces the field to be centered within the available |\n | | space. |\n +-----------+------------------------------------------------------------+\n\nNote that unless a minimum field width is defined, the field width\nwill always be the same size as the data to fill it, so that the\nalignment option has no meaning in this case.\n\nThe *sign* option is only valid for number types, and can be one of\nthe following:\n\n +-----------+------------------------------------------------------------+\n | Option | Meaning |\n +===========+============================================================+\n | ``\'+\'`` | indicates that a sign should be used for both positive as |\n | | well as negative numbers. |\n +-----------+------------------------------------------------------------+\n | ``\'-\'`` | indicates that a sign should be used only for negative |\n | | numbers (this is the default behavior). |\n +-----------+------------------------------------------------------------+\n | space | indicates that a leading space should be used on positive |\n | | numbers, and a minus sign on negative numbers. |\n +-----------+------------------------------------------------------------+\n\nThe ``\'#\'`` option is only valid for integers, and only for binary,\noctal, or hexadecimal output. If present, it specifies that the\noutput will be prefixed by ``\'0b\'``, ``\'0o\'``, or ``\'0x\'``,\nrespectively.\n\n*width* is a decimal integer defining the minimum field width. If not\nspecified, then the field width will be determined by the content.\n\nIf the *width* field is preceded by a zero (``\'0\'``) character, this\nenables zero-padding. This is equivalent to an *alignment* type of\n``\'=\'`` and a *fill* character of ``\'0\'``.\n\nThe *precision* is a decimal number indicating how many digits should\nbe displayed after the decimal point for a floating point value\nformatted with ``\'f\'`` and ``\'F\'``, or before and after the decimal\npoint for a floating point value formatted with ``\'g\'`` or ``\'G\'``.\nFor non-number types the field indicates the maximum field size - in\nother words, how many characters will be used from the field content.\nThe *precision* is ignored for integer values.\n\nFinally, the *type* determines how the data should be presented.\n\nThe available integer presentation types are:\n\n +-----------+------------------------------------------------------------+\n | Type | Meaning |\n +===========+============================================================+\n | ``\'b\'`` | Binary format. Outputs the number in base 2. |\n +-----------+------------------------------------------------------------+\n | ``\'c\'`` | Character. Converts the integer to the corresponding |\n | | unicode character before printing. |\n +-----------+------------------------------------------------------------+\n | ``\'d\'`` | Decimal Integer. Outputs the number in base 10. |\n +-----------+------------------------------------------------------------+\n | ``\'o\'`` | Octal format. Outputs the number in base 8. |\n +-----------+------------------------------------------------------------+\n | ``\'x\'`` | Hex format. Outputs the number in base 16, using lower- |\n | | case letters for the digits above 9. |\n +-----------+------------------------------------------------------------+\n | ``\'X\'`` | Hex format. Outputs the number in base 16, using upper- |\n | | case letters for the digits above 9. |\n +-----------+------------------------------------------------------------+\n | ``\'n\'`` | Number. This is the same as ``\'d\'``, except that it uses |\n | | the current locale setting to insert the appropriate |\n | | number separator characters. |\n +-----------+------------------------------------------------------------+\n | None | The same as ``\'d\'``. |\n +-----------+------------------------------------------------------------+\n\nThe available presentation types for floating point and decimal values\nare:\n\n +-----------+------------------------------------------------------------+\n | Type | Meaning |\n +===========+============================================================+\n | ``\'e\'`` | Exponent notation. Prints the number in scientific |\n | | notation using the letter \'e\' to indicate the exponent. |\n +-----------+------------------------------------------------------------+\n | ``\'E\'`` | Exponent notation. Same as ``\'e\'`` except it uses an upper |\n | | case \'E\' as the separator character. |\n +-----------+------------------------------------------------------------+\n | ``\'f\'`` | Fixed point. Displays the number as a fixed-point number. |\n +-----------+------------------------------------------------------------+\n | ``\'F\'`` | Fixed point. Same as ``\'f\'``. |\n +-----------+------------------------------------------------------------+\n | ``\'g\'`` | General format. This prints the number as a fixed-point |\n | | number, unless the number is too large, in which case it |\n | | switches to ``\'e\'`` exponent notation. Infinity and NaN |\n | | values are formatted as ``inf``, ``-inf`` and ``nan``, |\n | | respectively. |\n +-----------+------------------------------------------------------------+\n | ``\'G\'`` | General format. Same as ``\'g\'`` except switches to ``\'E\'`` |\n | | if the number gets to large. The representations of |\n | | infinity and NaN are uppercased, too. |\n +-----------+------------------------------------------------------------+\n | ``\'n\'`` | Number. This is the same as ``\'g\'``, except that it uses |\n | | the current locale setting to insert the appropriate |\n | | number separator characters. |\n +-----------+------------------------------------------------------------+\n | ``\'%\'`` | Percentage. Multiplies the number by 100 and displays in |\n | | fixed (``\'f\'``) format, followed by a percent sign. |\n +-----------+------------------------------------------------------------+\n | None | The same as ``\'g\'``. |\n +-----------+------------------------------------------------------------+\n', + 'function': u'\nFunction definitions\n********************\n\nA function definition defines a user-defined function object (see\nsection *The standard type hierarchy*):\n\n decorated ::= decorators (classdef | funcdef)\n decorators ::= decorator+\n decorator ::= "@" dotted_name ["(" [argument_list [","]] ")"] NEWLINE\n funcdef ::= "def" funcname "(" [parameter_list] ")" ":" suite\n dotted_name ::= identifier ("." identifier)*\n parameter_list ::= (defparameter ",")*\n ( "*" identifier [, "**" identifier]\n | "**" identifier\n | defparameter [","] )\n defparameter ::= parameter ["=" expression]\n sublist ::= parameter ("," parameter)* [","]\n parameter ::= identifier | "(" sublist ")"\n funcname ::= identifier\n\nA function definition is an executable statement. Its execution binds\nthe function name in the current local namespace to a function object\n(a wrapper around the executable code for the function). This\nfunction object contains a reference to the current global namespace\nas the global namespace to be used when the function is called.\n\nThe function definition does not execute the function body; this gets\nexecuted only when the function is called. [3]\n\nA function definition may be wrapped by one or more *decorator*\nexpressions. Decorator expressions are evaluated when the function is\ndefined, in the scope that contains the function definition. The\nresult must be a callable, which is invoked with the function object\nas the only argument. The returned value is bound to the function name\ninstead of the function object. Multiple decorators are applied in\nnested fashion. For example, the following code:\n\n @f1(arg)\n @f2\n def func(): pass\n\nis equivalent to:\n\n def func(): pass\n func = f1(arg)(f2(func))\n\nWhen one or more top-level parameters have the form *parameter* ``=``\n*expression*, the function is said to have "default parameter values."\nFor a parameter with a default value, the corresponding argument may\nbe omitted from a call, in which case the parameter\'s default value is\nsubstituted. If a parameter has a default value, all following\nparameters must also have a default value --- this is a syntactic\nrestriction that is not expressed by the grammar.\n\n**Default parameter values are evaluated when the function definition\nis executed.** This means that the expression is evaluated once, when\nthe function is defined, and that that same "pre-computed" value is\nused for each call. This is especially important to understand when a\ndefault parameter is a mutable object, such as a list or a dictionary:\nif the function modifies the object (e.g. by appending an item to a\nlist), the default value is in effect modified. This is generally not\nwhat was intended. A way around this is to use ``None`` as the\ndefault, and explicitly test for it in the body of the function, e.g.:\n\n def whats_on_the_telly(penguin=None):\n if penguin is None:\n penguin = []\n penguin.append("property of the zoo")\n return penguin\n\nFunction call semantics are described in more detail in section\n*Calls*. A function call always assigns values to all parameters\nmentioned in the parameter list, either from position arguments, from\nkeyword arguments, or from default values. If the form\n"``*identifier``" is present, it is initialized to a tuple receiving\nany excess positional parameters, defaulting to the empty tuple. If\nthe form "``**identifier``" is present, it is initialized to a new\ndictionary receiving any excess keyword arguments, defaulting to a new\nempty dictionary.\n\nIt is also possible to create anonymous functions (functions not bound\nto a name), for immediate use in expressions. This uses lambda forms,\ndescribed in section *Expression lists*. Note that the lambda form is\nmerely a shorthand for a simplified function definition; a function\ndefined in a "``def``" statement can be passed around or assigned to\nanother name just like a function defined by a lambda form. The\n"``def``" form is actually more powerful since it allows the execution\nof multiple statements.\n\n**Programmer\'s note:** Functions are first-class objects. A "``def``"\nform executed inside a function definition defines a local function\nthat can be returned or passed around. Free variables used in the\nnested function can access the local variables of the function\ncontaining the def. See section *Naming and binding* for details.\n', 'global': u'\nThe ``global`` statement\n************************\n\n global_stmt ::= "global" identifier ("," identifier)*\n\nThe ``global`` statement is a declaration which holds for the entire\ncurrent code block. It means that the listed identifiers are to be\ninterpreted as globals. It would be impossible to assign to a global\nvariable without ``global``, although free variables may refer to\nglobals without being declared global.\n\nNames listed in a ``global`` statement must not be used in the same\ncode block textually preceding that ``global`` statement.\n\nNames listed in a ``global`` statement must not be defined as formal\nparameters or in a ``for`` loop control target, ``class`` definition,\nfunction definition, or ``import`` statement.\n\n(The current implementation does not enforce the latter two\nrestrictions, but programs should not abuse this freedom, as future\nimplementations may enforce them or silently change the meaning of the\nprogram.)\n\n**Programmer\'s note:** the ``global`` is a directive to the parser.\nIt applies only to code parsed at the same time as the ``global``\nstatement. In particular, a ``global`` statement contained in an\n``exec`` statement does not affect the code block *containing* the\n``exec`` statement, and code contained in an ``exec`` statement is\nunaffected by ``global`` statements in the code containing the\n``exec`` statement. The same applies to the ``eval()``,\n``execfile()`` and ``compile()`` functions.\n', 'id-classes': u'\nReserved classes of identifiers\n*******************************\n\nCertain classes of identifiers (besides keywords) have special\nmeanings. These classes are identified by the patterns of leading and\ntrailing underscore characters:\n\n``_*``\n Not imported by ``from module import *``. The special identifier\n ``_`` is used in the interactive interpreter to store the result of\n the last evaluation; it is stored in the ``__builtin__`` module.\n When not in interactive mode, ``_`` has no special meaning and is\n not defined. See section *The import statement*.\n\n Note: The name ``_`` is often used in conjunction with\n internationalization; refer to the documentation for the\n ``gettext`` module for more information on this convention.\n\n``__*__``\n System-defined names. These names are defined by the interpreter\n and its implementation (including the standard library);\n applications should not expect to define additional names using\n this convention. The set of names of this class defined by Python\n may be extended in future versions. See section *Special method\n names*.\n\n``__*``\n Class-private names. Names in this category, when used within the\n context of a class definition, are re-written to use a mangled form\n to help avoid name clashes between "private" attributes of base and\n derived classes. See section *Identifiers (Names)*.\n', 'identifiers': u'\nIdentifiers and keywords\n************************\n\nIdentifiers (also referred to as *names*) are described by the\nfollowing lexical definitions:\n\n identifier ::= (letter|"_") (letter | digit | "_")*\n letter ::= lowercase | uppercase\n lowercase ::= "a"..."z"\n uppercase ::= "A"..."Z"\n digit ::= "0"..."9"\n\nIdentifiers are unlimited in length. Case is significant.\n\n\nKeywords\n========\n\nThe following identifiers are used as reserved words, or *keywords* of\nthe language, and cannot be used as ordinary identifiers. They must\nbe spelled exactly as written here:\n\n and del from not while\n as elif global or with\n assert else if pass yield\n break except import print\n class exec in raise\n continue finally is return\n def for lambda try\n\nChanged in version 2.4: ``None`` became a constant and is now\nrecognized by the compiler as a name for the built-in object ``None``.\nAlthough it is not a keyword, you cannot assign a different object to\nit.\n\nChanged in version 2.5: Both ``as`` and ``with`` are only recognized\nwhen the ``with_statement`` future feature has been enabled. It will\nalways be enabled in Python 2.6. See section *The with statement* for\ndetails. Note that using ``as`` and ``with`` as identifiers will\nalways issue a warning, even when the ``with_statement`` future\ndirective is not in effect.\n\n\nReserved classes of identifiers\n===============================\n\nCertain classes of identifiers (besides keywords) have special\nmeanings. These classes are identified by the patterns of leading and\ntrailing underscore characters:\n\n``_*``\n Not imported by ``from module import *``. The special identifier\n ``_`` is used in the interactive interpreter to store the result of\n the last evaluation; it is stored in the ``__builtin__`` module.\n When not in interactive mode, ``_`` has no special meaning and is\n not defined. See section *The import statement*.\n\n Note: The name ``_`` is often used in conjunction with\n internationalization; refer to the documentation for the\n ``gettext`` module for more information on this convention.\n\n``__*__``\n System-defined names. These names are defined by the interpreter\n and its implementation (including the standard library);\n applications should not expect to define additional names using\n this convention. The set of names of this class defined by Python\n may be extended in future versions. See section *Special method\n names*.\n\n``__*``\n Class-private names. Names in this category, when used within the\n context of a class definition, are re-written to use a mangled form\n to help avoid name clashes between "private" attributes of base and\n derived classes. See section *Identifiers (Names)*.\n', 'if': u'\nThe ``if`` statement\n********************\n\nThe ``if`` statement is used for conditional execution:\n\n if_stmt ::= "if" expression ":" suite\n ( "elif" expression ":" suite )*\n ["else" ":" suite]\n\nIt selects exactly one of the suites by evaluating the expressions one\nby one until one is found to be true (see section *Boolean operations*\nfor the definition of true and false); then that suite is executed\n(and no other part of the ``if`` statement is executed or evaluated).\nIf all expressions are false, the suite of the ``else`` clause, if\npresent, is executed.\n', 'imaginary': u'\nImaginary literals\n******************\n\nImaginary literals are described by the following lexical definitions:\n\n imagnumber ::= (floatnumber | intpart) ("j" | "J")\n\nAn imaginary literal yields a complex number with a real part of 0.0.\nComplex numbers are represented as a pair of floating point numbers\nand have the same restrictions on their range. To create a complex\nnumber with a nonzero real part, add a floating point number to it,\ne.g., ``(3+4j)``. Some examples of imaginary literals:\n\n 3.14j 10.j 10j .001j 1e100j 3.14e-10j\n', - 'import': u'\nThe ``import`` statement\n************************\n\n import_stmt ::= "import" module ["as" name] ( "," module ["as" name] )*\n | "from" relative_module "import" identifier ["as" name]\n ( "," identifier ["as" name] )*\n | "from" relative_module "import" "(" identifier ["as" name]\n ( "," identifier ["as" name] )* [","] ")"\n | "from" module "import" "*"\n module ::= (identifier ".")* identifier\n relative_module ::= "."* module | "."+\n name ::= identifier\n\nImport statements are executed in two steps: (1) find a module, and\ninitialize it if necessary; (2) define a name or names in the local\nnamespace (of the scope where the ``import`` statement occurs). The\nfirst form (without ``from``) repeats these steps for each identifier\nin the list. The form with ``from`` performs step (1) once, and then\nperforms step (2) repeatedly.\n\nIn this context, to "initialize" a built-in or extension module means\nto call an initialization function that the module must provide for\nthe purpose (in the reference implementation, the function\'s name is\nobtained by prepending string "init" to the module\'s name); to\n"initialize" a Python-coded module means to execute the module\'s body.\n\nThe system maintains a table of modules that have been or are being\ninitialized, indexed by module name. This table is accessible as\n``sys.modules``. When a module name is found in this table, step (1)\nis finished. If not, a search for a module definition is started.\nWhen a module is found, it is loaded. Details of the module searching\nand loading process are implementation and platform specific. It\ngenerally involves searching for a "built-in" module with the given\nname and then searching a list of locations given as ``sys.path``.\n\nIf a built-in module is found, its built-in initialization code is\nexecuted and step (1) is finished. If no matching file is found,\n``ImportError`` is raised. If a file is found, it is parsed, yielding\nan executable code block. If a syntax error occurs, ``SyntaxError``\nis raised. Otherwise, an empty module of the given name is created\nand inserted in the module table, and then the code block is executed\nin the context of this module. Exceptions during this execution\nterminate step (1).\n\nWhen step (1) finishes without raising an exception, step (2) can\nbegin.\n\nThe first form of ``import`` statement binds the module name in the\nlocal namespace to the module object, and then goes on to import the\nnext identifier, if any. If the module name is followed by ``as``,\nthe name following ``as`` is used as the local name for the module.\n\nThe ``from`` form does not bind the module name: it goes through the\nlist of identifiers, looks each one of them up in the module found in\nstep (1), and binds the name in the local namespace to the object thus\nfound. As with the first form of ``import``, an alternate local name\ncan be supplied by specifying "``as`` localname". If a name is not\nfound, ``ImportError`` is raised. If the list of identifiers is\nreplaced by a star (``\'*\'``), all public names defined in the module\nare bound in the local namespace of the ``import`` statement..\n\nThe *public names* defined by a module are determined by checking the\nmodule\'s namespace for a variable named ``__all__``; if defined, it\nmust be a sequence of strings which are names defined or imported by\nthat module. The names given in ``__all__`` are all considered public\nand are required to exist. If ``__all__`` is not defined, the set of\npublic names includes all names found in the module\'s namespace which\ndo not begin with an underscore character (``\'_\'``). ``__all__``\nshould contain the entire public API. It is intended to avoid\naccidentally exporting items that are not part of the API (such as\nlibrary modules which were imported and used within the module).\n\nThe ``from`` form with ``*`` may only occur in a module scope. If the\nwild card form of import --- ``import *`` --- is used in a function\nand the function contains or is a nested block with free variables,\nthe compiler will raise a ``SyntaxError``.\n\n**Hierarchical module names:** when the module names contains one or\nmore dots, the module search path is carried out differently. The\nsequence of identifiers up to the last dot is used to find a\n"package"; the final identifier is then searched inside the package.\nA package is generally a subdirectory of a directory on ``sys.path``\nthat has a file ``__init__.py``. [XXX Can\'t be bothered to spell this\nout right now; see the URL\nhttp://www.python.org/doc/essays/packages.html for more details, also\nabout how the module search works from inside a package.]\n\nThe built-in function ``__import__()`` is provided to support\napplications that determine which modules need to be loaded\ndynamically; refer to *Built-in Functions* for additional information.\n\n\nFuture statements\n=================\n\nA *future statement* is a directive to the compiler that a particular\nmodule should be compiled using syntax or semantics that will be\navailable in a specified future release of Python. The future\nstatement is intended to ease migration to future versions of Python\nthat introduce incompatible changes to the language. It allows use of\nthe new features on a per-module basis before the release in which the\nfeature becomes standard.\n\n future_statement ::= "from" "__future__" "import" feature ["as" name]\n ("," feature ["as" name])*\n | "from" "__future__" "import" "(" feature ["as" name]\n ("," feature ["as" name])* [","] ")"\n feature ::= identifier\n name ::= identifier\n\nA future statement must appear near the top of the module. The only\nlines that can appear before a future statement are:\n\n* the module docstring (if any),\n\n* comments,\n\n* blank lines, and\n\n* other future statements.\n\nThe features recognized by Python 2.5 are ``absolute_import``,\n``division``, ``generators``, ``nested_scopes`` and\n``with_statement``. ``generators`` and ``nested_scopes`` are\nredundant in Python version 2.3 and above because they are always\nenabled.\n\nA future statement is recognized and treated specially at compile\ntime: Changes to the semantics of core constructs are often\nimplemented by generating different code. It may even be the case\nthat a new feature introduces new incompatible syntax (such as a new\nreserved word), in which case the compiler may need to parse the\nmodule differently. Such decisions cannot be pushed off until\nruntime.\n\nFor any given release, the compiler knows which feature names have\nbeen defined, and raises a compile-time error if a future statement\ncontains a feature not known to it.\n\nThe direct runtime semantics are the same as for any import statement:\nthere is a standard module ``__future__``, described later, and it\nwill be imported in the usual way at the time the future statement is\nexecuted.\n\nThe interesting runtime semantics depend on the specific feature\nenabled by the future statement.\n\nNote that there is nothing special about the statement:\n\n import __future__ [as name]\n\nThat is not a future statement; it\'s an ordinary import statement with\nno special semantics or syntax restrictions.\n\nCode compiled by an ``exec`` statement or calls to the builtin\nfunctions ``compile()`` and ``execfile()`` that occur in a module\n``M`` containing a future statement will, by default, use the new\nsyntax or semantics associated with the future statement. This can,\nstarting with Python 2.2 be controlled by optional arguments to\n``compile()`` --- see the documentation of that function for details.\n\nA future statement typed at an interactive interpreter prompt will\ntake effect for the rest of the interpreter session. If an\ninterpreter is started with the *-i* option, is passed a script name\nto execute, and the script includes a future statement, it will be in\neffect in the interactive session started after the script is\nexecuted.\n', - 'in': u'\nComparisons\n***********\n\nUnlike C, all comparison operations in Python have the same priority,\nwhich is lower than that of any arithmetic, shifting or bitwise\noperation. Also unlike C, expressions like ``a < b < c`` have the\ninterpretation that is conventional in mathematics:\n\n comparison ::= or_expr ( comp_operator or_expr )*\n comp_operator ::= "<" | ">" | "==" | ">=" | "<=" | "<>" | "!="\n | "is" ["not"] | ["not"] "in"\n\nComparisons yield boolean values: ``True`` or ``False``.\n\nComparisons can be chained arbitrarily, e.g., ``x < y <= z`` is\nequivalent to ``x < y and y <= z``, except that ``y`` is evaluated\nonly once (but in both cases ``z`` is not evaluated at all when ``x <\ny`` is found to be false).\n\nFormally, if *a*, *b*, *c*, ..., *y*, *z* are expressions and *op1*,\n*op2*, ..., *opN* are comparison operators, then ``a op1 b op2 c ... y\nopN z`` is equivalent to ``a op1 b and b op2 c and ... y opN z``,\nexcept that each expression is evaluated at most once.\n\nNote that ``a op1 b op2 c`` doesn\'t imply any kind of comparison\nbetween *a* and *c*, so that, e.g., ``x < y > z`` is perfectly legal\n(though perhaps not pretty).\n\nThe forms ``<>`` and ``!=`` are equivalent; for consistency with C,\n``!=`` is preferred; where ``!=`` is mentioned below ``<>`` is also\naccepted. The ``<>`` spelling is considered obsolescent.\n\nThe operators ``<``, ``>``, ``==``, ``>=``, ``<=``, and ``!=`` compare\nthe values of two objects. The objects need not have the same type.\nIf both are numbers, they are converted to a common type. Otherwise,\nobjects of different types *always* compare unequal, and are ordered\nconsistently but arbitrarily. You can control comparison behavior of\nobjects of non-builtin types by defining a ``__cmp__`` method or rich\ncomparison methods like ``__gt__``, described in section *Special\nmethod names*.\n\n(This unusual definition of comparison was used to simplify the\ndefinition of operations like sorting and the ``in`` and ``not in``\noperators. In the future, the comparison rules for objects of\ndifferent types are likely to change.)\n\nComparison of objects of the same type depends on the type:\n\n* Numbers are compared arithmetically.\n\n* Strings are compared lexicographically using the numeric equivalents\n (the result of the built-in function ``ord()``) of their characters.\n Unicode and 8-bit strings are fully interoperable in this behavior.\n [4]\n\n* Tuples and lists are compared lexicographically using comparison of\n corresponding elements. This means that to compare equal, each\n element must compare equal and the two sequences must be of the same\n type and have the same length.\n\n If not equal, the sequences are ordered the same as their first\n differing elements. For example, ``cmp([1,2,x], [1,2,y])`` returns\n the same as ``cmp(x,y)``. If the corresponding element does not\n exist, the shorter sequence is ordered first (for example, ``[1,2] <\n [1,2,3]``).\n\n* Mappings (dictionaries) compare equal if and only if their sorted\n (key, value) lists compare equal. [5] Outcomes other than equality\n are resolved consistently, but are not otherwise defined. [6]\n\n* Most other objects of builtin types compare unequal unless they are\n the same object; the choice whether one object is considered smaller\n or larger than another one is made arbitrarily but consistently\n within one execution of a program.\n\nThe operators ``in`` and ``not in`` test for collection membership.\n``x in s`` evaluates to true if *x* is a member of the collection *s*,\nand false otherwise. ``x not in s`` returns the negation of ``x in\ns``. The collection membership test has traditionally been bound to\nsequences; an object is a member of a collection if the collection is\na sequence and contains an element equal to that object. However, it\nmake sense for many other object types to support membership tests\nwithout being a sequence. In particular, dictionaries (for keys) and\nsets support membership testing.\n\nFor the list and tuple types, ``x in y`` is true if and only if there\nexists an index *i* such that ``x == y[i]`` is true.\n\nFor the Unicode and string types, ``x in y`` is true if and only if\n*x* is a substring of *y*. An equivalent test is ``y.find(x) != -1``.\nNote, *x* and *y* need not be the same type; consequently, ``u\'ab\' in\n\'abc\'`` will return ``True``. Empty strings are always considered to\nbe a substring of any other string, so ``"" in "abc"`` will return\n``True``.\n\nChanged in version 2.3: Previously, *x* was required to be a string of\nlength ``1``.\n\nFor user-defined classes which define the ``__contains__()`` method,\n``x in y`` is true if and only if ``y.__contains__(x)`` is true.\n\nFor user-defined classes which do not define ``__contains__()`` and do\ndefine ``__getitem__()``, ``x in y`` is true if and only if there is a\nnon-negative integer index *i* such that ``x == y[i]``, and all lower\ninteger indices do not raise ``IndexError`` exception. (If any other\nexception is raised, it is as if ``in`` raised that exception).\n\nThe operator ``not in`` is defined to have the inverse true value of\n``in``.\n\nThe operators ``is`` and ``is not`` test for object identity: ``x is\ny`` is true if and only if *x* and *y* are the same object. ``x is\nnot y`` yields the inverse truth value.\n', + 'import': u'\nThe ``import`` statement\n************************\n\n import_stmt ::= "import" module ["as" name] ( "," module ["as" name] )*\n | "from" relative_module "import" identifier ["as" name]\n ( "," identifier ["as" name] )*\n | "from" relative_module "import" "(" identifier ["as" name]\n ( "," identifier ["as" name] )* [","] ")"\n | "from" module "import" "*"\n module ::= (identifier ".")* identifier\n relative_module ::= "."* module | "."+\n name ::= identifier\n\nImport statements are executed in two steps: (1) find a module, and\ninitialize it if necessary; (2) define a name or names in the local\nnamespace (of the scope where the ``import`` statement occurs). The\nfirst form (without ``from``) repeats these steps for each identifier\nin the list. The form with ``from`` performs step (1) once, and then\nperforms step (2) repeatedly.\n\nIn this context, to "initialize" a built-in or extension module means\nto call an initialization function that the module must provide for\nthe purpose (in the reference implementation, the function\'s name is\nobtained by prepending string "init" to the module\'s name); to\n"initialize" a Python-coded module means to execute the module\'s body.\n\nThe system maintains a table of modules that have been or are being\ninitialized, indexed by module name. This table is accessible as\n``sys.modules``. When a module name is found in this table, step (1)\nis finished. If not, a search for a module definition is started.\nWhen a module is found, it is loaded. Details of the module searching\nand loading process are implementation and platform specific. It\ngenerally involves searching for a "built-in" module with the given\nname and then searching a list of locations given as ``sys.path``.\n\nIf a built-in module is found, its built-in initialization code is\nexecuted and step (1) is finished. If no matching file is found,\n``ImportError`` is raised. If a file is found, it is parsed, yielding\nan executable code block. If a syntax error occurs, ``SyntaxError``\nis raised. Otherwise, an empty module of the given name is created\nand inserted in the module table, and then the code block is executed\nin the context of this module. Exceptions during this execution\nterminate step (1).\n\nWhen step (1) finishes without raising an exception, step (2) can\nbegin.\n\nThe first form of ``import`` statement binds the module name in the\nlocal namespace to the module object, and then goes on to import the\nnext identifier, if any. If the module name is followed by ``as``,\nthe name following ``as`` is used as the local name for the module.\n\nThe ``from`` form does not bind the module name: it goes through the\nlist of identifiers, looks each one of them up in the module found in\nstep (1), and binds the name in the local namespace to the object thus\nfound. As with the first form of ``import``, an alternate local name\ncan be supplied by specifying "``as`` localname". If a name is not\nfound, ``ImportError`` is raised. If the list of identifiers is\nreplaced by a star (``\'*\'``), all public names defined in the module\nare bound in the local namespace of the ``import`` statement..\n\nThe *public names* defined by a module are determined by checking the\nmodule\'s namespace for a variable named ``__all__``; if defined, it\nmust be a sequence of strings which are names defined or imported by\nthat module. The names given in ``__all__`` are all considered public\nand are required to exist. If ``__all__`` is not defined, the set of\npublic names includes all names found in the module\'s namespace which\ndo not begin with an underscore character (``\'_\'``). ``__all__``\nshould contain the entire public API. It is intended to avoid\naccidentally exporting items that are not part of the API (such as\nlibrary modules which were imported and used within the module).\n\nThe ``from`` form with ``*`` may only occur in a module scope. If the\nwild card form of import --- ``import *`` --- is used in a function\nand the function contains or is a nested block with free variables,\nthe compiler will raise a ``SyntaxError``.\n\n**Hierarchical module names:** when the module names contains one or\nmore dots, the module search path is carried out differently. The\nsequence of identifiers up to the last dot is used to find a\n"package"; the final identifier is then searched inside the package.\nA package is generally a subdirectory of a directory on ``sys.path``\nthat has a file ``__init__.py``.\n\nThe built-in function ``__import__()`` is provided to support\napplications that determine which modules need to be loaded\ndynamically; refer to *Built-in Functions* for additional information.\n\n\nFuture statements\n=================\n\nA *future statement* is a directive to the compiler that a particular\nmodule should be compiled using syntax or semantics that will be\navailable in a specified future release of Python. The future\nstatement is intended to ease migration to future versions of Python\nthat introduce incompatible changes to the language. It allows use of\nthe new features on a per-module basis before the release in which the\nfeature becomes standard.\n\n future_statement ::= "from" "__future__" "import" feature ["as" name]\n ("," feature ["as" name])*\n | "from" "__future__" "import" "(" feature ["as" name]\n ("," feature ["as" name])* [","] ")"\n feature ::= identifier\n name ::= identifier\n\nA future statement must appear near the top of the module. The only\nlines that can appear before a future statement are:\n\n* the module docstring (if any),\n\n* comments,\n\n* blank lines, and\n\n* other future statements.\n\nThe features recognized by Python 2.5 are ``absolute_import``,\n``division``, ``generators``, ``nested_scopes`` and\n``with_statement``. ``generators`` and ``nested_scopes`` are\nredundant in Python version 2.3 and above because they are always\nenabled.\n\nA future statement is recognized and treated specially at compile\ntime: Changes to the semantics of core constructs are often\nimplemented by generating different code. It may even be the case\nthat a new feature introduces new incompatible syntax (such as a new\nreserved word), in which case the compiler may need to parse the\nmodule differently. Such decisions cannot be pushed off until\nruntime.\n\nFor any given release, the compiler knows which feature names have\nbeen defined, and raises a compile-time error if a future statement\ncontains a feature not known to it.\n\nThe direct runtime semantics are the same as for any import statement:\nthere is a standard module ``__future__``, described later, and it\nwill be imported in the usual way at the time the future statement is\nexecuted.\n\nThe interesting runtime semantics depend on the specific feature\nenabled by the future statement.\n\nNote that there is nothing special about the statement:\n\n import __future__ [as name]\n\nThat is not a future statement; it\'s an ordinary import statement with\nno special semantics or syntax restrictions.\n\nCode compiled by an ``exec`` statement or calls to the builtin\nfunctions ``compile()`` and ``execfile()`` that occur in a module\n``M`` containing a future statement will, by default, use the new\nsyntax or semantics associated with the future statement. This can,\nstarting with Python 2.2 be controlled by optional arguments to\n``compile()`` --- see the documentation of that function for details.\n\nA future statement typed at an interactive interpreter prompt will\ntake effect for the rest of the interpreter session. If an\ninterpreter is started with the *-i* option, is passed a script name\nto execute, and the script includes a future statement, it will be in\neffect in the interactive session started after the script is\nexecuted.\n', + 'in': u'\nComparisons\n***********\n\nUnlike C, all comparison operations in Python have the same priority,\nwhich is lower than that of any arithmetic, shifting or bitwise\noperation. Also unlike C, expressions like ``a < b < c`` have the\ninterpretation that is conventional in mathematics:\n\n comparison ::= or_expr ( comp_operator or_expr )*\n comp_operator ::= "<" | ">" | "==" | ">=" | "<=" | "<>" | "!="\n | "is" ["not"] | ["not"] "in"\n\nComparisons yield boolean values: ``True`` or ``False``.\n\nComparisons can be chained arbitrarily, e.g., ``x < y <= z`` is\nequivalent to ``x < y and y <= z``, except that ``y`` is evaluated\nonly once (but in both cases ``z`` is not evaluated at all when ``x <\ny`` is found to be false).\n\nFormally, if *a*, *b*, *c*, ..., *y*, *z* are expressions and *op1*,\n*op2*, ..., *opN* are comparison operators, then ``a op1 b op2 c ... y\nopN z`` is equivalent to ``a op1 b and b op2 c and ... y opN z``,\nexcept that each expression is evaluated at most once.\n\nNote that ``a op1 b op2 c`` doesn\'t imply any kind of comparison\nbetween *a* and *c*, so that, e.g., ``x < y > z`` is perfectly legal\n(though perhaps not pretty).\n\nThe forms ``<>`` and ``!=`` are equivalent; for consistency with C,\n``!=`` is preferred; where ``!=`` is mentioned below ``<>`` is also\naccepted. The ``<>`` spelling is considered obsolescent.\n\nThe operators ``<``, ``>``, ``==``, ``>=``, ``<=``, and ``!=`` compare\nthe values of two objects. The objects need not have the same type.\nIf both are numbers, they are converted to a common type. Otherwise,\nobjects of different types *always* compare unequal, and are ordered\nconsistently but arbitrarily. You can control comparison behavior of\nobjects of non-builtin types by defining a ``__cmp__`` method or rich\ncomparison methods like ``__gt__``, described in section *Special\nmethod names*.\n\n(This unusual definition of comparison was used to simplify the\ndefinition of operations like sorting and the ``in`` and ``not in``\noperators. In the future, the comparison rules for objects of\ndifferent types are likely to change.)\n\nComparison of objects of the same type depends on the type:\n\n* Numbers are compared arithmetically.\n\n* Strings are compared lexicographically using the numeric equivalents\n (the result of the built-in function ``ord()``) of their characters.\n Unicode and 8-bit strings are fully interoperable in this behavior.\n [4]\n\n* Tuples and lists are compared lexicographically using comparison of\n corresponding elements. This means that to compare equal, each\n element must compare equal and the two sequences must be of the same\n type and have the same length.\n\n If not equal, the sequences are ordered the same as their first\n differing elements. For example, ``cmp([1,2,x], [1,2,y])`` returns\n the same as ``cmp(x,y)``. If the corresponding element does not\n exist, the shorter sequence is ordered first (for example, ``[1,2] <\n [1,2,3]``).\n\n* Mappings (dictionaries) compare equal if and only if their sorted\n (key, value) lists compare equal. [5] Outcomes other than equality\n are resolved consistently, but are not otherwise defined. [6]\n\n* Most other objects of builtin types compare unequal unless they are\n the same object; the choice whether one object is considered smaller\n or larger than another one is made arbitrarily but consistently\n within one execution of a program.\n\nThe operators ``in`` and ``not in`` test for collection membership.\n``x in s`` evaluates to true if *x* is a member of the collection *s*,\nand false otherwise. ``x not in s`` returns the negation of ``x in\ns``. The collection membership test has traditionally been bound to\nsequences; an object is a member of a collection if the collection is\na sequence and contains an element equal to that object. However, it\nmake sense for many other object types to support membership tests\nwithout being a sequence. In particular, dictionaries (for keys) and\nsets support membership testing.\n\nFor the list and tuple types, ``x in y`` is true if and only if there\nexists an index *i* such that ``x == y[i]`` is true.\n\nFor the Unicode and string types, ``x in y`` is true if and only if\n*x* is a substring of *y*. An equivalent test is ``y.find(x) != -1``.\nNote, *x* and *y* need not be the same type; consequently, ``u\'ab\' in\n\'abc\'`` will return ``True``. Empty strings are always considered to\nbe a substring of any other string, so ``"" in "abc"`` will return\n``True``.\n\nChanged in version 2.3: Previously, *x* was required to be a string of\nlength ``1``.\n\nFor user-defined classes which define the ``__contains__()`` method,\n``x in y`` is true if and only if ``y.__contains__(x)`` is true.\n\nFor user-defined classes which do not define ``__contains__()`` and do\ndefine ``__getitem__()``, ``x in y`` is true if and only if there is a\nnon-negative integer index *i* such that ``x == y[i]``, and all lower\ninteger indices do not raise ``IndexError`` exception. (If any other\nexception is raised, it is as if ``in`` raised that exception).\n\nThe operator ``not in`` is defined to have the inverse true value of\n``in``.\n\nThe operators ``is`` and ``is not`` test for object identity: ``x is\ny`` is true if and only if *x* and *y* are the same object. ``x is\nnot y`` yields the inverse truth value. [7]\n', 'integers': u'\nInteger and long integer literals\n*********************************\n\nInteger and long integer literals are described by the following\nlexical definitions:\n\n longinteger ::= integer ("l" | "L")\n integer ::= decimalinteger | octinteger | hexinteger\n decimalinteger ::= nonzerodigit digit* | "0"\n octinteger ::= "0" octdigit+\n hexinteger ::= "0" ("x" | "X") hexdigit+\n nonzerodigit ::= "1"..."9"\n octdigit ::= "0"..."7"\n hexdigit ::= digit | "a"..."f" | "A"..."F"\n\nAlthough both lower case ``\'l\'`` and upper case ``\'L\'`` are allowed as\nsuffix for long integers, it is strongly recommended to always use\n``\'L\'``, since the letter ``\'l\'`` looks too much like the digit\n``\'1\'``.\n\nPlain integer literals that are above the largest representable plain\ninteger (e.g., 2147483647 when using 32-bit arithmetic) are accepted\nas if they were long integers instead. [1] There is no limit for long\ninteger literals apart from what can be stored in available memory.\n\nSome examples of plain integer literals (first row) and long integer\nliterals (second and third rows):\n\n 7 2147483647 0177\n 3L 79228162514264337593543950336L 0377L 0x100000000L\n 79228162514264337593543950336 0xdeadbeef\n', 'lambda': u'\nExpression lists\n****************\n\n expression_list ::= expression ( "," expression )* [","]\n\nAn expression list containing at least one comma yields a tuple. The\nlength of the tuple is the number of expressions in the list. The\nexpressions are evaluated from left to right.\n\nThe trailing comma is required only to create a single tuple (a.k.a. a\n*singleton*); it is optional in all other cases. A single expression\nwithout a trailing comma doesn\'t create a tuple, but rather yields the\nvalue of that expression. (To create an empty tuple, use an empty pair\nof parentheses: ``()``.)\n', 'lists': u'\nList displays\n*************\n\nA list display is a possibly empty series of expressions enclosed in\nsquare brackets:\n\n list_display ::= "[" [expression_list | list_comprehension] "]"\n list_comprehension ::= expression list_for\n list_for ::= "for" target_list "in" old_expression_list [list_iter]\n old_expression_list ::= old_expression [("," old_expression)+ [","]]\n list_iter ::= list_for | list_if\n list_if ::= "if" old_expression [list_iter]\n\nA list display yields a new list object. Its contents are specified\nby providing either a list of expressions or a list comprehension.\nWhen a comma-separated list of expressions is supplied, its elements\nare evaluated from left to right and placed into the list object in\nthat order. When a list comprehension is supplied, it consists of a\nsingle expression followed by at least one ``for`` clause and zero or\nmore ``for`` or ``if`` clauses. In this case, the elements of the new\nlist are those that would be produced by considering each of the\n``for`` or ``if`` clauses a block, nesting from left to right, and\nevaluating the expression to produce a list element each time the\ninnermost block is reached [1].\n', 'naming': u'\nNaming and binding\n******************\n\n*Names* refer to objects. Names are introduced by name binding\noperations. Each occurrence of a name in the program text refers to\nthe *binding* of that name established in the innermost function block\ncontaining the use.\n\nA *block* is a piece of Python program text that is executed as a\nunit. The following are blocks: a module, a function body, and a class\ndefinition. Each command typed interactively is a block. A script\nfile (a file given as standard input to the interpreter or specified\non the interpreter command line the first argument) is a code block.\nA script command (a command specified on the interpreter command line\nwith the \'**-c**\' option) is a code block. The file read by the\nbuilt-in function ``execfile()`` is a code block. The string argument\npassed to the built-in function ``eval()`` and to the ``exec``\nstatement is a code block. The expression read and evaluated by the\nbuilt-in function ``input()`` is a code block.\n\nA code block is executed in an *execution frame*. A frame contains\nsome administrative information (used for debugging) and determines\nwhere and how execution continues after the code block\'s execution has\ncompleted.\n\nA *scope* defines the visibility of a name within a block. If a local\nvariable is defined in a block, its scope includes that block. If the\ndefinition occurs in a function block, the scope extends to any blocks\ncontained within the defining one, unless a contained block introduces\na different binding for the name. The scope of names defined in a\nclass block is limited to the class block; it does not extend to the\ncode blocks of methods -- this includes generator expressions since\nthey are implemented using a function scope. This means that the\nfollowing will fail:\n\n class A:\n a = 42\n b = list(a + i for i in range(10))\n\nWhen a name is used in a code block, it is resolved using the nearest\nenclosing scope. The set of all such scopes visible to a code block\nis called the block\'s *environment*.\n\nIf a name is bound in a block, it is a local variable of that block.\nIf a name is bound at the module level, it is a global variable. (The\nvariables of the module code block are local and global.) If a\nvariable is used in a code block but not defined there, it is a *free\nvariable*.\n\nWhen a name is not found at all, a ``NameError`` exception is raised.\nIf the name refers to a local variable that has not been bound, a\n``UnboundLocalError`` exception is raised. ``UnboundLocalError`` is a\nsubclass of ``NameError``.\n\nThe following constructs bind names: formal parameters to functions,\n``import`` statements, class and function definitions (these bind the\nclass or function name in the defining block), and targets that are\nidentifiers if occurring in an assignment, ``for`` loop header, or in\nthe second position of an ``except`` clause header. The ``import``\nstatement of the form "``from ...import *``" binds all names defined\nin the imported module, except those beginning with an underscore.\nThis form may only be used at the module level.\n\nA target occurring in a ``del`` statement is also considered bound for\nthis purpose (though the actual semantics are to unbind the name). It\nis illegal to unbind a name that is referenced by an enclosing scope;\nthe compiler will report a ``SyntaxError``.\n\nEach assignment or import statement occurs within a block defined by a\nclass or function definition or at the module level (the top-level\ncode block).\n\nIf a name binding operation occurs anywhere within a code block, all\nuses of the name within the block are treated as references to the\ncurrent block. This can lead to errors when a name is used within a\nblock before it is bound. This rule is subtle. Python lacks\ndeclarations and allows name binding operations to occur anywhere\nwithin a code block. The local variables of a code block can be\ndetermined by scanning the entire text of the block for name binding\noperations.\n\nIf the global statement occurs within a block, all uses of the name\nspecified in the statement refer to the binding of that name in the\ntop-level namespace. Names are resolved in the top-level namespace by\nsearching the global namespace, i.e. the namespace of the module\ncontaining the code block, and the builtin namespace, the namespace of\nthe module ``__builtin__``. The global namespace is searched first.\nIf the name is not found there, the builtin namespace is searched.\nThe global statement must precede all uses of the name.\n\nThe built-in namespace associated with the execution of a code block\nis actually found by looking up the name ``__builtins__`` in its\nglobal namespace; this should be a dictionary or a module (in the\nlatter case the module\'s dictionary is used). By default, when in the\n``__main__`` module, ``__builtins__`` is the built-in module\n``__builtin__`` (note: no \'s\'); when in any other module,\n``__builtins__`` is an alias for the dictionary of the ``__builtin__``\nmodule itself. ``__builtins__`` can be set to a user-created\ndictionary to create a weak form of restricted execution.\n\nNote: Users should not touch ``__builtins__``; it is strictly an\n implementation detail. Users wanting to override values in the\n built-in namespace should ``import`` the ``__builtin__`` (no \'s\')\n module and modify its attributes appropriately.\n\nThe namespace for a module is automatically created the first time a\nmodule is imported. The main module for a script is always called\n``__main__``.\n\nThe global statement has the same scope as a name binding operation in\nthe same block. If the nearest enclosing scope for a free variable\ncontains a global statement, the free variable is treated as a global.\n\nA class definition is an executable statement that may use and define\nnames. These references follow the normal rules for name resolution.\nThe namespace of the class definition becomes the attribute dictionary\nof the class. Names defined at the class scope are not visible in\nmethods.\n\n\nInteraction with dynamic features\n=================================\n\nThere are several cases where Python statements are illegal when used\nin conjunction with nested scopes that contain free variables.\n\nIf a variable is referenced in an enclosing scope, it is illegal to\ndelete the name. An error will be reported at compile time.\n\nIf the wild card form of import --- ``import *`` --- is used in a\nfunction and the function contains or is a nested block with free\nvariables, the compiler will raise a ``SyntaxError``.\n\nIf ``exec`` is used in a function and the function contains or is a\nnested block with free variables, the compiler will raise a\n``SyntaxError`` unless the exec explicitly specifies the local\nnamespace for the ``exec``. (In other words, ``exec obj`` would be\nillegal, but ``exec obj in ns`` would be legal.)\n\nThe ``eval()``, ``execfile()``, and ``input()`` functions and the\n``exec`` statement do not have access to the full environment for\nresolving names. Names may be resolved in the local and global\nnamespaces of the caller. Free variables are not resolved in the\nnearest enclosing namespace, but in the global namespace. [1] The\n``exec`` statement and the ``eval()`` and ``execfile()`` functions\nhave optional arguments to override the global and local namespace.\nIf only one namespace is specified, it is used for both.\n', 'numbers': u"\nNumeric literals\n****************\n\nThere are four types of numeric literals: plain integers, long\nintegers, floating point numbers, and imaginary numbers. There are no\ncomplex literals (complex numbers can be formed by adding a real\nnumber and an imaginary number).\n\nNote that numeric literals do not include a sign; a phrase like ``-1``\nis actually an expression composed of the unary operator '``-``' and\nthe literal ``1``.\n", - 'numeric-types': u'\nEmulating numeric types\n***********************\n\nThe following methods can be defined to emulate numeric objects.\nMethods corresponding to operations that are not supported by the\nparticular kind of number implemented (e.g., bitwise operations for\nnon-integral numbers) should be left undefined.\n\nobject.__add__(self, other)\nobject.__sub__(self, other)\nobject.__mul__(self, other)\nobject.__floordiv__(self, other)\nobject.__mod__(self, other)\nobject.__divmod__(self, other)\nobject.__pow__(self, other[, modulo])\nobject.__lshift__(self, other)\nobject.__rshift__(self, other)\nobject.__and__(self, other)\nobject.__xor__(self, other)\nobject.__or__(self, other)\n\n These methods are called to implement the binary arithmetic\n operations (``+``, ``-``, ``*``, ``//``, ``%``, ``divmod()``,\n ``pow()``, ``**``, ``<<``, ``>>``, ``&``, ``^``, ``|``). For\n instance, to evaluate the expression *x*``+``*y*, where *x* is an\n instance of a class that has an ``__add__()`` method,\n ``x.__add__(y)`` is called. The ``__divmod__()`` method should be\n the equivalent to using ``__floordiv__()`` and ``__mod__()``; it\n should not be related to ``__truediv__()`` (described below). Note\n that ``__pow__()`` should be defined to accept an optional third\n argument if the ternary version of the built-in ``pow()`` function\n is to be supported.\n\n If one of those methods does not support the operation with the\n supplied arguments, it should return ``NotImplemented``.\n\nobject.__div__(self, other)\nobject.__truediv__(self, other)\n\n The division operator (``/``) is implemented by these methods. The\n ``__truediv__()`` method is used when ``__future__.division`` is in\n effect, otherwise ``__div__()`` is used. If only one of these two\n methods is defined, the object will not support division in the\n alternate context; ``TypeError`` will be raised instead.\n\nobject.__radd__(self, other)\nobject.__rsub__(self, other)\nobject.__rmul__(self, other)\nobject.__rdiv__(self, other)\nobject.__rtruediv__(self, other)\nobject.__rfloordiv__(self, other)\nobject.__rmod__(self, other)\nobject.__rdivmod__(self, other)\nobject.__rpow__(self, other)\nobject.__rlshift__(self, other)\nobject.__rrshift__(self, other)\nobject.__rand__(self, other)\nobject.__rxor__(self, other)\nobject.__ror__(self, other)\n\n These methods are called to implement the binary arithmetic\n operations (``+``, ``-``, ``*``, ``/``, ``%``, ``divmod()``,\n ``pow()``, ``**``, ``<<``, ``>>``, ``&``, ``^``, ``|``) with\n reflected (swapped) operands. These functions are only called if\n the left operand does not support the corresponding operation and\n the operands are of different types. [4] For instance, to evaluate\n the expression *x*``-``*y*, where *y* is an instance of a class\n that has an ``__rsub__()`` method, ``y.__rsub__(x)`` is called if\n ``x.__sub__(y)`` returns *NotImplemented*.\n\n Note that ternary ``pow()`` will not try calling ``__rpow__()``\n (the coercion rules would become too complicated).\n\n Note: If the right operand\'s type is a subclass of the left operand\'s\n type and that subclass provides the reflected method for the\n operation, this method will be called before the left operand\'s\n non-reflected method. This behavior allows subclasses to\n override their ancestors\' operations.\n\nobject.__iadd__(self, other)\nobject.__isub__(self, other)\nobject.__imul__(self, other)\nobject.__idiv__(self, other)\nobject.__itruediv__(self, other)\nobject.__ifloordiv__(self, other)\nobject.__imod__(self, other)\nobject.__ipow__(self, other[, modulo])\nobject.__ilshift__(self, other)\nobject.__irshift__(self, other)\nobject.__iand__(self, other)\nobject.__ixor__(self, other)\nobject.__ior__(self, other)\n\n These methods are called to implement the augmented arithmetic\n operations (``+=``, ``-=``, ``*=``, ``/=``, ``//=``, ``%=``,\n ``**=``, ``<<=``, ``>>=``, ``&=``, ``^=``, ``|=``). These methods\n should attempt to do the operation in-place (modifying *self*) and\n return the result (which could be, but does not have to be,\n *self*). If a specific method is not defined, the augmented\n operation falls back to the normal methods. For instance, to\n evaluate the expression *x*``+=``*y*, where *x* is an instance of a\n class that has an ``__iadd__()`` method, ``x.__iadd__(y)`` is\n called. If *x* is an instance of a class that does not define a\n ``__iadd__()`` method, ``x.__add__(y)`` and ``y.__radd__(x)`` are\n considered, as with the evaluation of *x*``+``*y*.\n\nobject.__neg__(self)\nobject.__pos__(self)\nobject.__abs__(self)\nobject.__invert__(self)\n\n Called to implement the unary arithmetic operations (``-``, ``+``,\n ``abs()`` and ``~``).\n\nobject.__complex__(self)\nobject.__int__(self)\nobject.__long__(self)\nobject.__float__(self)\n\n Called to implement the built-in functions ``complex()``,\n ``int()``, ``long()``, and ``float()``. Should return a value of\n the appropriate type.\n\nobject.__oct__(self)\nobject.__hex__(self)\n\n Called to implement the built-in functions ``oct()`` and ``hex()``.\n Should return a string value.\n\nobject.__index__(self)\n\n Called to implement ``operator.index()``. Also called whenever\n Python needs an integer object (such as in slicing). Must return\n an integer (int or long).\n\n Added in version 2.5.\n\nobject.__coerce__(self, other)\n\n Called to implement "mixed-mode" numeric arithmetic. Should either\n return a 2-tuple containing *self* and *other* converted to a\n common numeric type, or ``None`` if conversion is impossible. When\n the common type would be the type of ``other``, it is sufficient to\n return ``None``, since the interpreter will also ask the other\n object to attempt a coercion (but sometimes, if the implementation\n of the other type cannot be changed, it is useful to do the\n conversion to the other type here). A return value of\n ``NotImplemented`` is equivalent to returning ``None``.\n', + 'numeric-types': u'\nEmulating numeric types\n***********************\n\nThe following methods can be defined to emulate numeric objects.\nMethods corresponding to operations that are not supported by the\nparticular kind of number implemented (e.g., bitwise operations for\nnon-integral numbers) should be left undefined.\n\nobject.__add__(self, other)\nobject.__sub__(self, other)\nobject.__mul__(self, other)\nobject.__floordiv__(self, other)\nobject.__mod__(self, other)\nobject.__divmod__(self, other)\nobject.__pow__(self, other[, modulo])\nobject.__lshift__(self, other)\nobject.__rshift__(self, other)\nobject.__and__(self, other)\nobject.__xor__(self, other)\nobject.__or__(self, other)\n\n These methods are called to implement the binary arithmetic\n operations (``+``, ``-``, ``*``, ``//``, ``%``, ``divmod()``,\n ``pow()``, ``**``, ``<<``, ``>>``, ``&``, ``^``, ``|``). For\n instance, to evaluate the expression ``x + y``, where *x* is an\n instance of a class that has an ``__add__()`` method,\n ``x.__add__(y)`` is called. The ``__divmod__()`` method should be\n the equivalent to using ``__floordiv__()`` and ``__mod__()``; it\n should not be related to ``__truediv__()`` (described below). Note\n that ``__pow__()`` should be defined to accept an optional third\n argument if the ternary version of the built-in ``pow()`` function\n is to be supported.\n\n If one of those methods does not support the operation with the\n supplied arguments, it should return ``NotImplemented``.\n\nobject.__div__(self, other)\nobject.__truediv__(self, other)\n\n The division operator (``/``) is implemented by these methods. The\n ``__truediv__()`` method is used when ``__future__.division`` is in\n effect, otherwise ``__div__()`` is used. If only one of these two\n methods is defined, the object will not support division in the\n alternate context; ``TypeError`` will be raised instead.\n\nobject.__radd__(self, other)\nobject.__rsub__(self, other)\nobject.__rmul__(self, other)\nobject.__rdiv__(self, other)\nobject.__rtruediv__(self, other)\nobject.__rfloordiv__(self, other)\nobject.__rmod__(self, other)\nobject.__rdivmod__(self, other)\nobject.__rpow__(self, other)\nobject.__rlshift__(self, other)\nobject.__rrshift__(self, other)\nobject.__rand__(self, other)\nobject.__rxor__(self, other)\nobject.__ror__(self, other)\n\n These methods are called to implement the binary arithmetic\n operations (``+``, ``-``, ``*``, ``/``, ``%``, ``divmod()``,\n ``pow()``, ``**``, ``<<``, ``>>``, ``&``, ``^``, ``|``) with\n reflected (swapped) operands. These functions are only called if\n the left operand does not support the corresponding operation and\n the operands are of different types. [3] For instance, to evaluate\n the expression ``x - y``, where *y* is an instance of a class that\n has an ``__rsub__()`` method, ``y.__rsub__(x)`` is called if\n ``x.__sub__(y)`` returns *NotImplemented*.\n\n Note that ternary ``pow()`` will not try calling ``__rpow__()``\n (the coercion rules would become too complicated).\n\n Note: If the right operand\'s type is a subclass of the left operand\'s\n type and that subclass provides the reflected method for the\n operation, this method will be called before the left operand\'s\n non-reflected method. This behavior allows subclasses to\n override their ancestors\' operations.\n\nobject.__iadd__(self, other)\nobject.__isub__(self, other)\nobject.__imul__(self, other)\nobject.__idiv__(self, other)\nobject.__itruediv__(self, other)\nobject.__ifloordiv__(self, other)\nobject.__imod__(self, other)\nobject.__ipow__(self, other[, modulo])\nobject.__ilshift__(self, other)\nobject.__irshift__(self, other)\nobject.__iand__(self, other)\nobject.__ixor__(self, other)\nobject.__ior__(self, other)\n\n These methods are called to implement the augmented arithmetic\n operations (``+=``, ``-=``, ``*=``, ``/=``, ``//=``, ``%=``,\n ``**=``, ``<<=``, ``>>=``, ``&=``, ``^=``, ``|=``). These methods\n should attempt to do the operation in-place (modifying *self*) and\n return the result (which could be, but does not have to be,\n *self*). If a specific method is not defined, the augmented\n operation falls back to the normal methods. For instance, to\n evaluate the expression ``x += y``, where *x* is an instance of a\n class that has an ``__iadd__()`` method, ``x.__iadd__(y)`` is\n called. If *x* is an instance of a class that does not define a\n ``__iadd__()`` method, ``x.__add__(y)`` and ``y.__radd__(x)`` are\n considered, as with the evaluation of ``x + y``.\n\nobject.__neg__(self)\nobject.__pos__(self)\nobject.__abs__(self)\nobject.__invert__(self)\n\n Called to implement the unary arithmetic operations (``-``, ``+``,\n ``abs()`` and ``~``).\n\nobject.__complex__(self)\nobject.__int__(self)\nobject.__long__(self)\nobject.__float__(self)\n\n Called to implement the built-in functions ``complex()``,\n ``int()``, ``long()``, and ``float()``. Should return a value of\n the appropriate type.\n\nobject.__oct__(self)\nobject.__hex__(self)\n\n Called to implement the built-in functions ``oct()`` and ``hex()``.\n Should return a string value.\n\nobject.__index__(self)\n\n Called to implement ``operator.index()``. Also called whenever\n Python needs an integer object (such as in slicing). Must return\n an integer (int or long).\n\n New in version 2.5.\n\nobject.__coerce__(self, other)\n\n Called to implement "mixed-mode" numeric arithmetic. Should either\n return a 2-tuple containing *self* and *other* converted to a\n common numeric type, or ``None`` if conversion is impossible. When\n the common type would be the type of ``other``, it is sufficient to\n return ``None``, since the interpreter will also ask the other\n object to attempt a coercion (but sometimes, if the implementation\n of the other type cannot be changed, it is useful to do the\n conversion to the other type here). A return value of\n ``NotImplemented`` is equivalent to returning ``None``.\n', 'objects': u'\nObjects, values and types\n*************************\n\n*Objects* are Python\'s abstraction for data. All data in a Python\nprogram is represented by objects or by relations between objects. (In\na sense, and in conformance to Von Neumann\'s model of a "stored\nprogram computer," code is also represented by objects.)\n\nEvery object has an identity, a type and a value. An object\'s\n*identity* never changes once it has been created; you may think of it\nas the object\'s address in memory. The \'``is``\' operator compares the\nidentity of two objects; the ``id()`` function returns an integer\nrepresenting its identity (currently implemented as its address). An\nobject\'s *type* is also unchangeable. [1] An object\'s type determines\nthe operations that the object supports (e.g., "does it have a\nlength?") and also defines the possible values for objects of that\ntype. The ``type()`` function returns an object\'s type (which is an\nobject itself). The *value* of some objects can change. Objects\nwhose value can change are said to be *mutable*; objects whose value\nis unchangeable once they are created are called *immutable*. (The\nvalue of an immutable container object that contains a reference to a\nmutable object can change when the latter\'s value is changed; however\nthe container is still considered immutable, because the collection of\nobjects it contains cannot be changed. So, immutability is not\nstrictly the same as having an unchangeable value, it is more subtle.)\nAn object\'s mutability is determined by its type; for instance,\nnumbers, strings and tuples are immutable, while dictionaries and\nlists are mutable.\n\nObjects are never explicitly destroyed; however, when they become\nunreachable they may be garbage-collected. An implementation is\nallowed to postpone garbage collection or omit it altogether --- it is\na matter of implementation quality how garbage collection is\nimplemented, as long as no objects are collected that are still\nreachable. (Implementation note: the current implementation uses a\nreference-counting scheme with (optional) delayed detection of\ncyclically linked garbage, which collects most objects as soon as they\nbecome unreachable, but is not guaranteed to collect garbage\ncontaining circular references. See the documentation of the ``gc``\nmodule for information on controlling the collection of cyclic\ngarbage.)\n\nNote that the use of the implementation\'s tracing or debugging\nfacilities may keep objects alive that would normally be collectable.\nAlso note that catching an exception with a \'``try``...``except``\'\nstatement may keep objects alive.\n\nSome objects contain references to "external" resources such as open\nfiles or windows. It is understood that these resources are freed\nwhen the object is garbage-collected, but since garbage collection is\nnot guaranteed to happen, such objects also provide an explicit way to\nrelease the external resource, usually a ``close()`` method. Programs\nare strongly recommended to explicitly close such objects. The\n\'``try``...``finally``\' statement provides a convenient way to do\nthis.\n\nSome objects contain references to other objects; these are called\n*containers*. Examples of containers are tuples, lists and\ndictionaries. The references are part of a container\'s value. In\nmost cases, when we talk about the value of a container, we imply the\nvalues, not the identities of the contained objects; however, when we\ntalk about the mutability of a container, only the identities of the\nimmediately contained objects are implied. So, if an immutable\ncontainer (like a tuple) contains a reference to a mutable object, its\nvalue changes if that mutable object is changed.\n\nTypes affect almost all aspects of object behavior. Even the\nimportance of object identity is affected in some sense: for immutable\ntypes, operations that compute new values may actually return a\nreference to any existing object with the same type and value, while\nfor mutable objects this is not allowed. E.g., after ``a = 1; b =\n1``, ``a`` and ``b`` may or may not refer to the same object with the\nvalue one, depending on the implementation, but after ``c = []; d =\n[]``, ``c`` and ``d`` are guaranteed to refer to two different,\nunique, newly created empty lists. (Note that ``c = d = []`` assigns\nthe same object to both ``c`` and ``d``.)\n', - 'operator-summary': u'\nSummary\n*******\n\nThe following table summarizes the operator precedences in Python,\nfrom lowest precedence (least binding) to highest precedence (most\nbinding). Operators in the same box have the same precedence. Unless\nthe syntax is explicitly given, operators are binary. Operators in\nthe same box group left to right (except for comparisons, including\ntests, which all have the same precedence and chain from left to right\n--- see section *Comparisons* --- and exponentiation, which groups\nfrom right to left).\n\n+-------------------------------------------------+---------------------------------------+\n| Operator | Description |\n+=================================================+=======================================+\n| ``lambda`` | Lambda expression |\n+-------------------------------------------------+---------------------------------------+\n| ``or`` | Boolean OR |\n+-------------------------------------------------+---------------------------------------+\n| ``and`` | Boolean AND |\n+-------------------------------------------------+---------------------------------------+\n| ``not`` *x* | Boolean NOT |\n+-------------------------------------------------+---------------------------------------+\n| ``in``, ``not`` ``in`` | Membership tests |\n+-------------------------------------------------+---------------------------------------+\n| ``is``, ``is not`` | Identity tests |\n+-------------------------------------------------+---------------------------------------+\n| ``<``, ``<=``, ``>``, ``>=``, ``<>``, ``!=``, | Comparisons |\n| ``==`` | |\n+-------------------------------------------------+---------------------------------------+\n| ``|`` | Bitwise OR |\n+-------------------------------------------------+---------------------------------------+\n| ``^`` | Bitwise XOR |\n+-------------------------------------------------+---------------------------------------+\n| ``&`` | Bitwise AND |\n+-------------------------------------------------+---------------------------------------+\n| ``<<``, ``>>`` | Shifts |\n+-------------------------------------------------+---------------------------------------+\n| ``+``, ``-`` | Addition and subtraction |\n+-------------------------------------------------+---------------------------------------+\n| ``*``, ``/``, ``%`` | Multiplication, division, remainder |\n+-------------------------------------------------+---------------------------------------+\n| ``+x``, ``-x`` | Positive, negative |\n+-------------------------------------------------+---------------------------------------+\n| ``~x`` | Bitwise not |\n+-------------------------------------------------+---------------------------------------+\n| ``**`` | Exponentiation |\n+-------------------------------------------------+---------------------------------------+\n| ``x.attribute`` | Attribute reference |\n+-------------------------------------------------+---------------------------------------+\n| ``x[index]`` | Subscription |\n+-------------------------------------------------+---------------------------------------+\n| ``x[index:index]`` | Slicing |\n+-------------------------------------------------+---------------------------------------+\n| ``f(arguments...)`` | Function call |\n+-------------------------------------------------+---------------------------------------+\n| ``(expressions...)`` | Binding or tuple display |\n+-------------------------------------------------+---------------------------------------+\n| ``[expressions...]`` | List display |\n+-------------------------------------------------+---------------------------------------+\n| ``{key:datum...}`` | Dictionary display |\n+-------------------------------------------------+---------------------------------------+\n| ```expressions...``` | String conversion |\n+-------------------------------------------------+---------------------------------------+\n\n-[ Footnotes ]-\n\n[1] In Python 2.3 and later releases, a list comprehension "leaks" the\n control variables of each ``for`` it contains into the containing\n scope. However, this behavior is deprecated, and relying on it\n will not work in Python 3.0\n\n[2] While ``abs(x%y) < abs(y)`` is true mathematically, for floats it\n may not be true numerically due to roundoff. For example, and\n assuming a platform on which a Python float is an IEEE 754 double-\n precision number, in order that ``-1e-100 % 1e100`` have the same\n sign as ``1e100``, the computed result is ``-1e-100 + 1e100``,\n which is numerically exactly equal to ``1e100``. Function\n ``fmod()`` in the ``math`` module returns a result whose sign\n matches the sign of the first argument instead, and so returns\n ``-1e-100`` in this case. Which approach is more appropriate\n depends on the application.\n\n[3] If x is very close to an exact integer multiple of y, it\'s\n possible for ``floor(x/y)`` to be one larger than ``(x-x%y)/y``\n due to rounding. In such cases, Python returns the latter result,\n in order to preserve that ``divmod(x,y)[0] * y + x % y`` be very\n close to ``x``.\n\n[4] While comparisons between unicode strings make sense at the byte\n level, they may be counter-intuitive to users. For example, the\n strings ``u"\\u00C7"`` and ``u"\\u0043\\u0327"`` compare differently,\n even though they both represent the same unicode character (LATIN\n CAPTITAL LETTER C WITH CEDILLA). To compare strings in a human\n recognizable way, compare using ``unicodedata.normalize()``.\n\n[5] The implementation computes this efficiently, without constructing\n lists or sorting.\n\n[6] Earlier versions of Python used lexicographic comparison of the\n sorted (key, value) lists, but this was very expensive for the\n common case of comparing for equality. An even earlier version of\n Python compared dictionaries by identity only, but this caused\n surprises because people expected to be able to test a dictionary\n for emptiness by comparing it to ``{}``.\n', + 'operator-summary': u'\nSummary\n*******\n\nThe following table summarizes the operator precedences in Python,\nfrom lowest precedence (least binding) to highest precedence (most\nbinding). Operators in the same box have the same precedence. Unless\nthe syntax is explicitly given, operators are binary. Operators in\nthe same box group left to right (except for comparisons, including\ntests, which all have the same precedence and chain from left to right\n--- see section *Comparisons* --- and exponentiation, which groups\nfrom right to left).\n\n+-------------------------------------------------+---------------------------------------+\n| Operator | Description |\n+=================================================+=======================================+\n| ``lambda`` | Lambda expression |\n+-------------------------------------------------+---------------------------------------+\n| ``or`` | Boolean OR |\n+-------------------------------------------------+---------------------------------------+\n| ``and`` | Boolean AND |\n+-------------------------------------------------+---------------------------------------+\n| ``not`` *x* | Boolean NOT |\n+-------------------------------------------------+---------------------------------------+\n| ``in``, ``not`` ``in`` | Membership tests |\n+-------------------------------------------------+---------------------------------------+\n| ``is``, ``is not`` | Identity tests |\n+-------------------------------------------------+---------------------------------------+\n| ``<``, ``<=``, ``>``, ``>=``, ``<>``, ``!=``, | Comparisons |\n| ``==`` | |\n+-------------------------------------------------+---------------------------------------+\n| ``|`` | Bitwise OR |\n+-------------------------------------------------+---------------------------------------+\n| ``^`` | Bitwise XOR |\n+-------------------------------------------------+---------------------------------------+\n| ``&`` | Bitwise AND |\n+-------------------------------------------------+---------------------------------------+\n| ``<<``, ``>>`` | Shifts |\n+-------------------------------------------------+---------------------------------------+\n| ``+``, ``-`` | Addition and subtraction |\n+-------------------------------------------------+---------------------------------------+\n| ``*``, ``/``, ``%`` | Multiplication, division, remainder |\n+-------------------------------------------------+---------------------------------------+\n| ``+x``, ``-x`` | Positive, negative |\n+-------------------------------------------------+---------------------------------------+\n| ``~x`` | Bitwise not |\n+-------------------------------------------------+---------------------------------------+\n| ``**`` | Exponentiation |\n+-------------------------------------------------+---------------------------------------+\n| ``x[index]`` | Subscription |\n+-------------------------------------------------+---------------------------------------+\n| ``x[index:index]`` | Slicing |\n+-------------------------------------------------+---------------------------------------+\n| ``x(arguments...)`` | Call |\n+-------------------------------------------------+---------------------------------------+\n| ``x.attribute`` | Attribute reference |\n+-------------------------------------------------+---------------------------------------+\n| ``(expressions...)`` | Binding or tuple display |\n+-------------------------------------------------+---------------------------------------+\n| ``[expressions...]`` | List display |\n+-------------------------------------------------+---------------------------------------+\n| ``{key:datum...}`` | Dictionary display |\n+-------------------------------------------------+---------------------------------------+\n| ```expressions...``` | String conversion |\n+-------------------------------------------------+---------------------------------------+\n\n-[ Footnotes ]-\n\n[1] In Python 2.3 and later releases, a list comprehension "leaks" the\n control variables of each ``for`` it contains into the containing\n scope. However, this behavior is deprecated, and relying on it\n will not work in Python 3.0\n\n[2] While ``abs(x%y) < abs(y)`` is true mathematically, for floats it\n may not be true numerically due to roundoff. For example, and\n assuming a platform on which a Python float is an IEEE 754 double-\n precision number, in order that ``-1e-100 % 1e100`` have the same\n sign as ``1e100``, the computed result is ``-1e-100 + 1e100``,\n which is numerically exactly equal to ``1e100``. Function\n ``fmod()`` in the ``math`` module returns a result whose sign\n matches the sign of the first argument instead, and so returns\n ``-1e-100`` in this case. Which approach is more appropriate\n depends on the application.\n\n[3] If x is very close to an exact integer multiple of y, it\'s\n possible for ``floor(x/y)`` to be one larger than ``(x-x%y)/y``\n due to rounding. In such cases, Python returns the latter result,\n in order to preserve that ``divmod(x,y)[0] * y + x % y`` be very\n close to ``x``.\n\n[4] While comparisons between unicode strings make sense at the byte\n level, they may be counter-intuitive to users. For example, the\n strings ``u"\\u00C7"`` and ``u"\\u0043\\u0327"`` compare differently,\n even though they both represent the same unicode character (LATIN\n CAPTITAL LETTER C WITH CEDILLA). To compare strings in a human\n recognizable way, compare using ``unicodedata.normalize()``.\n\n[5] The implementation computes this efficiently, without constructing\n lists or sorting.\n\n[6] Earlier versions of Python used lexicographic comparison of the\n sorted (key, value) lists, but this was very expensive for the\n common case of comparing for equality. An even earlier version of\n Python compared dictionaries by identity only, but this caused\n surprises because people expected to be able to test a dictionary\n for emptiness by comparing it to ``{}``.\n\n[7] Due to automatic garbage-collection, free lists, and the dynamic\n nature of descriptors, you may notice seemingly unusual behaviour\n in certain uses of the ``is`` operator, like those involving\n comparisons between instance methods, or constants. Check their\n documentation for more info.\n', 'pass': u'\nThe ``pass`` statement\n**********************\n\n pass_stmt ::= "pass"\n\n``pass`` is a null operation --- when it is executed, nothing happens.\nIt is useful as a placeholder when a statement is required\nsyntactically, but no code needs to be executed, for example:\n\n def f(arg): pass # a function that does nothing (yet)\n\n class C: pass # a class with no methods (yet)\n', 'power': u'\nThe power operator\n******************\n\nThe power operator binds more tightly than unary operators on its\nleft; it binds less tightly than unary operators on its right. The\nsyntax is:\n\n power ::= primary ["**" u_expr]\n\nThus, in an unparenthesized sequence of power and unary operators, the\noperators are evaluated from right to left (this does not constrain\nthe evaluation order for the operands): ``-1**2`` results in ``-1``.\n\nThe power operator has the same semantics as the built-in ``pow()``\nfunction, when called with two arguments: it yields its left argument\nraised to the power of its right argument. The numeric arguments are\nfirst converted to a common type. The result type is that of the\narguments after coercion.\n\nWith mixed operand types, the coercion rules for binary arithmetic\noperators apply. For int and long int operands, the result has the\nsame type as the operands (after coercion) unless the second argument\nis negative; in that case, all arguments are converted to float and a\nfloat result is delivered. For example, ``10**2`` returns ``100``, but\n``10**-2`` returns ``0.01``. (This last feature was added in Python\n2.2. In Python 2.1 and before, if both arguments were of integer types\nand the second argument was negative, an exception was raised).\n\nRaising ``0.0`` to a negative power results in a\n``ZeroDivisionError``. Raising a negative number to a fractional power\nresults in a ``ValueError``.\n', - 'print': u'\nThe ``print`` statement\n***********************\n\n print_stmt ::= "print" ([expression ("," expression)* [","]\n | ">>" expression [("," expression)+ [","])\n\n``print`` evaluates each expression in turn and writes the resulting\nobject to standard output (see below). If an object is not a string,\nit is first converted to a string using the rules for string\nconversions. The (resulting or original) string is then written. A\nspace is written before each object is (converted and) written, unless\nthe output system believes it is positioned at the beginning of a\nline. This is the case (1) when no characters have yet been written\nto standard output, (2) when the last character written to standard\noutput is ``\'\\n\'``, or (3) when the last write operation on standard\noutput was not a ``print`` statement. (In some cases it may be\nfunctional to write an empty string to standard output for this\nreason.)\n\nNote: Objects which act like file objects but which are not the built-in\n file objects often do not properly emulate this aspect of the file\n object\'s behavior, so it is best not to rely on this.\n\nA ``\'\\n\'`` character is written at the end, unless the ``print``\nstatement ends with a comma. This is the only action if the statement\ncontains just the keyword ``print``.\n\nStandard output is defined as the file object named ``stdout`` in the\nbuilt-in module ``sys``. If no such object exists, or if it does not\nhave a ``write()`` method, a ``RuntimeError`` exception is raised.\n\n``print`` also has an extended form, defined by the second portion of\nthe syntax described above. This form is sometimes referred to as\n"``print`` chevron." In this form, the first expression after the\n``>>`` must evaluate to a "file-like" object, specifically an object\nthat has a ``write()`` method as described above. With this extended\nform, the subsequent expressions are printed to this file object. If\nthe first expression evaluates to ``None``, then ``sys.stdout`` is\nused as the file for output.\n', + 'print': u'\nThe ``print`` statement\n***********************\n\n print_stmt ::= "print" ([expression ("," expression)* [","]]\n | ">>" expression [("," expression)+ [","]])\n\n``print`` evaluates each expression in turn and writes the resulting\nobject to standard output (see below). If an object is not a string,\nit is first converted to a string using the rules for string\nconversions. The (resulting or original) string is then written. A\nspace is written before each object is (converted and) written, unless\nthe output system believes it is positioned at the beginning of a\nline. This is the case (1) when no characters have yet been written\nto standard output, (2) when the last character written to standard\noutput is ``\'\\n\'``, or (3) when the last write operation on standard\noutput was not a ``print`` statement. (In some cases it may be\nfunctional to write an empty string to standard output for this\nreason.)\n\nNote: Objects which act like file objects but which are not the built-in\n file objects often do not properly emulate this aspect of the file\n object\'s behavior, so it is best not to rely on this.\n\nA ``\'\\n\'`` character is written at the end, unless the ``print``\nstatement ends with a comma. This is the only action if the statement\ncontains just the keyword ``print``.\n\nStandard output is defined as the file object named ``stdout`` in the\nbuilt-in module ``sys``. If no such object exists, or if it does not\nhave a ``write()`` method, a ``RuntimeError`` exception is raised.\n\n``print`` also has an extended form, defined by the second portion of\nthe syntax described above. This form is sometimes referred to as\n"``print`` chevron." In this form, the first expression after the\n``>>`` must evaluate to a "file-like" object, specifically an object\nthat has a ``write()`` method as described above. With this extended\nform, the subsequent expressions are printed to this file object. If\nthe first expression evaluates to ``None``, then ``sys.stdout`` is\nused as the file for output.\n', 'raise': u'\nThe ``raise`` statement\n***********************\n\n raise_stmt ::= "raise" [expression ["," expression ["," expression]]]\n\nIf no expressions are present, ``raise`` re-raises the last exception\nthat was active in the current scope. If no exception is active in\nthe current scope, a ``TypeError`` exception is raised indicating that\nthis is an error (if running under IDLE, a ``Queue.Empty`` exception\nis raised instead).\n\nOtherwise, ``raise`` evaluates the expressions to get three objects,\nusing ``None`` as the value of omitted expressions. The first two\nobjects are used to determine the *type* and *value* of the exception.\n\nIf the first object is an instance, the type of the exception is the\nclass of the instance, the instance itself is the value, and the\nsecond object must be ``None``.\n\nIf the first object is a class, it becomes the type of the exception.\nThe second object is used to determine the exception value: If it is\nan instance of the class, the instance becomes the exception value. If\nthe second object is a tuple, it is used as the argument list for the\nclass constructor; if it is ``None``, an empty argument list is used,\nand any other object is treated as a single argument to the\nconstructor. The instance so created by calling the constructor is\nused as the exception value.\n\nIf a third object is present and not ``None``, it must be a traceback\nobject (see section *The standard type hierarchy*), and it is\nsubstituted instead of the current location as the place where the\nexception occurred. If the third object is present and not a\ntraceback object or ``None``, a ``TypeError`` exception is raised.\nThe three-expression form of ``raise`` is useful to re-raise an\nexception transparently in an except clause, but ``raise`` with no\nexpressions should be preferred if the exception to be re-raised was\nthe most recently active exception in the current scope.\n\nAdditional information on exceptions can be found in section\n*Exceptions*, and information about handling exceptions is in section\n*The try statement*.\n', 'return': u'\nThe ``return`` statement\n************************\n\n return_stmt ::= "return" [expression_list]\n\n``return`` may only occur syntactically nested in a function\ndefinition, not within a nested class definition.\n\nIf an expression list is present, it is evaluated, else ``None`` is\nsubstituted.\n\n``return`` leaves the current function call with the expression list\n(or ``None``) as return value.\n\nWhen ``return`` passes control out of a ``try`` statement with a\n``finally`` clause, that ``finally`` clause is executed before really\nleaving the function.\n\nIn a generator function, the ``return`` statement is not allowed to\ninclude an **expression_list**. In that context, a bare ``return``\nindicates that the generator is done and will cause ``StopIteration``\nto be raised.\n', - 'sequence-methods': u'\nAdditional methods for emulation of sequence types\n**************************************************\n\nThe following optional methods can be defined to further emulate\nsequence objects. Immutable sequences methods should at most only\ndefine ``__getslice__()``; mutable sequences might define all three\nmethods.\n\nobject.__getslice__(self, i, j)\n\n Deprecated in version 2.0: Support slice objects as parameters to\n the ``__getitem__()`` method. (However, built-in types in CPython\n currently still implement ``__getslice__()``. Therefore, you have\n to override it in derived classes when implementing slicing.)\n\n Called to implement evaluation of ``self[i:j]``. The returned\n object should be of the same type as *self*. Note that missing *i*\n or *j* in the slice expression are replaced by zero or\n ``sys.maxint``, respectively. If negative indexes are used in the\n slice, the length of the sequence is added to that index. If the\n instance does not implement the ``__len__()`` method, an\n ``AttributeError`` is raised. No guarantee is made that indexes\n adjusted this way are not still negative. Indexes which are\n greater than the length of the sequence are not modified. If no\n ``__getslice__()`` is found, a slice object is created instead, and\n passed to ``__getitem__()`` instead.\n\nobject.__setslice__(self, i, j, sequence)\n\n Called to implement assignment to ``self[i:j]``. Same notes for *i*\n and *j* as for ``__getslice__()``.\n\n This method is deprecated. If no ``__setslice__()`` is found, or\n for extended slicing of the form ``self[i:j:k]``, a slice object is\n created, and passed to ``__setitem__()``, instead of\n ``__setslice__()`` being called.\n\nobject.__delslice__(self, i, j)\n\n Called to implement deletion of ``self[i:j]``. Same notes for *i*\n and *j* as for ``__getslice__()``. This method is deprecated. If no\n ``__delslice__()`` is found, or for extended slicing of the form\n ``self[i:j:k]``, a slice object is created, and passed to\n ``__delitem__()``, instead of ``__delslice__()`` being called.\n\nNotice that these methods are only invoked when a single slice with a\nsingle colon is used, and the slice method is available. For slice\noperations involving extended slice notation, or in absence of the\nslice methods, ``__getitem__()``, ``__setitem__()`` or\n``__delitem__()`` is called with a slice object as argument.\n\nThe following example demonstrate how to make your program or module\ncompatible with earlier versions of Python (assuming that methods\n``__getitem__()``, ``__setitem__()`` and ``__delitem__()`` support\nslice objects as arguments):\n\n class MyClass:\n ...\n def __getitem__(self, index):\n ...\n def __setitem__(self, index, value):\n ...\n def __delitem__(self, index):\n ...\n\n if sys.version_info < (2, 0):\n # They won\'t be defined if version is at least 2.0 final\n\n def __getslice__(self, i, j):\n return self[max(0, i):max(0, j):]\n def __setslice__(self, i, j, seq):\n self[max(0, i):max(0, j):] = seq\n def __delslice__(self, i, j):\n del self[max(0, i):max(0, j):]\n ...\n\nNote the calls to ``max()``; these are necessary because of the\nhandling of negative indices before the ``__*slice__()`` methods are\ncalled. When negative indexes are used, the ``__*item__()`` methods\nreceive them as provided, but the ``__*slice__()`` methods get a\n"cooked" form of the index values. For each negative index value, the\nlength of the sequence is added to the index before calling the method\n(which may still result in a negative index); this is the customary\nhandling of negative indexes by the built-in sequence types, and the\n``__*item__()`` methods are expected to do this as well. However,\nsince they should already be doing that, negative indexes cannot be\npassed in; they must be constrained to the bounds of the sequence\nbefore being passed to the ``__*item__()`` methods. Calling ``max(0,\ni)`` conveniently returns the proper value.\n', - 'sequence-types': u"\nEmulating container types\n*************************\n\nThe following methods can be defined to implement container objects.\nContainers usually are sequences (such as lists or tuples) or mappings\n(like dictionaries), but can represent other containers as well. The\nfirst set of methods is used either to emulate a sequence or to\nemulate a mapping; the difference is that for a sequence, the\nallowable keys should be the integers *k* for which ``0 <= k < N``\nwhere *N* is the length of the sequence, or slice objects, which\ndefine a range of items. (For backwards compatibility, the method\n``__getslice__()`` (see below) can also be defined to handle simple,\nbut not extended slices.) It is also recommended that mappings provide\nthe methods ``keys()``, ``values()``, ``items()``, ``has_key()``,\n``get()``, ``clear()``, ``setdefault()``, ``iterkeys()``,\n``itervalues()``, ``iteritems()``, ``pop()``, ``popitem()``,\n``copy()``, and ``update()`` behaving similar to those for Python's\nstandard dictionary objects. The ``UserDict`` module provides a\n``DictMixin`` class to help create those methods from a base set of\n``__getitem__()``, ``__setitem__()``, ``__delitem__()``, and\n``keys()``. Mutable sequences should provide methods ``append()``,\n``count()``, ``index()``, ``extend()``, ``insert()``, ``pop()``,\n``remove()``, ``reverse()`` and ``sort()``, like Python standard list\nobjects. Finally, sequence types should implement addition (meaning\nconcatenation) and multiplication (meaning repetition) by defining the\nmethods ``__add__()``, ``__radd__()``, ``__iadd__()``, ``__mul__()``,\n``__rmul__()`` and ``__imul__()`` described below; they should not\ndefine ``__coerce__()`` or other numerical operators. It is\nrecommended that both mappings and sequences implement the\n``__contains__()`` method to allow efficient use of the ``in``\noperator; for mappings, ``in`` should be equivalent of ``has_key()``;\nfor sequences, it should search through the values. It is further\nrecommended that both mappings and sequences implement the\n``__iter__()`` method to allow efficient iteration through the\ncontainer; for mappings, ``__iter__()`` should be the same as\n``iterkeys()``; for sequences, it should iterate through the values.\n\nobject.__len__(self)\n\n Called to implement the built-in function ``len()``. Should return\n the length of the object, an integer ``>=`` 0. Also, an object\n that doesn't define a ``__nonzero__()`` method and whose\n ``__len__()`` method returns zero is considered to be false in a\n Boolean context.\n\nobject.__getitem__(self, key)\n\n Called to implement evaluation of ``self[key]``. For sequence\n types, the accepted keys should be integers and slice objects.\n Note that the special interpretation of negative indexes (if the\n class wishes to emulate a sequence type) is up to the\n ``__getitem__()`` method. If *key* is of an inappropriate type,\n ``TypeError`` may be raised; if of a value outside the set of\n indexes for the sequence (after any special interpretation of\n negative values), ``IndexError`` should be raised. For mapping\n types, if *key* is missing (not in the container), ``KeyError``\n should be raised.\n\n Note: ``for`` loops expect that an ``IndexError`` will be raised for\n illegal indexes to allow proper detection of the end of the\n sequence.\n\nobject.__setitem__(self, key, value)\n\n Called to implement assignment to ``self[key]``. Same note as for\n ``__getitem__()``. This should only be implemented for mappings if\n the objects support changes to the values for keys, or if new keys\n can be added, or for sequences if elements can be replaced. The\n same exceptions should be raised for improper *key* values as for\n the ``__getitem__()`` method.\n\nobject.__delitem__(self, key)\n\n Called to implement deletion of ``self[key]``. Same note as for\n ``__getitem__()``. This should only be implemented for mappings if\n the objects support removal of keys, or for sequences if elements\n can be removed from the sequence. The same exceptions should be\n raised for improper *key* values as for the ``__getitem__()``\n method.\n\nobject.__iter__(self)\n\n This method is called when an iterator is required for a container.\n This method should return a new iterator object that can iterate\n over all the objects in the container. For mappings, it should\n iterate over the keys of the container, and should also be made\n available as the method ``iterkeys()``.\n\n Iterator objects also need to implement this method; they are\n required to return themselves. For more information on iterator\n objects, see *Iterator Types*.\n\nobject.__reversed__(self)\n\n Called (if present) by the ``reversed()`` builtin to implement\n reverse iteration. It should return a new iterator object that\n iterates over all the objects in the container in reverse order.\n\n If the ``__reversed__()`` method is not provided, the\n ``reversed()`` builtin will fall back to using the sequence\n protocol (``__len__()`` and ``__getitem__()``). Objects should\n normally only provide ``__reversed__()`` if they do not support the\n sequence protocol and an efficient implementation of reverse\n iteration is possible.\n\n Added in version 2.6.\n\nThe membership test operators (``in`` and ``not in``) are normally\nimplemented as an iteration through a sequence. However, container\nobjects can supply the following special method with a more efficient\nimplementation, which also does not require the object be a sequence.\n\nobject.__contains__(self, item)\n\n Called to implement membership test operators. Should return true\n if *item* is in *self*, false otherwise. For mapping objects, this\n should consider the keys of the mapping rather than the values or\n the key-item pairs.\n", + 'sequence-methods': u'\nAdditional methods for emulation of sequence types\n**************************************************\n\nThe following optional methods can be defined to further emulate\nsequence objects. Immutable sequences methods should at most only\ndefine ``__getslice__()``; mutable sequences might define all three\nmethods.\n\nobject.__getslice__(self, i, j)\n\n Deprecated since version 2.0: Support slice objects as parameters\n to the ``__getitem__()`` method. (However, built-in types in\n CPython currently still implement ``__getslice__()``. Therefore,\n you have to override it in derived classes when implementing\n slicing.)\n\n Called to implement evaluation of ``self[i:j]``. The returned\n object should be of the same type as *self*. Note that missing *i*\n or *j* in the slice expression are replaced by zero or\n ``sys.maxint``, respectively. If negative indexes are used in the\n slice, the length of the sequence is added to that index. If the\n instance does not implement the ``__len__()`` method, an\n ``AttributeError`` is raised. No guarantee is made that indexes\n adjusted this way are not still negative. Indexes which are\n greater than the length of the sequence are not modified. If no\n ``__getslice__()`` is found, a slice object is created instead, and\n passed to ``__getitem__()`` instead.\n\nobject.__setslice__(self, i, j, sequence)\n\n Called to implement assignment to ``self[i:j]``. Same notes for *i*\n and *j* as for ``__getslice__()``.\n\n This method is deprecated. If no ``__setslice__()`` is found, or\n for extended slicing of the form ``self[i:j:k]``, a slice object is\n created, and passed to ``__setitem__()``, instead of\n ``__setslice__()`` being called.\n\nobject.__delslice__(self, i, j)\n\n Called to implement deletion of ``self[i:j]``. Same notes for *i*\n and *j* as for ``__getslice__()``. This method is deprecated. If no\n ``__delslice__()`` is found, or for extended slicing of the form\n ``self[i:j:k]``, a slice object is created, and passed to\n ``__delitem__()``, instead of ``__delslice__()`` being called.\n\nNotice that these methods are only invoked when a single slice with a\nsingle colon is used, and the slice method is available. For slice\noperations involving extended slice notation, or in absence of the\nslice methods, ``__getitem__()``, ``__setitem__()`` or\n``__delitem__()`` is called with a slice object as argument.\n\nThe following example demonstrate how to make your program or module\ncompatible with earlier versions of Python (assuming that methods\n``__getitem__()``, ``__setitem__()`` and ``__delitem__()`` support\nslice objects as arguments):\n\n class MyClass:\n ...\n def __getitem__(self, index):\n ...\n def __setitem__(self, index, value):\n ...\n def __delitem__(self, index):\n ...\n\n if sys.version_info < (2, 0):\n # They won\'t be defined if version is at least 2.0 final\n\n def __getslice__(self, i, j):\n return self[max(0, i):max(0, j):]\n def __setslice__(self, i, j, seq):\n self[max(0, i):max(0, j):] = seq\n def __delslice__(self, i, j):\n del self[max(0, i):max(0, j):]\n ...\n\nNote the calls to ``max()``; these are necessary because of the\nhandling of negative indices before the ``__*slice__()`` methods are\ncalled. When negative indexes are used, the ``__*item__()`` methods\nreceive them as provided, but the ``__*slice__()`` methods get a\n"cooked" form of the index values. For each negative index value, the\nlength of the sequence is added to the index before calling the method\n(which may still result in a negative index); this is the customary\nhandling of negative indexes by the built-in sequence types, and the\n``__*item__()`` methods are expected to do this as well. However,\nsince they should already be doing that, negative indexes cannot be\npassed in; they must be constrained to the bounds of the sequence\nbefore being passed to the ``__*item__()`` methods. Calling ``max(0,\ni)`` conveniently returns the proper value.\n', + 'sequence-types': u"\nEmulating container types\n*************************\n\nThe following methods can be defined to implement container objects.\nContainers usually are sequences (such as lists or tuples) or mappings\n(like dictionaries), but can represent other containers as well. The\nfirst set of methods is used either to emulate a sequence or to\nemulate a mapping; the difference is that for a sequence, the\nallowable keys should be the integers *k* for which ``0 <= k < N``\nwhere *N* is the length of the sequence, or slice objects, which\ndefine a range of items. (For backwards compatibility, the method\n``__getslice__()`` (see below) can also be defined to handle simple,\nbut not extended slices.) It is also recommended that mappings provide\nthe methods ``keys()``, ``values()``, ``items()``, ``has_key()``,\n``get()``, ``clear()``, ``setdefault()``, ``iterkeys()``,\n``itervalues()``, ``iteritems()``, ``pop()``, ``popitem()``,\n``copy()``, and ``update()`` behaving similar to those for Python's\nstandard dictionary objects. The ``UserDict`` module provides a\n``DictMixin`` class to help create those methods from a base set of\n``__getitem__()``, ``__setitem__()``, ``__delitem__()``, and\n``keys()``. Mutable sequences should provide methods ``append()``,\n``count()``, ``index()``, ``extend()``, ``insert()``, ``pop()``,\n``remove()``, ``reverse()`` and ``sort()``, like Python standard list\nobjects. Finally, sequence types should implement addition (meaning\nconcatenation) and multiplication (meaning repetition) by defining the\nmethods ``__add__()``, ``__radd__()``, ``__iadd__()``, ``__mul__()``,\n``__rmul__()`` and ``__imul__()`` described below; they should not\ndefine ``__coerce__()`` or other numerical operators. It is\nrecommended that both mappings and sequences implement the\n``__contains__()`` method to allow efficient use of the ``in``\noperator; for mappings, ``in`` should be equivalent of ``has_key()``;\nfor sequences, it should search through the values. It is further\nrecommended that both mappings and sequences implement the\n``__iter__()`` method to allow efficient iteration through the\ncontainer; for mappings, ``__iter__()`` should be the same as\n``iterkeys()``; for sequences, it should iterate through the values.\n\nobject.__len__(self)\n\n Called to implement the built-in function ``len()``. Should return\n the length of the object, an integer ``>=`` 0. Also, an object\n that doesn't define a ``__nonzero__()`` method and whose\n ``__len__()`` method returns zero is considered to be false in a\n Boolean context.\n\nobject.__getitem__(self, key)\n\n Called to implement evaluation of ``self[key]``. For sequence\n types, the accepted keys should be integers and slice objects.\n Note that the special interpretation of negative indexes (if the\n class wishes to emulate a sequence type) is up to the\n ``__getitem__()`` method. If *key* is of an inappropriate type,\n ``TypeError`` may be raised; if of a value outside the set of\n indexes for the sequence (after any special interpretation of\n negative values), ``IndexError`` should be raised. For mapping\n types, if *key* is missing (not in the container), ``KeyError``\n should be raised.\n\n Note: ``for`` loops expect that an ``IndexError`` will be raised for\n illegal indexes to allow proper detection of the end of the\n sequence.\n\nobject.__setitem__(self, key, value)\n\n Called to implement assignment to ``self[key]``. Same note as for\n ``__getitem__()``. This should only be implemented for mappings if\n the objects support changes to the values for keys, or if new keys\n can be added, or for sequences if elements can be replaced. The\n same exceptions should be raised for improper *key* values as for\n the ``__getitem__()`` method.\n\nobject.__delitem__(self, key)\n\n Called to implement deletion of ``self[key]``. Same note as for\n ``__getitem__()``. This should only be implemented for mappings if\n the objects support removal of keys, or for sequences if elements\n can be removed from the sequence. The same exceptions should be\n raised for improper *key* values as for the ``__getitem__()``\n method.\n\nobject.__iter__(self)\n\n This method is called when an iterator is required for a container.\n This method should return a new iterator object that can iterate\n over all the objects in the container. For mappings, it should\n iterate over the keys of the container, and should also be made\n available as the method ``iterkeys()``.\n\n Iterator objects also need to implement this method; they are\n required to return themselves. For more information on iterator\n objects, see *Iterator Types*.\n\nobject.__reversed__(self)\n\n Called (if present) by the ``reversed()`` builtin to implement\n reverse iteration. It should return a new iterator object that\n iterates over all the objects in the container in reverse order.\n\n If the ``__reversed__()`` method is not provided, the\n ``reversed()`` builtin will fall back to using the sequence\n protocol (``__len__()`` and ``__getitem__()``). Objects should\n normally only provide ``__reversed__()`` if they do not support the\n sequence protocol and an efficient implementation of reverse\n iteration is possible.\n\n New in version 2.6.\n\nThe membership test operators (``in`` and ``not in``) are normally\nimplemented as an iteration through a sequence. However, container\nobjects can supply the following special method with a more efficient\nimplementation, which also does not require the object be a sequence.\n\nobject.__contains__(self, item)\n\n Called to implement membership test operators. Should return true\n if *item* is in *self*, false otherwise. For mapping objects, this\n should consider the keys of the mapping rather than the values or\n the key-item pairs.\n", 'shifting': u'\nShifting operations\n*******************\n\nThe shifting operations have lower priority than the arithmetic\noperations:\n\n shift_expr ::= a_expr | shift_expr ( "<<" | ">>" ) a_expr\n\nThese operators accept plain or long integers as arguments. The\narguments are converted to a common type. They shift the first\nargument to the left or right by the number of bits given by the\nsecond argument.\n\nA right shift by *n* bits is defined as division by ``pow(2, n)``. A\nleft shift by *n* bits is defined as multiplication with ``pow(2,\nn)``. Negative shift counts raise a ``ValueError`` exception.\n', 'slicings': u'\nSlicings\n********\n\nA slicing selects a range of items in a sequence object (e.g., a\nstring, tuple or list). Slicings may be used as expressions or as\ntargets in assignment or ``del`` statements. The syntax for a\nslicing:\n\n slicing ::= simple_slicing | extended_slicing\n simple_slicing ::= primary "[" short_slice "]"\n extended_slicing ::= primary "[" slice_list "]"\n slice_list ::= slice_item ("," slice_item)* [","]\n slice_item ::= expression | proper_slice | ellipsis\n proper_slice ::= short_slice | long_slice\n short_slice ::= [lower_bound] ":" [upper_bound]\n long_slice ::= short_slice ":" [stride]\n lower_bound ::= expression\n upper_bound ::= expression\n stride ::= expression\n ellipsis ::= "..."\n\nThere is ambiguity in the formal syntax here: anything that looks like\nan expression list also looks like a slice list, so any subscription\ncan be interpreted as a slicing. Rather than further complicating the\nsyntax, this is disambiguated by defining that in this case the\ninterpretation as a subscription takes priority over the\ninterpretation as a slicing (this is the case if the slice list\ncontains no proper slice nor ellipses). Similarly, when the slice\nlist has exactly one short slice and no trailing comma, the\ninterpretation as a simple slicing takes priority over that as an\nextended slicing.\n\nThe semantics for a simple slicing are as follows. The primary must\nevaluate to a sequence object. The lower and upper bound expressions,\nif present, must evaluate to plain integers; defaults are zero and the\n``sys.maxint``, respectively. If either bound is negative, the\nsequence\'s length is added to it. The slicing now selects all items\nwith index *k* such that ``i <= k < j`` where *i* and *j* are the\nspecified lower and upper bounds. This may be an empty sequence. It\nis not an error if *i* or *j* lie outside the range of valid indexes\n(such items don\'t exist so they aren\'t selected).\n\nThe semantics for an extended slicing are as follows. The primary\nmust evaluate to a mapping object, and it is indexed with a key that\nis constructed from the slice list, as follows. If the slice list\ncontains at least one comma, the key is a tuple containing the\nconversion of the slice items; otherwise, the conversion of the lone\nslice item is the key. The conversion of a slice item that is an\nexpression is that expression. The conversion of an ellipsis slice\nitem is the built-in ``Ellipsis`` object. The conversion of a proper\nslice is a slice object (see section *The standard type hierarchy*)\nwhose ``start``, ``stop`` and ``step`` attributes are the values of\nthe expressions given as lower bound, upper bound and stride,\nrespectively, substituting ``None`` for missing expressions.\n', - 'specialattrs': u"\nSpecial Attributes\n******************\n\nThe implementation adds a few special read-only attributes to several\nobject types, where they are relevant. Some of these are not reported\nby the ``dir()`` built-in function.\n\nobject.__dict__\n\n A dictionary or other mapping object used to store an object's\n (writable) attributes.\n\nobject.__methods__\n\n Deprecated in version 2.2: Use the built-in function ``dir()`` to\n get a list of an object's attributes. This attribute is no longer\n available.\n\nobject.__members__\n\n Deprecated in version 2.2: Use the built-in function ``dir()`` to\n get a list of an object's attributes. This attribute is no longer\n available.\n\ninstance.__class__\n\n The class to which a class instance belongs.\n\nclass.__bases__\n\n The tuple of base classes of a class object. If there are no base\n classes, this will be an empty tuple.\n\nclass.__name__\n\n The name of the class or type.\n\n-[ Footnotes ]-\n\n[1] Additional information on these special methods may be found in\n the Python Reference Manual (*Basic customization*).\n\n[2] As a consequence, the list ``[1, 2]`` is considered equal to\n ``[1.0, 2.0]``, and similarly for tuples.\n\n[3] They must have since the parser can't tell the type of the\n operands.\n\n[4] To format only a tuple you should therefore provide a singleton\n tuple whose only element is the tuple to be formatted.\n\n[5] These numbers are fairly arbitrary. They are intended to avoid\n printing endless strings of meaningless digits without hampering\n correct use and without having to know the exact precision of\n floating point values on a particular machine.\n\n[6] The advantage of leaving the newline on is that returning an empty\n string is then an unambiguous EOF indication. It is also possible\n (in cases where it might matter, for example, if you want to make\n an exact copy of a file while scanning its lines) to tell whether\n the last line of a file ended in a newline or not (yes this\n happens!).\n", - 'specialnames': u'\nSpecial method names\n********************\n\nA class can implement certain operations that are invoked by special\nsyntax (such as arithmetic operations or subscripting and slicing) by\ndefining methods with special names. This is Python\'s approach to\n*operator overloading*, allowing classes to define their own behavior\nwith respect to language operators. For instance, if a class defines\na method named ``__getitem__()``, and ``x`` is an instance of this\nclass, then ``x[i]`` is equivalent [2] to ``x.__getitem__(i)``.\nExcept where mentioned, attempts to execute an operation raise an\nexception when no appropriate method is defined.\n\nFor new-style classes, special methods are only guaranteed to work if\ndefined in an object\'s class, not in the object\'s instance dictionary.\nThat explains why this won\'t work:\n\n >>> class C:\n ... pass\n ...\n >>> c = C()\n >>> c.__len__ = lambda: 5\n >>> len(c)\n Traceback (most recent call last):\n File "", line 1, in \n TypeError: object of type \'C\' has no len()\n\nWhen implementing a class that emulates any built-in type, it is\nimportant that the emulation only be implemented to the degree that it\nmakes sense for the object being modelled. For example, some\nsequences may work well with retrieval of individual elements, but\nextracting a slice may not make sense. (One example of this is the\n``NodeList`` interface in the W3C\'s Document Object Model.)\n\n\nBasic customization\n===================\n\nobject.__new__(cls[, ...])\n\n Called to create a new instance of class *cls*. ``__new__()`` is a\n static method (special-cased so you need not declare it as such)\n that takes the class of which an instance was requested as its\n first argument. The remaining arguments are those passed to the\n object constructor expression (the call to the class). The return\n value of ``__new__()`` should be the new object instance (usually\n an instance of *cls*).\n\n Typical implementations create a new instance of the class by\n invoking the superclass\'s ``__new__()`` method using\n ``super(currentclass, cls).__new__(cls[, ...])`` with appropriate\n arguments and then modifying the newly-created instance as\n necessary before returning it.\n\n If ``__new__()`` returns an instance of *cls*, then the new\n instance\'s ``__init__()`` method will be invoked like\n ``__init__(self[, ...])``, where *self* is the new instance and the\n remaining arguments are the same as were passed to ``__new__()``.\n\n If ``__new__()`` does not return an instance of *cls*, then the new\n instance\'s ``__init__()`` method will not be invoked.\n\n ``__new__()`` is intended mainly to allow subclasses of immutable\n types (like int, str, or tuple) to customize instance creation. It\n is also commonly overridden in custom metaclasses in order to\n customize class creation.\n\nobject.__init__(self[, ...])\n\n Called when the instance is created. The arguments are those\n passed to the class constructor expression. If a base class has an\n ``__init__()`` method, the derived class\'s ``__init__()`` method,\n if any, must explicitly call it to ensure proper initialization of\n the base class part of the instance; for example:\n ``BaseClass.__init__(self, [args...])``. As a special constraint\n on constructors, no value may be returned; doing so will cause a\n ``TypeError`` to be raised at runtime.\n\nobject.__del__(self)\n\n Called when the instance is about to be destroyed. This is also\n called a destructor. If a base class has a ``__del__()`` method,\n the derived class\'s ``__del__()`` method, if any, must explicitly\n call it to ensure proper deletion of the base class part of the\n instance. Note that it is possible (though not recommended!) for\n the ``__del__()`` method to postpone destruction of the instance by\n creating a new reference to it. It may then be called at a later\n time when this new reference is deleted. It is not guaranteed that\n ``__del__()`` methods are called for objects that still exist when\n the interpreter exits.\n\n Note: ``del x`` doesn\'t directly call ``x.__del__()`` --- the former\n decrements the reference count for ``x`` by one, and the latter\n is only called when ``x``\'s reference count reaches zero. Some\n common situations that may prevent the reference count of an\n object from going to zero include: circular references between\n objects (e.g., a doubly-linked list or a tree data structure with\n parent and child pointers); a reference to the object on the\n stack frame of a function that caught an exception (the traceback\n stored in ``sys.exc_traceback`` keeps the stack frame alive); or\n a reference to the object on the stack frame that raised an\n unhandled exception in interactive mode (the traceback stored in\n ``sys.last_traceback`` keeps the stack frame alive). The first\n situation can only be remedied by explicitly breaking the cycles;\n the latter two situations can be resolved by storing ``None`` in\n ``sys.exc_traceback`` or ``sys.last_traceback``. Circular\n references which are garbage are detected when the option cycle\n detector is enabled (it\'s on by default), but can only be cleaned\n up if there are no Python-level ``__del__()`` methods involved.\n Refer to the documentation for the ``gc`` module for more\n information about how ``__del__()`` methods are handled by the\n cycle detector, particularly the description of the ``garbage``\n value.\n\n Warning: Due to the precarious circumstances under which ``__del__()``\n methods are invoked, exceptions that occur during their execution\n are ignored, and a warning is printed to ``sys.stderr`` instead.\n Also, when ``__del__()`` is invoked in response to a module being\n deleted (e.g., when execution of the program is done), other\n globals referenced by the ``__del__()`` method may already have\n been deleted. For this reason, ``__del__()`` methods should do\n the absolute minimum needed to maintain external invariants.\n Starting with version 1.5, Python guarantees that globals whose\n name begins with a single underscore are deleted from their\n module before other globals are deleted; if no other references\n to such globals exist, this may help in assuring that imported\n modules are still available at the time when the ``__del__()``\n method is called.\n\nobject.__repr__(self)\n\n Called by the ``repr()`` built-in function and by string\n conversions (reverse quotes) to compute the "official" string\n representation of an object. If at all possible, this should look\n like a valid Python expression that could be used to recreate an\n object with the same value (given an appropriate environment). If\n this is not possible, a string of the form ``<...some useful\n description...>`` should be returned. The return value must be a\n string object. If a class defines ``__repr__()`` but not\n ``__str__()``, then ``__repr__()`` is also used when an "informal"\n string representation of instances of that class is required.\n\n This is typically used for debugging, so it is important that the\n representation is information-rich and unambiguous.\n\nobject.__str__(self)\n\n Called by the ``str()`` built-in function and by the ``print``\n statement to compute the "informal" string representation of an\n object. This differs from ``__repr__()`` in that it does not have\n to be a valid Python expression: a more convenient or concise\n representation may be used instead. The return value must be a\n string object.\n\nobject.__lt__(self, other)\nobject.__le__(self, other)\nobject.__eq__(self, other)\nobject.__ne__(self, other)\nobject.__gt__(self, other)\nobject.__ge__(self, other)\n\n Added in version 2.1.\n\n These are the so-called "rich comparison" methods, and are called\n for comparison operators in preference to ``__cmp__()`` below. The\n correspondence between operator symbols and method names is as\n follows: ``xy`` call ``x.__ne__(y)``, ``x>y`` calls ``x.__gt__(y)``, and\n ``x>=y`` calls ``x.__ge__(y)``.\n\n A rich comparison method may return the singleton\n ``NotImplemented`` if it does not implement the operation for a\n given pair of arguments. By convention, ``False`` and ``True`` are\n returned for a successful comparison. However, these methods can\n return any value, so if the comparison operator is used in a\n Boolean context (e.g., in the condition of an ``if`` statement),\n Python will call ``bool()`` on the value to determine if the result\n is true or false.\n\n There are no implied relationships among the comparison operators.\n The truth of ``x==y`` does not imply that ``x!=y`` is false.\n Accordingly, when defining ``__eq__()``, one should also define\n ``__ne__()`` so that the operators will behave as expected. See\n the paragraph on ``__hash__()`` for some important notes on\n creating *hashable* objects which support custom comparison\n operations and are usable as dictionary keys.\n\n There are no swapped-argument versions of these methods (to be used\n when the left argument does not support the operation but the right\n argument does); rather, ``__lt__()`` and ``__gt__()`` are each\n other\'s reflection, ``__le__()`` and ``__ge__()`` are each other\'s\n reflection, and ``__eq__()`` and ``__ne__()`` are their own\n reflection.\n\n Arguments to rich comparison methods are never coerced.\n\nobject.__cmp__(self, other)\n\n Called by comparison operations if rich comparison (see above) is\n not defined. Should return a negative integer if ``self < other``,\n zero if ``self == other``, a positive integer if ``self > other``.\n If no ``__cmp__()``, ``__eq__()`` or ``__ne__()`` operation is\n defined, class instances are compared by object identity\n ("address"). See also the description of ``__hash__()`` for some\n important notes on creating *hashable* objects which support custom\n comparison operations and are usable as dictionary keys. (Note: the\n restriction that exceptions are not propagated by ``__cmp__()`` has\n been removed since Python 1.5.)\n\nobject.__rcmp__(self, other)\n\n Changed in version 2.1: No longer supported.\n\nobject.__hash__(self)\n\n Called for the key object for dictionary operations, and by the\n built-in function ``hash()``. Should return an integer usable as a\n hash value for dictionary operations. The only required property\n is that objects which compare equal have the same hash value; it is\n advised to somehow mix together (e.g., using exclusive or) the hash\n values for the components of the object that also play a part in\n comparison of objects.\n\n If a class does not define a ``__cmp__()`` or ``__eq__()`` method\n it should not define a ``__hash__()`` operation either; if it\n defines ``__cmp__()`` or ``__eq__()`` but not ``__hash__()``, its\n instances will not be usable as dictionary keys. If a class\n defines mutable objects and implements a ``__cmp__()`` or\n ``__eq__()`` method, it should not implement ``__hash__()``, since\n the dictionary implementation requires that a key\'s hash value is\n immutable (if the object\'s hash value changes, it will be in the\n wrong hash bucket).\n\n User-defined classes have ``__cmp__()`` and ``__hash__()`` methods\n by default; with them, all objects compare unequal and\n ``x.__hash__()`` returns ``id(x)``.\n\n Changed in version 2.5: ``__hash__()`` may now also return a long\n integer object; the 32-bit integer is then derived from the hash of\n that object.\n\nobject.__nonzero__(self)\n\n Called to implement truth value testing, and the built-in operation\n ``bool()``; should return ``False`` or ``True``, or their integer\n equivalents ``0`` or ``1``. When this method is not defined,\n ``__len__()`` is called, if it is defined (see below). If a class\n defines neither ``__len__()`` nor ``__nonzero__()``, all its\n instances are considered true.\n\nobject.__unicode__(self)\n\n Called to implement ``unicode()`` builtin; should return a Unicode\n object. When this method is not defined, string conversion is\n attempted, and the result of string conversion is converted to\n Unicode using the system default encoding.\n\n\nCustomizing attribute access\n============================\n\nThe following methods can be defined to customize the meaning of\nattribute access (use of, assignment to, or deletion of ``x.name``)\nfor class instances.\n\nobject.__getattr__(self, name)\n\n Called when an attribute lookup has not found the attribute in the\n usual places (i.e. it is not an instance attribute nor is it found\n in the class tree for ``self``). ``name`` is the attribute name.\n This method should return the (computed) attribute value or raise\n an ``AttributeError`` exception.\n\n Note that if the attribute is found through the normal mechanism,\n ``__getattr__()`` is not called. (This is an intentional asymmetry\n between ``__getattr__()`` and ``__setattr__()``.) This is done both\n for efficiency reasons and because otherwise ``__setattr__()``\n would have no way to access other attributes of the instance. Note\n that at least for instance variables, you can fake total control by\n not inserting any values in the instance attribute dictionary (but\n instead inserting them in another object). See the\n ``__getattribute__()`` method below for a way to actually get total\n control in new-style classes.\n\nobject.__setattr__(self, name, value)\n\n Called when an attribute assignment is attempted. This is called\n instead of the normal mechanism (i.e. store the value in the\n instance dictionary). *name* is the attribute name, *value* is the\n value to be assigned to it.\n\n If ``__setattr__()`` wants to assign to an instance attribute, it\n should not simply execute ``self.name = value`` --- this would\n cause a recursive call to itself. Instead, it should insert the\n value in the dictionary of instance attributes, e.g.,\n ``self.__dict__[name] = value``. For new-style classes, rather\n than accessing the instance dictionary, it should call the base\n class method with the same name, for example,\n ``object.__setattr__(self, name, value)``.\n\nobject.__delattr__(self, name)\n\n Like ``__setattr__()`` but for attribute deletion instead of\n assignment. This should only be implemented if ``del obj.name`` is\n meaningful for the object.\n\n\nMore attribute access for new-style classes\n-------------------------------------------\n\nThe following methods only apply to new-style classes.\n\nobject.__getattribute__(self, name)\n\n Called unconditionally to implement attribute accesses for\n instances of the class. If the class also defines\n ``__getattr__()``, the latter will not be called unless\n ``__getattribute__()`` either calls it explicitly or raises an\n ``AttributeError``. This method should return the (computed)\n attribute value or raise an ``AttributeError`` exception. In order\n to avoid infinite recursion in this method, its implementation\n should always call the base class method with the same name to\n access any attributes it needs, for example,\n ``object.__getattribute__(self, name)``.\n\n\nImplementing Descriptors\n------------------------\n\nThe following methods only apply when an instance of the class\ncontaining the method (a so-called *descriptor* class) appears in the\nclass dictionary of another new-style class, known as the *owner*\nclass. In the examples below, "the attribute" refers to the attribute\nwhose name is the key of the property in the owner class\'\n``__dict__``. Descriptors can only be implemented as new-style\nclasses themselves.\n\nobject.__get__(self, instance, owner)\n\n Called to get the attribute of the owner class (class attribute\n access) or of an instance of that class (instance attribute\n access). *owner* is always the owner class, while *instance* is the\n instance that the attribute was accessed through, or ``None`` when\n the attribute is accessed through the *owner*. This method should\n return the (computed) attribute value or raise an\n ``AttributeError`` exception.\n\nobject.__set__(self, instance, value)\n\n Called to set the attribute on an instance *instance* of the owner\n class to a new value, *value*.\n\nobject.__delete__(self, instance)\n\n Called to delete the attribute on an instance *instance* of the\n owner class.\n\n\nInvoking Descriptors\n--------------------\n\nIn general, a descriptor is an object attribute with "binding\nbehavior", one whose attribute access has been overridden by methods\nin the descriptor protocol: ``__get__()``, ``__set__()``, and\n``__delete__()``. If any of those methods are defined for an object,\nit is said to be a descriptor.\n\nThe default behavior for attribute access is to get, set, or delete\nthe attribute from an object\'s dictionary. For instance, ``a.x`` has a\nlookup chain starting with ``a.__dict__[\'x\']``, then\n``type(a).__dict__[\'x\']``, and continuing through the base classes of\n``type(a)`` excluding metaclasses.\n\nHowever, if the looked-up value is an object defining one of the\ndescriptor methods, then Python may override the default behavior and\ninvoke the descriptor method instead. Where this occurs in the\nprecedence chain depends on which descriptor methods were defined and\nhow they were called. Note that descriptors are only invoked for new\nstyle objects or classes (ones that subclass ``object()`` or\n``type()``).\n\nThe starting point for descriptor invocation is a binding, ``a.x``.\nHow the arguments are assembled depends on ``a``:\n\nDirect Call\n The simplest and least common call is when user code directly\n invokes a descriptor method: ``x.__get__(a)``.\n\nInstance Binding\n If binding to a new-style object instance, ``a.x`` is transformed\n into the call: ``type(a).__dict__[\'x\'].__get__(a, type(a))``.\n\nClass Binding\n If binding to a new-style class, ``A.x`` is transformed into the\n call: ``A.__dict__[\'x\'].__get__(None, A)``.\n\nSuper Binding\n If ``a`` is an instance of ``super``, then the binding ``super(B,\n obj).m()`` searches ``obj.__class__.__mro__`` for the base class\n ``A`` immediately preceding ``B`` and then invokes the descriptor\n with the call: ``A.__dict__[\'m\'].__get__(obj, A)``.\n\nFor instance bindings, the precedence of descriptor invocation depends\non the which descriptor methods are defined. Normally, data\ndescriptors define both ``__get__()`` and ``__set__()``, while non-\ndata descriptors have just the ``__get__()`` method. Data descriptors\nalways override a redefinition in an instance dictionary. In\ncontrast, non-data descriptors can be overridden by instances. [3]\n\nPython methods (including ``staticmethod()`` and ``classmethod()``)\nare implemented as non-data descriptors. Accordingly, instances can\nredefine and override methods. This allows individual instances to\nacquire behaviors that differ from other instances of the same class.\n\nThe ``property()`` function is implemented as a data descriptor.\nAccordingly, instances cannot override the behavior of a property.\n\n\n__slots__\n---------\n\nBy default, instances of both old and new-style classes have a\ndictionary for attribute storage. This wastes space for objects\nhaving very few instance variables. The space consumption can become\nacute when creating large numbers of instances.\n\nThe default can be overridden by defining *__slots__* in a new-style\nclass definition. The *__slots__* declaration takes a sequence of\ninstance variables and reserves just enough space in each instance to\nhold a value for each variable. Space is saved because *__dict__* is\nnot created for each instance.\n\n__slots__\n\n This class variable can be assigned a string, iterable, or sequence\n of strings with variable names used by instances. If defined in a\n new-style class, *__slots__* reserves space for the declared\n variables and prevents the automatic creation of *__dict__* and\n *__weakref__* for each instance.\n\n Added in version 2.2.\n\nNotes on using *__slots__*\n\n* Without a *__dict__* variable, instances cannot be assigned new\n variables not listed in the *__slots__* definition. Attempts to\n assign to an unlisted variable name raises ``AttributeError``. If\n dynamic assignment of new variables is desired, then add\n ``\'__dict__\'`` to the sequence of strings in the *__slots__*\n declaration.\n\n Changed in version 2.3: Previously, adding ``\'__dict__\'`` to the\n *__slots__* declaration would not enable the assignment of new\n attributes not specifically listed in the sequence of instance\n variable names.\n\n* Without a *__weakref__* variable for each instance, classes defining\n *__slots__* do not support weak references to its instances. If weak\n reference support is needed, then add ``\'__weakref__\'`` to the\n sequence of strings in the *__slots__* declaration.\n\n Changed in version 2.3: Previously, adding ``\'__weakref__\'`` to the\n *__slots__* declaration would not enable support for weak\n references.\n\n* *__slots__* are implemented at the class level by creating\n descriptors (*Implementing Descriptors*) for each variable name. As\n a result, class attributes cannot be used to set default values for\n instance variables defined by *__slots__*; otherwise, the class\n attribute would overwrite the descriptor assignment.\n\n* If a class defines a slot also defined in a base class, the instance\n variable defined by the base class slot is inaccessible (except by\n retrieving its descriptor directly from the base class). This\n renders the meaning of the program undefined. In the future, a\n check may be added to prevent this.\n\n* The action of a *__slots__* declaration is limited to the class\n where it is defined. As a result, subclasses will have a *__dict__*\n unless they also define *__slots__*.\n\n* *__slots__* do not work for classes derived from "variable-length"\n built-in types such as ``long``, ``str`` and ``tuple``.\n\n* Any non-string iterable may be assigned to *__slots__*. Mappings may\n also be used; however, in the future, special meaning may be\n assigned to the values corresponding to each key.\n\n* *__class__* assignment works only if both classes have the same\n *__slots__*.\n\n Changed in version 2.6: Previously, *__class__* assignment raised an\n error if either new or old class had *__slots__*.\n\n\nCustomizing class creation\n==========================\n\nBy default, new-style classes are constructed using ``type()``. A\nclass definition is read into a separate namespace and the value of\nclass name is bound to the result of ``type(name, bases, dict)``.\n\nWhen the class definition is read, if *__metaclass__* is defined then\nthe callable assigned to it will be called instead of ``type()``. This\nallows classes or functions to be written which monitor or alter the\nclass creation process:\n\n* Modifying the class dictionary prior to the class being created.\n\n* Returning an instance of another class -- essentially performing the\n role of a factory function.\n\nThese steps will have to be performed in the metaclass\'s ``__new__()``\nmethod -- ``type.__new__()`` can then be called from this method to\ncreate a class with different properties. This example adds a new\nelement to the class dictionary before creating the class:\n\n class metacls(type):\n def __new__(mcs, name, bases, dict):\n dict[\'foo\'] = \'metacls was here\'\n return type.__new__(mcs, name, bases, dict)\n\nYou can of course also override other class methods (or add new\nmethods); for example defining a custom ``__call__()`` method in the\nmetaclass allows custom behavior when the class is called, e.g. not\nalways creating a new instance.\n\n__metaclass__\n\n This variable can be any callable accepting arguments for ``name``,\n ``bases``, and ``dict``. Upon class creation, the callable is used\n instead of the built-in ``type()``.\n\n Added in version 2.2.\n\nThe appropriate metaclass is determined by the following precedence\nrules:\n\n* If ``dict[\'__metaclass__\']`` exists, it is used.\n\n* Otherwise, if there is at least one base class, its metaclass is\n used (this looks for a *__class__* attribute first and if not found,\n uses its type).\n\n* Otherwise, if a global variable named __metaclass__ exists, it is\n used.\n\n* Otherwise, the old-style, classic metaclass (types.ClassType) is\n used.\n\nThe potential uses for metaclasses are boundless. Some ideas that have\nbeen explored including logging, interface checking, automatic\ndelegation, automatic property creation, proxies, frameworks, and\nautomatic resource locking/synchronization.\n\n\nEmulating callable objects\n==========================\n\nobject.__call__(self[, args...])\n\n Called when the instance is "called" as a function; if this method\n is defined, ``x(arg1, arg2, ...)`` is a shorthand for\n ``x.__call__(arg1, arg2, ...)``.\n\n\nEmulating container types\n=========================\n\nThe following methods can be defined to implement container objects.\nContainers usually are sequences (such as lists or tuples) or mappings\n(like dictionaries), but can represent other containers as well. The\nfirst set of methods is used either to emulate a sequence or to\nemulate a mapping; the difference is that for a sequence, the\nallowable keys should be the integers *k* for which ``0 <= k < N``\nwhere *N* is the length of the sequence, or slice objects, which\ndefine a range of items. (For backwards compatibility, the method\n``__getslice__()`` (see below) can also be defined to handle simple,\nbut not extended slices.) It is also recommended that mappings provide\nthe methods ``keys()``, ``values()``, ``items()``, ``has_key()``,\n``get()``, ``clear()``, ``setdefault()``, ``iterkeys()``,\n``itervalues()``, ``iteritems()``, ``pop()``, ``popitem()``,\n``copy()``, and ``update()`` behaving similar to those for Python\'s\nstandard dictionary objects. The ``UserDict`` module provides a\n``DictMixin`` class to help create those methods from a base set of\n``__getitem__()``, ``__setitem__()``, ``__delitem__()``, and\n``keys()``. Mutable sequences should provide methods ``append()``,\n``count()``, ``index()``, ``extend()``, ``insert()``, ``pop()``,\n``remove()``, ``reverse()`` and ``sort()``, like Python standard list\nobjects. Finally, sequence types should implement addition (meaning\nconcatenation) and multiplication (meaning repetition) by defining the\nmethods ``__add__()``, ``__radd__()``, ``__iadd__()``, ``__mul__()``,\n``__rmul__()`` and ``__imul__()`` described below; they should not\ndefine ``__coerce__()`` or other numerical operators. It is\nrecommended that both mappings and sequences implement the\n``__contains__()`` method to allow efficient use of the ``in``\noperator; for mappings, ``in`` should be equivalent of ``has_key()``;\nfor sequences, it should search through the values. It is further\nrecommended that both mappings and sequences implement the\n``__iter__()`` method to allow efficient iteration through the\ncontainer; for mappings, ``__iter__()`` should be the same as\n``iterkeys()``; for sequences, it should iterate through the values.\n\nobject.__len__(self)\n\n Called to implement the built-in function ``len()``. Should return\n the length of the object, an integer ``>=`` 0. Also, an object\n that doesn\'t define a ``__nonzero__()`` method and whose\n ``__len__()`` method returns zero is considered to be false in a\n Boolean context.\n\nobject.__getitem__(self, key)\n\n Called to implement evaluation of ``self[key]``. For sequence\n types, the accepted keys should be integers and slice objects.\n Note that the special interpretation of negative indexes (if the\n class wishes to emulate a sequence type) is up to the\n ``__getitem__()`` method. If *key* is of an inappropriate type,\n ``TypeError`` may be raised; if of a value outside the set of\n indexes for the sequence (after any special interpretation of\n negative values), ``IndexError`` should be raised. For mapping\n types, if *key* is missing (not in the container), ``KeyError``\n should be raised.\n\n Note: ``for`` loops expect that an ``IndexError`` will be raised for\n illegal indexes to allow proper detection of the end of the\n sequence.\n\nobject.__setitem__(self, key, value)\n\n Called to implement assignment to ``self[key]``. Same note as for\n ``__getitem__()``. This should only be implemented for mappings if\n the objects support changes to the values for keys, or if new keys\n can be added, or for sequences if elements can be replaced. The\n same exceptions should be raised for improper *key* values as for\n the ``__getitem__()`` method.\n\nobject.__delitem__(self, key)\n\n Called to implement deletion of ``self[key]``. Same note as for\n ``__getitem__()``. This should only be implemented for mappings if\n the objects support removal of keys, or for sequences if elements\n can be removed from the sequence. The same exceptions should be\n raised for improper *key* values as for the ``__getitem__()``\n method.\n\nobject.__iter__(self)\n\n This method is called when an iterator is required for a container.\n This method should return a new iterator object that can iterate\n over all the objects in the container. For mappings, it should\n iterate over the keys of the container, and should also be made\n available as the method ``iterkeys()``.\n\n Iterator objects also need to implement this method; they are\n required to return themselves. For more information on iterator\n objects, see *Iterator Types*.\n\nobject.__reversed__(self)\n\n Called (if present) by the ``reversed()`` builtin to implement\n reverse iteration. It should return a new iterator object that\n iterates over all the objects in the container in reverse order.\n\n If the ``__reversed__()`` method is not provided, the\n ``reversed()`` builtin will fall back to using the sequence\n protocol (``__len__()`` and ``__getitem__()``). Objects should\n normally only provide ``__reversed__()`` if they do not support the\n sequence protocol and an efficient implementation of reverse\n iteration is possible.\n\n Added in version 2.6.\n\nThe membership test operators (``in`` and ``not in``) are normally\nimplemented as an iteration through a sequence. However, container\nobjects can supply the following special method with a more efficient\nimplementation, which also does not require the object be a sequence.\n\nobject.__contains__(self, item)\n\n Called to implement membership test operators. Should return true\n if *item* is in *self*, false otherwise. For mapping objects, this\n should consider the keys of the mapping rather than the values or\n the key-item pairs.\n\n\nAdditional methods for emulation of sequence types\n==================================================\n\nThe following optional methods can be defined to further emulate\nsequence objects. Immutable sequences methods should at most only\ndefine ``__getslice__()``; mutable sequences might define all three\nmethods.\n\nobject.__getslice__(self, i, j)\n\n Deprecated in version 2.0: Support slice objects as parameters to\n the ``__getitem__()`` method. (However, built-in types in CPython\n currently still implement ``__getslice__()``. Therefore, you have\n to override it in derived classes when implementing slicing.)\n\n Called to implement evaluation of ``self[i:j]``. The returned\n object should be of the same type as *self*. Note that missing *i*\n or *j* in the slice expression are replaced by zero or\n ``sys.maxint``, respectively. If negative indexes are used in the\n slice, the length of the sequence is added to that index. If the\n instance does not implement the ``__len__()`` method, an\n ``AttributeError`` is raised. No guarantee is made that indexes\n adjusted this way are not still negative. Indexes which are\n greater than the length of the sequence are not modified. If no\n ``__getslice__()`` is found, a slice object is created instead, and\n passed to ``__getitem__()`` instead.\n\nobject.__setslice__(self, i, j, sequence)\n\n Called to implement assignment to ``self[i:j]``. Same notes for *i*\n and *j* as for ``__getslice__()``.\n\n This method is deprecated. If no ``__setslice__()`` is found, or\n for extended slicing of the form ``self[i:j:k]``, a slice object is\n created, and passed to ``__setitem__()``, instead of\n ``__setslice__()`` being called.\n\nobject.__delslice__(self, i, j)\n\n Called to implement deletion of ``self[i:j]``. Same notes for *i*\n and *j* as for ``__getslice__()``. This method is deprecated. If no\n ``__delslice__()`` is found, or for extended slicing of the form\n ``self[i:j:k]``, a slice object is created, and passed to\n ``__delitem__()``, instead of ``__delslice__()`` being called.\n\nNotice that these methods are only invoked when a single slice with a\nsingle colon is used, and the slice method is available. For slice\noperations involving extended slice notation, or in absence of the\nslice methods, ``__getitem__()``, ``__setitem__()`` or\n``__delitem__()`` is called with a slice object as argument.\n\nThe following example demonstrate how to make your program or module\ncompatible with earlier versions of Python (assuming that methods\n``__getitem__()``, ``__setitem__()`` and ``__delitem__()`` support\nslice objects as arguments):\n\n class MyClass:\n ...\n def __getitem__(self, index):\n ...\n def __setitem__(self, index, value):\n ...\n def __delitem__(self, index):\n ...\n\n if sys.version_info < (2, 0):\n # They won\'t be defined if version is at least 2.0 final\n\n def __getslice__(self, i, j):\n return self[max(0, i):max(0, j):]\n def __setslice__(self, i, j, seq):\n self[max(0, i):max(0, j):] = seq\n def __delslice__(self, i, j):\n del self[max(0, i):max(0, j):]\n ...\n\nNote the calls to ``max()``; these are necessary because of the\nhandling of negative indices before the ``__*slice__()`` methods are\ncalled. When negative indexes are used, the ``__*item__()`` methods\nreceive them as provided, but the ``__*slice__()`` methods get a\n"cooked" form of the index values. For each negative index value, the\nlength of the sequence is added to the index before calling the method\n(which may still result in a negative index); this is the customary\nhandling of negative indexes by the built-in sequence types, and the\n``__*item__()`` methods are expected to do this as well. However,\nsince they should already be doing that, negative indexes cannot be\npassed in; they must be constrained to the bounds of the sequence\nbefore being passed to the ``__*item__()`` methods. Calling ``max(0,\ni)`` conveniently returns the proper value.\n\n\nEmulating numeric types\n=======================\n\nThe following methods can be defined to emulate numeric objects.\nMethods corresponding to operations that are not supported by the\nparticular kind of number implemented (e.g., bitwise operations for\nnon-integral numbers) should be left undefined.\n\nobject.__add__(self, other)\nobject.__sub__(self, other)\nobject.__mul__(self, other)\nobject.__floordiv__(self, other)\nobject.__mod__(self, other)\nobject.__divmod__(self, other)\nobject.__pow__(self, other[, modulo])\nobject.__lshift__(self, other)\nobject.__rshift__(self, other)\nobject.__and__(self, other)\nobject.__xor__(self, other)\nobject.__or__(self, other)\n\n These methods are called to implement the binary arithmetic\n operations (``+``, ``-``, ``*``, ``//``, ``%``, ``divmod()``,\n ``pow()``, ``**``, ``<<``, ``>>``, ``&``, ``^``, ``|``). For\n instance, to evaluate the expression *x*``+``*y*, where *x* is an\n instance of a class that has an ``__add__()`` method,\n ``x.__add__(y)`` is called. The ``__divmod__()`` method should be\n the equivalent to using ``__floordiv__()`` and ``__mod__()``; it\n should not be related to ``__truediv__()`` (described below). Note\n that ``__pow__()`` should be defined to accept an optional third\n argument if the ternary version of the built-in ``pow()`` function\n is to be supported.\n\n If one of those methods does not support the operation with the\n supplied arguments, it should return ``NotImplemented``.\n\nobject.__div__(self, other)\nobject.__truediv__(self, other)\n\n The division operator (``/``) is implemented by these methods. The\n ``__truediv__()`` method is used when ``__future__.division`` is in\n effect, otherwise ``__div__()`` is used. If only one of these two\n methods is defined, the object will not support division in the\n alternate context; ``TypeError`` will be raised instead.\n\nobject.__radd__(self, other)\nobject.__rsub__(self, other)\nobject.__rmul__(self, other)\nobject.__rdiv__(self, other)\nobject.__rtruediv__(self, other)\nobject.__rfloordiv__(self, other)\nobject.__rmod__(self, other)\nobject.__rdivmod__(self, other)\nobject.__rpow__(self, other)\nobject.__rlshift__(self, other)\nobject.__rrshift__(self, other)\nobject.__rand__(self, other)\nobject.__rxor__(self, other)\nobject.__ror__(self, other)\n\n These methods are called to implement the binary arithmetic\n operations (``+``, ``-``, ``*``, ``/``, ``%``, ``divmod()``,\n ``pow()``, ``**``, ``<<``, ``>>``, ``&``, ``^``, ``|``) with\n reflected (swapped) operands. These functions are only called if\n the left operand does not support the corresponding operation and\n the operands are of different types. [4] For instance, to evaluate\n the expression *x*``-``*y*, where *y* is an instance of a class\n that has an ``__rsub__()`` method, ``y.__rsub__(x)`` is called if\n ``x.__sub__(y)`` returns *NotImplemented*.\n\n Note that ternary ``pow()`` will not try calling ``__rpow__()``\n (the coercion rules would become too complicated).\n\n Note: If the right operand\'s type is a subclass of the left operand\'s\n type and that subclass provides the reflected method for the\n operation, this method will be called before the left operand\'s\n non-reflected method. This behavior allows subclasses to\n override their ancestors\' operations.\n\nobject.__iadd__(self, other)\nobject.__isub__(self, other)\nobject.__imul__(self, other)\nobject.__idiv__(self, other)\nobject.__itruediv__(self, other)\nobject.__ifloordiv__(self, other)\nobject.__imod__(self, other)\nobject.__ipow__(self, other[, modulo])\nobject.__ilshift__(self, other)\nobject.__irshift__(self, other)\nobject.__iand__(self, other)\nobject.__ixor__(self, other)\nobject.__ior__(self, other)\n\n These methods are called to implement the augmented arithmetic\n operations (``+=``, ``-=``, ``*=``, ``/=``, ``//=``, ``%=``,\n ``**=``, ``<<=``, ``>>=``, ``&=``, ``^=``, ``|=``). These methods\n should attempt to do the operation in-place (modifying *self*) and\n return the result (which could be, but does not have to be,\n *self*). If a specific method is not defined, the augmented\n operation falls back to the normal methods. For instance, to\n evaluate the expression *x*``+=``*y*, where *x* is an instance of a\n class that has an ``__iadd__()`` method, ``x.__iadd__(y)`` is\n called. If *x* is an instance of a class that does not define a\n ``__iadd__()`` method, ``x.__add__(y)`` and ``y.__radd__(x)`` are\n considered, as with the evaluation of *x*``+``*y*.\n\nobject.__neg__(self)\nobject.__pos__(self)\nobject.__abs__(self)\nobject.__invert__(self)\n\n Called to implement the unary arithmetic operations (``-``, ``+``,\n ``abs()`` and ``~``).\n\nobject.__complex__(self)\nobject.__int__(self)\nobject.__long__(self)\nobject.__float__(self)\n\n Called to implement the built-in functions ``complex()``,\n ``int()``, ``long()``, and ``float()``. Should return a value of\n the appropriate type.\n\nobject.__oct__(self)\nobject.__hex__(self)\n\n Called to implement the built-in functions ``oct()`` and ``hex()``.\n Should return a string value.\n\nobject.__index__(self)\n\n Called to implement ``operator.index()``. Also called whenever\n Python needs an integer object (such as in slicing). Must return\n an integer (int or long).\n\n Added in version 2.5.\n\nobject.__coerce__(self, other)\n\n Called to implement "mixed-mode" numeric arithmetic. Should either\n return a 2-tuple containing *self* and *other* converted to a\n common numeric type, or ``None`` if conversion is impossible. When\n the common type would be the type of ``other``, it is sufficient to\n return ``None``, since the interpreter will also ask the other\n object to attempt a coercion (but sometimes, if the implementation\n of the other type cannot be changed, it is useful to do the\n conversion to the other type here). A return value of\n ``NotImplemented`` is equivalent to returning ``None``.\n\n\nCoercion rules\n==============\n\nThis section used to document the rules for coercion. As the language\nhas evolved, the coercion rules have become hard to document\nprecisely; documenting what one version of one particular\nimplementation does is undesirable. Instead, here are some informal\nguidelines regarding coercion. In Python 3.0, coercion will not be\nsupported.\n\n* If the left operand of a % operator is a string or Unicode object,\n no coercion takes place and the string formatting operation is\n invoked instead.\n\n* It is no longer recommended to define a coercion operation. Mixed-\n mode operations on types that don\'t define coercion pass the\n original arguments to the operation.\n\n* New-style classes (those derived from ``object``) never invoke the\n ``__coerce__()`` method in response to a binary operator; the only\n time ``__coerce__()`` is invoked is when the built-in function\n ``coerce()`` is called.\n\n* For most intents and purposes, an operator that returns\n ``NotImplemented`` is treated the same as one that is not\n implemented at all.\n\n* Below, ``__op__()`` and ``__rop__()`` are used to signify the\n generic method names corresponding to an operator; ``__iop__()`` is\n used for the corresponding in-place operator. For example, for the\n operator \'``+``\', ``__add__()`` and ``__radd__()`` are used for the\n left and right variant of the binary operator, and ``__iadd__()``\n for the in-place variant.\n\n* For objects *x* and *y*, first ``x.__op__(y)`` is tried. If this is\n not implemented or returns ``NotImplemented``, ``y.__rop__(x)`` is\n tried. If this is also not implemented or returns\n ``NotImplemented``, a ``TypeError`` exception is raised. But see\n the following exception:\n\n* Exception to the previous item: if the left operand is an instance\n of a built-in type or a new-style class, and the right operand is an\n instance of a proper subclass of that type or class and overrides\n the base\'s ``__rop__()`` method, the right operand\'s ``__rop__()``\n method is tried *before* the left operand\'s ``__op__()`` method.\n\n This is done so that a subclass can completely override binary\n operators. Otherwise, the left operand\'s ``__op__()`` method would\n always accept the right operand: when an instance of a given class\n is expected, an instance of a subclass of that class is always\n acceptable.\n\n* When either operand type defines a coercion, this coercion is called\n before that type\'s ``__op__()`` or ``__rop__()`` method is called,\n but no sooner. If the coercion returns an object of a different\n type for the operand whose coercion is invoked, part of the process\n is redone using the new object.\n\n* When an in-place operator (like \'``+=``\') is used, if the left\n operand implements ``__iop__()``, it is invoked without any\n coercion. When the operation falls back to ``__op__()`` and/or\n ``__rop__()``, the normal coercion rules apply.\n\n* In *x*``+``*y*, if *x* is a sequence that implements sequence\n concatenation, sequence concatenation is invoked.\n\n* In *x*``*``*y*, if one operator is a sequence that implements\n sequence repetition, and the other is an integer (``int`` or\n ``long``), sequence repetition is invoked.\n\n* Rich comparisons (implemented by methods ``__eq__()`` and so on)\n never use coercion. Three-way comparison (implemented by\n ``__cmp__()``) does use coercion under the same conditions as other\n binary operations use it.\n\n* In the current implementation, the built-in numeric types ``int``,\n ``long`` and ``float`` do not use coercion; the type ``complex``\n however does use it. The difference can become apparent when\n subclassing these types. Over time, the type ``complex`` may be\n fixed to avoid coercion. All these types implement a\n ``__coerce__()`` method, for use by the built-in ``coerce()``\n function.\n\n\nWith Statement Context Managers\n===============================\n\nAdded in version 2.5.\n\nA *context manager* is an object that defines the runtime context to\nbe established when executing a ``with`` statement. The context\nmanager handles the entry into, and the exit from, the desired runtime\ncontext for the execution of the block of code. Context managers are\nnormally invoked using the ``with`` statement (described in section\n*The with statement*), but can also be used by directly invoking their\nmethods.\n\nTypical uses of context managers include saving and restoring various\nkinds of global state, locking and unlocking resources, closing opened\nfiles, etc.\n\nFor more information on context managers, see *Context Manager Types*.\n\nobject.__enter__(self)\n\n Enter the runtime context related to this object. The ``with``\n statement will bind this method\'s return value to the target(s)\n specified in the ``as`` clause of the statement, if any.\n\nobject.__exit__(self, exc_type, exc_value, traceback)\n\n Exit the runtime context related to this object. The parameters\n describe the exception that caused the context to be exited. If the\n context was exited without an exception, all three arguments will\n be ``None``.\n\n If an exception is supplied, and the method wishes to suppress the\n exception (i.e., prevent it from being propagated), it should\n return a true value. Otherwise, the exception will be processed\n normally upon exit from this method.\n\n Note that ``__exit__()`` methods should not reraise the passed-in\n exception; this is the caller\'s responsibility.\n\nSee also:\n\n **PEP 0343** - The "with" statement\n The specification, background, and examples for the Python\n ``with`` statement.\n\n-[ Footnotes ]-\n\n[1] Since Python 2.2, a gradual merging of types and classes has been\n started that makes this and a few other assertions made in this\n manual not 100% accurate and complete: for example, it *is* now\n possible in some cases to change an object\'s type, under certain\n controlled conditions. Until this manual undergoes extensive\n revision, it must now be taken as authoritative only regarding\n "classic classes", that are still the default, for compatibility\n purposes, in Python 2.2 and 2.3. For more information, see\n http://www.python.org/doc/newstyle/.\n\n[2] This, and other statements, are only roughly true for instances of\n new-style classes.\n\n[3] A descriptor can define any combination of ``__get__()``,\n ``__set__()`` and ``__delete__()``. If it does not define\n ``__get__()``, then accessing the attribute even on an instance\n will return the descriptor object itself. If the descriptor\n defines ``__set__()`` and/or ``__delete__()``, it is a data\n descriptor; if it defines neither, it is a non-data descriptor.\n\n[4] For operands of the same type, it is assumed that if the non-\n reflected method (such as ``__add__()``) fails the operation is\n not supported, which is why the reflected method is not called.\n', + 'specialattrs': u"\nSpecial Attributes\n******************\n\nThe implementation adds a few special read-only attributes to several\nobject types, where they are relevant. Some of these are not reported\nby the ``dir()`` built-in function.\n\nobject.__dict__\n\n A dictionary or other mapping object used to store an object's\n (writable) attributes.\n\nobject.__methods__\n\n Deprecated since version 2.2: Use the built-in function ``dir()``\n to get a list of an object's attributes. This attribute is no\n longer available.\n\nobject.__members__\n\n Deprecated since version 2.2: Use the built-in function ``dir()``\n to get a list of an object's attributes. This attribute is no\n longer available.\n\ninstance.__class__\n\n The class to which a class instance belongs.\n\nclass.__bases__\n\n The tuple of base classes of a class object. If there are no base\n classes, this will be an empty tuple.\n\nclass.__name__\n\n The name of the class or type.\n\n-[ Footnotes ]-\n\n[1] Additional information on these special methods may be found in\n the Python Reference Manual (*Basic customization*).\n\n[2] As a consequence, the list ``[1, 2]`` is considered equal to\n ``[1.0, 2.0]``, and similarly for tuples.\n\n[3] They must have since the parser can't tell the type of the\n operands.\n\n[4] To format only a tuple you should therefore provide a singleton\n tuple whose only element is the tuple to be formatted.\n\n[5] These numbers are fairly arbitrary. They are intended to avoid\n printing endless strings of meaningless digits without hampering\n correct use and without having to know the exact precision of\n floating point values on a particular machine.\n\n[6] The advantage of leaving the newline on is that returning an empty\n string is then an unambiguous EOF indication. It is also possible\n (in cases where it might matter, for example, if you want to make\n an exact copy of a file while scanning its lines) to tell whether\n the last line of a file ended in a newline or not (yes this\n happens!).\n", + 'specialnames': u'\nSpecial method names\n********************\n\nA class can implement certain operations that are invoked by special\nsyntax (such as arithmetic operations or subscripting and slicing) by\ndefining methods with special names. This is Python\'s approach to\n*operator overloading*, allowing classes to define their own behavior\nwith respect to language operators. For instance, if a class defines\na method named ``__getitem__()``, and ``x`` is an instance of this\nclass, then ``x[i]`` is roughly equivalent to ``x.__getitem__(i)`` for\nold-style classes and ``type(x).__getitem__(x, i)`` for new-style\nclasses. Except where mentioned, attempts to execute an operation\nraise an exception when no appropriate method is defined (typically\n``AttributeError`` or ``TypeError``).\n\nWhen implementing a class that emulates any built-in type, it is\nimportant that the emulation only be implemented to the degree that it\nmakes sense for the object being modelled. For example, some\nsequences may work well with retrieval of individual elements, but\nextracting a slice may not make sense. (One example of this is the\n``NodeList`` interface in the W3C\'s Document Object Model.)\n\n\nBasic customization\n===================\n\nobject.__new__(cls[, ...])\n\n Called to create a new instance of class *cls*. ``__new__()`` is a\n static method (special-cased so you need not declare it as such)\n that takes the class of which an instance was requested as its\n first argument. The remaining arguments are those passed to the\n object constructor expression (the call to the class). The return\n value of ``__new__()`` should be the new object instance (usually\n an instance of *cls*).\n\n Typical implementations create a new instance of the class by\n invoking the superclass\'s ``__new__()`` method using\n ``super(currentclass, cls).__new__(cls[, ...])`` with appropriate\n arguments and then modifying the newly-created instance as\n necessary before returning it.\n\n If ``__new__()`` returns an instance of *cls*, then the new\n instance\'s ``__init__()`` method will be invoked like\n ``__init__(self[, ...])``, where *self* is the new instance and the\n remaining arguments are the same as were passed to ``__new__()``.\n\n If ``__new__()`` does not return an instance of *cls*, then the new\n instance\'s ``__init__()`` method will not be invoked.\n\n ``__new__()`` is intended mainly to allow subclasses of immutable\n types (like int, str, or tuple) to customize instance creation. It\n is also commonly overridden in custom metaclasses in order to\n customize class creation.\n\nobject.__init__(self[, ...])\n\n Called when the instance is created. The arguments are those\n passed to the class constructor expression. If a base class has an\n ``__init__()`` method, the derived class\'s ``__init__()`` method,\n if any, must explicitly call it to ensure proper initialization of\n the base class part of the instance; for example:\n ``BaseClass.__init__(self, [args...])``. As a special constraint\n on constructors, no value may be returned; doing so will cause a\n ``TypeError`` to be raised at runtime.\n\nobject.__del__(self)\n\n Called when the instance is about to be destroyed. This is also\n called a destructor. If a base class has a ``__del__()`` method,\n the derived class\'s ``__del__()`` method, if any, must explicitly\n call it to ensure proper deletion of the base class part of the\n instance. Note that it is possible (though not recommended!) for\n the ``__del__()`` method to postpone destruction of the instance by\n creating a new reference to it. It may then be called at a later\n time when this new reference is deleted. It is not guaranteed that\n ``__del__()`` methods are called for objects that still exist when\n the interpreter exits.\n\n Note: ``del x`` doesn\'t directly call ``x.__del__()`` --- the former\n decrements the reference count for ``x`` by one, and the latter\n is only called when ``x``\'s reference count reaches zero. Some\n common situations that may prevent the reference count of an\n object from going to zero include: circular references between\n objects (e.g., a doubly-linked list or a tree data structure with\n parent and child pointers); a reference to the object on the\n stack frame of a function that caught an exception (the traceback\n stored in ``sys.exc_traceback`` keeps the stack frame alive); or\n a reference to the object on the stack frame that raised an\n unhandled exception in interactive mode (the traceback stored in\n ``sys.last_traceback`` keeps the stack frame alive). The first\n situation can only be remedied by explicitly breaking the cycles;\n the latter two situations can be resolved by storing ``None`` in\n ``sys.exc_traceback`` or ``sys.last_traceback``. Circular\n references which are garbage are detected when the option cycle\n detector is enabled (it\'s on by default), but can only be cleaned\n up if there are no Python-level ``__del__()`` methods involved.\n Refer to the documentation for the ``gc`` module for more\n information about how ``__del__()`` methods are handled by the\n cycle detector, particularly the description of the ``garbage``\n value.\n\n Warning: Due to the precarious circumstances under which ``__del__()``\n methods are invoked, exceptions that occur during their execution\n are ignored, and a warning is printed to ``sys.stderr`` instead.\n Also, when ``__del__()`` is invoked in response to a module being\n deleted (e.g., when execution of the program is done), other\n globals referenced by the ``__del__()`` method may already have\n been deleted. For this reason, ``__del__()`` methods should do\n the absolute minimum needed to maintain external invariants.\n Starting with version 1.5, Python guarantees that globals whose\n name begins with a single underscore are deleted from their\n module before other globals are deleted; if no other references\n to such globals exist, this may help in assuring that imported\n modules are still available at the time when the ``__del__()``\n method is called.\n\nobject.__repr__(self)\n\n Called by the ``repr()`` built-in function and by string\n conversions (reverse quotes) to compute the "official" string\n representation of an object. If at all possible, this should look\n like a valid Python expression that could be used to recreate an\n object with the same value (given an appropriate environment). If\n this is not possible, a string of the form ``<...some useful\n description...>`` should be returned. The return value must be a\n string object. If a class defines ``__repr__()`` but not\n ``__str__()``, then ``__repr__()`` is also used when an "informal"\n string representation of instances of that class is required.\n\n This is typically used for debugging, so it is important that the\n representation is information-rich and unambiguous.\n\nobject.__str__(self)\n\n Called by the ``str()`` built-in function and by the ``print``\n statement to compute the "informal" string representation of an\n object. This differs from ``__repr__()`` in that it does not have\n to be a valid Python expression: a more convenient or concise\n representation may be used instead. The return value must be a\n string object.\n\nobject.__lt__(self, other)\nobject.__le__(self, other)\nobject.__eq__(self, other)\nobject.__ne__(self, other)\nobject.__gt__(self, other)\nobject.__ge__(self, other)\n\n New in version 2.1.\n\n These are the so-called "rich comparison" methods, and are called\n for comparison operators in preference to ``__cmp__()`` below. The\n correspondence between operator symbols and method names is as\n follows: ``xy`` call ``x.__ne__(y)``, ``x>y`` calls ``x.__gt__(y)``, and\n ``x>=y`` calls ``x.__ge__(y)``.\n\n A rich comparison method may return the singleton\n ``NotImplemented`` if it does not implement the operation for a\n given pair of arguments. By convention, ``False`` and ``True`` are\n returned for a successful comparison. However, these methods can\n return any value, so if the comparison operator is used in a\n Boolean context (e.g., in the condition of an ``if`` statement),\n Python will call ``bool()`` on the value to determine if the result\n is true or false.\n\n There are no implied relationships among the comparison operators.\n The truth of ``x==y`` does not imply that ``x!=y`` is false.\n Accordingly, when defining ``__eq__()``, one should also define\n ``__ne__()`` so that the operators will behave as expected. See\n the paragraph on ``__hash__()`` for some important notes on\n creating *hashable* objects which support custom comparison\n operations and are usable as dictionary keys.\n\n There are no swapped-argument versions of these methods (to be used\n when the left argument does not support the operation but the right\n argument does); rather, ``__lt__()`` and ``__gt__()`` are each\n other\'s reflection, ``__le__()`` and ``__ge__()`` are each other\'s\n reflection, and ``__eq__()`` and ``__ne__()`` are their own\n reflection.\n\n Arguments to rich comparison methods are never coerced.\n\nobject.__cmp__(self, other)\n\n Called by comparison operations if rich comparison (see above) is\n not defined. Should return a negative integer if ``self < other``,\n zero if ``self == other``, a positive integer if ``self > other``.\n If no ``__cmp__()``, ``__eq__()`` or ``__ne__()`` operation is\n defined, class instances are compared by object identity\n ("address"). See also the description of ``__hash__()`` for some\n important notes on creating *hashable* objects which support custom\n comparison operations and are usable as dictionary keys. (Note: the\n restriction that exceptions are not propagated by ``__cmp__()`` has\n been removed since Python 1.5.)\n\nobject.__rcmp__(self, other)\n\n Changed in version 2.1: No longer supported.\n\nobject.__hash__(self)\n\n Called for the key object for dictionary operations, and by the\n built-in function ``hash()``. Should return an integer usable as a\n hash value for dictionary operations. The only required property\n is that objects which compare equal have the same hash value; it is\n advised to somehow mix together (e.g., using exclusive or) the hash\n values for the components of the object that also play a part in\n comparison of objects.\n\n If a class does not define a ``__cmp__()`` or ``__eq__()`` method\n it should not define a ``__hash__()`` operation either; if it\n defines ``__cmp__()`` or ``__eq__()`` but not ``__hash__()``, its\n instances will not be usable as dictionary keys. If a class\n defines mutable objects and implements a ``__cmp__()`` or\n ``__eq__()`` method, it should not implement ``__hash__()``, since\n the dictionary implementation requires that a key\'s hash value is\n immutable (if the object\'s hash value changes, it will be in the\n wrong hash bucket).\n\n User-defined classes have ``__cmp__()`` and ``__hash__()`` methods\n by default; with them, all objects compare unequal (except with\n themselves) and ``x.__hash__()`` returns ``id(x)``.\n\n Classes which inherit a ``__hash__()`` method from a parent class\n but change the meaning of ``__cmp__()`` or ``__eq__()`` such that\n the hash value returned is no longer appropriate (e.g. by switching\n to a value-based concept of equality instead of the default\n identity based equality) can explicitly flag themselves as being\n unhashable by setting ``__hash__ = None`` in the class definition.\n Doing so means that not only will instances of the class raise an\n appropriate ``TypeError`` when a program attempts to retrieve their\n hash value, but they will also be correctly identified as\n unhashable when checking ``isinstance(obj, collections.Hashable)``\n (unlike classes which define their own ``__hash__()`` to explicitly\n raise ``TypeError``).\n\n Changed in version 2.5: ``__hash__()`` may now also return a long\n integer object; the 32-bit integer is then derived from the hash of\n that object.\n\n Changed in version 2.6: ``__hash__`` may now be set to ``None`` to\n explicitly flag instances of a class as unhashable.\n\nobject.__nonzero__(self)\n\n Called to implement truth value testing, and the built-in operation\n ``bool()``; should return ``False`` or ``True``, or their integer\n equivalents ``0`` or ``1``. When this method is not defined,\n ``__len__()`` is called, if it is defined (see below). If a class\n defines neither ``__len__()`` nor ``__nonzero__()``, all its\n instances are considered true.\n\nobject.__unicode__(self)\n\n Called to implement ``unicode()`` builtin; should return a Unicode\n object. When this method is not defined, string conversion is\n attempted, and the result of string conversion is converted to\n Unicode using the system default encoding.\n\n\nCustomizing attribute access\n============================\n\nThe following methods can be defined to customize the meaning of\nattribute access (use of, assignment to, or deletion of ``x.name``)\nfor class instances.\n\nobject.__getattr__(self, name)\n\n Called when an attribute lookup has not found the attribute in the\n usual places (i.e. it is not an instance attribute nor is it found\n in the class tree for ``self``). ``name`` is the attribute name.\n This method should return the (computed) attribute value or raise\n an ``AttributeError`` exception.\n\n Note that if the attribute is found through the normal mechanism,\n ``__getattr__()`` is not called. (This is an intentional asymmetry\n between ``__getattr__()`` and ``__setattr__()``.) This is done both\n for efficiency reasons and because otherwise ``__getattr__()``\n would have no way to access other attributes of the instance. Note\n that at least for instance variables, you can fake total control by\n not inserting any values in the instance attribute dictionary (but\n instead inserting them in another object). See the\n ``__getattribute__()`` method below for a way to actually get total\n control in new-style classes.\n\nobject.__setattr__(self, name, value)\n\n Called when an attribute assignment is attempted. This is called\n instead of the normal mechanism (i.e. store the value in the\n instance dictionary). *name* is the attribute name, *value* is the\n value to be assigned to it.\n\n If ``__setattr__()`` wants to assign to an instance attribute, it\n should not simply execute ``self.name = value`` --- this would\n cause a recursive call to itself. Instead, it should insert the\n value in the dictionary of instance attributes, e.g.,\n ``self.__dict__[name] = value``. For new-style classes, rather\n than accessing the instance dictionary, it should call the base\n class method with the same name, for example,\n ``object.__setattr__(self, name, value)``.\n\nobject.__delattr__(self, name)\n\n Like ``__setattr__()`` but for attribute deletion instead of\n assignment. This should only be implemented if ``del obj.name`` is\n meaningful for the object.\n\n\nMore attribute access for new-style classes\n-------------------------------------------\n\nThe following methods only apply to new-style classes.\n\nobject.__getattribute__(self, name)\n\n Called unconditionally to implement attribute accesses for\n instances of the class. If the class also defines\n ``__getattr__()``, the latter will not be called unless\n ``__getattribute__()`` either calls it explicitly or raises an\n ``AttributeError``. This method should return the (computed)\n attribute value or raise an ``AttributeError`` exception. In order\n to avoid infinite recursion in this method, its implementation\n should always call the base class method with the same name to\n access any attributes it needs, for example,\n ``object.__getattribute__(self, name)``.\n\n Note: This method may still be bypassed when looking up special methods\n as the result of implicit invocation via language syntax or\n builtin functions. See *Special method lookup for new-style\n classes*.\n\n\nImplementing Descriptors\n------------------------\n\nThe following methods only apply when an instance of the class\ncontaining the method (a so-called *descriptor* class) appears in the\nclass dictionary of another new-style class, known as the *owner*\nclass. In the examples below, "the attribute" refers to the attribute\nwhose name is the key of the property in the owner class\'\n``__dict__``. Descriptors can only be implemented as new-style\nclasses themselves.\n\nobject.__get__(self, instance, owner)\n\n Called to get the attribute of the owner class (class attribute\n access) or of an instance of that class (instance attribute\n access). *owner* is always the owner class, while *instance* is the\n instance that the attribute was accessed through, or ``None`` when\n the attribute is accessed through the *owner*. This method should\n return the (computed) attribute value or raise an\n ``AttributeError`` exception.\n\nobject.__set__(self, instance, value)\n\n Called to set the attribute on an instance *instance* of the owner\n class to a new value, *value*.\n\nobject.__delete__(self, instance)\n\n Called to delete the attribute on an instance *instance* of the\n owner class.\n\n\nInvoking Descriptors\n--------------------\n\nIn general, a descriptor is an object attribute with "binding\nbehavior", one whose attribute access has been overridden by methods\nin the descriptor protocol: ``__get__()``, ``__set__()``, and\n``__delete__()``. If any of those methods are defined for an object,\nit is said to be a descriptor.\n\nThe default behavior for attribute access is to get, set, or delete\nthe attribute from an object\'s dictionary. For instance, ``a.x`` has a\nlookup chain starting with ``a.__dict__[\'x\']``, then\n``type(a).__dict__[\'x\']``, and continuing through the base classes of\n``type(a)`` excluding metaclasses.\n\nHowever, if the looked-up value is an object defining one of the\ndescriptor methods, then Python may override the default behavior and\ninvoke the descriptor method instead. Where this occurs in the\nprecedence chain depends on which descriptor methods were defined and\nhow they were called. Note that descriptors are only invoked for new\nstyle objects or classes (ones that subclass ``object()`` or\n``type()``).\n\nThe starting point for descriptor invocation is a binding, ``a.x``.\nHow the arguments are assembled depends on ``a``:\n\nDirect Call\n The simplest and least common call is when user code directly\n invokes a descriptor method: ``x.__get__(a)``.\n\nInstance Binding\n If binding to a new-style object instance, ``a.x`` is transformed\n into the call: ``type(a).__dict__[\'x\'].__get__(a, type(a))``.\n\nClass Binding\n If binding to a new-style class, ``A.x`` is transformed into the\n call: ``A.__dict__[\'x\'].__get__(None, A)``.\n\nSuper Binding\n If ``a`` is an instance of ``super``, then the binding ``super(B,\n obj).m()`` searches ``obj.__class__.__mro__`` for the base class\n ``A`` immediately preceding ``B`` and then invokes the descriptor\n with the call: ``A.__dict__[\'m\'].__get__(obj, A)``.\n\nFor instance bindings, the precedence of descriptor invocation depends\non the which descriptor methods are defined. Normally, data\ndescriptors define both ``__get__()`` and ``__set__()``, while non-\ndata descriptors have just the ``__get__()`` method. Data descriptors\nalways override a redefinition in an instance dictionary. In\ncontrast, non-data descriptors can be overridden by instances. [2]\n\nPython methods (including ``staticmethod()`` and ``classmethod()``)\nare implemented as non-data descriptors. Accordingly, instances can\nredefine and override methods. This allows individual instances to\nacquire behaviors that differ from other instances of the same class.\n\nThe ``property()`` function is implemented as a data descriptor.\nAccordingly, instances cannot override the behavior of a property.\n\n\n__slots__\n---------\n\nBy default, instances of both old and new-style classes have a\ndictionary for attribute storage. This wastes space for objects\nhaving very few instance variables. The space consumption can become\nacute when creating large numbers of instances.\n\nThe default can be overridden by defining *__slots__* in a new-style\nclass definition. The *__slots__* declaration takes a sequence of\ninstance variables and reserves just enough space in each instance to\nhold a value for each variable. Space is saved because *__dict__* is\nnot created for each instance.\n\n__slots__\n\n This class variable can be assigned a string, iterable, or sequence\n of strings with variable names used by instances. If defined in a\n new-style class, *__slots__* reserves space for the declared\n variables and prevents the automatic creation of *__dict__* and\n *__weakref__* for each instance.\n\n New in version 2.2.\n\nNotes on using *__slots__*\n\n* When inheriting from a class without *__slots__*, the *__dict__*\n attribute of that class will always be accessible, so a *__slots__*\n definition in the subclass is meaningless.\n\n* Without a *__dict__* variable, instances cannot be assigned new\n variables not listed in the *__slots__* definition. Attempts to\n assign to an unlisted variable name raises ``AttributeError``. If\n dynamic assignment of new variables is desired, then add\n ``\'__dict__\'`` to the sequence of strings in the *__slots__*\n declaration.\n\n Changed in version 2.3: Previously, adding ``\'__dict__\'`` to the\n *__slots__* declaration would not enable the assignment of new\n attributes not specifically listed in the sequence of instance\n variable names.\n\n* Without a *__weakref__* variable for each instance, classes defining\n *__slots__* do not support weak references to its instances. If weak\n reference support is needed, then add ``\'__weakref__\'`` to the\n sequence of strings in the *__slots__* declaration.\n\n Changed in version 2.3: Previously, adding ``\'__weakref__\'`` to the\n *__slots__* declaration would not enable support for weak\n references.\n\n* *__slots__* are implemented at the class level by creating\n descriptors (*Implementing Descriptors*) for each variable name. As\n a result, class attributes cannot be used to set default values for\n instance variables defined by *__slots__*; otherwise, the class\n attribute would overwrite the descriptor assignment.\n\n* If a class defines a slot also defined in a base class, the instance\n variable defined by the base class slot is inaccessible (except by\n retrieving its descriptor directly from the base class). This\n renders the meaning of the program undefined. In the future, a\n check may be added to prevent this.\n\n* The action of a *__slots__* declaration is limited to the class\n where it is defined. As a result, subclasses will have a *__dict__*\n unless they also define *__slots__*.\n\n* *__slots__* do not work for classes derived from "variable-length"\n built-in types such as ``long``, ``str`` and ``tuple``.\n\n* Any non-string iterable may be assigned to *__slots__*. Mappings may\n also be used; however, in the future, special meaning may be\n assigned to the values corresponding to each key.\n\n* *__class__* assignment works only if both classes have the same\n *__slots__*.\n\n Changed in version 2.6: Previously, *__class__* assignment raised an\n error if either new or old class had *__slots__*.\n\n\nCustomizing class creation\n==========================\n\nBy default, new-style classes are constructed using ``type()``. A\nclass definition is read into a separate namespace and the value of\nclass name is bound to the result of ``type(name, bases, dict)``.\n\nWhen the class definition is read, if *__metaclass__* is defined then\nthe callable assigned to it will be called instead of ``type()``. This\nallows classes or functions to be written which monitor or alter the\nclass creation process:\n\n* Modifying the class dictionary prior to the class being created.\n\n* Returning an instance of another class -- essentially performing the\n role of a factory function.\n\nThese steps will have to be performed in the metaclass\'s ``__new__()``\nmethod -- ``type.__new__()`` can then be called from this method to\ncreate a class with different properties. This example adds a new\nelement to the class dictionary before creating the class:\n\n class metacls(type):\n def __new__(mcs, name, bases, dict):\n dict[\'foo\'] = \'metacls was here\'\n return type.__new__(mcs, name, bases, dict)\n\nYou can of course also override other class methods (or add new\nmethods); for example defining a custom ``__call__()`` method in the\nmetaclass allows custom behavior when the class is called, e.g. not\nalways creating a new instance.\n\n__metaclass__\n\n This variable can be any callable accepting arguments for ``name``,\n ``bases``, and ``dict``. Upon class creation, the callable is used\n instead of the built-in ``type()``.\n\n New in version 2.2.\n\nThe appropriate metaclass is determined by the following precedence\nrules:\n\n* If ``dict[\'__metaclass__\']`` exists, it is used.\n\n* Otherwise, if there is at least one base class, its metaclass is\n used (this looks for a *__class__* attribute first and if not found,\n uses its type).\n\n* Otherwise, if a global variable named __metaclass__ exists, it is\n used.\n\n* Otherwise, the old-style, classic metaclass (types.ClassType) is\n used.\n\nThe potential uses for metaclasses are boundless. Some ideas that have\nbeen explored including logging, interface checking, automatic\ndelegation, automatic property creation, proxies, frameworks, and\nautomatic resource locking/synchronization.\n\n\nEmulating callable objects\n==========================\n\nobject.__call__(self[, args...])\n\n Called when the instance is "called" as a function; if this method\n is defined, ``x(arg1, arg2, ...)`` is a shorthand for\n ``x.__call__(arg1, arg2, ...)``.\n\n\nEmulating container types\n=========================\n\nThe following methods can be defined to implement container objects.\nContainers usually are sequences (such as lists or tuples) or mappings\n(like dictionaries), but can represent other containers as well. The\nfirst set of methods is used either to emulate a sequence or to\nemulate a mapping; the difference is that for a sequence, the\nallowable keys should be the integers *k* for which ``0 <= k < N``\nwhere *N* is the length of the sequence, or slice objects, which\ndefine a range of items. (For backwards compatibility, the method\n``__getslice__()`` (see below) can also be defined to handle simple,\nbut not extended slices.) It is also recommended that mappings provide\nthe methods ``keys()``, ``values()``, ``items()``, ``has_key()``,\n``get()``, ``clear()``, ``setdefault()``, ``iterkeys()``,\n``itervalues()``, ``iteritems()``, ``pop()``, ``popitem()``,\n``copy()``, and ``update()`` behaving similar to those for Python\'s\nstandard dictionary objects. The ``UserDict`` module provides a\n``DictMixin`` class to help create those methods from a base set of\n``__getitem__()``, ``__setitem__()``, ``__delitem__()``, and\n``keys()``. Mutable sequences should provide methods ``append()``,\n``count()``, ``index()``, ``extend()``, ``insert()``, ``pop()``,\n``remove()``, ``reverse()`` and ``sort()``, like Python standard list\nobjects. Finally, sequence types should implement addition (meaning\nconcatenation) and multiplication (meaning repetition) by defining the\nmethods ``__add__()``, ``__radd__()``, ``__iadd__()``, ``__mul__()``,\n``__rmul__()`` and ``__imul__()`` described below; they should not\ndefine ``__coerce__()`` or other numerical operators. It is\nrecommended that both mappings and sequences implement the\n``__contains__()`` method to allow efficient use of the ``in``\noperator; for mappings, ``in`` should be equivalent of ``has_key()``;\nfor sequences, it should search through the values. It is further\nrecommended that both mappings and sequences implement the\n``__iter__()`` method to allow efficient iteration through the\ncontainer; for mappings, ``__iter__()`` should be the same as\n``iterkeys()``; for sequences, it should iterate through the values.\n\nobject.__len__(self)\n\n Called to implement the built-in function ``len()``. Should return\n the length of the object, an integer ``>=`` 0. Also, an object\n that doesn\'t define a ``__nonzero__()`` method and whose\n ``__len__()`` method returns zero is considered to be false in a\n Boolean context.\n\nobject.__getitem__(self, key)\n\n Called to implement evaluation of ``self[key]``. For sequence\n types, the accepted keys should be integers and slice objects.\n Note that the special interpretation of negative indexes (if the\n class wishes to emulate a sequence type) is up to the\n ``__getitem__()`` method. If *key* is of an inappropriate type,\n ``TypeError`` may be raised; if of a value outside the set of\n indexes for the sequence (after any special interpretation of\n negative values), ``IndexError`` should be raised. For mapping\n types, if *key* is missing (not in the container), ``KeyError``\n should be raised.\n\n Note: ``for`` loops expect that an ``IndexError`` will be raised for\n illegal indexes to allow proper detection of the end of the\n sequence.\n\nobject.__setitem__(self, key, value)\n\n Called to implement assignment to ``self[key]``. Same note as for\n ``__getitem__()``. This should only be implemented for mappings if\n the objects support changes to the values for keys, or if new keys\n can be added, or for sequences if elements can be replaced. The\n same exceptions should be raised for improper *key* values as for\n the ``__getitem__()`` method.\n\nobject.__delitem__(self, key)\n\n Called to implement deletion of ``self[key]``. Same note as for\n ``__getitem__()``. This should only be implemented for mappings if\n the objects support removal of keys, or for sequences if elements\n can be removed from the sequence. The same exceptions should be\n raised for improper *key* values as for the ``__getitem__()``\n method.\n\nobject.__iter__(self)\n\n This method is called when an iterator is required for a container.\n This method should return a new iterator object that can iterate\n over all the objects in the container. For mappings, it should\n iterate over the keys of the container, and should also be made\n available as the method ``iterkeys()``.\n\n Iterator objects also need to implement this method; they are\n required to return themselves. For more information on iterator\n objects, see *Iterator Types*.\n\nobject.__reversed__(self)\n\n Called (if present) by the ``reversed()`` builtin to implement\n reverse iteration. It should return a new iterator object that\n iterates over all the objects in the container in reverse order.\n\n If the ``__reversed__()`` method is not provided, the\n ``reversed()`` builtin will fall back to using the sequence\n protocol (``__len__()`` and ``__getitem__()``). Objects should\n normally only provide ``__reversed__()`` if they do not support the\n sequence protocol and an efficient implementation of reverse\n iteration is possible.\n\n New in version 2.6.\n\nThe membership test operators (``in`` and ``not in``) are normally\nimplemented as an iteration through a sequence. However, container\nobjects can supply the following special method with a more efficient\nimplementation, which also does not require the object be a sequence.\n\nobject.__contains__(self, item)\n\n Called to implement membership test operators. Should return true\n if *item* is in *self*, false otherwise. For mapping objects, this\n should consider the keys of the mapping rather than the values or\n the key-item pairs.\n\n\nAdditional methods for emulation of sequence types\n==================================================\n\nThe following optional methods can be defined to further emulate\nsequence objects. Immutable sequences methods should at most only\ndefine ``__getslice__()``; mutable sequences might define all three\nmethods.\n\nobject.__getslice__(self, i, j)\n\n Deprecated since version 2.0: Support slice objects as parameters\n to the ``__getitem__()`` method. (However, built-in types in\n CPython currently still implement ``__getslice__()``. Therefore,\n you have to override it in derived classes when implementing\n slicing.)\n\n Called to implement evaluation of ``self[i:j]``. The returned\n object should be of the same type as *self*. Note that missing *i*\n or *j* in the slice expression are replaced by zero or\n ``sys.maxint``, respectively. If negative indexes are used in the\n slice, the length of the sequence is added to that index. If the\n instance does not implement the ``__len__()`` method, an\n ``AttributeError`` is raised. No guarantee is made that indexes\n adjusted this way are not still negative. Indexes which are\n greater than the length of the sequence are not modified. If no\n ``__getslice__()`` is found, a slice object is created instead, and\n passed to ``__getitem__()`` instead.\n\nobject.__setslice__(self, i, j, sequence)\n\n Called to implement assignment to ``self[i:j]``. Same notes for *i*\n and *j* as for ``__getslice__()``.\n\n This method is deprecated. If no ``__setslice__()`` is found, or\n for extended slicing of the form ``self[i:j:k]``, a slice object is\n created, and passed to ``__setitem__()``, instead of\n ``__setslice__()`` being called.\n\nobject.__delslice__(self, i, j)\n\n Called to implement deletion of ``self[i:j]``. Same notes for *i*\n and *j* as for ``__getslice__()``. This method is deprecated. If no\n ``__delslice__()`` is found, or for extended slicing of the form\n ``self[i:j:k]``, a slice object is created, and passed to\n ``__delitem__()``, instead of ``__delslice__()`` being called.\n\nNotice that these methods are only invoked when a single slice with a\nsingle colon is used, and the slice method is available. For slice\noperations involving extended slice notation, or in absence of the\nslice methods, ``__getitem__()``, ``__setitem__()`` or\n``__delitem__()`` is called with a slice object as argument.\n\nThe following example demonstrate how to make your program or module\ncompatible with earlier versions of Python (assuming that methods\n``__getitem__()``, ``__setitem__()`` and ``__delitem__()`` support\nslice objects as arguments):\n\n class MyClass:\n ...\n def __getitem__(self, index):\n ...\n def __setitem__(self, index, value):\n ...\n def __delitem__(self, index):\n ...\n\n if sys.version_info < (2, 0):\n # They won\'t be defined if version is at least 2.0 final\n\n def __getslice__(self, i, j):\n return self[max(0, i):max(0, j):]\n def __setslice__(self, i, j, seq):\n self[max(0, i):max(0, j):] = seq\n def __delslice__(self, i, j):\n del self[max(0, i):max(0, j):]\n ...\n\nNote the calls to ``max()``; these are necessary because of the\nhandling of negative indices before the ``__*slice__()`` methods are\ncalled. When negative indexes are used, the ``__*item__()`` methods\nreceive them as provided, but the ``__*slice__()`` methods get a\n"cooked" form of the index values. For each negative index value, the\nlength of the sequence is added to the index before calling the method\n(which may still result in a negative index); this is the customary\nhandling of negative indexes by the built-in sequence types, and the\n``__*item__()`` methods are expected to do this as well. However,\nsince they should already be doing that, negative indexes cannot be\npassed in; they must be constrained to the bounds of the sequence\nbefore being passed to the ``__*item__()`` methods. Calling ``max(0,\ni)`` conveniently returns the proper value.\n\n\nEmulating numeric types\n=======================\n\nThe following methods can be defined to emulate numeric objects.\nMethods corresponding to operations that are not supported by the\nparticular kind of number implemented (e.g., bitwise operations for\nnon-integral numbers) should be left undefined.\n\nobject.__add__(self, other)\nobject.__sub__(self, other)\nobject.__mul__(self, other)\nobject.__floordiv__(self, other)\nobject.__mod__(self, other)\nobject.__divmod__(self, other)\nobject.__pow__(self, other[, modulo])\nobject.__lshift__(self, other)\nobject.__rshift__(self, other)\nobject.__and__(self, other)\nobject.__xor__(self, other)\nobject.__or__(self, other)\n\n These methods are called to implement the binary arithmetic\n operations (``+``, ``-``, ``*``, ``//``, ``%``, ``divmod()``,\n ``pow()``, ``**``, ``<<``, ``>>``, ``&``, ``^``, ``|``). For\n instance, to evaluate the expression ``x + y``, where *x* is an\n instance of a class that has an ``__add__()`` method,\n ``x.__add__(y)`` is called. The ``__divmod__()`` method should be\n the equivalent to using ``__floordiv__()`` and ``__mod__()``; it\n should not be related to ``__truediv__()`` (described below). Note\n that ``__pow__()`` should be defined to accept an optional third\n argument if the ternary version of the built-in ``pow()`` function\n is to be supported.\n\n If one of those methods does not support the operation with the\n supplied arguments, it should return ``NotImplemented``.\n\nobject.__div__(self, other)\nobject.__truediv__(self, other)\n\n The division operator (``/``) is implemented by these methods. The\n ``__truediv__()`` method is used when ``__future__.division`` is in\n effect, otherwise ``__div__()`` is used. If only one of these two\n methods is defined, the object will not support division in the\n alternate context; ``TypeError`` will be raised instead.\n\nobject.__radd__(self, other)\nobject.__rsub__(self, other)\nobject.__rmul__(self, other)\nobject.__rdiv__(self, other)\nobject.__rtruediv__(self, other)\nobject.__rfloordiv__(self, other)\nobject.__rmod__(self, other)\nobject.__rdivmod__(self, other)\nobject.__rpow__(self, other)\nobject.__rlshift__(self, other)\nobject.__rrshift__(self, other)\nobject.__rand__(self, other)\nobject.__rxor__(self, other)\nobject.__ror__(self, other)\n\n These methods are called to implement the binary arithmetic\n operations (``+``, ``-``, ``*``, ``/``, ``%``, ``divmod()``,\n ``pow()``, ``**``, ``<<``, ``>>``, ``&``, ``^``, ``|``) with\n reflected (swapped) operands. These functions are only called if\n the left operand does not support the corresponding operation and\n the operands are of different types. [3] For instance, to evaluate\n the expression ``x - y``, where *y* is an instance of a class that\n has an ``__rsub__()`` method, ``y.__rsub__(x)`` is called if\n ``x.__sub__(y)`` returns *NotImplemented*.\n\n Note that ternary ``pow()`` will not try calling ``__rpow__()``\n (the coercion rules would become too complicated).\n\n Note: If the right operand\'s type is a subclass of the left operand\'s\n type and that subclass provides the reflected method for the\n operation, this method will be called before the left operand\'s\n non-reflected method. This behavior allows subclasses to\n override their ancestors\' operations.\n\nobject.__iadd__(self, other)\nobject.__isub__(self, other)\nobject.__imul__(self, other)\nobject.__idiv__(self, other)\nobject.__itruediv__(self, other)\nobject.__ifloordiv__(self, other)\nobject.__imod__(self, other)\nobject.__ipow__(self, other[, modulo])\nobject.__ilshift__(self, other)\nobject.__irshift__(self, other)\nobject.__iand__(self, other)\nobject.__ixor__(self, other)\nobject.__ior__(self, other)\n\n These methods are called to implement the augmented arithmetic\n operations (``+=``, ``-=``, ``*=``, ``/=``, ``//=``, ``%=``,\n ``**=``, ``<<=``, ``>>=``, ``&=``, ``^=``, ``|=``). These methods\n should attempt to do the operation in-place (modifying *self*) and\n return the result (which could be, but does not have to be,\n *self*). If a specific method is not defined, the augmented\n operation falls back to the normal methods. For instance, to\n evaluate the expression ``x += y``, where *x* is an instance of a\n class that has an ``__iadd__()`` method, ``x.__iadd__(y)`` is\n called. If *x* is an instance of a class that does not define a\n ``__iadd__()`` method, ``x.__add__(y)`` and ``y.__radd__(x)`` are\n considered, as with the evaluation of ``x + y``.\n\nobject.__neg__(self)\nobject.__pos__(self)\nobject.__abs__(self)\nobject.__invert__(self)\n\n Called to implement the unary arithmetic operations (``-``, ``+``,\n ``abs()`` and ``~``).\n\nobject.__complex__(self)\nobject.__int__(self)\nobject.__long__(self)\nobject.__float__(self)\n\n Called to implement the built-in functions ``complex()``,\n ``int()``, ``long()``, and ``float()``. Should return a value of\n the appropriate type.\n\nobject.__oct__(self)\nobject.__hex__(self)\n\n Called to implement the built-in functions ``oct()`` and ``hex()``.\n Should return a string value.\n\nobject.__index__(self)\n\n Called to implement ``operator.index()``. Also called whenever\n Python needs an integer object (such as in slicing). Must return\n an integer (int or long).\n\n New in version 2.5.\n\nobject.__coerce__(self, other)\n\n Called to implement "mixed-mode" numeric arithmetic. Should either\n return a 2-tuple containing *self* and *other* converted to a\n common numeric type, or ``None`` if conversion is impossible. When\n the common type would be the type of ``other``, it is sufficient to\n return ``None``, since the interpreter will also ask the other\n object to attempt a coercion (but sometimes, if the implementation\n of the other type cannot be changed, it is useful to do the\n conversion to the other type here). A return value of\n ``NotImplemented`` is equivalent to returning ``None``.\n\n\nCoercion rules\n==============\n\nThis section used to document the rules for coercion. As the language\nhas evolved, the coercion rules have become hard to document\nprecisely; documenting what one version of one particular\nimplementation does is undesirable. Instead, here are some informal\nguidelines regarding coercion. In Python 3.0, coercion will not be\nsupported.\n\n* If the left operand of a % operator is a string or Unicode object,\n no coercion takes place and the string formatting operation is\n invoked instead.\n\n* It is no longer recommended to define a coercion operation. Mixed-\n mode operations on types that don\'t define coercion pass the\n original arguments to the operation.\n\n* New-style classes (those derived from ``object``) never invoke the\n ``__coerce__()`` method in response to a binary operator; the only\n time ``__coerce__()`` is invoked is when the built-in function\n ``coerce()`` is called.\n\n* For most intents and purposes, an operator that returns\n ``NotImplemented`` is treated the same as one that is not\n implemented at all.\n\n* Below, ``__op__()`` and ``__rop__()`` are used to signify the\n generic method names corresponding to an operator; ``__iop__()`` is\n used for the corresponding in-place operator. For example, for the\n operator \'``+``\', ``__add__()`` and ``__radd__()`` are used for the\n left and right variant of the binary operator, and ``__iadd__()``\n for the in-place variant.\n\n* For objects *x* and *y*, first ``x.__op__(y)`` is tried. If this is\n not implemented or returns ``NotImplemented``, ``y.__rop__(x)`` is\n tried. If this is also not implemented or returns\n ``NotImplemented``, a ``TypeError`` exception is raised. But see\n the following exception:\n\n* Exception to the previous item: if the left operand is an instance\n of a built-in type or a new-style class, and the right operand is an\n instance of a proper subclass of that type or class and overrides\n the base\'s ``__rop__()`` method, the right operand\'s ``__rop__()``\n method is tried *before* the left operand\'s ``__op__()`` method.\n\n This is done so that a subclass can completely override binary\n operators. Otherwise, the left operand\'s ``__op__()`` method would\n always accept the right operand: when an instance of a given class\n is expected, an instance of a subclass of that class is always\n acceptable.\n\n* When either operand type defines a coercion, this coercion is called\n before that type\'s ``__op__()`` or ``__rop__()`` method is called,\n but no sooner. If the coercion returns an object of a different\n type for the operand whose coercion is invoked, part of the process\n is redone using the new object.\n\n* When an in-place operator (like \'``+=``\') is used, if the left\n operand implements ``__iop__()``, it is invoked without any\n coercion. When the operation falls back to ``__op__()`` and/or\n ``__rop__()``, the normal coercion rules apply.\n\n* In ``x + y``, if *x* is a sequence that implements sequence\n concatenation, sequence concatenation is invoked.\n\n* In ``x * y``, if one operator is a sequence that implements sequence\n repetition, and the other is an integer (``int`` or ``long``),\n sequence repetition is invoked.\n\n* Rich comparisons (implemented by methods ``__eq__()`` and so on)\n never use coercion. Three-way comparison (implemented by\n ``__cmp__()``) does use coercion under the same conditions as other\n binary operations use it.\n\n* In the current implementation, the built-in numeric types ``int``,\n ``long`` and ``float`` do not use coercion; the type ``complex``\n however does use it. The difference can become apparent when\n subclassing these types. Over time, the type ``complex`` may be\n fixed to avoid coercion. All these types implement a\n ``__coerce__()`` method, for use by the built-in ``coerce()``\n function.\n\n\nWith Statement Context Managers\n===============================\n\nNew in version 2.5.\n\nA *context manager* is an object that defines the runtime context to\nbe established when executing a ``with`` statement. The context\nmanager handles the entry into, and the exit from, the desired runtime\ncontext for the execution of the block of code. Context managers are\nnormally invoked using the ``with`` statement (described in section\n*The with statement*), but can also be used by directly invoking their\nmethods.\n\nTypical uses of context managers include saving and restoring various\nkinds of global state, locking and unlocking resources, closing opened\nfiles, etc.\n\nFor more information on context managers, see *Context Manager Types*.\n\nobject.__enter__(self)\n\n Enter the runtime context related to this object. The ``with``\n statement will bind this method\'s return value to the target(s)\n specified in the ``as`` clause of the statement, if any.\n\nobject.__exit__(self, exc_type, exc_value, traceback)\n\n Exit the runtime context related to this object. The parameters\n describe the exception that caused the context to be exited. If the\n context was exited without an exception, all three arguments will\n be ``None``.\n\n If an exception is supplied, and the method wishes to suppress the\n exception (i.e., prevent it from being propagated), it should\n return a true value. Otherwise, the exception will be processed\n normally upon exit from this method.\n\n Note that ``__exit__()`` methods should not reraise the passed-in\n exception; this is the caller\'s responsibility.\n\nSee also:\n\n **PEP 0343** - The "with" statement\n The specification, background, and examples for the Python\n ``with`` statement.\n\n\nSpecial method lookup for old-style classes\n===========================================\n\nFor old-style classes, special methods are always looked up in exactly\nthe same way as any other method or attribute. This is the case\nregardless of whether the method is being looked up explicitly as in\n``x.__getitem__(i)`` or implicitly as in ``x[i]``.\n\nThis behaviour means that special methods may exhibit different\nbehaviour for different instances of a single old-style class if the\nappropriate special attributes are set differently:\n\n >>> class C:\n ... pass\n ...\n >>> c1 = C()\n >>> c2 = C()\n >>> c1.__len__ = lambda: 5\n >>> c2.__len__ = lambda: 9\n >>> len(c1)\n 5\n >>> len(c2)\n 9\n\n\nSpecial method lookup for new-style classes\n===========================================\n\nFor new-style classes, implicit invocations of special methods are\nonly guaranteed to work correctly if defined on an object\'s type, not\nin the object\'s instance dictionary. That behaviour is the reason why\nthe following code raises an exception (unlike the equivalent example\nwith old-style classes):\n\n >>> class C(object):\n ... pass\n ...\n >>> c = C()\n >>> c.__len__ = lambda: 5\n >>> len(c)\n Traceback (most recent call last):\n File "", line 1, in \n TypeError: object of type \'C\' has no len()\n\nThe rationale behind this behaviour lies with a number of special\nmethods such as ``__hash__()`` and ``__repr__()`` that are implemented\nby all objects, including type objects. If the implicit lookup of\nthese methods used the conventional lookup process, they would fail\nwhen invoked on the type object itself:\n\n >>> 1 .__hash__() == hash(1)\n True\n >>> int.__hash__() == hash(int)\n Traceback (most recent call last):\n File "", line 1, in \n TypeError: descriptor \'__hash__\' of \'int\' object needs an argument\n\nIncorrectly attempting to invoke an unbound method of a class in this\nway is sometimes referred to as \'metaclass confusion\', and is avoided\nby bypassing the instance when looking up special methods:\n\n >>> type(1).__hash__(1) == hash(1)\n True\n >>> type(int).__hash__(int) == hash(int)\n True\n\nIn addition to bypassing any instance attributes in the interest of\ncorrectness, implicit special method lookup may also bypass the\n``__getattribute__()`` method even of the object\'s metaclass:\n\n >>> class Meta(type):\n ... def __getattribute__(*args):\n ... print "Metaclass getattribute invoked"\n ... return type.__getattribute__(*args)\n ...\n >>> class C(object):\n ... __metaclass__ = Meta\n ... def __len__(self):\n ... return 10\n ... def __getattribute__(*args):\n ... print "Class getattribute invoked"\n ... return object.__getattribute__(*args)\n ...\n >>> c = C()\n >>> c.__len__() # Explicit lookup via instance\n Class getattribute invoked\n 10\n >>> type(c).__len__(c) # Explicit lookup via type\n Metaclass getattribute invoked\n 10\n >>> len(c) # Implicit lookup\n 10\n\nBypassing the ``__getattribute__()`` machinery in this fashion\nprovides significant scope for speed optimisations within the\ninterpreter, at the cost of some flexibility in the handling of\nspecial methods (the special method *must* be set on the class object\nitself in order to be consistently invoked by the interpreter).\n\n-[ Footnotes ]-\n\n[1] It *is* possible in some cases to change an object\'s type, under\n certain controlled conditions. It generally isn\'t a good idea\n though, since it can lead to some very strange behaviour if it is\n handled incorrectly.\n\n[2] A descriptor can define any combination of ``__get__()``,\n ``__set__()`` and ``__delete__()``. If it does not define\n ``__get__()``, then accessing the attribute even on an instance\n will return the descriptor object itself. If the descriptor\n defines ``__set__()`` and/or ``__delete__()``, it is a data\n descriptor; if it defines neither, it is a non-data descriptor.\n\n[3] For operands of the same type, it is assumed that if the non-\n reflected method (such as ``__add__()``) fails the operation is\n not supported, which is why the reflected method is not called.\n', 'string-conversions': u'\nString conversions\n******************\n\nA string conversion is an expression list enclosed in reverse (a.k.a.\nbackward) quotes:\n\n string_conversion ::= "\'" expression_list "\'"\n\nA string conversion evaluates the contained expression list and\nconverts the resulting object into a string according to rules\nspecific to its type.\n\nIf the object is a string, a number, ``None``, or a tuple, list or\ndictionary containing only objects whose type is one of these, the\nresulting string is a valid Python expression which can be passed to\nthe built-in function ``eval()`` to yield an expression with the same\nvalue (or an approximation, if floating point numbers are involved).\n\n(In particular, converting a string adds quotes around it and converts\n"funny" characters to escape sequences that are safe to print.)\n\nRecursive objects (for example, lists or dictionaries that contain a\nreference to themselves, directly or indirectly) use ``...`` to\nindicate a recursive reference, and the result cannot be passed to\n``eval()`` to get an equal value (``SyntaxError`` will be raised\ninstead).\n\nThe built-in function ``repr()`` performs exactly the same conversion\nin its argument as enclosing it in parentheses and reverse quotes\ndoes. The built-in function ``str()`` performs a similar but more\nuser-friendly conversion.\n', - 'string-methods': u'\nString Methods\n**************\n\nBelow are listed the string methods which both 8-bit strings and\nUnicode objects support. Note that none of these methods take keyword\narguments.\n\nIn addition, Python\'s strings support the sequence type methods\ndescribed in the *Sequence Types --- str, unicode, list, tuple,\nbuffer, xrange* section. To output formatted strings use template\nstrings or the ``%`` operator described in the *String Formatting\nOperations* section. Also, see the ``re`` module for string functions\nbased on regular expressions.\n\nstr.capitalize()\n\n Return a copy of the string with only its first character\n capitalized.\n\n For 8-bit strings, this method is locale-dependent.\n\nstr.center(width[, fillchar])\n\n Return centered in a string of length *width*. Padding is done\n using the specified *fillchar* (default is a space).\n\n Changed in version 2.4: Support for the *fillchar* argument.\n\nstr.count(sub[, start[, end]])\n\n Return the number of occurrences of substring *sub* in the range\n [*start*, *end*]. Optional arguments *start* and *end* are\n interpreted as in slice notation.\n\nstr.decode([encoding[, errors]])\n\n Decodes the string using the codec registered for *encoding*.\n *encoding* defaults to the default string encoding. *errors* may\n be given to set a different error handling scheme. The default is\n ``\'strict\'``, meaning that encoding errors raise ``UnicodeError``.\n Other possible values are ``\'ignore\'``, ``\'replace\'`` and any other\n name registered via ``codecs.register_error()``, see section *Codec\n Base Classes*.\n\n Added in version 2.2.\n\n Changed in version 2.3: Support for other error handling schemes\n added.\n\nstr.encode([encoding[, errors]])\n\n Return an encoded version of the string. Default encoding is the\n current default string encoding. *errors* may be given to set a\n different error handling scheme. The default for *errors* is\n ``\'strict\'``, meaning that encoding errors raise a\n ``UnicodeError``. Other possible values are ``\'ignore\'``,\n ``\'replace\'``, ``\'xmlcharrefreplace\'``, ``\'backslashreplace\'`` and\n any other name registered via ``codecs.register_error()``, see\n section *Codec Base Classes*. For a list of possible encodings, see\n section *Standard Encodings*.\n\n Added in version 2.0.\n\n Changed in version 2.3: Support for ``\'xmlcharrefreplace\'`` and\n ``\'backslashreplace\'`` and other error handling schemes added.\n\nstr.endswith(suffix[, start[, end]])\n\n Return ``True`` if the string ends with the specified *suffix*,\n otherwise return ``False``. *suffix* can also be a tuple of\n suffixes to look for. With optional *start*, test beginning at\n that position. With optional *end*, stop comparing at that\n position.\n\n Changed in version 2.5: Accept tuples as *suffix*.\n\nstr.expandtabs([tabsize])\n\n Return a copy of the string where all tab characters are replaced\n by one or more spaces, depending on the current column and the\n given tab size. The column number is reset to zero after each\n newline occurring in the string. If *tabsize* is not given, a tab\n size of ``8`` characters is assumed. This doesn\'t understand other\n non-printing characters or escape sequences.\n\nstr.find(sub[, start[, end]])\n\n Return the lowest index in the string where substring *sub* is\n found, such that *sub* is contained in the range [*start*, *end*].\n Optional arguments *start* and *end* are interpreted as in slice\n notation. Return ``-1`` if *sub* is not found.\n\nstr.format(format_string, *args, **kwargs)\n\n Perform a string formatting operation. The *format_string*\n argument can contain literal text or replacement fields delimited\n by braces ``{}``. Each replacement field contains either the\n numeric index of a positional argument, or the name of a keyword\n argument. Returns a copy of *format_string* where each replacement\n field is replaced with the string value of the corresponding\n argument.\n\n >>> "The sum of 1 + 2 is {0}".format(1+2)\n \'The sum of 1 + 2 is 3\'\n\n See *Format String Syntax* for a description of the various\n formatting options that can be specified in format strings.\n\n This method of string formatting is the new standard in Python 3.0,\n and should be preferred to the ``%`` formatting described in\n *String Formatting Operations* in new code.\n\n Added in version 2.6.\n\nstr.index(sub[, start[, end]])\n\n Like ``find()``, but raise ``ValueError`` when the substring is not\n found.\n\nstr.isalnum()\n\n Return true if all characters in the string are alphanumeric and\n there is at least one character, false otherwise.\n\n For 8-bit strings, this method is locale-dependent.\n\nstr.isalpha()\n\n Return true if all characters in the string are alphabetic and\n there is at least one character, false otherwise.\n\n For 8-bit strings, this method is locale-dependent.\n\nstr.isdigit()\n\n Return true if all characters in the string are digits and there is\n at least one character, false otherwise.\n\n For 8-bit strings, this method is locale-dependent.\n\nstr.islower()\n\n Return true if all cased characters in the string are lowercase and\n there is at least one cased character, false otherwise.\n\n For 8-bit strings, this method is locale-dependent.\n\nstr.isspace()\n\n Return true if there are only whitespace characters in the string\n and there is at least one character, false otherwise.\n\n For 8-bit strings, this method is locale-dependent.\n\nstr.istitle()\n\n Return true if the string is a titlecased string and there is at\n least one character, for example uppercase characters may only\n follow uncased characters and lowercase characters only cased ones.\n Return false otherwise.\n\n For 8-bit strings, this method is locale-dependent.\n\nstr.isupper()\n\n Return true if all cased characters in the string are uppercase and\n there is at least one cased character, false otherwise.\n\n For 8-bit strings, this method is locale-dependent.\n\nstr.join(seq)\n\n Return a string which is the concatenation of the strings in the\n sequence *seq*. The separator between elements is the string\n providing this method.\n\nstr.ljust(width[, fillchar])\n\n Return the string left justified in a string of length *width*.\n Padding is done using the specified *fillchar* (default is a\n space). The original string is returned if *width* is less than\n ``len(s)``.\n\n Changed in version 2.4: Support for the *fillchar* argument.\n\nstr.lower()\n\n Return a copy of the string converted to lowercase.\n\n For 8-bit strings, this method is locale-dependent.\n\nstr.lstrip([chars])\n\n Return a copy of the string with leading characters removed. The\n *chars* argument is a string specifying the set of characters to be\n removed. If omitted or ``None``, the *chars* argument defaults to\n removing whitespace. The *chars* argument is not a prefix; rather,\n all combinations of its values are stripped:\n\n >>> \' spacious \'.lstrip()\n \'spacious \'\n >>> \'www.example.com\'.lstrip(\'cmowz.\')\n \'example.com\'\n\n Changed in version 2.2.2: Support for the *chars* argument.\n\nstr.partition(sep)\n\n Split the string at the first occurrence of *sep*, and return a\n 3-tuple containing the part before the separator, the separator\n itself, and the part after the separator. If the separator is not\n found, return a 3-tuple containing the string itself, followed by\n two empty strings.\n\n Added in version 2.5.\n\nstr.replace(old, new[, count])\n\n Return a copy of the string with all occurrences of substring *old*\n replaced by *new*. If the optional argument *count* is given, only\n the first *count* occurrences are replaced.\n\nstr.rfind(sub[, start[, end]])\n\n Return the highest index in the string where substring *sub* is\n found, such that *sub* is contained within s[start,end]. Optional\n arguments *start* and *end* are interpreted as in slice notation.\n Return ``-1`` on failure.\n\nstr.rindex(sub[, start[, end]])\n\n Like ``rfind()`` but raises ``ValueError`` when the substring *sub*\n is not found.\n\nstr.rjust(width[, fillchar])\n\n Return the string right justified in a string of length *width*.\n Padding is done using the specified *fillchar* (default is a\n space). The original string is returned if *width* is less than\n ``len(s)``.\n\n Changed in version 2.4: Support for the *fillchar* argument.\n\nstr.rpartition(sep)\n\n Split the string at the last occurrence of *sep*, and return a\n 3-tuple containing the part before the separator, the separator\n itself, and the part after the separator. If the separator is not\n found, return a 3-tuple containing two empty strings, followed by\n the string itself.\n\n Added in version 2.5.\n\nstr.rsplit([sep[, maxsplit]])\n\n Return a list of the words in the string, using *sep* as the\n delimiter string. If *maxsplit* is given, at most *maxsplit* splits\n are done, the *rightmost* ones. If *sep* is not specified or\n ``None``, any whitespace string is a separator. Except for\n splitting from the right, ``rsplit()`` behaves like ``split()``\n which is described in detail below.\n\n Added in version 2.4.\n\nstr.rstrip([chars])\n\n Return a copy of the string with trailing characters removed. The\n *chars* argument is a string specifying the set of characters to be\n removed. If omitted or ``None``, the *chars* argument defaults to\n removing whitespace. The *chars* argument is not a suffix; rather,\n all combinations of its values are stripped:\n\n >>> \' spacious \'.rstrip()\n \' spacious\'\n >>> \'mississippi\'.rstrip(\'ipz\')\n \'mississ\'\n\n Changed in version 2.2.2: Support for the *chars* argument.\n\nstr.split([sep[, maxsplit]])\n\n Return a list of the words in the string, using *sep* as the\n delimiter string. If *maxsplit* is given, at most *maxsplit*\n splits are done (thus, the list will have at most ``maxsplit+1``\n elements). If *maxsplit* is not specified, then there is no limit\n on the number of splits (all possible splits are made).\n\n If *sep* is given, consecutive delimiters are not grouped together\n and are deemed to delimit empty strings (for example,\n ``\'1,,2\'.split(\',\')`` returns ``[\'1\', \'\', \'2\']``). The *sep*\n argument may consist of multiple characters (for example,\n ``\'1<>2<>3\'.split(\'<>\')`` returns ``[\'1\', \'2\', \'3\']``). Splitting\n an empty string with a specified separator returns ``[\'\']``.\n\n If *sep* is not specified or is ``None``, a different splitting\n algorithm is applied: runs of consecutive whitespace are regarded\n as a single separator, and the result will contain no empty strings\n at the start or end if the string has leading or trailing\n whitespace. Consequently, splitting an empty string or a string\n consisting of just whitespace with a ``None`` separator returns\n ``[]``.\n\n For example, ``\' 1 2 3 \'.split()`` returns ``[\'1\', \'2\', \'3\']``,\n and ``\' 1 2 3 \'.split(None, 1)`` returns ``[\'1\', \'2 3 \']``.\n\nstr.splitlines([keepends])\n\n Return a list of the lines in the string, breaking at line\n boundaries. Line breaks are not included in the resulting list\n unless *keepends* is given and true.\n\nstr.startswith(prefix[, start[, end]])\n\n Return ``True`` if string starts with the *prefix*, otherwise\n return ``False``. *prefix* can also be a tuple of prefixes to look\n for. With optional *start*, test string beginning at that\n position. With optional *end*, stop comparing string at that\n position.\n\n Changed in version 2.5: Accept tuples as *prefix*.\n\nstr.strip([chars])\n\n Return a copy of the string with the leading and trailing\n characters removed. The *chars* argument is a string specifying the\n set of characters to be removed. If omitted or ``None``, the\n *chars* argument defaults to removing whitespace. The *chars*\n argument is not a prefix or suffix; rather, all combinations of its\n values are stripped:\n\n >>> \' spacious \'.strip()\n \'spacious\'\n >>> \'www.example.com\'.strip(\'cmowz.\')\n \'example\'\n\n Changed in version 2.2.2: Support for the *chars* argument.\n\nstr.swapcase()\n\n Return a copy of the string with uppercase characters converted to\n lowercase and vice versa.\n\n For 8-bit strings, this method is locale-dependent.\n\nstr.title()\n\n Return a titlecased version of the string: words start with\n uppercase characters, all remaining cased characters are lowercase.\n\n For 8-bit strings, this method is locale-dependent.\n\nstr.translate(table[, deletechars])\n\n Return a copy of the string where all characters occurring in the\n optional argument *deletechars* are removed, and the remaining\n characters have been mapped through the given translation table,\n which must be a string of length 256.\n\n You can use the ``maketrans()`` helper function in the ``string``\n module to create a translation table. For string objects, set the\n *table* argument to ``None`` for translations that only delete\n characters:\n\n >>> \'read this short text\'.translate(None, \'aeiou\')\n \'rd ths shrt txt\'\n\n Added in version 2.6: Support for a ``None`` *table* argument.\n\n For Unicode objects, the ``translate()`` method does not accept the\n optional *deletechars* argument. Instead, it returns a copy of the\n *s* where all characters have been mapped through the given\n translation table which must be a mapping of Unicode ordinals to\n Unicode ordinals, Unicode strings or ``None``. Unmapped characters\n are left untouched. Characters mapped to ``None`` are deleted.\n Note, a more flexible approach is to create a custom character\n mapping codec using the ``codecs`` module (see ``encodings.cp1251``\n for an example).\n\nstr.upper()\n\n Return a copy of the string converted to uppercase.\n\n For 8-bit strings, this method is locale-dependent.\n\nstr.zfill(width)\n\n Return the numeric string left filled with zeros in a string of\n length *width*. A sign prefix is handled correctly. The original\n string is returned if *width* is less than ``len(s)``.\n\n Added in version 2.2.2.\n\nThe following methods are present only on unicode objects:\n\nunicode.isnumeric()\n\n Return ``True`` if there are only numeric characters in S,\n ``False`` otherwise. Numeric characters include digit characters,\n and all characters that have the Unicode numeric value property,\n e.g. U+2155, VULGAR FRACTION ONE FIFTH.\n\nunicode.isdecimal()\n\n Return ``True`` if there are only decimal characters in S,\n ``False`` otherwise. Decimal characters include digit characters,\n and all characters that that can be used to form decimal-radix\n numbers, e.g. U+0660, ARABIC-INDIC DIGIT ZERO.\n', - 'strings': u'\nString literals\n***************\n\nString literals are described by the following lexical definitions:\n\n stringliteral ::= [stringprefix](shortstring | longstring)\n stringprefix ::= "r" | "u" | "ur" | "R" | "U" | "UR" | "Ur" | "uR"\n shortstring ::= "\'" shortstringitem* "\'" | \'"\' shortstringitem* \'"\'\n longstring ::= ""\'" longstringitem* ""\'"\n | \'"""\' longstringitem* \'"""\'\n shortstringitem ::= shortstringchar | escapeseq\n longstringitem ::= longstringchar | escapeseq\n shortstringchar ::= \n longstringchar ::= \n escapeseq ::= "\\" \n\nOne syntactic restriction not indicated by these productions is that\nwhitespace is not allowed between the **stringprefix** and the rest of\nthe string literal. The source character set is defined by the\nencoding declaration; it is ASCII if no encoding declaration is given\nin the source file; see section *Encoding declarations*.\n\nIn plain English: String literals can be enclosed in matching single\nquotes (``\'``) or double quotes (``"``). They can also be enclosed in\nmatching groups of three single or double quotes (these are generally\nreferred to as *triple-quoted strings*). The backslash (``\\``)\ncharacter is used to escape characters that otherwise have a special\nmeaning, such as newline, backslash itself, or the quote character.\nString literals may optionally be prefixed with a letter ``\'r\'`` or\n``\'R\'``; such strings are called *raw strings* and use different rules\nfor interpreting backslash escape sequences. A prefix of ``\'u\'`` or\n``\'U\'`` makes the string a Unicode string. Unicode strings use the\nUnicode character set as defined by the Unicode Consortium and ISO\n10646. Some additional escape sequences, described below, are\navailable in Unicode strings. The two prefix characters may be\ncombined; in this case, ``\'u\'`` must appear before ``\'r\'``.\n\nIn triple-quoted strings, unescaped newlines and quotes are allowed\n(and are retained), except that three unescaped quotes in a row\nterminate the string. (A "quote" is the character used to open the\nstring, i.e. either ``\'`` or ``"``.)\n\nUnless an ``\'r\'`` or ``\'R\'`` prefix is present, escape sequences in\nstrings are interpreted according to rules similar to those used by\nStandard C. The recognized escape sequences are:\n\n+-------------------+-----------------------------------+---------+\n| Escape Sequence | Meaning | Notes |\n+===================+===================================+=========+\n| ``\\newline`` | Ignored | |\n+-------------------+-----------------------------------+---------+\n| ``\\\\`` | Backslash (``\\``) | |\n+-------------------+-----------------------------------+---------+\n| ``\\\'`` | Single quote (``\'``) | |\n+-------------------+-----------------------------------+---------+\n| ``\\"`` | Double quote (``"``) | |\n+-------------------+-----------------------------------+---------+\n| ``\\a`` | ASCII Bell (BEL) | |\n+-------------------+-----------------------------------+---------+\n| ``\\b`` | ASCII Backspace (BS) | |\n+-------------------+-----------------------------------+---------+\n| ``\\f`` | ASCII Formfeed (FF) | |\n+-------------------+-----------------------------------+---------+\n| ``\\n`` | ASCII Linefeed (LF) | |\n+-------------------+-----------------------------------+---------+\n| ``\\N{name}`` | Character named *name* in the | |\n| | Unicode database (Unicode only) | |\n+-------------------+-----------------------------------+---------+\n| ``\\r`` | ASCII Carriage Return (CR) | |\n+-------------------+-----------------------------------+---------+\n| ``\\t`` | ASCII Horizontal Tab (TAB) | |\n+-------------------+-----------------------------------+---------+\n| ``\\uxxxx`` | Character with 16-bit hex value | (1) |\n| | *xxxx* (Unicode only) | |\n+-------------------+-----------------------------------+---------+\n| ``\\Uxxxxxxxx`` | Character with 32-bit hex value | (2) |\n| | *xxxxxxxx* (Unicode only) | |\n+-------------------+-----------------------------------+---------+\n| ``\\v`` | ASCII Vertical Tab (VT) | |\n+-------------------+-----------------------------------+---------+\n| ``\\ooo`` | Character with octal value *ooo* | (3,5) |\n+-------------------+-----------------------------------+---------+\n| ``\\xhh`` | Character with hex value *hh* | (4,5) |\n+-------------------+-----------------------------------+---------+\n\nNotes:\n\n1. Individual code units which form parts of a surrogate pair can be\n encoded using this escape sequence.\n\n2. Any Unicode character can be encoded this way, but characters\n outside the Basic Multilingual Plane (BMP) will be encoded using a\n surrogate pair if Python is compiled to use 16-bit code units (the\n default). Individual code units which form parts of a surrogate\n pair can be encoded using this escape sequence.\n\n3. As in Standard C, up to three octal digits are accepted.\n\n4. Unlike in Standard C, exactly two hex digits are required.\n\n5. In a string literal, hexadecimal and octal escapes denote the byte\n with the given value; it is not necessary that the byte encodes a\n character in the source character set. In a Unicode literal, these\n escapes denote a Unicode character with the given value.\n\nUnlike Standard C, all unrecognized escape sequences are left in the\nstring unchanged, i.e., *the backslash is left in the string*. (This\nbehavior is useful when debugging: if an escape sequence is mistyped,\nthe resulting output is more easily recognized as broken.) It is also\nimportant to note that the escape sequences marked as "(Unicode only)"\nin the table above fall into the category of unrecognized escapes for\nnon-Unicode string literals.\n\nWhen an ``\'r\'`` or ``\'R\'`` prefix is present, a character following a\nbackslash is included in the string without change, and *all\nbackslashes are left in the string*. For example, the string literal\n``r"\\n"`` consists of two characters: a backslash and a lowercase\n``\'n\'``. String quotes can be escaped with a backslash, but the\nbackslash remains in the string; for example, ``r"\\""`` is a valid\nstring literal consisting of two characters: a backslash and a double\nquote; ``r"\\"`` is not a valid string literal (even a raw string\ncannot end in an odd number of backslashes). Specifically, *a raw\nstring cannot end in a single backslash* (since the backslash would\nescape the following quote character). Note also that a single\nbackslash followed by a newline is interpreted as those two characters\nas part of the string, *not* as a line continuation.\n\nWhen an ``\'r\'`` or ``\'R\'`` prefix is used in conjunction with a\n``\'u\'`` or ``\'U\'`` prefix, then the ``\\uXXXX`` and ``\\UXXXXXXXX``\nescape sequences are processed while *all other backslashes are left\nin the string*. For example, the string literal ``ur"\\u0062\\n"``\nconsists of three Unicode characters: \'LATIN SMALL LETTER B\', \'REVERSE\nSOLIDUS\', and \'LATIN SMALL LETTER N\'. Backslashes can be escaped with\na preceding backslash; however, both remain in the string. As a\nresult, ``\\uXXXX`` escape sequences are only recognized when there are\nan odd number of backslashes.\n', + 'string-methods': u'\nString Methods\n**************\n\nBelow are listed the string methods which both 8-bit strings and\nUnicode objects support. Note that none of these methods take keyword\narguments.\n\nIn addition, Python\'s strings support the sequence type methods\ndescribed in the *Sequence Types --- str, unicode, list, tuple,\nbuffer, xrange* section. To output formatted strings use template\nstrings or the ``%`` operator described in the *String Formatting\nOperations* section. Also, see the ``re`` module for string functions\nbased on regular expressions.\n\nstr.capitalize()\n\n Return a copy of the string with only its first character\n capitalized.\n\n For 8-bit strings, this method is locale-dependent.\n\nstr.center(width[, fillchar])\n\n Return centered in a string of length *width*. Padding is done\n using the specified *fillchar* (default is a space).\n\n Changed in version 2.4: Support for the *fillchar* argument.\n\nstr.count(sub[, start[, end]])\n\n Return the number of occurrences of substring *sub* in the range\n [*start*, *end*]. Optional arguments *start* and *end* are\n interpreted as in slice notation.\n\nstr.decode([encoding[, errors]])\n\n Decodes the string using the codec registered for *encoding*.\n *encoding* defaults to the default string encoding. *errors* may\n be given to set a different error handling scheme. The default is\n ``\'strict\'``, meaning that encoding errors raise ``UnicodeError``.\n Other possible values are ``\'ignore\'``, ``\'replace\'`` and any other\n name registered via ``codecs.register_error()``, see section *Codec\n Base Classes*.\n\n New in version 2.2.\n\n Changed in version 2.3: Support for other error handling schemes\n added.\n\nstr.encode([encoding[, errors]])\n\n Return an encoded version of the string. Default encoding is the\n current default string encoding. *errors* may be given to set a\n different error handling scheme. The default for *errors* is\n ``\'strict\'``, meaning that encoding errors raise a\n ``UnicodeError``. Other possible values are ``\'ignore\'``,\n ``\'replace\'``, ``\'xmlcharrefreplace\'``, ``\'backslashreplace\'`` and\n any other name registered via ``codecs.register_error()``, see\n section *Codec Base Classes*. For a list of possible encodings, see\n section *Standard Encodings*.\n\n New in version 2.0.\n\n Changed in version 2.3: Support for ``\'xmlcharrefreplace\'`` and\n ``\'backslashreplace\'`` and other error handling schemes added.\n\nstr.endswith(suffix[, start[, end]])\n\n Return ``True`` if the string ends with the specified *suffix*,\n otherwise return ``False``. *suffix* can also be a tuple of\n suffixes to look for. With optional *start*, test beginning at\n that position. With optional *end*, stop comparing at that\n position.\n\n Changed in version 2.5: Accept tuples as *suffix*.\n\nstr.expandtabs([tabsize])\n\n Return a copy of the string where all tab characters are replaced\n by one or more spaces, depending on the current column and the\n given tab size. The column number is reset to zero after each\n newline occurring in the string. If *tabsize* is not given, a tab\n size of ``8`` characters is assumed. This doesn\'t understand other\n non-printing characters or escape sequences.\n\nstr.find(sub[, start[, end]])\n\n Return the lowest index in the string where substring *sub* is\n found, such that *sub* is contained in the range [*start*, *end*].\n Optional arguments *start* and *end* are interpreted as in slice\n notation. Return ``-1`` if *sub* is not found.\n\nstr.format(format_string, *args, **kwargs)\n\n Perform a string formatting operation. The *format_string*\n argument can contain literal text or replacement fields delimited\n by braces ``{}``. Each replacement field contains either the\n numeric index of a positional argument, or the name of a keyword\n argument. Returns a copy of *format_string* where each replacement\n field is replaced with the string value of the corresponding\n argument.\n\n >>> "The sum of 1 + 2 is {0}".format(1+2)\n \'The sum of 1 + 2 is 3\'\n\n See *Format String Syntax* for a description of the various\n formatting options that can be specified in format strings.\n\n This method of string formatting is the new standard in Python 3.0,\n and should be preferred to the ``%`` formatting described in\n *String Formatting Operations* in new code.\n\n New in version 2.6.\n\nstr.index(sub[, start[, end]])\n\n Like ``find()``, but raise ``ValueError`` when the substring is not\n found.\n\nstr.isalnum()\n\n Return true if all characters in the string are alphanumeric and\n there is at least one character, false otherwise.\n\n For 8-bit strings, this method is locale-dependent.\n\nstr.isalpha()\n\n Return true if all characters in the string are alphabetic and\n there is at least one character, false otherwise.\n\n For 8-bit strings, this method is locale-dependent.\n\nstr.isdigit()\n\n Return true if all characters in the string are digits and there is\n at least one character, false otherwise.\n\n For 8-bit strings, this method is locale-dependent.\n\nstr.islower()\n\n Return true if all cased characters in the string are lowercase and\n there is at least one cased character, false otherwise.\n\n For 8-bit strings, this method is locale-dependent.\n\nstr.isspace()\n\n Return true if there are only whitespace characters in the string\n and there is at least one character, false otherwise.\n\n For 8-bit strings, this method is locale-dependent.\n\nstr.istitle()\n\n Return true if the string is a titlecased string and there is at\n least one character, for example uppercase characters may only\n follow uncased characters and lowercase characters only cased ones.\n Return false otherwise.\n\n For 8-bit strings, this method is locale-dependent.\n\nstr.isupper()\n\n Return true if all cased characters in the string are uppercase and\n there is at least one cased character, false otherwise.\n\n For 8-bit strings, this method is locale-dependent.\n\nstr.join(seq)\n\n Return a string which is the concatenation of the strings in the\n sequence *seq*. The separator between elements is the string\n providing this method.\n\nstr.ljust(width[, fillchar])\n\n Return the string left justified in a string of length *width*.\n Padding is done using the specified *fillchar* (default is a\n space). The original string is returned if *width* is less than\n ``len(s)``.\n\n Changed in version 2.4: Support for the *fillchar* argument.\n\nstr.lower()\n\n Return a copy of the string converted to lowercase.\n\n For 8-bit strings, this method is locale-dependent.\n\nstr.lstrip([chars])\n\n Return a copy of the string with leading characters removed. The\n *chars* argument is a string specifying the set of characters to be\n removed. If omitted or ``None``, the *chars* argument defaults to\n removing whitespace. The *chars* argument is not a prefix; rather,\n all combinations of its values are stripped:\n\n >>> \' spacious \'.lstrip()\n \'spacious \'\n >>> \'www.example.com\'.lstrip(\'cmowz.\')\n \'example.com\'\n\n Changed in version 2.2.2: Support for the *chars* argument.\n\nstr.partition(sep)\n\n Split the string at the first occurrence of *sep*, and return a\n 3-tuple containing the part before the separator, the separator\n itself, and the part after the separator. If the separator is not\n found, return a 3-tuple containing the string itself, followed by\n two empty strings.\n\n New in version 2.5.\n\nstr.replace(old, new[, count])\n\n Return a copy of the string with all occurrences of substring *old*\n replaced by *new*. If the optional argument *count* is given, only\n the first *count* occurrences are replaced.\n\nstr.rfind(sub[, start[, end]])\n\n Return the highest index in the string where substring *sub* is\n found, such that *sub* is contained within s[start,end]. Optional\n arguments *start* and *end* are interpreted as in slice notation.\n Return ``-1`` on failure.\n\nstr.rindex(sub[, start[, end]])\n\n Like ``rfind()`` but raises ``ValueError`` when the substring *sub*\n is not found.\n\nstr.rjust(width[, fillchar])\n\n Return the string right justified in a string of length *width*.\n Padding is done using the specified *fillchar* (default is a\n space). The original string is returned if *width* is less than\n ``len(s)``.\n\n Changed in version 2.4: Support for the *fillchar* argument.\n\nstr.rpartition(sep)\n\n Split the string at the last occurrence of *sep*, and return a\n 3-tuple containing the part before the separator, the separator\n itself, and the part after the separator. If the separator is not\n found, return a 3-tuple containing two empty strings, followed by\n the string itself.\n\n New in version 2.5.\n\nstr.rsplit([sep[, maxsplit]])\n\n Return a list of the words in the string, using *sep* as the\n delimiter string. If *maxsplit* is given, at most *maxsplit* splits\n are done, the *rightmost* ones. If *sep* is not specified or\n ``None``, any whitespace string is a separator. Except for\n splitting from the right, ``rsplit()`` behaves like ``split()``\n which is described in detail below.\n\n New in version 2.4.\n\nstr.rstrip([chars])\n\n Return a copy of the string with trailing characters removed. The\n *chars* argument is a string specifying the set of characters to be\n removed. If omitted or ``None``, the *chars* argument defaults to\n removing whitespace. The *chars* argument is not a suffix; rather,\n all combinations of its values are stripped:\n\n >>> \' spacious \'.rstrip()\n \' spacious\'\n >>> \'mississippi\'.rstrip(\'ipz\')\n \'mississ\'\n\n Changed in version 2.2.2: Support for the *chars* argument.\n\nstr.split([sep[, maxsplit]])\n\n Return a list of the words in the string, using *sep* as the\n delimiter string. If *maxsplit* is given, at most *maxsplit*\n splits are done (thus, the list will have at most ``maxsplit+1``\n elements). If *maxsplit* is not specified, then there is no limit\n on the number of splits (all possible splits are made).\n\n If *sep* is given, consecutive delimiters are not grouped together\n and are deemed to delimit empty strings (for example,\n ``\'1,,2\'.split(\',\')`` returns ``[\'1\', \'\', \'2\']``). The *sep*\n argument may consist of multiple characters (for example,\n ``\'1<>2<>3\'.split(\'<>\')`` returns ``[\'1\', \'2\', \'3\']``). Splitting\n an empty string with a specified separator returns ``[\'\']``.\n\n If *sep* is not specified or is ``None``, a different splitting\n algorithm is applied: runs of consecutive whitespace are regarded\n as a single separator, and the result will contain no empty strings\n at the start or end if the string has leading or trailing\n whitespace. Consequently, splitting an empty string or a string\n consisting of just whitespace with a ``None`` separator returns\n ``[]``.\n\n For example, ``\' 1 2 3 \'.split()`` returns ``[\'1\', \'2\', \'3\']``,\n and ``\' 1 2 3 \'.split(None, 1)`` returns ``[\'1\', \'2 3 \']``.\n\nstr.splitlines([keepends])\n\n Return a list of the lines in the string, breaking at line\n boundaries. Line breaks are not included in the resulting list\n unless *keepends* is given and true.\n\nstr.startswith(prefix[, start[, end]])\n\n Return ``True`` if string starts with the *prefix*, otherwise\n return ``False``. *prefix* can also be a tuple of prefixes to look\n for. With optional *start*, test string beginning at that\n position. With optional *end*, stop comparing string at that\n position.\n\n Changed in version 2.5: Accept tuples as *prefix*.\n\nstr.strip([chars])\n\n Return a copy of the string with the leading and trailing\n characters removed. The *chars* argument is a string specifying the\n set of characters to be removed. If omitted or ``None``, the\n *chars* argument defaults to removing whitespace. The *chars*\n argument is not a prefix or suffix; rather, all combinations of its\n values are stripped:\n\n >>> \' spacious \'.strip()\n \'spacious\'\n >>> \'www.example.com\'.strip(\'cmowz.\')\n \'example\'\n\n Changed in version 2.2.2: Support for the *chars* argument.\n\nstr.swapcase()\n\n Return a copy of the string with uppercase characters converted to\n lowercase and vice versa.\n\n For 8-bit strings, this method is locale-dependent.\n\nstr.title()\n\n Return a titlecased version of the string: words start with\n uppercase characters, all remaining cased characters are lowercase.\n\n For 8-bit strings, this method is locale-dependent.\n\nstr.translate(table[, deletechars])\n\n Return a copy of the string where all characters occurring in the\n optional argument *deletechars* are removed, and the remaining\n characters have been mapped through the given translation table,\n which must be a string of length 256.\n\n You can use the ``maketrans()`` helper function in the ``string``\n module to create a translation table. For string objects, set the\n *table* argument to ``None`` for translations that only delete\n characters:\n\n >>> \'read this short text\'.translate(None, \'aeiou\')\n \'rd ths shrt txt\'\n\n New in version 2.6: Support for a ``None`` *table* argument.\n\n For Unicode objects, the ``translate()`` method does not accept the\n optional *deletechars* argument. Instead, it returns a copy of the\n *s* where all characters have been mapped through the given\n translation table which must be a mapping of Unicode ordinals to\n Unicode ordinals, Unicode strings or ``None``. Unmapped characters\n are left untouched. Characters mapped to ``None`` are deleted.\n Note, a more flexible approach is to create a custom character\n mapping codec using the ``codecs`` module (see ``encodings.cp1251``\n for an example).\n\nstr.upper()\n\n Return a copy of the string converted to uppercase.\n\n For 8-bit strings, this method is locale-dependent.\n\nstr.zfill(width)\n\n Return the numeric string left filled with zeros in a string of\n length *width*. A sign prefix is handled correctly. The original\n string is returned if *width* is less than ``len(s)``.\n\n New in version 2.2.2.\n\nThe following methods are present only on unicode objects:\n\nunicode.isnumeric()\n\n Return ``True`` if there are only numeric characters in S,\n ``False`` otherwise. Numeric characters include digit characters,\n and all characters that have the Unicode numeric value property,\n e.g. U+2155, VULGAR FRACTION ONE FIFTH.\n\nunicode.isdecimal()\n\n Return ``True`` if there are only decimal characters in S,\n ``False`` otherwise. Decimal characters include digit characters,\n and all characters that that can be used to form decimal-radix\n numbers, e.g. U+0660, ARABIC-INDIC DIGIT ZERO.\n', + 'strings': u'\nString literals\n***************\n\nString literals are described by the following lexical definitions:\n\n stringliteral ::= [stringprefix](shortstring | longstring)\n stringprefix ::= "r" | "u" | "ur" | "R" | "U" | "UR" | "Ur" | "uR"\n shortstring ::= "\'" shortstringitem* "\'" | \'"\' shortstringitem* \'"\'\n longstring ::= "\'\'\'" longstringitem* "\'\'\'"\n | \'"""\' longstringitem* \'"""\'\n shortstringitem ::= shortstringchar | escapeseq\n longstringitem ::= longstringchar | escapeseq\n shortstringchar ::= \n longstringchar ::= \n escapeseq ::= "\\" \n\nOne syntactic restriction not indicated by these productions is that\nwhitespace is not allowed between the **stringprefix** and the rest of\nthe string literal. The source character set is defined by the\nencoding declaration; it is ASCII if no encoding declaration is given\nin the source file; see section *Encoding declarations*.\n\nIn plain English: String literals can be enclosed in matching single\nquotes (``\'``) or double quotes (``"``). They can also be enclosed in\nmatching groups of three single or double quotes (these are generally\nreferred to as *triple-quoted strings*). The backslash (``\\``)\ncharacter is used to escape characters that otherwise have a special\nmeaning, such as newline, backslash itself, or the quote character.\nString literals may optionally be prefixed with a letter ``\'r\'`` or\n``\'R\'``; such strings are called *raw strings* and use different rules\nfor interpreting backslash escape sequences. A prefix of ``\'u\'`` or\n``\'U\'`` makes the string a Unicode string. Unicode strings use the\nUnicode character set as defined by the Unicode Consortium and ISO\n10646. Some additional escape sequences, described below, are\navailable in Unicode strings. The two prefix characters may be\ncombined; in this case, ``\'u\'`` must appear before ``\'r\'``.\n\nIn triple-quoted strings, unescaped newlines and quotes are allowed\n(and are retained), except that three unescaped quotes in a row\nterminate the string. (A "quote" is the character used to open the\nstring, i.e. either ``\'`` or ``"``.)\n\nUnless an ``\'r\'`` or ``\'R\'`` prefix is present, escape sequences in\nstrings are interpreted according to rules similar to those used by\nStandard C. The recognized escape sequences are:\n\n+-------------------+-----------------------------------+---------+\n| Escape Sequence | Meaning | Notes |\n+===================+===================================+=========+\n| ``\\newline`` | Ignored | |\n+-------------------+-----------------------------------+---------+\n| ``\\\\`` | Backslash (``\\``) | |\n+-------------------+-----------------------------------+---------+\n| ``\\\'`` | Single quote (``\'``) | |\n+-------------------+-----------------------------------+---------+\n| ``\\"`` | Double quote (``"``) | |\n+-------------------+-----------------------------------+---------+\n| ``\\a`` | ASCII Bell (BEL) | |\n+-------------------+-----------------------------------+---------+\n| ``\\b`` | ASCII Backspace (BS) | |\n+-------------------+-----------------------------------+---------+\n| ``\\f`` | ASCII Formfeed (FF) | |\n+-------------------+-----------------------------------+---------+\n| ``\\n`` | ASCII Linefeed (LF) | |\n+-------------------+-----------------------------------+---------+\n| ``\\N{name}`` | Character named *name* in the | |\n| | Unicode database (Unicode only) | |\n+-------------------+-----------------------------------+---------+\n| ``\\r`` | ASCII Carriage Return (CR) | |\n+-------------------+-----------------------------------+---------+\n| ``\\t`` | ASCII Horizontal Tab (TAB) | |\n+-------------------+-----------------------------------+---------+\n| ``\\uxxxx`` | Character with 16-bit hex value | (1) |\n| | *xxxx* (Unicode only) | |\n+-------------------+-----------------------------------+---------+\n| ``\\Uxxxxxxxx`` | Character with 32-bit hex value | (2) |\n| | *xxxxxxxx* (Unicode only) | |\n+-------------------+-----------------------------------+---------+\n| ``\\v`` | ASCII Vertical Tab (VT) | |\n+-------------------+-----------------------------------+---------+\n| ``\\ooo`` | Character with octal value *ooo* | (3,5) |\n+-------------------+-----------------------------------+---------+\n| ``\\xhh`` | Character with hex value *hh* | (4,5) |\n+-------------------+-----------------------------------+---------+\n\nNotes:\n\n1. Individual code units which form parts of a surrogate pair can be\n encoded using this escape sequence.\n\n2. Any Unicode character can be encoded this way, but characters\n outside the Basic Multilingual Plane (BMP) will be encoded using a\n surrogate pair if Python is compiled to use 16-bit code units (the\n default). Individual code units which form parts of a surrogate\n pair can be encoded using this escape sequence.\n\n3. As in Standard C, up to three octal digits are accepted.\n\n4. Unlike in Standard C, exactly two hex digits are required.\n\n5. In a string literal, hexadecimal and octal escapes denote the byte\n with the given value; it is not necessary that the byte encodes a\n character in the source character set. In a Unicode literal, these\n escapes denote a Unicode character with the given value.\n\nUnlike Standard C, all unrecognized escape sequences are left in the\nstring unchanged, i.e., *the backslash is left in the string*. (This\nbehavior is useful when debugging: if an escape sequence is mistyped,\nthe resulting output is more easily recognized as broken.) It is also\nimportant to note that the escape sequences marked as "(Unicode only)"\nin the table above fall into the category of unrecognized escapes for\nnon-Unicode string literals.\n\nWhen an ``\'r\'`` or ``\'R\'`` prefix is present, a character following a\nbackslash is included in the string without change, and *all\nbackslashes are left in the string*. For example, the string literal\n``r"\\n"`` consists of two characters: a backslash and a lowercase\n``\'n\'``. String quotes can be escaped with a backslash, but the\nbackslash remains in the string; for example, ``r"\\""`` is a valid\nstring literal consisting of two characters: a backslash and a double\nquote; ``r"\\"`` is not a valid string literal (even a raw string\ncannot end in an odd number of backslashes). Specifically, *a raw\nstring cannot end in a single backslash* (since the backslash would\nescape the following quote character). Note also that a single\nbackslash followed by a newline is interpreted as those two characters\nas part of the string, *not* as a line continuation.\n\nWhen an ``\'r\'`` or ``\'R\'`` prefix is used in conjunction with a\n``\'u\'`` or ``\'U\'`` prefix, then the ``\\uXXXX`` and ``\\UXXXXXXXX``\nescape sequences are processed while *all other backslashes are left\nin the string*. For example, the string literal ``ur"\\u0062\\n"``\nconsists of three Unicode characters: \'LATIN SMALL LETTER B\', \'REVERSE\nSOLIDUS\', and \'LATIN SMALL LETTER N\'. Backslashes can be escaped with\na preceding backslash; however, both remain in the string. As a\nresult, ``\\uXXXX`` escape sequences are only recognized when there are\nan odd number of backslashes.\n', 'subscriptions': u'\nSubscriptions\n*************\n\nA subscription selects an item of a sequence (string, tuple or list)\nor mapping (dictionary) object:\n\n subscription ::= primary "[" expression_list "]"\n\nThe primary must evaluate to an object of a sequence or mapping type.\n\nIf the primary is a mapping, the expression list must evaluate to an\nobject whose value is one of the keys of the mapping, and the\nsubscription selects the value in the mapping that corresponds to that\nkey. (The expression list is a tuple except if it has exactly one\nitem.)\n\nIf the primary is a sequence, the expression (list) must evaluate to a\nplain integer. If this value is negative, the length of the sequence\nis added to it (so that, e.g., ``x[-1]`` selects the last item of\n``x``.) The resulting value must be a nonnegative integer less than\nthe number of items in the sequence, and the subscription selects the\nitem whose index is that value (counting from zero).\n\nA string\'s items are characters. A character is not a separate data\ntype but a string of exactly one character.\n', 'truth': u"\nTruth Value Testing\n*******************\n\nAny object can be tested for truth value, for use in an ``if`` or\n``while`` condition or as operand of the Boolean operations below. The\nfollowing values are considered false:\n\n* ``None``\n\n* ``False``\n\n* zero of any numeric type, for example, ``0``, ``0L``, ``0.0``,\n ``0j``.\n\n* any empty sequence, for example, ``''``, ``()``, ``[]``.\n\n* any empty mapping, for example, ``{}``.\n\n* instances of user-defined classes, if the class defines a\n ``__nonzero__()`` or ``__len__()`` method, when that method returns\n the integer zero or ``bool`` value ``False``. [1]\n\nAll other values are considered true --- so objects of many types are\nalways true.\n\nOperations and built-in functions that have a Boolean result always\nreturn ``0`` or ``False`` for false and ``1`` or ``True`` for true,\nunless otherwise stated. (Important exception: the Boolean operations\n``or`` and ``and`` always return one of their operands.)\n", 'try': u'\nThe ``try`` statement\n*********************\n\nThe ``try`` statement specifies exception handlers and/or cleanup code\nfor a group of statements:\n\n try_stmt ::= try1_stmt | try2_stmt\n try1_stmt ::= "try" ":" suite\n ("except" [expression ["," target]] ":" suite)+\n ["else" ":" suite]\n ["finally" ":" suite]\n try2_stmt ::= "try" ":" suite\n "finally" ":" suite\n\nChanged in version 2.5: In previous versions of Python,\n``try``...``except``...``finally`` did not work. ``try``...``except``\nhad to be nested in ``try``...``finally``.\n\nThe ``except`` clause(s) specify one or more exception handlers. When\nno exception occurs in the ``try`` clause, no exception handler is\nexecuted. When an exception occurs in the ``try`` suite, a search for\nan exception handler is started. This search inspects the except\nclauses in turn until one is found that matches the exception. An\nexpression-less except clause, if present, must be last; it matches\nany exception. For an except clause with an expression, that\nexpression is evaluated, and the clause matches the exception if the\nresulting object is "compatible" with the exception. An object is\ncompatible with an exception if it is the class or a base class of the\nexception object, a tuple containing an item compatible with the\nexception, or, in the (deprecated) case of string exceptions, is the\nraised string itself (note that the object identities must match, i.e.\nit must be the same string object, not just a string with the same\nvalue).\n\nIf no except clause matches the exception, the search for an exception\nhandler continues in the surrounding code and on the invocation stack.\n[1]\n\nIf the evaluation of an expression in the header of an except clause\nraises an exception, the original search for a handler is canceled and\na search starts for the new exception in the surrounding code and on\nthe call stack (it is treated as if the entire ``try`` statement\nraised the exception).\n\nWhen a matching except clause is found, the exception is assigned to\nthe target specified in that except clause, if present, and the except\nclause\'s suite is executed. All except clauses must have an\nexecutable block. When the end of this block is reached, execution\ncontinues normally after the entire try statement. (This means that\nif two nested handlers exist for the same exception, and the exception\noccurs in the try clause of the inner handler, the outer handler will\nnot handle the exception.)\n\nBefore an except clause\'s suite is executed, details about the\nexception are assigned to three variables in the ``sys`` module:\n``sys.exc_type`` receives the object identifying the exception;\n``sys.exc_value`` receives the exception\'s parameter;\n``sys.exc_traceback`` receives a traceback object (see section *The\nstandard type hierarchy*) identifying the point in the program where\nthe exception occurred. These details are also available through the\n``sys.exc_info()`` function, which returns a tuple ``(exc_type,\nexc_value, exc_traceback)``. Use of the corresponding variables is\ndeprecated in favor of this function, since their use is unsafe in a\nthreaded program. As of Python 1.5, the variables are restored to\ntheir previous values (before the call) when returning from a function\nthat handled an exception.\n\nThe optional ``else`` clause is executed if and when control flows off\nthe end of the ``try`` clause. [2] Exceptions in the ``else`` clause\nare not handled by the preceding ``except`` clauses.\n\nIf ``finally`` is present, it specifies a \'cleanup\' handler. The\n``try`` clause is executed, including any ``except`` and ``else``\nclauses. If an exception occurs in any of the clauses and is not\nhandled, the exception is temporarily saved. The ``finally`` clause is\nexecuted. If there is a saved exception, it is re-raised at the end\nof the ``finally`` clause. If the ``finally`` clause raises another\nexception or executes a ``return`` or ``break`` statement, the saved\nexception is lost. The exception information is not available to the\nprogram during execution of the ``finally`` clause.\n\nWhen a ``return``, ``break`` or ``continue`` statement is executed in\nthe ``try`` suite of a ``try``...``finally`` statement, the\n``finally`` clause is also executed \'on the way out.\' A ``continue``\nstatement is illegal in the ``finally`` clause. (The reason is a\nproblem with the current implementation --- this restriction may be\nlifted in the future).\n\nAdditional information on exceptions can be found in section\n*Exceptions*, and information on using the ``raise`` statement to\ngenerate exceptions may be found in section *The raise statement*.\n', - 'types': u'\nThe standard type hierarchy\n***************************\n\nBelow is a list of the types that are built into Python. Extension\nmodules (written in C, Java, or other languages, depending on the\nimplementation) can define additional types. Future versions of\nPython may add types to the type hierarchy (e.g., rational numbers,\nefficiently stored arrays of integers, etc.).\n\nSome of the type descriptions below contain a paragraph listing\n\'special attributes.\' These are attributes that provide access to the\nimplementation and are not intended for general use. Their definition\nmay change in the future.\n\nNone\n This type has a single value. There is a single object with this\n value. This object is accessed through the built-in name ``None``.\n It is used to signify the absence of a value in many situations,\n e.g., it is returned from functions that don\'t explicitly return\n anything. Its truth value is false.\n\nNotImplemented\n This type has a single value. There is a single object with this\n value. This object is accessed through the built-in name\n ``NotImplemented``. Numeric methods and rich comparison methods may\n return this value if they do not implement the operation for the\n operands provided. (The interpreter will then try the reflected\n operation, or some other fallback, depending on the operator.) Its\n truth value is true.\n\nEllipsis\n This type has a single value. There is a single object with this\n value. This object is accessed through the built-in name\n ``Ellipsis``. It is used to indicate the presence of the ``...``\n syntax in a slice. Its truth value is true.\n\n``numbers.Number``\n These are created by numeric literals and returned as results by\n arithmetic operators and arithmetic built-in functions. Numeric\n objects are immutable; once created their value never changes.\n Python numbers are of course strongly related to mathematical\n numbers, but subject to the limitations of numerical representation\n in computers.\n\n Python distinguishes between integers, floating point numbers, and\n complex numbers:\n\n ``numbers.Integral``\n These represent elements from the mathematical set of integers\n (positive and negative).\n\n There are three types of integers:\n\n Plain integers\n These represent numbers in the range -2147483648 through\n 2147483647. (The range may be larger on machines with a\n larger natural word size, but not smaller.) When the result\n of an operation would fall outside this range, the result is\n normally returned as a long integer (in some cases, the\n exception ``OverflowError`` is raised instead). For the\n purpose of shift and mask operations, integers are assumed to\n have a binary, 2\'s complement notation using 32 or more bits,\n and hiding no bits from the user (i.e., all 4294967296\n different bit patterns correspond to different values).\n\n Long integers\n These represent numbers in an unlimited range, subject to\n available (virtual) memory only. For the purpose of shift\n and mask operations, a binary representation is assumed, and\n negative numbers are represented in a variant of 2\'s\n complement which gives the illusion of an infinite string of\n sign bits extending to the left.\n\n Booleans\n These represent the truth values False and True. The two\n objects representing the values False and True are the only\n Boolean objects. The Boolean type is a subtype of plain\n integers, and Boolean values behave like the values 0 and 1,\n respectively, in almost all contexts, the exception being\n that when converted to a string, the strings ``"False"`` or\n ``"True"`` are returned, respectively.\n\n The rules for integer representation are intended to give the\n most meaningful interpretation of shift and mask operations\n involving negative integers and the least surprises when\n switching between the plain and long integer domains. Any\n operation, if it yields a result in the plain integer domain,\n will yield the same result in the long integer domain or when\n using mixed operands. The switch between domains is transparent\n to the programmer.\n\n ``numbers.Real`` (``float``)\n These represent machine-level double precision floating point\n numbers. You are at the mercy of the underlying machine\n architecture (and C or Java implementation) for the accepted\n range and handling of overflow. Python does not support single-\n precision floating point numbers; the savings in processor and\n memory usage that are usually the reason for using these is\n dwarfed by the overhead of using objects in Python, so there is\n no reason to complicate the language with two kinds of floating\n point numbers.\n\n ``numbers.Complex``\n These represent complex numbers as a pair of machine-level\n double precision floating point numbers. The same caveats apply\n as for floating point numbers. The real and imaginary parts of a\n complex number ``z`` can be retrieved through the read-only\n attributes ``z.real`` and ``z.imag``.\n\nSequences\n These represent finite ordered sets indexed by non-negative\n numbers. The built-in function ``len()`` returns the number of\n items of a sequence. When the length of a sequence is *n*, the\n index set contains the numbers 0, 1, ..., *n*-1. Item *i* of\n sequence *a* is selected by ``a[i]``.\n\n Sequences also support slicing: ``a[i:j]`` selects all items with\n index *k* such that *i* ``<=`` *k* ``<`` *j*. When used as an\n expression, a slice is a sequence of the same type. This implies\n that the index set is renumbered so that it starts at 0.\n\n Some sequences also support "extended slicing" with a third "step"\n parameter: ``a[i:j:k]`` selects all items of *a* with index *x*\n where ``x = i + n*k``, *n* ``>=`` ``0`` and *i* ``<=`` *x* ``<``\n *j*.\n\n Sequences are distinguished according to their mutability:\n\n Immutable sequences\n An object of an immutable sequence type cannot change once it is\n created. (If the object contains references to other objects,\n these other objects may be mutable and may be changed; however,\n the collection of objects directly referenced by an immutable\n object cannot change.)\n\n The following types are immutable sequences:\n\n Strings\n The items of a string are characters. There is no separate\n character type; a character is represented by a string of one\n item. Characters represent (at least) 8-bit bytes. The\n built-in functions ``chr()`` and ``ord()`` convert between\n characters and nonnegative integers representing the byte\n values. Bytes with the values 0-127 usually represent the\n corresponding ASCII values, but the interpretation of values\n is up to the program. The string data type is also used to\n represent arrays of bytes, e.g., to hold data read from a\n file.\n\n (On systems whose native character set is not ASCII, strings\n may use EBCDIC in their internal representation, provided the\n functions ``chr()`` and ``ord()`` implement a mapping between\n ASCII and EBCDIC, and string comparison preserves the ASCII\n order. Or perhaps someone can propose a better rule?)\n\n Unicode\n The items of a Unicode object are Unicode code units. A\n Unicode code unit is represented by a Unicode object of one\n item and can hold either a 16-bit or 32-bit value\n representing a Unicode ordinal (the maximum value for the\n ordinal is given in ``sys.maxunicode``, and depends on how\n Python is configured at compile time). Surrogate pairs may\n be present in the Unicode object, and will be reported as two\n separate items. The built-in functions ``unichr()`` and\n ``ord()`` convert between code units and nonnegative integers\n representing the Unicode ordinals as defined in the Unicode\n Standard 3.0. Conversion from and to other encodings are\n possible through the Unicode method ``encode()`` and the\n built-in function ``unicode()``.\n\n Tuples\n The items of a tuple are arbitrary Python objects. Tuples of\n two or more items are formed by comma-separated lists of\n expressions. A tuple of one item (a \'singleton\') can be\n formed by affixing a comma to an expression (an expression by\n itself does not create a tuple, since parentheses must be\n usable for grouping of expressions). An empty tuple can be\n formed by an empty pair of parentheses.\n\n Mutable sequences\n Mutable sequences can be changed after they are created. The\n subscription and slicing notations can be used as the target of\n assignment and ``del`` (delete) statements.\n\n There is currently a single intrinsic mutable sequence type:\n\n Lists\n The items of a list are arbitrary Python objects. Lists are\n formed by placing a comma-separated list of expressions in\n square brackets. (Note that there are no special cases needed\n to form lists of length 0 or 1.)\n\n The extension module ``array`` provides an additional example of\n a mutable sequence type.\n\nSet types\n These represent unordered, finite sets of unique, immutable\n objects. As such, they cannot be indexed by any subscript. However,\n they can be iterated over, and the built-in function ``len()``\n returns the number of items in a set. Common uses for sets are fast\n membership testing, removing duplicates from a sequence, and\n computing mathematical operations such as intersection, union,\n difference, and symmetric difference.\n\n For set elements, the same immutability rules apply as for\n dictionary keys. Note that numeric types obey the normal rules for\n numeric comparison: if two numbers compare equal (e.g., ``1`` and\n ``1.0``), only one of them can be contained in a set.\n\n There are currently two intrinsic set types:\n\n Sets\n These represent a mutable set. They are created by the built-in\n ``set()`` constructor and can be modified afterwards by several\n methods, such as ``add()``.\n\n Frozen sets\n These represent an immutable set. They are created by the\n built-in ``frozenset()`` constructor. As a frozenset is\n immutable and *hashable*, it can be used again as an element of\n another set, or as a dictionary key.\n\nMappings\n These represent finite sets of objects indexed by arbitrary index\n sets. The subscript notation ``a[k]`` selects the item indexed by\n ``k`` from the mapping ``a``; this can be used in expressions and\n as the target of assignments or ``del`` statements. The built-in\n function ``len()`` returns the number of items in a mapping.\n\n There is currently a single intrinsic mapping type:\n\n Dictionaries\n These represent finite sets of objects indexed by nearly\n arbitrary values. The only types of values not acceptable as\n keys are values containing lists or dictionaries or other\n mutable types that are compared by value rather than by object\n identity, the reason being that the efficient implementation of\n dictionaries requires a key\'s hash value to remain constant.\n Numeric types used for keys obey the normal rules for numeric\n comparison: if two numbers compare equal (e.g., ``1`` and\n ``1.0``) then they can be used interchangeably to index the same\n dictionary entry.\n\n Dictionaries are mutable; they can be created by the ``{...}``\n notation (see section *Dictionary displays*).\n\n The extension modules ``dbm``, ``gdbm``, and ``bsddb`` provide\n additional examples of mapping types.\n\nCallable types\n These are the types to which the function call operation (see\n section *Calls*) can be applied:\n\n User-defined functions\n A user-defined function object is created by a function\n definition (see section *Function definitions*). It should be\n called with an argument list containing the same number of items\n as the function\'s formal parameter list.\n\n Special attributes:\n\n +-------------------------+---------------------------------+-------------+\n | Attribute | Meaning | |\n +=========================+=================================+=============+\n | ``func_doc`` | The function\'s documentation | Writable |\n | | string, or ``None`` if | |\n | | unavailable | |\n +-------------------------+---------------------------------+-------------+\n | ``__doc__`` | Another way of spelling | Writable |\n | | ``func_doc`` | |\n +-------------------------+---------------------------------+-------------+\n | ``func_name`` | The function\'s name | Writable |\n +-------------------------+---------------------------------+-------------+\n | ``__name__`` | Another way of spelling | Writable |\n | | ``func_name`` | |\n +-------------------------+---------------------------------+-------------+\n | ``__module__`` | The name of the module the | Writable |\n | | function was defined in, or | |\n | | ``None`` if unavailable. | |\n +-------------------------+---------------------------------+-------------+\n | ``func_defaults`` | A tuple containing default | Writable |\n | | argument values for those | |\n | | arguments that have defaults, | |\n | | or ``None`` if no arguments | |\n | | have a default value | |\n +-------------------------+---------------------------------+-------------+\n | ``func_code`` | The code object representing | Writable |\n | | the compiled function body. | |\n +-------------------------+---------------------------------+-------------+\n | ``func_globals`` | A reference to the dictionary | Read-only |\n | | that holds the function\'s | |\n | | global variables --- the global | |\n | | namespace of the module in | |\n | | which the function was defined. | |\n +-------------------------+---------------------------------+-------------+\n | ``func_dict`` | The namespace supporting | Writable |\n | | arbitrary function attributes. | |\n +-------------------------+---------------------------------+-------------+\n | ``func_closure`` | ``None`` or a tuple of cells | Read-only |\n | | that contain bindings for the | |\n | | function\'s free variables. | |\n +-------------------------+---------------------------------+-------------+\n\n Most of the attributes labelled "Writable" check the type of the\n assigned value.\n\n Changed in version 2.4: ``func_name`` is now writable.\n\n Function objects also support getting and setting arbitrary\n attributes, which can be used, for example, to attach metadata\n to functions. Regular attribute dot-notation is used to get and\n set such attributes. *Note that the current implementation only\n supports function attributes on user-defined functions. Function\n attributes on built-in functions may be supported in the\n future.*\n\n Additional information about a function\'s definition can be\n retrieved from its code object; see the description of internal\n types below.\n\n User-defined methods\n A user-defined method object combines a class, a class instance\n (or ``None``) and any callable object (normally a user-defined\n function).\n\n Special read-only attributes: ``im_self`` is the class instance\n object, ``im_func`` is the function object; ``im_class`` is the\n class of ``im_self`` for bound methods or the class that asked\n for the method for unbound methods; ``__doc__`` is the method\'s\n documentation (same as ``im_func.__doc__``); ``__name__`` is the\n method name (same as ``im_func.__name__``); ``__module__`` is\n the name of the module the method was defined in, or ``None`` if\n unavailable.\n\n Changed in version 2.2: ``im_self`` used to refer to the class\n that defined the method.\n\n Changed in version 2.6: For 3.0 forward-compatibility,\n ``im_func`` is also available as ``__func__``, and ``im_self``\n as ``__self__``.\n\n Methods also support accessing (but not setting) the arbitrary\n function attributes on the underlying function object.\n\n User-defined method objects may be created when getting an\n attribute of a class (perhaps via an instance of that class), if\n that attribute is a user-defined function object, an unbound\n user-defined method object, or a class method object. When the\n attribute is a user-defined method object, a new method object\n is only created if the class from which it is being retrieved is\n the same as, or a derived class of, the class stored in the\n original method object; otherwise, the original method object is\n used as it is.\n\n When a user-defined method object is created by retrieving a\n user-defined function object from a class, its ``im_self``\n attribute is ``None`` and the method object is said to be\n unbound. When one is created by retrieving a user-defined\n function object from a class via one of its instances, its\n ``im_self`` attribute is the instance, and the method object is\n said to be bound. In either case, the new method\'s ``im_class``\n attribute is the class from which the retrieval takes place, and\n its ``im_func`` attribute is the original function object.\n\n When a user-defined method object is created by retrieving\n another method object from a class or instance, the behaviour is\n the same as for a function object, except that the ``im_func``\n attribute of the new instance is not the original method object\n but its ``im_func`` attribute.\n\n When a user-defined method object is created by retrieving a\n class method object from a class or instance, its ``im_self``\n attribute is the class itself (the same as the ``im_class``\n attribute), and its ``im_func`` attribute is the function object\n underlying the class method.\n\n When an unbound user-defined method object is called, the\n underlying function (``im_func``) is called, with the\n restriction that the first argument must be an instance of the\n proper class (``im_class``) or of a derived class thereof.\n\n When a bound user-defined method object is called, the\n underlying function (``im_func``) is called, inserting the class\n instance (``im_self``) in front of the argument list. For\n instance, when ``C`` is a class which contains a definition for\n a function ``f()``, and ``x`` is an instance of ``C``, calling\n ``x.f(1)`` is equivalent to calling ``C.f(x, 1)``.\n\n When a user-defined method object is derived from a class method\n object, the "class instance" stored in ``im_self`` will actually\n be the class itself, so that calling either ``x.f(1)`` or\n ``C.f(1)`` is equivalent to calling ``f(C,1)`` where ``f`` is\n the underlying function.\n\n Note that the transformation from function object to (unbound or\n bound) method object happens each time the attribute is\n retrieved from the class or instance. In some cases, a fruitful\n optimization is to assign the attribute to a local variable and\n call that local variable. Also notice that this transformation\n only happens for user-defined functions; other callable objects\n (and all non-callable objects) are retrieved without\n transformation. It is also important to note that user-defined\n functions which are attributes of a class instance are not\n converted to bound methods; this *only* happens when the\n function is an attribute of the class.\n\n Generator functions\n A function or method which uses the ``yield`` statement (see\n section *The yield statement*) is called a *generator function*.\n Such a function, when called, always returns an iterator object\n which can be used to execute the body of the function: calling\n the iterator\'s ``next()`` method will cause the function to\n execute until it provides a value using the ``yield`` statement.\n When the function executes a ``return`` statement or falls off\n the end, a ``StopIteration`` exception is raised and the\n iterator will have reached the end of the set of values to be\n returned.\n\n Built-in functions\n A built-in function object is a wrapper around a C function.\n Examples of built-in functions are ``len()`` and ``math.sin()``\n (``math`` is a standard built-in module). The number and type of\n the arguments are determined by the C function. Special read-\n only attributes: ``__doc__`` is the function\'s documentation\n string, or ``None`` if unavailable; ``__name__`` is the\n function\'s name; ``__self__`` is set to ``None`` (but see the\n next item); ``__module__`` is the name of the module the\n function was defined in or ``None`` if unavailable.\n\n Built-in methods\n This is really a different disguise of a built-in function, this\n time containing an object passed to the C function as an\n implicit extra argument. An example of a built-in method is\n ``alist.append()``, assuming *alist* is a list object. In this\n case, the special read-only attribute ``__self__`` is set to the\n object denoted by *list*.\n\n Class Types\n Class types, or "new-style classes," are callable. These\n objects normally act as factories for new instances of\n themselves, but variations are possible for class types that\n override ``__new__()``. The arguments of the call are passed to\n ``__new__()`` and, in the typical case, to ``__init__()`` to\n initialize the new instance.\n\n Classic Classes\n Class objects are described below. When a class object is\n called, a new class instance (also described below) is created\n and returned. This implies a call to the class\'s ``__init__()``\n method if it has one. Any arguments are passed on to the\n ``__init__()`` method. If there is no ``__init__()`` method,\n the class must be called without arguments.\n\n Class instances\n Class instances are described below. Class instances are\n callable only when the class has a ``__call__()`` method;\n ``x(arguments)`` is a shorthand for ``x.__call__(arguments)``.\n\nModules\n Modules are imported by the ``import`` statement (see section *The\n import statement*). A module object has a namespace implemented by\n a dictionary object (this is the dictionary referenced by the\n func_globals attribute of functions defined in the module).\n Attribute references are translated to lookups in this dictionary,\n e.g., ``m.x`` is equivalent to ``m.__dict__["x"]``. A module object\n does not contain the code object used to initialize the module\n (since it isn\'t needed once the initialization is done).\n\n Attribute assignment updates the module\'s namespace dictionary,\n e.g., ``m.x = 1`` is equivalent to ``m.__dict__["x"] = 1``.\n\n Special read-only attribute: ``__dict__`` is the module\'s namespace\n as a dictionary object.\n\n Predefined (writable) attributes: ``__name__`` is the module\'s\n name; ``__doc__`` is the module\'s documentation string, or ``None``\n if unavailable; ``__file__`` is the pathname of the file from which\n the module was loaded, if it was loaded from a file. The\n ``__file__`` attribute is not present for C modules that are\n statically linked into the interpreter; for extension modules\n loaded dynamically from a shared library, it is the pathname of the\n shared library file.\n\nClasses\n Class objects are created by class definitions (see section *Class\n definitions*). A class has a namespace implemented by a dictionary\n object. Class attribute references are translated to lookups in\n this dictionary, e.g., ``C.x`` is translated to\n ``C.__dict__["x"]``. When the attribute name is not found there,\n the attribute search continues in the base classes. The search is\n depth-first, left-to-right in the order of occurrence in the base\n class list.\n\n When a class attribute reference (for class ``C``, say) would yield\n a user-defined function object or an unbound user-defined method\n object whose associated class is either ``C`` or one of its base\n classes, it is transformed into an unbound user-defined method\n object whose ``im_class`` attribute is ``C``. When it would yield a\n class method object, it is transformed into a bound user-defined\n method object whose ``im_class`` and ``im_self`` attributes are\n both ``C``. When it would yield a static method object, it is\n transformed into the object wrapped by the static method object.\n See section *Implementing Descriptors* for another way in which\n attributes retrieved from a class may differ from those actually\n contained in its ``__dict__``.\n\n Class attribute assignments update the class\'s dictionary, never\n the dictionary of a base class.\n\n A class object can be called (see above) to yield a class instance\n (see below).\n\n Special attributes: ``__name__`` is the class name; ``__module__``\n is the module name in which the class was defined; ``__dict__`` is\n the dictionary containing the class\'s namespace; ``__bases__`` is a\n tuple (possibly empty or a singleton) containing the base classes,\n in the order of their occurrence in the base class list;\n ``__doc__`` is the class\'s documentation string, or None if\n undefined.\n\nClass instances\n A class instance is created by calling a class object (see above).\n A class instance has a namespace implemented as a dictionary which\n is the first place in which attribute references are searched.\n When an attribute is not found there, and the instance\'s class has\n an attribute by that name, the search continues with the class\n attributes. If a class attribute is found that is a user-defined\n function object or an unbound user-defined method object whose\n associated class is the class (call it ``C``) of the instance for\n which the attribute reference was initiated or one of its bases, it\n is transformed into a bound user-defined method object whose\n ``im_class`` attribute is ``C`` and whose ``im_self`` attribute is\n the instance. Static method and class method objects are also\n transformed, as if they had been retrieved from class ``C``; see\n above under "Classes". See section *Implementing Descriptors* for\n another way in which attributes of a class retrieved via its\n instances may differ from the objects actually stored in the\n class\'s ``__dict__``. If no class attribute is found, and the\n object\'s class has a ``__getattr__()`` method, that is called to\n satisfy the lookup.\n\n Attribute assignments and deletions update the instance\'s\n dictionary, never a class\'s dictionary. If the class has a\n ``__setattr__()`` or ``__delattr__()`` method, this is called\n instead of updating the instance dictionary directly.\n\n Class instances can pretend to be numbers, sequences, or mappings\n if they have methods with certain special names. See section\n *Special method names*.\n\n Special attributes: ``__dict__`` is the attribute dictionary;\n ``__class__`` is the instance\'s class.\n\nFiles\n A file object represents an open file. File objects are created by\n the ``open()`` built-in function, and also by ``os.popen()``,\n ``os.fdopen()``, and the ``makefile()`` method of socket objects\n (and perhaps by other functions or methods provided by extension\n modules). The objects ``sys.stdin``, ``sys.stdout`` and\n ``sys.stderr`` are initialized to file objects corresponding to the\n interpreter\'s standard input, output and error streams. See *File\n Objects* for complete documentation of file objects.\n\nInternal types\n A few types used internally by the interpreter are exposed to the\n user. Their definitions may change with future versions of the\n interpreter, but they are mentioned here for completeness.\n\n Code objects\n Code objects represent *byte-compiled* executable Python code,\n or *bytecode*. The difference between a code object and a\n function object is that the function object contains an explicit\n reference to the function\'s globals (the module in which it was\n defined), while a code object contains no context; also the\n default argument values are stored in the function object, not\n in the code object (because they represent values calculated at\n run-time). Unlike function objects, code objects are immutable\n and contain no references (directly or indirectly) to mutable\n objects.\n\n Special read-only attributes: ``co_name`` gives the function\n name; ``co_argcount`` is the number of positional arguments\n (including arguments with default values); ``co_nlocals`` is the\n number of local variables used by the function (including\n arguments); ``co_varnames`` is a tuple containing the names of\n the local variables (starting with the argument names);\n ``co_cellvars`` is a tuple containing the names of local\n variables that are referenced by nested functions;\n ``co_freevars`` is a tuple containing the names of free\n variables; ``co_code`` is a string representing the sequence of\n bytecode instructions; ``co_consts`` is a tuple containing the\n literals used by the bytecode; ``co_names`` is a tuple\n containing the names used by the bytecode; ``co_filename`` is\n the filename from which the code was compiled;\n ``co_firstlineno`` is the first line number of the function;\n ``co_lnotab`` is a string encoding the mapping from bytecode\n offsets to line numbers (for details see the source code of the\n interpreter); ``co_stacksize`` is the required stack size\n (including local variables); ``co_flags`` is an integer encoding\n a number of flags for the interpreter.\n\n The following flag bits are defined for ``co_flags``: bit\n ``0x04`` is set if the function uses the ``*arguments`` syntax\n to accept an arbitrary number of positional arguments; bit\n ``0x08`` is set if the function uses the ``**keywords`` syntax\n to accept arbitrary keyword arguments; bit ``0x20`` is set if\n the function is a generator.\n\n Future feature declarations (``from __future__ import\n division``) also use bits in ``co_flags`` to indicate whether a\n code object was compiled with a particular feature enabled: bit\n ``0x2000`` is set if the function was compiled with future\n division enabled; bits ``0x10`` and ``0x1000`` were used in\n earlier versions of Python.\n\n Other bits in ``co_flags`` are reserved for internal use.\n\n If a code object represents a function, the first item in\n ``co_consts`` is the documentation string of the function, or\n ``None`` if undefined.\n\n Frame objects\n Frame objects represent execution frames. They may occur in\n traceback objects (see below).\n\n Special read-only attributes: ``f_back`` is to the previous\n stack frame (towards the caller), or ``None`` if this is the\n bottom stack frame; ``f_code`` is the code object being executed\n in this frame; ``f_locals`` is the dictionary used to look up\n local variables; ``f_globals`` is used for global variables;\n ``f_builtins`` is used for built-in (intrinsic) names;\n ``f_restricted`` is a flag indicating whether the function is\n executing in restricted execution mode; ``f_lasti`` gives the\n precise instruction (this is an index into the bytecode string\n of the code object).\n\n Special writable attributes: ``f_trace``, if not ``None``, is a\n function called at the start of each source code line (this is\n used by the debugger); ``f_exc_type``, ``f_exc_value``,\n ``f_exc_traceback`` represent the last exception raised in the\n parent frame provided another exception was ever raised in the\n current frame (in all other cases they are None); ``f_lineno``\n is the current line number of the frame --- writing to this from\n within a trace function jumps to the given line (only for the\n bottom-most frame). A debugger can implement a Jump command\n (aka Set Next Statement) by writing to f_lineno.\n\n Traceback objects\n Traceback objects represent a stack trace of an exception. A\n traceback object is created when an exception occurs. When the\n search for an exception handler unwinds the execution stack, at\n each unwound level a traceback object is inserted in front of\n the current traceback. When an exception handler is entered,\n the stack trace is made available to the program. (See section\n *The try statement*.) It is accessible as ``sys.exc_traceback``,\n and also as the third item of the tuple returned by\n ``sys.exc_info()``. The latter is the preferred interface,\n since it works correctly when the program is using multiple\n threads. When the program contains no suitable handler, the\n stack trace is written (nicely formatted) to the standard error\n stream; if the interpreter is interactive, it is also made\n available to the user as ``sys.last_traceback``.\n\n Special read-only attributes: ``tb_next`` is the next level in\n the stack trace (towards the frame where the exception\n occurred), or ``None`` if there is no next level; ``tb_frame``\n points to the execution frame of the current level;\n ``tb_lineno`` gives the line number where the exception\n occurred; ``tb_lasti`` indicates the precise instruction. The\n line number and last instruction in the traceback may differ\n from the line number of its frame object if the exception\n occurred in a ``try`` statement with no matching except clause\n or with a finally clause.\n\n Slice objects\n Slice objects are used to represent slices when *extended slice\n syntax* is used. This is a slice using two colons, or multiple\n slices or ellipses separated by commas, e.g., ``a[i:j:step]``,\n ``a[i:j, k:l]``, or ``a[..., i:j]``. They are also created by\n the built-in ``slice()`` function.\n\n Special read-only attributes: ``start`` is the lower bound;\n ``stop`` is the upper bound; ``step`` is the step value; each is\n ``None`` if omitted. These attributes can have any type.\n\n Slice objects support one method:\n\n slice.indices(self, length)\n\n This method takes a single integer argument *length* and\n computes information about the extended slice that the slice\n object would describe if applied to a sequence of *length*\n items. It returns a tuple of three integers; respectively\n these are the *start* and *stop* indices and the *step* or\n stride length of the slice. Missing or out-of-bounds indices\n are handled in a manner consistent with regular slices.\n\n Added in version 2.3.\n\n Static method objects\n Static method objects provide a way of defeating the\n transformation of function objects to method objects described\n above. A static method object is a wrapper around any other\n object, usually a user-defined method object. When a static\n method object is retrieved from a class or a class instance, the\n object actually returned is the wrapped object, which is not\n subject to any further transformation. Static method objects are\n not themselves callable, although the objects they wrap usually\n are. Static method objects are created by the built-in\n ``staticmethod()`` constructor.\n\n Class method objects\n A class method object, like a static method object, is a wrapper\n around another object that alters the way in which that object\n is retrieved from classes and class instances. The behaviour of\n class method objects upon such retrieval is described above,\n under "User-defined methods". Class method objects are created\n by the built-in ``classmethod()`` constructor.\n', + 'types': u'\nThe standard type hierarchy\n***************************\n\nBelow is a list of the types that are built into Python. Extension\nmodules (written in C, Java, or other languages, depending on the\nimplementation) can define additional types. Future versions of\nPython may add types to the type hierarchy (e.g., rational numbers,\nefficiently stored arrays of integers, etc.).\n\nSome of the type descriptions below contain a paragraph listing\n\'special attributes.\' These are attributes that provide access to the\nimplementation and are not intended for general use. Their definition\nmay change in the future.\n\nNone\n This type has a single value. There is a single object with this\n value. This object is accessed through the built-in name ``None``.\n It is used to signify the absence of a value in many situations,\n e.g., it is returned from functions that don\'t explicitly return\n anything. Its truth value is false.\n\nNotImplemented\n This type has a single value. There is a single object with this\n value. This object is accessed through the built-in name\n ``NotImplemented``. Numeric methods and rich comparison methods may\n return this value if they do not implement the operation for the\n operands provided. (The interpreter will then try the reflected\n operation, or some other fallback, depending on the operator.) Its\n truth value is true.\n\nEllipsis\n This type has a single value. There is a single object with this\n value. This object is accessed through the built-in name\n ``Ellipsis``. It is used to indicate the presence of the ``...``\n syntax in a slice. Its truth value is true.\n\n``numbers.Number``\n These are created by numeric literals and returned as results by\n arithmetic operators and arithmetic built-in functions. Numeric\n objects are immutable; once created their value never changes.\n Python numbers are of course strongly related to mathematical\n numbers, but subject to the limitations of numerical representation\n in computers.\n\n Python distinguishes between integers, floating point numbers, and\n complex numbers:\n\n ``numbers.Integral``\n These represent elements from the mathematical set of integers\n (positive and negative).\n\n There are three types of integers:\n\n Plain integers\n These represent numbers in the range -2147483648 through\n 2147483647. (The range may be larger on machines with a\n larger natural word size, but not smaller.) When the result\n of an operation would fall outside this range, the result is\n normally returned as a long integer (in some cases, the\n exception ``OverflowError`` is raised instead). For the\n purpose of shift and mask operations, integers are assumed to\n have a binary, 2\'s complement notation using 32 or more bits,\n and hiding no bits from the user (i.e., all 4294967296\n different bit patterns correspond to different values).\n\n Long integers\n These represent numbers in an unlimited range, subject to\n available (virtual) memory only. For the purpose of shift\n and mask operations, a binary representation is assumed, and\n negative numbers are represented in a variant of 2\'s\n complement which gives the illusion of an infinite string of\n sign bits extending to the left.\n\n Booleans\n These represent the truth values False and True. The two\n objects representing the values False and True are the only\n Boolean objects. The Boolean type is a subtype of plain\n integers, and Boolean values behave like the values 0 and 1,\n respectively, in almost all contexts, the exception being\n that when converted to a string, the strings ``"False"`` or\n ``"True"`` are returned, respectively.\n\n The rules for integer representation are intended to give the\n most meaningful interpretation of shift and mask operations\n involving negative integers and the least surprises when\n switching between the plain and long integer domains. Any\n operation, if it yields a result in the plain integer domain,\n will yield the same result in the long integer domain or when\n using mixed operands. The switch between domains is transparent\n to the programmer.\n\n ``numbers.Real`` (``float``)\n These represent machine-level double precision floating point\n numbers. You are at the mercy of the underlying machine\n architecture (and C or Java implementation) for the accepted\n range and handling of overflow. Python does not support single-\n precision floating point numbers; the savings in processor and\n memory usage that are usually the reason for using these is\n dwarfed by the overhead of using objects in Python, so there is\n no reason to complicate the language with two kinds of floating\n point numbers.\n\n ``numbers.Complex``\n These represent complex numbers as a pair of machine-level\n double precision floating point numbers. The same caveats apply\n as for floating point numbers. The real and imaginary parts of a\n complex number ``z`` can be retrieved through the read-only\n attributes ``z.real`` and ``z.imag``.\n\nSequences\n These represent finite ordered sets indexed by non-negative\n numbers. The built-in function ``len()`` returns the number of\n items of a sequence. When the length of a sequence is *n*, the\n index set contains the numbers 0, 1, ..., *n*-1. Item *i* of\n sequence *a* is selected by ``a[i]``.\n\n Sequences also support slicing: ``a[i:j]`` selects all items with\n index *k* such that *i* ``<=`` *k* ``<`` *j*. When used as an\n expression, a slice is a sequence of the same type. This implies\n that the index set is renumbered so that it starts at 0.\n\n Some sequences also support "extended slicing" with a third "step"\n parameter: ``a[i:j:k]`` selects all items of *a* with index *x*\n where ``x = i + n*k``, *n* ``>=`` ``0`` and *i* ``<=`` *x* ``<``\n *j*.\n\n Sequences are distinguished according to their mutability:\n\n Immutable sequences\n An object of an immutable sequence type cannot change once it is\n created. (If the object contains references to other objects,\n these other objects may be mutable and may be changed; however,\n the collection of objects directly referenced by an immutable\n object cannot change.)\n\n The following types are immutable sequences:\n\n Strings\n The items of a string are characters. There is no separate\n character type; a character is represented by a string of one\n item. Characters represent (at least) 8-bit bytes. The\n built-in functions ``chr()`` and ``ord()`` convert between\n characters and nonnegative integers representing the byte\n values. Bytes with the values 0-127 usually represent the\n corresponding ASCII values, but the interpretation of values\n is up to the program. The string data type is also used to\n represent arrays of bytes, e.g., to hold data read from a\n file.\n\n (On systems whose native character set is not ASCII, strings\n may use EBCDIC in their internal representation, provided the\n functions ``chr()`` and ``ord()`` implement a mapping between\n ASCII and EBCDIC, and string comparison preserves the ASCII\n order. Or perhaps someone can propose a better rule?)\n\n Unicode\n The items of a Unicode object are Unicode code units. A\n Unicode code unit is represented by a Unicode object of one\n item and can hold either a 16-bit or 32-bit value\n representing a Unicode ordinal (the maximum value for the\n ordinal is given in ``sys.maxunicode``, and depends on how\n Python is configured at compile time). Surrogate pairs may\n be present in the Unicode object, and will be reported as two\n separate items. The built-in functions ``unichr()`` and\n ``ord()`` convert between code units and nonnegative integers\n representing the Unicode ordinals as defined in the Unicode\n Standard 3.0. Conversion from and to other encodings are\n possible through the Unicode method ``encode()`` and the\n built-in function ``unicode()``.\n\n Tuples\n The items of a tuple are arbitrary Python objects. Tuples of\n two or more items are formed by comma-separated lists of\n expressions. A tuple of one item (a \'singleton\') can be\n formed by affixing a comma to an expression (an expression by\n itself does not create a tuple, since parentheses must be\n usable for grouping of expressions). An empty tuple can be\n formed by an empty pair of parentheses.\n\n Mutable sequences\n Mutable sequences can be changed after they are created. The\n subscription and slicing notations can be used as the target of\n assignment and ``del`` (delete) statements.\n\n There is currently a single intrinsic mutable sequence type:\n\n Lists\n The items of a list are arbitrary Python objects. Lists are\n formed by placing a comma-separated list of expressions in\n square brackets. (Note that there are no special cases needed\n to form lists of length 0 or 1.)\n\n The extension module ``array`` provides an additional example of\n a mutable sequence type.\n\nSet types\n These represent unordered, finite sets of unique, immutable\n objects. As such, they cannot be indexed by any subscript. However,\n they can be iterated over, and the built-in function ``len()``\n returns the number of items in a set. Common uses for sets are fast\n membership testing, removing duplicates from a sequence, and\n computing mathematical operations such as intersection, union,\n difference, and symmetric difference.\n\n For set elements, the same immutability rules apply as for\n dictionary keys. Note that numeric types obey the normal rules for\n numeric comparison: if two numbers compare equal (e.g., ``1`` and\n ``1.0``), only one of them can be contained in a set.\n\n There are currently two intrinsic set types:\n\n Sets\n These represent a mutable set. They are created by the built-in\n ``set()`` constructor and can be modified afterwards by several\n methods, such as ``add()``.\n\n Frozen sets\n These represent an immutable set. They are created by the\n built-in ``frozenset()`` constructor. As a frozenset is\n immutable and *hashable*, it can be used again as an element of\n another set, or as a dictionary key.\n\nMappings\n These represent finite sets of objects indexed by arbitrary index\n sets. The subscript notation ``a[k]`` selects the item indexed by\n ``k`` from the mapping ``a``; this can be used in expressions and\n as the target of assignments or ``del`` statements. The built-in\n function ``len()`` returns the number of items in a mapping.\n\n There is currently a single intrinsic mapping type:\n\n Dictionaries\n These represent finite sets of objects indexed by nearly\n arbitrary values. The only types of values not acceptable as\n keys are values containing lists or dictionaries or other\n mutable types that are compared by value rather than by object\n identity, the reason being that the efficient implementation of\n dictionaries requires a key\'s hash value to remain constant.\n Numeric types used for keys obey the normal rules for numeric\n comparison: if two numbers compare equal (e.g., ``1`` and\n ``1.0``) then they can be used interchangeably to index the same\n dictionary entry.\n\n Dictionaries are mutable; they can be created by the ``{...}``\n notation (see section *Dictionary displays*).\n\n The extension modules ``dbm``, ``gdbm``, and ``bsddb`` provide\n additional examples of mapping types.\n\nCallable types\n These are the types to which the function call operation (see\n section *Calls*) can be applied:\n\n User-defined functions\n A user-defined function object is created by a function\n definition (see section *Function definitions*). It should be\n called with an argument list containing the same number of items\n as the function\'s formal parameter list.\n\n Special attributes:\n\n +-------------------------+---------------------------------+-------------+\n | Attribute | Meaning | |\n +=========================+=================================+=============+\n | ``func_doc`` | The function\'s documentation | Writable |\n | | string, or ``None`` if | |\n | | unavailable | |\n +-------------------------+---------------------------------+-------------+\n | ``__doc__`` | Another way of spelling | Writable |\n | | ``func_doc`` | |\n +-------------------------+---------------------------------+-------------+\n | ``func_name`` | The function\'s name | Writable |\n +-------------------------+---------------------------------+-------------+\n | ``__name__`` | Another way of spelling | Writable |\n | | ``func_name`` | |\n +-------------------------+---------------------------------+-------------+\n | ``__module__`` | The name of the module the | Writable |\n | | function was defined in, or | |\n | | ``None`` if unavailable. | |\n +-------------------------+---------------------------------+-------------+\n | ``func_defaults`` | A tuple containing default | Writable |\n | | argument values for those | |\n | | arguments that have defaults, | |\n | | or ``None`` if no arguments | |\n | | have a default value | |\n +-------------------------+---------------------------------+-------------+\n | ``func_code`` | The code object representing | Writable |\n | | the compiled function body. | |\n +-------------------------+---------------------------------+-------------+\n | ``func_globals`` | A reference to the dictionary | Read-only |\n | | that holds the function\'s | |\n | | global variables --- the global | |\n | | namespace of the module in | |\n | | which the function was defined. | |\n +-------------------------+---------------------------------+-------------+\n | ``func_dict`` | The namespace supporting | Writable |\n | | arbitrary function attributes. | |\n +-------------------------+---------------------------------+-------------+\n | ``func_closure`` | ``None`` or a tuple of cells | Read-only |\n | | that contain bindings for the | |\n | | function\'s free variables. | |\n +-------------------------+---------------------------------+-------------+\n\n Most of the attributes labelled "Writable" check the type of the\n assigned value.\n\n Changed in version 2.4: ``func_name`` is now writable.\n\n Function objects also support getting and setting arbitrary\n attributes, which can be used, for example, to attach metadata\n to functions. Regular attribute dot-notation is used to get and\n set such attributes. *Note that the current implementation only\n supports function attributes on user-defined functions. Function\n attributes on built-in functions may be supported in the\n future.*\n\n Additional information about a function\'s definition can be\n retrieved from its code object; see the description of internal\n types below.\n\n User-defined methods\n A user-defined method object combines a class, a class instance\n (or ``None``) and any callable object (normally a user-defined\n function).\n\n Special read-only attributes: ``im_self`` is the class instance\n object, ``im_func`` is the function object; ``im_class`` is the\n class of ``im_self`` for bound methods or the class that asked\n for the method for unbound methods; ``__doc__`` is the method\'s\n documentation (same as ``im_func.__doc__``); ``__name__`` is the\n method name (same as ``im_func.__name__``); ``__module__`` is\n the name of the module the method was defined in, or ``None`` if\n unavailable.\n\n Changed in version 2.2: ``im_self`` used to refer to the class\n that defined the method.\n\n Changed in version 2.6: For 3.0 forward-compatibility,\n ``im_func`` is also available as ``__func__``, and ``im_self``\n as ``__self__``.\n\n Methods also support accessing (but not setting) the arbitrary\n function attributes on the underlying function object.\n\n User-defined method objects may be created when getting an\n attribute of a class (perhaps via an instance of that class), if\n that attribute is a user-defined function object, an unbound\n user-defined method object, or a class method object. When the\n attribute is a user-defined method object, a new method object\n is only created if the class from which it is being retrieved is\n the same as, or a derived class of, the class stored in the\n original method object; otherwise, the original method object is\n used as it is.\n\n When a user-defined method object is created by retrieving a\n user-defined function object from a class, its ``im_self``\n attribute is ``None`` and the method object is said to be\n unbound. When one is created by retrieving a user-defined\n function object from a class via one of its instances, its\n ``im_self`` attribute is the instance, and the method object is\n said to be bound. In either case, the new method\'s ``im_class``\n attribute is the class from which the retrieval takes place, and\n its ``im_func`` attribute is the original function object.\n\n When a user-defined method object is created by retrieving\n another method object from a class or instance, the behaviour is\n the same as for a function object, except that the ``im_func``\n attribute of the new instance is not the original method object\n but its ``im_func`` attribute.\n\n When a user-defined method object is created by retrieving a\n class method object from a class or instance, its ``im_self``\n attribute is the class itself (the same as the ``im_class``\n attribute), and its ``im_func`` attribute is the function object\n underlying the class method.\n\n When an unbound user-defined method object is called, the\n underlying function (``im_func``) is called, with the\n restriction that the first argument must be an instance of the\n proper class (``im_class``) or of a derived class thereof.\n\n When a bound user-defined method object is called, the\n underlying function (``im_func``) is called, inserting the class\n instance (``im_self``) in front of the argument list. For\n instance, when ``C`` is a class which contains a definition for\n a function ``f()``, and ``x`` is an instance of ``C``, calling\n ``x.f(1)`` is equivalent to calling ``C.f(x, 1)``.\n\n When a user-defined method object is derived from a class method\n object, the "class instance" stored in ``im_self`` will actually\n be the class itself, so that calling either ``x.f(1)`` or\n ``C.f(1)`` is equivalent to calling ``f(C,1)`` where ``f`` is\n the underlying function.\n\n Note that the transformation from function object to (unbound or\n bound) method object happens each time the attribute is\n retrieved from the class or instance. In some cases, a fruitful\n optimization is to assign the attribute to a local variable and\n call that local variable. Also notice that this transformation\n only happens for user-defined functions; other callable objects\n (and all non-callable objects) are retrieved without\n transformation. It is also important to note that user-defined\n functions which are attributes of a class instance are not\n converted to bound methods; this *only* happens when the\n function is an attribute of the class.\n\n Generator functions\n A function or method which uses the ``yield`` statement (see\n section *The yield statement*) is called a *generator function*.\n Such a function, when called, always returns an iterator object\n which can be used to execute the body of the function: calling\n the iterator\'s ``next()`` method will cause the function to\n execute until it provides a value using the ``yield`` statement.\n When the function executes a ``return`` statement or falls off\n the end, a ``StopIteration`` exception is raised and the\n iterator will have reached the end of the set of values to be\n returned.\n\n Built-in functions\n A built-in function object is a wrapper around a C function.\n Examples of built-in functions are ``len()`` and ``math.sin()``\n (``math`` is a standard built-in module). The number and type of\n the arguments are determined by the C function. Special read-\n only attributes: ``__doc__`` is the function\'s documentation\n string, or ``None`` if unavailable; ``__name__`` is the\n function\'s name; ``__self__`` is set to ``None`` (but see the\n next item); ``__module__`` is the name of the module the\n function was defined in or ``None`` if unavailable.\n\n Built-in methods\n This is really a different disguise of a built-in function, this\n time containing an object passed to the C function as an\n implicit extra argument. An example of a built-in method is\n ``alist.append()``, assuming *alist* is a list object. In this\n case, the special read-only attribute ``__self__`` is set to the\n object denoted by *list*.\n\n Class Types\n Class types, or "new-style classes," are callable. These\n objects normally act as factories for new instances of\n themselves, but variations are possible for class types that\n override ``__new__()``. The arguments of the call are passed to\n ``__new__()`` and, in the typical case, to ``__init__()`` to\n initialize the new instance.\n\n Classic Classes\n Class objects are described below. When a class object is\n called, a new class instance (also described below) is created\n and returned. This implies a call to the class\'s ``__init__()``\n method if it has one. Any arguments are passed on to the\n ``__init__()`` method. If there is no ``__init__()`` method,\n the class must be called without arguments.\n\n Class instances\n Class instances are described below. Class instances are\n callable only when the class has a ``__call__()`` method;\n ``x(arguments)`` is a shorthand for ``x.__call__(arguments)``.\n\nModules\n Modules are imported by the ``import`` statement (see section *The\n import statement*). A module object has a namespace implemented by\n a dictionary object (this is the dictionary referenced by the\n func_globals attribute of functions defined in the module).\n Attribute references are translated to lookups in this dictionary,\n e.g., ``m.x`` is equivalent to ``m.__dict__["x"]``. A module object\n does not contain the code object used to initialize the module\n (since it isn\'t needed once the initialization is done).\n\n Attribute assignment updates the module\'s namespace dictionary,\n e.g., ``m.x = 1`` is equivalent to ``m.__dict__["x"] = 1``.\n\n Special read-only attribute: ``__dict__`` is the module\'s namespace\n as a dictionary object.\n\n Predefined (writable) attributes: ``__name__`` is the module\'s\n name; ``__doc__`` is the module\'s documentation string, or ``None``\n if unavailable; ``__file__`` is the pathname of the file from which\n the module was loaded, if it was loaded from a file. The\n ``__file__`` attribute is not present for C modules that are\n statically linked into the interpreter; for extension modules\n loaded dynamically from a shared library, it is the pathname of the\n shared library file.\n\nClasses\n Both class types (new-style classes) and class objects (old-\n style/classic classes) are typically created by class definitions\n (see section *Class definitions*). A class has a namespace\n implemented by a dictionary object. Class attribute references are\n translated to lookups in this dictionary, e.g., ``C.x`` is\n translated to ``C.__dict__["x"]`` (although for new-style classes\n in particular there are a number of hooks which allow for other\n means of locating attributes). When the attribute name is not found\n there, the attribute search continues in the base classes. For\n old-style classes, the search is depth-first, left-to-right in the\n order of occurrence in the base class list. New-style classes use\n the more complex C3 method resolution order which behaves correctly\n even in the presence of \'diamond\' inheritance structures where\n there are multiple inheritance paths leading back to a common\n ancestor. Additional details on the C3 MRO used by new-style\n classes can be found in the documentation accompanying the 2.3\n release at http://www.python.org/download/releases/2.3/mro/.\n\n When a class attribute reference (for class ``C``, say) would yield\n a user-defined function object or an unbound user-defined method\n object whose associated class is either ``C`` or one of its base\n classes, it is transformed into an unbound user-defined method\n object whose ``im_class`` attribute is ``C``. When it would yield a\n class method object, it is transformed into a bound user-defined\n method object whose ``im_class`` and ``im_self`` attributes are\n both ``C``. When it would yield a static method object, it is\n transformed into the object wrapped by the static method object.\n See section *Implementing Descriptors* for another way in which\n attributes retrieved from a class may differ from those actually\n contained in its ``__dict__`` (note that only new-style classes\n support descriptors).\n\n Class attribute assignments update the class\'s dictionary, never\n the dictionary of a base class.\n\n A class object can be called (see above) to yield a class instance\n (see below).\n\n Special attributes: ``__name__`` is the class name; ``__module__``\n is the module name in which the class was defined; ``__dict__`` is\n the dictionary containing the class\'s namespace; ``__bases__`` is a\n tuple (possibly empty or a singleton) containing the base classes,\n in the order of their occurrence in the base class list;\n ``__doc__`` is the class\'s documentation string, or None if\n undefined.\n\nClass instances\n A class instance is created by calling a class object (see above).\n A class instance has a namespace implemented as a dictionary which\n is the first place in which attribute references are searched.\n When an attribute is not found there, and the instance\'s class has\n an attribute by that name, the search continues with the class\n attributes. If a class attribute is found that is a user-defined\n function object or an unbound user-defined method object whose\n associated class is the class (call it ``C``) of the instance for\n which the attribute reference was initiated or one of its bases, it\n is transformed into a bound user-defined method object whose\n ``im_class`` attribute is ``C`` and whose ``im_self`` attribute is\n the instance. Static method and class method objects are also\n transformed, as if they had been retrieved from class ``C``; see\n above under "Classes". See section *Implementing Descriptors* for\n another way in which attributes of a class retrieved via its\n instances may differ from the objects actually stored in the\n class\'s ``__dict__``. If no class attribute is found, and the\n object\'s class has a ``__getattr__()`` method, that is called to\n satisfy the lookup.\n\n Attribute assignments and deletions update the instance\'s\n dictionary, never a class\'s dictionary. If the class has a\n ``__setattr__()`` or ``__delattr__()`` method, this is called\n instead of updating the instance dictionary directly.\n\n Class instances can pretend to be numbers, sequences, or mappings\n if they have methods with certain special names. See section\n *Special method names*.\n\n Special attributes: ``__dict__`` is the attribute dictionary;\n ``__class__`` is the instance\'s class.\n\nFiles\n A file object represents an open file. File objects are created by\n the ``open()`` built-in function, and also by ``os.popen()``,\n ``os.fdopen()``, and the ``makefile()`` method of socket objects\n (and perhaps by other functions or methods provided by extension\n modules). The objects ``sys.stdin``, ``sys.stdout`` and\n ``sys.stderr`` are initialized to file objects corresponding to the\n interpreter\'s standard input, output and error streams. See *File\n Objects* for complete documentation of file objects.\n\nInternal types\n A few types used internally by the interpreter are exposed to the\n user. Their definitions may change with future versions of the\n interpreter, but they are mentioned here for completeness.\n\n Code objects\n Code objects represent *byte-compiled* executable Python code,\n or *bytecode*. The difference between a code object and a\n function object is that the function object contains an explicit\n reference to the function\'s globals (the module in which it was\n defined), while a code object contains no context; also the\n default argument values are stored in the function object, not\n in the code object (because they represent values calculated at\n run-time). Unlike function objects, code objects are immutable\n and contain no references (directly or indirectly) to mutable\n objects.\n\n Special read-only attributes: ``co_name`` gives the function\n name; ``co_argcount`` is the number of positional arguments\n (including arguments with default values); ``co_nlocals`` is the\n number of local variables used by the function (including\n arguments); ``co_varnames`` is a tuple containing the names of\n the local variables (starting with the argument names);\n ``co_cellvars`` is a tuple containing the names of local\n variables that are referenced by nested functions;\n ``co_freevars`` is a tuple containing the names of free\n variables; ``co_code`` is a string representing the sequence of\n bytecode instructions; ``co_consts`` is a tuple containing the\n literals used by the bytecode; ``co_names`` is a tuple\n containing the names used by the bytecode; ``co_filename`` is\n the filename from which the code was compiled;\n ``co_firstlineno`` is the first line number of the function;\n ``co_lnotab`` is a string encoding the mapping from bytecode\n offsets to line numbers (for details see the source code of the\n interpreter); ``co_stacksize`` is the required stack size\n (including local variables); ``co_flags`` is an integer encoding\n a number of flags for the interpreter.\n\n The following flag bits are defined for ``co_flags``: bit\n ``0x04`` is set if the function uses the ``*arguments`` syntax\n to accept an arbitrary number of positional arguments; bit\n ``0x08`` is set if the function uses the ``**keywords`` syntax\n to accept arbitrary keyword arguments; bit ``0x20`` is set if\n the function is a generator.\n\n Future feature declarations (``from __future__ import\n division``) also use bits in ``co_flags`` to indicate whether a\n code object was compiled with a particular feature enabled: bit\n ``0x2000`` is set if the function was compiled with future\n division enabled; bits ``0x10`` and ``0x1000`` were used in\n earlier versions of Python.\n\n Other bits in ``co_flags`` are reserved for internal use.\n\n If a code object represents a function, the first item in\n ``co_consts`` is the documentation string of the function, or\n ``None`` if undefined.\n\n Frame objects\n Frame objects represent execution frames. They may occur in\n traceback objects (see below).\n\n Special read-only attributes: ``f_back`` is to the previous\n stack frame (towards the caller), or ``None`` if this is the\n bottom stack frame; ``f_code`` is the code object being executed\n in this frame; ``f_locals`` is the dictionary used to look up\n local variables; ``f_globals`` is used for global variables;\n ``f_builtins`` is used for built-in (intrinsic) names;\n ``f_restricted`` is a flag indicating whether the function is\n executing in restricted execution mode; ``f_lasti`` gives the\n precise instruction (this is an index into the bytecode string\n of the code object).\n\n Special writable attributes: ``f_trace``, if not ``None``, is a\n function called at the start of each source code line (this is\n used by the debugger); ``f_exc_type``, ``f_exc_value``,\n ``f_exc_traceback`` represent the last exception raised in the\n parent frame provided another exception was ever raised in the\n current frame (in all other cases they are None); ``f_lineno``\n is the current line number of the frame --- writing to this from\n within a trace function jumps to the given line (only for the\n bottom-most frame). A debugger can implement a Jump command\n (aka Set Next Statement) by writing to f_lineno.\n\n Traceback objects\n Traceback objects represent a stack trace of an exception. A\n traceback object is created when an exception occurs. When the\n search for an exception handler unwinds the execution stack, at\n each unwound level a traceback object is inserted in front of\n the current traceback. When an exception handler is entered,\n the stack trace is made available to the program. (See section\n *The try statement*.) It is accessible as ``sys.exc_traceback``,\n and also as the third item of the tuple returned by\n ``sys.exc_info()``. The latter is the preferred interface,\n since it works correctly when the program is using multiple\n threads. When the program contains no suitable handler, the\n stack trace is written (nicely formatted) to the standard error\n stream; if the interpreter is interactive, it is also made\n available to the user as ``sys.last_traceback``.\n\n Special read-only attributes: ``tb_next`` is the next level in\n the stack trace (towards the frame where the exception\n occurred), or ``None`` if there is no next level; ``tb_frame``\n points to the execution frame of the current level;\n ``tb_lineno`` gives the line number where the exception\n occurred; ``tb_lasti`` indicates the precise instruction. The\n line number and last instruction in the traceback may differ\n from the line number of its frame object if the exception\n occurred in a ``try`` statement with no matching except clause\n or with a finally clause.\n\n Slice objects\n Slice objects are used to represent slices when *extended slice\n syntax* is used. This is a slice using two colons, or multiple\n slices or ellipses separated by commas, e.g., ``a[i:j:step]``,\n ``a[i:j, k:l]``, or ``a[..., i:j]``. They are also created by\n the built-in ``slice()`` function.\n\n Special read-only attributes: ``start`` is the lower bound;\n ``stop`` is the upper bound; ``step`` is the step value; each is\n ``None`` if omitted. These attributes can have any type.\n\n Slice objects support one method:\n\n slice.indices(self, length)\n\n This method takes a single integer argument *length* and\n computes information about the extended slice that the slice\n object would describe if applied to a sequence of *length*\n items. It returns a tuple of three integers; respectively\n these are the *start* and *stop* indices and the *step* or\n stride length of the slice. Missing or out-of-bounds indices\n are handled in a manner consistent with regular slices.\n\n New in version 2.3.\n\n Static method objects\n Static method objects provide a way of defeating the\n transformation of function objects to method objects described\n above. A static method object is a wrapper around any other\n object, usually a user-defined method object. When a static\n method object is retrieved from a class or a class instance, the\n object actually returned is the wrapped object, which is not\n subject to any further transformation. Static method objects are\n not themselves callable, although the objects they wrap usually\n are. Static method objects are created by the built-in\n ``staticmethod()`` constructor.\n\n Class method objects\n A class method object, like a static method object, is a wrapper\n around another object that alters the way in which that object\n is retrieved from classes and class instances. The behaviour of\n class method objects upon such retrieval is described above,\n under "User-defined methods". Class method objects are created\n by the built-in ``classmethod()`` constructor.\n', 'typesfunctions': u'\nFunctions\n*********\n\nFunction objects are created by function definitions. The only\noperation on a function object is to call it: ``func(argument-list)``.\n\nThere are really two flavors of function objects: built-in functions\nand user-defined functions. Both support the same operation (to call\nthe function), but the implementation is different, hence the\ndifferent object types.\n\nSee *Function definitions* for more information.\n', - 'typesmapping': u'\nMapping Types --- ``dict``\n**************************\n\nA *mapping* object maps *hashable* values to arbitrary objects.\nMappings are mutable objects. There is currently only one standard\nmapping type, the *dictionary*. (For other containers see the built\nin ``list``, ``set``, and ``tuple`` classes, and the ``collections``\nmodule.)\n\nA dictionary\'s keys are *almost* arbitrary values. Values that are\nnot *hashable*, that is, values containing lists, dictionaries or\nother mutable types (that are compared by value rather than by object\nidentity) may not be used as keys. Numeric types used for keys obey\nthe normal rules for numeric comparison: if two numbers compare equal\n(such as ``1`` and ``1.0``) then they can be used interchangeably to\nindex the same dictionary entry. (Note however, that since computers\nstore floating-point numbers as approximations it is usually unwise to\nuse them as dictionary keys.)\n\nDictionaries can be created by placing a comma-separated list of\n``key: value`` pairs within braces, for example: ``{\'jack\': 4098,\n\'sjoerd\': 4127}`` or ``{4098: \'jack\', 4127: \'sjoerd\'}``, or by the\n``dict`` constructor.\n\nclass dict([arg])\n\n Return a new dictionary initialized from an optional positional\n argument or from a set of keyword arguments. If no arguments are\n given, return a new empty dictionary. If the positional argument\n *arg* is a mapping object, return a dictionary mapping the same\n keys to the same values as does the mapping object. Otherwise the\n positional argument must be a sequence, a container that supports\n iteration, or an iterator object. The elements of the argument\n must each also be of one of those kinds, and each must in turn\n contain exactly two objects. The first is used as a key in the new\n dictionary, and the second as the key\'s value. If a given key is\n seen more than once, the last value associated with it is retained\n in the new dictionary.\n\n If keyword arguments are given, the keywords themselves with their\n associated values are added as items to the dictionary. If a key is\n specified both in the positional argument and as a keyword\n argument, the value associated with the keyword is retained in the\n dictionary. For example, these all return a dictionary equal to\n ``{"one": 2, "two": 3}``:\n\n * ``dict(one=2, two=3)``\n\n * ``dict({\'one\': 2, \'two\': 3})``\n\n * ``dict(zip((\'one\', \'two\'), (2, 3)))``\n\n * ``dict([[\'two\', 3], [\'one\', 2]])``\n\n The first example only works for keys that are valid Python\n identifiers; the others work with any valid keys.\n\n Added in version 2.2.\n\n Changed in version 2.3: Support for building a dictionary from\n keyword arguments added.\n\n These are the operations that dictionaries support (and therefore,\n custom mapping types should support too):\n\n len(d)\n\n Return the number of items in the dictionary *d*.\n\n d[key]\n\n Return the item of *d* with key *key*. Raises a ``KeyError`` if\n *key* is not in the map.\n\n Added in version 2.5: If a subclass of dict defines a method\n ``__missing__()``, if the key *key* is not present, the\n ``d[key]`` operation calls that method with the key *key* as\n argument. The ``d[key]`` operation then returns or raises\n whatever is returned or raised by the ``__missing__(key)`` call\n if the key is not present. No other operations or methods invoke\n ``__missing__()``. If ``__missing__()`` is not defined,\n ``KeyError`` is raised. ``__missing__()`` must be a method; it\n cannot be an instance variable. For an example, see\n ``collections.defaultdict``.\n\n d[key] = value\n\n Set ``d[key]`` to *value*.\n\n del d[key]\n\n Remove ``d[key]`` from *d*. Raises a ``KeyError`` if *key* is\n not in the map.\n\n key in d\n\n Return ``True`` if *d* has a key *key*, else ``False``.\n\n Added in version 2.2.\n\n key not in d\n\n Equivalent to ``not key in d``.\n\n Added in version 2.2.\n\n clear()\n\n Remove all items from the dictionary.\n\n copy()\n\n Return a shallow copy of the dictionary.\n\n fromkeys(seq[, value])\n\n Create a new dictionary with keys from *seq* and values set to\n *value*.\n\n ``fromkeys()`` is a class method that returns a new dictionary.\n *value* defaults to ``None``.\n\n Added in version 2.3.\n\n get(key[, default])\n\n Return the value for *key* if *key* is in the dictionary, else\n *default*. If *default* is not given, it defaults to ``None``,\n so that this method never raises a ``KeyError``.\n\n has_key(key)\n\n ``dict.has_key(key)`` is equivalent to ``key in d``, but\n deprecated.\n\n items()\n\n Return a copy of the dictionary\'s list of ``(key, value)``\n pairs.\n\n Note: Keys and values are listed in an arbitrary order which is non-\n random, varies across Python implementations, and depends on\n the dictionary\'s history of insertions and deletions. If\n ``items()``, ``keys()``, ``values()``, ``iteritems()``,\n ``iterkeys()``, and ``itervalues()`` are called with no\n intervening modifications to the dictionary, the lists will\n directly correspond. This allows the creation of ``(value,\n key)`` pairs using ``zip()``: ``pairs = zip(d.values(),\n d.keys())``. The same relationship holds for the\n ``iterkeys()`` and ``itervalues()`` methods: ``pairs =\n zip(d.itervalues(), d.iterkeys())`` provides the same value\n for ``pairs``. Another way to create the same list is ``pairs\n = [(v, k) for (k, v) in d.iteritems()]``.\n\n iteritems()\n\n Return an iterator over the dictionary\'s ``(key, value)`` pairs.\n See the note for ``dict.items()``.\n\n Added in version 2.2.\n\n iterkeys()\n\n Return an iterator over the dictionary\'s keys. See the note for\n ``dict.items()``.\n\n Added in version 2.2.\n\n itervalues()\n\n Return an iterator over the dictionary\'s values. See the note\n for ``dict.items()``.\n\n Added in version 2.2.\n\n keys()\n\n Return a copy of the dictionary\'s list of keys. See the note\n for ``dict.items()``.\n\n pop(key[, default])\n\n If *key* is in the dictionary, remove it and return its value,\n else return *default*. If *default* is not given and *key* is\n not in the dictionary, a ``KeyError`` is raised.\n\n Added in version 2.3.\n\n popitem()\n\n Remove and return an arbitrary ``(key, value)`` pair from the\n dictionary.\n\n ``popitem()`` is useful to destructively iterate over a\n dictionary, as often used in set algorithms. If the dictionary\n is empty, calling ``popitem()`` raises a ``KeyError``.\n\n setdefault(key[, default])\n\n If *key* is in the dictionary, return its value. If not, insert\n *key* with a value of *default* and return *default*. *default*\n defaults to ``None``.\n\n update([other])\n\n Update the dictionary with the key/value pairs from *other*,\n overwriting existing keys. Return ``None``.\n\n ``update()`` accepts either another dictionary object or an\n iterable of key/value pairs (as a tuple or other iterable of\n length two). If keyword arguments are specified, the dictionary\n is then is updated with those key/value pairs: ``d.update(red=1,\n blue=2)``.\n\n Changed in version 2.4: Allowed the argument to be an iterable\n of key/value pairs and allowed keyword arguments.\n\n values()\n\n Return a copy of the dictionary\'s list of values. See the note\n for ``dict.items()``.\n', + 'typesmapping': u'\nMapping Types --- ``dict``\n**************************\n\nA *mapping* object maps *hashable* values to arbitrary objects.\nMappings are mutable objects. There is currently only one standard\nmapping type, the *dictionary*. (For other containers see the built\nin ``list``, ``set``, and ``tuple`` classes, and the ``collections``\nmodule.)\n\nA dictionary\'s keys are *almost* arbitrary values. Values that are\nnot *hashable*, that is, values containing lists, dictionaries or\nother mutable types (that are compared by value rather than by object\nidentity) may not be used as keys. Numeric types used for keys obey\nthe normal rules for numeric comparison: if two numbers compare equal\n(such as ``1`` and ``1.0``) then they can be used interchangeably to\nindex the same dictionary entry. (Note however, that since computers\nstore floating-point numbers as approximations it is usually unwise to\nuse them as dictionary keys.)\n\nDictionaries can be created by placing a comma-separated list of\n``key: value`` pairs within braces, for example: ``{\'jack\': 4098,\n\'sjoerd\': 4127}`` or ``{4098: \'jack\', 4127: \'sjoerd\'}``, or by the\n``dict`` constructor.\n\nclass dict([arg])\n\n Return a new dictionary initialized from an optional positional\n argument or from a set of keyword arguments. If no arguments are\n given, return a new empty dictionary. If the positional argument\n *arg* is a mapping object, return a dictionary mapping the same\n keys to the same values as does the mapping object. Otherwise the\n positional argument must be a sequence, a container that supports\n iteration, or an iterator object. The elements of the argument\n must each also be of one of those kinds, and each must in turn\n contain exactly two objects. The first is used as a key in the new\n dictionary, and the second as the key\'s value. If a given key is\n seen more than once, the last value associated with it is retained\n in the new dictionary.\n\n If keyword arguments are given, the keywords themselves with their\n associated values are added as items to the dictionary. If a key is\n specified both in the positional argument and as a keyword\n argument, the value associated with the keyword is retained in the\n dictionary. For example, these all return a dictionary equal to\n ``{"one": 2, "two": 3}``:\n\n * ``dict(one=2, two=3)``\n\n * ``dict({\'one\': 2, \'two\': 3})``\n\n * ``dict(zip((\'one\', \'two\'), (2, 3)))``\n\n * ``dict([[\'two\', 3], [\'one\', 2]])``\n\n The first example only works for keys that are valid Python\n identifiers; the others work with any valid keys.\n\n New in version 2.2.\n\n Changed in version 2.3: Support for building a dictionary from\n keyword arguments added.\n\n These are the operations that dictionaries support (and therefore,\n custom mapping types should support too):\n\n len(d)\n\n Return the number of items in the dictionary *d*.\n\n d[key]\n\n Return the item of *d* with key *key*. Raises a ``KeyError`` if\n *key* is not in the map.\n\n New in version 2.5: If a subclass of dict defines a method\n ``__missing__()``, if the key *key* is not present, the\n ``d[key]`` operation calls that method with the key *key* as\n argument. The ``d[key]`` operation then returns or raises\n whatever is returned or raised by the ``__missing__(key)`` call\n if the key is not present. No other operations or methods invoke\n ``__missing__()``. If ``__missing__()`` is not defined,\n ``KeyError`` is raised. ``__missing__()`` must be a method; it\n cannot be an instance variable. For an example, see\n ``collections.defaultdict``.\n\n d[key] = value\n\n Set ``d[key]`` to *value*.\n\n del d[key]\n\n Remove ``d[key]`` from *d*. Raises a ``KeyError`` if *key* is\n not in the map.\n\n key in d\n\n Return ``True`` if *d* has a key *key*, else ``False``.\n\n New in version 2.2.\n\n key not in d\n\n Equivalent to ``not key in d``.\n\n New in version 2.2.\n\n clear()\n\n Remove all items from the dictionary.\n\n copy()\n\n Return a shallow copy of the dictionary.\n\n fromkeys(seq[, value])\n\n Create a new dictionary with keys from *seq* and values set to\n *value*.\n\n ``fromkeys()`` is a class method that returns a new dictionary.\n *value* defaults to ``None``.\n\n New in version 2.3.\n\n get(key[, default])\n\n Return the value for *key* if *key* is in the dictionary, else\n *default*. If *default* is not given, it defaults to ``None``,\n so that this method never raises a ``KeyError``.\n\n has_key(key)\n\n ``dict.has_key(key)`` is equivalent to ``key in d``, but\n deprecated.\n\n items()\n\n Return a copy of the dictionary\'s list of ``(key, value)``\n pairs.\n\n Note: Keys and values are listed in an arbitrary order which is non-\n random, varies across Python implementations, and depends on\n the dictionary\'s history of insertions and deletions. If\n ``items()``, ``keys()``, ``values()``, ``iteritems()``,\n ``iterkeys()``, and ``itervalues()`` are called with no\n intervening modifications to the dictionary, the lists will\n directly correspond. This allows the creation of ``(value,\n key)`` pairs using ``zip()``: ``pairs = zip(d.values(),\n d.keys())``. The same relationship holds for the\n ``iterkeys()`` and ``itervalues()`` methods: ``pairs =\n zip(d.itervalues(), d.iterkeys())`` provides the same value\n for ``pairs``. Another way to create the same list is ``pairs\n = [(v, k) for (k, v) in d.iteritems()]``.\n\n iteritems()\n\n Return an iterator over the dictionary\'s ``(key, value)`` pairs.\n See the note for ``dict.items()``.\n\n New in version 2.2.\n\n iterkeys()\n\n Return an iterator over the dictionary\'s keys. See the note for\n ``dict.items()``.\n\n New in version 2.2.\n\n itervalues()\n\n Return an iterator over the dictionary\'s values. See the note\n for ``dict.items()``.\n\n New in version 2.2.\n\n keys()\n\n Return a copy of the dictionary\'s list of keys. See the note\n for ``dict.items()``.\n\n pop(key[, default])\n\n If *key* is in the dictionary, remove it and return its value,\n else return *default*. If *default* is not given and *key* is\n not in the dictionary, a ``KeyError`` is raised.\n\n New in version 2.3.\n\n popitem()\n\n Remove and return an arbitrary ``(key, value)`` pair from the\n dictionary.\n\n ``popitem()`` is useful to destructively iterate over a\n dictionary, as often used in set algorithms. If the dictionary\n is empty, calling ``popitem()`` raises a ``KeyError``.\n\n setdefault(key[, default])\n\n If *key* is in the dictionary, return its value. If not, insert\n *key* with a value of *default* and return *default*. *default*\n defaults to ``None``.\n\n update([other])\n\n Update the dictionary with the key/value pairs from *other*,\n overwriting existing keys. Return ``None``.\n\n ``update()`` accepts either another dictionary object or an\n iterable of key/value pairs (as a tuple or other iterable of\n length two). If keyword arguments are specified, the dictionary\n is then is updated with those key/value pairs: ``d.update(red=1,\n blue=2)``.\n\n Changed in version 2.4: Allowed the argument to be an iterable\n of key/value pairs and allowed keyword arguments.\n\n values()\n\n Return a copy of the dictionary\'s list of values. See the note\n for ``dict.items()``.\n', 'typesmethods': u"\nMethods\n*******\n\nMethods are functions that are called using the attribute notation.\nThere are two flavors: built-in methods (such as ``append()`` on\nlists) and class instance methods. Built-in methods are described\nwith the types that support them.\n\nThe implementation adds two special read-only attributes to class\ninstance methods: ``m.im_self`` is the object on which the method\noperates, and ``m.im_func`` is the function implementing the method.\nCalling ``m(arg-1, arg-2, ..., arg-n)`` is completely equivalent to\ncalling ``m.im_func(m.im_self, arg-1, arg-2, ..., arg-n)``.\n\nClass instance methods are either *bound* or *unbound*, referring to\nwhether the method was accessed through an instance or a class,\nrespectively. When a method is unbound, its ``im_self`` attribute\nwill be ``None`` and if called, an explicit ``self`` object must be\npassed as the first argument. In this case, ``self`` must be an\ninstance of the unbound method's class (or a subclass of that class),\notherwise a ``TypeError`` is raised.\n\nLike function objects, methods objects support getting arbitrary\nattributes. However, since method attributes are actually stored on\nthe underlying function object (``meth.im_func``), setting method\nattributes on either bound or unbound methods is disallowed.\nAttempting to set a method attribute results in a ``TypeError`` being\nraised. In order to set a method attribute, you need to explicitly\nset it on the underlying function object:\n\n class C:\n def method(self):\n pass\n\n c = C()\n c.method.im_func.whoami = 'my name is c'\n\nSee *The standard type hierarchy* for more information.\n", 'typesmodules': u"\nModules\n*******\n\nThe only special operation on a module is attribute access:\n``m.name``, where *m* is a module and *name* accesses a name defined\nin *m*'s symbol table. Module attributes can be assigned to. (Note\nthat the ``import`` statement is not, strictly speaking, an operation\non a module object; ``import foo`` does not require a module object\nnamed *foo* to exist, rather it requires an (external) *definition*\nfor a module named *foo* somewhere.)\n\nA special member of every module is ``__dict__``. This is the\ndictionary containing the module's symbol table. Modifying this\ndictionary will actually change the module's symbol table, but direct\nassignment to the ``__dict__`` attribute is not possible (you can\nwrite ``m.__dict__['a'] = 1``, which defines ``m.a`` to be ``1``, but\nyou can't write ``m.__dict__ = {}``). Modifying ``__dict__`` directly\nis not recommended.\n\nModules built into the interpreter are written like this: ````. If loaded from a file, they are written as\n````.\n", - 'typesseq': u'\nSequence Types --- ``str``, ``unicode``, ``list``, ``tuple``, ``buffer``, ``xrange``\n************************************************************************************\n\nThere are six sequence types: strings, Unicode strings, lists, tuples,\nbuffers, and xrange objects. (For other containers see the built in\n``dict``, ``list``, ``set``, and ``tuple`` classes, and the\n``collections`` module.)\n\nString literals are written in single or double quotes: ``\'xyzzy\'``,\n``"frobozz"``. See *String literals* for more about string literals.\nUnicode strings are much like strings, but are specified in the syntax\nusing a preceding ``\'u\'`` character: ``u\'abc\'``, ``u"def"``. In\naddition to the functionality described here, there are also string-\nspecific methods described in the *String Methods* section. Lists are\nconstructed with square brackets, separating items with commas: ``[a,\nb, c]``. Tuples are constructed by the comma operator (not within\nsquare brackets), with or without enclosing parentheses, but an empty\ntuple must have the enclosing parentheses, such as ``a, b, c`` or\n``()``. A single item tuple must have a trailing comma, such as\n``(d,)``.\n\nBuffer objects are not directly supported by Python syntax, but can be\ncreated by calling the builtin function ``buffer()``. They don\'t\nsupport concatenation or repetition.\n\nObjects of type xrange are similar to buffers in that there is no\nspecific syntax to create them, but they are created using the\n``xrange()`` function. They don\'t support slicing, concatenation or\nrepetition, and using ``in``, ``not in``, ``min()`` or ``max()`` on\nthem is inefficient.\n\nMost sequence types support the following operations. The ``in`` and\n``not in`` operations have the same priorities as the comparison\noperations. The ``+`` and ``*`` operations have the same priority as\nthe corresponding numeric operations. [3] Additional methods are\nprovided for *Mutable Sequence Types*.\n\nThis table lists the sequence operations sorted in ascending priority\n(operations in the same box have the same priority). In the table,\n*s* and *t* are sequences of the same type; *n*, *i* and *j* are\nintegers:\n\n+--------------------+----------------------------------+------------+\n| Operation | Result | Notes |\n+====================+==================================+============+\n| ``x in s`` | ``True`` if an item of *s* is | (1) |\n| | equal to *x*, else ``False`` | |\n+--------------------+----------------------------------+------------+\n| ``x not in s`` | ``False`` if an item of *s* is | (1) |\n| | equal to *x*, else ``True`` | |\n+--------------------+----------------------------------+------------+\n| ``s + t`` | the concatenation of *s* and *t* | (6) |\n+--------------------+----------------------------------+------------+\n| ``s * n, n * s`` | *n* shallow copies of *s* | (2) |\n| | concatenated | |\n+--------------------+----------------------------------+------------+\n| ``s[i]`` | *i*\'th item of *s*, origin 0 | (3) |\n+--------------------+----------------------------------+------------+\n| ``s[i:j]`` | slice of *s* from *i* to *j* | (3)(4) |\n+--------------------+----------------------------------+------------+\n| ``s[i:j:k]`` | slice of *s* from *i* to *j* | (3)(5) |\n| | with step *k* | |\n+--------------------+----------------------------------+------------+\n| ``len(s)`` | length of *s* | |\n+--------------------+----------------------------------+------------+\n| ``min(s)`` | smallest item of *s* | |\n+--------------------+----------------------------------+------------+\n| ``max(s)`` | largest item of *s* | |\n+--------------------+----------------------------------+------------+\n\nSequence types also support comparisons. In particular, tuples and\nlists are compared lexicographically by comparing corresponding\nelements. This means that to compare equal, every element must compare\nequal and the two sequences must be of the same type and have the same\nlength. (For full details see *Comparisons* in the language\nreference.)\n\nNotes:\n\n1. When *s* is a string or Unicode string object the ``in`` and ``not\n in`` operations act like a substring test. In Python versions\n before 2.3, *x* had to be a string of length 1. In Python 2.3 and\n beyond, *x* may be a string of any length.\n\n2. Values of *n* less than ``0`` are treated as ``0`` (which yields an\n empty sequence of the same type as *s*). Note also that the copies\n are shallow; nested structures are not copied. This often haunts\n new Python programmers; consider:\n\n >>> lists = [[]] * 3\n >>> lists\n [[], [], []]\n >>> lists[0].append(3)\n >>> lists\n [[3], [3], [3]]\n\n What has happened is that ``[[]]`` is a one-element list containing\n an empty list, so all three elements of ``[[]] * 3`` are (pointers\n to) this single empty list. Modifying any of the elements of\n ``lists`` modifies this single list. You can create a list of\n different lists this way:\n\n >>> lists = [[] for i in range(3)]\n >>> lists[0].append(3)\n >>> lists[1].append(5)\n >>> lists[2].append(7)\n >>> lists\n [[3], [5], [7]]\n\n3. If *i* or *j* is negative, the index is relative to the end of the\n string: ``len(s) + i`` or ``len(s) + j`` is substituted. But note\n that ``-0`` is still ``0``.\n\n4. The slice of *s* from *i* to *j* is defined as the sequence of\n items with index *k* such that ``i <= k < j``. If *i* or *j* is\n greater than ``len(s)``, use ``len(s)``. If *i* is omitted or\n ``None``, use ``0``. If *j* is omitted or ``None``, use\n ``len(s)``. If *i* is greater than or equal to *j*, the slice is\n empty.\n\n5. The slice of *s* from *i* to *j* with step *k* is defined as the\n sequence of items with index ``x = i + n*k`` such that ``0 <= n <\n (j-i)/k``. In other words, the indices are ``i``, ``i+k``,\n ``i+2*k``, ``i+3*k`` and so on, stopping when *j* is reached (but\n never including *j*). If *i* or *j* is greater than ``len(s)``,\n use ``len(s)``. If *i* or *j* are omitted or ``None``, they become\n "end" values (which end depends on the sign of *k*). Note, *k*\n cannot be zero. If *k* is ``None``, it is treated like ``1``.\n\n6. If *s* and *t* are both strings, some Python implementations such\n as CPython can usually perform an in-place optimization for\n assignments of the form ``s=s+t`` or ``s+=t``. When applicable,\n this optimization makes quadratic run-time much less likely. This\n optimization is both version and implementation dependent. For\n performance sensitive code, it is preferable to use the\n ``str.join()`` method which assures consistent linear concatenation\n performance across versions and implementations.\n\n Changed in version 2.4: Formerly, string concatenation never\n occurred in-place.\n\n\nString Methods\n==============\n\nBelow are listed the string methods which both 8-bit strings and\nUnicode objects support. Note that none of these methods take keyword\narguments.\n\nIn addition, Python\'s strings support the sequence type methods\ndescribed in the *Sequence Types --- str, unicode, list, tuple,\nbuffer, xrange* section. To output formatted strings use template\nstrings or the ``%`` operator described in the *String Formatting\nOperations* section. Also, see the ``re`` module for string functions\nbased on regular expressions.\n\nstr.capitalize()\n\n Return a copy of the string with only its first character\n capitalized.\n\n For 8-bit strings, this method is locale-dependent.\n\nstr.center(width[, fillchar])\n\n Return centered in a string of length *width*. Padding is done\n using the specified *fillchar* (default is a space).\n\n Changed in version 2.4: Support for the *fillchar* argument.\n\nstr.count(sub[, start[, end]])\n\n Return the number of occurrences of substring *sub* in the range\n [*start*, *end*]. Optional arguments *start* and *end* are\n interpreted as in slice notation.\n\nstr.decode([encoding[, errors]])\n\n Decodes the string using the codec registered for *encoding*.\n *encoding* defaults to the default string encoding. *errors* may\n be given to set a different error handling scheme. The default is\n ``\'strict\'``, meaning that encoding errors raise ``UnicodeError``.\n Other possible values are ``\'ignore\'``, ``\'replace\'`` and any other\n name registered via ``codecs.register_error()``, see section *Codec\n Base Classes*.\n\n Added in version 2.2.\n\n Changed in version 2.3: Support for other error handling schemes\n added.\n\nstr.encode([encoding[, errors]])\n\n Return an encoded version of the string. Default encoding is the\n current default string encoding. *errors* may be given to set a\n different error handling scheme. The default for *errors* is\n ``\'strict\'``, meaning that encoding errors raise a\n ``UnicodeError``. Other possible values are ``\'ignore\'``,\n ``\'replace\'``, ``\'xmlcharrefreplace\'``, ``\'backslashreplace\'`` and\n any other name registered via ``codecs.register_error()``, see\n section *Codec Base Classes*. For a list of possible encodings, see\n section *Standard Encodings*.\n\n Added in version 2.0.\n\n Changed in version 2.3: Support for ``\'xmlcharrefreplace\'`` and\n ``\'backslashreplace\'`` and other error handling schemes added.\n\nstr.endswith(suffix[, start[, end]])\n\n Return ``True`` if the string ends with the specified *suffix*,\n otherwise return ``False``. *suffix* can also be a tuple of\n suffixes to look for. With optional *start*, test beginning at\n that position. With optional *end*, stop comparing at that\n position.\n\n Changed in version 2.5: Accept tuples as *suffix*.\n\nstr.expandtabs([tabsize])\n\n Return a copy of the string where all tab characters are replaced\n by one or more spaces, depending on the current column and the\n given tab size. The column number is reset to zero after each\n newline occurring in the string. If *tabsize* is not given, a tab\n size of ``8`` characters is assumed. This doesn\'t understand other\n non-printing characters or escape sequences.\n\nstr.find(sub[, start[, end]])\n\n Return the lowest index in the string where substring *sub* is\n found, such that *sub* is contained in the range [*start*, *end*].\n Optional arguments *start* and *end* are interpreted as in slice\n notation. Return ``-1`` if *sub* is not found.\n\nstr.format(format_string, *args, **kwargs)\n\n Perform a string formatting operation. The *format_string*\n argument can contain literal text or replacement fields delimited\n by braces ``{}``. Each replacement field contains either the\n numeric index of a positional argument, or the name of a keyword\n argument. Returns a copy of *format_string* where each replacement\n field is replaced with the string value of the corresponding\n argument.\n\n >>> "The sum of 1 + 2 is {0}".format(1+2)\n \'The sum of 1 + 2 is 3\'\n\n See *Format String Syntax* for a description of the various\n formatting options that can be specified in format strings.\n\n This method of string formatting is the new standard in Python 3.0,\n and should be preferred to the ``%`` formatting described in\n *String Formatting Operations* in new code.\n\n Added in version 2.6.\n\nstr.index(sub[, start[, end]])\n\n Like ``find()``, but raise ``ValueError`` when the substring is not\n found.\n\nstr.isalnum()\n\n Return true if all characters in the string are alphanumeric and\n there is at least one character, false otherwise.\n\n For 8-bit strings, this method is locale-dependent.\n\nstr.isalpha()\n\n Return true if all characters in the string are alphabetic and\n there is at least one character, false otherwise.\n\n For 8-bit strings, this method is locale-dependent.\n\nstr.isdigit()\n\n Return true if all characters in the string are digits and there is\n at least one character, false otherwise.\n\n For 8-bit strings, this method is locale-dependent.\n\nstr.islower()\n\n Return true if all cased characters in the string are lowercase and\n there is at least one cased character, false otherwise.\n\n For 8-bit strings, this method is locale-dependent.\n\nstr.isspace()\n\n Return true if there are only whitespace characters in the string\n and there is at least one character, false otherwise.\n\n For 8-bit strings, this method is locale-dependent.\n\nstr.istitle()\n\n Return true if the string is a titlecased string and there is at\n least one character, for example uppercase characters may only\n follow uncased characters and lowercase characters only cased ones.\n Return false otherwise.\n\n For 8-bit strings, this method is locale-dependent.\n\nstr.isupper()\n\n Return true if all cased characters in the string are uppercase and\n there is at least one cased character, false otherwise.\n\n For 8-bit strings, this method is locale-dependent.\n\nstr.join(seq)\n\n Return a string which is the concatenation of the strings in the\n sequence *seq*. The separator between elements is the string\n providing this method.\n\nstr.ljust(width[, fillchar])\n\n Return the string left justified in a string of length *width*.\n Padding is done using the specified *fillchar* (default is a\n space). The original string is returned if *width* is less than\n ``len(s)``.\n\n Changed in version 2.4: Support for the *fillchar* argument.\n\nstr.lower()\n\n Return a copy of the string converted to lowercase.\n\n For 8-bit strings, this method is locale-dependent.\n\nstr.lstrip([chars])\n\n Return a copy of the string with leading characters removed. The\n *chars* argument is a string specifying the set of characters to be\n removed. If omitted or ``None``, the *chars* argument defaults to\n removing whitespace. The *chars* argument is not a prefix; rather,\n all combinations of its values are stripped:\n\n >>> \' spacious \'.lstrip()\n \'spacious \'\n >>> \'www.example.com\'.lstrip(\'cmowz.\')\n \'example.com\'\n\n Changed in version 2.2.2: Support for the *chars* argument.\n\nstr.partition(sep)\n\n Split the string at the first occurrence of *sep*, and return a\n 3-tuple containing the part before the separator, the separator\n itself, and the part after the separator. If the separator is not\n found, return a 3-tuple containing the string itself, followed by\n two empty strings.\n\n Added in version 2.5.\n\nstr.replace(old, new[, count])\n\n Return a copy of the string with all occurrences of substring *old*\n replaced by *new*. If the optional argument *count* is given, only\n the first *count* occurrences are replaced.\n\nstr.rfind(sub[, start[, end]])\n\n Return the highest index in the string where substring *sub* is\n found, such that *sub* is contained within s[start,end]. Optional\n arguments *start* and *end* are interpreted as in slice notation.\n Return ``-1`` on failure.\n\nstr.rindex(sub[, start[, end]])\n\n Like ``rfind()`` but raises ``ValueError`` when the substring *sub*\n is not found.\n\nstr.rjust(width[, fillchar])\n\n Return the string right justified in a string of length *width*.\n Padding is done using the specified *fillchar* (default is a\n space). The original string is returned if *width* is less than\n ``len(s)``.\n\n Changed in version 2.4: Support for the *fillchar* argument.\n\nstr.rpartition(sep)\n\n Split the string at the last occurrence of *sep*, and return a\n 3-tuple containing the part before the separator, the separator\n itself, and the part after the separator. If the separator is not\n found, return a 3-tuple containing two empty strings, followed by\n the string itself.\n\n Added in version 2.5.\n\nstr.rsplit([sep[, maxsplit]])\n\n Return a list of the words in the string, using *sep* as the\n delimiter string. If *maxsplit* is given, at most *maxsplit* splits\n are done, the *rightmost* ones. If *sep* is not specified or\n ``None``, any whitespace string is a separator. Except for\n splitting from the right, ``rsplit()`` behaves like ``split()``\n which is described in detail below.\n\n Added in version 2.4.\n\nstr.rstrip([chars])\n\n Return a copy of the string with trailing characters removed. The\n *chars* argument is a string specifying the set of characters to be\n removed. If omitted or ``None``, the *chars* argument defaults to\n removing whitespace. The *chars* argument is not a suffix; rather,\n all combinations of its values are stripped:\n\n >>> \' spacious \'.rstrip()\n \' spacious\'\n >>> \'mississippi\'.rstrip(\'ipz\')\n \'mississ\'\n\n Changed in version 2.2.2: Support for the *chars* argument.\n\nstr.split([sep[, maxsplit]])\n\n Return a list of the words in the string, using *sep* as the\n delimiter string. If *maxsplit* is given, at most *maxsplit*\n splits are done (thus, the list will have at most ``maxsplit+1``\n elements). If *maxsplit* is not specified, then there is no limit\n on the number of splits (all possible splits are made).\n\n If *sep* is given, consecutive delimiters are not grouped together\n and are deemed to delimit empty strings (for example,\n ``\'1,,2\'.split(\',\')`` returns ``[\'1\', \'\', \'2\']``). The *sep*\n argument may consist of multiple characters (for example,\n ``\'1<>2<>3\'.split(\'<>\')`` returns ``[\'1\', \'2\', \'3\']``). Splitting\n an empty string with a specified separator returns ``[\'\']``.\n\n If *sep* is not specified or is ``None``, a different splitting\n algorithm is applied: runs of consecutive whitespace are regarded\n as a single separator, and the result will contain no empty strings\n at the start or end if the string has leading or trailing\n whitespace. Consequently, splitting an empty string or a string\n consisting of just whitespace with a ``None`` separator returns\n ``[]``.\n\n For example, ``\' 1 2 3 \'.split()`` returns ``[\'1\', \'2\', \'3\']``,\n and ``\' 1 2 3 \'.split(None, 1)`` returns ``[\'1\', \'2 3 \']``.\n\nstr.splitlines([keepends])\n\n Return a list of the lines in the string, breaking at line\n boundaries. Line breaks are not included in the resulting list\n unless *keepends* is given and true.\n\nstr.startswith(prefix[, start[, end]])\n\n Return ``True`` if string starts with the *prefix*, otherwise\n return ``False``. *prefix* can also be a tuple of prefixes to look\n for. With optional *start*, test string beginning at that\n position. With optional *end*, stop comparing string at that\n position.\n\n Changed in version 2.5: Accept tuples as *prefix*.\n\nstr.strip([chars])\n\n Return a copy of the string with the leading and trailing\n characters removed. The *chars* argument is a string specifying the\n set of characters to be removed. If omitted or ``None``, the\n *chars* argument defaults to removing whitespace. The *chars*\n argument is not a prefix or suffix; rather, all combinations of its\n values are stripped:\n\n >>> \' spacious \'.strip()\n \'spacious\'\n >>> \'www.example.com\'.strip(\'cmowz.\')\n \'example\'\n\n Changed in version 2.2.2: Support for the *chars* argument.\n\nstr.swapcase()\n\n Return a copy of the string with uppercase characters converted to\n lowercase and vice versa.\n\n For 8-bit strings, this method is locale-dependent.\n\nstr.title()\n\n Return a titlecased version of the string: words start with\n uppercase characters, all remaining cased characters are lowercase.\n\n For 8-bit strings, this method is locale-dependent.\n\nstr.translate(table[, deletechars])\n\n Return a copy of the string where all characters occurring in the\n optional argument *deletechars* are removed, and the remaining\n characters have been mapped through the given translation table,\n which must be a string of length 256.\n\n You can use the ``maketrans()`` helper function in the ``string``\n module to create a translation table. For string objects, set the\n *table* argument to ``None`` for translations that only delete\n characters:\n\n >>> \'read this short text\'.translate(None, \'aeiou\')\n \'rd ths shrt txt\'\n\n Added in version 2.6: Support for a ``None`` *table* argument.\n\n For Unicode objects, the ``translate()`` method does not accept the\n optional *deletechars* argument. Instead, it returns a copy of the\n *s* where all characters have been mapped through the given\n translation table which must be a mapping of Unicode ordinals to\n Unicode ordinals, Unicode strings or ``None``. Unmapped characters\n are left untouched. Characters mapped to ``None`` are deleted.\n Note, a more flexible approach is to create a custom character\n mapping codec using the ``codecs`` module (see ``encodings.cp1251``\n for an example).\n\nstr.upper()\n\n Return a copy of the string converted to uppercase.\n\n For 8-bit strings, this method is locale-dependent.\n\nstr.zfill(width)\n\n Return the numeric string left filled with zeros in a string of\n length *width*. A sign prefix is handled correctly. The original\n string is returned if *width* is less than ``len(s)``.\n\n Added in version 2.2.2.\n\nThe following methods are present only on unicode objects:\n\nunicode.isnumeric()\n\n Return ``True`` if there are only numeric characters in S,\n ``False`` otherwise. Numeric characters include digit characters,\n and all characters that have the Unicode numeric value property,\n e.g. U+2155, VULGAR FRACTION ONE FIFTH.\n\nunicode.isdecimal()\n\n Return ``True`` if there are only decimal characters in S,\n ``False`` otherwise. Decimal characters include digit characters,\n and all characters that that can be used to form decimal-radix\n numbers, e.g. U+0660, ARABIC-INDIC DIGIT ZERO.\n\n\nString Formatting Operations\n============================\n\nString and Unicode objects have one unique built-in operation: the\n``%`` operator (modulo). This is also known as the string\n*formatting* or *interpolation* operator. Given ``format % values``\n(where *format* is a string or Unicode object), ``%`` conversion\nspecifications in *format* are replaced with zero or more elements of\n*values*. The effect is similar to the using ``sprintf`` in the C\nlanguage. If *format* is a Unicode object, or if any of the objects\nbeing converted using the ``%s`` conversion are Unicode objects, the\nresult will also be a Unicode object.\n\nIf *format* requires a single argument, *values* may be a single non-\ntuple object. [4] Otherwise, *values* must be a tuple with exactly\nthe number of items specified by the format string, or a single\nmapping object (for example, a dictionary).\n\nA conversion specifier contains two or more characters and has the\nfollowing components, which must occur in this order:\n\n1. The ``\'%\'`` character, which marks the start of the specifier.\n\n2. Mapping key (optional), consisting of a parenthesised sequence of\n characters (for example, ``(somename)``).\n\n3. Conversion flags (optional), which affect the result of some\n conversion types.\n\n4. Minimum field width (optional). If specified as an ``\'*\'``\n (asterisk), the actual width is read from the next element of the\n tuple in *values*, and the object to convert comes after the\n minimum field width and optional precision.\n\n5. Precision (optional), given as a ``\'.\'`` (dot) followed by the\n precision. If specified as ``\'*\'`` (an asterisk), the actual width\n is read from the next element of the tuple in *values*, and the\n value to convert comes after the precision.\n\n6. Length modifier (optional).\n\n7. Conversion type.\n\nWhen the right argument is a dictionary (or other mapping type), then\nthe formats in the string *must* include a parenthesised mapping key\ninto that dictionary inserted immediately after the ``\'%\'`` character.\nThe mapping key selects the value to be formatted from the mapping.\nFor example:\n\n>>> print \'%(language)s has %(#)03d quote types.\' % \\\n... {\'language\': "Python", "#": 2}\nPython has 002 quote types.\n\nIn this case no ``*`` specifiers may occur in a format (since they\nrequire a sequential parameter list).\n\nThe conversion flag characters are:\n\n+-----------+-----------------------------------------------------------------------+\n| Flag | Meaning |\n+===========+=======================================================================+\n| ``\'#\'`` | The value conversion will use the "alternate form" (where defined |\n| | below). |\n+-----------+-----------------------------------------------------------------------+\n| ``\'0\'`` | The conversion will be zero padded for numeric values. |\n+-----------+-----------------------------------------------------------------------+\n| ``\'-\'`` | The converted value is left adjusted (overrides the ``\'0\'`` |\n| | conversion if both are given). |\n+-----------+-----------------------------------------------------------------------+\n| ``\' \'`` | (a space) A blank should be left before a positive number (or empty |\n| | string) produced by a signed conversion. |\n+-----------+-----------------------------------------------------------------------+\n| ``\'+\'`` | A sign character (``\'+\'`` or ``\'-\'``) will precede the conversion |\n| | (overrides a "space" flag). |\n+-----------+-----------------------------------------------------------------------+\n\nA length modifier (``h``, ``l``, or ``L``) may be present, but is\nignored as it is not necessary for Python -- so e.g. ``%ld`` is\nidentical to ``%d``.\n\nThe conversion types are:\n\n+--------------+-------------------------------------------------------+---------+\n| Conversion | Meaning | Notes |\n+==============+=======================================================+=========+\n| ``\'d\'`` | Signed integer decimal. | |\n+--------------+-------------------------------------------------------+---------+\n| ``\'i\'`` | Signed integer decimal. | |\n+--------------+-------------------------------------------------------+---------+\n| ``\'o\'`` | Signed octal value. | (1) |\n+--------------+-------------------------------------------------------+---------+\n| ``\'u\'`` | Obselete type -- it is identical to ``\'d\'``. | (7) |\n+--------------+-------------------------------------------------------+---------+\n| ``\'x\'`` | Signed hexadecimal (lowercase). | (2) |\n+--------------+-------------------------------------------------------+---------+\n| ``\'X\'`` | Signed hexadecimal (uppercase). | (2) |\n+--------------+-------------------------------------------------------+---------+\n| ``\'e\'`` | Floating point exponential format (lowercase). | (3) |\n+--------------+-------------------------------------------------------+---------+\n| ``\'E\'`` | Floating point exponential format (uppercase). | (3) |\n+--------------+-------------------------------------------------------+---------+\n| ``\'f\'`` | Floating point decimal format. | (3) |\n+--------------+-------------------------------------------------------+---------+\n| ``\'F\'`` | Floating point decimal format. | (3) |\n+--------------+-------------------------------------------------------+---------+\n| ``\'g\'`` | Floating point format. Uses lowercase exponential | (4) |\n| | format if exponent is less than -4 or not less than | |\n| | precision, decimal format otherwise. | |\n+--------------+-------------------------------------------------------+---------+\n| ``\'G\'`` | Floating point format. Uses uppercase exponential | (4) |\n| | format if exponent is less than -4 or not less than | |\n| | precision, decimal format otherwise. | |\n+--------------+-------------------------------------------------------+---------+\n| ``\'c\'`` | Single character (accepts integer or single character | |\n| | string). | |\n+--------------+-------------------------------------------------------+---------+\n| ``\'r\'`` | String (converts any python object using ``repr()``). | (5) |\n+--------------+-------------------------------------------------------+---------+\n| ``\'s\'`` | String (converts any python object using ``str()``). | (6) |\n+--------------+-------------------------------------------------------+---------+\n| ``\'%\'`` | No argument is converted, results in a ``\'%\'`` | |\n| | character in the result. | |\n+--------------+-------------------------------------------------------+---------+\n\nNotes:\n\n1. The alternate form causes a leading zero (``\'0\'``) to be inserted\n between left-hand padding and the formatting of the number if the\n leading character of the result is not already a zero.\n\n2. The alternate form causes a leading ``\'0x\'`` or ``\'0X\'`` (depending\n on whether the ``\'x\'`` or ``\'X\'`` format was used) to be inserted\n between left-hand padding and the formatting of the number if the\n leading character of the result is not already a zero.\n\n3. The alternate form causes the result to always contain a decimal\n point, even if no digits follow it.\n\n The precision determines the number of digits after the decimal\n point and defaults to 6.\n\n4. The alternate form causes the result to always contain a decimal\n point, and trailing zeroes are not removed as they would otherwise\n be.\n\n The precision determines the number of significant digits before\n and after the decimal point and defaults to 6.\n\n5. The ``%r`` conversion was added in Python 2.0.\n\n The precision determines the maximal number of characters used.\n\n6. If the object or format provided is a ``unicode`` string, the\n resulting string will also be ``unicode``.\n\n The precision determines the maximal number of characters used.\n\n7. See **PEP 237**.\n\nSince Python strings have an explicit length, ``%s`` conversions do\nnot assume that ``\'\\0\'`` is the end of the string.\n\nFor safety reasons, floating point precisions are clipped to 50;\n``%f`` conversions for numbers whose absolute value is over 1e25 are\nreplaced by ``%g`` conversions. [5] All other errors raise\nexceptions.\n\nAdditional string operations are defined in standard modules\n``string`` and ``re``.\n\n\nXRange Type\n===========\n\nThe ``xrange`` type is an immutable sequence which is commonly used\nfor looping. The advantage of the ``xrange`` type is that an\n``xrange`` object will always take the same amount of memory, no\nmatter the size of the range it represents. There are no consistent\nperformance advantages.\n\nXRange objects have very little behavior: they only support indexing,\niteration, and the ``len()`` function.\n\n\nMutable Sequence Types\n======================\n\nList objects support additional operations that allow in-place\nmodification of the object. Other mutable sequence types (when added\nto the language) should also support these operations. Strings and\ntuples are immutable sequence types: such objects cannot be modified\nonce created. The following operations are defined on mutable sequence\ntypes (where *x* is an arbitrary object):\n\n+--------------------------------+----------------------------------+-----------------------+\n| Operation | Result | Notes |\n+================================+==================================+=======================+\n| ``s[i] = x`` | item *i* of *s* is replaced by | |\n| | *x* | |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s[i:j] = t`` | slice of *s* from *i* to *j* is | |\n| | replaced by the contents of the | |\n| | iterable *t* | |\n+--------------------------------+----------------------------------+-----------------------+\n| ``del s[i:j]`` | same as ``s[i:j] = []`` | |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s[i:j:k] = t`` | the elements of ``s[i:j:k]`` are | (1) |\n| | replaced by those of *t* | |\n+--------------------------------+----------------------------------+-----------------------+\n| ``del s[i:j:k]`` | removes the elements of | |\n| | ``s[i:j:k]`` from the list | |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s.append(x)`` | same as ``s[len(s):len(s)] = | (2) |\n| | [x]`` | |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s.extend(x)`` | same as ``s[len(s):len(s)] = x`` | (3) |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s.count(x)`` | return number of *i*\'s for which | |\n| | ``s[i] == x`` | |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s.index(x[, i[, j]])`` | return smallest *k* such that | (4) |\n| | ``s[k] == x`` and ``i <= k < j`` | |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s.insert(i, x)`` | same as ``s[i:i] = [x]`` | (5) |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s.pop([i])`` | same as ``x = s[i]; del s[i]; | (6) |\n| | return x`` | |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s.remove(x)`` | same as ``del s[s.index(x)]`` | (4) |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s.reverse()`` | reverses the items of *s* in | (7) |\n| | place | |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s.sort([cmp[, key[, | sort the items of *s* in place | (7)(8)(9)(10) |\n| reverse]]])`` | | |\n+--------------------------------+----------------------------------+-----------------------+\n\nNotes:\n\n1. *t* must have the same length as the slice it is replacing.\n\n2. The C implementation of Python has historically accepted multiple\n parameters and implicitly joined them into a tuple; this no longer\n works in Python 2.0. Use of this misfeature has been deprecated\n since Python 1.4.\n\n3. *x* can be any iterable object.\n\n4. Raises ``ValueError`` when *x* is not found in *s*. When a negative\n index is passed as the second or third parameter to the ``index()``\n method, the list length is added, as for slice indices. If it is\n still negative, it is truncated to zero, as for slice indices.\n\n Changed in version 2.3: Previously, ``index()`` didn\'t have\n arguments for specifying start and stop positions.\n\n5. When a negative index is passed as the first parameter to the\n ``insert()`` method, the list length is added, as for slice\n indices. If it is still negative, it is truncated to zero, as for\n slice indices.\n\n Changed in version 2.3: Previously, all negative indices were\n truncated to zero.\n\n6. The ``pop()`` method is only supported by the list and array types.\n The optional argument *i* defaults to ``-1``, so that by default\n the last item is removed and returned.\n\n7. The ``sort()`` and ``reverse()`` methods modify the list in place\n for economy of space when sorting or reversing a large list. To\n remind you that they operate by side effect, they don\'t return the\n sorted or reversed list.\n\n8. The ``sort()`` method takes optional arguments for controlling the\n comparisons.\n\n *cmp* specifies a custom comparison function of two arguments (list\n items) which should return a negative, zero or positive number\n depending on whether the first argument is considered smaller than,\n equal to, or larger than the second argument: ``cmp=lambda x,y:\n cmp(x.lower(), y.lower())``. The default value is ``None``.\n\n *key* specifies a function of one argument that is used to extract\n a comparison key from each list element: ``key=str.lower``. The\n default value is ``None``.\n\n *reverse* is a boolean value. If set to ``True``, then the list\n elements are sorted as if each comparison were reversed.\n\n In general, the *key* and *reverse* conversion processes are much\n faster than specifying an equivalent *cmp* function. This is\n because *cmp* is called multiple times for each list element while\n *key* and *reverse* touch each element only once.\n\n Changed in version 2.3: Support for ``None`` as an equivalent to\n omitting *cmp* was added.\n\n Changed in version 2.4: Support for *key* and *reverse* was added.\n\n9. Starting with Python 2.3, the ``sort()`` method is guaranteed to be\n stable. A sort is stable if it guarantees not to change the\n relative order of elements that compare equal --- this is helpful\n for sorting in multiple passes (for example, sort by department,\n then by salary grade).\n\n10. While a list is being sorted, the effect of attempting to mutate,\n or even inspect, the list is undefined. The C implementation of\n Python 2.3 and newer makes the list appear empty for the duration,\n and raises ``ValueError`` if it can detect that the list has been\n mutated during a sort.\n', + 'typesseq': u'\nSequence Types --- ``str``, ``unicode``, ``list``, ``tuple``, ``buffer``, ``xrange``\n************************************************************************************\n\nThere are six sequence types: strings, Unicode strings, lists, tuples,\nbuffers, and xrange objects. (For other containers see the built in\n``dict``, ``list``, ``set``, and ``tuple`` classes, and the\n``collections`` module.)\n\nString literals are written in single or double quotes: ``\'xyzzy\'``,\n``"frobozz"``. See *String literals* for more about string literals.\nUnicode strings are much like strings, but are specified in the syntax\nusing a preceding ``\'u\'`` character: ``u\'abc\'``, ``u"def"``. In\naddition to the functionality described here, there are also string-\nspecific methods described in the *String Methods* section. Lists are\nconstructed with square brackets, separating items with commas: ``[a,\nb, c]``. Tuples are constructed by the comma operator (not within\nsquare brackets), with or without enclosing parentheses, but an empty\ntuple must have the enclosing parentheses, such as ``a, b, c`` or\n``()``. A single item tuple must have a trailing comma, such as\n``(d,)``.\n\nBuffer objects are not directly supported by Python syntax, but can be\ncreated by calling the builtin function ``buffer()``. They don\'t\nsupport concatenation or repetition.\n\nObjects of type xrange are similar to buffers in that there is no\nspecific syntax to create them, but they are created using the\n``xrange()`` function. They don\'t support slicing, concatenation or\nrepetition, and using ``in``, ``not in``, ``min()`` or ``max()`` on\nthem is inefficient.\n\nMost sequence types support the following operations. The ``in`` and\n``not in`` operations have the same priorities as the comparison\noperations. The ``+`` and ``*`` operations have the same priority as\nthe corresponding numeric operations. [3] Additional methods are\nprovided for *Mutable Sequence Types*.\n\nThis table lists the sequence operations sorted in ascending priority\n(operations in the same box have the same priority). In the table,\n*s* and *t* are sequences of the same type; *n*, *i* and *j* are\nintegers:\n\n+--------------------+----------------------------------+------------+\n| Operation | Result | Notes |\n+====================+==================================+============+\n| ``x in s`` | ``True`` if an item of *s* is | (1) |\n| | equal to *x*, else ``False`` | |\n+--------------------+----------------------------------+------------+\n| ``x not in s`` | ``False`` if an item of *s* is | (1) |\n| | equal to *x*, else ``True`` | |\n+--------------------+----------------------------------+------------+\n| ``s + t`` | the concatenation of *s* and *t* | (6) |\n+--------------------+----------------------------------+------------+\n| ``s * n, n * s`` | *n* shallow copies of *s* | (2) |\n| | concatenated | |\n+--------------------+----------------------------------+------------+\n| ``s[i]`` | *i*\'th item of *s*, origin 0 | (3) |\n+--------------------+----------------------------------+------------+\n| ``s[i:j]`` | slice of *s* from *i* to *j* | (3)(4) |\n+--------------------+----------------------------------+------------+\n| ``s[i:j:k]`` | slice of *s* from *i* to *j* | (3)(5) |\n| | with step *k* | |\n+--------------------+----------------------------------+------------+\n| ``len(s)`` | length of *s* | |\n+--------------------+----------------------------------+------------+\n| ``min(s)`` | smallest item of *s* | |\n+--------------------+----------------------------------+------------+\n| ``max(s)`` | largest item of *s* | |\n+--------------------+----------------------------------+------------+\n\nSequence types also support comparisons. In particular, tuples and\nlists are compared lexicographically by comparing corresponding\nelements. This means that to compare equal, every element must compare\nequal and the two sequences must be of the same type and have the same\nlength. (For full details see *Comparisons* in the language\nreference.)\n\nNotes:\n\n1. When *s* is a string or Unicode string object the ``in`` and ``not\n in`` operations act like a substring test. In Python versions\n before 2.3, *x* had to be a string of length 1. In Python 2.3 and\n beyond, *x* may be a string of any length.\n\n2. Values of *n* less than ``0`` are treated as ``0`` (which yields an\n empty sequence of the same type as *s*). Note also that the copies\n are shallow; nested structures are not copied. This often haunts\n new Python programmers; consider:\n\n >>> lists = [[]] * 3\n >>> lists\n [[], [], []]\n >>> lists[0].append(3)\n >>> lists\n [[3], [3], [3]]\n\n What has happened is that ``[[]]`` is a one-element list containing\n an empty list, so all three elements of ``[[]] * 3`` are (pointers\n to) this single empty list. Modifying any of the elements of\n ``lists`` modifies this single list. You can create a list of\n different lists this way:\n\n >>> lists = [[] for i in range(3)]\n >>> lists[0].append(3)\n >>> lists[1].append(5)\n >>> lists[2].append(7)\n >>> lists\n [[3], [5], [7]]\n\n3. If *i* or *j* is negative, the index is relative to the end of the\n string: ``len(s) + i`` or ``len(s) + j`` is substituted. But note\n that ``-0`` is still ``0``.\n\n4. The slice of *s* from *i* to *j* is defined as the sequence of\n items with index *k* such that ``i <= k < j``. If *i* or *j* is\n greater than ``len(s)``, use ``len(s)``. If *i* is omitted or\n ``None``, use ``0``. If *j* is omitted or ``None``, use\n ``len(s)``. If *i* is greater than or equal to *j*, the slice is\n empty.\n\n5. The slice of *s* from *i* to *j* with step *k* is defined as the\n sequence of items with index ``x = i + n*k`` such that ``0 <= n <\n (j-i)/k``. In other words, the indices are ``i``, ``i+k``,\n ``i+2*k``, ``i+3*k`` and so on, stopping when *j* is reached (but\n never including *j*). If *i* or *j* is greater than ``len(s)``,\n use ``len(s)``. If *i* or *j* are omitted or ``None``, they become\n "end" values (which end depends on the sign of *k*). Note, *k*\n cannot be zero. If *k* is ``None``, it is treated like ``1``.\n\n6. If *s* and *t* are both strings, some Python implementations such\n as CPython can usually perform an in-place optimization for\n assignments of the form ``s=s+t`` or ``s+=t``. When applicable,\n this optimization makes quadratic run-time much less likely. This\n optimization is both version and implementation dependent. For\n performance sensitive code, it is preferable to use the\n ``str.join()`` method which assures consistent linear concatenation\n performance across versions and implementations.\n\n Changed in version 2.4: Formerly, string concatenation never\n occurred in-place.\n\n\nString Methods\n==============\n\nBelow are listed the string methods which both 8-bit strings and\nUnicode objects support. Note that none of these methods take keyword\narguments.\n\nIn addition, Python\'s strings support the sequence type methods\ndescribed in the *Sequence Types --- str, unicode, list, tuple,\nbuffer, xrange* section. To output formatted strings use template\nstrings or the ``%`` operator described in the *String Formatting\nOperations* section. Also, see the ``re`` module for string functions\nbased on regular expressions.\n\nstr.capitalize()\n\n Return a copy of the string with only its first character\n capitalized.\n\n For 8-bit strings, this method is locale-dependent.\n\nstr.center(width[, fillchar])\n\n Return centered in a string of length *width*. Padding is done\n using the specified *fillchar* (default is a space).\n\n Changed in version 2.4: Support for the *fillchar* argument.\n\nstr.count(sub[, start[, end]])\n\n Return the number of occurrences of substring *sub* in the range\n [*start*, *end*]. Optional arguments *start* and *end* are\n interpreted as in slice notation.\n\nstr.decode([encoding[, errors]])\n\n Decodes the string using the codec registered for *encoding*.\n *encoding* defaults to the default string encoding. *errors* may\n be given to set a different error handling scheme. The default is\n ``\'strict\'``, meaning that encoding errors raise ``UnicodeError``.\n Other possible values are ``\'ignore\'``, ``\'replace\'`` and any other\n name registered via ``codecs.register_error()``, see section *Codec\n Base Classes*.\n\n New in version 2.2.\n\n Changed in version 2.3: Support for other error handling schemes\n added.\n\nstr.encode([encoding[, errors]])\n\n Return an encoded version of the string. Default encoding is the\n current default string encoding. *errors* may be given to set a\n different error handling scheme. The default for *errors* is\n ``\'strict\'``, meaning that encoding errors raise a\n ``UnicodeError``. Other possible values are ``\'ignore\'``,\n ``\'replace\'``, ``\'xmlcharrefreplace\'``, ``\'backslashreplace\'`` and\n any other name registered via ``codecs.register_error()``, see\n section *Codec Base Classes*. For a list of possible encodings, see\n section *Standard Encodings*.\n\n New in version 2.0.\n\n Changed in version 2.3: Support for ``\'xmlcharrefreplace\'`` and\n ``\'backslashreplace\'`` and other error handling schemes added.\n\nstr.endswith(suffix[, start[, end]])\n\n Return ``True`` if the string ends with the specified *suffix*,\n otherwise return ``False``. *suffix* can also be a tuple of\n suffixes to look for. With optional *start*, test beginning at\n that position. With optional *end*, stop comparing at that\n position.\n\n Changed in version 2.5: Accept tuples as *suffix*.\n\nstr.expandtabs([tabsize])\n\n Return a copy of the string where all tab characters are replaced\n by one or more spaces, depending on the current column and the\n given tab size. The column number is reset to zero after each\n newline occurring in the string. If *tabsize* is not given, a tab\n size of ``8`` characters is assumed. This doesn\'t understand other\n non-printing characters or escape sequences.\n\nstr.find(sub[, start[, end]])\n\n Return the lowest index in the string where substring *sub* is\n found, such that *sub* is contained in the range [*start*, *end*].\n Optional arguments *start* and *end* are interpreted as in slice\n notation. Return ``-1`` if *sub* is not found.\n\nstr.format(format_string, *args, **kwargs)\n\n Perform a string formatting operation. The *format_string*\n argument can contain literal text or replacement fields delimited\n by braces ``{}``. Each replacement field contains either the\n numeric index of a positional argument, or the name of a keyword\n argument. Returns a copy of *format_string* where each replacement\n field is replaced with the string value of the corresponding\n argument.\n\n >>> "The sum of 1 + 2 is {0}".format(1+2)\n \'The sum of 1 + 2 is 3\'\n\n See *Format String Syntax* for a description of the various\n formatting options that can be specified in format strings.\n\n This method of string formatting is the new standard in Python 3.0,\n and should be preferred to the ``%`` formatting described in\n *String Formatting Operations* in new code.\n\n New in version 2.6.\n\nstr.index(sub[, start[, end]])\n\n Like ``find()``, but raise ``ValueError`` when the substring is not\n found.\n\nstr.isalnum()\n\n Return true if all characters in the string are alphanumeric and\n there is at least one character, false otherwise.\n\n For 8-bit strings, this method is locale-dependent.\n\nstr.isalpha()\n\n Return true if all characters in the string are alphabetic and\n there is at least one character, false otherwise.\n\n For 8-bit strings, this method is locale-dependent.\n\nstr.isdigit()\n\n Return true if all characters in the string are digits and there is\n at least one character, false otherwise.\n\n For 8-bit strings, this method is locale-dependent.\n\nstr.islower()\n\n Return true if all cased characters in the string are lowercase and\n there is at least one cased character, false otherwise.\n\n For 8-bit strings, this method is locale-dependent.\n\nstr.isspace()\n\n Return true if there are only whitespace characters in the string\n and there is at least one character, false otherwise.\n\n For 8-bit strings, this method is locale-dependent.\n\nstr.istitle()\n\n Return true if the string is a titlecased string and there is at\n least one character, for example uppercase characters may only\n follow uncased characters and lowercase characters only cased ones.\n Return false otherwise.\n\n For 8-bit strings, this method is locale-dependent.\n\nstr.isupper()\n\n Return true if all cased characters in the string are uppercase and\n there is at least one cased character, false otherwise.\n\n For 8-bit strings, this method is locale-dependent.\n\nstr.join(seq)\n\n Return a string which is the concatenation of the strings in the\n sequence *seq*. The separator between elements is the string\n providing this method.\n\nstr.ljust(width[, fillchar])\n\n Return the string left justified in a string of length *width*.\n Padding is done using the specified *fillchar* (default is a\n space). The original string is returned if *width* is less than\n ``len(s)``.\n\n Changed in version 2.4: Support for the *fillchar* argument.\n\nstr.lower()\n\n Return a copy of the string converted to lowercase.\n\n For 8-bit strings, this method is locale-dependent.\n\nstr.lstrip([chars])\n\n Return a copy of the string with leading characters removed. The\n *chars* argument is a string specifying the set of characters to be\n removed. If omitted or ``None``, the *chars* argument defaults to\n removing whitespace. The *chars* argument is not a prefix; rather,\n all combinations of its values are stripped:\n\n >>> \' spacious \'.lstrip()\n \'spacious \'\n >>> \'www.example.com\'.lstrip(\'cmowz.\')\n \'example.com\'\n\n Changed in version 2.2.2: Support for the *chars* argument.\n\nstr.partition(sep)\n\n Split the string at the first occurrence of *sep*, and return a\n 3-tuple containing the part before the separator, the separator\n itself, and the part after the separator. If the separator is not\n found, return a 3-tuple containing the string itself, followed by\n two empty strings.\n\n New in version 2.5.\n\nstr.replace(old, new[, count])\n\n Return a copy of the string with all occurrences of substring *old*\n replaced by *new*. If the optional argument *count* is given, only\n the first *count* occurrences are replaced.\n\nstr.rfind(sub[, start[, end]])\n\n Return the highest index in the string where substring *sub* is\n found, such that *sub* is contained within s[start,end]. Optional\n arguments *start* and *end* are interpreted as in slice notation.\n Return ``-1`` on failure.\n\nstr.rindex(sub[, start[, end]])\n\n Like ``rfind()`` but raises ``ValueError`` when the substring *sub*\n is not found.\n\nstr.rjust(width[, fillchar])\n\n Return the string right justified in a string of length *width*.\n Padding is done using the specified *fillchar* (default is a\n space). The original string is returned if *width* is less than\n ``len(s)``.\n\n Changed in version 2.4: Support for the *fillchar* argument.\n\nstr.rpartition(sep)\n\n Split the string at the last occurrence of *sep*, and return a\n 3-tuple containing the part before the separator, the separator\n itself, and the part after the separator. If the separator is not\n found, return a 3-tuple containing two empty strings, followed by\n the string itself.\n\n New in version 2.5.\n\nstr.rsplit([sep[, maxsplit]])\n\n Return a list of the words in the string, using *sep* as the\n delimiter string. If *maxsplit* is given, at most *maxsplit* splits\n are done, the *rightmost* ones. If *sep* is not specified or\n ``None``, any whitespace string is a separator. Except for\n splitting from the right, ``rsplit()`` behaves like ``split()``\n which is described in detail below.\n\n New in version 2.4.\n\nstr.rstrip([chars])\n\n Return a copy of the string with trailing characters removed. The\n *chars* argument is a string specifying the set of characters to be\n removed. If omitted or ``None``, the *chars* argument defaults to\n removing whitespace. The *chars* argument is not a suffix; rather,\n all combinations of its values are stripped:\n\n >>> \' spacious \'.rstrip()\n \' spacious\'\n >>> \'mississippi\'.rstrip(\'ipz\')\n \'mississ\'\n\n Changed in version 2.2.2: Support for the *chars* argument.\n\nstr.split([sep[, maxsplit]])\n\n Return a list of the words in the string, using *sep* as the\n delimiter string. If *maxsplit* is given, at most *maxsplit*\n splits are done (thus, the list will have at most ``maxsplit+1``\n elements). If *maxsplit* is not specified, then there is no limit\n on the number of splits (all possible splits are made).\n\n If *sep* is given, consecutive delimiters are not grouped together\n and are deemed to delimit empty strings (for example,\n ``\'1,,2\'.split(\',\')`` returns ``[\'1\', \'\', \'2\']``). The *sep*\n argument may consist of multiple characters (for example,\n ``\'1<>2<>3\'.split(\'<>\')`` returns ``[\'1\', \'2\', \'3\']``). Splitting\n an empty string with a specified separator returns ``[\'\']``.\n\n If *sep* is not specified or is ``None``, a different splitting\n algorithm is applied: runs of consecutive whitespace are regarded\n as a single separator, and the result will contain no empty strings\n at the start or end if the string has leading or trailing\n whitespace. Consequently, splitting an empty string or a string\n consisting of just whitespace with a ``None`` separator returns\n ``[]``.\n\n For example, ``\' 1 2 3 \'.split()`` returns ``[\'1\', \'2\', \'3\']``,\n and ``\' 1 2 3 \'.split(None, 1)`` returns ``[\'1\', \'2 3 \']``.\n\nstr.splitlines([keepends])\n\n Return a list of the lines in the string, breaking at line\n boundaries. Line breaks are not included in the resulting list\n unless *keepends* is given and true.\n\nstr.startswith(prefix[, start[, end]])\n\n Return ``True`` if string starts with the *prefix*, otherwise\n return ``False``. *prefix* can also be a tuple of prefixes to look\n for. With optional *start*, test string beginning at that\n position. With optional *end*, stop comparing string at that\n position.\n\n Changed in version 2.5: Accept tuples as *prefix*.\n\nstr.strip([chars])\n\n Return a copy of the string with the leading and trailing\n characters removed. The *chars* argument is a string specifying the\n set of characters to be removed. If omitted or ``None``, the\n *chars* argument defaults to removing whitespace. The *chars*\n argument is not a prefix or suffix; rather, all combinations of its\n values are stripped:\n\n >>> \' spacious \'.strip()\n \'spacious\'\n >>> \'www.example.com\'.strip(\'cmowz.\')\n \'example\'\n\n Changed in version 2.2.2: Support for the *chars* argument.\n\nstr.swapcase()\n\n Return a copy of the string with uppercase characters converted to\n lowercase and vice versa.\n\n For 8-bit strings, this method is locale-dependent.\n\nstr.title()\n\n Return a titlecased version of the string: words start with\n uppercase characters, all remaining cased characters are lowercase.\n\n For 8-bit strings, this method is locale-dependent.\n\nstr.translate(table[, deletechars])\n\n Return a copy of the string where all characters occurring in the\n optional argument *deletechars* are removed, and the remaining\n characters have been mapped through the given translation table,\n which must be a string of length 256.\n\n You can use the ``maketrans()`` helper function in the ``string``\n module to create a translation table. For string objects, set the\n *table* argument to ``None`` for translations that only delete\n characters:\n\n >>> \'read this short text\'.translate(None, \'aeiou\')\n \'rd ths shrt txt\'\n\n New in version 2.6: Support for a ``None`` *table* argument.\n\n For Unicode objects, the ``translate()`` method does not accept the\n optional *deletechars* argument. Instead, it returns a copy of the\n *s* where all characters have been mapped through the given\n translation table which must be a mapping of Unicode ordinals to\n Unicode ordinals, Unicode strings or ``None``. Unmapped characters\n are left untouched. Characters mapped to ``None`` are deleted.\n Note, a more flexible approach is to create a custom character\n mapping codec using the ``codecs`` module (see ``encodings.cp1251``\n for an example).\n\nstr.upper()\n\n Return a copy of the string converted to uppercase.\n\n For 8-bit strings, this method is locale-dependent.\n\nstr.zfill(width)\n\n Return the numeric string left filled with zeros in a string of\n length *width*. A sign prefix is handled correctly. The original\n string is returned if *width* is less than ``len(s)``.\n\n New in version 2.2.2.\n\nThe following methods are present only on unicode objects:\n\nunicode.isnumeric()\n\n Return ``True`` if there are only numeric characters in S,\n ``False`` otherwise. Numeric characters include digit characters,\n and all characters that have the Unicode numeric value property,\n e.g. U+2155, VULGAR FRACTION ONE FIFTH.\n\nunicode.isdecimal()\n\n Return ``True`` if there are only decimal characters in S,\n ``False`` otherwise. Decimal characters include digit characters,\n and all characters that that can be used to form decimal-radix\n numbers, e.g. U+0660, ARABIC-INDIC DIGIT ZERO.\n\n\nString Formatting Operations\n============================\n\nString and Unicode objects have one unique built-in operation: the\n``%`` operator (modulo). This is also known as the string\n*formatting* or *interpolation* operator. Given ``format % values``\n(where *format* is a string or Unicode object), ``%`` conversion\nspecifications in *format* are replaced with zero or more elements of\n*values*. The effect is similar to the using ``sprintf`` in the C\nlanguage. If *format* is a Unicode object, or if any of the objects\nbeing converted using the ``%s`` conversion are Unicode objects, the\nresult will also be a Unicode object.\n\nIf *format* requires a single argument, *values* may be a single non-\ntuple object. [4] Otherwise, *values* must be a tuple with exactly\nthe number of items specified by the format string, or a single\nmapping object (for example, a dictionary).\n\nA conversion specifier contains two or more characters and has the\nfollowing components, which must occur in this order:\n\n1. The ``\'%\'`` character, which marks the start of the specifier.\n\n2. Mapping key (optional), consisting of a parenthesised sequence of\n characters (for example, ``(somename)``).\n\n3. Conversion flags (optional), which affect the result of some\n conversion types.\n\n4. Minimum field width (optional). If specified as an ``\'*\'``\n (asterisk), the actual width is read from the next element of the\n tuple in *values*, and the object to convert comes after the\n minimum field width and optional precision.\n\n5. Precision (optional), given as a ``\'.\'`` (dot) followed by the\n precision. If specified as ``\'*\'`` (an asterisk), the actual width\n is read from the next element of the tuple in *values*, and the\n value to convert comes after the precision.\n\n6. Length modifier (optional).\n\n7. Conversion type.\n\nWhen the right argument is a dictionary (or other mapping type), then\nthe formats in the string *must* include a parenthesised mapping key\ninto that dictionary inserted immediately after the ``\'%\'`` character.\nThe mapping key selects the value to be formatted from the mapping.\nFor example:\n\n>>> print \'%(language)s has %(#)03d quote types.\' % \\\n... {\'language\': "Python", "#": 2}\nPython has 002 quote types.\n\nIn this case no ``*`` specifiers may occur in a format (since they\nrequire a sequential parameter list).\n\nThe conversion flag characters are:\n\n+-----------+-----------------------------------------------------------------------+\n| Flag | Meaning |\n+===========+=======================================================================+\n| ``\'#\'`` | The value conversion will use the "alternate form" (where defined |\n| | below). |\n+-----------+-----------------------------------------------------------------------+\n| ``\'0\'`` | The conversion will be zero padded for numeric values. |\n+-----------+-----------------------------------------------------------------------+\n| ``\'-\'`` | The converted value is left adjusted (overrides the ``\'0\'`` |\n| | conversion if both are given). |\n+-----------+-----------------------------------------------------------------------+\n| ``\' \'`` | (a space) A blank should be left before a positive number (or empty |\n| | string) produced by a signed conversion. |\n+-----------+-----------------------------------------------------------------------+\n| ``\'+\'`` | A sign character (``\'+\'`` or ``\'-\'``) will precede the conversion |\n| | (overrides a "space" flag). |\n+-----------+-----------------------------------------------------------------------+\n\nA length modifier (``h``, ``l``, or ``L``) may be present, but is\nignored as it is not necessary for Python -- so e.g. ``%ld`` is\nidentical to ``%d``.\n\nThe conversion types are:\n\n+--------------+-------------------------------------------------------+---------+\n| Conversion | Meaning | Notes |\n+==============+=======================================================+=========+\n| ``\'d\'`` | Signed integer decimal. | |\n+--------------+-------------------------------------------------------+---------+\n| ``\'i\'`` | Signed integer decimal. | |\n+--------------+-------------------------------------------------------+---------+\n| ``\'o\'`` | Signed octal value. | (1) |\n+--------------+-------------------------------------------------------+---------+\n| ``\'u\'`` | Obselete type -- it is identical to ``\'d\'``. | (7) |\n+--------------+-------------------------------------------------------+---------+\n| ``\'x\'`` | Signed hexadecimal (lowercase). | (2) |\n+--------------+-------------------------------------------------------+---------+\n| ``\'X\'`` | Signed hexadecimal (uppercase). | (2) |\n+--------------+-------------------------------------------------------+---------+\n| ``\'e\'`` | Floating point exponential format (lowercase). | (3) |\n+--------------+-------------------------------------------------------+---------+\n| ``\'E\'`` | Floating point exponential format (uppercase). | (3) |\n+--------------+-------------------------------------------------------+---------+\n| ``\'f\'`` | Floating point decimal format. | (3) |\n+--------------+-------------------------------------------------------+---------+\n| ``\'F\'`` | Floating point decimal format. | (3) |\n+--------------+-------------------------------------------------------+---------+\n| ``\'g\'`` | Floating point format. Uses lowercase exponential | (4) |\n| | format if exponent is less than -4 or not less than | |\n| | precision, decimal format otherwise. | |\n+--------------+-------------------------------------------------------+---------+\n| ``\'G\'`` | Floating point format. Uses uppercase exponential | (4) |\n| | format if exponent is less than -4 or not less than | |\n| | precision, decimal format otherwise. | |\n+--------------+-------------------------------------------------------+---------+\n| ``\'c\'`` | Single character (accepts integer or single character | |\n| | string). | |\n+--------------+-------------------------------------------------------+---------+\n| ``\'r\'`` | String (converts any python object using ``repr()``). | (5) |\n+--------------+-------------------------------------------------------+---------+\n| ``\'s\'`` | String (converts any python object using ``str()``). | (6) |\n+--------------+-------------------------------------------------------+---------+\n| ``\'%\'`` | No argument is converted, results in a ``\'%\'`` | |\n| | character in the result. | |\n+--------------+-------------------------------------------------------+---------+\n\nNotes:\n\n1. The alternate form causes a leading zero (``\'0\'``) to be inserted\n between left-hand padding and the formatting of the number if the\n leading character of the result is not already a zero.\n\n2. The alternate form causes a leading ``\'0x\'`` or ``\'0X\'`` (depending\n on whether the ``\'x\'`` or ``\'X\'`` format was used) to be inserted\n between left-hand padding and the formatting of the number if the\n leading character of the result is not already a zero.\n\n3. The alternate form causes the result to always contain a decimal\n point, even if no digits follow it.\n\n The precision determines the number of digits after the decimal\n point and defaults to 6.\n\n4. The alternate form causes the result to always contain a decimal\n point, and trailing zeroes are not removed as they would otherwise\n be.\n\n The precision determines the number of significant digits before\n and after the decimal point and defaults to 6.\n\n5. The ``%r`` conversion was added in Python 2.0.\n\n The precision determines the maximal number of characters used.\n\n6. If the object or format provided is a ``unicode`` string, the\n resulting string will also be ``unicode``.\n\n The precision determines the maximal number of characters used.\n\n7. See **PEP 237**.\n\nSince Python strings have an explicit length, ``%s`` conversions do\nnot assume that ``\'\\0\'`` is the end of the string.\n\nFor safety reasons, floating point precisions are clipped to 50;\n``%f`` conversions for numbers whose absolute value is over 1e25 are\nreplaced by ``%g`` conversions. [5] All other errors raise\nexceptions.\n\nAdditional string operations are defined in standard modules\n``string`` and ``re``.\n\n\nXRange Type\n===========\n\nThe ``xrange`` type is an immutable sequence which is commonly used\nfor looping. The advantage of the ``xrange`` type is that an\n``xrange`` object will always take the same amount of memory, no\nmatter the size of the range it represents. There are no consistent\nperformance advantages.\n\nXRange objects have very little behavior: they only support indexing,\niteration, and the ``len()`` function.\n\n\nMutable Sequence Types\n======================\n\nList objects support additional operations that allow in-place\nmodification of the object. Other mutable sequence types (when added\nto the language) should also support these operations. Strings and\ntuples are immutable sequence types: such objects cannot be modified\nonce created. The following operations are defined on mutable sequence\ntypes (where *x* is an arbitrary object):\n\n+--------------------------------+----------------------------------+-----------------------+\n| Operation | Result | Notes |\n+================================+==================================+=======================+\n| ``s[i] = x`` | item *i* of *s* is replaced by | |\n| | *x* | |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s[i:j] = t`` | slice of *s* from *i* to *j* is | |\n| | replaced by the contents of the | |\n| | iterable *t* | |\n+--------------------------------+----------------------------------+-----------------------+\n| ``del s[i:j]`` | same as ``s[i:j] = []`` | |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s[i:j:k] = t`` | the elements of ``s[i:j:k]`` are | (1) |\n| | replaced by those of *t* | |\n+--------------------------------+----------------------------------+-----------------------+\n| ``del s[i:j:k]`` | removes the elements of | |\n| | ``s[i:j:k]`` from the list | |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s.append(x)`` | same as ``s[len(s):len(s)] = | (2) |\n| | [x]`` | |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s.extend(x)`` | same as ``s[len(s):len(s)] = x`` | (3) |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s.count(x)`` | return number of *i*\'s for which | |\n| | ``s[i] == x`` | |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s.index(x[, i[, j]])`` | return smallest *k* such that | (4) |\n| | ``s[k] == x`` and ``i <= k < j`` | |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s.insert(i, x)`` | same as ``s[i:i] = [x]`` | (5) |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s.pop([i])`` | same as ``x = s[i]; del s[i]; | (6) |\n| | return x`` | |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s.remove(x)`` | same as ``del s[s.index(x)]`` | (4) |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s.reverse()`` | reverses the items of *s* in | (7) |\n| | place | |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s.sort([cmp[, key[, | sort the items of *s* in place | (7)(8)(9)(10) |\n| reverse]]])`` | | |\n+--------------------------------+----------------------------------+-----------------------+\n\nNotes:\n\n1. *t* must have the same length as the slice it is replacing.\n\n2. The C implementation of Python has historically accepted multiple\n parameters and implicitly joined them into a tuple; this no longer\n works in Python 2.0. Use of this misfeature has been deprecated\n since Python 1.4.\n\n3. *x* can be any iterable object.\n\n4. Raises ``ValueError`` when *x* is not found in *s*. When a negative\n index is passed as the second or third parameter to the ``index()``\n method, the list length is added, as for slice indices. If it is\n still negative, it is truncated to zero, as for slice indices.\n\n Changed in version 2.3: Previously, ``index()`` didn\'t have\n arguments for specifying start and stop positions.\n\n5. When a negative index is passed as the first parameter to the\n ``insert()`` method, the list length is added, as for slice\n indices. If it is still negative, it is truncated to zero, as for\n slice indices.\n\n Changed in version 2.3: Previously, all negative indices were\n truncated to zero.\n\n6. The ``pop()`` method is only supported by the list and array types.\n The optional argument *i* defaults to ``-1``, so that by default\n the last item is removed and returned.\n\n7. The ``sort()`` and ``reverse()`` methods modify the list in place\n for economy of space when sorting or reversing a large list. To\n remind you that they operate by side effect, they don\'t return the\n sorted or reversed list.\n\n8. The ``sort()`` method takes optional arguments for controlling the\n comparisons.\n\n *cmp* specifies a custom comparison function of two arguments (list\n items) which should return a negative, zero or positive number\n depending on whether the first argument is considered smaller than,\n equal to, or larger than the second argument: ``cmp=lambda x,y:\n cmp(x.lower(), y.lower())``. The default value is ``None``.\n\n *key* specifies a function of one argument that is used to extract\n a comparison key from each list element: ``key=str.lower``. The\n default value is ``None``.\n\n *reverse* is a boolean value. If set to ``True``, then the list\n elements are sorted as if each comparison were reversed.\n\n In general, the *key* and *reverse* conversion processes are much\n faster than specifying an equivalent *cmp* function. This is\n because *cmp* is called multiple times for each list element while\n *key* and *reverse* touch each element only once.\n\n Changed in version 2.3: Support for ``None`` as an equivalent to\n omitting *cmp* was added.\n\n Changed in version 2.4: Support for *key* and *reverse* was added.\n\n9. Starting with Python 2.3, the ``sort()`` method is guaranteed to be\n stable. A sort is stable if it guarantees not to change the\n relative order of elements that compare equal --- this is helpful\n for sorting in multiple passes (for example, sort by department,\n then by salary grade).\n\n10. While a list is being sorted, the effect of attempting to mutate,\n or even inspect, the list is undefined. The C implementation of\n Python 2.3 and newer makes the list appear empty for the duration,\n and raises ``ValueError`` if it can detect that the list has been\n mutated during a sort.\n', 'typesseq-mutable': u"\nMutable Sequence Types\n**********************\n\nList objects support additional operations that allow in-place\nmodification of the object. Other mutable sequence types (when added\nto the language) should also support these operations. Strings and\ntuples are immutable sequence types: such objects cannot be modified\nonce created. The following operations are defined on mutable sequence\ntypes (where *x* is an arbitrary object):\n\n+--------------------------------+----------------------------------+-----------------------+\n| Operation | Result | Notes |\n+================================+==================================+=======================+\n| ``s[i] = x`` | item *i* of *s* is replaced by | |\n| | *x* | |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s[i:j] = t`` | slice of *s* from *i* to *j* is | |\n| | replaced by the contents of the | |\n| | iterable *t* | |\n+--------------------------------+----------------------------------+-----------------------+\n| ``del s[i:j]`` | same as ``s[i:j] = []`` | |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s[i:j:k] = t`` | the elements of ``s[i:j:k]`` are | (1) |\n| | replaced by those of *t* | |\n+--------------------------------+----------------------------------+-----------------------+\n| ``del s[i:j:k]`` | removes the elements of | |\n| | ``s[i:j:k]`` from the list | |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s.append(x)`` | same as ``s[len(s):len(s)] = | (2) |\n| | [x]`` | |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s.extend(x)`` | same as ``s[len(s):len(s)] = x`` | (3) |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s.count(x)`` | return number of *i*'s for which | |\n| | ``s[i] == x`` | |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s.index(x[, i[, j]])`` | return smallest *k* such that | (4) |\n| | ``s[k] == x`` and ``i <= k < j`` | |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s.insert(i, x)`` | same as ``s[i:i] = [x]`` | (5) |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s.pop([i])`` | same as ``x = s[i]; del s[i]; | (6) |\n| | return x`` | |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s.remove(x)`` | same as ``del s[s.index(x)]`` | (4) |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s.reverse()`` | reverses the items of *s* in | (7) |\n| | place | |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s.sort([cmp[, key[, | sort the items of *s* in place | (7)(8)(9)(10) |\n| reverse]]])`` | | |\n+--------------------------------+----------------------------------+-----------------------+\n\nNotes:\n\n1. *t* must have the same length as the slice it is replacing.\n\n2. The C implementation of Python has historically accepted multiple\n parameters and implicitly joined them into a tuple; this no longer\n works in Python 2.0. Use of this misfeature has been deprecated\n since Python 1.4.\n\n3. *x* can be any iterable object.\n\n4. Raises ``ValueError`` when *x* is not found in *s*. When a negative\n index is passed as the second or third parameter to the ``index()``\n method, the list length is added, as for slice indices. If it is\n still negative, it is truncated to zero, as for slice indices.\n\n Changed in version 2.3: Previously, ``index()`` didn't have\n arguments for specifying start and stop positions.\n\n5. When a negative index is passed as the first parameter to the\n ``insert()`` method, the list length is added, as for slice\n indices. If it is still negative, it is truncated to zero, as for\n slice indices.\n\n Changed in version 2.3: Previously, all negative indices were\n truncated to zero.\n\n6. The ``pop()`` method is only supported by the list and array types.\n The optional argument *i* defaults to ``-1``, so that by default\n the last item is removed and returned.\n\n7. The ``sort()`` and ``reverse()`` methods modify the list in place\n for economy of space when sorting or reversing a large list. To\n remind you that they operate by side effect, they don't return the\n sorted or reversed list.\n\n8. The ``sort()`` method takes optional arguments for controlling the\n comparisons.\n\n *cmp* specifies a custom comparison function of two arguments (list\n items) which should return a negative, zero or positive number\n depending on whether the first argument is considered smaller than,\n equal to, or larger than the second argument: ``cmp=lambda x,y:\n cmp(x.lower(), y.lower())``. The default value is ``None``.\n\n *key* specifies a function of one argument that is used to extract\n a comparison key from each list element: ``key=str.lower``. The\n default value is ``None``.\n\n *reverse* is a boolean value. If set to ``True``, then the list\n elements are sorted as if each comparison were reversed.\n\n In general, the *key* and *reverse* conversion processes are much\n faster than specifying an equivalent *cmp* function. This is\n because *cmp* is called multiple times for each list element while\n *key* and *reverse* touch each element only once.\n\n Changed in version 2.3: Support for ``None`` as an equivalent to\n omitting *cmp* was added.\n\n Changed in version 2.4: Support for *key* and *reverse* was added.\n\n9. Starting with Python 2.3, the ``sort()`` method is guaranteed to be\n stable. A sort is stable if it guarantees not to change the\n relative order of elements that compare equal --- this is helpful\n for sorting in multiple passes (for example, sort by department,\n then by salary grade).\n\n10. While a list is being sorted, the effect of attempting to mutate,\n or even inspect, the list is undefined. The C implementation of\n Python 2.3 and newer makes the list appear empty for the duration,\n and raises ``ValueError`` if it can detect that the list has been\n mutated during a sort.\n", 'unary': u'\nUnary arithmetic operations\n***************************\n\nAll unary arithmetic (and bitwise) operations have the same priority:\n\n u_expr ::= power | "-" u_expr | "+" u_expr | "~" u_expr\n\nThe unary ``-`` (minus) operator yields the negation of its numeric\nargument.\n\nThe unary ``+`` (plus) operator yields its numeric argument unchanged.\n\nThe unary ``~`` (invert) operator yields the bitwise inversion of its\nplain or long integer argument. The bitwise inversion of ``x`` is\ndefined as ``-(x+1)``. It only applies to integral numbers.\n\nIn all three cases, if the argument does not have the proper type, a\n``TypeError`` exception is raised.\n', 'while': u'\nThe ``while`` statement\n***********************\n\nThe ``while`` statement is used for repeated execution as long as an\nexpression is true:\n\n while_stmt ::= "while" expression ":" suite\n ["else" ":" suite]\n\nThis repeatedly tests the expression and, if it is true, executes the\nfirst suite; if the expression is false (which may be the first time\nit is tested) the suite of the ``else`` clause, if present, is\nexecuted and the loop terminates.\n\nA ``break`` statement executed in the first suite terminates the loop\nwithout executing the ``else`` clause\'s suite. A ``continue``\nstatement executed in the first suite skips the rest of the suite and\ngoes back to testing the expression.\n', - 'with': u'\nThe ``with`` statement\n**********************\n\nAdded in version 2.5.\n\nThe ``with`` statement is used to wrap the execution of a block with\nmethods defined by a context manager (see section *With Statement\nContext Managers*). This allows common\n``try``...``except``...``finally`` usage patterns to be encapsulated\nfor convenient reuse.\n\n with_stmt ::= "with" expression ["as" target] ":" suite\n\nThe execution of the ``with`` statement proceeds as follows:\n\n1. The context expression is evaluated to obtain a context manager.\n\n2. The context manager\'s ``__enter__()`` method is invoked.\n\n3. If a target was included in the ``with`` statement, the return\n value from ``__enter__()`` is assigned to it.\n\n Note: The ``with`` statement guarantees that if the ``__enter__()``\n method returns without an error, then ``__exit__()`` will always\n be called. Thus, if an error occurs during the assignment to the\n target list, it will be treated the same as an error occurring\n within the suite would be. See step 5 below.\n\n4. The suite is executed.\n\n5. The context manager\'s ``__exit__()`` method is invoked. If an\n exception caused the suite to be exited, its type, value, and\n traceback are passed as arguments to ``__exit__()``. Otherwise,\n three ``None`` arguments are supplied.\n\n If the suite was exited due to an exception, and the return value\n from the ``__exit__()`` method was false, the exception is\n reraised. If the return value was true, the exception is\n suppressed, and execution continues with the statement following\n the ``with`` statement.\n\n If the suite was exited for any reason other than an exception, the\n return value from ``__exit__()`` is ignored, and execution proceeds\n at the normal location for the kind of exit that was taken.\n\nNote: In Python 2.5, the ``with`` statement is only allowed when the\n ``with_statement`` feature has been enabled. It is always enabled\n in Python 2.6.\n\nSee also:\n\n **PEP 0343** - The "with" statement\n The specification, background, and examples for the Python\n ``with`` statement.\n', + 'with': u'\nThe ``with`` statement\n**********************\n\nNew in version 2.5.\n\nThe ``with`` statement is used to wrap the execution of a block with\nmethods defined by a context manager (see section *With Statement\nContext Managers*). This allows common\n``try``...``except``...``finally`` usage patterns to be encapsulated\nfor convenient reuse.\n\n with_stmt ::= "with" expression ["as" target] ":" suite\n\nThe execution of the ``with`` statement proceeds as follows:\n\n1. The context expression is evaluated to obtain a context manager.\n\n2. The context manager\'s ``__enter__()`` method is invoked.\n\n3. If a target was included in the ``with`` statement, the return\n value from ``__enter__()`` is assigned to it.\n\n Note: The ``with`` statement guarantees that if the ``__enter__()``\n method returns without an error, then ``__exit__()`` will always\n be called. Thus, if an error occurs during the assignment to the\n target list, it will be treated the same as an error occurring\n within the suite would be. See step 5 below.\n\n4. The suite is executed.\n\n5. The context manager\'s ``__exit__()`` method is invoked. If an\n exception caused the suite to be exited, its type, value, and\n traceback are passed as arguments to ``__exit__()``. Otherwise,\n three ``None`` arguments are supplied.\n\n If the suite was exited due to an exception, and the return value\n from the ``__exit__()`` method was false, the exception is\n reraised. If the return value was true, the exception is\n suppressed, and execution continues with the statement following\n the ``with`` statement.\n\n If the suite was exited for any reason other than an exception, the\n return value from ``__exit__()`` is ignored, and execution proceeds\n at the normal location for the kind of exit that was taken.\n\nNote: In Python 2.5, the ``with`` statement is only allowed when the\n ``with_statement`` feature has been enabled. It is always enabled\n in Python 2.6.\n\nSee also:\n\n **PEP 0343** - The "with" statement\n The specification, background, and examples for the Python\n ``with`` statement.\n', 'yield': u'\nThe ``yield`` statement\n***********************\n\n yield_stmt ::= yield_expression\n\nThe ``yield`` statement is only used when defining a generator\nfunction, and is only used in the body of the generator function.\nUsing a ``yield`` statement in a function definition is sufficient to\ncause that definition to create a generator function instead of a\nnormal function.\n\nWhen a generator function is called, it returns an iterator known as a\ngenerator iterator, or more commonly, a generator. The body of the\ngenerator function is executed by calling the generator\'s ``next()``\nmethod repeatedly until it raises an exception.\n\nWhen a ``yield`` statement is executed, the state of the generator is\nfrozen and the value of **expression_list** is returned to\n``next()``\'s caller. By "frozen" we mean that all local state is\nretained, including the current bindings of local variables, the\ninstruction pointer, and the internal evaluation stack: enough\ninformation is saved so that the next time ``next()`` is invoked, the\nfunction can proceed exactly as if the ``yield`` statement were just\nanother external call.\n\nAs of Python version 2.5, the ``yield`` statement is now allowed in\nthe ``try`` clause of a ``try`` ... ``finally`` construct. If the\ngenerator is not resumed before it is finalized (by reaching a zero\nreference count or by being garbage collected), the generator-\niterator\'s ``close()`` method will be called, allowing any pending\n``finally`` clauses to execute.\n\nNote: In Python 2.2, the ``yield`` statement was only allowed when the\n ``generators`` feature has been enabled. This ``__future__`` import\n statement was used to enable the feature:\n\n from __future__ import generators\n\nSee also:\n\n **PEP 0255** - Simple Generators\n The proposal for adding generators and the ``yield`` statement\n to Python.\n\n **PEP 0342** - Coroutines via Enhanced Generators\n The proposal that, among other generator enhancements, proposed\n allowing ``yield`` to appear inside a ``try`` ... ``finally``\n block.\n'} From buildbot at python.org Fri Oct 3 00:29:33 2008 From: buildbot at python.org (buildbot at python.org) Date: Thu, 02 Oct 2008 22:29:33 +0000 Subject: [Python-checkins] buildbot failure in S-390 Debian 3.0 Message-ID: <20081002222933.A9B2B1E4002@bag.python.org> The Buildbot has detected a new failure of S-390 Debian 3.0. Full details are available at: http://www.python.org/dev/buildbot/all/S-390%20Debian%203.0/builds/953 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-debian-s390 Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: benjamin.peterson,christian.heimes,guido.van.rossum,martin.v.loewis BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_fnmatch ====================================================================== ERROR: test_mix_bytes_str (test.test_fnmatch.FnmatchTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/scratch/pybot/buildarea/3.0.klose-debian-s390/build/Lib/test/test_fnmatch.py", line 41, in test_mix_bytes_str self.assertRaises(TypeError, fnmatch, 'test', b'*') File "/scratch/pybot/buildarea/3.0.klose-debian-s390/build/Lib/unittest.py", line 311, in failUnlessRaises callableObj(*args, **kwargs) File "/scratch/pybot/buildarea/3.0.klose-debian-s390/build/Lib/fnmatch.py", line 38, in fnmatch return fnmatchcase(name, pat) File "/scratch/pybot/buildarea/3.0.klose-debian-s390/build/Lib/fnmatch.py", line 76, in fnmatchcase match = _compile_pattern(pat) File "/scratch/pybot/buildarea/3.0.klose-debian-s390/build/Lib/fnmatch.py", line 41, in _compile_pattern regex = _cache.get(pat) BytesWarning: Comparison between bytes and string make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Fri Oct 3 01:02:45 2008 From: buildbot at python.org (buildbot at python.org) Date: Thu, 02 Oct 2008 23:02:45 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.0 Message-ID: <20081002230245.5E9891E4002@bag.python.org> The Buildbot has detected a new failure of sparc solaris10 gcc 3.0. Full details are available at: http://www.python.org/dev/buildbot/all/sparc%20solaris10%20gcc%203.0/builds/627 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: loewis-sun Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: benjamin.peterson,christian.heimes,guido.van.rossum,martin.v.loewis BUILD FAILED: failed test Excerpt from the test logfile: 2 tests failed: test_fnmatch test_posix ====================================================================== ERROR: test_mix_bytes_str (test.test_fnmatch.FnmatchTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/test/test_fnmatch.py", line 41, in test_mix_bytes_str self.assertRaises(TypeError, fnmatch, 'test', b'*') File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/unittest.py", line 311, in failUnlessRaises callableObj(*args, **kwargs) File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/fnmatch.py", line 38, in fnmatch return fnmatchcase(name, pat) File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/fnmatch.py", line 76, in fnmatchcase match = _compile_pattern(pat) File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/fnmatch.py", line 41, in _compile_pattern regex = _cache.get(pat) BytesWarning: Comparison between bytes and string ====================================================================== ERROR: test_getcwd_long_pathnames (test.test_posix.PosixTester) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/test/test_posix.py", line 252, in test_getcwd_long_pathnames support.rmtree(base_path) File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/test/support.py", line 98, in rmtree shutil.rmtree(path) File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/shutil.py", line 225, in rmtree onerror(os.rmdir, path, sys.exc_info()) File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/shutil.py", line 223, in rmtree os.rmdir(path) OSError: [Errno 22] Invalid argument: '/home2/buildbot/slave/3.0.loewis-sun/build/@test.getcwd/@test.getcwd' sincerely, -The Buildbot From nnorwitz at gmail.com Fri Oct 3 05:51:04 2008 From: nnorwitz at gmail.com (Neal Norwitz) Date: Thu, 2 Oct 2008 23:51:04 -0400 Subject: [Python-checkins] Python Regression Test Failures all (1) Message-ID: <20081003035103.GA19133@python.psfb.org> 331 tests OK. 1 test failed: test_distutils 25 tests skipped: test_aepack test_al test_applesingle test_bsddb185 test_cd test_cl test_epoll test_gl test_imgfile test_ioctl test_kqueue test_lib2to3 test_macos test_macostools test_multiprocessing test_pep277 test_py3kwarn test_scriptpackages test_startfile test_sunaudiodev test_tcl test_unicode_file test_winreg test_winsound test_zipfile64 4 skips unexpected on linux2: test_epoll test_multiprocessing test_lib2to3 test_ioctl test_grammar test_opcodes test_dict test_builtin test_exceptions test_types test_unittest test_doctest test_doctest2 test_MimeWriter test_SimpleHTTPServer test_StringIO test___all__ test___future__ test__locale test_abc test_abstract_numbers test_aepack test_aepack skipped -- No module named aepack test_al test_al skipped -- No module named al test_anydbm test_applesingle test_applesingle skipped -- No module named macostools test_array test_ast test_asynchat test_asyncore test_atexit test_audioop test_augassign test_base64 test_bastion test_bigaddrspace test_bigmem test_binascii test_binhex test_binop test_bisect test_bool test_bsddb test_bsddb185 test_bsddb185 skipped -- No module named bsddb185 test_bsddb3 Sleepycat Software: Berkeley DB 4.1.25: (December 19, 2002) Test path prefix: /tmp/z-test_bsddb3-1858 test_buffer test_bufio test_bytes test_bz2 test_calendar test_call test_capi test_cd test_cd skipped -- No module named cd test_cfgparser test_cgi test_charmapcodec test_cl test_cl skipped -- No module named cl test_class test_cmath test_cmd test_cmd_line test_cmd_line_script test_code test_codeccallbacks test_codecencodings_cn test_codecencodings_hk test_codecencodings_jp test_codecencodings_kr test_codecencodings_tw test_codecmaps_cn test_codecmaps_hk test_codecmaps_jp test_codecmaps_kr test_codecmaps_tw test_codecs test_codeop test_coding test_coercion test_collections test_colorsys test_commands test_compare test_compile test_compiler testCompileLibrary still working, be patient... testCompileLibrary still working, be patient... testCompileLibrary still working, be patient... testCompileLibrary still working, be patient... testCompileLibrary still working, be patient... testCompileLibrary still working, be patient... testCompileLibrary still working, be patient... testCompileLibrary still working, be patient... testCompileLibrary still working, be patient... testCompileLibrary still working, be patient... test_complex test_complex_args test_contains test_contextlib test_cookie test_cookielib test_copy test_copy_reg test_cpickle test_cprofile test_crypt test_csv test_ctypes test_datetime test_dbm test_decimal test_decorators test_defaultdict test_deque test_descr test_descrtut test_difflib test_dircache test_dis test_distutils test test_distutils failed -- errors occurred; run in verbose mode for details test_dl test_docxmlrpc test_dumbdbm test_dummy_thread test_dummy_threading test_email test_email_codecs test_email_renamed test_enumerate test_eof test_epoll test_epoll skipped -- kernel doesn't support epoll() test_errno test_exception_variations test_extcall test_fcntl test_file test_filecmp test_fileinput test_fileio test_float test_fnmatch test_fork1 test_format test_fpformat test_fractions test_frozen test_ftplib test_funcattrs test_functools test_future test_future3 test_future4 test_future_builtins test_gc test_gdbm test_generators test_genericpath test_genexps test_getargs test_getargs2 test_getopt test_gettext test_gl test_gl skipped -- No module named gl test_glob test_global test_grp test_gzip test_hash test_hashlib test_heapq test_hmac test_hotshot test_htmllib test_htmlparser test_httplib test_httpservers [12826 refs] [12826 refs] [21355 refs] test_imageop test_imaplib test_imgfile test_imgfile skipped -- No module named imgfile test_imp test_import test_importhooks test_index test_inspect test_int test_int_literal test_io test_ioctl test_ioctl skipped -- Unable to open /dev/tty test_isinstance test_iter test_iterlen test_itertools test_json test_kqueue test_kqueue skipped -- test works only on BSD test_largefile test_lib2to3 test_lib2to3 skipped -- No module named myfixes test_list test_locale test_logging test_long test_long_future test_longexp test_macos test_macos skipped -- No module named MacOS test_macostools test_macostools skipped -- No module named macostools test_macpath test_mailbox test_marshal test_math test_md5 test_memoryio test_mhlib test_mimetools test_mimetypes test_minidom test_mmap test_module test_modulefinder test_multibytecodec test_multibytecodec_support test_multifile test_multiprocessing test_multiprocessing skipped -- OSError raises on RLock creation, see issue 3111! test_mutants test_mutex test_netrc test_new test_nis test_normalization test_ntpath test_old_mailbox test_openpty test_operator test_optparse test_os /tmp/python-test/local/lib/python2.6/os.py:759: DeprecationWarning: integer argument expected, got float bs += read(_urandomfd, n - len(bs)) test_parser Expecting 's_push: parser stack overflow' in next line s_push: parser stack overflow test_peepholer test_pep247 test_pep263 test_pep277 test_pep277 skipped -- test works only on NT+ test_pep292 test_pep352 test_pickle test_pickletools test_pipes test_pkg test_pkgimport test_pkgutil test_platform test_plistlib test_poll test_popen [12831 refs] [12831 refs] [12831 refs] test_popen2 test_poplib test_posix test_posixpath test_pow test_pprint test_print test_profile test_profilehooks test_property test_pstats test_pty test_pwd test_py3kwarn test_py3kwarn skipped -- test.test_py3kwarn must be run with the -3 flag test_pyclbr test_pydoc [17360 refs] test_pyexpat test_queue test_quopri [15345 refs] [15345 refs] test_random test_re test_repr test_resource test_rfc822 test_richcmp test_robotparser test_runpy test_sax test_scope test_scriptpackages test_scriptpackages skipped -- No module named aetools test_select test_set test_sets test_sgmllib test_sha test_shelve test_shlex test_shutil test_signal test_site [12826 refs] [12826 refs] [12829 refs] [12826 refs] test_slice test_smtplib test_socket test_socketserver test_softspace test_sort test_sqlite test_ssl test_startfile test_startfile skipped -- cannot import name startfile test_str test_strftime test_string test_stringprep test_strop test_strptime test_struct test_structmembers test_structseq test_subprocess [12826 refs] [12826 refs] [12826 refs] [12826 refs] [12826 refs] [12826 refs] [12826 refs] [12826 refs] [12826 refs] [12826 refs] [12826 refs] [12826 refs] [14726 refs] [13041 refs] [12826 refs] [12826 refs] [12826 refs] [12826 refs] [12826 refs] [12826 refs] . [12826 refs] [12826 refs] this bit of output is from a test of stdout in a different process ... [12826 refs] [12826 refs] [13041 refs] test_sunaudiodev test_sunaudiodev skipped -- No module named sunaudiodev test_sundry /tmp/python-test/local/lib/python2.6/test/test_sundry.py:67: DeprecationWarning: The posixfile module is deprecated; fcntl.lockf() provides better locking import posixfile test_symtable test_syntax test_sys [12826 refs] [12826 refs] [13055 refs] [12849 refs] test_tarfile test_tcl test_tcl skipped -- No module named _tkinter test_telnetlib test_tempfile [12829 refs] test_textwrap test_thread test_threaded_import test_threadedtempfile test_threading [16318 refs] [15967 refs] [15783 refs] [15783 refs] [15783 refs] [15783 refs] test_threading_local test_threadsignals test_time test_timeout test_tokenize test_trace test_traceback test_transformer test_tuple test_typechecks test_ucn test_unary test_undocumented_details test_unicode test_unicode_file test_unicode_file skipped -- No Unicode filesystem semantics on this platform. test_unicodedata test_univnewlines test_unpack test_urllib test_urllib2 test_urllib2_localnet test_urllib2net test_urllibnet test_urlparse test_userdict test_userlist test_userstring test_uu test_uuid WARNING: uuid.getnode is unreliable on many platforms. It is disabled until the code and/or test can be fixed properly. WARNING: uuid._ifconfig_getnode is unreliable on many platforms. It is disabled until the code and/or test can be fixed properly. WARNING: uuid._unixdll_getnode is unreliable on many platforms. It is disabled until the code and/or test can be fixed properly. test_wait3 test_wait4 test_warnings test_wave test_weakref test_whichdb test_winreg test_winreg skipped -- No module named _winreg test_winsound test_winsound skipped -- No module named winsound test_with test_wsgiref test_xdrlib test_xml_etree test_xml_etree_c test_xmllib test_xmlrpc test_xpickle test_xrange test_zipfile test_zipfile64 test_zipfile64 skipped -- test requires loads of disk-space bytes and a long time to run test_zipimport test_zlib 331 tests OK. 1 test failed: test_distutils 25 tests skipped: test_aepack test_al test_applesingle test_bsddb185 test_cd test_cl test_epoll test_gl test_imgfile test_ioctl test_kqueue test_lib2to3 test_macos test_macostools test_multiprocessing test_pep277 test_py3kwarn test_scriptpackages test_startfile test_sunaudiodev test_tcl test_unicode_file test_winreg test_winsound test_zipfile64 4 skips unexpected on linux2: test_epoll test_multiprocessing test_lib2to3 test_ioctl [662730 refs] From python-checkins at python.org Fri Oct 3 06:10:46 2008 From: python-checkins at python.org (neal.norwitz) Date: Fri, 3 Oct 2008 06:10:46 +0200 (CEST) Subject: [Python-checkins] r66762 - python/branches/release26-maint/Misc/build.sh Message-ID: <20081003041046.9B17C1E4002@bag.python.org> Author: neal.norwitz Date: Fri Oct 3 06:10:46 2008 New Revision: 66762 Log: Disable the build for 2.6, only build docs Modified: python/branches/release26-maint/Misc/build.sh Modified: python/branches/release26-maint/Misc/build.sh ============================================================================== --- python/branches/release26-maint/Misc/build.sh (original) +++ python/branches/release26-maint/Misc/build.sh Fri Oct 3 06:10:46 2008 @@ -50,9 +50,9 @@ #FAILURE_CC="optional--uncomment and set to desired address" REMOTE_SYSTEM="neal at dinsdale.python.org" -REMOTE_DIR="/data/ftp.python.org/pub/docs.python.org/dev/" +REMOTE_DIR="/data/ftp.python.org/pub/docs.python.org/dev/2.6" RESULT_FILE="$DIR/build/index.html" -INSTALL_DIR="/tmp/python-test/local" +INSTALL_DIR="/tmp/python-test-2.6/local" RSYNC_OPTS="-aC -e ssh" # Always run the installed version of Python. @@ -77,7 +77,7 @@ LEAKY_SKIPS="-x test_compiler test_logging" # Change this flag to "yes" for old releases to only update/build the docs. -BUILD_DISABLED="no" +BUILD_DISABLED="yes" ## utility functions current_time() { From python-checkins at python.org Fri Oct 3 06:13:08 2008 From: python-checkins at python.org (neal.norwitz) Date: Fri, 3 Oct 2008 06:13:08 +0200 (CEST) Subject: [Python-checkins] r66763 - python/trunk/Misc/build.sh Message-ID: <20081003041308.949331E4002@bag.python.org> Author: neal.norwitz Date: Fri Oct 3 06:13:08 2008 New Revision: 66763 Log: Update the version to 2.7. Hopefully this fixes the test_distutils failure Modified: python/trunk/Misc/build.sh Modified: python/trunk/Misc/build.sh ============================================================================== --- python/trunk/Misc/build.sh (original) +++ python/trunk/Misc/build.sh Fri Oct 3 06:13:08 2008 @@ -59,7 +59,7 @@ PYTHON=$INSTALL_DIR/bin/python # Python options and regression test program that should always be run. -REGRTEST_ARGS="-E -tt $INSTALL_DIR/lib/python2.6/test/regrtest.py" +REGRTEST_ARGS="-E -tt $INSTALL_DIR/lib/python2.7/test/regrtest.py" REFLOG="build/reflog.txt.out" # These tests are not stable and falsely report leaks sometimes. From nnorwitz at gmail.com Fri Oct 3 06:20:07 2008 From: nnorwitz at gmail.com (Neal Norwitz) Date: Fri, 3 Oct 2008 00:20:07 -0400 Subject: [Python-checkins] Python Regression Test Failures doc (1) Message-ID: <20081003042007.GA19355@python.psfb.org> svn update tools/sphinx At revision 66763. svn update tools/docutils At revision 66763. svn update tools/jinja At revision 66763. svn update tools/pygments At revision 66763. mkdir -p build/html build/doctrees python tools/sphinx-build.py -b html -d build/doctrees -D latex_paper_size= . build/html Error: Sphinx needs to be executed with Python 2.4 or newer (If you run this from the Makefile, you can set the PYTHON variable to the path of an alternative interpreter executable, e.g., ``make html PYTHON=python2.5``). make: *** [build] Error 1 From nnorwitz at gmail.com Fri Oct 3 07:20:07 2008 From: nnorwitz at gmail.com (Neal Norwitz) Date: Fri, 3 Oct 2008 01:20:07 -0400 Subject: [Python-checkins] Python Regression Test Failures doc (1) Message-ID: <20081003052007.GA19613@python.psfb.org> svn update tools/sphinx At revision 66763. svn update tools/docutils At revision 66763. svn update tools/jinja At revision 66763. svn update tools/pygments At revision 66763. mkdir -p build/html build/doctrees python tools/sphinx-build.py -b html -d build/doctrees -D latex_paper_size= . build/html Error: Sphinx needs to be executed with Python 2.4 or newer (If you run this from the Makefile, you can set the PYTHON variable to the path of an alternative interpreter executable, e.g., ``make html PYTHON=python2.5``). make: *** [build] Error 1 From nnorwitz at gmail.com Fri Oct 3 08:20:07 2008 From: nnorwitz at gmail.com (Neal Norwitz) Date: Fri, 3 Oct 2008 02:20:07 -0400 Subject: [Python-checkins] Python Regression Test Failures doc (1) Message-ID: <20081003062007.GA19807@python.psfb.org> svn update tools/sphinx At revision 66763. svn update tools/docutils At revision 66763. svn update tools/jinja At revision 66763. svn update tools/pygments At revision 66763. mkdir -p build/html build/doctrees python tools/sphinx-build.py -b html -d build/doctrees -D latex_paper_size= . build/html Error: Sphinx needs to be executed with Python 2.4 or newer (If you run this from the Makefile, you can set the PYTHON variable to the path of an alternative interpreter executable, e.g., ``make html PYTHON=python2.5``). make: *** [build] Error 1 From nnorwitz at gmail.com Fri Oct 3 09:20:09 2008 From: nnorwitz at gmail.com (Neal Norwitz) Date: Fri, 3 Oct 2008 03:20:09 -0400 Subject: [Python-checkins] Python Regression Test Failures doc (1) Message-ID: <20081003072009.GA20018@python.psfb.org> svn update tools/sphinx At revision 66763. svn update tools/docutils At revision 66763. svn update tools/jinja At revision 66763. svn update tools/pygments At revision 66763. mkdir -p build/html build/doctrees python tools/sphinx-build.py -b html -d build/doctrees -D latex_paper_size= . build/html Error: Sphinx needs to be executed with Python 2.4 or newer (If you run this from the Makefile, you can set the PYTHON variable to the path of an alternative interpreter executable, e.g., ``make html PYTHON=python2.5``). make: *** [build] Error 1 From nnorwitz at gmail.com Fri Oct 3 10:08:19 2008 From: nnorwitz at gmail.com (Neal Norwitz) Date: Fri, 3 Oct 2008 04:08:19 -0400 Subject: [Python-checkins] Python Regression Test Failures basics (1) Message-ID: <20081003080819.GA31338@python.psfb.org> 326 tests OK. 1 test failed: test_distutils 33 tests skipped: test_aepack test_al test_applesingle test_bsddb185 test_bsddb3 test_cd test_cl test_curses test_epoll test_gl test_imgfile test_ioctl test_kqueue test_lib2to3 test_linuxaudiodev test_macos test_macostools test_multiprocessing test_ossaudiodev test_pep277 test_py3kwarn test_scriptpackages test_socketserver test_startfile test_sunaudiodev test_tcl test_timeout test_unicode_file test_urllib2net test_urllibnet test_winreg test_winsound test_zipfile64 4 skips unexpected on linux2: test_epoll test_multiprocessing test_lib2to3 test_ioctl test_grammar test_opcodes test_dict test_builtin test_exceptions test_types test_unittest test_doctest test_doctest2 test_MimeWriter test_SimpleHTTPServer test_StringIO test___all__ test___future__ test__locale test_abc test_abstract_numbers test_aepack test_aepack skipped -- No module named aepack test_al test_al skipped -- No module named al test_anydbm test_applesingle test_applesingle skipped -- No module named macostools test_array test_ast test_asynchat test_asyncore test_atexit test_audioop test_augassign test_base64 test_bastion test_bigaddrspace test_bigmem test_binascii test_binhex test_binop test_bisect test_bool test_bsddb test_bsddb185 test_bsddb185 skipped -- No module named bsddb185 test_bsddb3 test_bsddb3 skipped -- Use of the `bsddb' resource not enabled test_buffer test_bufio test_bytes test_bz2 test_calendar test_call test_capi test_cd test_cd skipped -- No module named cd test_cfgparser test_cgi test_charmapcodec test_cl test_cl skipped -- No module named cl test_class test_cmath test_cmd test_cmd_line test_cmd_line_script test_code test_codeccallbacks test_codecencodings_cn test_codecencodings_hk test_codecencodings_jp test_codecencodings_kr test_codecencodings_tw test_codecmaps_cn test_codecmaps_hk test_codecmaps_jp test_codecmaps_kr test_codecmaps_tw test_codecs test_codeop test_coding test_coercion test_collections test_colorsys test_commands test_compare test_compile test_compiler test_complex test_complex_args test_contains test_contextlib test_cookie test_cookielib test_copy test_copy_reg test_cpickle test_cprofile test_crypt test_csv test_ctypes test_curses test_curses skipped -- Use of the `curses' resource not enabled test_datetime test_dbm test_decimal test_decorators test_defaultdict test_deque test_descr test_descrtut test_difflib test_dircache test_dis test_distutils test test_distutils failed -- errors occurred; run in verbose mode for details test_dl test_docxmlrpc test_dumbdbm test_dummy_thread test_dummy_threading test_email test_email_codecs test_email_renamed test_enumerate test_eof test_epoll test_epoll skipped -- kernel doesn't support epoll() test_errno test_exception_variations test_extcall test_fcntl test_file test_filecmp test_fileinput test_fileio test_float test_fnmatch test_fork1 test_format test_fpformat test_fractions test_frozen test_ftplib test_funcattrs test_functools test_future test_future3 test_future4 test_future_builtins test_gc test_gdbm test_generators test_genericpath test_genexps test_getargs test_getargs2 test_getopt test_gettext test_gl test_gl skipped -- No module named gl test_glob test_global test_grp test_gzip test_hash test_hashlib test_heapq test_hmac test_hotshot test_htmllib test_htmlparser test_httplib test_httpservers [12826 refs] [12826 refs] [21355 refs] test_imageop test_imaplib test_imgfile test_imgfile skipped -- No module named imgfile test_imp test_import test_importhooks test_index test_inspect test_int test_int_literal test_io test_ioctl test_ioctl skipped -- Unable to open /dev/tty test_isinstance test_iter test_iterlen test_itertools test_json test_kqueue test_kqueue skipped -- test works only on BSD test_largefile test_lib2to3 test_lib2to3 skipped -- No module named myfixes test_linuxaudiodev test_linuxaudiodev skipped -- Use of the `audio' resource not enabled test_list test_locale test_logging test_long test_long_future test_longexp test_macos test_macos skipped -- No module named MacOS test_macostools test_macostools skipped -- No module named macostools test_macpath test_mailbox test_marshal test_math test_md5 test_memoryio test_mhlib test_mimetools test_mimetypes test_minidom test_mmap test_module test_modulefinder test_multibytecodec test_multibytecodec_support test_multifile test_multiprocessing test_multiprocessing skipped -- OSError raises on RLock creation, see issue 3111! test_mutants test_mutex test_netrc test_new test_nis test_normalization test_ntpath test_old_mailbox test_openpty test_operator test_optparse test_os /tmp/python-test/local/lib/python2.6/os.py:759: DeprecationWarning: integer argument expected, got float bs += read(_urandomfd, n - len(bs)) test_ossaudiodev test_ossaudiodev skipped -- Use of the `audio' resource not enabled test_parser Expecting 's_push: parser stack overflow' in next line s_push: parser stack overflow test_peepholer test_pep247 test_pep263 test_pep277 test_pep277 skipped -- test works only on NT+ test_pep292 test_pep352 test_pickle test_pickletools test_pipes test_pkg test_pkgimport test_pkgutil test_platform test_plistlib test_poll test_popen [12831 refs] [12831 refs] [12831 refs] test_popen2 test_poplib test_posix test_posixpath test_pow test_pprint test_print test_profile test_profilehooks test_property test_pstats test_pty test_pwd test_py3kwarn test_py3kwarn skipped -- test.test_py3kwarn must be run with the -3 flag test_pyclbr test_pydoc [17360 refs] test_pyexpat test_queue test_quopri [15345 refs] [15345 refs] test_random test_re test_repr test_resource test_rfc822 test_richcmp test_robotparser test_runpy test_sax test_scope test_scriptpackages test_scriptpackages skipped -- No module named aetools test_select test_set test_sets test_sgmllib test_sha test_shelve test_shlex test_shutil test_signal test_site [12826 refs] [12826 refs] [12829 refs] [12826 refs] test_slice test_smtplib test_socket test_socketserver test_socketserver skipped -- Use of the `network' resource not enabled test_softspace test_sort test_sqlite test_ssl test_startfile test_startfile skipped -- cannot import name startfile test_str test_strftime test_string test_stringprep test_strop test_strptime test_struct test_structmembers test_structseq test_subprocess [12826 refs] [12826 refs] [12826 refs] [12826 refs] [12826 refs] [12826 refs] [12826 refs] [12826 refs] [12826 refs] [12826 refs] [12826 refs] [12826 refs] [14726 refs] [13041 refs] [12826 refs] [12826 refs] [12826 refs] [12826 refs] [12826 refs] [12826 refs] . [12826 refs] [12826 refs] this bit of output is from a test of stdout in a different process ... [12826 refs] [12826 refs] [13041 refs] test_sunaudiodev test_sunaudiodev skipped -- No module named sunaudiodev test_sundry /tmp/python-test/local/lib/python2.6/test/test_sundry.py:67: DeprecationWarning: The posixfile module is deprecated; fcntl.lockf() provides better locking import posixfile test_symtable test_syntax test_sys [12826 refs] [12826 refs] [13055 refs] [12849 refs] test_tarfile test_tcl test_tcl skipped -- No module named _tkinter test_telnetlib test_tempfile [12829 refs] test_textwrap test_thread test_threaded_import test_threadedtempfile test_threading [16318 refs] [15967 refs] [15783 refs] [15783 refs] [15783 refs] [15783 refs] test_threading_local test_threadsignals test_time test_timeout test_timeout skipped -- Use of the `network' resource not enabled test_tokenize test_trace test_traceback test_transformer test_tuple test_typechecks test_ucn test_unary test_undocumented_details test_unicode test_unicode_file test_unicode_file skipped -- No Unicode filesystem semantics on this platform. test_unicodedata test_univnewlines test_unpack test_urllib test_urllib2 test_urllib2_localnet test_urllib2net test_urllib2net skipped -- Use of the `network' resource not enabled test_urllibnet test_urllibnet skipped -- Use of the `network' resource not enabled test_urlparse test_userdict test_userlist test_userstring test_uu test_uuid WARNING: uuid.getnode is unreliable on many platforms. It is disabled until the code and/or test can be fixed properly. WARNING: uuid._ifconfig_getnode is unreliable on many platforms. It is disabled until the code and/or test can be fixed properly. WARNING: uuid._unixdll_getnode is unreliable on many platforms. It is disabled until the code and/or test can be fixed properly. test_wait3 test_wait4 test_warnings test_wave test_weakref test_whichdb test_winreg test_winreg skipped -- No module named _winreg test_winsound test_winsound skipped -- No module named winsound test_with test_wsgiref test_xdrlib test_xml_etree test_xml_etree_c test_xmllib test_xmlrpc test_xpickle test_xrange test_zipfile test_zipfile64 test_zipfile64 skipped -- test requires loads of disk-space bytes and a long time to run test_zipimport test_zlib 326 tests OK. 1 test failed: test_distutils 33 tests skipped: test_aepack test_al test_applesingle test_bsddb185 test_bsddb3 test_cd test_cl test_curses test_epoll test_gl test_imgfile test_ioctl test_kqueue test_lib2to3 test_linuxaudiodev test_macos test_macostools test_multiprocessing test_ossaudiodev test_pep277 test_py3kwarn test_scriptpackages test_socketserver test_startfile test_sunaudiodev test_tcl test_timeout test_unicode_file test_urllib2net test_urllibnet test_winreg test_winsound test_zipfile64 4 skips unexpected on linux2: test_epoll test_multiprocessing test_lib2to3 test_ioctl [647823 refs] From nnorwitz at gmail.com Fri Oct 3 10:14:24 2008 From: nnorwitz at gmail.com (Neal Norwitz) Date: Fri, 3 Oct 2008 04:14:24 -0400 Subject: [Python-checkins] Python Regression Test Failures opt (1) Message-ID: <20081003081424.GA32643@python.psfb.org> 326 tests OK. 1 test failed: test_distutils 33 tests skipped: test_aepack test_al test_applesingle test_bsddb185 test_bsddb3 test_cd test_cl test_curses test_epoll test_gl test_imgfile test_ioctl test_kqueue test_lib2to3 test_linuxaudiodev test_macos test_macostools test_multiprocessing test_ossaudiodev test_pep277 test_py3kwarn test_scriptpackages test_socketserver test_startfile test_sunaudiodev test_tcl test_timeout test_unicode_file test_urllib2net test_urllibnet test_winreg test_winsound test_zipfile64 4 skips unexpected on linux2: test_epoll test_multiprocessing test_lib2to3 test_ioctl test_grammar test_opcodes test_dict test_builtin test_exceptions test_types test_unittest test_doctest test_doctest2 test_MimeWriter test_SimpleHTTPServer test_StringIO test___all__ test___future__ test__locale test_abc test_abstract_numbers test_aepack test_aepack skipped -- No module named aepack test_al test_al skipped -- No module named al test_anydbm test_applesingle test_applesingle skipped -- No module named macostools test_array test_ast test_asynchat test_asyncore test_atexit test_audioop test_augassign test_base64 test_bastion test_bigaddrspace test_bigmem test_binascii test_binhex test_binop test_bisect test_bool test_bsddb test_bsddb185 test_bsddb185 skipped -- No module named bsddb185 test_bsddb3 test_bsddb3 skipped -- Use of the `bsddb' resource not enabled test_buffer test_bufio test_bytes test_bz2 test_calendar test_call test_capi test_cd test_cd skipped -- No module named cd test_cfgparser test_cgi test_charmapcodec test_cl test_cl skipped -- No module named cl test_class test_cmath test_cmd test_cmd_line test_cmd_line_script test_code test_codeccallbacks test_codecencodings_cn test_codecencodings_hk test_codecencodings_jp test_codecencodings_kr test_codecencodings_tw test_codecmaps_cn test_codecmaps_hk test_codecmaps_jp test_codecmaps_kr test_codecmaps_tw test_codecs test_codeop test_coding test_coercion test_collections test_colorsys test_commands test_compare test_compile test_compiler test_complex test_complex_args test_contains test_contextlib test_cookie test_cookielib test_copy test_copy_reg test_cpickle test_cprofile test_crypt test_csv test_ctypes test_curses test_curses skipped -- Use of the `curses' resource not enabled test_datetime test_dbm test_decimal test_decorators test_defaultdict test_deque test_descr test_descrtut test_difflib test_dircache test_dis test_distutils [17000 refs] test test_distutils failed -- errors occurred; run in verbose mode for details test_dl test_docxmlrpc test_dumbdbm test_dummy_thread test_dummy_threading test_email test_email_codecs test_email_renamed test_enumerate test_eof test_epoll test_epoll skipped -- kernel doesn't support epoll() test_errno test_exception_variations test_extcall test_fcntl test_file test_filecmp test_fileinput test_fileio test_float test_fnmatch test_fork1 test_format test_fpformat test_fractions test_frozen test_ftplib test_funcattrs test_functools test_future test_future3 test_future4 test_future_builtins test_gc test_gdbm test_generators test_genericpath test_genexps test_getargs test_getargs2 test_getopt test_gettext test_gl test_gl skipped -- No module named gl test_glob test_global test_grp test_gzip test_hash test_hashlib test_heapq test_hmac test_hotshot test_htmllib test_htmlparser test_httplib test_httpservers [12826 refs] [12826 refs] [21355 refs] test_imageop test_imaplib test_imgfile test_imgfile skipped -- No module named imgfile test_imp test_import test_importhooks test_index test_inspect test_int test_int_literal test_io test_ioctl test_ioctl skipped -- Unable to open /dev/tty test_isinstance test_iter test_iterlen test_itertools test_json test_kqueue test_kqueue skipped -- test works only on BSD test_largefile test_lib2to3 test_lib2to3 skipped -- No module named myfixes test_linuxaudiodev test_linuxaudiodev skipped -- Use of the `audio' resource not enabled test_list test_locale test_logging test_long test_long_future test_longexp test_macos test_macos skipped -- No module named MacOS test_macostools test_macostools skipped -- No module named macostools test_macpath test_mailbox test_marshal test_math test_md5 test_memoryio test_mhlib test_mimetools test_mimetypes test_minidom test_mmap test_module test_modulefinder test_multibytecodec test_multibytecodec_support test_multifile test_multiprocessing test_multiprocessing skipped -- OSError raises on RLock creation, see issue 3111! test_mutants test_mutex test_netrc test_new test_nis test_normalization test_ntpath test_old_mailbox test_openpty test_operator test_optparse test_os /tmp/python-test/local/lib/python2.6/os.py:759: DeprecationWarning: integer argument expected, got float bs += read(_urandomfd, n - len(bs)) test_ossaudiodev test_ossaudiodev skipped -- Use of the `audio' resource not enabled test_parser Expecting 's_push: parser stack overflow' in next line s_push: parser stack overflow test_peepholer test_pep247 test_pep263 test_pep277 test_pep277 skipped -- test works only on NT+ test_pep292 test_pep352 test_pickle test_pickletools test_pipes test_pkg test_pkgimport test_pkgutil test_platform test_plistlib test_poll test_popen [12831 refs] [12831 refs] [12831 refs] test_popen2 test_poplib test_posix test_posixpath test_pow test_pprint test_print test_profile test_profilehooks test_property test_pstats test_pty test_pwd test_py3kwarn test_py3kwarn skipped -- test.test_py3kwarn must be run with the -3 flag test_pyclbr test_pydoc [17360 refs] test_pyexpat test_queue test_quopri [15345 refs] [15345 refs] test_random test_re test_repr test_resource test_rfc822 test_richcmp test_robotparser test_runpy test_sax test_scope test_scriptpackages test_scriptpackages skipped -- No module named aetools test_select test_set test_sets test_sgmllib test_sha test_shelve test_shlex test_shutil test_signal test_site [12826 refs] [12826 refs] [12829 refs] [12826 refs] test_slice test_smtplib test_socket test_socketserver test_socketserver skipped -- Use of the `network' resource not enabled test_softspace test_sort test_sqlite test_ssl test_startfile test_startfile skipped -- cannot import name startfile test_str test_strftime test_string test_stringprep test_strop test_strptime test_struct test_structmembers test_structseq test_subprocess [12826 refs] [12826 refs] [12826 refs] [12826 refs] [12826 refs] [12826 refs] [12826 refs] [12826 refs] [12826 refs] [12826 refs] [12826 refs] [12826 refs] [14726 refs] [13041 refs] [12826 refs] [12826 refs] [12826 refs] [12826 refs] [12826 refs] [12826 refs] . [12826 refs] [12826 refs] this bit of output is from a test of stdout in a different process ... [12826 refs] [12826 refs] [13041 refs] test_sunaudiodev test_sunaudiodev skipped -- No module named sunaudiodev test_sundry /tmp/python-test/local/lib/python2.6/test/test_sundry.py:67: DeprecationWarning: The posixfile module is deprecated; fcntl.lockf() provides better locking import posixfile test_symtable test_syntax test_sys [12826 refs] [12826 refs] [13055 refs] [12849 refs] test_tarfile test_tcl test_tcl skipped -- No module named _tkinter test_telnetlib test_tempfile [12829 refs] test_textwrap test_thread test_threaded_import test_threadedtempfile test_threading [16318 refs] [15967 refs] [15783 refs] [15783 refs] [15783 refs] [15783 refs] test_threading_local test_threadsignals test_time test_timeout test_timeout skipped -- Use of the `network' resource not enabled test_tokenize test_trace test_traceback test_transformer test_tuple test_typechecks test_ucn test_unary test_undocumented_details test_unicode test_unicode_file test_unicode_file skipped -- No Unicode filesystem semantics on this platform. test_unicodedata test_univnewlines test_unpack test_urllib test_urllib2 test_urllib2_localnet test_urllib2net test_urllib2net skipped -- Use of the `network' resource not enabled test_urllibnet test_urllibnet skipped -- Use of the `network' resource not enabled test_urlparse test_userdict test_userlist test_userstring test_uu test_uuid WARNING: uuid.getnode is unreliable on many platforms. It is disabled until the code and/or test can be fixed properly. WARNING: uuid._ifconfig_getnode is unreliable on many platforms. It is disabled until the code and/or test can be fixed properly. WARNING: uuid._unixdll_getnode is unreliable on many platforms. It is disabled until the code and/or test can be fixed properly. test_wait3 test_wait4 test_warnings test_wave test_weakref test_whichdb test_winreg test_winreg skipped -- No module named _winreg test_winsound test_winsound skipped -- No module named winsound test_with test_wsgiref test_xdrlib test_xml_etree test_xml_etree_c test_xmllib test_xmlrpc test_xpickle test_xrange test_zipfile test_zipfile64 test_zipfile64 skipped -- test requires loads of disk-space bytes and a long time to run test_zipimport test_zlib 326 tests OK. 1 test failed: test_distutils 33 tests skipped: test_aepack test_al test_applesingle test_bsddb185 test_bsddb3 test_cd test_cl test_curses test_epoll test_gl test_imgfile test_ioctl test_kqueue test_lib2to3 test_linuxaudiodev test_macos test_macostools test_multiprocessing test_ossaudiodev test_pep277 test_py3kwarn test_scriptpackages test_socketserver test_startfile test_sunaudiodev test_tcl test_timeout test_unicode_file test_urllib2net test_urllibnet test_winreg test_winsound test_zipfile64 4 skips unexpected on linux2: test_epoll test_multiprocessing test_lib2to3 test_ioctl [647097 refs] From nnorwitz at gmail.com Fri Oct 3 10:20:07 2008 From: nnorwitz at gmail.com (Neal Norwitz) Date: Fri, 3 Oct 2008 04:20:07 -0400 Subject: [Python-checkins] Python Regression Test Failures doc (1) Message-ID: <20081003082007.GA883@python.psfb.org> svn update tools/sphinx At revision 66763. svn update tools/docutils At revision 66763. svn update tools/jinja At revision 66763. svn update tools/pygments At revision 66763. mkdir -p build/html build/doctrees python tools/sphinx-build.py -b html -d build/doctrees -D latex_paper_size= . build/html Error: Sphinx needs to be executed with Python 2.4 or newer (If you run this from the Makefile, you can set the PYTHON variable to the path of an alternative interpreter executable, e.g., ``make html PYTHON=python2.5``). make: *** [build] Error 1 From python-checkins at python.org Fri Oct 3 10:59:42 2008 From: python-checkins at python.org (martin.v.loewis) Date: Fri, 3 Oct 2008 10:59:42 +0200 (CEST) Subject: [Python-checkins] r66764 - in python/trunk: configure configure.in pyconfig.h.in Message-ID: <20081003085942.389C31E4002@bag.python.org> Author: martin.v.loewis Date: Fri Oct 3 10:59:41 2008 New Revision: 66764 Log: Bump version to 2.7. Regenerate. Modified: python/trunk/configure python/trunk/configure.in python/trunk/pyconfig.h.in Modified: python/trunk/configure ============================================================================== --- python/trunk/configure (original) +++ python/trunk/configure Fri Oct 3 10:59:41 2008 @@ -1,7 +1,7 @@ #! /bin/sh # From configure.in Revision: 66295 . # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.61 for python 2.6. +# Generated by GNU Autoconf 2.61 for python 2.7. # # Report bugs to . # @@ -575,8 +575,8 @@ # Identity of this package. PACKAGE_NAME='python' PACKAGE_TARNAME='python' -PACKAGE_VERSION='2.6' -PACKAGE_STRING='python 2.6' +PACKAGE_VERSION='2.7' +PACKAGE_STRING='python 2.7' PACKAGE_BUGREPORT='http://www.python.org/python-bugs' ac_unique_file="Include/object.h" @@ -1247,7 +1247,7 @@ # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures python 2.6 to adapt to many kinds of systems. +\`configure' configures python 2.7 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1308,7 +1308,7 @@ if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of python 2.6:";; + short | recursive ) echo "Configuration of python 2.7:";; esac cat <<\_ACEOF @@ -1433,7 +1433,7 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -python configure 2.6 +python configure 2.7 generated by GNU Autoconf 2.61 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, @@ -1447,7 +1447,7 @@ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by python $as_me 2.6, which was +It was created by python $as_me 2.7, which was generated by GNU Autoconf 2.61. Invocation command line was $ $0 $@ @@ -1816,7 +1816,7 @@ mv confdefs.h.new confdefs.h -VERSION=2.6 +VERSION=2.7 SOVERSION=1.0 @@ -24998,7 +24998,7 @@ # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by python $as_me 2.6, which was +This file was extended by python $as_me 2.7, which was generated by GNU Autoconf 2.61. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -25047,7 +25047,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ -python config.status 2.6 +python config.status 2.7 configured by $0, generated by GNU Autoconf 2.61, with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" Modified: python/trunk/configure.in ============================================================================== --- python/trunk/configure.in (original) +++ python/trunk/configure.in Fri Oct 3 10:59:41 2008 @@ -4,7 +4,7 @@ dnl NOTE: autoconf 2.64 doesn't seem to work (use 2.63). # Set VERSION so we only need to edit in one place (i.e., here) -m4_define(PYTHON_VERSION, 2.6) +m4_define(PYTHON_VERSION, 2.7) AC_REVISION($Revision$) AC_PREREQ(2.61) Modified: python/trunk/pyconfig.h.in ============================================================================== --- python/trunk/pyconfig.h.in (original) +++ python/trunk/pyconfig.h.in Fri Oct 3 10:59:41 2008 @@ -360,7 +360,7 @@ /* Define to 1 if you have the header file. */ #undef HAVE_LIBINTL_H -/* Define to 1 if you have the `readline' library (-lreadline). */ +/* Define if you have the readline library (-lreadline). */ #undef HAVE_LIBREADLINE /* Define to 1 if you have the `resolv' library (-lresolv). */ From nnorwitz at gmail.com Fri Oct 3 11:17:13 2008 From: nnorwitz at gmail.com (Neal Norwitz) Date: Fri, 3 Oct 2008 05:17:13 -0400 Subject: [Python-checkins] Python Regression Test Failures refleak (1) Message-ID: <20081003091713.GA21211@python.psfb.org> More important issues: ---------------------- test_pydoc leaked [-21, 0, 0] references, sum=-21 Less important issues: ---------------------- test_cmd_line leaked [-50, 25, 25] references, sum=0 test_smtplib leaked [0, -88, 0] references, sum=-88 test_sys leaked [0, 21, -21] references, sum=0 test_urllib2_localnet leaked [271, 3, -265] references, sum=9 test_xmlrpc leaked [-1, 83, 3] references, sum=85 From nnorwitz at gmail.com Fri Oct 3 11:20:17 2008 From: nnorwitz at gmail.com (Neal Norwitz) Date: Fri, 3 Oct 2008 05:20:17 -0400 Subject: [Python-checkins] Python Regression Test Failures doc (1) Message-ID: <20081003092017.GA21461@python.psfb.org> svn update tools/sphinx At revision 66764. svn update tools/docutils At revision 66764. svn update tools/jinja At revision 66764. svn update tools/pygments At revision 66764. mkdir -p build/html build/doctrees python tools/sphinx-build.py -b html -d build/doctrees -D latex_paper_size= . build/html Error: Sphinx needs to be executed with Python 2.4 or newer (If you run this from the Makefile, you can set the PYTHON variable to the path of an alternative interpreter executable, e.g., ``make html PYTHON=python2.5``). make: *** [build] Error 1 From nnorwitz at gmail.com Fri Oct 3 11:42:55 2008 From: nnorwitz at gmail.com (Neal Norwitz) Date: Fri, 3 Oct 2008 05:42:55 -0400 Subject: [Python-checkins] Python Regression Test Failures all (2) Message-ID: <20081003094255.GA26778@python.psfb.org> 330 tests OK. 2 tests failed: test_distutils test_smtplib 25 tests skipped: test_aepack test_al test_applesingle test_bsddb185 test_cd test_cl test_epoll test_gl test_imgfile test_ioctl test_kqueue test_lib2to3 test_macos test_macostools test_multiprocessing test_pep277 test_py3kwarn test_scriptpackages test_startfile test_sunaudiodev test_tcl test_unicode_file test_winreg test_winsound test_zipfile64 4 skips unexpected on linux2: test_epoll test_multiprocessing test_lib2to3 test_ioctl test_grammar test_opcodes test_dict test_builtin test_exceptions test_types test_unittest test_doctest test_doctest2 test_MimeWriter test_SimpleHTTPServer test_StringIO test___all__ test___future__ test__locale test_abc test_abstract_numbers test_aepack test_aepack skipped -- No module named aepack test_al test_al skipped -- No module named al test_anydbm test_applesingle test_applesingle skipped -- No module named macostools test_array test_ast test_asynchat test_asyncore test_atexit test_audioop test_augassign test_base64 test_bastion test_bigaddrspace test_bigmem test_binascii test_binhex test_binop test_bisect test_bool test_bsddb test_bsddb185 test_bsddb185 skipped -- No module named bsddb185 test_bsddb3 Sleepycat Software: Berkeley DB 4.1.25: (December 19, 2002) Test path prefix: /tmp/z-test_bsddb3-21219 test_buffer test_bufio test_bytes test_bz2 test_calendar test_call test_capi test_cd test_cd skipped -- No module named cd test_cfgparser test_cgi test_charmapcodec test_cl test_cl skipped -- No module named cl test_class test_cmath test_cmd test_cmd_line test_cmd_line_script test_code test_codeccallbacks test_codecencodings_cn test_codecencodings_hk test_codecencodings_jp test_codecencodings_kr test_codecencodings_tw test_codecmaps_cn test_codecmaps_hk test_codecmaps_jp test_codecmaps_kr test_codecmaps_tw test_codecs test_codeop test_coding test_coercion test_collections test_colorsys test_commands test_compare test_compile test_compiler testCompileLibrary still working, be patient... testCompileLibrary still working, be patient... test_complex test_complex_args test_contains test_contextlib test_cookie test_cookielib test_copy test_copy_reg test_cpickle test_cprofile test_crypt test_csv test_ctypes test_datetime test_dbm test_decimal test_decorators test_defaultdict test_deque test_descr test_descrtut test_difflib test_dircache test_dis test_distutils test test_distutils failed -- errors occurred; run in verbose mode for details test_dl test_docxmlrpc test_dumbdbm test_dummy_thread test_dummy_threading test_email test_email_codecs test_email_renamed test_enumerate test_eof test_epoll test_epoll skipped -- kernel doesn't support epoll() test_errno test_exception_variations test_extcall test_fcntl test_file test_filecmp test_fileinput test_fileio test_float test_fnmatch test_fork1 test_format test_fpformat test_fractions test_frozen test_ftplib test_funcattrs test_functools test_future test_future3 test_future4 test_future_builtins test_gc test_gdbm test_generators test_genericpath test_genexps test_getargs test_getargs2 test_getopt test_gettext test_gl test_gl skipped -- No module named gl test_glob test_global test_grp test_gzip test_hash test_hashlib test_heapq test_hmac test_hotshot test_htmllib test_htmlparser test_httplib test_httpservers [12826 refs] [12826 refs] [21355 refs] test_imageop test_imaplib test_imgfile test_imgfile skipped -- No module named imgfile test_imp test_import test_importhooks test_index test_inspect test_int test_int_literal test_io test_ioctl test_ioctl skipped -- Unable to open /dev/tty test_isinstance test_iter test_iterlen test_itertools test_json test_kqueue test_kqueue skipped -- test works only on BSD test_largefile test_lib2to3 test_lib2to3 skipped -- No module named myfixes test_list test_locale test_logging test_long test_long_future test_longexp test_macos test_macos skipped -- No module named MacOS test_macostools test_macostools skipped -- No module named macostools test_macpath test_mailbox test_marshal test_math test_md5 test_memoryio test_mhlib test_mimetools test_mimetypes test_minidom test_mmap test_module test_modulefinder test_multibytecodec test_multibytecodec_support test_multifile test_multiprocessing test_multiprocessing skipped -- OSError raises on RLock creation, see issue 3111! test_mutants test_mutex test_netrc test_new test_nis test_normalization test_ntpath test_old_mailbox test_openpty test_operator test_optparse test_os /tmp/python-test/local/lib/python2.6/os.py:759: DeprecationWarning: integer argument expected, got float bs += read(_urandomfd, n - len(bs)) test_parser Expecting 's_push: parser stack overflow' in next line s_push: parser stack overflow test_peepholer test_pep247 test_pep263 test_pep277 test_pep277 skipped -- test works only on NT+ test_pep292 test_pep352 test_pickle test_pickletools test_pipes test_pkg test_pkgimport test_pkgutil test_platform test_plistlib test_poll test_popen [12831 refs] [12831 refs] [12831 refs] test_popen2 test_poplib test_posix test_posixpath test_pow test_pprint test_print test_profile test_profilehooks test_property test_pstats test_pty test_pwd test_py3kwarn test_py3kwarn skipped -- test.test_py3kwarn must be run with the -3 flag test_pyclbr test_pydoc [17360 refs] test_pyexpat test_queue test_quopri [15345 refs] [15345 refs] test_random test_re test_repr test_resource test_rfc822 test_richcmp test_robotparser test_runpy test_sax test_scope test_scriptpackages test_scriptpackages skipped -- No module named aetools test_select test_set test_sets test_sgmllib test_sha test_shelve test_shlex test_shutil test_signal test_site [12826 refs] [12826 refs] [12829 refs] [12826 refs] test_slice test_smtplib test test_smtplib produced unexpected output: ********************************************************************** error: uncaptured python exception, closing channel (:[Errno 9] Bad file descriptor [/tmp/python-test/local/lib/python2.6/asyncore.py|readwrite|101] [/tmp/python-test/local/lib/python2.6/asyncore.py|handle_write_event|427] [|getsockopt|1] [/tmp/python-test/local/lib/python2.6/socket.py|_dummy|165]) ********************************************************************** test_socket test_socketserver test_softspace test_sort test_sqlite test_ssl test_startfile test_startfile skipped -- cannot import name startfile test_str test_strftime test_string test_stringprep test_strop test_strptime test_struct test_structmembers test_structseq test_subprocess [12826 refs] [12826 refs] [12826 refs] [12826 refs] [12826 refs] [12826 refs] [12826 refs] [12826 refs] [12826 refs] [12826 refs] [12826 refs] [12826 refs] [14726 refs] [13041 refs] [12826 refs] [12826 refs] [12826 refs] [12826 refs] [12826 refs] [12826 refs] . [12826 refs] [12826 refs] this bit of output is from a test of stdout in a different process ... [12826 refs] [12826 refs] [13041 refs] test_sunaudiodev test_sunaudiodev skipped -- No module named sunaudiodev test_sundry /tmp/python-test/local/lib/python2.6/test/test_sundry.py:67: DeprecationWarning: The posixfile module is deprecated; fcntl.lockf() provides better locking import posixfile test_symtable test_syntax test_sys [12826 refs] [12826 refs] [13055 refs] [12849 refs] test_tarfile test_tcl test_tcl skipped -- No module named _tkinter test_telnetlib test_tempfile [12829 refs] test_textwrap test_thread test_threaded_import test_threadedtempfile test_threading [16318 refs] [16812 refs] [15783 refs] [15783 refs] [15783 refs] [15783 refs] test_threading_local test_threadsignals test_time test_timeout test_tokenize test_trace test_traceback test_transformer test_tuple test_typechecks test_ucn test_unary test_undocumented_details test_unicode test_unicode_file test_unicode_file skipped -- No Unicode filesystem semantics on this platform. test_unicodedata test_univnewlines test_unpack test_urllib test_urllib2 test_urllib2_localnet test_urllib2net test_urllibnet test_urlparse test_userdict test_userlist test_userstring test_uu test_uuid WARNING: uuid.getnode is unreliable on many platforms. It is disabled until the code and/or test can be fixed properly. WARNING: uuid._ifconfig_getnode is unreliable on many platforms. It is disabled until the code and/or test can be fixed properly. WARNING: uuid._unixdll_getnode is unreliable on many platforms. It is disabled until the code and/or test can be fixed properly. test_wait3 test_wait4 test_warnings test_wave test_weakref test_whichdb test_winreg test_winreg skipped -- No module named _winreg test_winsound test_winsound skipped -- No module named winsound test_with test_wsgiref test_xdrlib test_xml_etree test_xml_etree_c test_xmllib test_xmlrpc test_xpickle test_xrange test_zipfile test_zipfile64 test_zipfile64 skipped -- test requires loads of disk-space bytes and a long time to run test_zipimport test_zlib 330 tests OK. 2 tests failed: test_distutils test_smtplib 25 tests skipped: test_aepack test_al test_applesingle test_bsddb185 test_cd test_cl test_epoll test_gl test_imgfile test_ioctl test_kqueue test_lib2to3 test_macos test_macostools test_multiprocessing test_pep277 test_py3kwarn test_scriptpackages test_startfile test_sunaudiodev test_tcl test_unicode_file test_winreg test_winsound test_zipfile64 4 skips unexpected on linux2: test_epoll test_multiprocessing test_lib2to3 test_ioctl [662728 refs] From buildbot at python.org Fri Oct 3 12:00:59 2008 From: buildbot at python.org (buildbot at python.org) Date: Fri, 03 Oct 2008 10:00:59 +0000 Subject: [Python-checkins] buildbot failure in g4 osx.4 trunk Message-ID: <20081003100059.65DAC1E406C@bag.python.org> The Buildbot has detected a new failure of g4 osx.4 trunk. Full details are available at: http://www.python.org/dev/buildbot/all/g4%20osx.4%20trunk/builds/3992 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: psf-g4 Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: martin.v.loewis,neal.norwitz BUILD FAILED: failed test Excerpt from the test logfile: Traceback (most recent call last): File "/Users/buildslave/bb/trunk.psf-g4/build/Lib/threading.py", line 522, in __bootstrap_inner self.run() File "/Users/buildslave/bb/trunk.psf-g4/build/Lib/test/test_ftplib.py", line 203, in run asyncore.loop(timeout=0.1, count=1) File "/Users/buildslave/bb/trunk.psf-g4/build/Lib/asyncore.py", line 204, in loop poll_fun(timeout, map) File "/Users/buildslave/bb/trunk.psf-g4/build/Lib/asyncore.py", line 141, in poll read(obj) File "/Users/buildslave/bb/trunk.psf-g4/build/Lib/asyncore.py", line 78, in read obj.handle_error() File "/Users/buildslave/bb/trunk.psf-g4/build/Lib/asyncore.py", line 74, in read obj.handle_read_event() File "/Users/buildslave/bb/trunk.psf-g4/build/Lib/asyncore.py", line 413, in handle_read_event self.handle_read() File "/Users/buildslave/bb/trunk.psf-g4/build/Lib/test/test_ssl.py", line 408, in handle_read self.send(data.lower()) File "/Users/buildslave/bb/trunk.psf-g4/build/Lib/asyncore.py", line 519, in send self.initiate_send() File "/Users/buildslave/bb/trunk.psf-g4/build/Lib/asyncore.py", line 506, in initiate_send num_sent = dispatcher.send(self, self.out_buffer[:512]) File "/Users/buildslave/bb/trunk.psf-g4/build/Lib/asyncore.py", line 349, in send result = self.socket.send(data) File "/Users/buildslave/bb/trunk.psf-g4/build/Lib/socket.py", line 165, in _dummy raise error(EBADF, 'Bad file descriptor') error: [Errno 9] Bad file descriptor 1 test failed: test_ftplib make: *** [buildbottest] Error 1 sincerely, -The Buildbot From nnorwitz at gmail.com Fri Oct 3 12:20:07 2008 From: nnorwitz at gmail.com (Neal Norwitz) Date: Fri, 3 Oct 2008 06:20:07 -0400 Subject: [Python-checkins] Python Regression Test Failures doc (1) Message-ID: <20081003102007.GA26946@python.psfb.org> svn update tools/sphinx At revision 66764. svn update tools/docutils At revision 66764. svn update tools/jinja At revision 66764. svn update tools/pygments At revision 66764. mkdir -p build/html build/doctrees python tools/sphinx-build.py -b html -d build/doctrees -D latex_paper_size= . build/html Error: Sphinx needs to be executed with Python 2.4 or newer (If you run this from the Makefile, you can set the PYTHON variable to the path of an alternative interpreter executable, e.g., ``make html PYTHON=python2.5``). make: *** [build] Error 1 From python-checkins at python.org Fri Oct 3 12:59:56 2008 From: python-checkins at python.org (martin.v.loewis) Date: Fri, 3 Oct 2008 12:59:56 +0200 (CEST) Subject: [Python-checkins] r66765 - in python/trunk: PC/pyconfig.h PCbuild/pyproject.vsprops Message-ID: <20081003105956.1B3901E4002@bag.python.org> Author: martin.v.loewis Date: Fri Oct 3 12:59:55 2008 New Revision: 66765 Log: Update version number to 2.7. Modified: python/trunk/PC/pyconfig.h python/trunk/PCbuild/pyproject.vsprops Modified: python/trunk/PC/pyconfig.h ============================================================================== --- python/trunk/PC/pyconfig.h (original) +++ python/trunk/PC/pyconfig.h Fri Oct 3 12:59:55 2008 @@ -323,9 +323,9 @@ their Makefile (other compilers are generally taken care of by distutils.) */ # ifdef _DEBUG -# pragma comment(lib,"python26_d.lib") +# pragma comment(lib,"python27_d.lib") # else -# pragma comment(lib,"python26.lib") +# pragma comment(lib,"python27.lib") # endif /* _DEBUG */ # endif /* _MSC_VER */ # endif /* Py_BUILD_CORE */ Modified: python/trunk/PCbuild/pyproject.vsprops ============================================================================== --- python/trunk/PCbuild/pyproject.vsprops (original) +++ python/trunk/PCbuild/pyproject.vsprops Fri Oct 3 12:59:55 2008 @@ -38,7 +38,7 @@ /> svn update tools/sphinx At revision 66765. svn update tools/docutils At revision 66765. svn update tools/jinja At revision 66765. svn update tools/pygments At revision 66765. mkdir -p build/html build/doctrees python tools/sphinx-build.py -b html -d build/doctrees -D latex_paper_size= . build/html Error: Sphinx needs to be executed with Python 2.4 or newer (If you run this from the Makefile, you can set the PYTHON variable to the path of an alternative interpreter executable, e.g., ``make html PYTHON=python2.5``). make: *** [build] Error 1 From python-checkins at python.org Fri Oct 3 13:52:07 2008 From: python-checkins at python.org (benjamin.peterson) Date: Fri, 3 Oct 2008 13:52:07 +0200 (CEST) Subject: [Python-checkins] r66766 - python/trunk/Mac/BuildScript/build-installer.py Message-ID: <20081003115207.18A571E4002@bag.python.org> Author: benjamin.peterson Date: Fri Oct 3 13:52:06 2008 New Revision: 66766 Log: update the mac installer script Modified: python/trunk/Mac/BuildScript/build-installer.py Modified: python/trunk/Mac/BuildScript/build-installer.py ============================================================================== --- python/trunk/Mac/BuildScript/build-installer.py (original) +++ python/trunk/Mac/BuildScript/build-installer.py Fri Oct 3 13:52:06 2008 @@ -129,8 +129,8 @@ ), dict( - name="SQLite 3.3.5", - url="http://www.sqlite.org/sqlite-3.3.5.tar.gz", + name="SQLite 3.6.3", + url="http://www.sqlite.org/sqlite-3.6.3.tar.gz", checksum='93f742986e8bc2dfa34792e16df017a6feccf3a2', configure_pre=[ '--enable-threadsafe', @@ -170,8 +170,8 @@ ), ), dict( - name="Sleepycat DB 4.4", - url="http://downloads.sleepycat.com/db-4.4.20.tar.gz", + name="Sleepycat DB 4.7.25", + url="http://download.oracle.com/berkeley-db/db-4.7.25.tar.gz", #name="Sleepycat DB 4.3.29", #url="http://downloads.sleepycat.com/db-4.3.29.tar.gz", buildDir="build_unix", @@ -585,21 +585,23 @@ version = getVersion() docdir = os.path.join(rootDir, 'pydocs') + novername = 'python-docs-html.tar.bz2' name = 'html-%s.tar.bz2'%(getFullVersion(),) sourceArchive = os.path.join(DEPSRC, name) if os.path.exists(sourceArchive): print "Using local copy of %s"%(name,) else: - print "Downloading %s"%(name,) + print "Downloading %s"%(novername,) downloadURL('http://www.python.org/ftp/python/doc/%s/%s'%( - getFullVersion(), name), sourceArchive) + getFullVersion(), novername), sourceArchive) print "Archive for %s stored as %s"%(name, sourceArchive) extractArchive(os.path.dirname(docdir), sourceArchive) + os.rename( os.path.join( - os.path.dirname(docdir), 'Python-Docs-%s'%(getFullVersion(),)), + os.path.dirname(docdir), 'python-docs-html'), docdir) @@ -1028,11 +1030,11 @@ buildPython() buildPythonDocs() fn = os.path.join(WORKDIR, "_root", "Applications", - "MacPython %s"%(getVersion(),), "Update Shell Profile.command") + "Python %s"%(getVersion(),), "Update Shell Profile.command") patchFile("scripts/postflight.patch-profile", fn) os.chmod(fn, 0755) - folder = os.path.join(WORKDIR, "_root", "Applications", "MacPython %s"%( + folder = os.path.join(WORKDIR, "_root", "Applications", "Python %s"%( getVersion(),)) os.chmod(folder, 0755) setIcon(folder, "../Icons/Python Folder.icns") From nnorwitz at gmail.com Fri Oct 3 14:20:07 2008 From: nnorwitz at gmail.com (Neal Norwitz) Date: Fri, 3 Oct 2008 08:20:07 -0400 Subject: [Python-checkins] Python Regression Test Failures doc (1) Message-ID: <20081003122007.GA24423@python.psfb.org> svn update tools/sphinx At revision 66766. svn update tools/docutils At revision 66766. svn update tools/jinja At revision 66766. svn update tools/pygments At revision 66766. mkdir -p build/html build/doctrees python tools/sphinx-build.py -b html -d build/doctrees -D latex_paper_size= . build/html Error: Sphinx needs to be executed with Python 2.4 or newer (If you run this from the Makefile, you can set the PYTHON variable to the path of an alternative interpreter executable, e.g., ``make html PYTHON=python2.5``). make: *** [build] Error 1 From python-checkins at python.org Fri Oct 3 14:26:42 2008 From: python-checkins at python.org (andrew.kuchling) Date: Fri, 3 Oct 2008 14:26:42 +0200 (CEST) Subject: [Python-checkins] r66767 - in python/trunk/Modules: _codecsmodule.c cjkcodecs/multibytecodec.c Message-ID: <20081003122642.8D87F1E4002@bag.python.org> Author: andrew.kuchling Date: Fri Oct 3 14:26:42 2008 New Revision: 66767 Log: Docstring typo. Modified: python/trunk/Modules/_codecsmodule.c python/trunk/Modules/cjkcodecs/multibytecodec.c Modified: python/trunk/Modules/_codecsmodule.c ============================================================================== --- python/trunk/Modules/_codecsmodule.c (original) +++ python/trunk/Modules/_codecsmodule.c Fri Oct 3 14:26:42 2008 @@ -115,7 +115,7 @@ to the default encoding. errors may be given to set a different error\n\ handling scheme. Default is 'strict' meaning that encoding errors raise\n\ a ValueError. Other possible values are 'ignore' and 'replace'\n\ -as well as any other name registerd with codecs.register_error that is\n\ +as well as any other name registered with codecs.register_error that is\n\ able to handle ValueErrors."); static PyObject * Modified: python/trunk/Modules/cjkcodecs/multibytecodec.c ============================================================================== --- python/trunk/Modules/cjkcodecs/multibytecodec.c (original) +++ python/trunk/Modules/cjkcodecs/multibytecodec.c Fri Oct 3 14:26:42 2008 @@ -36,7 +36,7 @@ Decodes `string' using I, an MultibyteCodec instance. errors may be given\n\ to set a different error handling scheme. Default is 'strict' meaning\n\ that encoding errors raise a UnicodeDecodeError. Other possible values\n\ -are 'ignore' and 'replace' as well as any other name registerd with\n\ +are 'ignore' and 'replace' as well as any other name registered with\n\ codecs.register_error that is able to handle UnicodeDecodeErrors."); static char *codeckwarglist[] = {"input", "errors", NULL}; From buildbot at python.org Fri Oct 3 14:42:30 2008 From: buildbot at python.org (buildbot at python.org) Date: Fri, 03 Oct 2008 12:42:30 +0000 Subject: [Python-checkins] buildbot failure in x86 W2k8 trunk Message-ID: <20081003124230.7A11A1E4002@bag.python.org> The Buildbot has detected a new failure of x86 W2k8 trunk. Full details are available at: http://www.python.org/dev/buildbot/all/x86%20W2k8%20trunk/builds/241 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: nelson-windows Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: benjamin.peterson BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_bsddb3 sincerely, -The Buildbot From buildbot at python.org Fri Oct 3 15:12:15 2008 From: buildbot at python.org (buildbot at python.org) Date: Fri, 03 Oct 2008 13:12:15 +0000 Subject: [Python-checkins] buildbot failure in ppc Debian unstable trunk Message-ID: <20081003131216.208E41E4002@bag.python.org> The Buildbot has detected a new failure of ppc Debian unstable trunk. Full details are available at: http://www.python.org/dev/buildbot/all/ppc%20Debian%20unstable%20trunk/builds/2029 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-debian-ppc Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: andrew.kuchling BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_bsddb3 Traceback (most recent call last): File "/home/pybot/buildarea/trunk.klose-debian-ppc/build/Lib/threading.py", line 522, in __bootstrap_inner self.run() File "/home/pybot/buildarea/trunk.klose-debian-ppc/build/Lib/threading.py", line 477, in run self.__target(*self.__args, **self.__kwargs) File "/home/pybot/buildarea/trunk.klose-debian-ppc/build/Lib/bsddb/test/test_thread.py", line 306, in readerThread rec = dbutils.DeadlockWrap(c.next, max_retries=10) File "/home/pybot/buildarea/trunk.klose-debian-ppc/build/Lib/bsddb/dbutils.py", line 68, in DeadlockWrap return function(*_args, **_kwargs) DBLockDeadlockError: (-30994, 'DB_LOCK_DEADLOCK: Locker killed to resolve a deadlock') make: *** [buildbottest] Error 1 sincerely, -The Buildbot From nnorwitz at gmail.com Fri Oct 3 15:20:07 2008 From: nnorwitz at gmail.com (Neal Norwitz) Date: Fri, 3 Oct 2008 09:20:07 -0400 Subject: [Python-checkins] Python Regression Test Failures doc (1) Message-ID: <20081003132007.GA6600@python.psfb.org> svn update tools/sphinx At revision 66767. svn update tools/docutils At revision 66767. svn update tools/jinja At revision 66767. svn update tools/pygments At revision 66767. mkdir -p build/html build/doctrees python tools/sphinx-build.py -b html -d build/doctrees -D latex_paper_size= . build/html Error: Sphinx needs to be executed with Python 2.4 or newer (If you run this from the Makefile, you can set the PYTHON variable to the path of an alternative interpreter executable, e.g., ``make html PYTHON=python2.5``). make: *** [build] Error 1 From buildbot at python.org Fri Oct 3 15:22:20 2008 From: buildbot at python.org (buildbot at python.org) Date: Fri, 03 Oct 2008 13:22:20 +0000 Subject: [Python-checkins] buildbot failure in S-390 Debian trunk Message-ID: <20081003132220.EAE131E4002@bag.python.org> The Buildbot has detected a new failure of S-390 Debian trunk. Full details are available at: http://www.python.org/dev/buildbot/all/S-390%20Debian%20trunk/builds/1158 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-debian-s390 Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: benjamin.peterson BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_pickletools make: *** [buildbottest] Error 1 sincerely, -The Buildbot From nnorwitz at gmail.com Fri Oct 3 16:20:06 2008 From: nnorwitz at gmail.com (Neal Norwitz) Date: Fri, 3 Oct 2008 10:20:06 -0400 Subject: [Python-checkins] Python Regression Test Failures doc (1) Message-ID: <20081003142006.GA6794@python.psfb.org> svn update tools/sphinx At revision 66767. svn update tools/docutils At revision 66767. svn update tools/jinja At revision 66767. svn update tools/pygments At revision 66767. mkdir -p build/html build/doctrees python tools/sphinx-build.py -b html -d build/doctrees -D latex_paper_size= . build/html Error: Sphinx needs to be executed with Python 2.4 or newer (If you run this from the Makefile, you can set the PYTHON variable to the path of an alternative interpreter executable, e.g., ``make html PYTHON=python2.5``). make: *** [build] Error 1 From nnorwitz at gmail.com Fri Oct 3 17:20:16 2008 From: nnorwitz at gmail.com (Neal Norwitz) Date: Fri, 3 Oct 2008 11:20:16 -0400 Subject: [Python-checkins] Python Regression Test Failures doc (1) Message-ID: <20081003152016.GA6989@python.psfb.org> svn update tools/sphinx At revision 66767. svn update tools/docutils At revision 66767. svn update tools/jinja At revision 66767. svn update tools/pygments At revision 66767. mkdir -p build/html build/doctrees python tools/sphinx-build.py -b html -d build/doctrees -D latex_paper_size= . build/html Error: Sphinx needs to be executed with Python 2.4 or newer (If you run this from the Makefile, you can set the PYTHON variable to the path of an alternative interpreter executable, e.g., ``make html PYTHON=python2.5``). make: *** [build] Error 1 From nnorwitz at gmail.com Fri Oct 3 18:20:07 2008 From: nnorwitz at gmail.com (Neal Norwitz) Date: Fri, 3 Oct 2008 12:20:07 -0400 Subject: [Python-checkins] Python Regression Test Failures doc (1) Message-ID: <20081003162007.GA17783@python.psfb.org> svn update tools/sphinx At revision 66771. svn update tools/docutils At revision 66771. svn update tools/jinja At revision 66771. svn update tools/pygments At revision 66771. mkdir -p build/html build/doctrees python tools/sphinx-build.py -b html -d build/doctrees -D latex_paper_size= . build/html Error: Sphinx needs to be executed with Python 2.4 or newer (If you run this from the Makefile, you can set the PYTHON variable to the path of an alternative interpreter executable, e.g., ``make html PYTHON=python2.5``). make: *** [build] Error 1 From nnorwitz at gmail.com Fri Oct 3 22:15:57 2008 From: nnorwitz at gmail.com (Neal Norwitz) Date: Fri, 3 Oct 2008 16:15:57 -0400 Subject: [Python-checkins] Python Regression Test Failures opt (1) Message-ID: <20081003201557.GA12438@python.psfb.org> 326 tests OK. 1 test failed: test_smtplib 33 tests skipped: test_aepack test_al test_applesingle test_bsddb185 test_bsddb3 test_cd test_cl test_curses test_epoll test_gl test_imgfile test_ioctl test_kqueue test_lib2to3 test_linuxaudiodev test_macos test_macostools test_multiprocessing test_ossaudiodev test_pep277 test_py3kwarn test_scriptpackages test_socketserver test_startfile test_sunaudiodev test_tcl test_timeout test_unicode_file test_urllib2net test_urllibnet test_winreg test_winsound test_zipfile64 4 skips unexpected on linux2: test_epoll test_multiprocessing test_lib2to3 test_ioctl test_grammar test_opcodes test_dict test_builtin test_exceptions test_types test_unittest test_doctest test_doctest2 test_MimeWriter test_SimpleHTTPServer test_StringIO test___all__ test___future__ test__locale test_abc test_abstract_numbers test_aepack test_aepack skipped -- No module named aepack test_al test_al skipped -- No module named al test_anydbm test_applesingle test_applesingle skipped -- No module named macostools test_array test_ast test_asynchat test_asyncore test_atexit test_audioop test_augassign test_base64 test_bastion test_bigaddrspace test_bigmem test_binascii test_binhex test_binop test_bisect test_bool test_bsddb test_bsddb185 test_bsddb185 skipped -- No module named bsddb185 test_bsddb3 test_bsddb3 skipped -- Use of the `bsddb' resource not enabled test_buffer test_bufio test_bytes test_bz2 test_calendar test_call test_capi test_cd test_cd skipped -- No module named cd test_cfgparser test_cgi test_charmapcodec test_cl test_cl skipped -- No module named cl test_class test_cmath test_cmd test_cmd_line test_cmd_line_script test_code test_codeccallbacks test_codecencodings_cn test_codecencodings_hk test_codecencodings_jp test_codecencodings_kr test_codecencodings_tw test_codecmaps_cn test_codecmaps_hk test_codecmaps_jp test_codecmaps_kr test_codecmaps_tw test_codecs test_codeop test_coding test_coercion test_collections test_colorsys test_commands test_compare test_compile test_compiler test_complex test_complex_args test_contains test_contextlib test_cookie test_cookielib test_copy test_copy_reg test_cpickle test_cprofile test_crypt test_csv test_ctypes test_curses test_curses skipped -- Use of the `curses' resource not enabled test_datetime test_dbm test_decimal test_decorators test_defaultdict test_deque test_descr test_descrtut test_difflib test_dircache test_dis test_distutils [17000 refs] test_dl test_docxmlrpc test_dumbdbm test_dummy_thread test_dummy_threading test_email test_email_codecs test_email_renamed test_enumerate test_eof test_epoll test_epoll skipped -- kernel doesn't support epoll() test_errno test_exception_variations test_extcall test_fcntl test_file test_filecmp test_fileinput test_fileio test_float test_fnmatch test_fork1 test_format test_fpformat test_fractions test_frozen test_ftplib test_funcattrs test_functools test_future test_future3 test_future4 test_future_builtins test_gc test_gdbm test_generators test_genericpath test_genexps test_getargs test_getargs2 test_getopt test_gettext test_gl test_gl skipped -- No module named gl test_glob test_global test_grp test_gzip test_hash test_hashlib test_heapq test_hmac test_hotshot test_htmllib test_htmlparser test_httplib test_httpservers [12826 refs] [12826 refs] [21355 refs] test_imageop test_imaplib test_imgfile test_imgfile skipped -- No module named imgfile test_imp test_import test_importhooks test_index test_inspect test_int test_int_literal test_io test_ioctl test_ioctl skipped -- Unable to open /dev/tty test_isinstance test_iter test_iterlen test_itertools test_json test_kqueue test_kqueue skipped -- test works only on BSD test_largefile test_lib2to3 test_lib2to3 skipped -- No module named myfixes test_linuxaudiodev test_linuxaudiodev skipped -- Use of the `audio' resource not enabled test_list test_locale test_logging test_long test_long_future test_longexp test_macos test_macos skipped -- No module named MacOS test_macostools test_macostools skipped -- No module named macostools test_macpath test_mailbox test_marshal test_math test_md5 test_memoryio test_mhlib test_mimetools test_mimetypes test_minidom test_mmap test_module test_modulefinder test_multibytecodec test_multibytecodec_support test_multifile test_multiprocessing test_multiprocessing skipped -- OSError raises on RLock creation, see issue 3111! test_mutants test_mutex test_netrc test_new test_nis test_normalization test_ntpath test_old_mailbox test_openpty test_operator test_optparse test_os /tmp/python-test/local/lib/python2.7/os.py:759: DeprecationWarning: integer argument expected, got float bs += read(_urandomfd, n - len(bs)) test_ossaudiodev test_ossaudiodev skipped -- Use of the `audio' resource not enabled test_parser Expecting 's_push: parser stack overflow' in next line s_push: parser stack overflow test_peepholer test_pep247 test_pep263 test_pep277 test_pep277 skipped -- test works only on NT+ test_pep292 test_pep352 test_pickle test_pickletools test_pipes test_pkg test_pkgimport test_pkgutil test_platform test_plistlib test_poll test_popen [12831 refs] [12831 refs] [12831 refs] test_popen2 test_poplib test_posix test_posixpath test_pow test_pprint test_print test_profile test_profilehooks test_property test_pstats test_pty test_pwd test_py3kwarn test_py3kwarn skipped -- test.test_py3kwarn must be run with the -3 flag test_pyclbr test_pydoc [17360 refs] test_pyexpat test_queue test_quopri [15345 refs] [15345 refs] test_random test_re test_repr test_resource test_rfc822 test_richcmp test_robotparser test_runpy test_sax test_scope test_scriptpackages test_scriptpackages skipped -- No module named aetools test_select test_set test_sets test_sgmllib test_sha test_shelve test_shlex test_shutil test_signal test_site [12826 refs] [12826 refs] [12829 refs] [12826 refs] test_slice test_smtplib test test_smtplib produced unexpected output: ********************************************************************** error: uncaptured python exception, closing channel (:[Errno 9] Bad file descriptor [/tmp/python-test/local/lib/python2.7/asyncore.py|readwrite|101] [/tmp/python-test/local/lib/python2.7/asyncore.py|handle_write_event|427] [|getsockopt|1] [/tmp/python-test/local/lib/python2.7/socket.py|_dummy|165]) ********************************************************************** test_socket test_socketserver test_socketserver skipped -- Use of the `network' resource not enabled test_softspace test_sort test_sqlite test_ssl test_startfile test_startfile skipped -- cannot import name startfile test_str test_strftime test_string test_stringprep test_strop test_strptime test_struct test_structmembers test_structseq test_subprocess [12826 refs] [12826 refs] [12826 refs] [12826 refs] [12826 refs] [12826 refs] [12826 refs] [12826 refs] [12826 refs] [12826 refs] [12826 refs] [12826 refs] [14726 refs] [13041 refs] [12826 refs] [12826 refs] [12826 refs] [12826 refs] [12826 refs] [12826 refs] . [12826 refs] [12826 refs] this bit of output is from a test of stdout in a different process ... [12826 refs] [12826 refs] [13041 refs] test_sunaudiodev test_sunaudiodev skipped -- No module named sunaudiodev test_sundry /tmp/python-test/local/lib/python2.7/test/test_sundry.py:67: DeprecationWarning: The posixfile module is deprecated; fcntl.lockf() provides better locking import posixfile test_symtable test_syntax test_sys [12826 refs] [12826 refs] [13055 refs] [12849 refs] test_tarfile test_tcl test_tcl skipped -- No module named _tkinter test_telnetlib test_tempfile [12829 refs] test_textwrap test_thread test_threaded_import test_threadedtempfile test_threading [16318 refs] [16812 refs] [15783 refs] [15783 refs] [15783 refs] [15783 refs] test_threading_local test_threadsignals test_time test_timeout test_timeout skipped -- Use of the `network' resource not enabled test_tokenize test_trace test_traceback test_transformer test_tuple test_typechecks test_ucn test_unary test_undocumented_details test_unicode test_unicode_file test_unicode_file skipped -- No Unicode filesystem semantics on this platform. test_unicodedata test_univnewlines test_unpack test_urllib test_urllib2 test_urllib2_localnet test_urllib2net test_urllib2net skipped -- Use of the `network' resource not enabled test_urllibnet test_urllibnet skipped -- Use of the `network' resource not enabled test_urlparse test_userdict test_userlist test_userstring test_uu test_uuid WARNING: uuid.getnode is unreliable on many platforms. It is disabled until the code and/or test can be fixed properly. WARNING: uuid._ifconfig_getnode is unreliable on many platforms. It is disabled until the code and/or test can be fixed properly. WARNING: uuid._unixdll_getnode is unreliable on many platforms. It is disabled until the code and/or test can be fixed properly. test_wait3 test_wait4 test_warnings test_wave test_weakref test_whichdb test_winreg test_winreg skipped -- No module named _winreg test_winsound test_winsound skipped -- No module named winsound test_with test_wsgiref test_xdrlib test_xml_etree test_xml_etree_c test_xmllib test_xmlrpc test_xpickle test_xrange test_zipfile test_zipfile64 test_zipfile64 skipped -- test requires loads of disk-space bytes and a long time to run test_zipimport test_zlib 326 tests OK. 1 test failed: test_smtplib 33 tests skipped: test_aepack test_al test_applesingle test_bsddb185 test_bsddb3 test_cd test_cl test_curses test_epoll test_gl test_imgfile test_ioctl test_kqueue test_lib2to3 test_linuxaudiodev test_macos test_macostools test_multiprocessing test_ossaudiodev test_pep277 test_py3kwarn test_scriptpackages test_socketserver test_startfile test_sunaudiodev test_tcl test_timeout test_unicode_file test_urllib2net test_urllibnet test_winreg test_winsound test_zipfile64 4 skips unexpected on linux2: test_epoll test_multiprocessing test_lib2to3 test_ioctl [647089 refs] From amauryfa at gmail.com Sat Oct 4 00:14:43 2008 From: amauryfa at gmail.com (Amaury Forgeot d'Arc) Date: Sat, 4 Oct 2008 00:14:43 +0200 Subject: [Python-checkins] python-checkins seems broken Message-ID: Hello, I consult very regularly (100x a day) the python-checkins and python-300-checkins mailing list archives: http://mail.python.org/pipermail/python-checkins/2008-October/date.html#end http://mail.python.org/pipermail/python-3000-checkins/2008-October/date.html#end But they did not receive the svn checkins since Friday morning (CEST timezone). They do display the buildbot failures however. I miss these messages, they are for me the best way to keep in sync with the developments. (I think I have read all the commit diffs for three years at least) They are specially important these days, where many people can work on the same files. Do other subscribed people receive these commit messages? Is there a problem with the mailer, or some SVN trigger? -- Amaury Forgeot d'Arc From amk at amk.ca Sat Oct 4 02:17:40 2008 From: amk at amk.ca (A.M. Kuchling) Date: Fri, 3 Oct 2008 20:17:40 -0400 Subject: [Python-checkins] python-checkins seems broken In-Reply-To: References: Message-ID: <20081004001740.GA20814@amk.local> On Sat, Oct 04, 2008 at 12:14:43AM +0200, Amaury Forgeot d'Arc wrote: > Do other subscribed people receive these commit messages? > Is there a problem with the mailer, or some SVN trigger? It looks like mail from dinsdale.python.org to mail.python.org isn't working due to a DNS issue: rcpt to: amk at python.org 550 5.7.1 Client host rejected: cannot find your reverse hostname, [82.94.164.164] data I know there's a transition to new IP addresses going on for the python.org machines, but Thomas or Sean probably needs to do something with the DNS for this. --amk From python-checkins at python.org Sat Oct 4 09:32:44 2008 From: python-checkins at python.org (benjamin.peterson) Date: Sat, 4 Oct 2008 09:32:44 +0200 (CEST) Subject: [Python-checkins] r66759 - peps/trunk/pep-0101.txt Message-ID: <20081004073244.81C971E4002@bag.python.org> Author: benjamin.peterson Date: Thu Oct 2 23:51:11 2008 New Revision: 66759 Log: pydoc-topics needs to be updated before releases Modified: peps/trunk/pep-0101.txt Modified: peps/trunk/pep-0101.txt ============================================================================== --- peps/trunk/pep-0101.txt (original) +++ peps/trunk/pep-0101.txt Thu Oct 2 23:51:11 2008 @@ -122,6 +122,11 @@ use your judgement, taking into account whether you are making an alpha, beta, or final release. + --- Regenerate Lib/pydoc-topics.py + + cd to the Doc directory and type ``make pydoc-topics``. Then copy + ``build/pydoc-topics/pydoc-topics.py`` to ``Lib/pydoc-topics.py``. + ___ Bump version numbers via the release script. .../sandbox/release/release.py --bump X.YaZ From python-checkins at python.org Sat Oct 4 09:32:47 2008 From: python-checkins at python.org (benjamin.peterson) Date: Sat, 4 Oct 2008 09:32:47 +0200 (CEST) Subject: [Python-checkins] r66760 - peps/trunk/pep-0101.txt Message-ID: <20081004073247.223EF1E4008@bag.python.org> Author: benjamin.peterson Date: Thu Oct 2 23:57:20 2008 New Revision: 66760 Log: fix markup Modified: peps/trunk/pep-0101.txt Modified: peps/trunk/pep-0101.txt ============================================================================== --- peps/trunk/pep-0101.txt (original) +++ peps/trunk/pep-0101.txt Thu Oct 2 23:57:20 2008 @@ -122,7 +122,7 @@ use your judgement, taking into account whether you are making an alpha, beta, or final release. - --- Regenerate Lib/pydoc-topics.py + ___ Regenerate Lib/pydoc-topics.py cd to the Doc directory and type ``make pydoc-topics``. Then copy ``build/pydoc-topics/pydoc-topics.py`` to ``Lib/pydoc-topics.py``. From python-checkins at python.org Sat Oct 4 09:32:50 2008 From: python-checkins at python.org (benjamin.peterson) Date: Sat, 4 Oct 2008 09:32:50 +0200 (CEST) Subject: [Python-checkins] r66761 - python/branches/release26-maint/Lib/pydoc_topics.py Message-ID: <20081004073250.64C821E4036@bag.python.org> Author: benjamin.peterson Date: Fri Oct 3 00:26:15 2008 New Revision: 66761 Log: update pydoc-topics here, too Modified: python/branches/release26-maint/Lib/pydoc_topics.py Modified: python/branches/release26-maint/Lib/pydoc_topics.py ============================================================================== --- python/branches/release26-maint/Lib/pydoc_topics.py (original) +++ python/branches/release26-maint/Lib/pydoc_topics.py Fri Oct 3 00:26:15 2008 @@ -1,31 +1,31 @@ -# Autogenerated by Sphinx on Sun Jun 1 22:23:15 2008 +# Autogenerated by Sphinx on Thu Oct 2 17:24:06 2008 topics = {'assert': u'\nThe ``assert`` statement\n************************\n\nAssert statements are a convenient way to insert debugging assertions\ninto a program:\n\n assert_stmt ::= "assert" expression ["," expression]\n\nThe simple form, ``assert expression``, is equivalent to\n\n if __debug__:\n if not expression: raise AssertionError\n\nThe extended form, ``assert expression1, expression2``, is equivalent\nto\n\n if __debug__:\n if not expression1: raise AssertionError, expression2\n\nThese equivalences assume that ``__debug__`` and ``AssertionError``\nrefer to the built-in variables with those names. In the current\nimplementation, the built-in variable ``__debug__`` is ``True`` under\nnormal circumstances, ``False`` when optimization is requested\n(command line option -O). The current code generator emits no code\nfor an assert statement when optimization is requested at compile\ntime. Note that it is unnecessary to include the source code for the\nexpression that failed in the error message; it will be displayed as\npart of the stack trace.\n\nAssignments to ``__debug__`` are illegal. The value for the built-in\nvariable is determined when the interpreter starts.\n', - 'assignment': u'\nAssignment statements\n*********************\n\nAssignment statements are used to (re)bind names to values and to\nmodify attributes or items of mutable objects:\n\n assignment_stmt ::= (target_list "=")+ (expression_list | yield_expression)\n target_list ::= target ("," target)* [","]\n target ::= identifier\n | "(" target_list ")"\n | "[" target_list "]"\n | attributeref\n | subscription\n | slicing\n\n(See section *Primaries* for the syntax definitions for the last three\nsymbols.)\n\nAn assignment statement evaluates the expression list (remember that\nthis can be a single expression or a comma-separated list, the latter\nyielding a tuple) and assigns the single resulting object to each of\nthe target lists, from left to right.\n\nAssignment is defined recursively depending on the form of the target\n(list). When a target is part of a mutable object (an attribute\nreference, subscription or slicing), the mutable object must\nultimately perform the assignment and decide about its validity, and\nmay raise an exception if the assignment is unacceptable. The rules\nobserved by various types and the exceptions raised are given with the\ndefinition of the object types (see section *The standard type\nhierarchy*).\n\nAssignment of an object to a target list is recursively defined as\nfollows.\n\n* If the target list is a single target: The object is assigned to\n that target.\n\n* If the target list is a comma-separated list of targets: The object\n must be a sequence with the same number of items as there are\n targets in the target list, and the items are assigned, from left to\n right, to the corresponding targets. (This rule is relaxed as of\n Python 1.5; in earlier versions, the object had to be a tuple.\n Since strings are sequences, an assignment like ``a, b = "xy"`` is\n now legal as long as the string has the right length.)\n\nAssignment of an object to a single target is recursively defined as\nfollows.\n\n* If the target is an identifier (name):\n\n * If the name does not occur in a ``global`` statement in the\n current code block: the name is bound to the object in the current\n local namespace.\n\n * Otherwise: the name is bound to the object in the current global\n namespace.\n\n The name is rebound if it was already bound. This may cause the\n reference count for the object previously bound to the name to reach\n zero, causing the object to be deallocated and its destructor (if it\n has one) to be called.\n\n* If the target is a target list enclosed in parentheses or in square\n brackets: The object must be a sequence with the same number of\n items as there are targets in the target list, and its items are\n assigned, from left to right, to the corresponding targets.\n\n* If the target is an attribute reference: The primary expression in\n the reference is evaluated. It should yield an object with\n assignable attributes; if this is not the case, ``TypeError`` is\n raised. That object is then asked to assign the assigned object to\n the given attribute; if it cannot perform the assignment, it raises\n an exception (usually but not necessarily ``AttributeError``).\n\n* If the target is a subscription: The primary expression in the\n reference is evaluated. It should yield either a mutable sequence\n object (such as a list) or a mapping object (such as a dictionary).\n Next, the subscript expression is evaluated.\n\n If the primary is a mutable sequence object (such as a list), the\n subscript must yield a plain integer. If it is negative, the\n sequence\'s length is added to it. The resulting value must be a\n nonnegative integer less than the sequence\'s length, and the\n sequence is asked to assign the assigned object to its item with\n that index. If the index is out of range, ``IndexError`` is raised\n (assignment to a subscripted sequence cannot add new items to a\n list).\n\n If the primary is a mapping object (such as a dictionary), the\n subscript must have a type compatible with the mapping\'s key type,\n and the mapping is then asked to create a key/datum pair which maps\n the subscript to the assigned object. This can either replace an\n existing key/value pair with the same key value, or insert a new\n key/value pair (if no key with the same value existed).\n\n* If the target is a slicing: The primary expression in the reference\n is evaluated. It should yield a mutable sequence object (such as a\n list). The assigned object should be a sequence object of the same\n type. Next, the lower and upper bound expressions are evaluated,\n insofar they are present; defaults are zero and the sequence\'s\n length. The bounds should evaluate to (small) integers. If either\n bound is negative, the sequence\'s length is added to it. The\n resulting bounds are clipped to lie between zero and the sequence\'s\n length, inclusive. Finally, the sequence object is asked to replace\n the slice with the items of the assigned sequence. The length of\n the slice may be different from the length of the assigned sequence,\n thus changing the length of the target sequence, if the object\n allows it.\n\n(In the current implementation, the syntax for targets is taken to be\nthe same as for expressions, and invalid syntax is rejected during the\ncode generation phase, causing less detailed error messages.)\n\nWARNING: Although the definition of assignment implies that overlaps\nbetween the left-hand side and the right-hand side are \'safe\' (for\nexample ``a, b = b, a`` swaps two variables), overlaps *within* the\ncollection of assigned-to variables are not safe! For instance, the\nfollowing program prints ``[0, 2]``:\n\n x = [0, 1]\n i = 0\n i, x[i] = 1, 2\n print x\n\n\nAugmented assignment statements\n===============================\n\nAugmented assignment is the combination, in a single statement, of a\nbinary operation and an assignment statement:\n\n augmented_assignment_stmt ::= target augop (expression_list | yield_expression)\n augop ::= "+=" | "-=" | "*=" | "/=" | "%=" | "**="\n | ">>=" | "<<=" | "&=" | "^=" | "|="\n\n(See section *Primaries* for the syntax definitions for the last three\nsymbols.)\n\nAn augmented assignment evaluates the target (which, unlike normal\nassignment statements, cannot be an unpacking) and the expression\nlist, performs the binary operation specific to the type of assignment\non the two operands, and assigns the result to the original target.\nThe target is only evaluated once.\n\nAn augmented assignment expression like ``x += 1`` can be rewritten as\n``x = x + 1`` to achieve a similar, but not exactly equal effect. In\nthe augmented version, ``x`` is only evaluated once. Also, when\npossible, the actual operation is performed *in-place*, meaning that\nrather than creating a new object and assigning that to the target,\nthe old object is modified instead.\n\nWith the exception of assigning to tuples and multiple targets in a\nsingle statement, the assignment done by augmented assignment\nstatements is handled the same way as normal assignments. Similarly,\nwith the exception of the possible *in-place* behavior, the binary\noperation performed by augmented assignment is the same as the normal\nbinary operations.\n\nFor targets which are attribute references, the initial value is\nretrieved with a ``getattr()`` and the result is assigned with a\n``setattr()``. Notice that the two methods do not necessarily refer\nto the same variable. When ``getattr()`` refers to a class variable,\n``setattr()`` still writes to an instance variable. For example:\n\n class A:\n x = 3 # class variable\n a = A()\n a.x += 1 # writes a.x as 4 leaving A.x as 3\n', + 'assignment': u'\nAssignment statements\n*********************\n\nAssignment statements are used to (re)bind names to values and to\nmodify attributes or items of mutable objects:\n\n assignment_stmt ::= (target_list "=")+ (expression_list | yield_expression)\n target_list ::= target ("," target)* [","]\n target ::= identifier\n | "(" target_list ")"\n | "[" target_list "]"\n | attributeref\n | subscription\n | slicing\n\n(See section *Primaries* for the syntax definitions for the last three\nsymbols.)\n\nAn assignment statement evaluates the expression list (remember that\nthis can be a single expression or a comma-separated list, the latter\nyielding a tuple) and assigns the single resulting object to each of\nthe target lists, from left to right.\n\nAssignment is defined recursively depending on the form of the target\n(list). When a target is part of a mutable object (an attribute\nreference, subscription or slicing), the mutable object must\nultimately perform the assignment and decide about its validity, and\nmay raise an exception if the assignment is unacceptable. The rules\nobserved by various types and the exceptions raised are given with the\ndefinition of the object types (see section *The standard type\nhierarchy*).\n\nAssignment of an object to a target list is recursively defined as\nfollows.\n\n* If the target list is a single target: The object is assigned to\n that target.\n\n* If the target list is a comma-separated list of targets: The object\n must be a sequence with the same number of items as there are\n targets in the target list, and the items are assigned, from left to\n right, to the corresponding targets. (This rule is relaxed as of\n Python 1.5; in earlier versions, the object had to be a tuple.\n Since strings are sequences, an assignment like ``a, b = "xy"`` is\n now legal as long as the string has the right length.)\n\nAssignment of an object to a single target is recursively defined as\nfollows.\n\n* If the target is an identifier (name):\n\n * If the name does not occur in a ``global`` statement in the\n current code block: the name is bound to the object in the current\n local namespace.\n\n * Otherwise: the name is bound to the object in the current global\n namespace.\n\n The name is rebound if it was already bound. This may cause the\n reference count for the object previously bound to the name to reach\n zero, causing the object to be deallocated and its destructor (if it\n has one) to be called.\n\n* If the target is a target list enclosed in parentheses or in square\n brackets: The object must be a sequence with the same number of\n items as there are targets in the target list, and its items are\n assigned, from left to right, to the corresponding targets.\n\n* If the target is an attribute reference: The primary expression in\n the reference is evaluated. It should yield an object with\n assignable attributes; if this is not the case, ``TypeError`` is\n raised. That object is then asked to assign the assigned object to\n the given attribute; if it cannot perform the assignment, it raises\n an exception (usually but not necessarily ``AttributeError``).\n\n* If the target is a subscription: The primary expression in the\n reference is evaluated. It should yield either a mutable sequence\n object (such as a list) or a mapping object (such as a dictionary).\n Next, the subscript expression is evaluated.\n\n If the primary is a mutable sequence object (such as a list), the\n subscript must yield a plain integer. If it is negative, the\n sequence\'s length is added to it. The resulting value must be a\n nonnegative integer less than the sequence\'s length, and the\n sequence is asked to assign the assigned object to its item with\n that index. If the index is out of range, ``IndexError`` is raised\n (assignment to a subscripted sequence cannot add new items to a\n list).\n\n If the primary is a mapping object (such as a dictionary), the\n subscript must have a type compatible with the mapping\'s key type,\n and the mapping is then asked to create a key/datum pair which maps\n the subscript to the assigned object. This can either replace an\n existing key/value pair with the same key value, or insert a new\n key/value pair (if no key with the same value existed).\n\n* If the target is a slicing: The primary expression in the reference\n is evaluated. It should yield a mutable sequence object (such as a\n list). The assigned object should be a sequence object of the same\n type. Next, the lower and upper bound expressions are evaluated,\n insofar they are present; defaults are zero and the sequence\'s\n length. The bounds should evaluate to (small) integers. If either\n bound is negative, the sequence\'s length is added to it. The\n resulting bounds are clipped to lie between zero and the sequence\'s\n length, inclusive. Finally, the sequence object is asked to replace\n the slice with the items of the assigned sequence. The length of\n the slice may be different from the length of the assigned sequence,\n thus changing the length of the target sequence, if the object\n allows it.\n\n(In the current implementation, the syntax for targets is taken to be\nthe same as for expressions, and invalid syntax is rejected during the\ncode generation phase, causing less detailed error messages.)\n\nWARNING: Although the definition of assignment implies that overlaps\nbetween the left-hand side and the right-hand side are \'safe\' (for\nexample ``a, b = b, a`` swaps two variables), overlaps *within* the\ncollection of assigned-to variables are not safe! For instance, the\nfollowing program prints ``[0, 2]``:\n\n x = [0, 1]\n i = 0\n i, x[i] = 1, 2\n print x\n\n\nAugmented assignment statements\n===============================\n\nAugmented assignment is the combination, in a single statement, of a\nbinary operation and an assignment statement:\n\n augmented_assignment_stmt ::= target augop (expression_list | yield_expression)\n augop ::= "+=" | "-=" | "*=" | "/=" | "//=" | "%=" | "**="\n | ">>=" | "<<=" | "&=" | "^=" | "|="\n\n(See section *Primaries* for the syntax definitions for the last three\nsymbols.)\n\nAn augmented assignment evaluates the target (which, unlike normal\nassignment statements, cannot be an unpacking) and the expression\nlist, performs the binary operation specific to the type of assignment\non the two operands, and assigns the result to the original target.\nThe target is only evaluated once.\n\nAn augmented assignment expression like ``x += 1`` can be rewritten as\n``x = x + 1`` to achieve a similar, but not exactly equal effect. In\nthe augmented version, ``x`` is only evaluated once. Also, when\npossible, the actual operation is performed *in-place*, meaning that\nrather than creating a new object and assigning that to the target,\nthe old object is modified instead.\n\nWith the exception of assigning to tuples and multiple targets in a\nsingle statement, the assignment done by augmented assignment\nstatements is handled the same way as normal assignments. Similarly,\nwith the exception of the possible *in-place* behavior, the binary\noperation performed by augmented assignment is the same as the normal\nbinary operations.\n\nFor targets which are attribute references, the initial value is\nretrieved with a ``getattr()`` and the result is assigned with a\n``setattr()``. Notice that the two methods do not necessarily refer\nto the same variable. When ``getattr()`` refers to a class variable,\n``setattr()`` still writes to an instance variable. For example:\n\n class A:\n x = 3 # class variable\n a = A()\n a.x += 1 # writes a.x as 4 leaving A.x as 3\n', 'atom-identifiers': u'\nIdentifiers (Names)\n*******************\n\nAn identifier occurring as an atom is a name. See section\n*Identifiers and keywords* for lexical definition and section *Naming\nand binding* for documentation of naming and binding.\n\nWhen the name is bound to an object, evaluation of the atom yields\nthat object. When a name is not bound, an attempt to evaluate it\nraises a ``NameError`` exception.\n\n**Private name mangling:** When an identifier that textually occurs in\na class definition begins with two or more underscore characters and\ndoes not end in two or more underscores, it is considered a *private\nname* of that class. Private names are transformed to a longer form\nbefore code is generated for them. The transformation inserts the\nclass name in front of the name, with leading underscores removed, and\na single underscore inserted in front of the class name. For example,\nthe identifier ``__spam`` occurring in a class named ``Ham`` will be\ntransformed to ``_Ham__spam``. This transformation is independent of\nthe syntactical context in which the identifier is used. If the\ntransformed name is extremely long (longer than 255 characters),\nimplementation defined truncation may happen. If the class name\nconsists only of underscores, no transformation is done.\n', 'atom-literals': u"\nLiterals\n********\n\nPython supports string literals and various numeric literals:\n\n literal ::= stringliteral | integer | longinteger\n | floatnumber | imagnumber\n\nEvaluation of a literal yields an object of the given type (string,\ninteger, long integer, floating point number, complex number) with the\ngiven value. The value may be approximated in the case of floating\npoint and imaginary (complex) literals. See section *Literals* for\ndetails.\n\nAll literals correspond to immutable data types, and hence the\nobject's identity is less important than its value. Multiple\nevaluations of literals with the same value (either the same\noccurrence in the program text or a different occurrence) may obtain\nthe same object or a different object with the same value.\n", - 'attribute-access': u'\nCustomizing attribute access\n****************************\n\nThe following methods can be defined to customize the meaning of\nattribute access (use of, assignment to, or deletion of ``x.name``)\nfor class instances.\n\nobject.__getattr__(self, name)\n\n Called when an attribute lookup has not found the attribute in the\n usual places (i.e. it is not an instance attribute nor is it found\n in the class tree for ``self``). ``name`` is the attribute name.\n This method should return the (computed) attribute value or raise\n an ``AttributeError`` exception.\n\n Note that if the attribute is found through the normal mechanism,\n ``__getattr__()`` is not called. (This is an intentional asymmetry\n between ``__getattr__()`` and ``__setattr__()``.) This is done both\n for efficiency reasons and because otherwise ``__setattr__()``\n would have no way to access other attributes of the instance. Note\n that at least for instance variables, you can fake total control by\n not inserting any values in the instance attribute dictionary (but\n instead inserting them in another object). See the\n ``__getattribute__()`` method below for a way to actually get total\n control in new-style classes.\n\nobject.__setattr__(self, name, value)\n\n Called when an attribute assignment is attempted. This is called\n instead of the normal mechanism (i.e. store the value in the\n instance dictionary). *name* is the attribute name, *value* is the\n value to be assigned to it.\n\n If ``__setattr__()`` wants to assign to an instance attribute, it\n should not simply execute ``self.name = value`` --- this would\n cause a recursive call to itself. Instead, it should insert the\n value in the dictionary of instance attributes, e.g.,\n ``self.__dict__[name] = value``. For new-style classes, rather\n than accessing the instance dictionary, it should call the base\n class method with the same name, for example,\n ``object.__setattr__(self, name, value)``.\n\nobject.__delattr__(self, name)\n\n Like ``__setattr__()`` but for attribute deletion instead of\n assignment. This should only be implemented if ``del obj.name`` is\n meaningful for the object.\n\n\nMore attribute access for new-style classes\n===========================================\n\nThe following methods only apply to new-style classes.\n\nobject.__getattribute__(self, name)\n\n Called unconditionally to implement attribute accesses for\n instances of the class. If the class also defines\n ``__getattr__()``, the latter will not be called unless\n ``__getattribute__()`` either calls it explicitly or raises an\n ``AttributeError``. This method should return the (computed)\n attribute value or raise an ``AttributeError`` exception. In order\n to avoid infinite recursion in this method, its implementation\n should always call the base class method with the same name to\n access any attributes it needs, for example,\n ``object.__getattribute__(self, name)``.\n\n\nImplementing Descriptors\n========================\n\nThe following methods only apply when an instance of the class\ncontaining the method (a so-called *descriptor* class) appears in the\nclass dictionary of another new-style class, known as the *owner*\nclass. In the examples below, "the attribute" refers to the attribute\nwhose name is the key of the property in the owner class\'\n``__dict__``. Descriptors can only be implemented as new-style\nclasses themselves.\n\nobject.__get__(self, instance, owner)\n\n Called to get the attribute of the owner class (class attribute\n access) or of an instance of that class (instance attribute\n access). *owner* is always the owner class, while *instance* is the\n instance that the attribute was accessed through, or ``None`` when\n the attribute is accessed through the *owner*. This method should\n return the (computed) attribute value or raise an\n ``AttributeError`` exception.\n\nobject.__set__(self, instance, value)\n\n Called to set the attribute on an instance *instance* of the owner\n class to a new value, *value*.\n\nobject.__delete__(self, instance)\n\n Called to delete the attribute on an instance *instance* of the\n owner class.\n\n\nInvoking Descriptors\n====================\n\nIn general, a descriptor is an object attribute with "binding\nbehavior", one whose attribute access has been overridden by methods\nin the descriptor protocol: ``__get__()``, ``__set__()``, and\n``__delete__()``. If any of those methods are defined for an object,\nit is said to be a descriptor.\n\nThe default behavior for attribute access is to get, set, or delete\nthe attribute from an object\'s dictionary. For instance, ``a.x`` has a\nlookup chain starting with ``a.__dict__[\'x\']``, then\n``type(a).__dict__[\'x\']``, and continuing through the base classes of\n``type(a)`` excluding metaclasses.\n\nHowever, if the looked-up value is an object defining one of the\ndescriptor methods, then Python may override the default behavior and\ninvoke the descriptor method instead. Where this occurs in the\nprecedence chain depends on which descriptor methods were defined and\nhow they were called. Note that descriptors are only invoked for new\nstyle objects or classes (ones that subclass ``object()`` or\n``type()``).\n\nThe starting point for descriptor invocation is a binding, ``a.x``.\nHow the arguments are assembled depends on ``a``:\n\nDirect Call\n The simplest and least common call is when user code directly\n invokes a descriptor method: ``x.__get__(a)``.\n\nInstance Binding\n If binding to a new-style object instance, ``a.x`` is transformed\n into the call: ``type(a).__dict__[\'x\'].__get__(a, type(a))``.\n\nClass Binding\n If binding to a new-style class, ``A.x`` is transformed into the\n call: ``A.__dict__[\'x\'].__get__(None, A)``.\n\nSuper Binding\n If ``a`` is an instance of ``super``, then the binding ``super(B,\n obj).m()`` searches ``obj.__class__.__mro__`` for the base class\n ``A`` immediately preceding ``B`` and then invokes the descriptor\n with the call: ``A.__dict__[\'m\'].__get__(obj, A)``.\n\nFor instance bindings, the precedence of descriptor invocation depends\non the which descriptor methods are defined. Normally, data\ndescriptors define both ``__get__()`` and ``__set__()``, while non-\ndata descriptors have just the ``__get__()`` method. Data descriptors\nalways override a redefinition in an instance dictionary. In\ncontrast, non-data descriptors can be overridden by instances. [3]\n\nPython methods (including ``staticmethod()`` and ``classmethod()``)\nare implemented as non-data descriptors. Accordingly, instances can\nredefine and override methods. This allows individual instances to\nacquire behaviors that differ from other instances of the same class.\n\nThe ``property()`` function is implemented as a data descriptor.\nAccordingly, instances cannot override the behavior of a property.\n\n\n__slots__\n=========\n\nBy default, instances of both old and new-style classes have a\ndictionary for attribute storage. This wastes space for objects\nhaving very few instance variables. The space consumption can become\nacute when creating large numbers of instances.\n\nThe default can be overridden by defining *__slots__* in a new-style\nclass definition. The *__slots__* declaration takes a sequence of\ninstance variables and reserves just enough space in each instance to\nhold a value for each variable. Space is saved because *__dict__* is\nnot created for each instance.\n\n__slots__\n\n This class variable can be assigned a string, iterable, or sequence\n of strings with variable names used by instances. If defined in a\n new-style class, *__slots__* reserves space for the declared\n variables and prevents the automatic creation of *__dict__* and\n *__weakref__* for each instance.\n\n Added in version 2.2.\n\nNotes on using *__slots__*\n\n* Without a *__dict__* variable, instances cannot be assigned new\n variables not listed in the *__slots__* definition. Attempts to\n assign to an unlisted variable name raises ``AttributeError``. If\n dynamic assignment of new variables is desired, then add\n ``\'__dict__\'`` to the sequence of strings in the *__slots__*\n declaration.\n\n Changed in version 2.3: Previously, adding ``\'__dict__\'`` to the\n *__slots__* declaration would not enable the assignment of new\n attributes not specifically listed in the sequence of instance\n variable names.\n\n* Without a *__weakref__* variable for each instance, classes defining\n *__slots__* do not support weak references to its instances. If weak\n reference support is needed, then add ``\'__weakref__\'`` to the\n sequence of strings in the *__slots__* declaration.\n\n Changed in version 2.3: Previously, adding ``\'__weakref__\'`` to the\n *__slots__* declaration would not enable support for weak\n references.\n\n* *__slots__* are implemented at the class level by creating\n descriptors (*Implementing Descriptors*) for each variable name. As\n a result, class attributes cannot be used to set default values for\n instance variables defined by *__slots__*; otherwise, the class\n attribute would overwrite the descriptor assignment.\n\n* If a class defines a slot also defined in a base class, the instance\n variable defined by the base class slot is inaccessible (except by\n retrieving its descriptor directly from the base class). This\n renders the meaning of the program undefined. In the future, a\n check may be added to prevent this.\n\n* The action of a *__slots__* declaration is limited to the class\n where it is defined. As a result, subclasses will have a *__dict__*\n unless they also define *__slots__*.\n\n* *__slots__* do not work for classes derived from "variable-length"\n built-in types such as ``long``, ``str`` and ``tuple``.\n\n* Any non-string iterable may be assigned to *__slots__*. Mappings may\n also be used; however, in the future, special meaning may be\n assigned to the values corresponding to each key.\n\n* *__class__* assignment works only if both classes have the same\n *__slots__*.\n\n Changed in version 2.6: Previously, *__class__* assignment raised an\n error if either new or old class had *__slots__*.\n', + 'attribute-access': u'\nCustomizing attribute access\n****************************\n\nThe following methods can be defined to customize the meaning of\nattribute access (use of, assignment to, or deletion of ``x.name``)\nfor class instances.\n\nobject.__getattr__(self, name)\n\n Called when an attribute lookup has not found the attribute in the\n usual places (i.e. it is not an instance attribute nor is it found\n in the class tree for ``self``). ``name`` is the attribute name.\n This method should return the (computed) attribute value or raise\n an ``AttributeError`` exception.\n\n Note that if the attribute is found through the normal mechanism,\n ``__getattr__()`` is not called. (This is an intentional asymmetry\n between ``__getattr__()`` and ``__setattr__()``.) This is done both\n for efficiency reasons and because otherwise ``__getattr__()``\n would have no way to access other attributes of the instance. Note\n that at least for instance variables, you can fake total control by\n not inserting any values in the instance attribute dictionary (but\n instead inserting them in another object). See the\n ``__getattribute__()`` method below for a way to actually get total\n control in new-style classes.\n\nobject.__setattr__(self, name, value)\n\n Called when an attribute assignment is attempted. This is called\n instead of the normal mechanism (i.e. store the value in the\n instance dictionary). *name* is the attribute name, *value* is the\n value to be assigned to it.\n\n If ``__setattr__()`` wants to assign to an instance attribute, it\n should not simply execute ``self.name = value`` --- this would\n cause a recursive call to itself. Instead, it should insert the\n value in the dictionary of instance attributes, e.g.,\n ``self.__dict__[name] = value``. For new-style classes, rather\n than accessing the instance dictionary, it should call the base\n class method with the same name, for example,\n ``object.__setattr__(self, name, value)``.\n\nobject.__delattr__(self, name)\n\n Like ``__setattr__()`` but for attribute deletion instead of\n assignment. This should only be implemented if ``del obj.name`` is\n meaningful for the object.\n\n\nMore attribute access for new-style classes\n===========================================\n\nThe following methods only apply to new-style classes.\n\nobject.__getattribute__(self, name)\n\n Called unconditionally to implement attribute accesses for\n instances of the class. If the class also defines\n ``__getattr__()``, the latter will not be called unless\n ``__getattribute__()`` either calls it explicitly or raises an\n ``AttributeError``. This method should return the (computed)\n attribute value or raise an ``AttributeError`` exception. In order\n to avoid infinite recursion in this method, its implementation\n should always call the base class method with the same name to\n access any attributes it needs, for example,\n ``object.__getattribute__(self, name)``.\n\n Note: This method may still be bypassed when looking up special methods\n as the result of implicit invocation via language syntax or\n builtin functions. See *Special method lookup for new-style\n classes*.\n\n\nImplementing Descriptors\n========================\n\nThe following methods only apply when an instance of the class\ncontaining the method (a so-called *descriptor* class) appears in the\nclass dictionary of another new-style class, known as the *owner*\nclass. In the examples below, "the attribute" refers to the attribute\nwhose name is the key of the property in the owner class\'\n``__dict__``. Descriptors can only be implemented as new-style\nclasses themselves.\n\nobject.__get__(self, instance, owner)\n\n Called to get the attribute of the owner class (class attribute\n access) or of an instance of that class (instance attribute\n access). *owner* is always the owner class, while *instance* is the\n instance that the attribute was accessed through, or ``None`` when\n the attribute is accessed through the *owner*. This method should\n return the (computed) attribute value or raise an\n ``AttributeError`` exception.\n\nobject.__set__(self, instance, value)\n\n Called to set the attribute on an instance *instance* of the owner\n class to a new value, *value*.\n\nobject.__delete__(self, instance)\n\n Called to delete the attribute on an instance *instance* of the\n owner class.\n\n\nInvoking Descriptors\n====================\n\nIn general, a descriptor is an object attribute with "binding\nbehavior", one whose attribute access has been overridden by methods\nin the descriptor protocol: ``__get__()``, ``__set__()``, and\n``__delete__()``. If any of those methods are defined for an object,\nit is said to be a descriptor.\n\nThe default behavior for attribute access is to get, set, or delete\nthe attribute from an object\'s dictionary. For instance, ``a.x`` has a\nlookup chain starting with ``a.__dict__[\'x\']``, then\n``type(a).__dict__[\'x\']``, and continuing through the base classes of\n``type(a)`` excluding metaclasses.\n\nHowever, if the looked-up value is an object defining one of the\ndescriptor methods, then Python may override the default behavior and\ninvoke the descriptor method instead. Where this occurs in the\nprecedence chain depends on which descriptor methods were defined and\nhow they were called. Note that descriptors are only invoked for new\nstyle objects or classes (ones that subclass ``object()`` or\n``type()``).\n\nThe starting point for descriptor invocation is a binding, ``a.x``.\nHow the arguments are assembled depends on ``a``:\n\nDirect Call\n The simplest and least common call is when user code directly\n invokes a descriptor method: ``x.__get__(a)``.\n\nInstance Binding\n If binding to a new-style object instance, ``a.x`` is transformed\n into the call: ``type(a).__dict__[\'x\'].__get__(a, type(a))``.\n\nClass Binding\n If binding to a new-style class, ``A.x`` is transformed into the\n call: ``A.__dict__[\'x\'].__get__(None, A)``.\n\nSuper Binding\n If ``a`` is an instance of ``super``, then the binding ``super(B,\n obj).m()`` searches ``obj.__class__.__mro__`` for the base class\n ``A`` immediately preceding ``B`` and then invokes the descriptor\n with the call: ``A.__dict__[\'m\'].__get__(obj, A)``.\n\nFor instance bindings, the precedence of descriptor invocation depends\non the which descriptor methods are defined. Normally, data\ndescriptors define both ``__get__()`` and ``__set__()``, while non-\ndata descriptors have just the ``__get__()`` method. Data descriptors\nalways override a redefinition in an instance dictionary. In\ncontrast, non-data descriptors can be overridden by instances. [2]\n\nPython methods (including ``staticmethod()`` and ``classmethod()``)\nare implemented as non-data descriptors. Accordingly, instances can\nredefine and override methods. This allows individual instances to\nacquire behaviors that differ from other instances of the same class.\n\nThe ``property()`` function is implemented as a data descriptor.\nAccordingly, instances cannot override the behavior of a property.\n\n\n__slots__\n=========\n\nBy default, instances of both old and new-style classes have a\ndictionary for attribute storage. This wastes space for objects\nhaving very few instance variables. The space consumption can become\nacute when creating large numbers of instances.\n\nThe default can be overridden by defining *__slots__* in a new-style\nclass definition. The *__slots__* declaration takes a sequence of\ninstance variables and reserves just enough space in each instance to\nhold a value for each variable. Space is saved because *__dict__* is\nnot created for each instance.\n\n__slots__\n\n This class variable can be assigned a string, iterable, or sequence\n of strings with variable names used by instances. If defined in a\n new-style class, *__slots__* reserves space for the declared\n variables and prevents the automatic creation of *__dict__* and\n *__weakref__* for each instance.\n\n New in version 2.2.\n\nNotes on using *__slots__*\n\n* When inheriting from a class without *__slots__*, the *__dict__*\n attribute of that class will always be accessible, so a *__slots__*\n definition in the subclass is meaningless.\n\n* Without a *__dict__* variable, instances cannot be assigned new\n variables not listed in the *__slots__* definition. Attempts to\n assign to an unlisted variable name raises ``AttributeError``. If\n dynamic assignment of new variables is desired, then add\n ``\'__dict__\'`` to the sequence of strings in the *__slots__*\n declaration.\n\n Changed in version 2.3: Previously, adding ``\'__dict__\'`` to the\n *__slots__* declaration would not enable the assignment of new\n attributes not specifically listed in the sequence of instance\n variable names.\n\n* Without a *__weakref__* variable for each instance, classes defining\n *__slots__* do not support weak references to its instances. If weak\n reference support is needed, then add ``\'__weakref__\'`` to the\n sequence of strings in the *__slots__* declaration.\n\n Changed in version 2.3: Previously, adding ``\'__weakref__\'`` to the\n *__slots__* declaration would not enable support for weak\n references.\n\n* *__slots__* are implemented at the class level by creating\n descriptors (*Implementing Descriptors*) for each variable name. As\n a result, class attributes cannot be used to set default values for\n instance variables defined by *__slots__*; otherwise, the class\n attribute would overwrite the descriptor assignment.\n\n* If a class defines a slot also defined in a base class, the instance\n variable defined by the base class slot is inaccessible (except by\n retrieving its descriptor directly from the base class). This\n renders the meaning of the program undefined. In the future, a\n check may be added to prevent this.\n\n* The action of a *__slots__* declaration is limited to the class\n where it is defined. As a result, subclasses will have a *__dict__*\n unless they also define *__slots__*.\n\n* *__slots__* do not work for classes derived from "variable-length"\n built-in types such as ``long``, ``str`` and ``tuple``.\n\n* Any non-string iterable may be assigned to *__slots__*. Mappings may\n also be used; however, in the future, special meaning may be\n assigned to the values corresponding to each key.\n\n* *__class__* assignment works only if both classes have the same\n *__slots__*.\n\n Changed in version 2.6: Previously, *__class__* assignment raised an\n error if either new or old class had *__slots__*.\n', 'attribute-references': u'\nAttribute references\n********************\n\nAn attribute reference is a primary followed by a period and a name:\n\n attributeref ::= primary "." identifier\n\nThe primary must evaluate to an object of a type that supports\nattribute references, e.g., a module, list, or an instance. This\nobject is then asked to produce the attribute whose name is the\nidentifier. If this attribute is not available, the exception\n``AttributeError`` is raised. Otherwise, the type and value of the\nobject produced is determined by the object. Multiple evaluations of\nthe same attribute reference may yield different objects.\n', - 'augassign': u'\nAugmented assignment statements\n*******************************\n\nAugmented assignment is the combination, in a single statement, of a\nbinary operation and an assignment statement:\n\n augmented_assignment_stmt ::= target augop (expression_list | yield_expression)\n augop ::= "+=" | "-=" | "*=" | "/=" | "%=" | "**="\n | ">>=" | "<<=" | "&=" | "^=" | "|="\n\n(See section *Primaries* for the syntax definitions for the last three\nsymbols.)\n\nAn augmented assignment evaluates the target (which, unlike normal\nassignment statements, cannot be an unpacking) and the expression\nlist, performs the binary operation specific to the type of assignment\non the two operands, and assigns the result to the original target.\nThe target is only evaluated once.\n\nAn augmented assignment expression like ``x += 1`` can be rewritten as\n``x = x + 1`` to achieve a similar, but not exactly equal effect. In\nthe augmented version, ``x`` is only evaluated once. Also, when\npossible, the actual operation is performed *in-place*, meaning that\nrather than creating a new object and assigning that to the target,\nthe old object is modified instead.\n\nWith the exception of assigning to tuples and multiple targets in a\nsingle statement, the assignment done by augmented assignment\nstatements is handled the same way as normal assignments. Similarly,\nwith the exception of the possible *in-place* behavior, the binary\noperation performed by augmented assignment is the same as the normal\nbinary operations.\n\nFor targets which are attribute references, the initial value is\nretrieved with a ``getattr()`` and the result is assigned with a\n``setattr()``. Notice that the two methods do not necessarily refer\nto the same variable. When ``getattr()`` refers to a class variable,\n``setattr()`` still writes to an instance variable. For example:\n\n class A:\n x = 3 # class variable\n a = A()\n a.x += 1 # writes a.x as 4 leaving A.x as 3\n', - 'binary': u'\nBinary arithmetic operations\n****************************\n\nThe binary arithmetic operations have the conventional priority\nlevels. Note that some of these operations also apply to certain non-\nnumeric types. Apart from the power operator, there are only two\nlevels, one for multiplicative operators and one for additive\noperators:\n\n m_expr ::= u_expr | m_expr "*" u_expr | m_expr "//" u_expr | m_expr "/" u_expr\n | m_expr "%" u_expr\n a_expr ::= m_expr | a_expr "+" m_expr | a_expr "-" m_expr\n\nThe ``*`` (multiplication) operator yields the product of its\narguments. The arguments must either both be numbers, or one argument\nmust be an integer (plain or long) and the other must be a sequence.\nIn the former case, the numbers are converted to a common type and\nthen multiplied together. In the latter case, sequence repetition is\nperformed; a negative repetition factor yields an empty sequence.\n\nThe ``/`` (division) and ``//`` (floor division) operators yield the\nquotient of their arguments. The numeric arguments are first\nconverted to a common type. Plain or long integer division yields an\ninteger of the same type; the result is that of mathematical division\nwith the \'floor\' function applied to the result. Division by zero\nraises the ``ZeroDivisionError`` exception.\n\nThe ``%`` (modulo) operator yields the remainder from the division of\nthe first argument by the second. The numeric arguments are first\nconverted to a common type. A zero right argument raises the\n``ZeroDivisionError`` exception. The arguments may be floating point\nnumbers, e.g., ``3.14%0.7`` equals ``0.34`` (since ``3.14`` equals\n``4*0.7 + 0.34``.) The modulo operator always yields a result with\nthe same sign as its second operand (or zero); the absolute value of\nthe result is strictly smaller than the absolute value of the second\noperand [2].\n\nThe integer division and modulo operators are connected by the\nfollowing identity: ``x == (x/y)*y + (x%y)``. Integer division and\nmodulo are also connected with the built-in function ``divmod()``:\n``divmod(x, y) == (x/y, x%y)``. These identities don\'t hold for\nfloating point numbers; there similar identities hold approximately\nwhere ``x/y`` is replaced by ``floor(x/y)`` or ``floor(x/y) - 1`` [3].\n\nIn addition to performing the modulo operation on numbers, the ``%``\noperator is also overloaded by string and unicode objects to perform\nstring formatting (also known as interpolation). The syntax for string\nformatting is described in the Python Library Reference, section\n*String Formatting Operations*.\n\nDeprecated in version 2.3: The floor division operator, the modulo\noperator, and the ``divmod()`` function are no longer defined for\ncomplex numbers. Instead, convert to a floating point number using\nthe ``abs()`` function if appropriate.\n\nThe ``+`` (addition) operator yields the sum of its arguments. The\narguments must either both be numbers or both sequences of the same\ntype. In the former case, the numbers are converted to a common type\nand then added together. In the latter case, the sequences are\nconcatenated.\n\nThe ``-`` (subtraction) operator yields the difference of its\narguments. The numeric arguments are first converted to a common\ntype.\n', + 'augassign': u'\nAugmented assignment statements\n*******************************\n\nAugmented assignment is the combination, in a single statement, of a\nbinary operation and an assignment statement:\n\n augmented_assignment_stmt ::= target augop (expression_list | yield_expression)\n augop ::= "+=" | "-=" | "*=" | "/=" | "//=" | "%=" | "**="\n | ">>=" | "<<=" | "&=" | "^=" | "|="\n\n(See section *Primaries* for the syntax definitions for the last three\nsymbols.)\n\nAn augmented assignment evaluates the target (which, unlike normal\nassignment statements, cannot be an unpacking) and the expression\nlist, performs the binary operation specific to the type of assignment\non the two operands, and assigns the result to the original target.\nThe target is only evaluated once.\n\nAn augmented assignment expression like ``x += 1`` can be rewritten as\n``x = x + 1`` to achieve a similar, but not exactly equal effect. In\nthe augmented version, ``x`` is only evaluated once. Also, when\npossible, the actual operation is performed *in-place*, meaning that\nrather than creating a new object and assigning that to the target,\nthe old object is modified instead.\n\nWith the exception of assigning to tuples and multiple targets in a\nsingle statement, the assignment done by augmented assignment\nstatements is handled the same way as normal assignments. Similarly,\nwith the exception of the possible *in-place* behavior, the binary\noperation performed by augmented assignment is the same as the normal\nbinary operations.\n\nFor targets which are attribute references, the initial value is\nretrieved with a ``getattr()`` and the result is assigned with a\n``setattr()``. Notice that the two methods do not necessarily refer\nto the same variable. When ``getattr()`` refers to a class variable,\n``setattr()`` still writes to an instance variable. For example:\n\n class A:\n x = 3 # class variable\n a = A()\n a.x += 1 # writes a.x as 4 leaving A.x as 3\n', + 'binary': u'\nBinary arithmetic operations\n****************************\n\nThe binary arithmetic operations have the conventional priority\nlevels. Note that some of these operations also apply to certain non-\nnumeric types. Apart from the power operator, there are only two\nlevels, one for multiplicative operators and one for additive\noperators:\n\n m_expr ::= u_expr | m_expr "*" u_expr | m_expr "//" u_expr | m_expr "/" u_expr\n | m_expr "%" u_expr\n a_expr ::= m_expr | a_expr "+" m_expr | a_expr "-" m_expr\n\nThe ``*`` (multiplication) operator yields the product of its\narguments. The arguments must either both be numbers, or one argument\nmust be an integer (plain or long) and the other must be a sequence.\nIn the former case, the numbers are converted to a common type and\nthen multiplied together. In the latter case, sequence repetition is\nperformed; a negative repetition factor yields an empty sequence.\n\nThe ``/`` (division) and ``//`` (floor division) operators yield the\nquotient of their arguments. The numeric arguments are first\nconverted to a common type. Plain or long integer division yields an\ninteger of the same type; the result is that of mathematical division\nwith the \'floor\' function applied to the result. Division by zero\nraises the ``ZeroDivisionError`` exception.\n\nThe ``%`` (modulo) operator yields the remainder from the division of\nthe first argument by the second. The numeric arguments are first\nconverted to a common type. A zero right argument raises the\n``ZeroDivisionError`` exception. The arguments may be floating point\nnumbers, e.g., ``3.14%0.7`` equals ``0.34`` (since ``3.14`` equals\n``4*0.7 + 0.34``.) The modulo operator always yields a result with\nthe same sign as its second operand (or zero); the absolute value of\nthe result is strictly smaller than the absolute value of the second\noperand [2].\n\nThe integer division and modulo operators are connected by the\nfollowing identity: ``x == (x/y)*y + (x%y)``. Integer division and\nmodulo are also connected with the built-in function ``divmod()``:\n``divmod(x, y) == (x/y, x%y)``. These identities don\'t hold for\nfloating point numbers; there similar identities hold approximately\nwhere ``x/y`` is replaced by ``floor(x/y)`` or ``floor(x/y) - 1`` [3].\n\nIn addition to performing the modulo operation on numbers, the ``%``\noperator is also overloaded by string and unicode objects to perform\nstring formatting (also known as interpolation). The syntax for string\nformatting is described in the Python Library Reference, section\n*String Formatting Operations*.\n\nDeprecated since version 2.3: The floor division operator, the modulo\noperator, and the ``divmod()`` function are no longer defined for\ncomplex numbers. Instead, convert to a floating point number using\nthe ``abs()`` function if appropriate.\n\nThe ``+`` (addition) operator yields the sum of its arguments. The\narguments must either both be numbers or both sequences of the same\ntype. In the former case, the numbers are converted to a common type\nand then added together. In the latter case, the sequences are\nconcatenated.\n\nThe ``-`` (subtraction) operator yields the difference of its\narguments. The numeric arguments are first converted to a common\ntype.\n', 'bitwise': u'\nBinary bitwise operations\n*************************\n\nEach of the three bitwise operations has a different priority level:\n\n and_expr ::= shift_expr | and_expr "&" shift_expr\n xor_expr ::= and_expr | xor_expr "^" and_expr\n or_expr ::= xor_expr | or_expr "|" xor_expr\n\nThe ``&`` operator yields the bitwise AND of its arguments, which must\nbe plain or long integers. The arguments are converted to a common\ntype.\n\nThe ``^`` operator yields the bitwise XOR (exclusive OR) of its\narguments, which must be plain or long integers. The arguments are\nconverted to a common type.\n\nThe ``|`` operator yields the bitwise (inclusive) OR of its arguments,\nwhich must be plain or long integers. The arguments are converted to\na common type.\n', 'bltin-code-objects': u'\nCode Objects\n************\n\nCode objects are used by the implementation to represent "pseudo-\ncompiled" executable Python code such as a function body. They differ\nfrom function objects because they don\'t contain a reference to their\nglobal execution environment. Code objects are returned by the built-\nin ``compile()`` function and can be extracted from function objects\nthrough their ``func_code`` attribute. See also the ``code`` module.\n\nA code object can be executed or evaluated by passing it (instead of a\nsource string) to the ``exec`` statement or the built-in ``eval()``\nfunction.\n\nSee *The standard type hierarchy* for more information.\n', 'bltin-ellipsis-object': u'\nThe Ellipsis Object\n*******************\n\nThis object is used by extended slice notation (see *Slicings*). It\nsupports no special operations. There is exactly one ellipsis object,\nnamed ``Ellipsis`` (a built-in name).\n\nIt is written as ``Ellipsis``.\n', - 'bltin-file-objects': u'\nFile Objects\n************\n\nFile objects are implemented using C\'s ``stdio`` package and can be\ncreated with the built-in ``open()`` function. File objects are also\nreturned by some other built-in functions and methods, such as\n``os.popen()`` and ``os.fdopen()`` and the ``makefile()`` method of\nsocket objects. Temporary files can be created using the ``tempfile``\nmodule, and high-level file operations such as copying, moving, and\ndeleting files and directories can be achieved with the ``shutil``\nmodule.\n\nWhen a file operation fails for an I/O-related reason, the exception\n``IOError`` is raised. This includes situations where the operation\nis not defined for some reason, like ``seek()`` on a tty device or\nwriting a file opened for reading.\n\nFiles have the following methods:\n\nfile.close()\n\n Close the file. A closed file cannot be read or written any more.\n Any operation which requires that the file be open will raise a\n ``ValueError`` after the file has been closed. Calling ``close()``\n more than once is allowed.\n\n As of Python 2.5, you can avoid having to call this method\n explicitly if you use the ``with`` statement. For example, the\n following code will automatically close *f* when the ``with`` block\n is exited:\n\n from __future__ import with_statement\n\n with open("hello.txt") as f:\n for line in f:\n print line\n\n In older versions of Python, you would have needed to do this to\n get the same effect:\n\n f = open("hello.txt")\n try:\n for line in f:\n print line\n finally:\n f.close()\n\n Note: Not all "file-like" types in Python support use as a context\n manager for the ``with`` statement. If your code is intended to\n work with any file-like object, you can use the function\n ``contextlib.closing()`` instead of using the object directly.\n\nfile.flush()\n\n Flush the internal buffer, like ``stdio``\'s ``fflush``. This may\n be a no-op on some file-like objects.\n\nfile.fileno()\n\n Return the integer "file descriptor" that is used by the underlying\n implementation to request I/O operations from the operating system.\n This can be useful for other, lower level interfaces that use file\n descriptors, such as the ``fcntl`` module or ``os.read()`` and\n friends.\n\n Note: File-like objects which do not have a real file descriptor should\n *not* provide this method!\n\nfile.isatty()\n\n Return ``True`` if the file is connected to a tty(-like) device,\n else ``False``.\n\n Note: If a file-like object is not associated with a real file, this\n method should *not* be implemented.\n\nfile.next()\n\n A file object is its own iterator, for example ``iter(f)`` returns\n *f* (unless *f* is closed). When a file is used as an iterator,\n typically in a ``for`` loop (for example, ``for line in f: print\n line``), the ``next()`` method is called repeatedly. This method\n returns the next input line, or raises ``StopIteration`` when EOF\n is hit when the file is open for reading (behavior is undefined\n when the file is open for writing). In order to make a ``for``\n loop the most efficient way of looping over the lines of a file (a\n very common operation), the ``next()`` method uses a hidden read-\n ahead buffer. As a consequence of using a read-ahead buffer,\n combining ``next()`` with other file methods (like ``readline()``)\n does not work right. However, using ``seek()`` to reposition the\n file to an absolute position will flush the read-ahead buffer.\n\n Added in version 2.3.\n\nfile.read([size])\n\n Read at most *size* bytes from the file (less if the read hits EOF\n before obtaining *size* bytes). If the *size* argument is negative\n or omitted, read all data until EOF is reached. The bytes are\n returned as a string object. An empty string is returned when EOF\n is encountered immediately. (For certain files, like ttys, it\n makes sense to continue reading after an EOF is hit.) Note that\n this method may call the underlying C function ``fread`` more than\n once in an effort to acquire as close to *size* bytes as possible.\n Also note that when in non-blocking mode, less data than what was\n requested may be returned, even if no *size* parameter was given.\n\nfile.readline([size])\n\n Read one entire line from the file. A trailing newline character\n is kept in the string (but may be absent when a file ends with an\n incomplete line). [6] If the *size* argument is present and non-\n negative, it is a maximum byte count (including the trailing\n newline) and an incomplete line may be returned. An empty string is\n returned *only* when EOF is encountered immediately.\n\n Note: Unlike ``stdio``\'s ``fgets``, the returned string contains null\n characters (``\'\\0\'``) if they occurred in the input.\n\nfile.readlines([sizehint])\n\n Read until EOF using ``readline()`` and return a list containing\n the lines thus read. If the optional *sizehint* argument is\n present, instead of reading up to EOF, whole lines totalling\n approximately *sizehint* bytes (possibly after rounding up to an\n internal buffer size) are read. Objects implementing a file-like\n interface may choose to ignore *sizehint* if it cannot be\n implemented, or cannot be implemented efficiently.\n\nfile.xreadlines()\n\n This method returns the same thing as ``iter(f)``.\n\n Added in version 2.1.\n\n Deprecated in version 2.3: Use ``for line in file`` instead.\n\nfile.seek(offset[, whence])\n\n Set the file\'s current position, like ``stdio``\'s ``fseek``. The\n *whence* argument is optional and defaults to ``os.SEEK_SET`` or\n ``0`` (absolute file positioning); other values are ``os.SEEK_CUR``\n or ``1`` (seek relative to the current position) and\n ``os.SEEK_END`` or ``2`` (seek relative to the file\'s end). There\n is no return value.\n\n For example, ``f.seek(2, os.SEEK_CUR)`` advances the position by\n two and ``f.seek(-3, os.SEEK_END)`` sets the position to the third\n to last.\n\n Note that if the file is opened for appending (mode ``\'a\'`` or\n ``\'a+\'``), any ``seek()`` operations will be undone at the next\n write. If the file is only opened for writing in append mode (mode\n ``\'a\'``), this method is essentially a no-op, but it remains useful\n for files opened in append mode with reading enabled (mode\n ``\'a+\'``). If the file is opened in text mode (without ``\'b\'``),\n only offsets returned by ``tell()`` are legal. Use of other\n offsets causes undefined behavior.\n\n Note that not all file objects are seekable.\n\n Changed in version 2.6: Passing float values as offset has been\n deprecated.\n\nfile.tell()\n\n Return the file\'s current position, like ``stdio``\'s ``ftell``.\n\n Note: On Windows, ``tell()`` can return illegal values (after an\n ``fgets``) when reading files with Unix-style line-endings. Use\n binary mode (``\'rb\'``) to circumvent this problem.\n\nfile.truncate([size])\n\n Truncate the file\'s size. If the optional *size* argument is\n present, the file is truncated to (at most) that size. The size\n defaults to the current position. The current file position is not\n changed. Note that if a specified size exceeds the file\'s current\n size, the result is platform-dependent: possibilities include that\n the file may remain unchanged, increase to the specified size as if\n zero-filled, or increase to the specified size with undefined new\n content. Availability: Windows, many Unix variants.\n\nfile.write(str)\n\n Write a string to the file. There is no return value. Due to\n buffering, the string may not actually show up in the file until\n the ``flush()`` or ``close()`` method is called.\n\nfile.writelines(sequence)\n\n Write a sequence of strings to the file. The sequence can be any\n iterable object producing strings, typically a list of strings.\n There is no return value. (The name is intended to match\n ``readlines()``; ``writelines()`` does not add line separators.)\n\nFiles support the iterator protocol. Each iteration returns the same\nresult as ``file.readline()``, and iteration ends when the\n``readline()`` method returns an empty string.\n\nFile objects also offer a number of other interesting attributes.\nThese are not required for file-like objects, but should be\nimplemented if they make sense for the particular object.\n\nfile.closed\n\n bool indicating the current state of the file object. This is a\n read-only attribute; the ``close()`` method changes the value. It\n may not be available on all file-like objects.\n\nfile.encoding\n\n The encoding that this file uses. When Unicode strings are written\n to a file, they will be converted to byte strings using this\n encoding. In addition, when the file is connected to a terminal,\n the attribute gives the encoding that the terminal is likely to use\n (that information might be incorrect if the user has misconfigured\n the terminal). The attribute is read-only and may not be present\n on all file-like objects. It may also be ``None``, in which case\n the file uses the system default encoding for converting Unicode\n strings.\n\n Added in version 2.3.\n\nfile.errors\n\n The Unicode error handler used to along with the encoding.\n\n Added in version 2.6.\n\nfile.mode\n\n The I/O mode for the file. If the file was created using the\n ``open()`` built-in function, this will be the value of the *mode*\n parameter. This is a read-only attribute and may not be present on\n all file-like objects.\n\nfile.name\n\n If the file object was created using ``open()``, the name of the\n file. Otherwise, some string that indicates the source of the file\n object, of the form ``<...>``. This is a read-only attribute and\n may not be present on all file-like objects.\n\nfile.newlines\n\n If Python was built with the *--with-universal-newlines* option to\n **configure** (the default) this read-only attribute exists, and\n for files opened in universal newline read mode it keeps track of\n the types of newlines encountered while reading the file. The\n values it can take are ``\'\\r\'``, ``\'\\n\'``, ``\'\\r\\n\'``, ``None``\n (unknown, no newlines read yet) or a tuple containing all the\n newline types seen, to indicate that multiple newline conventions\n were encountered. For files not opened in universal newline read\n mode the value of this attribute will be ``None``.\n\nfile.softspace\n\n Boolean that indicates whether a space character needs to be\n printed before another value when using the ``print`` statement.\n Classes that are trying to simulate a file object should also have\n a writable ``softspace`` attribute, which should be initialized to\n zero. This will be automatic for most classes implemented in\n Python (care may be needed for objects that override attribute\n access); types implemented in C will have to provide a writable\n ``softspace`` attribute.\n\n Note: This attribute is not used to control the ``print`` statement,\n but to allow the implementation of ``print`` to keep track of its\n internal state.\n', + 'bltin-file-objects': u'\nFile Objects\n************\n\nFile objects are implemented using C\'s ``stdio`` package and can be\ncreated with the built-in ``open()`` function. File objects are also\nreturned by some other built-in functions and methods, such as\n``os.popen()`` and ``os.fdopen()`` and the ``makefile()`` method of\nsocket objects. Temporary files can be created using the ``tempfile``\nmodule, and high-level file operations such as copying, moving, and\ndeleting files and directories can be achieved with the ``shutil``\nmodule.\n\nWhen a file operation fails for an I/O-related reason, the exception\n``IOError`` is raised. This includes situations where the operation\nis not defined for some reason, like ``seek()`` on a tty device or\nwriting a file opened for reading.\n\nFiles have the following methods:\n\nfile.close()\n\n Close the file. A closed file cannot be read or written any more.\n Any operation which requires that the file be open will raise a\n ``ValueError`` after the file has been closed. Calling ``close()``\n more than once is allowed.\n\n As of Python 2.5, you can avoid having to call this method\n explicitly if you use the ``with`` statement. For example, the\n following code will automatically close *f* when the ``with`` block\n is exited:\n\n from __future__ import with_statement # This isn\'t required in Python 2.6\n\n with open("hello.txt") as f:\n for line in f:\n print line\n\n In older versions of Python, you would have needed to do this to\n get the same effect:\n\n f = open("hello.txt")\n try:\n for line in f:\n print line\n finally:\n f.close()\n\n Note: Not all "file-like" types in Python support use as a context\n manager for the ``with`` statement. If your code is intended to\n work with any file-like object, you can use the function\n ``contextlib.closing()`` instead of using the object directly.\n\nfile.flush()\n\n Flush the internal buffer, like ``stdio``\'s ``fflush``. This may\n be a no-op on some file-like objects.\n\nfile.fileno()\n\n Return the integer "file descriptor" that is used by the underlying\n implementation to request I/O operations from the operating system.\n This can be useful for other, lower level interfaces that use file\n descriptors, such as the ``fcntl`` module or ``os.read()`` and\n friends.\n\n Note: File-like objects which do not have a real file descriptor should\n *not* provide this method!\n\nfile.isatty()\n\n Return ``True`` if the file is connected to a tty(-like) device,\n else ``False``.\n\n Note: If a file-like object is not associated with a real file, this\n method should *not* be implemented.\n\nfile.next()\n\n A file object is its own iterator, for example ``iter(f)`` returns\n *f* (unless *f* is closed). When a file is used as an iterator,\n typically in a ``for`` loop (for example, ``for line in f: print\n line``), the ``next()`` method is called repeatedly. This method\n returns the next input line, or raises ``StopIteration`` when EOF\n is hit when the file is open for reading (behavior is undefined\n when the file is open for writing). In order to make a ``for``\n loop the most efficient way of looping over the lines of a file (a\n very common operation), the ``next()`` method uses a hidden read-\n ahead buffer. As a consequence of using a read-ahead buffer,\n combining ``next()`` with other file methods (like ``readline()``)\n does not work right. However, using ``seek()`` to reposition the\n file to an absolute position will flush the read-ahead buffer.\n\n New in version 2.3.\n\nfile.read([size])\n\n Read at most *size* bytes from the file (less if the read hits EOF\n before obtaining *size* bytes). If the *size* argument is negative\n or omitted, read all data until EOF is reached. The bytes are\n returned as a string object. An empty string is returned when EOF\n is encountered immediately. (For certain files, like ttys, it\n makes sense to continue reading after an EOF is hit.) Note that\n this method may call the underlying C function ``fread`` more than\n once in an effort to acquire as close to *size* bytes as possible.\n Also note that when in non-blocking mode, less data than was\n requested may be returned, even if no *size* parameter was given.\n\n Note: This function is simply a wrapper for the underlying ``fread`` C\n function, and will behave the same in corner cases, such as\n whether the EOF value is cached.\n\nfile.readline([size])\n\n Read one entire line from the file. A trailing newline character\n is kept in the string (but may be absent when a file ends with an\n incomplete line). [6] If the *size* argument is present and non-\n negative, it is a maximum byte count (including the trailing\n newline) and an incomplete line may be returned. An empty string is\n returned *only* when EOF is encountered immediately.\n\n Note: Unlike ``stdio``\'s ``fgets``, the returned string contains null\n characters (``\'\\0\'``) if they occurred in the input.\n\nfile.readlines([sizehint])\n\n Read until EOF using ``readline()`` and return a list containing\n the lines thus read. If the optional *sizehint* argument is\n present, instead of reading up to EOF, whole lines totalling\n approximately *sizehint* bytes (possibly after rounding up to an\n internal buffer size) are read. Objects implementing a file-like\n interface may choose to ignore *sizehint* if it cannot be\n implemented, or cannot be implemented efficiently.\n\nfile.xreadlines()\n\n This method returns the same thing as ``iter(f)``.\n\n New in version 2.1.\n\n Deprecated since version 2.3: Use ``for line in file`` instead.\n\nfile.seek(offset[, whence])\n\n Set the file\'s current position, like ``stdio``\'s ``fseek``. The\n *whence* argument is optional and defaults to ``os.SEEK_SET`` or\n ``0`` (absolute file positioning); other values are ``os.SEEK_CUR``\n or ``1`` (seek relative to the current position) and\n ``os.SEEK_END`` or ``2`` (seek relative to the file\'s end). There\n is no return value.\n\n For example, ``f.seek(2, os.SEEK_CUR)`` advances the position by\n two and ``f.seek(-3, os.SEEK_END)`` sets the position to the third\n to last.\n\n Note that if the file is opened for appending (mode ``\'a\'`` or\n ``\'a+\'``), any ``seek()`` operations will be undone at the next\n write. If the file is only opened for writing in append mode (mode\n ``\'a\'``), this method is essentially a no-op, but it remains useful\n for files opened in append mode with reading enabled (mode\n ``\'a+\'``). If the file is opened in text mode (without ``\'b\'``),\n only offsets returned by ``tell()`` are legal. Use of other\n offsets causes undefined behavior.\n\n Note that not all file objects are seekable.\n\n Changed in version 2.6: Passing float values as offset has been\n deprecated.\n\nfile.tell()\n\n Return the file\'s current position, like ``stdio``\'s ``ftell``.\n\n Note: On Windows, ``tell()`` can return illegal values (after an\n ``fgets``) when reading files with Unix-style line-endings. Use\n binary mode (``\'rb\'``) to circumvent this problem.\n\nfile.truncate([size])\n\n Truncate the file\'s size. If the optional *size* argument is\n present, the file is truncated to (at most) that size. The size\n defaults to the current position. The current file position is not\n changed. Note that if a specified size exceeds the file\'s current\n size, the result is platform-dependent: possibilities include that\n the file may remain unchanged, increase to the specified size as if\n zero-filled, or increase to the specified size with undefined new\n content. Availability: Windows, many Unix variants.\n\nfile.write(str)\n\n Write a string to the file. There is no return value. Due to\n buffering, the string may not actually show up in the file until\n the ``flush()`` or ``close()`` method is called.\n\nfile.writelines(sequence)\n\n Write a sequence of strings to the file. The sequence can be any\n iterable object producing strings, typically a list of strings.\n There is no return value. (The name is intended to match\n ``readlines()``; ``writelines()`` does not add line separators.)\n\nFiles support the iterator protocol. Each iteration returns the same\nresult as ``file.readline()``, and iteration ends when the\n``readline()`` method returns an empty string.\n\nFile objects also offer a number of other interesting attributes.\nThese are not required for file-like objects, but should be\nimplemented if they make sense for the particular object.\n\nfile.closed\n\n bool indicating the current state of the file object. This is a\n read-only attribute; the ``close()`` method changes the value. It\n may not be available on all file-like objects.\n\nfile.encoding\n\n The encoding that this file uses. When Unicode strings are written\n to a file, they will be converted to byte strings using this\n encoding. In addition, when the file is connected to a terminal,\n the attribute gives the encoding that the terminal is likely to use\n (that information might be incorrect if the user has misconfigured\n the terminal). The attribute is read-only and may not be present\n on all file-like objects. It may also be ``None``, in which case\n the file uses the system default encoding for converting Unicode\n strings.\n\n New in version 2.3.\n\nfile.errors\n\n The Unicode error handler used along with the encoding.\n\n New in version 2.6.\n\nfile.mode\n\n The I/O mode for the file. If the file was created using the\n ``open()`` built-in function, this will be the value of the *mode*\n parameter. This is a read-only attribute and may not be present on\n all file-like objects.\n\nfile.name\n\n If the file object was created using ``open()``, the name of the\n file. Otherwise, some string that indicates the source of the file\n object, of the form ``<...>``. This is a read-only attribute and\n may not be present on all file-like objects.\n\nfile.newlines\n\n If Python was built with the *--with-universal-newlines* option to\n **configure** (the default) this read-only attribute exists, and\n for files opened in universal newline read mode it keeps track of\n the types of newlines encountered while reading the file. The\n values it can take are ``\'\\r\'``, ``\'\\n\'``, ``\'\\r\\n\'``, ``None``\n (unknown, no newlines read yet) or a tuple containing all the\n newline types seen, to indicate that multiple newline conventions\n were encountered. For files not opened in universal newline read\n mode the value of this attribute will be ``None``.\n\nfile.softspace\n\n Boolean that indicates whether a space character needs to be\n printed before another value when using the ``print`` statement.\n Classes that are trying to simulate a file object should also have\n a writable ``softspace`` attribute, which should be initialized to\n zero. This will be automatic for most classes implemented in\n Python (care may be needed for objects that override attribute\n access); types implemented in C will have to provide a writable\n ``softspace`` attribute.\n\n Note: This attribute is not used to control the ``print`` statement,\n but to allow the implementation of ``print`` to keep track of its\n internal state.\n', 'bltin-null-object': u"\nThe Null Object\n***************\n\nThis object is returned by functions that don't explicitly return a\nvalue. It supports no special operations. There is exactly one null\nobject, named ``None`` (a built-in name).\n\nIt is written as ``None``.\n", 'bltin-type-objects': u"\nType Objects\n************\n\nType objects represent the various object types. An object's type is\naccessed by the built-in function ``type()``. There are no special\noperations on types. The standard module ``types`` defines names for\nall standard built-in types.\n\nTypes are written like this: ````.\n", - 'booleans': u'\nBoolean operations\n******************\n\nBoolean operations have the lowest priority of all Python operations:\n\n expression ::= conditional_expression | lambda_form\n old_expression ::= or_test | old_lambda_form\n conditional_expression ::= or_test ["if" or_test "else" expression]\n or_test ::= and_test | or_test "or" and_test\n and_test ::= not_test | and_test "and" not_test\n not_test ::= comparison | "not" not_test\n\nIn the context of Boolean operations, and also when expressions are\nused by control flow statements, the following values are interpreted\nas false: ``False``, ``None``, numeric zero of all types, and empty\nstrings and containers (including strings, tuples, lists,\ndictionaries, sets and frozensets). All other values are interpreted\nas true.\n\nThe operator ``not`` yields ``True`` if its argument is false,\n``False`` otherwise.\n\nThe expression ``x if C else y`` first evaluates *C* (*not* *x*); if\n*C* is true, *x* is evaluated and its value is returned; otherwise,\n*y* is evaluated and its value is returned.\n\nAdded in version 2.5.\n\nThe expression ``x and y`` first evaluates *x*; if *x* is false, its\nvalue is returned; otherwise, *y* is evaluated and the resulting value\nis returned.\n\nThe expression ``x or y`` first evaluates *x*; if *x* is true, its\nvalue is returned; otherwise, *y* is evaluated and the resulting value\nis returned.\n\n(Note that neither ``and`` nor ``or`` restrict the value and type they\nreturn to ``False`` and ``True``, but rather return the last evaluated\nargument. This is sometimes useful, e.g., if ``s`` is a string that\nshould be replaced by a default value if it is empty, the expression\n``s or \'foo\'`` yields the desired value. Because ``not`` has to\ninvent a value anyway, it does not bother to return a value of the\nsame type as its argument, so e.g., ``not \'foo\'`` yields ``False``,\nnot ``\'\'``.)\n', + 'booleans': u'\nBoolean operations\n******************\n\nBoolean operations have the lowest priority of all Python operations:\n\n expression ::= conditional_expression | lambda_form\n old_expression ::= or_test | old_lambda_form\n conditional_expression ::= or_test ["if" or_test "else" expression]\n or_test ::= and_test | or_test "or" and_test\n and_test ::= not_test | and_test "and" not_test\n not_test ::= comparison | "not" not_test\n\nIn the context of Boolean operations, and also when expressions are\nused by control flow statements, the following values are interpreted\nas false: ``False``, ``None``, numeric zero of all types, and empty\nstrings and containers (including strings, tuples, lists,\ndictionaries, sets and frozensets). All other values are interpreted\nas true. (See the ``__nonzero__()`` special method for a way to\nchange this.)\n\nThe operator ``not`` yields ``True`` if its argument is false,\n``False`` otherwise.\n\nThe expression ``x if C else y`` first evaluates *C* (*not* *x*); if\n*C* is true, *x* is evaluated and its value is returned; otherwise,\n*y* is evaluated and its value is returned.\n\nNew in version 2.5.\n\nThe expression ``x and y`` first evaluates *x*; if *x* is false, its\nvalue is returned; otherwise, *y* is evaluated and the resulting value\nis returned.\n\nThe expression ``x or y`` first evaluates *x*; if *x* is true, its\nvalue is returned; otherwise, *y* is evaluated and the resulting value\nis returned.\n\n(Note that neither ``and`` nor ``or`` restrict the value and type they\nreturn to ``False`` and ``True``, but rather return the last evaluated\nargument. This is sometimes useful, e.g., if ``s`` is a string that\nshould be replaced by a default value if it is empty, the expression\n``s or \'foo\'`` yields the desired value. Because ``not`` has to\ninvent a value anyway, it does not bother to return a value of the\nsame type as its argument, so e.g., ``not \'foo\'`` yields ``False``,\nnot ``\'\'``.)\n', 'break': u'\nThe ``break`` statement\n***********************\n\n break_stmt ::= "break"\n\n``break`` may only occur syntactically nested in a ``for`` or\n``while`` loop, but not nested in a function or class definition\nwithin that loop.\n\nIt terminates the nearest enclosing loop, skipping the optional\n``else`` clause if the loop has one.\n\nIf a ``for`` loop is terminated by ``break``, the loop control target\nkeeps its current value.\n\nWhen ``break`` passes control out of a ``try`` statement with a\n``finally`` clause, that ``finally`` clause is executed before really\nleaving the loop.\n', 'callable-types': u'\nEmulating callable objects\n**************************\n\nobject.__call__(self[, args...])\n\n Called when the instance is "called" as a function; if this method\n is defined, ``x(arg1, arg2, ...)`` is a shorthand for\n ``x.__call__(arg1, arg2, ...)``.\n', - 'calls': u'\nCalls\n*****\n\nA call calls a callable object (e.g., a function) with a possibly\nempty series of arguments:\n\n call ::= primary "(" [argument_list [","]\n | expression genexpr_for] ")"\n argument_list ::= positional_arguments ["," keyword_arguments]\n ["," "*" expression]\n ["," "**" expression]\n | keyword_arguments ["," "*" expression]\n ["," "**" expression]\n | "*" expression ["," "**" expression]\n | "**" expression\n positional_arguments ::= expression ("," expression)*\n keyword_arguments ::= keyword_item ("," keyword_item)*\n keyword_item ::= identifier "=" expression\n\nA trailing comma may be present after the positional and keyword\narguments but does not affect the semantics.\n\nThe primary must evaluate to a callable object (user-defined\nfunctions, built-in functions, methods of built-in objects, class\nobjects, methods of class instances, and certain class instances\nthemselves are callable; extensions may define additional callable\nobject types). All argument expressions are evaluated before the call\nis attempted. Please refer to section *Function definitions* for the\nsyntax of formal parameter lists.\n\nIf keyword arguments are present, they are first converted to\npositional arguments, as follows. First, a list of unfilled slots is\ncreated for the formal parameters. If there are N positional\narguments, they are placed in the first N slots. Next, for each\nkeyword argument, the identifier is used to determine the\ncorresponding slot (if the identifier is the same as the first formal\nparameter name, the first slot is used, and so on). If the slot is\nalready filled, a ``TypeError`` exception is raised. Otherwise, the\nvalue of the argument is placed in the slot, filling it (even if the\nexpression is ``None``, it fills the slot). When all arguments have\nbeen processed, the slots that are still unfilled are filled with the\ncorresponding default value from the function definition. (Default\nvalues are calculated, once, when the function is defined; thus, a\nmutable object such as a list or dictionary used as default value will\nbe shared by all calls that don\'t specify an argument value for the\ncorresponding slot; this should usually be avoided.) If there are any\nunfilled slots for which no default value is specified, a\n``TypeError`` exception is raised. Otherwise, the list of filled\nslots is used as the argument list for the call.\n\nNote: An implementation may provide builtin functions whose positional\n parameters do not have names, even if they are \'named\' for the\n purpose of documentation, and which therefore cannot be supplied by\n keyword. In CPython, this is the case for functions implemented in\n C that use ``PyArg_ParseTuple`` to parse their arguments.\n\nIf there are more positional arguments than there are formal parameter\nslots, a ``TypeError`` exception is raised, unless a formal parameter\nusing the syntax ``*identifier`` is present; in this case, that formal\nparameter receives a tuple containing the excess positional arguments\n(or an empty tuple if there were no excess positional arguments).\n\nIf any keyword argument does not correspond to a formal parameter\nname, a ``TypeError`` exception is raised, unless a formal parameter\nusing the syntax ``**identifier`` is present; in this case, that\nformal parameter receives a dictionary containing the excess keyword\narguments (using the keywords as keys and the argument values as\ncorresponding values), or a (new) empty dictionary if there were no\nexcess keyword arguments.\n\nIf the syntax ``*expression`` appears in the function call,\n``expression`` must evaluate to a sequence. Elements from this\nsequence are treated as if they were additional positional arguments;\nif there are positional arguments *x1*,...,*xN* , and ``expression``\nevaluates to a sequence *y1*,...,*yM*, this is equivalent to a call\nwith M+N positional arguments *x1*,...,*xN*,*y1*,...,*yM*.\n\nA consequence of this is that although the ``*expression`` syntax\nappears *after* any keyword arguments, it is processed *before* the\nkeyword arguments (and the ``**expression`` argument, if any -- see\nbelow). So:\n\n >>> def f(a, b):\n ... print a, b\n ...\n >>> f(b=1, *(2,))\n 2 1\n >>> f(a=1, *(2,))\n Traceback (most recent call last):\n File "", line 1, in ?\n TypeError: f() got multiple values for keyword argument \'a\'\n >>> f(1, *(2,))\n 1 2\n\nIt is unusual for both keyword arguments and the ``*expression``\nsyntax to be used in the same call, so in practice this confusion does\nnot arise.\n\nIf the syntax ``**expression`` appears in the function call,\n``expression`` must evaluate to a mapping, the contents of which are\ntreated as additional keyword arguments. In the case of a keyword\nappearing in both ``expression`` and as an explicit keyword argument,\na ``TypeError`` exception is raised.\n\nFormal parameters using the syntax ``*identifier`` or ``**identifier``\ncannot be used as positional argument slots or as keyword argument\nnames. Formal parameters using the syntax ``(sublist)`` cannot be\nused as keyword argument names; the outermost sublist corresponds to a\nsingle unnamed argument slot, and the argument value is assigned to\nthe sublist using the usual tuple assignment rules after all other\nparameter processing is done.\n\nA call always returns some value, possibly ``None``, unless it raises\nan exception. How this value is computed depends on the type of the\ncallable object.\n\nIf it is---\n\na user-defined function:\n The code block for the function is executed, passing it the\n argument list. The first thing the code block will do is bind the\n formal parameters to the arguments; this is described in section\n *Function definitions*. When the code block executes a ``return``\n statement, this specifies the return value of the function call.\n\na built-in function or method:\n The result is up to the interpreter; see *Built-in Functions* for\n the descriptions of built-in functions and methods.\n\na class object:\n A new instance of that class is returned.\n\na class instance method:\n The corresponding user-defined function is called, with an argument\n list that is one longer than the argument list of the call: the\n instance becomes the first argument.\n\na class instance:\n The class must define a ``__call__()`` method; the effect is then\n the same as if that method was called.\n', - 'class': u'\nClass definitions\n*****************\n\nA class definition defines a class object (see section *The standard\ntype hierarchy*):\n\n classdef ::= "class" classname [inheritance] ":" suite\n inheritance ::= "(" [expression_list] ")"\n classname ::= identifier\n\nA class definition is an executable statement. It first evaluates the\ninheritance list, if present. Each item in the inheritance list\nshould evaluate to a class object or class type which allows\nsubclassing. The class\'s suite is then executed in a new execution\nframe (see section *Naming and binding*), using a newly created local\nnamespace and the original global namespace. (Usually, the suite\ncontains only function definitions.) When the class\'s suite finishes\nexecution, its execution frame is discarded but its local namespace is\nsaved. A class object is then created using the inheritance list for\nthe base classes and the saved local namespace for the attribute\ndictionary. The class name is bound to this class object in the\noriginal local namespace.\n\n**Programmer\'s note:** Variables defined in the class definition are\nclass variables; they are shared by all instances. To create instance\nvariables, they can be set in a method with ``self.name = value``.\nBoth class and instance variables are accessible through the notation\n"``self.name``", and an instance variable hides a class variable with\nthe same name when accessed in this way. Class variables can be used\nas defaults for instance variables, but using mutable values there can\nlead to unexpected results. For *new-style class*es, descriptors can\nbe used to create instance variables with different implementation\ndetails.\n\nClass definitions, like function definitions, may be wrapped by one or\nmore *decorator* expressions. The evaluation rules for the decorator\nexpressions are the same as for functions. The result must be a class\nobject, which is then bound to the class name.\n\n-[ Footnotes ]-\n\n[1] The exception is propagated to the invocation stack only if there\n is no ``finally`` clause that negates the exception.\n\n[2] Currently, control "flows off the end" except in the case of an\n exception or the execution of a ``return``, ``continue``, or\n ``break`` statement.\n', - 'coercion-rules': u"\nCoercion rules\n**************\n\nThis section used to document the rules for coercion. As the language\nhas evolved, the coercion rules have become hard to document\nprecisely; documenting what one version of one particular\nimplementation does is undesirable. Instead, here are some informal\nguidelines regarding coercion. In Python 3.0, coercion will not be\nsupported.\n\n* If the left operand of a % operator is a string or Unicode object,\n no coercion takes place and the string formatting operation is\n invoked instead.\n\n* It is no longer recommended to define a coercion operation. Mixed-\n mode operations on types that don't define coercion pass the\n original arguments to the operation.\n\n* New-style classes (those derived from ``object``) never invoke the\n ``__coerce__()`` method in response to a binary operator; the only\n time ``__coerce__()`` is invoked is when the built-in function\n ``coerce()`` is called.\n\n* For most intents and purposes, an operator that returns\n ``NotImplemented`` is treated the same as one that is not\n implemented at all.\n\n* Below, ``__op__()`` and ``__rop__()`` are used to signify the\n generic method names corresponding to an operator; ``__iop__()`` is\n used for the corresponding in-place operator. For example, for the\n operator '``+``', ``__add__()`` and ``__radd__()`` are used for the\n left and right variant of the binary operator, and ``__iadd__()``\n for the in-place variant.\n\n* For objects *x* and *y*, first ``x.__op__(y)`` is tried. If this is\n not implemented or returns ``NotImplemented``, ``y.__rop__(x)`` is\n tried. If this is also not implemented or returns\n ``NotImplemented``, a ``TypeError`` exception is raised. But see\n the following exception:\n\n* Exception to the previous item: if the left operand is an instance\n of a built-in type or a new-style class, and the right operand is an\n instance of a proper subclass of that type or class and overrides\n the base's ``__rop__()`` method, the right operand's ``__rop__()``\n method is tried *before* the left operand's ``__op__()`` method.\n\n This is done so that a subclass can completely override binary\n operators. Otherwise, the left operand's ``__op__()`` method would\n always accept the right operand: when an instance of a given class\n is expected, an instance of a subclass of that class is always\n acceptable.\n\n* When either operand type defines a coercion, this coercion is called\n before that type's ``__op__()`` or ``__rop__()`` method is called,\n but no sooner. If the coercion returns an object of a different\n type for the operand whose coercion is invoked, part of the process\n is redone using the new object.\n\n* When an in-place operator (like '``+=``') is used, if the left\n operand implements ``__iop__()``, it is invoked without any\n coercion. When the operation falls back to ``__op__()`` and/or\n ``__rop__()``, the normal coercion rules apply.\n\n* In *x*``+``*y*, if *x* is a sequence that implements sequence\n concatenation, sequence concatenation is invoked.\n\n* In *x*``*``*y*, if one operator is a sequence that implements\n sequence repetition, and the other is an integer (``int`` or\n ``long``), sequence repetition is invoked.\n\n* Rich comparisons (implemented by methods ``__eq__()`` and so on)\n never use coercion. Three-way comparison (implemented by\n ``__cmp__()``) does use coercion under the same conditions as other\n binary operations use it.\n\n* In the current implementation, the built-in numeric types ``int``,\n ``long`` and ``float`` do not use coercion; the type ``complex``\n however does use it. The difference can become apparent when\n subclassing these types. Over time, the type ``complex`` may be\n fixed to avoid coercion. All these types implement a\n ``__coerce__()`` method, for use by the built-in ``coerce()``\n function.\n", - 'comparisons': u'\nComparisons\n***********\n\nUnlike C, all comparison operations in Python have the same priority,\nwhich is lower than that of any arithmetic, shifting or bitwise\noperation. Also unlike C, expressions like ``a < b < c`` have the\ninterpretation that is conventional in mathematics:\n\n comparison ::= or_expr ( comp_operator or_expr )*\n comp_operator ::= "<" | ">" | "==" | ">=" | "<=" | "<>" | "!="\n | "is" ["not"] | ["not"] "in"\n\nComparisons yield boolean values: ``True`` or ``False``.\n\nComparisons can be chained arbitrarily, e.g., ``x < y <= z`` is\nequivalent to ``x < y and y <= z``, except that ``y`` is evaluated\nonly once (but in both cases ``z`` is not evaluated at all when ``x <\ny`` is found to be false).\n\nFormally, if *a*, *b*, *c*, ..., *y*, *z* are expressions and *op1*,\n*op2*, ..., *opN* are comparison operators, then ``a op1 b op2 c ... y\nopN z`` is equivalent to ``a op1 b and b op2 c and ... y opN z``,\nexcept that each expression is evaluated at most once.\n\nNote that ``a op1 b op2 c`` doesn\'t imply any kind of comparison\nbetween *a* and *c*, so that, e.g., ``x < y > z`` is perfectly legal\n(though perhaps not pretty).\n\nThe forms ``<>`` and ``!=`` are equivalent; for consistency with C,\n``!=`` is preferred; where ``!=`` is mentioned below ``<>`` is also\naccepted. The ``<>`` spelling is considered obsolescent.\n\nThe operators ``<``, ``>``, ``==``, ``>=``, ``<=``, and ``!=`` compare\nthe values of two objects. The objects need not have the same type.\nIf both are numbers, they are converted to a common type. Otherwise,\nobjects of different types *always* compare unequal, and are ordered\nconsistently but arbitrarily. You can control comparison behavior of\nobjects of non-builtin types by defining a ``__cmp__`` method or rich\ncomparison methods like ``__gt__``, described in section *Special\nmethod names*.\n\n(This unusual definition of comparison was used to simplify the\ndefinition of operations like sorting and the ``in`` and ``not in``\noperators. In the future, the comparison rules for objects of\ndifferent types are likely to change.)\n\nComparison of objects of the same type depends on the type:\n\n* Numbers are compared arithmetically.\n\n* Strings are compared lexicographically using the numeric equivalents\n (the result of the built-in function ``ord()``) of their characters.\n Unicode and 8-bit strings are fully interoperable in this behavior.\n [4]\n\n* Tuples and lists are compared lexicographically using comparison of\n corresponding elements. This means that to compare equal, each\n element must compare equal and the two sequences must be of the same\n type and have the same length.\n\n If not equal, the sequences are ordered the same as their first\n differing elements. For example, ``cmp([1,2,x], [1,2,y])`` returns\n the same as ``cmp(x,y)``. If the corresponding element does not\n exist, the shorter sequence is ordered first (for example, ``[1,2] <\n [1,2,3]``).\n\n* Mappings (dictionaries) compare equal if and only if their sorted\n (key, value) lists compare equal. [5] Outcomes other than equality\n are resolved consistently, but are not otherwise defined. [6]\n\n* Most other objects of builtin types compare unequal unless they are\n the same object; the choice whether one object is considered smaller\n or larger than another one is made arbitrarily but consistently\n within one execution of a program.\n\nThe operators ``in`` and ``not in`` test for collection membership.\n``x in s`` evaluates to true if *x* is a member of the collection *s*,\nand false otherwise. ``x not in s`` returns the negation of ``x in\ns``. The collection membership test has traditionally been bound to\nsequences; an object is a member of a collection if the collection is\na sequence and contains an element equal to that object. However, it\nmake sense for many other object types to support membership tests\nwithout being a sequence. In particular, dictionaries (for keys) and\nsets support membership testing.\n\nFor the list and tuple types, ``x in y`` is true if and only if there\nexists an index *i* such that ``x == y[i]`` is true.\n\nFor the Unicode and string types, ``x in y`` is true if and only if\n*x* is a substring of *y*. An equivalent test is ``y.find(x) != -1``.\nNote, *x* and *y* need not be the same type; consequently, ``u\'ab\' in\n\'abc\'`` will return ``True``. Empty strings are always considered to\nbe a substring of any other string, so ``"" in "abc"`` will return\n``True``.\n\nChanged in version 2.3: Previously, *x* was required to be a string of\nlength ``1``.\n\nFor user-defined classes which define the ``__contains__()`` method,\n``x in y`` is true if and only if ``y.__contains__(x)`` is true.\n\nFor user-defined classes which do not define ``__contains__()`` and do\ndefine ``__getitem__()``, ``x in y`` is true if and only if there is a\nnon-negative integer index *i* such that ``x == y[i]``, and all lower\ninteger indices do not raise ``IndexError`` exception. (If any other\nexception is raised, it is as if ``in`` raised that exception).\n\nThe operator ``not in`` is defined to have the inverse true value of\n``in``.\n\nThe operators ``is`` and ``is not`` test for object identity: ``x is\ny`` is true if and only if *x* and *y* are the same object. ``x is\nnot y`` yields the inverse truth value.\n', - 'compound': u'\nCompound statements\n*******************\n\nCompound statements contain (groups of) other statements; they affect\nor control the execution of those other statements in some way. In\ngeneral, compound statements span multiple lines, although in simple\nincarnations a whole compound statement may be contained in one line.\n\nThe ``if``, ``while`` and ``for`` statements implement traditional\ncontrol flow constructs. ``try`` specifies exception handlers and/or\ncleanup code for a group of statements. Function and class\ndefinitions are also syntactically compound statements.\n\nCompound statements consist of one or more \'clauses.\' A clause\nconsists of a header and a \'suite.\' The clause headers of a\nparticular compound statement are all at the same indentation level.\nEach clause header begins with a uniquely identifying keyword and ends\nwith a colon. A suite is a group of statements controlled by a\nclause. A suite can be one or more semicolon-separated simple\nstatements on the same line as the header, following the header\'s\ncolon, or it can be one or more indented statements on subsequent\nlines. Only the latter form of suite can contain nested compound\nstatements; the following is illegal, mostly because it wouldn\'t be\nclear to which ``if`` clause a following ``else`` clause would belong:\n\n if test1: if test2: print x\n\nAlso note that the semicolon binds tighter than the colon in this\ncontext, so that in the following example, either all or none of the\n``print`` statements are executed:\n\n if x < y < z: print x; print y; print z\n\nSummarizing:\n\n compound_stmt ::= if_stmt\n | while_stmt\n | for_stmt\n | try_stmt\n | with_stmt\n | funcdef\n | classdef\n | decorated\n suite ::= stmt_list NEWLINE | NEWLINE INDENT statement+ DEDENT\n statement ::= stmt_list NEWLINE | compound_stmt\n stmt_list ::= simple_stmt (";" simple_stmt)* [";"]\n\nNote that statements always end in a ``NEWLINE`` possibly followed by\na ``DEDENT``. Also note that optional continuation clauses always\nbegin with a keyword that cannot start a statement, thus there are no\nambiguities (the \'dangling ``else``\' problem is solved in Python by\nrequiring nested ``if`` statements to be indented).\n\nThe formatting of the grammar rules in the following sections places\neach clause on a separate line for clarity.\n\n\nThe ``if`` statement\n====================\n\nThe ``if`` statement is used for conditional execution:\n\n if_stmt ::= "if" expression ":" suite\n ( "elif" expression ":" suite )*\n ["else" ":" suite]\n\nIt selects exactly one of the suites by evaluating the expressions one\nby one until one is found to be true (see section *Boolean operations*\nfor the definition of true and false); then that suite is executed\n(and no other part of the ``if`` statement is executed or evaluated).\nIf all expressions are false, the suite of the ``else`` clause, if\npresent, is executed.\n\n\nThe ``while`` statement\n=======================\n\nThe ``while`` statement is used for repeated execution as long as an\nexpression is true:\n\n while_stmt ::= "while" expression ":" suite\n ["else" ":" suite]\n\nThis repeatedly tests the expression and, if it is true, executes the\nfirst suite; if the expression is false (which may be the first time\nit is tested) the suite of the ``else`` clause, if present, is\nexecuted and the loop terminates.\n\nA ``break`` statement executed in the first suite terminates the loop\nwithout executing the ``else`` clause\'s suite. A ``continue``\nstatement executed in the first suite skips the rest of the suite and\ngoes back to testing the expression.\n\n\nThe ``for`` statement\n=====================\n\nThe ``for`` statement is used to iterate over the elements of a\nsequence (such as a string, tuple or list) or other iterable object:\n\n for_stmt ::= "for" target_list "in" expression_list ":" suite\n ["else" ":" suite]\n\nThe expression list is evaluated once; it should yield an iterable\nobject. An iterator is created for the result of the\n``expression_list``. The suite is then executed once for each item\nprovided by the iterator, in the order of ascending indices. Each\nitem in turn is assigned to the target list using the standard rules\nfor assignments, and then the suite is executed. When the items are\nexhausted (which is immediately when the sequence is empty), the suite\nin the ``else`` clause, if present, is executed, and the loop\nterminates.\n\nA ``break`` statement executed in the first suite terminates the loop\nwithout executing the ``else`` clause\'s suite. A ``continue``\nstatement executed in the first suite skips the rest of the suite and\ncontinues with the next item, or with the ``else`` clause if there was\nno next item.\n\nThe suite may assign to the variable(s) in the target list; this does\nnot affect the next item assigned to it.\n\nThe target list is not deleted when the loop is finished, but if the\nsequence is empty, it will not have been assigned to at all by the\nloop. Hint: the built-in function ``range()`` returns a sequence of\nintegers suitable to emulate the effect of Pascal\'s ``for i := a to b\ndo``; e.g., ``range(3)`` returns the list ``[0, 1, 2]``.\n\nWarning: There is a subtlety when the sequence is being modified by the loop\n (this can only occur for mutable sequences, i.e. lists). An internal\n counter is used to keep track of which item is used next, and this\n is incremented on each iteration. When this counter has reached the\n length of the sequence the loop terminates. This means that if the\n suite deletes the current (or a previous) item from the sequence,\n the next item will be skipped (since it gets the index of the\n current item which has already been treated). Likewise, if the\n suite inserts an item in the sequence before the current item, the\n current item will be treated again the next time through the loop.\n This can lead to nasty bugs that can be avoided by making a\n temporary copy using a slice of the whole sequence, e.g.,\n\n for x in a[:]:\n if x < 0: a.remove(x)\n\n\nThe ``try`` statement\n=====================\n\nThe ``try`` statement specifies exception handlers and/or cleanup code\nfor a group of statements:\n\n try_stmt ::= try1_stmt | try2_stmt\n try1_stmt ::= "try" ":" suite\n ("except" [expression ["," target]] ":" suite)+\n ["else" ":" suite]\n ["finally" ":" suite]\n try2_stmt ::= "try" ":" suite\n "finally" ":" suite\n\nChanged in version 2.5: In previous versions of Python,\n``try``...``except``...``finally`` did not work. ``try``...``except``\nhad to be nested in ``try``...``finally``.\n\nThe ``except`` clause(s) specify one or more exception handlers. When\nno exception occurs in the ``try`` clause, no exception handler is\nexecuted. When an exception occurs in the ``try`` suite, a search for\nan exception handler is started. This search inspects the except\nclauses in turn until one is found that matches the exception. An\nexpression-less except clause, if present, must be last; it matches\nany exception. For an except clause with an expression, that\nexpression is evaluated, and the clause matches the exception if the\nresulting object is "compatible" with the exception. An object is\ncompatible with an exception if it is the class or a base class of the\nexception object, a tuple containing an item compatible with the\nexception, or, in the (deprecated) case of string exceptions, is the\nraised string itself (note that the object identities must match, i.e.\nit must be the same string object, not just a string with the same\nvalue).\n\nIf no except clause matches the exception, the search for an exception\nhandler continues in the surrounding code and on the invocation stack.\n[1]\n\nIf the evaluation of an expression in the header of an except clause\nraises an exception, the original search for a handler is canceled and\na search starts for the new exception in the surrounding code and on\nthe call stack (it is treated as if the entire ``try`` statement\nraised the exception).\n\nWhen a matching except clause is found, the exception is assigned to\nthe target specified in that except clause, if present, and the except\nclause\'s suite is executed. All except clauses must have an\nexecutable block. When the end of this block is reached, execution\ncontinues normally after the entire try statement. (This means that\nif two nested handlers exist for the same exception, and the exception\noccurs in the try clause of the inner handler, the outer handler will\nnot handle the exception.)\n\nBefore an except clause\'s suite is executed, details about the\nexception are assigned to three variables in the ``sys`` module:\n``sys.exc_type`` receives the object identifying the exception;\n``sys.exc_value`` receives the exception\'s parameter;\n``sys.exc_traceback`` receives a traceback object (see section *The\nstandard type hierarchy*) identifying the point in the program where\nthe exception occurred. These details are also available through the\n``sys.exc_info()`` function, which returns a tuple ``(exc_type,\nexc_value, exc_traceback)``. Use of the corresponding variables is\ndeprecated in favor of this function, since their use is unsafe in a\nthreaded program. As of Python 1.5, the variables are restored to\ntheir previous values (before the call) when returning from a function\nthat handled an exception.\n\nThe optional ``else`` clause is executed if and when control flows off\nthe end of the ``try`` clause. [2] Exceptions in the ``else`` clause\nare not handled by the preceding ``except`` clauses.\n\nIf ``finally`` is present, it specifies a \'cleanup\' handler. The\n``try`` clause is executed, including any ``except`` and ``else``\nclauses. If an exception occurs in any of the clauses and is not\nhandled, the exception is temporarily saved. The ``finally`` clause is\nexecuted. If there is a saved exception, it is re-raised at the end\nof the ``finally`` clause. If the ``finally`` clause raises another\nexception or executes a ``return`` or ``break`` statement, the saved\nexception is lost. The exception information is not available to the\nprogram during execution of the ``finally`` clause.\n\nWhen a ``return``, ``break`` or ``continue`` statement is executed in\nthe ``try`` suite of a ``try``...``finally`` statement, the\n``finally`` clause is also executed \'on the way out.\' A ``continue``\nstatement is illegal in the ``finally`` clause. (The reason is a\nproblem with the current implementation --- this restriction may be\nlifted in the future).\n\nAdditional information on exceptions can be found in section\n*Exceptions*, and information on using the ``raise`` statement to\ngenerate exceptions may be found in section *The raise statement*.\n\n\nThe ``with`` statement\n======================\n\nAdded in version 2.5.\n\nThe ``with`` statement is used to wrap the execution of a block with\nmethods defined by a context manager (see section *With Statement\nContext Managers*). This allows common\n``try``...``except``...``finally`` usage patterns to be encapsulated\nfor convenient reuse.\n\n with_stmt ::= "with" expression ["as" target] ":" suite\n\nThe execution of the ``with`` statement proceeds as follows:\n\n1. The context expression is evaluated to obtain a context manager.\n\n2. The context manager\'s ``__enter__()`` method is invoked.\n\n3. If a target was included in the ``with`` statement, the return\n value from ``__enter__()`` is assigned to it.\n\n Note: The ``with`` statement guarantees that if the ``__enter__()``\n method returns without an error, then ``__exit__()`` will always\n be called. Thus, if an error occurs during the assignment to the\n target list, it will be treated the same as an error occurring\n within the suite would be. See step 5 below.\n\n4. The suite is executed.\n\n5. The context manager\'s ``__exit__()`` method is invoked. If an\n exception caused the suite to be exited, its type, value, and\n traceback are passed as arguments to ``__exit__()``. Otherwise,\n three ``None`` arguments are supplied.\n\n If the suite was exited due to an exception, and the return value\n from the ``__exit__()`` method was false, the exception is\n reraised. If the return value was true, the exception is\n suppressed, and execution continues with the statement following\n the ``with`` statement.\n\n If the suite was exited for any reason other than an exception, the\n return value from ``__exit__()`` is ignored, and execution proceeds\n at the normal location for the kind of exit that was taken.\n\nNote: In Python 2.5, the ``with`` statement is only allowed when the\n ``with_statement`` feature has been enabled. It is always enabled\n in Python 2.6.\n\nSee also:\n\n **PEP 0343** - The "with" statement\n The specification, background, and examples for the Python\n ``with`` statement.\n\n\nFunction definitions\n====================\n\nA function definition defines a user-defined function object (see\nsection *The standard type hierarchy*):\n\n decorated ::= decorators (classdef | funcdef)\n decorators ::= decorator+\n decorator ::= "@" dotted_name ["(" [argument_list [","]] ")"] NEWLINE\n funcdef ::= "def" funcname "(" [parameter_list] ")" ":" suite\n dotted_name ::= identifier ("." identifier)*\n parameter_list ::= (defparameter ",")*\n ( "*" identifier [, "**" identifier]\n | "**" identifier\n | defparameter [","] )\n defparameter ::= parameter ["=" expression]\n sublist ::= parameter ("," parameter)* [","]\n parameter ::= identifier | "(" sublist ")"\n funcname ::= identifier\n\nA function definition is an executable statement. Its execution binds\nthe function name in the current local namespace to a function object\n(a wrapper around the executable code for the function). This\nfunction object contains a reference to the current global namespace\nas the global namespace to be used when the function is called.\n\nThe function definition does not execute the function body; this gets\nexecuted only when the function is called.\n\nA function definition may be wrapped by one or more *decorator*\nexpressions. Decorator expressions are evaluated when the function is\ndefined, in the scope that contains the function definition. The\nresult must be a callable, which is invoked with the function object\nas the only argument. The returned value is bound to the function name\ninstead of the function object. Multiple decorators are applied in\nnested fashion. For example, the following code:\n\n @f1(arg)\n @f2\n def func(): pass\n\nis equivalent to:\n\n def func(): pass\n func = f1(arg)(f2(func))\n\nWhen one or more top-level parameters have the form *parameter* ``=``\n*expression*, the function is said to have "default parameter values."\nFor a parameter with a default value, the corresponding argument may\nbe omitted from a call, in which case the parameter\'s default value is\nsubstituted. If a parameter has a default value, all following\nparameters must also have a default value --- this is a syntactic\nrestriction that is not expressed by the grammar.\n\n**Default parameter values are evaluated when the function definition\nis executed.** This means that the expression is evaluated once, when\nthe function is defined, and that that same "pre-computed" value is\nused for each call. This is especially important to understand when a\ndefault parameter is a mutable object, such as a list or a dictionary:\nif the function modifies the object (e.g. by appending an item to a\nlist), the default value is in effect modified. This is generally not\nwhat was intended. A way around this is to use ``None`` as the\ndefault, and explicitly test for it in the body of the function, e.g.:\n\n def whats_on_the_telly(penguin=None):\n if penguin is None:\n penguin = []\n penguin.append("property of the zoo")\n return penguin\n\nFunction call semantics are described in more detail in section\n*Calls*. A function call always assigns values to all parameters\nmentioned in the parameter list, either from position arguments, from\nkeyword arguments, or from default values. If the form\n"``*identifier``" is present, it is initialized to a tuple receiving\nany excess positional parameters, defaulting to the empty tuple. If\nthe form "``**identifier``" is present, it is initialized to a new\ndictionary receiving any excess keyword arguments, defaulting to a new\nempty dictionary.\n\nIt is also possible to create anonymous functions (functions not bound\nto a name), for immediate use in expressions. This uses lambda forms,\ndescribed in section *Expression lists*. Note that the lambda form is\nmerely a shorthand for a simplified function definition; a function\ndefined in a "``def``" statement can be passed around or assigned to\nanother name just like a function defined by a lambda form. The\n"``def``" form is actually more powerful since it allows the execution\nof multiple statements.\n\n**Programmer\'s note:** Functions are first-class objects. A "``def``"\nform executed inside a function definition defines a local function\nthat can be returned or passed around. Free variables used in the\nnested function can access the local variables of the function\ncontaining the def. See section *Naming and binding* for details.\n\n\nClass definitions\n=================\n\nA class definition defines a class object (see section *The standard\ntype hierarchy*):\n\n classdef ::= "class" classname [inheritance] ":" suite\n inheritance ::= "(" [expression_list] ")"\n classname ::= identifier\n\nA class definition is an executable statement. It first evaluates the\ninheritance list, if present. Each item in the inheritance list\nshould evaluate to a class object or class type which allows\nsubclassing. The class\'s suite is then executed in a new execution\nframe (see section *Naming and binding*), using a newly created local\nnamespace and the original global namespace. (Usually, the suite\ncontains only function definitions.) When the class\'s suite finishes\nexecution, its execution frame is discarded but its local namespace is\nsaved. A class object is then created using the inheritance list for\nthe base classes and the saved local namespace for the attribute\ndictionary. The class name is bound to this class object in the\noriginal local namespace.\n\n**Programmer\'s note:** Variables defined in the class definition are\nclass variables; they are shared by all instances. To create instance\nvariables, they can be set in a method with ``self.name = value``.\nBoth class and instance variables are accessible through the notation\n"``self.name``", and an instance variable hides a class variable with\nthe same name when accessed in this way. Class variables can be used\nas defaults for instance variables, but using mutable values there can\nlead to unexpected results. For *new-style class*es, descriptors can\nbe used to create instance variables with different implementation\ndetails.\n\nClass definitions, like function definitions, may be wrapped by one or\nmore *decorator* expressions. The evaluation rules for the decorator\nexpressions are the same as for functions. The result must be a class\nobject, which is then bound to the class name.\n\n-[ Footnotes ]-\n\n[1] The exception is propagated to the invocation stack only if there\n is no ``finally`` clause that negates the exception.\n\n[2] Currently, control "flows off the end" except in the case of an\n exception or the execution of a ``return``, ``continue``, or\n ``break`` statement.\n', - 'context-managers': u'\nWith Statement Context Managers\n*******************************\n\nAdded in version 2.5.\n\nA *context manager* is an object that defines the runtime context to\nbe established when executing a ``with`` statement. The context\nmanager handles the entry into, and the exit from, the desired runtime\ncontext for the execution of the block of code. Context managers are\nnormally invoked using the ``with`` statement (described in section\n*The with statement*), but can also be used by directly invoking their\nmethods.\n\nTypical uses of context managers include saving and restoring various\nkinds of global state, locking and unlocking resources, closing opened\nfiles, etc.\n\nFor more information on context managers, see *Context Manager Types*.\n\nobject.__enter__(self)\n\n Enter the runtime context related to this object. The ``with``\n statement will bind this method\'s return value to the target(s)\n specified in the ``as`` clause of the statement, if any.\n\nobject.__exit__(self, exc_type, exc_value, traceback)\n\n Exit the runtime context related to this object. The parameters\n describe the exception that caused the context to be exited. If the\n context was exited without an exception, all three arguments will\n be ``None``.\n\n If an exception is supplied, and the method wishes to suppress the\n exception (i.e., prevent it from being propagated), it should\n return a true value. Otherwise, the exception will be processed\n normally upon exit from this method.\n\n Note that ``__exit__()`` methods should not reraise the passed-in\n exception; this is the caller\'s responsibility.\n\nSee also:\n\n **PEP 0343** - The "with" statement\n The specification, background, and examples for the Python\n ``with`` statement.\n\n-[ Footnotes ]-\n\n[1] Since Python 2.2, a gradual merging of types and classes has been\n started that makes this and a few other assertions made in this\n manual not 100% accurate and complete: for example, it *is* now\n possible in some cases to change an object\'s type, under certain\n controlled conditions. Until this manual undergoes extensive\n revision, it must now be taken as authoritative only regarding\n "classic classes", that are still the default, for compatibility\n purposes, in Python 2.2 and 2.3. For more information, see\n http://www.python.org/doc/newstyle/.\n\n[2] This, and other statements, are only roughly true for instances of\n new-style classes.\n\n[3] A descriptor can define any combination of ``__get__()``,\n ``__set__()`` and ``__delete__()``. If it does not define\n ``__get__()``, then accessing the attribute even on an instance\n will return the descriptor object itself. If the descriptor\n defines ``__set__()`` and/or ``__delete__()``, it is a data\n descriptor; if it defines neither, it is a non-data descriptor.\n\n[4] For operands of the same type, it is assumed that if the non-\n reflected method (such as ``__add__()``) fails the operation is\n not supported, which is why the reflected method is not called.\n', + 'calls': u'\nCalls\n*****\n\nA call calls a callable object (e.g., a function) with a possibly\nempty series of arguments:\n\n call ::= primary "(" [argument_list [","]\n | expression genexpr_for] ")"\n argument_list ::= positional_arguments ["," keyword_arguments]\n ["," "*" expression] ["," keyword_arguments]\n ["," "**" expression]\n | keyword_arguments ["," "*" expression]\n ["," "**" expression]\n | "*" expression ["," "*" expression] ["," "**" expression]\n | "**" expression\n positional_arguments ::= expression ("," expression)*\n keyword_arguments ::= keyword_item ("," keyword_item)*\n keyword_item ::= identifier "=" expression\n\nA trailing comma may be present after the positional and keyword\narguments but does not affect the semantics.\n\nThe primary must evaluate to a callable object (user-defined\nfunctions, built-in functions, methods of built-in objects, class\nobjects, methods of class instances, and certain class instances\nthemselves are callable; extensions may define additional callable\nobject types). All argument expressions are evaluated before the call\nis attempted. Please refer to section *Function definitions* for the\nsyntax of formal parameter lists.\n\nIf keyword arguments are present, they are first converted to\npositional arguments, as follows. First, a list of unfilled slots is\ncreated for the formal parameters. If there are N positional\narguments, they are placed in the first N slots. Next, for each\nkeyword argument, the identifier is used to determine the\ncorresponding slot (if the identifier is the same as the first formal\nparameter name, the first slot is used, and so on). If the slot is\nalready filled, a ``TypeError`` exception is raised. Otherwise, the\nvalue of the argument is placed in the slot, filling it (even if the\nexpression is ``None``, it fills the slot). When all arguments have\nbeen processed, the slots that are still unfilled are filled with the\ncorresponding default value from the function definition. (Default\nvalues are calculated, once, when the function is defined; thus, a\nmutable object such as a list or dictionary used as default value will\nbe shared by all calls that don\'t specify an argument value for the\ncorresponding slot; this should usually be avoided.) If there are any\nunfilled slots for which no default value is specified, a\n``TypeError`` exception is raised. Otherwise, the list of filled\nslots is used as the argument list for the call.\n\nNote: An implementation may provide builtin functions whose positional\n parameters do not have names, even if they are \'named\' for the\n purpose of documentation, and which therefore cannot be supplied by\n keyword. In CPython, this is the case for functions implemented in\n C that use ``PyArg_ParseTuple`` to parse their arguments.\n\nIf there are more positional arguments than there are formal parameter\nslots, a ``TypeError`` exception is raised, unless a formal parameter\nusing the syntax ``*identifier`` is present; in this case, that formal\nparameter receives a tuple containing the excess positional arguments\n(or an empty tuple if there were no excess positional arguments).\n\nIf any keyword argument does not correspond to a formal parameter\nname, a ``TypeError`` exception is raised, unless a formal parameter\nusing the syntax ``**identifier`` is present; in this case, that\nformal parameter receives a dictionary containing the excess keyword\narguments (using the keywords as keys and the argument values as\ncorresponding values), or a (new) empty dictionary if there were no\nexcess keyword arguments.\n\nIf the syntax ``*expression`` appears in the function call,\n``expression`` must evaluate to a sequence. Elements from this\nsequence are treated as if they were additional positional arguments;\nif there are positional arguments *x1*,..., *xN*, and ``expression``\nevaluates to a sequence *y1*, ..., *yM*, this is equivalent to a call\nwith M+N positional arguments *x1*, ..., *xN*, *y1*, ..., *yM*.\n\nA consequence of this is that although the ``*expression`` syntax may\nappear *after* some keyword arguments, it is processed *before* the\nkeyword arguments (and the ``**expression`` argument, if any -- see\nbelow). So:\n\n >>> def f(a, b):\n ... print a, b\n ...\n >>> f(b=1, *(2,))\n 2 1\n >>> f(a=1, *(2,))\n Traceback (most recent call last):\n File "", line 1, in ?\n TypeError: f() got multiple values for keyword argument \'a\'\n >>> f(1, *(2,))\n 1 2\n\nIt is unusual for both keyword arguments and the ``*expression``\nsyntax to be used in the same call, so in practice this confusion does\nnot arise.\n\nIf the syntax ``**expression`` appears in the function call,\n``expression`` must evaluate to a mapping, the contents of which are\ntreated as additional keyword arguments. In the case of a keyword\nappearing in both ``expression`` and as an explicit keyword argument,\na ``TypeError`` exception is raised.\n\nFormal parameters using the syntax ``*identifier`` or ``**identifier``\ncannot be used as positional argument slots or as keyword argument\nnames. Formal parameters using the syntax ``(sublist)`` cannot be\nused as keyword argument names; the outermost sublist corresponds to a\nsingle unnamed argument slot, and the argument value is assigned to\nthe sublist using the usual tuple assignment rules after all other\nparameter processing is done.\n\nA call always returns some value, possibly ``None``, unless it raises\nan exception. How this value is computed depends on the type of the\ncallable object.\n\nIf it is---\n\na user-defined function:\n The code block for the function is executed, passing it the\n argument list. The first thing the code block will do is bind the\n formal parameters to the arguments; this is described in section\n *Function definitions*. When the code block executes a ``return``\n statement, this specifies the return value of the function call.\n\na built-in function or method:\n The result is up to the interpreter; see *Built-in Functions* for\n the descriptions of built-in functions and methods.\n\na class object:\n A new instance of that class is returned.\n\na class instance method:\n The corresponding user-defined function is called, with an argument\n list that is one longer than the argument list of the call: the\n instance becomes the first argument.\n\na class instance:\n The class must define a ``__call__()`` method; the effect is then\n the same as if that method was called.\n', + 'class': u'\nClass definitions\n*****************\n\nA class definition defines a class object (see section *The standard\ntype hierarchy*):\n\n classdef ::= "class" classname [inheritance] ":" suite\n inheritance ::= "(" [expression_list] ")"\n classname ::= identifier\n\nA class definition is an executable statement. It first evaluates the\ninheritance list, if present. Each item in the inheritance list\nshould evaluate to a class object or class type which allows\nsubclassing. The class\'s suite is then executed in a new execution\nframe (see section *Naming and binding*), using a newly created local\nnamespace and the original global namespace. (Usually, the suite\ncontains only function definitions.) When the class\'s suite finishes\nexecution, its execution frame is discarded but its local namespace is\nsaved. [4] A class object is then created using the inheritance list\nfor the base classes and the saved local namespace for the attribute\ndictionary. The class name is bound to this class object in the\noriginal local namespace.\n\n**Programmer\'s note:** Variables defined in the class definition are\nclass variables; they are shared by all instances. To create instance\nvariables, they can be set in a method with ``self.name = value``.\nBoth class and instance variables are accessible through the notation\n"``self.name``", and an instance variable hides a class variable with\nthe same name when accessed in this way. Class variables can be used\nas defaults for instance variables, but using mutable values there can\nlead to unexpected results. For *new-style class*es, descriptors can\nbe used to create instance variables with different implementation\ndetails.\n\nClass definitions, like function definitions, may be wrapped by one or\nmore *decorator* expressions. The evaluation rules for the decorator\nexpressions are the same as for functions. The result must be a class\nobject, which is then bound to the class name.\n\n-[ Footnotes ]-\n\n[1] The exception is propagated to the invocation stack only if there\n is no ``finally`` clause that negates the exception.\n\n[2] Currently, control "flows off the end" except in the case of an\n exception or the execution of a ``return``, ``continue``, or\n ``break`` statement.\n\n[3] A string literal appearing as the first statement in the function\n body is transformed into the function\'s ``__doc__`` attribute and\n therefore the function\'s *docstring*.\n\n[4] A string literal appearing as the first statement in the class\n body is transformed into the namespace\'s ``__doc__`` item and\n therefore the class\'s *docstring*.\n', + 'coercion-rules': u"\nCoercion rules\n**************\n\nThis section used to document the rules for coercion. As the language\nhas evolved, the coercion rules have become hard to document\nprecisely; documenting what one version of one particular\nimplementation does is undesirable. Instead, here are some informal\nguidelines regarding coercion. In Python 3.0, coercion will not be\nsupported.\n\n* If the left operand of a % operator is a string or Unicode object,\n no coercion takes place and the string formatting operation is\n invoked instead.\n\n* It is no longer recommended to define a coercion operation. Mixed-\n mode operations on types that don't define coercion pass the\n original arguments to the operation.\n\n* New-style classes (those derived from ``object``) never invoke the\n ``__coerce__()`` method in response to a binary operator; the only\n time ``__coerce__()`` is invoked is when the built-in function\n ``coerce()`` is called.\n\n* For most intents and purposes, an operator that returns\n ``NotImplemented`` is treated the same as one that is not\n implemented at all.\n\n* Below, ``__op__()`` and ``__rop__()`` are used to signify the\n generic method names corresponding to an operator; ``__iop__()`` is\n used for the corresponding in-place operator. For example, for the\n operator '``+``', ``__add__()`` and ``__radd__()`` are used for the\n left and right variant of the binary operator, and ``__iadd__()``\n for the in-place variant.\n\n* For objects *x* and *y*, first ``x.__op__(y)`` is tried. If this is\n not implemented or returns ``NotImplemented``, ``y.__rop__(x)`` is\n tried. If this is also not implemented or returns\n ``NotImplemented``, a ``TypeError`` exception is raised. But see\n the following exception:\n\n* Exception to the previous item: if the left operand is an instance\n of a built-in type or a new-style class, and the right operand is an\n instance of a proper subclass of that type or class and overrides\n the base's ``__rop__()`` method, the right operand's ``__rop__()``\n method is tried *before* the left operand's ``__op__()`` method.\n\n This is done so that a subclass can completely override binary\n operators. Otherwise, the left operand's ``__op__()`` method would\n always accept the right operand: when an instance of a given class\n is expected, an instance of a subclass of that class is always\n acceptable.\n\n* When either operand type defines a coercion, this coercion is called\n before that type's ``__op__()`` or ``__rop__()`` method is called,\n but no sooner. If the coercion returns an object of a different\n type for the operand whose coercion is invoked, part of the process\n is redone using the new object.\n\n* When an in-place operator (like '``+=``') is used, if the left\n operand implements ``__iop__()``, it is invoked without any\n coercion. When the operation falls back to ``__op__()`` and/or\n ``__rop__()``, the normal coercion rules apply.\n\n* In ``x + y``, if *x* is a sequence that implements sequence\n concatenation, sequence concatenation is invoked.\n\n* In ``x * y``, if one operator is a sequence that implements sequence\n repetition, and the other is an integer (``int`` or ``long``),\n sequence repetition is invoked.\n\n* Rich comparisons (implemented by methods ``__eq__()`` and so on)\n never use coercion. Three-way comparison (implemented by\n ``__cmp__()``) does use coercion under the same conditions as other\n binary operations use it.\n\n* In the current implementation, the built-in numeric types ``int``,\n ``long`` and ``float`` do not use coercion; the type ``complex``\n however does use it. The difference can become apparent when\n subclassing these types. Over time, the type ``complex`` may be\n fixed to avoid coercion. All these types implement a\n ``__coerce__()`` method, for use by the built-in ``coerce()``\n function.\n", + 'comparisons': u'\nComparisons\n***********\n\nUnlike C, all comparison operations in Python have the same priority,\nwhich is lower than that of any arithmetic, shifting or bitwise\noperation. Also unlike C, expressions like ``a < b < c`` have the\ninterpretation that is conventional in mathematics:\n\n comparison ::= or_expr ( comp_operator or_expr )*\n comp_operator ::= "<" | ">" | "==" | ">=" | "<=" | "<>" | "!="\n | "is" ["not"] | ["not"] "in"\n\nComparisons yield boolean values: ``True`` or ``False``.\n\nComparisons can be chained arbitrarily, e.g., ``x < y <= z`` is\nequivalent to ``x < y and y <= z``, except that ``y`` is evaluated\nonly once (but in both cases ``z`` is not evaluated at all when ``x <\ny`` is found to be false).\n\nFormally, if *a*, *b*, *c*, ..., *y*, *z* are expressions and *op1*,\n*op2*, ..., *opN* are comparison operators, then ``a op1 b op2 c ... y\nopN z`` is equivalent to ``a op1 b and b op2 c and ... y opN z``,\nexcept that each expression is evaluated at most once.\n\nNote that ``a op1 b op2 c`` doesn\'t imply any kind of comparison\nbetween *a* and *c*, so that, e.g., ``x < y > z`` is perfectly legal\n(though perhaps not pretty).\n\nThe forms ``<>`` and ``!=`` are equivalent; for consistency with C,\n``!=`` is preferred; where ``!=`` is mentioned below ``<>`` is also\naccepted. The ``<>`` spelling is considered obsolescent.\n\nThe operators ``<``, ``>``, ``==``, ``>=``, ``<=``, and ``!=`` compare\nthe values of two objects. The objects need not have the same type.\nIf both are numbers, they are converted to a common type. Otherwise,\nobjects of different types *always* compare unequal, and are ordered\nconsistently but arbitrarily. You can control comparison behavior of\nobjects of non-builtin types by defining a ``__cmp__`` method or rich\ncomparison methods like ``__gt__``, described in section *Special\nmethod names*.\n\n(This unusual definition of comparison was used to simplify the\ndefinition of operations like sorting and the ``in`` and ``not in``\noperators. In the future, the comparison rules for objects of\ndifferent types are likely to change.)\n\nComparison of objects of the same type depends on the type:\n\n* Numbers are compared arithmetically.\n\n* Strings are compared lexicographically using the numeric equivalents\n (the result of the built-in function ``ord()``) of their characters.\n Unicode and 8-bit strings are fully interoperable in this behavior.\n [4]\n\n* Tuples and lists are compared lexicographically using comparison of\n corresponding elements. This means that to compare equal, each\n element must compare equal and the two sequences must be of the same\n type and have the same length.\n\n If not equal, the sequences are ordered the same as their first\n differing elements. For example, ``cmp([1,2,x], [1,2,y])`` returns\n the same as ``cmp(x,y)``. If the corresponding element does not\n exist, the shorter sequence is ordered first (for example, ``[1,2] <\n [1,2,3]``).\n\n* Mappings (dictionaries) compare equal if and only if their sorted\n (key, value) lists compare equal. [5] Outcomes other than equality\n are resolved consistently, but are not otherwise defined. [6]\n\n* Most other objects of builtin types compare unequal unless they are\n the same object; the choice whether one object is considered smaller\n or larger than another one is made arbitrarily but consistently\n within one execution of a program.\n\nThe operators ``in`` and ``not in`` test for collection membership.\n``x in s`` evaluates to true if *x* is a member of the collection *s*,\nand false otherwise. ``x not in s`` returns the negation of ``x in\ns``. The collection membership test has traditionally been bound to\nsequences; an object is a member of a collection if the collection is\na sequence and contains an element equal to that object. However, it\nmake sense for many other object types to support membership tests\nwithout being a sequence. In particular, dictionaries (for keys) and\nsets support membership testing.\n\nFor the list and tuple types, ``x in y`` is true if and only if there\nexists an index *i* such that ``x == y[i]`` is true.\n\nFor the Unicode and string types, ``x in y`` is true if and only if\n*x* is a substring of *y*. An equivalent test is ``y.find(x) != -1``.\nNote, *x* and *y* need not be the same type; consequently, ``u\'ab\' in\n\'abc\'`` will return ``True``. Empty strings are always considered to\nbe a substring of any other string, so ``"" in "abc"`` will return\n``True``.\n\nChanged in version 2.3: Previously, *x* was required to be a string of\nlength ``1``.\n\nFor user-defined classes which define the ``__contains__()`` method,\n``x in y`` is true if and only if ``y.__contains__(x)`` is true.\n\nFor user-defined classes which do not define ``__contains__()`` and do\ndefine ``__getitem__()``, ``x in y`` is true if and only if there is a\nnon-negative integer index *i* such that ``x == y[i]``, and all lower\ninteger indices do not raise ``IndexError`` exception. (If any other\nexception is raised, it is as if ``in`` raised that exception).\n\nThe operator ``not in`` is defined to have the inverse true value of\n``in``.\n\nThe operators ``is`` and ``is not`` test for object identity: ``x is\ny`` is true if and only if *x* and *y* are the same object. ``x is\nnot y`` yields the inverse truth value. [7]\n', + 'compound': u'\nCompound statements\n*******************\n\nCompound statements contain (groups of) other statements; they affect\nor control the execution of those other statements in some way. In\ngeneral, compound statements span multiple lines, although in simple\nincarnations a whole compound statement may be contained in one line.\n\nThe ``if``, ``while`` and ``for`` statements implement traditional\ncontrol flow constructs. ``try`` specifies exception handlers and/or\ncleanup code for a group of statements. Function and class\ndefinitions are also syntactically compound statements.\n\nCompound statements consist of one or more \'clauses.\' A clause\nconsists of a header and a \'suite.\' The clause headers of a\nparticular compound statement are all at the same indentation level.\nEach clause header begins with a uniquely identifying keyword and ends\nwith a colon. A suite is a group of statements controlled by a\nclause. A suite can be one or more semicolon-separated simple\nstatements on the same line as the header, following the header\'s\ncolon, or it can be one or more indented statements on subsequent\nlines. Only the latter form of suite can contain nested compound\nstatements; the following is illegal, mostly because it wouldn\'t be\nclear to which ``if`` clause a following ``else`` clause would belong:\n\n if test1: if test2: print x\n\nAlso note that the semicolon binds tighter than the colon in this\ncontext, so that in the following example, either all or none of the\n``print`` statements are executed:\n\n if x < y < z: print x; print y; print z\n\nSummarizing:\n\n compound_stmt ::= if_stmt\n | while_stmt\n | for_stmt\n | try_stmt\n | with_stmt\n | funcdef\n | classdef\n | decorated\n suite ::= stmt_list NEWLINE | NEWLINE INDENT statement+ DEDENT\n statement ::= stmt_list NEWLINE | compound_stmt\n stmt_list ::= simple_stmt (";" simple_stmt)* [";"]\n\nNote that statements always end in a ``NEWLINE`` possibly followed by\na ``DEDENT``. Also note that optional continuation clauses always\nbegin with a keyword that cannot start a statement, thus there are no\nambiguities (the \'dangling ``else``\' problem is solved in Python by\nrequiring nested ``if`` statements to be indented).\n\nThe formatting of the grammar rules in the following sections places\neach clause on a separate line for clarity.\n\n\nThe ``if`` statement\n====================\n\nThe ``if`` statement is used for conditional execution:\n\n if_stmt ::= "if" expression ":" suite\n ( "elif" expression ":" suite )*\n ["else" ":" suite]\n\nIt selects exactly one of the suites by evaluating the expressions one\nby one until one is found to be true (see section *Boolean operations*\nfor the definition of true and false); then that suite is executed\n(and no other part of the ``if`` statement is executed or evaluated).\nIf all expressions are false, the suite of the ``else`` clause, if\npresent, is executed.\n\n\nThe ``while`` statement\n=======================\n\nThe ``while`` statement is used for repeated execution as long as an\nexpression is true:\n\n while_stmt ::= "while" expression ":" suite\n ["else" ":" suite]\n\nThis repeatedly tests the expression and, if it is true, executes the\nfirst suite; if the expression is false (which may be the first time\nit is tested) the suite of the ``else`` clause, if present, is\nexecuted and the loop terminates.\n\nA ``break`` statement executed in the first suite terminates the loop\nwithout executing the ``else`` clause\'s suite. A ``continue``\nstatement executed in the first suite skips the rest of the suite and\ngoes back to testing the expression.\n\n\nThe ``for`` statement\n=====================\n\nThe ``for`` statement is used to iterate over the elements of a\nsequence (such as a string, tuple or list) or other iterable object:\n\n for_stmt ::= "for" target_list "in" expression_list ":" suite\n ["else" ":" suite]\n\nThe expression list is evaluated once; it should yield an iterable\nobject. An iterator is created for the result of the\n``expression_list``. The suite is then executed once for each item\nprovided by the iterator, in the order of ascending indices. Each\nitem in turn is assigned to the target list using the standard rules\nfor assignments, and then the suite is executed. When the items are\nexhausted (which is immediately when the sequence is empty), the suite\nin the ``else`` clause, if present, is executed, and the loop\nterminates.\n\nA ``break`` statement executed in the first suite terminates the loop\nwithout executing the ``else`` clause\'s suite. A ``continue``\nstatement executed in the first suite skips the rest of the suite and\ncontinues with the next item, or with the ``else`` clause if there was\nno next item.\n\nThe suite may assign to the variable(s) in the target list; this does\nnot affect the next item assigned to it.\n\nThe target list is not deleted when the loop is finished, but if the\nsequence is empty, it will not have been assigned to at all by the\nloop. Hint: the built-in function ``range()`` returns a sequence of\nintegers suitable to emulate the effect of Pascal\'s ``for i := a to b\ndo``; e.g., ``range(3)`` returns the list ``[0, 1, 2]``.\n\nWarning: There is a subtlety when the sequence is being modified by the loop\n (this can only occur for mutable sequences, i.e. lists). An internal\n counter is used to keep track of which item is used next, and this\n is incremented on each iteration. When this counter has reached the\n length of the sequence the loop terminates. This means that if the\n suite deletes the current (or a previous) item from the sequence,\n the next item will be skipped (since it gets the index of the\n current item which has already been treated). Likewise, if the\n suite inserts an item in the sequence before the current item, the\n current item will be treated again the next time through the loop.\n This can lead to nasty bugs that can be avoided by making a\n temporary copy using a slice of the whole sequence, e.g.,\n\n for x in a[:]:\n if x < 0: a.remove(x)\n\n\nThe ``try`` statement\n=====================\n\nThe ``try`` statement specifies exception handlers and/or cleanup code\nfor a group of statements:\n\n try_stmt ::= try1_stmt | try2_stmt\n try1_stmt ::= "try" ":" suite\n ("except" [expression ["," target]] ":" suite)+\n ["else" ":" suite]\n ["finally" ":" suite]\n try2_stmt ::= "try" ":" suite\n "finally" ":" suite\n\nChanged in version 2.5: In previous versions of Python,\n``try``...``except``...``finally`` did not work. ``try``...``except``\nhad to be nested in ``try``...``finally``.\n\nThe ``except`` clause(s) specify one or more exception handlers. When\nno exception occurs in the ``try`` clause, no exception handler is\nexecuted. When an exception occurs in the ``try`` suite, a search for\nan exception handler is started. This search inspects the except\nclauses in turn until one is found that matches the exception. An\nexpression-less except clause, if present, must be last; it matches\nany exception. For an except clause with an expression, that\nexpression is evaluated, and the clause matches the exception if the\nresulting object is "compatible" with the exception. An object is\ncompatible with an exception if it is the class or a base class of the\nexception object, a tuple containing an item compatible with the\nexception, or, in the (deprecated) case of string exceptions, is the\nraised string itself (note that the object identities must match, i.e.\nit must be the same string object, not just a string with the same\nvalue).\n\nIf no except clause matches the exception, the search for an exception\nhandler continues in the surrounding code and on the invocation stack.\n[1]\n\nIf the evaluation of an expression in the header of an except clause\nraises an exception, the original search for a handler is canceled and\na search starts for the new exception in the surrounding code and on\nthe call stack (it is treated as if the entire ``try`` statement\nraised the exception).\n\nWhen a matching except clause is found, the exception is assigned to\nthe target specified in that except clause, if present, and the except\nclause\'s suite is executed. All except clauses must have an\nexecutable block. When the end of this block is reached, execution\ncontinues normally after the entire try statement. (This means that\nif two nested handlers exist for the same exception, and the exception\noccurs in the try clause of the inner handler, the outer handler will\nnot handle the exception.)\n\nBefore an except clause\'s suite is executed, details about the\nexception are assigned to three variables in the ``sys`` module:\n``sys.exc_type`` receives the object identifying the exception;\n``sys.exc_value`` receives the exception\'s parameter;\n``sys.exc_traceback`` receives a traceback object (see section *The\nstandard type hierarchy*) identifying the point in the program where\nthe exception occurred. These details are also available through the\n``sys.exc_info()`` function, which returns a tuple ``(exc_type,\nexc_value, exc_traceback)``. Use of the corresponding variables is\ndeprecated in favor of this function, since their use is unsafe in a\nthreaded program. As of Python 1.5, the variables are restored to\ntheir previous values (before the call) when returning from a function\nthat handled an exception.\n\nThe optional ``else`` clause is executed if and when control flows off\nthe end of the ``try`` clause. [2] Exceptions in the ``else`` clause\nare not handled by the preceding ``except`` clauses.\n\nIf ``finally`` is present, it specifies a \'cleanup\' handler. The\n``try`` clause is executed, including any ``except`` and ``else``\nclauses. If an exception occurs in any of the clauses and is not\nhandled, the exception is temporarily saved. The ``finally`` clause is\nexecuted. If there is a saved exception, it is re-raised at the end\nof the ``finally`` clause. If the ``finally`` clause raises another\nexception or executes a ``return`` or ``break`` statement, the saved\nexception is lost. The exception information is not available to the\nprogram during execution of the ``finally`` clause.\n\nWhen a ``return``, ``break`` or ``continue`` statement is executed in\nthe ``try`` suite of a ``try``...``finally`` statement, the\n``finally`` clause is also executed \'on the way out.\' A ``continue``\nstatement is illegal in the ``finally`` clause. (The reason is a\nproblem with the current implementation --- this restriction may be\nlifted in the future).\n\nAdditional information on exceptions can be found in section\n*Exceptions*, and information on using the ``raise`` statement to\ngenerate exceptions may be found in section *The raise statement*.\n\n\nThe ``with`` statement\n======================\n\nNew in version 2.5.\n\nThe ``with`` statement is used to wrap the execution of a block with\nmethods defined by a context manager (see section *With Statement\nContext Managers*). This allows common\n``try``...``except``...``finally`` usage patterns to be encapsulated\nfor convenient reuse.\n\n with_stmt ::= "with" expression ["as" target] ":" suite\n\nThe execution of the ``with`` statement proceeds as follows:\n\n1. The context expression is evaluated to obtain a context manager.\n\n2. The context manager\'s ``__enter__()`` method is invoked.\n\n3. If a target was included in the ``with`` statement, the return\n value from ``__enter__()`` is assigned to it.\n\n Note: The ``with`` statement guarantees that if the ``__enter__()``\n method returns without an error, then ``__exit__()`` will always\n be called. Thus, if an error occurs during the assignment to the\n target list, it will be treated the same as an error occurring\n within the suite would be. See step 5 below.\n\n4. The suite is executed.\n\n5. The context manager\'s ``__exit__()`` method is invoked. If an\n exception caused the suite to be exited, its type, value, and\n traceback are passed as arguments to ``__exit__()``. Otherwise,\n three ``None`` arguments are supplied.\n\n If the suite was exited due to an exception, and the return value\n from the ``__exit__()`` method was false, the exception is\n reraised. If the return value was true, the exception is\n suppressed, and execution continues with the statement following\n the ``with`` statement.\n\n If the suite was exited for any reason other than an exception, the\n return value from ``__exit__()`` is ignored, and execution proceeds\n at the normal location for the kind of exit that was taken.\n\nNote: In Python 2.5, the ``with`` statement is only allowed when the\n ``with_statement`` feature has been enabled. It is always enabled\n in Python 2.6.\n\nSee also:\n\n **PEP 0343** - The "with" statement\n The specification, background, and examples for the Python\n ``with`` statement.\n\n\nFunction definitions\n====================\n\nA function definition defines a user-defined function object (see\nsection *The standard type hierarchy*):\n\n decorated ::= decorators (classdef | funcdef)\n decorators ::= decorator+\n decorator ::= "@" dotted_name ["(" [argument_list [","]] ")"] NEWLINE\n funcdef ::= "def" funcname "(" [parameter_list] ")" ":" suite\n dotted_name ::= identifier ("." identifier)*\n parameter_list ::= (defparameter ",")*\n ( "*" identifier [, "**" identifier]\n | "**" identifier\n | defparameter [","] )\n defparameter ::= parameter ["=" expression]\n sublist ::= parameter ("," parameter)* [","]\n parameter ::= identifier | "(" sublist ")"\n funcname ::= identifier\n\nA function definition is an executable statement. Its execution binds\nthe function name in the current local namespace to a function object\n(a wrapper around the executable code for the function). This\nfunction object contains a reference to the current global namespace\nas the global namespace to be used when the function is called.\n\nThe function definition does not execute the function body; this gets\nexecuted only when the function is called. [3]\n\nA function definition may be wrapped by one or more *decorator*\nexpressions. Decorator expressions are evaluated when the function is\ndefined, in the scope that contains the function definition. The\nresult must be a callable, which is invoked with the function object\nas the only argument. The returned value is bound to the function name\ninstead of the function object. Multiple decorators are applied in\nnested fashion. For example, the following code:\n\n @f1(arg)\n @f2\n def func(): pass\n\nis equivalent to:\n\n def func(): pass\n func = f1(arg)(f2(func))\n\nWhen one or more top-level parameters have the form *parameter* ``=``\n*expression*, the function is said to have "default parameter values."\nFor a parameter with a default value, the corresponding argument may\nbe omitted from a call, in which case the parameter\'s default value is\nsubstituted. If a parameter has a default value, all following\nparameters must also have a default value --- this is a syntactic\nrestriction that is not expressed by the grammar.\n\n**Default parameter values are evaluated when the function definition\nis executed.** This means that the expression is evaluated once, when\nthe function is defined, and that that same "pre-computed" value is\nused for each call. This is especially important to understand when a\ndefault parameter is a mutable object, such as a list or a dictionary:\nif the function modifies the object (e.g. by appending an item to a\nlist), the default value is in effect modified. This is generally not\nwhat was intended. A way around this is to use ``None`` as the\ndefault, and explicitly test for it in the body of the function, e.g.:\n\n def whats_on_the_telly(penguin=None):\n if penguin is None:\n penguin = []\n penguin.append("property of the zoo")\n return penguin\n\nFunction call semantics are described in more detail in section\n*Calls*. A function call always assigns values to all parameters\nmentioned in the parameter list, either from position arguments, from\nkeyword arguments, or from default values. If the form\n"``*identifier``" is present, it is initialized to a tuple receiving\nany excess positional parameters, defaulting to the empty tuple. If\nthe form "``**identifier``" is present, it is initialized to a new\ndictionary receiving any excess keyword arguments, defaulting to a new\nempty dictionary.\n\nIt is also possible to create anonymous functions (functions not bound\nto a name), for immediate use in expressions. This uses lambda forms,\ndescribed in section *Expression lists*. Note that the lambda form is\nmerely a shorthand for a simplified function definition; a function\ndefined in a "``def``" statement can be passed around or assigned to\nanother name just like a function defined by a lambda form. The\n"``def``" form is actually more powerful since it allows the execution\nof multiple statements.\n\n**Programmer\'s note:** Functions are first-class objects. A "``def``"\nform executed inside a function definition defines a local function\nthat can be returned or passed around. Free variables used in the\nnested function can access the local variables of the function\ncontaining the def. See section *Naming and binding* for details.\n\n\nClass definitions\n=================\n\nA class definition defines a class object (see section *The standard\ntype hierarchy*):\n\n classdef ::= "class" classname [inheritance] ":" suite\n inheritance ::= "(" [expression_list] ")"\n classname ::= identifier\n\nA class definition is an executable statement. It first evaluates the\ninheritance list, if present. Each item in the inheritance list\nshould evaluate to a class object or class type which allows\nsubclassing. The class\'s suite is then executed in a new execution\nframe (see section *Naming and binding*), using a newly created local\nnamespace and the original global namespace. (Usually, the suite\ncontains only function definitions.) When the class\'s suite finishes\nexecution, its execution frame is discarded but its local namespace is\nsaved. [4] A class object is then created using the inheritance list\nfor the base classes and the saved local namespace for the attribute\ndictionary. The class name is bound to this class object in the\noriginal local namespace.\n\n**Programmer\'s note:** Variables defined in the class definition are\nclass variables; they are shared by all instances. To create instance\nvariables, they can be set in a method with ``self.name = value``.\nBoth class and instance variables are accessible through the notation\n"``self.name``", and an instance variable hides a class variable with\nthe same name when accessed in this way. Class variables can be used\nas defaults for instance variables, but using mutable values there can\nlead to unexpected results. For *new-style class*es, descriptors can\nbe used to create instance variables with different implementation\ndetails.\n\nClass definitions, like function definitions, may be wrapped by one or\nmore *decorator* expressions. The evaluation rules for the decorator\nexpressions are the same as for functions. The result must be a class\nobject, which is then bound to the class name.\n\n-[ Footnotes ]-\n\n[1] The exception is propagated to the invocation stack only if there\n is no ``finally`` clause that negates the exception.\n\n[2] Currently, control "flows off the end" except in the case of an\n exception or the execution of a ``return``, ``continue``, or\n ``break`` statement.\n\n[3] A string literal appearing as the first statement in the function\n body is transformed into the function\'s ``__doc__`` attribute and\n therefore the function\'s *docstring*.\n\n[4] A string literal appearing as the first statement in the class\n body is transformed into the namespace\'s ``__doc__`` item and\n therefore the class\'s *docstring*.\n', + 'context-managers': u'\nWith Statement Context Managers\n*******************************\n\nNew in version 2.5.\n\nA *context manager* is an object that defines the runtime context to\nbe established when executing a ``with`` statement. The context\nmanager handles the entry into, and the exit from, the desired runtime\ncontext for the execution of the block of code. Context managers are\nnormally invoked using the ``with`` statement (described in section\n*The with statement*), but can also be used by directly invoking their\nmethods.\n\nTypical uses of context managers include saving and restoring various\nkinds of global state, locking and unlocking resources, closing opened\nfiles, etc.\n\nFor more information on context managers, see *Context Manager Types*.\n\nobject.__enter__(self)\n\n Enter the runtime context related to this object. The ``with``\n statement will bind this method\'s return value to the target(s)\n specified in the ``as`` clause of the statement, if any.\n\nobject.__exit__(self, exc_type, exc_value, traceback)\n\n Exit the runtime context related to this object. The parameters\n describe the exception that caused the context to be exited. If the\n context was exited without an exception, all three arguments will\n be ``None``.\n\n If an exception is supplied, and the method wishes to suppress the\n exception (i.e., prevent it from being propagated), it should\n return a true value. Otherwise, the exception will be processed\n normally upon exit from this method.\n\n Note that ``__exit__()`` methods should not reraise the passed-in\n exception; this is the caller\'s responsibility.\n\nSee also:\n\n **PEP 0343** - The "with" statement\n The specification, background, and examples for the Python\n ``with`` statement.\n', 'continue': u'\nThe ``continue`` statement\n**************************\n\n continue_stmt ::= "continue"\n\n``continue`` may only occur syntactically nested in a ``for`` or\n``while`` loop, but not nested in a function or class definition or\n``finally`` clause within that loop. It continues with the next cycle\nof the nearest enclosing loop.\n\nWhen ``continue`` passes control out of a ``try`` statement with a\n``finally`` clause, that ``finally`` clause is executed before really\nstarting the next loop cycle.\n', 'conversions': u'\nArithmetic conversions\n**********************\n\nWhen a description of an arithmetic operator below uses the phrase\n"the numeric arguments are converted to a common type," the arguments\nare coerced using the coercion rules listed at *Coercion rules*. If\nboth arguments are standard numeric types, the following coercions are\napplied:\n\n* If either argument is a complex number, the other is converted to\n complex;\n\n* otherwise, if either argument is a floating point number, the other\n is converted to floating point;\n\n* otherwise, if either argument is a long integer, the other is\n converted to long integer;\n\n* otherwise, both must be plain integers and no conversion is\n necessary.\n\nSome additional rules apply for certain operators (e.g., a string left\nargument to the \'%\' operator). Extensions can define their own\ncoercions.\n', - 'customization': u'\nBasic customization\n*******************\n\nobject.__new__(cls[, ...])\n\n Called to create a new instance of class *cls*. ``__new__()`` is a\n static method (special-cased so you need not declare it as such)\n that takes the class of which an instance was requested as its\n first argument. The remaining arguments are those passed to the\n object constructor expression (the call to the class). The return\n value of ``__new__()`` should be the new object instance (usually\n an instance of *cls*).\n\n Typical implementations create a new instance of the class by\n invoking the superclass\'s ``__new__()`` method using\n ``super(currentclass, cls).__new__(cls[, ...])`` with appropriate\n arguments and then modifying the newly-created instance as\n necessary before returning it.\n\n If ``__new__()`` returns an instance of *cls*, then the new\n instance\'s ``__init__()`` method will be invoked like\n ``__init__(self[, ...])``, where *self* is the new instance and the\n remaining arguments are the same as were passed to ``__new__()``.\n\n If ``__new__()`` does not return an instance of *cls*, then the new\n instance\'s ``__init__()`` method will not be invoked.\n\n ``__new__()`` is intended mainly to allow subclasses of immutable\n types (like int, str, or tuple) to customize instance creation. It\n is also commonly overridden in custom metaclasses in order to\n customize class creation.\n\nobject.__init__(self[, ...])\n\n Called when the instance is created. The arguments are those\n passed to the class constructor expression. If a base class has an\n ``__init__()`` method, the derived class\'s ``__init__()`` method,\n if any, must explicitly call it to ensure proper initialization of\n the base class part of the instance; for example:\n ``BaseClass.__init__(self, [args...])``. As a special constraint\n on constructors, no value may be returned; doing so will cause a\n ``TypeError`` to be raised at runtime.\n\nobject.__del__(self)\n\n Called when the instance is about to be destroyed. This is also\n called a destructor. If a base class has a ``__del__()`` method,\n the derived class\'s ``__del__()`` method, if any, must explicitly\n call it to ensure proper deletion of the base class part of the\n instance. Note that it is possible (though not recommended!) for\n the ``__del__()`` method to postpone destruction of the instance by\n creating a new reference to it. It may then be called at a later\n time when this new reference is deleted. It is not guaranteed that\n ``__del__()`` methods are called for objects that still exist when\n the interpreter exits.\n\n Note: ``del x`` doesn\'t directly call ``x.__del__()`` --- the former\n decrements the reference count for ``x`` by one, and the latter\n is only called when ``x``\'s reference count reaches zero. Some\n common situations that may prevent the reference count of an\n object from going to zero include: circular references between\n objects (e.g., a doubly-linked list or a tree data structure with\n parent and child pointers); a reference to the object on the\n stack frame of a function that caught an exception (the traceback\n stored in ``sys.exc_traceback`` keeps the stack frame alive); or\n a reference to the object on the stack frame that raised an\n unhandled exception in interactive mode (the traceback stored in\n ``sys.last_traceback`` keeps the stack frame alive). The first\n situation can only be remedied by explicitly breaking the cycles;\n the latter two situations can be resolved by storing ``None`` in\n ``sys.exc_traceback`` or ``sys.last_traceback``. Circular\n references which are garbage are detected when the option cycle\n detector is enabled (it\'s on by default), but can only be cleaned\n up if there are no Python-level ``__del__()`` methods involved.\n Refer to the documentation for the ``gc`` module for more\n information about how ``__del__()`` methods are handled by the\n cycle detector, particularly the description of the ``garbage``\n value.\n\n Warning: Due to the precarious circumstances under which ``__del__()``\n methods are invoked, exceptions that occur during their execution\n are ignored, and a warning is printed to ``sys.stderr`` instead.\n Also, when ``__del__()`` is invoked in response to a module being\n deleted (e.g., when execution of the program is done), other\n globals referenced by the ``__del__()`` method may already have\n been deleted. For this reason, ``__del__()`` methods should do\n the absolute minimum needed to maintain external invariants.\n Starting with version 1.5, Python guarantees that globals whose\n name begins with a single underscore are deleted from their\n module before other globals are deleted; if no other references\n to such globals exist, this may help in assuring that imported\n modules are still available at the time when the ``__del__()``\n method is called.\n\nobject.__repr__(self)\n\n Called by the ``repr()`` built-in function and by string\n conversions (reverse quotes) to compute the "official" string\n representation of an object. If at all possible, this should look\n like a valid Python expression that could be used to recreate an\n object with the same value (given an appropriate environment). If\n this is not possible, a string of the form ``<...some useful\n description...>`` should be returned. The return value must be a\n string object. If a class defines ``__repr__()`` but not\n ``__str__()``, then ``__repr__()`` is also used when an "informal"\n string representation of instances of that class is required.\n\n This is typically used for debugging, so it is important that the\n representation is information-rich and unambiguous.\n\nobject.__str__(self)\n\n Called by the ``str()`` built-in function and by the ``print``\n statement to compute the "informal" string representation of an\n object. This differs from ``__repr__()`` in that it does not have\n to be a valid Python expression: a more convenient or concise\n representation may be used instead. The return value must be a\n string object.\n\nobject.__lt__(self, other)\nobject.__le__(self, other)\nobject.__eq__(self, other)\nobject.__ne__(self, other)\nobject.__gt__(self, other)\nobject.__ge__(self, other)\n\n Added in version 2.1.\n\n These are the so-called "rich comparison" methods, and are called\n for comparison operators in preference to ``__cmp__()`` below. The\n correspondence between operator symbols and method names is as\n follows: ``xy`` call ``x.__ne__(y)``, ``x>y`` calls ``x.__gt__(y)``, and\n ``x>=y`` calls ``x.__ge__(y)``.\n\n A rich comparison method may return the singleton\n ``NotImplemented`` if it does not implement the operation for a\n given pair of arguments. By convention, ``False`` and ``True`` are\n returned for a successful comparison. However, these methods can\n return any value, so if the comparison operator is used in a\n Boolean context (e.g., in the condition of an ``if`` statement),\n Python will call ``bool()`` on the value to determine if the result\n is true or false.\n\n There are no implied relationships among the comparison operators.\n The truth of ``x==y`` does not imply that ``x!=y`` is false.\n Accordingly, when defining ``__eq__()``, one should also define\n ``__ne__()`` so that the operators will behave as expected. See\n the paragraph on ``__hash__()`` for some important notes on\n creating *hashable* objects which support custom comparison\n operations and are usable as dictionary keys.\n\n There are no swapped-argument versions of these methods (to be used\n when the left argument does not support the operation but the right\n argument does); rather, ``__lt__()`` and ``__gt__()`` are each\n other\'s reflection, ``__le__()`` and ``__ge__()`` are each other\'s\n reflection, and ``__eq__()`` and ``__ne__()`` are their own\n reflection.\n\n Arguments to rich comparison methods are never coerced.\n\nobject.__cmp__(self, other)\n\n Called by comparison operations if rich comparison (see above) is\n not defined. Should return a negative integer if ``self < other``,\n zero if ``self == other``, a positive integer if ``self > other``.\n If no ``__cmp__()``, ``__eq__()`` or ``__ne__()`` operation is\n defined, class instances are compared by object identity\n ("address"). See also the description of ``__hash__()`` for some\n important notes on creating *hashable* objects which support custom\n comparison operations and are usable as dictionary keys. (Note: the\n restriction that exceptions are not propagated by ``__cmp__()`` has\n been removed since Python 1.5.)\n\nobject.__rcmp__(self, other)\n\n Changed in version 2.1: No longer supported.\n\nobject.__hash__(self)\n\n Called for the key object for dictionary operations, and by the\n built-in function ``hash()``. Should return an integer usable as a\n hash value for dictionary operations. The only required property\n is that objects which compare equal have the same hash value; it is\n advised to somehow mix together (e.g., using exclusive or) the hash\n values for the components of the object that also play a part in\n comparison of objects.\n\n If a class does not define a ``__cmp__()`` or ``__eq__()`` method\n it should not define a ``__hash__()`` operation either; if it\n defines ``__cmp__()`` or ``__eq__()`` but not ``__hash__()``, its\n instances will not be usable as dictionary keys. If a class\n defines mutable objects and implements a ``__cmp__()`` or\n ``__eq__()`` method, it should not implement ``__hash__()``, since\n the dictionary implementation requires that a key\'s hash value is\n immutable (if the object\'s hash value changes, it will be in the\n wrong hash bucket).\n\n User-defined classes have ``__cmp__()`` and ``__hash__()`` methods\n by default; with them, all objects compare unequal and\n ``x.__hash__()`` returns ``id(x)``.\n\n Changed in version 2.5: ``__hash__()`` may now also return a long\n integer object; the 32-bit integer is then derived from the hash of\n that object.\n\nobject.__nonzero__(self)\n\n Called to implement truth value testing, and the built-in operation\n ``bool()``; should return ``False`` or ``True``, or their integer\n equivalents ``0`` or ``1``. When this method is not defined,\n ``__len__()`` is called, if it is defined (see below). If a class\n defines neither ``__len__()`` nor ``__nonzero__()``, all its\n instances are considered true.\n\nobject.__unicode__(self)\n\n Called to implement ``unicode()`` builtin; should return a Unicode\n object. When this method is not defined, string conversion is\n attempted, and the result of string conversion is converted to\n Unicode using the system default encoding.\n', - 'debugger': u'\n``pdb`` --- The Python Debugger\n*******************************\n\nThe module ``pdb`` defines an interactive source code debugger for\nPython programs. It supports setting (conditional) breakpoints and\nsingle stepping at the source line level, inspection of stack frames,\nsource code listing, and evaluation of arbitrary Python code in the\ncontext of any stack frame. It also supports post-mortem debugging\nand can be called under program control.\n\nThe debugger is extensible --- it is actually defined as the class\n``Pdb``. This is currently undocumented but easily understood by\nreading the source. The extension interface uses the modules ``bdb``\n(undocumented) and ``cmd``.\n\nThe debugger\'s prompt is ``(Pdb)``. Typical usage to run a program\nunder control of the debugger is:\n\n >>> import pdb\n >>> import mymodule\n >>> pdb.run(\'mymodule.test()\')\n > (0)?()\n (Pdb) continue\n > (1)?()\n (Pdb) continue\n NameError: \'spam\'\n > (1)?()\n (Pdb)\n\n``pdb.py`` can also be invoked as a script to debug other scripts.\nFor example:\n\n python -m pdb myscript.py\n\nWhen invoked as a script, pdb will automatically enter post-mortem\ndebugging if the program being debugged exits abnormally. After post-\nmortem debugging (or after normal exit of the program), pdb will\nrestart the program. Automatic restarting preserves pdb\'s state (such\nas breakpoints) and in most cases is more useful than quitting the\ndebugger upon program\'s exit.\n\nAdded in version 2.4: Restarting post-mortem behavior added.\n\nTypical usage to inspect a crashed program is:\n\n >>> import pdb\n >>> import mymodule\n >>> mymodule.test()\n Traceback (most recent call last):\n File "", line 1, in ?\n File "./mymodule.py", line 4, in test\n test2()\n File "./mymodule.py", line 3, in test2\n print spam\n NameError: spam\n >>> pdb.pm()\n > ./mymodule.py(3)test2()\n -> print spam\n (Pdb)\n\nThe module defines the following functions; each enters the debugger\nin a slightly different way:\n\npdb.run(statement[, globals[, locals]])\n\n Execute the *statement* (given as a string) under debugger control.\n The debugger prompt appears before any code is executed; you can\n set breakpoints and type ``continue``, or you can step through the\n statement using ``step`` or ``next`` (all these commands are\n explained below). The optional *globals* and *locals* arguments\n specify the environment in which the code is executed; by default\n the dictionary of the module ``__main__`` is used. (See the\n explanation of the ``exec`` statement or the ``eval()`` built-in\n function.)\n\npdb.runeval(expression[, globals[, locals]])\n\n Evaluate the *expression* (given as a string) under debugger\n control. When ``runeval()`` returns, it returns the value of the\n expression. Otherwise this function is similar to ``run()``.\n\npdb.runcall(function[, argument, ...])\n\n Call the *function* (a function or method object, not a string)\n with the given arguments. When ``runcall()`` returns, it returns\n whatever the function call returned. The debugger prompt appears\n as soon as the function is entered.\n\npdb.set_trace()\n\n Enter the debugger at the calling stack frame. This is useful to\n hard-code a breakpoint at a given point in a program, even if the\n code is not otherwise being debugged (e.g. when an assertion\n fails).\n\npdb.post_mortem([traceback])\n\n Enter post-mortem debugging of the given *traceback* object. If no\n *traceback* is given, it uses the one of the exception that is\n currently being handled (an exception must be being handled if the\n default is to be used).\n\npdb.pm()\n\n Enter post-mortem debugging of the traceback found in\n ``sys.last_traceback``.\n', + 'customization': u'\nBasic customization\n*******************\n\nobject.__new__(cls[, ...])\n\n Called to create a new instance of class *cls*. ``__new__()`` is a\n static method (special-cased so you need not declare it as such)\n that takes the class of which an instance was requested as its\n first argument. The remaining arguments are those passed to the\n object constructor expression (the call to the class). The return\n value of ``__new__()`` should be the new object instance (usually\n an instance of *cls*).\n\n Typical implementations create a new instance of the class by\n invoking the superclass\'s ``__new__()`` method using\n ``super(currentclass, cls).__new__(cls[, ...])`` with appropriate\n arguments and then modifying the newly-created instance as\n necessary before returning it.\n\n If ``__new__()`` returns an instance of *cls*, then the new\n instance\'s ``__init__()`` method will be invoked like\n ``__init__(self[, ...])``, where *self* is the new instance and the\n remaining arguments are the same as were passed to ``__new__()``.\n\n If ``__new__()`` does not return an instance of *cls*, then the new\n instance\'s ``__init__()`` method will not be invoked.\n\n ``__new__()`` is intended mainly to allow subclasses of immutable\n types (like int, str, or tuple) to customize instance creation. It\n is also commonly overridden in custom metaclasses in order to\n customize class creation.\n\nobject.__init__(self[, ...])\n\n Called when the instance is created. The arguments are those\n passed to the class constructor expression. If a base class has an\n ``__init__()`` method, the derived class\'s ``__init__()`` method,\n if any, must explicitly call it to ensure proper initialization of\n the base class part of the instance; for example:\n ``BaseClass.__init__(self, [args...])``. As a special constraint\n on constructors, no value may be returned; doing so will cause a\n ``TypeError`` to be raised at runtime.\n\nobject.__del__(self)\n\n Called when the instance is about to be destroyed. This is also\n called a destructor. If a base class has a ``__del__()`` method,\n the derived class\'s ``__del__()`` method, if any, must explicitly\n call it to ensure proper deletion of the base class part of the\n instance. Note that it is possible (though not recommended!) for\n the ``__del__()`` method to postpone destruction of the instance by\n creating a new reference to it. It may then be called at a later\n time when this new reference is deleted. It is not guaranteed that\n ``__del__()`` methods are called for objects that still exist when\n the interpreter exits.\n\n Note: ``del x`` doesn\'t directly call ``x.__del__()`` --- the former\n decrements the reference count for ``x`` by one, and the latter\n is only called when ``x``\'s reference count reaches zero. Some\n common situations that may prevent the reference count of an\n object from going to zero include: circular references between\n objects (e.g., a doubly-linked list or a tree data structure with\n parent and child pointers); a reference to the object on the\n stack frame of a function that caught an exception (the traceback\n stored in ``sys.exc_traceback`` keeps the stack frame alive); or\n a reference to the object on the stack frame that raised an\n unhandled exception in interactive mode (the traceback stored in\n ``sys.last_traceback`` keeps the stack frame alive). The first\n situation can only be remedied by explicitly breaking the cycles;\n the latter two situations can be resolved by storing ``None`` in\n ``sys.exc_traceback`` or ``sys.last_traceback``. Circular\n references which are garbage are detected when the option cycle\n detector is enabled (it\'s on by default), but can only be cleaned\n up if there are no Python-level ``__del__()`` methods involved.\n Refer to the documentation for the ``gc`` module for more\n information about how ``__del__()`` methods are handled by the\n cycle detector, particularly the description of the ``garbage``\n value.\n\n Warning: Due to the precarious circumstances under which ``__del__()``\n methods are invoked, exceptions that occur during their execution\n are ignored, and a warning is printed to ``sys.stderr`` instead.\n Also, when ``__del__()`` is invoked in response to a module being\n deleted (e.g., when execution of the program is done), other\n globals referenced by the ``__del__()`` method may already have\n been deleted. For this reason, ``__del__()`` methods should do\n the absolute minimum needed to maintain external invariants.\n Starting with version 1.5, Python guarantees that globals whose\n name begins with a single underscore are deleted from their\n module before other globals are deleted; if no other references\n to such globals exist, this may help in assuring that imported\n modules are still available at the time when the ``__del__()``\n method is called.\n\nobject.__repr__(self)\n\n Called by the ``repr()`` built-in function and by string\n conversions (reverse quotes) to compute the "official" string\n representation of an object. If at all possible, this should look\n like a valid Python expression that could be used to recreate an\n object with the same value (given an appropriate environment). If\n this is not possible, a string of the form ``<...some useful\n description...>`` should be returned. The return value must be a\n string object. If a class defines ``__repr__()`` but not\n ``__str__()``, then ``__repr__()`` is also used when an "informal"\n string representation of instances of that class is required.\n\n This is typically used for debugging, so it is important that the\n representation is information-rich and unambiguous.\n\nobject.__str__(self)\n\n Called by the ``str()`` built-in function and by the ``print``\n statement to compute the "informal" string representation of an\n object. This differs from ``__repr__()`` in that it does not have\n to be a valid Python expression: a more convenient or concise\n representation may be used instead. The return value must be a\n string object.\n\nobject.__lt__(self, other)\nobject.__le__(self, other)\nobject.__eq__(self, other)\nobject.__ne__(self, other)\nobject.__gt__(self, other)\nobject.__ge__(self, other)\n\n New in version 2.1.\n\n These are the so-called "rich comparison" methods, and are called\n for comparison operators in preference to ``__cmp__()`` below. The\n correspondence between operator symbols and method names is as\n follows: ``xy`` call ``x.__ne__(y)``, ``x>y`` calls ``x.__gt__(y)``, and\n ``x>=y`` calls ``x.__ge__(y)``.\n\n A rich comparison method may return the singleton\n ``NotImplemented`` if it does not implement the operation for a\n given pair of arguments. By convention, ``False`` and ``True`` are\n returned for a successful comparison. However, these methods can\n return any value, so if the comparison operator is used in a\n Boolean context (e.g., in the condition of an ``if`` statement),\n Python will call ``bool()`` on the value to determine if the result\n is true or false.\n\n There are no implied relationships among the comparison operators.\n The truth of ``x==y`` does not imply that ``x!=y`` is false.\n Accordingly, when defining ``__eq__()``, one should also define\n ``__ne__()`` so that the operators will behave as expected. See\n the paragraph on ``__hash__()`` for some important notes on\n creating *hashable* objects which support custom comparison\n operations and are usable as dictionary keys.\n\n There are no swapped-argument versions of these methods (to be used\n when the left argument does not support the operation but the right\n argument does); rather, ``__lt__()`` and ``__gt__()`` are each\n other\'s reflection, ``__le__()`` and ``__ge__()`` are each other\'s\n reflection, and ``__eq__()`` and ``__ne__()`` are their own\n reflection.\n\n Arguments to rich comparison methods are never coerced.\n\nobject.__cmp__(self, other)\n\n Called by comparison operations if rich comparison (see above) is\n not defined. Should return a negative integer if ``self < other``,\n zero if ``self == other``, a positive integer if ``self > other``.\n If no ``__cmp__()``, ``__eq__()`` or ``__ne__()`` operation is\n defined, class instances are compared by object identity\n ("address"). See also the description of ``__hash__()`` for some\n important notes on creating *hashable* objects which support custom\n comparison operations and are usable as dictionary keys. (Note: the\n restriction that exceptions are not propagated by ``__cmp__()`` has\n been removed since Python 1.5.)\n\nobject.__rcmp__(self, other)\n\n Changed in version 2.1: No longer supported.\n\nobject.__hash__(self)\n\n Called for the key object for dictionary operations, and by the\n built-in function ``hash()``. Should return an integer usable as a\n hash value for dictionary operations. The only required property\n is that objects which compare equal have the same hash value; it is\n advised to somehow mix together (e.g., using exclusive or) the hash\n values for the components of the object that also play a part in\n comparison of objects.\n\n If a class does not define a ``__cmp__()`` or ``__eq__()`` method\n it should not define a ``__hash__()`` operation either; if it\n defines ``__cmp__()`` or ``__eq__()`` but not ``__hash__()``, its\n instances will not be usable as dictionary keys. If a class\n defines mutable objects and implements a ``__cmp__()`` or\n ``__eq__()`` method, it should not implement ``__hash__()``, since\n the dictionary implementation requires that a key\'s hash value is\n immutable (if the object\'s hash value changes, it will be in the\n wrong hash bucket).\n\n User-defined classes have ``__cmp__()`` and ``__hash__()`` methods\n by default; with them, all objects compare unequal (except with\n themselves) and ``x.__hash__()`` returns ``id(x)``.\n\n Classes which inherit a ``__hash__()`` method from a parent class\n but change the meaning of ``__cmp__()`` or ``__eq__()`` such that\n the hash value returned is no longer appropriate (e.g. by switching\n to a value-based concept of equality instead of the default\n identity based equality) can explicitly flag themselves as being\n unhashable by setting ``__hash__ = None`` in the class definition.\n Doing so means that not only will instances of the class raise an\n appropriate ``TypeError`` when a program attempts to retrieve their\n hash value, but they will also be correctly identified as\n unhashable when checking ``isinstance(obj, collections.Hashable)``\n (unlike classes which define their own ``__hash__()`` to explicitly\n raise ``TypeError``).\n\n Changed in version 2.5: ``__hash__()`` may now also return a long\n integer object; the 32-bit integer is then derived from the hash of\n that object.\n\n Changed in version 2.6: ``__hash__`` may now be set to ``None`` to\n explicitly flag instances of a class as unhashable.\n\nobject.__nonzero__(self)\n\n Called to implement truth value testing, and the built-in operation\n ``bool()``; should return ``False`` or ``True``, or their integer\n equivalents ``0`` or ``1``. When this method is not defined,\n ``__len__()`` is called, if it is defined (see below). If a class\n defines neither ``__len__()`` nor ``__nonzero__()``, all its\n instances are considered true.\n\nobject.__unicode__(self)\n\n Called to implement ``unicode()`` builtin; should return a Unicode\n object. When this method is not defined, string conversion is\n attempted, and the result of string conversion is converted to\n Unicode using the system default encoding.\n', + 'debugger': u'\n``pdb`` --- The Python Debugger\n*******************************\n\nThe module ``pdb`` defines an interactive source code debugger for\nPython programs. It supports setting (conditional) breakpoints and\nsingle stepping at the source line level, inspection of stack frames,\nsource code listing, and evaluation of arbitrary Python code in the\ncontext of any stack frame. It also supports post-mortem debugging\nand can be called under program control.\n\nThe debugger is extensible --- it is actually defined as the class\n``Pdb``. This is currently undocumented but easily understood by\nreading the source. The extension interface uses the modules ``bdb``\n(undocumented) and ``cmd``.\n\nThe debugger\'s prompt is ``(Pdb)``. Typical usage to run a program\nunder control of the debugger is:\n\n >>> import pdb\n >>> import mymodule\n >>> pdb.run(\'mymodule.test()\')\n > (0)?()\n (Pdb) continue\n > (1)?()\n (Pdb) continue\n NameError: \'spam\'\n > (1)?()\n (Pdb)\n\n``pdb.py`` can also be invoked as a script to debug other scripts.\nFor example:\n\n python -m pdb myscript.py\n\nWhen invoked as a script, pdb will automatically enter post-mortem\ndebugging if the program being debugged exits abnormally. After post-\nmortem debugging (or after normal exit of the program), pdb will\nrestart the program. Automatic restarting preserves pdb\'s state (such\nas breakpoints) and in most cases is more useful than quitting the\ndebugger upon program\'s exit.\n\nNew in version 2.4: Restarting post-mortem behavior added.\n\nTypical usage to inspect a crashed program is:\n\n >>> import pdb\n >>> import mymodule\n >>> mymodule.test()\n Traceback (most recent call last):\n File "", line 1, in ?\n File "./mymodule.py", line 4, in test\n test2()\n File "./mymodule.py", line 3, in test2\n print spam\n NameError: spam\n >>> pdb.pm()\n > ./mymodule.py(3)test2()\n -> print spam\n (Pdb)\n\nThe module defines the following functions; each enters the debugger\nin a slightly different way:\n\npdb.run(statement[, globals[, locals]])\n\n Execute the *statement* (given as a string) under debugger control.\n The debugger prompt appears before any code is executed; you can\n set breakpoints and type ``continue``, or you can step through the\n statement using ``step`` or ``next`` (all these commands are\n explained below). The optional *globals* and *locals* arguments\n specify the environment in which the code is executed; by default\n the dictionary of the module ``__main__`` is used. (See the\n explanation of the ``exec`` statement or the ``eval()`` built-in\n function.)\n\npdb.runeval(expression[, globals[, locals]])\n\n Evaluate the *expression* (given as a string) under debugger\n control. When ``runeval()`` returns, it returns the value of the\n expression. Otherwise this function is similar to ``run()``.\n\npdb.runcall(function[, argument, ...])\n\n Call the *function* (a function or method object, not a string)\n with the given arguments. When ``runcall()`` returns, it returns\n whatever the function call returned. The debugger prompt appears\n as soon as the function is entered.\n\npdb.set_trace()\n\n Enter the debugger at the calling stack frame. This is useful to\n hard-code a breakpoint at a given point in a program, even if the\n code is not otherwise being debugged (e.g. when an assertion\n fails).\n\npdb.post_mortem([traceback])\n\n Enter post-mortem debugging of the given *traceback* object. If no\n *traceback* is given, it uses the one of the exception that is\n currently being handled (an exception must be being handled if the\n default is to be used).\n\npdb.pm()\n\n Enter post-mortem debugging of the traceback found in\n ``sys.last_traceback``.\n', 'del': u'\nThe ``del`` statement\n*********************\n\n del_stmt ::= "del" target_list\n\nDeletion is recursively defined very similar to the way assignment is\ndefined. Rather that spelling it out in full details, here are some\nhints.\n\nDeletion of a target list recursively deletes each target, from left\nto right.\n\nDeletion of a name removes the binding of that name from the local or\nglobal namespace, depending on whether the name occurs in a ``global``\nstatement in the same code block. If the name is unbound, a\n``NameError`` exception will be raised.\n\nIt is illegal to delete a name from the local namespace if it occurs\nas a free variable in a nested block.\n\nDeletion of attribute references, subscriptions and slicings is passed\nto the primary object involved; deletion of a slicing is in general\nequivalent to assignment of an empty slice of the right type (but even\nthis is determined by the sliced object).\n', 'dict': u'\nDictionary displays\n*******************\n\nA dictionary display is a possibly empty series of key/datum pairs\nenclosed in curly braces:\n\n dict_display ::= "{" [key_datum_list] "}"\n key_datum_list ::= key_datum ("," key_datum)* [","]\n key_datum ::= expression ":" expression\n\nA dictionary display yields a new dictionary object.\n\nThe key/datum pairs are evaluated from left to right to define the\nentries of the dictionary: each key object is used as a key into the\ndictionary to store the corresponding datum.\n\nRestrictions on the types of the key values are listed earlier in\nsection *The standard type hierarchy*. (To summarize, the key type\nshould be *hashable*, which excludes all mutable objects.) Clashes\nbetween duplicate keys are not detected; the last datum (textually\nrightmost in the display) stored for a given key value prevails.\n', 'dynamic-features': u'\nInteraction with dynamic features\n*********************************\n\nThere are several cases where Python statements are illegal when used\nin conjunction with nested scopes that contain free variables.\n\nIf a variable is referenced in an enclosing scope, it is illegal to\ndelete the name. An error will be reported at compile time.\n\nIf the wild card form of import --- ``import *`` --- is used in a\nfunction and the function contains or is a nested block with free\nvariables, the compiler will raise a ``SyntaxError``.\n\nIf ``exec`` is used in a function and the function contains or is a\nnested block with free variables, the compiler will raise a\n``SyntaxError`` unless the exec explicitly specifies the local\nnamespace for the ``exec``. (In other words, ``exec obj`` would be\nillegal, but ``exec obj in ns`` would be legal.)\n\nThe ``eval()``, ``execfile()``, and ``input()`` functions and the\n``exec`` statement do not have access to the full environment for\nresolving names. Names may be resolved in the local and global\nnamespaces of the caller. Free variables are not resolved in the\nnearest enclosing namespace, but in the global namespace. [1] The\n``exec`` statement and the ``eval()`` and ``execfile()`` functions\nhave optional arguments to override the global and local namespace.\nIf only one namespace is specified, it is used for both.\n', @@ -36,48 +36,48 @@ 'exprlists': u'\nExpression lists\n****************\n\n expression_list ::= expression ( "," expression )* [","]\n\nAn expression list containing at least one comma yields a tuple. The\nlength of the tuple is the number of expressions in the list. The\nexpressions are evaluated from left to right.\n\nThe trailing comma is required only to create a single tuple (a.k.a. a\n*singleton*); it is optional in all other cases. A single expression\nwithout a trailing comma doesn\'t create a tuple, but rather yields the\nvalue of that expression. (To create an empty tuple, use an empty pair\nof parentheses: ``()``.)\n', 'floating': u'\nFloating point literals\n***********************\n\nFloating point literals are described by the following lexical\ndefinitions:\n\n floatnumber ::= pointfloat | exponentfloat\n pointfloat ::= [intpart] fraction | intpart "."\n exponentfloat ::= (intpart | pointfloat) exponent\n intpart ::= digit+\n fraction ::= "." digit+\n exponent ::= ("e" | "E") ["+" | "-"] digit+\n\nNote that the integer and exponent parts of floating point numbers can\nlook like octal integers, but are interpreted using radix 10. For\nexample, ``077e010`` is legal, and denotes the same number as\n``77e10``. The allowed range of floating point literals is\nimplementation-dependent. Some examples of floating point literals:\n\n 3.14 10. .001 1e100 3.14e-10 0e0\n\nNote that numeric literals do not include a sign; a phrase like ``-1``\nis actually an expression composed of the unary operator ``-`` and the\nliteral ``1``.\n', 'for': u'\nThe ``for`` statement\n*********************\n\nThe ``for`` statement is used to iterate over the elements of a\nsequence (such as a string, tuple or list) or other iterable object:\n\n for_stmt ::= "for" target_list "in" expression_list ":" suite\n ["else" ":" suite]\n\nThe expression list is evaluated once; it should yield an iterable\nobject. An iterator is created for the result of the\n``expression_list``. The suite is then executed once for each item\nprovided by the iterator, in the order of ascending indices. Each\nitem in turn is assigned to the target list using the standard rules\nfor assignments, and then the suite is executed. When the items are\nexhausted (which is immediately when the sequence is empty), the suite\nin the ``else`` clause, if present, is executed, and the loop\nterminates.\n\nA ``break`` statement executed in the first suite terminates the loop\nwithout executing the ``else`` clause\'s suite. A ``continue``\nstatement executed in the first suite skips the rest of the suite and\ncontinues with the next item, or with the ``else`` clause if there was\nno next item.\n\nThe suite may assign to the variable(s) in the target list; this does\nnot affect the next item assigned to it.\n\nThe target list is not deleted when the loop is finished, but if the\nsequence is empty, it will not have been assigned to at all by the\nloop. Hint: the built-in function ``range()`` returns a sequence of\nintegers suitable to emulate the effect of Pascal\'s ``for i := a to b\ndo``; e.g., ``range(3)`` returns the list ``[0, 1, 2]``.\n\nWarning: There is a subtlety when the sequence is being modified by the loop\n (this can only occur for mutable sequences, i.e. lists). An internal\n counter is used to keep track of which item is used next, and this\n is incremented on each iteration. When this counter has reached the\n length of the sequence the loop terminates. This means that if the\n suite deletes the current (or a previous) item from the sequence,\n the next item will be skipped (since it gets the index of the\n current item which has already been treated). Likewise, if the\n suite inserts an item in the sequence before the current item, the\n current item will be treated again the next time through the loop.\n This can lead to nasty bugs that can be avoided by making a\n temporary copy using a slice of the whole sequence, e.g.,\n\n for x in a[:]:\n if x < 0: a.remove(x)\n', - 'formatstrings': u'\nFormat String Syntax\n********************\n\nThe ``str.format()`` method and the ``Formatter`` class share the same\nsyntax for format strings (although in the case of ``Formatter``,\nsubclasses can define their own format string syntax.)\n\nFormat strings contain "replacement fields" surrounded by curly braces\n``{}``. Anything that is not contained in braces is considered literal\ntext, which is copied unchanged to the output. If you need to include\na brace character in the literal text, it can be escaped by doubling:\n``{{`` and ``}}``.\n\nThe grammar for a replacement field is as follows:\n\n replacement_field ::= "{" field_name ["!" conversion] [":" format_spec] "}"\n field_name ::= (identifier | integer) ("." attribute_name | "[" element_index "]")*\n attribute_name ::= identifier\n element_index ::= integer\n conversion ::= "r" | "s"\n format_spec ::= \n\nIn less formal terms, the replacement field starts with a\n*field_name*, which can either be a number (for a positional\nargument), or an identifier (for keyword arguments). Following this\nis an optional *conversion* field, which is preceded by an exclamation\npoint ``\'!\'``, and a *format_spec*, which is preceded by a colon\n``\':\'``.\n\nThe *field_name* itself begins with either a number or a keyword. If\nit\'s a number, it refers to a positional argument, and if it\'s a\nkeyword it refers to a named keyword argument. This can be followed\nby any number of index or attribute expressions. An expression of the\nform ``\'.name\'`` selects the named attribute using ``getattr()``,\nwhile an expression of the form ``\'[index]\'`` does an index lookup\nusing ``__getitem__()``.\n\nSome simple format string examples:\n\n "First, thou shalt count to {0}" # References first positional argument\n "My quest is {name}" # References keyword argument \'name\'\n "Weight in tons {0.weight}" # \'weight\' attribute of first positional arg\n "Units destroyed: {players[0]}" # First element of keyword argument \'players\'.\n\nThe *conversion* field causes a type coercion before formatting.\nNormally, the job of formatting a value is done by the\n``__format__()`` method of the value itself. However, in some cases\nit is desirable to force a type to be formatted as a string,\noverriding its own definition of formatting. By converting the value\nto a string before calling ``__format__()``, the normal formatting\nlogic is bypassed.\n\nTwo conversion flags are currently supported: ``\'!s\'`` which calls\n``str()`` on the value, and ``\'!r\'`` which calls ``repr()``.\n\nSome examples:\n\n "Harold\'s a clever {0!s}" # Calls str() on the argument first\n "Bring out the holy {name!r}" # Calls repr() on the argument first\n\nThe *format_spec* field contains a specification of how the value\nshould be presented, including such details as field width, alignment,\npadding, decimal precision and so on. Each value type can define it\'s\nown "formatting mini-language" or interpretation of the *format_spec*.\n\nMost built-in types support a common formatting mini-language, which\nis described in the next section.\n\nA *format_spec* field can also include nested replacement fields\nwithin it. These nested replacement fields can contain only a field\nname; conversion flags and format specifications are not allowed. The\nreplacement fields within the format_spec are substituted before the\n*format_spec* string is interpreted. This allows the formatting of a\nvalue to be dynamically specified.\n\nFor example, suppose you wanted to have a replacement field whose\nfield width is determined by another variable:\n\n "A man with two {0:{1}}".format("noses", 10)\n\nThis would first evaluate the inner replacement field, making the\nformat string effectively:\n\n "A man with two {0:10}"\n\nThen the outer replacement field would be evaluated, producing:\n\n "noses "\n\nWhich is subsitituted into the string, yielding:\n\n "A man with two noses "\n\n(The extra space is because we specified a field width of 10, and\nbecause left alignment is the default for strings.)\n\n\nFormat Specification Mini-Language\n==================================\n\n"Format specifications" are used within replacement fields contained\nwithin a format string to define how individual values are presented\n(see *Format String Syntax*.) They can also be passed directly to the\nbuiltin ``format()`` function. Each formattable type may define how\nthe format specification is to be interpreted.\n\nMost built-in types implement the following options for format\nspecifications, although some of the formatting options are only\nsupported by the numeric types.\n\nA general convention is that an empty format string (``""``) produces\nthe same result as if you had called ``str()`` on the value.\n\nThe general form of a *standard format specifier* is:\n\n format_spec ::= [[fill]align][sign][0][width][.precision][type]\n fill ::= \n align ::= "<" | ">" | "=" | "^"\n sign ::= "+" | "-" | " "\n width ::= integer\n precision ::= integer\n type ::= "b" | "c" | "d" | "e" | "E" | "f" | "F" | "g" | "G" | "n" | "o" | "x" | "X" | "%"\n\nThe *fill* character can be any character other than \'}\' (which\nsignifies the end of the field). The presence of a fill character is\nsignaled by the *next* character, which must be one of the alignment\noptions. If the second character of *format_spec* is not a valid\nalignment option, then it is assumed that both the fill character and\nthe alignment option are absent.\n\nThe meaning of the various alignment options is as follows:\n\n +-----------+------------------------------------------------------------+\n | Option | Meaning |\n +===========+============================================================+\n | ``\'<\'`` | Forces the field to be left-aligned within the available |\n | | space (This is the default.) |\n +-----------+------------------------------------------------------------+\n | ``\'>\'`` | Forces the field to be right-aligned within the available |\n | | space. |\n +-----------+------------------------------------------------------------+\n | ``\'=\'`` | Forces the padding to be placed after the sign (if any) |\n | | but before the digits. This is used for printing fields |\n | | in the form \'+000000120\'. This alignment option is only |\n | | valid for numeric types. |\n +-----------+------------------------------------------------------------+\n | ``\'^\'`` | Forces the field to be centered within the available |\n | | space. |\n +-----------+------------------------------------------------------------+\n\nNote that unless a minimum field width is defined, the field width\nwill always be the same size as the data to fill it, so that the\nalignment option has no meaning in this case.\n\nThe *sign* option is only valid for number types, and can be one of\nthe following:\n\n +-----------+------------------------------------------------------------+\n | Option | Meaning |\n +===========+============================================================+\n | ``\'+\'`` | indicates that a sign should be used for both positive as |\n | | well as negative numbers. |\n +-----------+------------------------------------------------------------+\n | ``\'-\'`` | indicates that a sign should be used only for negative |\n | | numbers (this is the default behavior). |\n +-----------+------------------------------------------------------------+\n | space | indicates that a leading space should be used on positive |\n | | numbers, and a minus sign on negative numbers. |\n +-----------+------------------------------------------------------------+\n\n*width* is a decimal integer defining the minimum field width. If not\nspecified, then the field width will be determined by the content.\n\nIf the *width* field is preceded by a zero (``\'0\'``) character, this\nenables zero-padding. This is equivalent to an *alignment* type of\n``\'=\'`` and a *fill* character of ``\'0\'``.\n\nThe *precision* is a decimal number indicating how many digits should\nbe displayed after the decimal point for a floating point value. For\nnon-number types the field indicates the maximum field size - in other\nwords, how many characters will be used from the field content. The\n*precision* is ignored for integer values.\n\nFinally, the *type* determines how the data should be presented.\n\nThe available integer presentation types are:\n\n +-----------+------------------------------------------------------------+\n | Type | Meaning |\n +===========+============================================================+\n | ``\'b\'`` | Binary. Outputs the number in base 2. |\n +-----------+------------------------------------------------------------+\n | ``\'c\'`` | Character. Converts the integer to the corresponding |\n | | unicode character before printing. |\n +-----------+------------------------------------------------------------+\n | ``\'d\'`` | Decimal Integer. Outputs the number in base 10. |\n +-----------+------------------------------------------------------------+\n | ``\'o\'`` | Octal format. Outputs the number in base 8. |\n +-----------+------------------------------------------------------------+\n | ``\'x\'`` | Hex format. Outputs the number in base 16, using lower- |\n | | case letters for the digits above 9. |\n +-----------+------------------------------------------------------------+\n | ``\'X\'`` | Hex format. Outputs the number in base 16, using upper- |\n | | case letters for the digits above 9. |\n +-----------+------------------------------------------------------------+\n | ``\'n\'`` | Number. This is the same as ``\'d\'``, except that it uses |\n | | the current locale setting to insert the appropriate |\n | | number separator characters. |\n +-----------+------------------------------------------------------------+\n | None | the same as ``\'d\'`` |\n +-----------+------------------------------------------------------------+\n\nThe available presentation types for floating point and decimal values\nare:\n\n +-----------+------------------------------------------------------------+\n | Type | Meaning |\n +===========+============================================================+\n | ``\'e\'`` | Exponent notation. Prints the number in scientific |\n | | notation using the letter \'e\' to indicate the exponent. |\n +-----------+------------------------------------------------------------+\n | ``\'E\'`` | Exponent notation. Same as ``\'e\'`` except it uses an upper |\n | | case \'E\' as the separator character. |\n +-----------+------------------------------------------------------------+\n | ``\'f\'`` | Fixed point. Displays the number as a fixed-point number. |\n +-----------+------------------------------------------------------------+\n | ``\'F\'`` | Fixed point. Same as ``\'f\'``. |\n +-----------+------------------------------------------------------------+\n | ``\'g\'`` | General format. This prints the number as a fixed-point |\n | | number, unless the number is too large, in which case it |\n | | switches to ``\'e\'`` exponent notation. |\n +-----------+------------------------------------------------------------+\n | ``\'G\'`` | General format. Same as ``\'g\'`` except switches to ``\'E\'`` |\n | | if the number gets to large. |\n +-----------+------------------------------------------------------------+\n | ``\'n\'`` | Number. This is the same as ``\'g\'``, except that it uses |\n | | the current locale setting to insert the appropriate |\n | | number separator characters. |\n +-----------+------------------------------------------------------------+\n | ``\'%\'`` | Percentage. Multiplies the number by 100 and displays in |\n | | fixed (``\'f\'``) format, followed by a percent sign. |\n +-----------+------------------------------------------------------------+\n | None | the same as ``\'g\'`` |\n +-----------+------------------------------------------------------------+\n', - 'function': u'\nFunction definitions\n********************\n\nA function definition defines a user-defined function object (see\nsection *The standard type hierarchy*):\n\n decorated ::= decorators (classdef | funcdef)\n decorators ::= decorator+\n decorator ::= "@" dotted_name ["(" [argument_list [","]] ")"] NEWLINE\n funcdef ::= "def" funcname "(" [parameter_list] ")" ":" suite\n dotted_name ::= identifier ("." identifier)*\n parameter_list ::= (defparameter ",")*\n ( "*" identifier [, "**" identifier]\n | "**" identifier\n | defparameter [","] )\n defparameter ::= parameter ["=" expression]\n sublist ::= parameter ("," parameter)* [","]\n parameter ::= identifier | "(" sublist ")"\n funcname ::= identifier\n\nA function definition is an executable statement. Its execution binds\nthe function name in the current local namespace to a function object\n(a wrapper around the executable code for the function). This\nfunction object contains a reference to the current global namespace\nas the global namespace to be used when the function is called.\n\nThe function definition does not execute the function body; this gets\nexecuted only when the function is called.\n\nA function definition may be wrapped by one or more *decorator*\nexpressions. Decorator expressions are evaluated when the function is\ndefined, in the scope that contains the function definition. The\nresult must be a callable, which is invoked with the function object\nas the only argument. The returned value is bound to the function name\ninstead of the function object. Multiple decorators are applied in\nnested fashion. For example, the following code:\n\n @f1(arg)\n @f2\n def func(): pass\n\nis equivalent to:\n\n def func(): pass\n func = f1(arg)(f2(func))\n\nWhen one or more top-level parameters have the form *parameter* ``=``\n*expression*, the function is said to have "default parameter values."\nFor a parameter with a default value, the corresponding argument may\nbe omitted from a call, in which case the parameter\'s default value is\nsubstituted. If a parameter has a default value, all following\nparameters must also have a default value --- this is a syntactic\nrestriction that is not expressed by the grammar.\n\n**Default parameter values are evaluated when the function definition\nis executed.** This means that the expression is evaluated once, when\nthe function is defined, and that that same "pre-computed" value is\nused for each call. This is especially important to understand when a\ndefault parameter is a mutable object, such as a list or a dictionary:\nif the function modifies the object (e.g. by appending an item to a\nlist), the default value is in effect modified. This is generally not\nwhat was intended. A way around this is to use ``None`` as the\ndefault, and explicitly test for it in the body of the function, e.g.:\n\n def whats_on_the_telly(penguin=None):\n if penguin is None:\n penguin = []\n penguin.append("property of the zoo")\n return penguin\n\nFunction call semantics are described in more detail in section\n*Calls*. A function call always assigns values to all parameters\nmentioned in the parameter list, either from position arguments, from\nkeyword arguments, or from default values. If the form\n"``*identifier``" is present, it is initialized to a tuple receiving\nany excess positional parameters, defaulting to the empty tuple. If\nthe form "``**identifier``" is present, it is initialized to a new\ndictionary receiving any excess keyword arguments, defaulting to a new\nempty dictionary.\n\nIt is also possible to create anonymous functions (functions not bound\nto a name), for immediate use in expressions. This uses lambda forms,\ndescribed in section *Expression lists*. Note that the lambda form is\nmerely a shorthand for a simplified function definition; a function\ndefined in a "``def``" statement can be passed around or assigned to\nanother name just like a function defined by a lambda form. The\n"``def``" form is actually more powerful since it allows the execution\nof multiple statements.\n\n**Programmer\'s note:** Functions are first-class objects. A "``def``"\nform executed inside a function definition defines a local function\nthat can be returned or passed around. Free variables used in the\nnested function can access the local variables of the function\ncontaining the def. See section *Naming and binding* for details.\n', + 'formatstrings': u'\nFormat String Syntax\n********************\n\nThe ``str.format()`` method and the ``Formatter`` class share the same\nsyntax for format strings (although in the case of ``Formatter``,\nsubclasses can define their own format string syntax.)\n\nFormat strings contain "replacement fields" surrounded by curly braces\n``{}``. Anything that is not contained in braces is considered literal\ntext, which is copied unchanged to the output. If you need to include\na brace character in the literal text, it can be escaped by doubling:\n``{{`` and ``}}``.\n\nThe grammar for a replacement field is as follows:\n\n replacement_field ::= "{" field_name ["!" conversion] [":" format_spec] "}"\n field_name ::= (identifier | integer) ("." attribute_name | "[" element_index "]")*\n attribute_name ::= identifier\n element_index ::= integer\n conversion ::= "r" | "s"\n format_spec ::= \n\nIn less formal terms, the replacement field starts with a\n*field_name*, which can either be a number (for a positional\nargument), or an identifier (for keyword arguments). Following this\nis an optional *conversion* field, which is preceded by an exclamation\npoint ``\'!\'``, and a *format_spec*, which is preceded by a colon\n``\':\'``.\n\nThe *field_name* itself begins with either a number or a keyword. If\nit\'s a number, it refers to a positional argument, and if it\'s a\nkeyword it refers to a named keyword argument. This can be followed\nby any number of index or attribute expressions. An expression of the\nform ``\'.name\'`` selects the named attribute using ``getattr()``,\nwhile an expression of the form ``\'[index]\'`` does an index lookup\nusing ``__getitem__()``.\n\nSome simple format string examples:\n\n "First, thou shalt count to {0}" # References first positional argument\n "My quest is {name}" # References keyword argument \'name\'\n "Weight in tons {0.weight}" # \'weight\' attribute of first positional arg\n "Units destroyed: {players[0]}" # First element of keyword argument \'players\'.\n\nThe *conversion* field causes a type coercion before formatting.\nNormally, the job of formatting a value is done by the\n``__format__()`` method of the value itself. However, in some cases\nit is desirable to force a type to be formatted as a string,\noverriding its own definition of formatting. By converting the value\nto a string before calling ``__format__()``, the normal formatting\nlogic is bypassed.\n\nTwo conversion flags are currently supported: ``\'!s\'`` which calls\n``str()`` on the value, and ``\'!r\'`` which calls ``repr()``.\n\nSome examples:\n\n "Harold\'s a clever {0!s}" # Calls str() on the argument first\n "Bring out the holy {name!r}" # Calls repr() on the argument first\n\nThe *format_spec* field contains a specification of how the value\nshould be presented, including such details as field width, alignment,\npadding, decimal precision and so on. Each value type can define it\'s\nown "formatting mini-language" or interpretation of the *format_spec*.\n\nMost built-in types support a common formatting mini-language, which\nis described in the next section.\n\nA *format_spec* field can also include nested replacement fields\nwithin it. These nested replacement fields can contain only a field\nname; conversion flags and format specifications are not allowed. The\nreplacement fields within the format_spec are substituted before the\n*format_spec* string is interpreted. This allows the formatting of a\nvalue to be dynamically specified.\n\nFor example, suppose you wanted to have a replacement field whose\nfield width is determined by another variable:\n\n "A man with two {0:{1}}".format("noses", 10)\n\nThis would first evaluate the inner replacement field, making the\nformat string effectively:\n\n "A man with two {0:10}"\n\nThen the outer replacement field would be evaluated, producing:\n\n "noses "\n\nWhich is substituted into the string, yielding:\n\n "A man with two noses "\n\n(The extra space is because we specified a field width of 10, and\nbecause left alignment is the default for strings.)\n\n\nFormat Specification Mini-Language\n==================================\n\n"Format specifications" are used within replacement fields contained\nwithin a format string to define how individual values are presented\n(see *Format String Syntax*.) They can also be passed directly to the\nbuiltin ``format()`` function. Each formattable type may define how\nthe format specification is to be interpreted.\n\nMost built-in types implement the following options for format\nspecifications, although some of the formatting options are only\nsupported by the numeric types.\n\nA general convention is that an empty format string (``""``) produces\nthe same result as if you had called ``str()`` on the value.\n\nThe general form of a *standard format specifier* is:\n\n format_spec ::= [[fill]align][sign][#][0][width][.precision][type]\n fill ::= \n align ::= "<" | ">" | "=" | "^"\n sign ::= "+" | "-" | " "\n width ::= integer\n precision ::= integer\n type ::= "b" | "c" | "d" | "e" | "E" | "f" | "F" | "g" | "G" | "n" | "o" | "x" | "X" | "%"\n\nThe *fill* character can be any character other than \'}\' (which\nsignifies the end of the field). The presence of a fill character is\nsignaled by the *next* character, which must be one of the alignment\noptions. If the second character of *format_spec* is not a valid\nalignment option, then it is assumed that both the fill character and\nthe alignment option are absent.\n\nThe meaning of the various alignment options is as follows:\n\n +-----------+------------------------------------------------------------+\n | Option | Meaning |\n +===========+============================================================+\n | ``\'<\'`` | Forces the field to be left-aligned within the available |\n | | space (This is the default.) |\n +-----------+------------------------------------------------------------+\n | ``\'>\'`` | Forces the field to be right-aligned within the available |\n | | space. |\n +-----------+------------------------------------------------------------+\n | ``\'=\'`` | Forces the padding to be placed after the sign (if any) |\n | | but before the digits. This is used for printing fields |\n | | in the form \'+000000120\'. This alignment option is only |\n | | valid for numeric types. |\n +-----------+------------------------------------------------------------+\n | ``\'^\'`` | Forces the field to be centered within the available |\n | | space. |\n +-----------+------------------------------------------------------------+\n\nNote that unless a minimum field width is defined, the field width\nwill always be the same size as the data to fill it, so that the\nalignment option has no meaning in this case.\n\nThe *sign* option is only valid for number types, and can be one of\nthe following:\n\n +-----------+------------------------------------------------------------+\n | Option | Meaning |\n +===========+============================================================+\n | ``\'+\'`` | indicates that a sign should be used for both positive as |\n | | well as negative numbers. |\n +-----------+------------------------------------------------------------+\n | ``\'-\'`` | indicates that a sign should be used only for negative |\n | | numbers (this is the default behavior). |\n +-----------+------------------------------------------------------------+\n | space | indicates that a leading space should be used on positive |\n | | numbers, and a minus sign on negative numbers. |\n +-----------+------------------------------------------------------------+\n\nThe ``\'#\'`` option is only valid for integers, and only for binary,\noctal, or hexadecimal output. If present, it specifies that the\noutput will be prefixed by ``\'0b\'``, ``\'0o\'``, or ``\'0x\'``,\nrespectively.\n\n*width* is a decimal integer defining the minimum field width. If not\nspecified, then the field width will be determined by the content.\n\nIf the *width* field is preceded by a zero (``\'0\'``) character, this\nenables zero-padding. This is equivalent to an *alignment* type of\n``\'=\'`` and a *fill* character of ``\'0\'``.\n\nThe *precision* is a decimal number indicating how many digits should\nbe displayed after the decimal point for a floating point value\nformatted with ``\'f\'`` and ``\'F\'``, or before and after the decimal\npoint for a floating point value formatted with ``\'g\'`` or ``\'G\'``.\nFor non-number types the field indicates the maximum field size - in\nother words, how many characters will be used from the field content.\nThe *precision* is ignored for integer values.\n\nFinally, the *type* determines how the data should be presented.\n\nThe available integer presentation types are:\n\n +-----------+------------------------------------------------------------+\n | Type | Meaning |\n +===========+============================================================+\n | ``\'b\'`` | Binary format. Outputs the number in base 2. |\n +-----------+------------------------------------------------------------+\n | ``\'c\'`` | Character. Converts the integer to the corresponding |\n | | unicode character before printing. |\n +-----------+------------------------------------------------------------+\n | ``\'d\'`` | Decimal Integer. Outputs the number in base 10. |\n +-----------+------------------------------------------------------------+\n | ``\'o\'`` | Octal format. Outputs the number in base 8. |\n +-----------+------------------------------------------------------------+\n | ``\'x\'`` | Hex format. Outputs the number in base 16, using lower- |\n | | case letters for the digits above 9. |\n +-----------+------------------------------------------------------------+\n | ``\'X\'`` | Hex format. Outputs the number in base 16, using upper- |\n | | case letters for the digits above 9. |\n +-----------+------------------------------------------------------------+\n | ``\'n\'`` | Number. This is the same as ``\'d\'``, except that it uses |\n | | the current locale setting to insert the appropriate |\n | | number separator characters. |\n +-----------+------------------------------------------------------------+\n | None | The same as ``\'d\'``. |\n +-----------+------------------------------------------------------------+\n\nThe available presentation types for floating point and decimal values\nare:\n\n +-----------+------------------------------------------------------------+\n | Type | Meaning |\n +===========+============================================================+\n | ``\'e\'`` | Exponent notation. Prints the number in scientific |\n | | notation using the letter \'e\' to indicate the exponent. |\n +-----------+------------------------------------------------------------+\n | ``\'E\'`` | Exponent notation. Same as ``\'e\'`` except it uses an upper |\n | | case \'E\' as the separator character. |\n +-----------+------------------------------------------------------------+\n | ``\'f\'`` | Fixed point. Displays the number as a fixed-point number. |\n +-----------+------------------------------------------------------------+\n | ``\'F\'`` | Fixed point. Same as ``\'f\'``. |\n +-----------+------------------------------------------------------------+\n | ``\'g\'`` | General format. This prints the number as a fixed-point |\n | | number, unless the number is too large, in which case it |\n | | switches to ``\'e\'`` exponent notation. Infinity and NaN |\n | | values are formatted as ``inf``, ``-inf`` and ``nan``, |\n | | respectively. |\n +-----------+------------------------------------------------------------+\n | ``\'G\'`` | General format. Same as ``\'g\'`` except switches to ``\'E\'`` |\n | | if the number gets to large. The representations of |\n | | infinity and NaN are uppercased, too. |\n +-----------+------------------------------------------------------------+\n | ``\'n\'`` | Number. This is the same as ``\'g\'``, except that it uses |\n | | the current locale setting to insert the appropriate |\n | | number separator characters. |\n +-----------+------------------------------------------------------------+\n | ``\'%\'`` | Percentage. Multiplies the number by 100 and displays in |\n | | fixed (``\'f\'``) format, followed by a percent sign. |\n +-----------+------------------------------------------------------------+\n | None | The same as ``\'g\'``. |\n +-----------+------------------------------------------------------------+\n', + 'function': u'\nFunction definitions\n********************\n\nA function definition defines a user-defined function object (see\nsection *The standard type hierarchy*):\n\n decorated ::= decorators (classdef | funcdef)\n decorators ::= decorator+\n decorator ::= "@" dotted_name ["(" [argument_list [","]] ")"] NEWLINE\n funcdef ::= "def" funcname "(" [parameter_list] ")" ":" suite\n dotted_name ::= identifier ("." identifier)*\n parameter_list ::= (defparameter ",")*\n ( "*" identifier [, "**" identifier]\n | "**" identifier\n | defparameter [","] )\n defparameter ::= parameter ["=" expression]\n sublist ::= parameter ("," parameter)* [","]\n parameter ::= identifier | "(" sublist ")"\n funcname ::= identifier\n\nA function definition is an executable statement. Its execution binds\nthe function name in the current local namespace to a function object\n(a wrapper around the executable code for the function). This\nfunction object contains a reference to the current global namespace\nas the global namespace to be used when the function is called.\n\nThe function definition does not execute the function body; this gets\nexecuted only when the function is called. [3]\n\nA function definition may be wrapped by one or more *decorator*\nexpressions. Decorator expressions are evaluated when the function is\ndefined, in the scope that contains the function definition. The\nresult must be a callable, which is invoked with the function object\nas the only argument. The returned value is bound to the function name\ninstead of the function object. Multiple decorators are applied in\nnested fashion. For example, the following code:\n\n @f1(arg)\n @f2\n def func(): pass\n\nis equivalent to:\n\n def func(): pass\n func = f1(arg)(f2(func))\n\nWhen one or more top-level parameters have the form *parameter* ``=``\n*expression*, the function is said to have "default parameter values."\nFor a parameter with a default value, the corresponding argument may\nbe omitted from a call, in which case the parameter\'s default value is\nsubstituted. If a parameter has a default value, all following\nparameters must also have a default value --- this is a syntactic\nrestriction that is not expressed by the grammar.\n\n**Default parameter values are evaluated when the function definition\nis executed.** This means that the expression is evaluated once, when\nthe function is defined, and that that same "pre-computed" value is\nused for each call. This is especially important to understand when a\ndefault parameter is a mutable object, such as a list or a dictionary:\nif the function modifies the object (e.g. by appending an item to a\nlist), the default value is in effect modified. This is generally not\nwhat was intended. A way around this is to use ``None`` as the\ndefault, and explicitly test for it in the body of the function, e.g.:\n\n def whats_on_the_telly(penguin=None):\n if penguin is None:\n penguin = []\n penguin.append("property of the zoo")\n return penguin\n\nFunction call semantics are described in more detail in section\n*Calls*. A function call always assigns values to all parameters\nmentioned in the parameter list, either from position arguments, from\nkeyword arguments, or from default values. If the form\n"``*identifier``" is present, it is initialized to a tuple receiving\nany excess positional parameters, defaulting to the empty tuple. If\nthe form "``**identifier``" is present, it is initialized to a new\ndictionary receiving any excess keyword arguments, defaulting to a new\nempty dictionary.\n\nIt is also possible to create anonymous functions (functions not bound\nto a name), for immediate use in expressions. This uses lambda forms,\ndescribed in section *Expression lists*. Note that the lambda form is\nmerely a shorthand for a simplified function definition; a function\ndefined in a "``def``" statement can be passed around or assigned to\nanother name just like a function defined by a lambda form. The\n"``def``" form is actually more powerful since it allows the execution\nof multiple statements.\n\n**Programmer\'s note:** Functions are first-class objects. A "``def``"\nform executed inside a function definition defines a local function\nthat can be returned or passed around. Free variables used in the\nnested function can access the local variables of the function\ncontaining the def. See section *Naming and binding* for details.\n', 'global': u'\nThe ``global`` statement\n************************\n\n global_stmt ::= "global" identifier ("," identifier)*\n\nThe ``global`` statement is a declaration which holds for the entire\ncurrent code block. It means that the listed identifiers are to be\ninterpreted as globals. It would be impossible to assign to a global\nvariable without ``global``, although free variables may refer to\nglobals without being declared global.\n\nNames listed in a ``global`` statement must not be used in the same\ncode block textually preceding that ``global`` statement.\n\nNames listed in a ``global`` statement must not be defined as formal\nparameters or in a ``for`` loop control target, ``class`` definition,\nfunction definition, or ``import`` statement.\n\n(The current implementation does not enforce the latter two\nrestrictions, but programs should not abuse this freedom, as future\nimplementations may enforce them or silently change the meaning of the\nprogram.)\n\n**Programmer\'s note:** the ``global`` is a directive to the parser.\nIt applies only to code parsed at the same time as the ``global``\nstatement. In particular, a ``global`` statement contained in an\n``exec`` statement does not affect the code block *containing* the\n``exec`` statement, and code contained in an ``exec`` statement is\nunaffected by ``global`` statements in the code containing the\n``exec`` statement. The same applies to the ``eval()``,\n``execfile()`` and ``compile()`` functions.\n', 'id-classes': u'\nReserved classes of identifiers\n*******************************\n\nCertain classes of identifiers (besides keywords) have special\nmeanings. These classes are identified by the patterns of leading and\ntrailing underscore characters:\n\n``_*``\n Not imported by ``from module import *``. The special identifier\n ``_`` is used in the interactive interpreter to store the result of\n the last evaluation; it is stored in the ``__builtin__`` module.\n When not in interactive mode, ``_`` has no special meaning and is\n not defined. See section *The import statement*.\n\n Note: The name ``_`` is often used in conjunction with\n internationalization; refer to the documentation for the\n ``gettext`` module for more information on this convention.\n\n``__*__``\n System-defined names. These names are defined by the interpreter\n and its implementation (including the standard library);\n applications should not expect to define additional names using\n this convention. The set of names of this class defined by Python\n may be extended in future versions. See section *Special method\n names*.\n\n``__*``\n Class-private names. Names in this category, when used within the\n context of a class definition, are re-written to use a mangled form\n to help avoid name clashes between "private" attributes of base and\n derived classes. See section *Identifiers (Names)*.\n', 'identifiers': u'\nIdentifiers and keywords\n************************\n\nIdentifiers (also referred to as *names*) are described by the\nfollowing lexical definitions:\n\n identifier ::= (letter|"_") (letter | digit | "_")*\n letter ::= lowercase | uppercase\n lowercase ::= "a"..."z"\n uppercase ::= "A"..."Z"\n digit ::= "0"..."9"\n\nIdentifiers are unlimited in length. Case is significant.\n\n\nKeywords\n========\n\nThe following identifiers are used as reserved words, or *keywords* of\nthe language, and cannot be used as ordinary identifiers. They must\nbe spelled exactly as written here:\n\n and del from not while\n as elif global or with\n assert else if pass yield\n break except import print\n class exec in raise\n continue finally is return\n def for lambda try\n\nChanged in version 2.4: ``None`` became a constant and is now\nrecognized by the compiler as a name for the built-in object ``None``.\nAlthough it is not a keyword, you cannot assign a different object to\nit.\n\nChanged in version 2.5: Both ``as`` and ``with`` are only recognized\nwhen the ``with_statement`` future feature has been enabled. It will\nalways be enabled in Python 2.6. See section *The with statement* for\ndetails. Note that using ``as`` and ``with`` as identifiers will\nalways issue a warning, even when the ``with_statement`` future\ndirective is not in effect.\n\n\nReserved classes of identifiers\n===============================\n\nCertain classes of identifiers (besides keywords) have special\nmeanings. These classes are identified by the patterns of leading and\ntrailing underscore characters:\n\n``_*``\n Not imported by ``from module import *``. The special identifier\n ``_`` is used in the interactive interpreter to store the result of\n the last evaluation; it is stored in the ``__builtin__`` module.\n When not in interactive mode, ``_`` has no special meaning and is\n not defined. See section *The import statement*.\n\n Note: The name ``_`` is often used in conjunction with\n internationalization; refer to the documentation for the\n ``gettext`` module for more information on this convention.\n\n``__*__``\n System-defined names. These names are defined by the interpreter\n and its implementation (including the standard library);\n applications should not expect to define additional names using\n this convention. The set of names of this class defined by Python\n may be extended in future versions. See section *Special method\n names*.\n\n``__*``\n Class-private names. Names in this category, when used within the\n context of a class definition, are re-written to use a mangled form\n to help avoid name clashes between "private" attributes of base and\n derived classes. See section *Identifiers (Names)*.\n', 'if': u'\nThe ``if`` statement\n********************\n\nThe ``if`` statement is used for conditional execution:\n\n if_stmt ::= "if" expression ":" suite\n ( "elif" expression ":" suite )*\n ["else" ":" suite]\n\nIt selects exactly one of the suites by evaluating the expressions one\nby one until one is found to be true (see section *Boolean operations*\nfor the definition of true and false); then that suite is executed\n(and no other part of the ``if`` statement is executed or evaluated).\nIf all expressions are false, the suite of the ``else`` clause, if\npresent, is executed.\n', 'imaginary': u'\nImaginary literals\n******************\n\nImaginary literals are described by the following lexical definitions:\n\n imagnumber ::= (floatnumber | intpart) ("j" | "J")\n\nAn imaginary literal yields a complex number with a real part of 0.0.\nComplex numbers are represented as a pair of floating point numbers\nand have the same restrictions on their range. To create a complex\nnumber with a nonzero real part, add a floating point number to it,\ne.g., ``(3+4j)``. Some examples of imaginary literals:\n\n 3.14j 10.j 10j .001j 1e100j 3.14e-10j\n', - 'import': u'\nThe ``import`` statement\n************************\n\n import_stmt ::= "import" module ["as" name] ( "," module ["as" name] )*\n | "from" relative_module "import" identifier ["as" name]\n ( "," identifier ["as" name] )*\n | "from" relative_module "import" "(" identifier ["as" name]\n ( "," identifier ["as" name] )* [","] ")"\n | "from" module "import" "*"\n module ::= (identifier ".")* identifier\n relative_module ::= "."* module | "."+\n name ::= identifier\n\nImport statements are executed in two steps: (1) find a module, and\ninitialize it if necessary; (2) define a name or names in the local\nnamespace (of the scope where the ``import`` statement occurs). The\nfirst form (without ``from``) repeats these steps for each identifier\nin the list. The form with ``from`` performs step (1) once, and then\nperforms step (2) repeatedly.\n\nIn this context, to "initialize" a built-in or extension module means\nto call an initialization function that the module must provide for\nthe purpose (in the reference implementation, the function\'s name is\nobtained by prepending string "init" to the module\'s name); to\n"initialize" a Python-coded module means to execute the module\'s body.\n\nThe system maintains a table of modules that have been or are being\ninitialized, indexed by module name. This table is accessible as\n``sys.modules``. When a module name is found in this table, step (1)\nis finished. If not, a search for a module definition is started.\nWhen a module is found, it is loaded. Details of the module searching\nand loading process are implementation and platform specific. It\ngenerally involves searching for a "built-in" module with the given\nname and then searching a list of locations given as ``sys.path``.\n\nIf a built-in module is found, its built-in initialization code is\nexecuted and step (1) is finished. If no matching file is found,\n``ImportError`` is raised. If a file is found, it is parsed, yielding\nan executable code block. If a syntax error occurs, ``SyntaxError``\nis raised. Otherwise, an empty module of the given name is created\nand inserted in the module table, and then the code block is executed\nin the context of this module. Exceptions during this execution\nterminate step (1).\n\nWhen step (1) finishes without raising an exception, step (2) can\nbegin.\n\nThe first form of ``import`` statement binds the module name in the\nlocal namespace to the module object, and then goes on to import the\nnext identifier, if any. If the module name is followed by ``as``,\nthe name following ``as`` is used as the local name for the module.\n\nThe ``from`` form does not bind the module name: it goes through the\nlist of identifiers, looks each one of them up in the module found in\nstep (1), and binds the name in the local namespace to the object thus\nfound. As with the first form of ``import``, an alternate local name\ncan be supplied by specifying "``as`` localname". If a name is not\nfound, ``ImportError`` is raised. If the list of identifiers is\nreplaced by a star (``\'*\'``), all public names defined in the module\nare bound in the local namespace of the ``import`` statement..\n\nThe *public names* defined by a module are determined by checking the\nmodule\'s namespace for a variable named ``__all__``; if defined, it\nmust be a sequence of strings which are names defined or imported by\nthat module. The names given in ``__all__`` are all considered public\nand are required to exist. If ``__all__`` is not defined, the set of\npublic names includes all names found in the module\'s namespace which\ndo not begin with an underscore character (``\'_\'``). ``__all__``\nshould contain the entire public API. It is intended to avoid\naccidentally exporting items that are not part of the API (such as\nlibrary modules which were imported and used within the module).\n\nThe ``from`` form with ``*`` may only occur in a module scope. If the\nwild card form of import --- ``import *`` --- is used in a function\nand the function contains or is a nested block with free variables,\nthe compiler will raise a ``SyntaxError``.\n\n**Hierarchical module names:** when the module names contains one or\nmore dots, the module search path is carried out differently. The\nsequence of identifiers up to the last dot is used to find a\n"package"; the final identifier is then searched inside the package.\nA package is generally a subdirectory of a directory on ``sys.path``\nthat has a file ``__init__.py``. [XXX Can\'t be bothered to spell this\nout right now; see the URL\nhttp://www.python.org/doc/essays/packages.html for more details, also\nabout how the module search works from inside a package.]\n\nThe built-in function ``__import__()`` is provided to support\napplications that determine which modules need to be loaded\ndynamically; refer to *Built-in Functions* for additional information.\n\n\nFuture statements\n=================\n\nA *future statement* is a directive to the compiler that a particular\nmodule should be compiled using syntax or semantics that will be\navailable in a specified future release of Python. The future\nstatement is intended to ease migration to future versions of Python\nthat introduce incompatible changes to the language. It allows use of\nthe new features on a per-module basis before the release in which the\nfeature becomes standard.\n\n future_statement ::= "from" "__future__" "import" feature ["as" name]\n ("," feature ["as" name])*\n | "from" "__future__" "import" "(" feature ["as" name]\n ("," feature ["as" name])* [","] ")"\n feature ::= identifier\n name ::= identifier\n\nA future statement must appear near the top of the module. The only\nlines that can appear before a future statement are:\n\n* the module docstring (if any),\n\n* comments,\n\n* blank lines, and\n\n* other future statements.\n\nThe features recognized by Python 2.5 are ``absolute_import``,\n``division``, ``generators``, ``nested_scopes`` and\n``with_statement``. ``generators`` and ``nested_scopes`` are\nredundant in Python version 2.3 and above because they are always\nenabled.\n\nA future statement is recognized and treated specially at compile\ntime: Changes to the semantics of core constructs are often\nimplemented by generating different code. It may even be the case\nthat a new feature introduces new incompatible syntax (such as a new\nreserved word), in which case the compiler may need to parse the\nmodule differently. Such decisions cannot be pushed off until\nruntime.\n\nFor any given release, the compiler knows which feature names have\nbeen defined, and raises a compile-time error if a future statement\ncontains a feature not known to it.\n\nThe direct runtime semantics are the same as for any import statement:\nthere is a standard module ``__future__``, described later, and it\nwill be imported in the usual way at the time the future statement is\nexecuted.\n\nThe interesting runtime semantics depend on the specific feature\nenabled by the future statement.\n\nNote that there is nothing special about the statement:\n\n import __future__ [as name]\n\nThat is not a future statement; it\'s an ordinary import statement with\nno special semantics or syntax restrictions.\n\nCode compiled by an ``exec`` statement or calls to the builtin\nfunctions ``compile()`` and ``execfile()`` that occur in a module\n``M`` containing a future statement will, by default, use the new\nsyntax or semantics associated with the future statement. This can,\nstarting with Python 2.2 be controlled by optional arguments to\n``compile()`` --- see the documentation of that function for details.\n\nA future statement typed at an interactive interpreter prompt will\ntake effect for the rest of the interpreter session. If an\ninterpreter is started with the *-i* option, is passed a script name\nto execute, and the script includes a future statement, it will be in\neffect in the interactive session started after the script is\nexecuted.\n', - 'in': u'\nComparisons\n***********\n\nUnlike C, all comparison operations in Python have the same priority,\nwhich is lower than that of any arithmetic, shifting or bitwise\noperation. Also unlike C, expressions like ``a < b < c`` have the\ninterpretation that is conventional in mathematics:\n\n comparison ::= or_expr ( comp_operator or_expr )*\n comp_operator ::= "<" | ">" | "==" | ">=" | "<=" | "<>" | "!="\n | "is" ["not"] | ["not"] "in"\n\nComparisons yield boolean values: ``True`` or ``False``.\n\nComparisons can be chained arbitrarily, e.g., ``x < y <= z`` is\nequivalent to ``x < y and y <= z``, except that ``y`` is evaluated\nonly once (but in both cases ``z`` is not evaluated at all when ``x <\ny`` is found to be false).\n\nFormally, if *a*, *b*, *c*, ..., *y*, *z* are expressions and *op1*,\n*op2*, ..., *opN* are comparison operators, then ``a op1 b op2 c ... y\nopN z`` is equivalent to ``a op1 b and b op2 c and ... y opN z``,\nexcept that each expression is evaluated at most once.\n\nNote that ``a op1 b op2 c`` doesn\'t imply any kind of comparison\nbetween *a* and *c*, so that, e.g., ``x < y > z`` is perfectly legal\n(though perhaps not pretty).\n\nThe forms ``<>`` and ``!=`` are equivalent; for consistency with C,\n``!=`` is preferred; where ``!=`` is mentioned below ``<>`` is also\naccepted. The ``<>`` spelling is considered obsolescent.\n\nThe operators ``<``, ``>``, ``==``, ``>=``, ``<=``, and ``!=`` compare\nthe values of two objects. The objects need not have the same type.\nIf both are numbers, they are converted to a common type. Otherwise,\nobjects of different types *always* compare unequal, and are ordered\nconsistently but arbitrarily. You can control comparison behavior of\nobjects of non-builtin types by defining a ``__cmp__`` method or rich\ncomparison methods like ``__gt__``, described in section *Special\nmethod names*.\n\n(This unusual definition of comparison was used to simplify the\ndefinition of operations like sorting and the ``in`` and ``not in``\noperators. In the future, the comparison rules for objects of\ndifferent types are likely to change.)\n\nComparison of objects of the same type depends on the type:\n\n* Numbers are compared arithmetically.\n\n* Strings are compared lexicographically using the numeric equivalents\n (the result of the built-in function ``ord()``) of their characters.\n Unicode and 8-bit strings are fully interoperable in this behavior.\n [4]\n\n* Tuples and lists are compared lexicographically using comparison of\n corresponding elements. This means that to compare equal, each\n element must compare equal and the two sequences must be of the same\n type and have the same length.\n\n If not equal, the sequences are ordered the same as their first\n differing elements. For example, ``cmp([1,2,x], [1,2,y])`` returns\n the same as ``cmp(x,y)``. If the corresponding element does not\n exist, the shorter sequence is ordered first (for example, ``[1,2] <\n [1,2,3]``).\n\n* Mappings (dictionaries) compare equal if and only if their sorted\n (key, value) lists compare equal. [5] Outcomes other than equality\n are resolved consistently, but are not otherwise defined. [6]\n\n* Most other objects of builtin types compare unequal unless they are\n the same object; the choice whether one object is considered smaller\n or larger than another one is made arbitrarily but consistently\n within one execution of a program.\n\nThe operators ``in`` and ``not in`` test for collection membership.\n``x in s`` evaluates to true if *x* is a member of the collection *s*,\nand false otherwise. ``x not in s`` returns the negation of ``x in\ns``. The collection membership test has traditionally been bound to\nsequences; an object is a member of a collection if the collection is\na sequence and contains an element equal to that object. However, it\nmake sense for many other object types to support membership tests\nwithout being a sequence. In particular, dictionaries (for keys) and\nsets support membership testing.\n\nFor the list and tuple types, ``x in y`` is true if and only if there\nexists an index *i* such that ``x == y[i]`` is true.\n\nFor the Unicode and string types, ``x in y`` is true if and only if\n*x* is a substring of *y*. An equivalent test is ``y.find(x) != -1``.\nNote, *x* and *y* need not be the same type; consequently, ``u\'ab\' in\n\'abc\'`` will return ``True``. Empty strings are always considered to\nbe a substring of any other string, so ``"" in "abc"`` will return\n``True``.\n\nChanged in version 2.3: Previously, *x* was required to be a string of\nlength ``1``.\n\nFor user-defined classes which define the ``__contains__()`` method,\n``x in y`` is true if and only if ``y.__contains__(x)`` is true.\n\nFor user-defined classes which do not define ``__contains__()`` and do\ndefine ``__getitem__()``, ``x in y`` is true if and only if there is a\nnon-negative integer index *i* such that ``x == y[i]``, and all lower\ninteger indices do not raise ``IndexError`` exception. (If any other\nexception is raised, it is as if ``in`` raised that exception).\n\nThe operator ``not in`` is defined to have the inverse true value of\n``in``.\n\nThe operators ``is`` and ``is not`` test for object identity: ``x is\ny`` is true if and only if *x* and *y* are the same object. ``x is\nnot y`` yields the inverse truth value.\n', + 'import': u'\nThe ``import`` statement\n************************\n\n import_stmt ::= "import" module ["as" name] ( "," module ["as" name] )*\n | "from" relative_module "import" identifier ["as" name]\n ( "," identifier ["as" name] )*\n | "from" relative_module "import" "(" identifier ["as" name]\n ( "," identifier ["as" name] )* [","] ")"\n | "from" module "import" "*"\n module ::= (identifier ".")* identifier\n relative_module ::= "."* module | "."+\n name ::= identifier\n\nImport statements are executed in two steps: (1) find a module, and\ninitialize it if necessary; (2) define a name or names in the local\nnamespace (of the scope where the ``import`` statement occurs). The\nfirst form (without ``from``) repeats these steps for each identifier\nin the list. The form with ``from`` performs step (1) once, and then\nperforms step (2) repeatedly.\n\nIn this context, to "initialize" a built-in or extension module means\nto call an initialization function that the module must provide for\nthe purpose (in the reference implementation, the function\'s name is\nobtained by prepending string "init" to the module\'s name); to\n"initialize" a Python-coded module means to execute the module\'s body.\n\nThe system maintains a table of modules that have been or are being\ninitialized, indexed by module name. This table is accessible as\n``sys.modules``. When a module name is found in this table, step (1)\nis finished. If not, a search for a module definition is started.\nWhen a module is found, it is loaded. Details of the module searching\nand loading process are implementation and platform specific. It\ngenerally involves searching for a "built-in" module with the given\nname and then searching a list of locations given as ``sys.path``.\n\nIf a built-in module is found, its built-in initialization code is\nexecuted and step (1) is finished. If no matching file is found,\n``ImportError`` is raised. If a file is found, it is parsed, yielding\nan executable code block. If a syntax error occurs, ``SyntaxError``\nis raised. Otherwise, an empty module of the given name is created\nand inserted in the module table, and then the code block is executed\nin the context of this module. Exceptions during this execution\nterminate step (1).\n\nWhen step (1) finishes without raising an exception, step (2) can\nbegin.\n\nThe first form of ``import`` statement binds the module name in the\nlocal namespace to the module object, and then goes on to import the\nnext identifier, if any. If the module name is followed by ``as``,\nthe name following ``as`` is used as the local name for the module.\n\nThe ``from`` form does not bind the module name: it goes through the\nlist of identifiers, looks each one of them up in the module found in\nstep (1), and binds the name in the local namespace to the object thus\nfound. As with the first form of ``import``, an alternate local name\ncan be supplied by specifying "``as`` localname". If a name is not\nfound, ``ImportError`` is raised. If the list of identifiers is\nreplaced by a star (``\'*\'``), all public names defined in the module\nare bound in the local namespace of the ``import`` statement..\n\nThe *public names* defined by a module are determined by checking the\nmodule\'s namespace for a variable named ``__all__``; if defined, it\nmust be a sequence of strings which are names defined or imported by\nthat module. The names given in ``__all__`` are all considered public\nand are required to exist. If ``__all__`` is not defined, the set of\npublic names includes all names found in the module\'s namespace which\ndo not begin with an underscore character (``\'_\'``). ``__all__``\nshould contain the entire public API. It is intended to avoid\naccidentally exporting items that are not part of the API (such as\nlibrary modules which were imported and used within the module).\n\nThe ``from`` form with ``*`` may only occur in a module scope. If the\nwild card form of import --- ``import *`` --- is used in a function\nand the function contains or is a nested block with free variables,\nthe compiler will raise a ``SyntaxError``.\n\n**Hierarchical module names:** when the module names contains one or\nmore dots, the module search path is carried out differently. The\nsequence of identifiers up to the last dot is used to find a\n"package"; the final identifier is then searched inside the package.\nA package is generally a subdirectory of a directory on ``sys.path``\nthat has a file ``__init__.py``.\n\nThe built-in function ``__import__()`` is provided to support\napplications that determine which modules need to be loaded\ndynamically; refer to *Built-in Functions* for additional information.\n\n\nFuture statements\n=================\n\nA *future statement* is a directive to the compiler that a particular\nmodule should be compiled using syntax or semantics that will be\navailable in a specified future release of Python. The future\nstatement is intended to ease migration to future versions of Python\nthat introduce incompatible changes to the language. It allows use of\nthe new features on a per-module basis before the release in which the\nfeature becomes standard.\n\n future_statement ::= "from" "__future__" "import" feature ["as" name]\n ("," feature ["as" name])*\n | "from" "__future__" "import" "(" feature ["as" name]\n ("," feature ["as" name])* [","] ")"\n feature ::= identifier\n name ::= identifier\n\nA future statement must appear near the top of the module. The only\nlines that can appear before a future statement are:\n\n* the module docstring (if any),\n\n* comments,\n\n* blank lines, and\n\n* other future statements.\n\nThe features recognized by Python 2.5 are ``absolute_import``,\n``division``, ``generators``, ``nested_scopes`` and\n``with_statement``. ``generators`` and ``nested_scopes`` are\nredundant in Python version 2.3 and above because they are always\nenabled.\n\nA future statement is recognized and treated specially at compile\ntime: Changes to the semantics of core constructs are often\nimplemented by generating different code. It may even be the case\nthat a new feature introduces new incompatible syntax (such as a new\nreserved word), in which case the compiler may need to parse the\nmodule differently. Such decisions cannot be pushed off until\nruntime.\n\nFor any given release, the compiler knows which feature names have\nbeen defined, and raises a compile-time error if a future statement\ncontains a feature not known to it.\n\nThe direct runtime semantics are the same as for any import statement:\nthere is a standard module ``__future__``, described later, and it\nwill be imported in the usual way at the time the future statement is\nexecuted.\n\nThe interesting runtime semantics depend on the specific feature\nenabled by the future statement.\n\nNote that there is nothing special about the statement:\n\n import __future__ [as name]\n\nThat is not a future statement; it\'s an ordinary import statement with\nno special semantics or syntax restrictions.\n\nCode compiled by an ``exec`` statement or calls to the builtin\nfunctions ``compile()`` and ``execfile()`` that occur in a module\n``M`` containing a future statement will, by default, use the new\nsyntax or semantics associated with the future statement. This can,\nstarting with Python 2.2 be controlled by optional arguments to\n``compile()`` --- see the documentation of that function for details.\n\nA future statement typed at an interactive interpreter prompt will\ntake effect for the rest of the interpreter session. If an\ninterpreter is started with the *-i* option, is passed a script name\nto execute, and the script includes a future statement, it will be in\neffect in the interactive session started after the script is\nexecuted.\n', + 'in': u'\nComparisons\n***********\n\nUnlike C, all comparison operations in Python have the same priority,\nwhich is lower than that of any arithmetic, shifting or bitwise\noperation. Also unlike C, expressions like ``a < b < c`` have the\ninterpretation that is conventional in mathematics:\n\n comparison ::= or_expr ( comp_operator or_expr )*\n comp_operator ::= "<" | ">" | "==" | ">=" | "<=" | "<>" | "!="\n | "is" ["not"] | ["not"] "in"\n\nComparisons yield boolean values: ``True`` or ``False``.\n\nComparisons can be chained arbitrarily, e.g., ``x < y <= z`` is\nequivalent to ``x < y and y <= z``, except that ``y`` is evaluated\nonly once (but in both cases ``z`` is not evaluated at all when ``x <\ny`` is found to be false).\n\nFormally, if *a*, *b*, *c*, ..., *y*, *z* are expressions and *op1*,\n*op2*, ..., *opN* are comparison operators, then ``a op1 b op2 c ... y\nopN z`` is equivalent to ``a op1 b and b op2 c and ... y opN z``,\nexcept that each expression is evaluated at most once.\n\nNote that ``a op1 b op2 c`` doesn\'t imply any kind of comparison\nbetween *a* and *c*, so that, e.g., ``x < y > z`` is perfectly legal\n(though perhaps not pretty).\n\nThe forms ``<>`` and ``!=`` are equivalent; for consistency with C,\n``!=`` is preferred; where ``!=`` is mentioned below ``<>`` is also\naccepted. The ``<>`` spelling is considered obsolescent.\n\nThe operators ``<``, ``>``, ``==``, ``>=``, ``<=``, and ``!=`` compare\nthe values of two objects. The objects need not have the same type.\nIf both are numbers, they are converted to a common type. Otherwise,\nobjects of different types *always* compare unequal, and are ordered\nconsistently but arbitrarily. You can control comparison behavior of\nobjects of non-builtin types by defining a ``__cmp__`` method or rich\ncomparison methods like ``__gt__``, described in section *Special\nmethod names*.\n\n(This unusual definition of comparison was used to simplify the\ndefinition of operations like sorting and the ``in`` and ``not in``\noperators. In the future, the comparison rules for objects of\ndifferent types are likely to change.)\n\nComparison of objects of the same type depends on the type:\n\n* Numbers are compared arithmetically.\n\n* Strings are compared lexicographically using the numeric equivalents\n (the result of the built-in function ``ord()``) of their characters.\n Unicode and 8-bit strings are fully interoperable in this behavior.\n [4]\n\n* Tuples and lists are compared lexicographically using comparison of\n corresponding elements. This means that to compare equal, each\n element must compare equal and the two sequences must be of the same\n type and have the same length.\n\n If not equal, the sequences are ordered the same as their first\n differing elements. For example, ``cmp([1,2,x], [1,2,y])`` returns\n the same as ``cmp(x,y)``. If the corresponding element does not\n exist, the shorter sequence is ordered first (for example, ``[1,2] <\n [1,2,3]``).\n\n* Mappings (dictionaries) compare equal if and only if their sorted\n (key, value) lists compare equal. [5] Outcomes other than equality\n are resolved consistently, but are not otherwise defined. [6]\n\n* Most other objects of builtin types compare unequal unless they are\n the same object; the choice whether one object is considered smaller\n or larger than another one is made arbitrarily but consistently\n within one execution of a program.\n\nThe operators ``in`` and ``not in`` test for collection membership.\n``x in s`` evaluates to true if *x* is a member of the collection *s*,\nand false otherwise. ``x not in s`` returns the negation of ``x in\ns``. The collection membership test has traditionally been bound to\nsequences; an object is a member of a collection if the collection is\na sequence and contains an element equal to that object. However, it\nmake sense for many other object types to support membership tests\nwithout being a sequence. In particular, dictionaries (for keys) and\nsets support membership testing.\n\nFor the list and tuple types, ``x in y`` is true if and only if there\nexists an index *i* such that ``x == y[i]`` is true.\n\nFor the Unicode and string types, ``x in y`` is true if and only if\n*x* is a substring of *y*. An equivalent test is ``y.find(x) != -1``.\nNote, *x* and *y* need not be the same type; consequently, ``u\'ab\' in\n\'abc\'`` will return ``True``. Empty strings are always considered to\nbe a substring of any other string, so ``"" in "abc"`` will return\n``True``.\n\nChanged in version 2.3: Previously, *x* was required to be a string of\nlength ``1``.\n\nFor user-defined classes which define the ``__contains__()`` method,\n``x in y`` is true if and only if ``y.__contains__(x)`` is true.\n\nFor user-defined classes which do not define ``__contains__()`` and do\ndefine ``__getitem__()``, ``x in y`` is true if and only if there is a\nnon-negative integer index *i* such that ``x == y[i]``, and all lower\ninteger indices do not raise ``IndexError`` exception. (If any other\nexception is raised, it is as if ``in`` raised that exception).\n\nThe operator ``not in`` is defined to have the inverse true value of\n``in``.\n\nThe operators ``is`` and ``is not`` test for object identity: ``x is\ny`` is true if and only if *x* and *y* are the same object. ``x is\nnot y`` yields the inverse truth value. [7]\n', 'integers': u'\nInteger and long integer literals\n*********************************\n\nInteger and long integer literals are described by the following\nlexical definitions:\n\n longinteger ::= integer ("l" | "L")\n integer ::= decimalinteger | octinteger | hexinteger\n decimalinteger ::= nonzerodigit digit* | "0"\n octinteger ::= "0" octdigit+\n hexinteger ::= "0" ("x" | "X") hexdigit+\n nonzerodigit ::= "1"..."9"\n octdigit ::= "0"..."7"\n hexdigit ::= digit | "a"..."f" | "A"..."F"\n\nAlthough both lower case ``\'l\'`` and upper case ``\'L\'`` are allowed as\nsuffix for long integers, it is strongly recommended to always use\n``\'L\'``, since the letter ``\'l\'`` looks too much like the digit\n``\'1\'``.\n\nPlain integer literals that are above the largest representable plain\ninteger (e.g., 2147483647 when using 32-bit arithmetic) are accepted\nas if they were long integers instead. [1] There is no limit for long\ninteger literals apart from what can be stored in available memory.\n\nSome examples of plain integer literals (first row) and long integer\nliterals (second and third rows):\n\n 7 2147483647 0177\n 3L 79228162514264337593543950336L 0377L 0x100000000L\n 79228162514264337593543950336 0xdeadbeef\n', 'lambda': u'\nExpression lists\n****************\n\n expression_list ::= expression ( "," expression )* [","]\n\nAn expression list containing at least one comma yields a tuple. The\nlength of the tuple is the number of expressions in the list. The\nexpressions are evaluated from left to right.\n\nThe trailing comma is required only to create a single tuple (a.k.a. a\n*singleton*); it is optional in all other cases. A single expression\nwithout a trailing comma doesn\'t create a tuple, but rather yields the\nvalue of that expression. (To create an empty tuple, use an empty pair\nof parentheses: ``()``.)\n', 'lists': u'\nList displays\n*************\n\nA list display is a possibly empty series of expressions enclosed in\nsquare brackets:\n\n list_display ::= "[" [expression_list | list_comprehension] "]"\n list_comprehension ::= expression list_for\n list_for ::= "for" target_list "in" old_expression_list [list_iter]\n old_expression_list ::= old_expression [("," old_expression)+ [","]]\n list_iter ::= list_for | list_if\n list_if ::= "if" old_expression [list_iter]\n\nA list display yields a new list object. Its contents are specified\nby providing either a list of expressions or a list comprehension.\nWhen a comma-separated list of expressions is supplied, its elements\nare evaluated from left to right and placed into the list object in\nthat order. When a list comprehension is supplied, it consists of a\nsingle expression followed by at least one ``for`` clause and zero or\nmore ``for`` or ``if`` clauses. In this case, the elements of the new\nlist are those that would be produced by considering each of the\n``for`` or ``if`` clauses a block, nesting from left to right, and\nevaluating the expression to produce a list element each time the\ninnermost block is reached [1].\n', 'naming': u'\nNaming and binding\n******************\n\n*Names* refer to objects. Names are introduced by name binding\noperations. Each occurrence of a name in the program text refers to\nthe *binding* of that name established in the innermost function block\ncontaining the use.\n\nA *block* is a piece of Python program text that is executed as a\nunit. The following are blocks: a module, a function body, and a class\ndefinition. Each command typed interactively is a block. A script\nfile (a file given as standard input to the interpreter or specified\non the interpreter command line the first argument) is a code block.\nA script command (a command specified on the interpreter command line\nwith the \'**-c**\' option) is a code block. The file read by the\nbuilt-in function ``execfile()`` is a code block. The string argument\npassed to the built-in function ``eval()`` and to the ``exec``\nstatement is a code block. The expression read and evaluated by the\nbuilt-in function ``input()`` is a code block.\n\nA code block is executed in an *execution frame*. A frame contains\nsome administrative information (used for debugging) and determines\nwhere and how execution continues after the code block\'s execution has\ncompleted.\n\nA *scope* defines the visibility of a name within a block. If a local\nvariable is defined in a block, its scope includes that block. If the\ndefinition occurs in a function block, the scope extends to any blocks\ncontained within the defining one, unless a contained block introduces\na different binding for the name. The scope of names defined in a\nclass block is limited to the class block; it does not extend to the\ncode blocks of methods -- this includes generator expressions since\nthey are implemented using a function scope. This means that the\nfollowing will fail:\n\n class A:\n a = 42\n b = list(a + i for i in range(10))\n\nWhen a name is used in a code block, it is resolved using the nearest\nenclosing scope. The set of all such scopes visible to a code block\nis called the block\'s *environment*.\n\nIf a name is bound in a block, it is a local variable of that block.\nIf a name is bound at the module level, it is a global variable. (The\nvariables of the module code block are local and global.) If a\nvariable is used in a code block but not defined there, it is a *free\nvariable*.\n\nWhen a name is not found at all, a ``NameError`` exception is raised.\nIf the name refers to a local variable that has not been bound, a\n``UnboundLocalError`` exception is raised. ``UnboundLocalError`` is a\nsubclass of ``NameError``.\n\nThe following constructs bind names: formal parameters to functions,\n``import`` statements, class and function definitions (these bind the\nclass or function name in the defining block), and targets that are\nidentifiers if occurring in an assignment, ``for`` loop header, or in\nthe second position of an ``except`` clause header. The ``import``\nstatement of the form "``from ...import *``" binds all names defined\nin the imported module, except those beginning with an underscore.\nThis form may only be used at the module level.\n\nA target occurring in a ``del`` statement is also considered bound for\nthis purpose (though the actual semantics are to unbind the name). It\nis illegal to unbind a name that is referenced by an enclosing scope;\nthe compiler will report a ``SyntaxError``.\n\nEach assignment or import statement occurs within a block defined by a\nclass or function definition or at the module level (the top-level\ncode block).\n\nIf a name binding operation occurs anywhere within a code block, all\nuses of the name within the block are treated as references to the\ncurrent block. This can lead to errors when a name is used within a\nblock before it is bound. This rule is subtle. Python lacks\ndeclarations and allows name binding operations to occur anywhere\nwithin a code block. The local variables of a code block can be\ndetermined by scanning the entire text of the block for name binding\noperations.\n\nIf the global statement occurs within a block, all uses of the name\nspecified in the statement refer to the binding of that name in the\ntop-level namespace. Names are resolved in the top-level namespace by\nsearching the global namespace, i.e. the namespace of the module\ncontaining the code block, and the builtin namespace, the namespace of\nthe module ``__builtin__``. The global namespace is searched first.\nIf the name is not found there, the builtin namespace is searched.\nThe global statement must precede all uses of the name.\n\nThe built-in namespace associated with the execution of a code block\nis actually found by looking up the name ``__builtins__`` in its\nglobal namespace; this should be a dictionary or a module (in the\nlatter case the module\'s dictionary is used). By default, when in the\n``__main__`` module, ``__builtins__`` is the built-in module\n``__builtin__`` (note: no \'s\'); when in any other module,\n``__builtins__`` is an alias for the dictionary of the ``__builtin__``\nmodule itself. ``__builtins__`` can be set to a user-created\ndictionary to create a weak form of restricted execution.\n\nNote: Users should not touch ``__builtins__``; it is strictly an\n implementation detail. Users wanting to override values in the\n built-in namespace should ``import`` the ``__builtin__`` (no \'s\')\n module and modify its attributes appropriately.\n\nThe namespace for a module is automatically created the first time a\nmodule is imported. The main module for a script is always called\n``__main__``.\n\nThe global statement has the same scope as a name binding operation in\nthe same block. If the nearest enclosing scope for a free variable\ncontains a global statement, the free variable is treated as a global.\n\nA class definition is an executable statement that may use and define\nnames. These references follow the normal rules for name resolution.\nThe namespace of the class definition becomes the attribute dictionary\nof the class. Names defined at the class scope are not visible in\nmethods.\n\n\nInteraction with dynamic features\n=================================\n\nThere are several cases where Python statements are illegal when used\nin conjunction with nested scopes that contain free variables.\n\nIf a variable is referenced in an enclosing scope, it is illegal to\ndelete the name. An error will be reported at compile time.\n\nIf the wild card form of import --- ``import *`` --- is used in a\nfunction and the function contains or is a nested block with free\nvariables, the compiler will raise a ``SyntaxError``.\n\nIf ``exec`` is used in a function and the function contains or is a\nnested block with free variables, the compiler will raise a\n``SyntaxError`` unless the exec explicitly specifies the local\nnamespace for the ``exec``. (In other words, ``exec obj`` would be\nillegal, but ``exec obj in ns`` would be legal.)\n\nThe ``eval()``, ``execfile()``, and ``input()`` functions and the\n``exec`` statement do not have access to the full environment for\nresolving names. Names may be resolved in the local and global\nnamespaces of the caller. Free variables are not resolved in the\nnearest enclosing namespace, but in the global namespace. [1] The\n``exec`` statement and the ``eval()`` and ``execfile()`` functions\nhave optional arguments to override the global and local namespace.\nIf only one namespace is specified, it is used for both.\n', 'numbers': u"\nNumeric literals\n****************\n\nThere are four types of numeric literals: plain integers, long\nintegers, floating point numbers, and imaginary numbers. There are no\ncomplex literals (complex numbers can be formed by adding a real\nnumber and an imaginary number).\n\nNote that numeric literals do not include a sign; a phrase like ``-1``\nis actually an expression composed of the unary operator '``-``' and\nthe literal ``1``.\n", - 'numeric-types': u'\nEmulating numeric types\n***********************\n\nThe following methods can be defined to emulate numeric objects.\nMethods corresponding to operations that are not supported by the\nparticular kind of number implemented (e.g., bitwise operations for\nnon-integral numbers) should be left undefined.\n\nobject.__add__(self, other)\nobject.__sub__(self, other)\nobject.__mul__(self, other)\nobject.__floordiv__(self, other)\nobject.__mod__(self, other)\nobject.__divmod__(self, other)\nobject.__pow__(self, other[, modulo])\nobject.__lshift__(self, other)\nobject.__rshift__(self, other)\nobject.__and__(self, other)\nobject.__xor__(self, other)\nobject.__or__(self, other)\n\n These methods are called to implement the binary arithmetic\n operations (``+``, ``-``, ``*``, ``//``, ``%``, ``divmod()``,\n ``pow()``, ``**``, ``<<``, ``>>``, ``&``, ``^``, ``|``). For\n instance, to evaluate the expression *x*``+``*y*, where *x* is an\n instance of a class that has an ``__add__()`` method,\n ``x.__add__(y)`` is called. The ``__divmod__()`` method should be\n the equivalent to using ``__floordiv__()`` and ``__mod__()``; it\n should not be related to ``__truediv__()`` (described below). Note\n that ``__pow__()`` should be defined to accept an optional third\n argument if the ternary version of the built-in ``pow()`` function\n is to be supported.\n\n If one of those methods does not support the operation with the\n supplied arguments, it should return ``NotImplemented``.\n\nobject.__div__(self, other)\nobject.__truediv__(self, other)\n\n The division operator (``/``) is implemented by these methods. The\n ``__truediv__()`` method is used when ``__future__.division`` is in\n effect, otherwise ``__div__()`` is used. If only one of these two\n methods is defined, the object will not support division in the\n alternate context; ``TypeError`` will be raised instead.\n\nobject.__radd__(self, other)\nobject.__rsub__(self, other)\nobject.__rmul__(self, other)\nobject.__rdiv__(self, other)\nobject.__rtruediv__(self, other)\nobject.__rfloordiv__(self, other)\nobject.__rmod__(self, other)\nobject.__rdivmod__(self, other)\nobject.__rpow__(self, other)\nobject.__rlshift__(self, other)\nobject.__rrshift__(self, other)\nobject.__rand__(self, other)\nobject.__rxor__(self, other)\nobject.__ror__(self, other)\n\n These methods are called to implement the binary arithmetic\n operations (``+``, ``-``, ``*``, ``/``, ``%``, ``divmod()``,\n ``pow()``, ``**``, ``<<``, ``>>``, ``&``, ``^``, ``|``) with\n reflected (swapped) operands. These functions are only called if\n the left operand does not support the corresponding operation and\n the operands are of different types. [4] For instance, to evaluate\n the expression *x*``-``*y*, where *y* is an instance of a class\n that has an ``__rsub__()`` method, ``y.__rsub__(x)`` is called if\n ``x.__sub__(y)`` returns *NotImplemented*.\n\n Note that ternary ``pow()`` will not try calling ``__rpow__()``\n (the coercion rules would become too complicated).\n\n Note: If the right operand\'s type is a subclass of the left operand\'s\n type and that subclass provides the reflected method for the\n operation, this method will be called before the left operand\'s\n non-reflected method. This behavior allows subclasses to\n override their ancestors\' operations.\n\nobject.__iadd__(self, other)\nobject.__isub__(self, other)\nobject.__imul__(self, other)\nobject.__idiv__(self, other)\nobject.__itruediv__(self, other)\nobject.__ifloordiv__(self, other)\nobject.__imod__(self, other)\nobject.__ipow__(self, other[, modulo])\nobject.__ilshift__(self, other)\nobject.__irshift__(self, other)\nobject.__iand__(self, other)\nobject.__ixor__(self, other)\nobject.__ior__(self, other)\n\n These methods are called to implement the augmented arithmetic\n operations (``+=``, ``-=``, ``*=``, ``/=``, ``//=``, ``%=``,\n ``**=``, ``<<=``, ``>>=``, ``&=``, ``^=``, ``|=``). These methods\n should attempt to do the operation in-place (modifying *self*) and\n return the result (which could be, but does not have to be,\n *self*). If a specific method is not defined, the augmented\n operation falls back to the normal methods. For instance, to\n evaluate the expression *x*``+=``*y*, where *x* is an instance of a\n class that has an ``__iadd__()`` method, ``x.__iadd__(y)`` is\n called. If *x* is an instance of a class that does not define a\n ``__iadd__()`` method, ``x.__add__(y)`` and ``y.__radd__(x)`` are\n considered, as with the evaluation of *x*``+``*y*.\n\nobject.__neg__(self)\nobject.__pos__(self)\nobject.__abs__(self)\nobject.__invert__(self)\n\n Called to implement the unary arithmetic operations (``-``, ``+``,\n ``abs()`` and ``~``).\n\nobject.__complex__(self)\nobject.__int__(self)\nobject.__long__(self)\nobject.__float__(self)\n\n Called to implement the built-in functions ``complex()``,\n ``int()``, ``long()``, and ``float()``. Should return a value of\n the appropriate type.\n\nobject.__oct__(self)\nobject.__hex__(self)\n\n Called to implement the built-in functions ``oct()`` and ``hex()``.\n Should return a string value.\n\nobject.__index__(self)\n\n Called to implement ``operator.index()``. Also called whenever\n Python needs an integer object (such as in slicing). Must return\n an integer (int or long).\n\n Added in version 2.5.\n\nobject.__coerce__(self, other)\n\n Called to implement "mixed-mode" numeric arithmetic. Should either\n return a 2-tuple containing *self* and *other* converted to a\n common numeric type, or ``None`` if conversion is impossible. When\n the common type would be the type of ``other``, it is sufficient to\n return ``None``, since the interpreter will also ask the other\n object to attempt a coercion (but sometimes, if the implementation\n of the other type cannot be changed, it is useful to do the\n conversion to the other type here). A return value of\n ``NotImplemented`` is equivalent to returning ``None``.\n', + 'numeric-types': u'\nEmulating numeric types\n***********************\n\nThe following methods can be defined to emulate numeric objects.\nMethods corresponding to operations that are not supported by the\nparticular kind of number implemented (e.g., bitwise operations for\nnon-integral numbers) should be left undefined.\n\nobject.__add__(self, other)\nobject.__sub__(self, other)\nobject.__mul__(self, other)\nobject.__floordiv__(self, other)\nobject.__mod__(self, other)\nobject.__divmod__(self, other)\nobject.__pow__(self, other[, modulo])\nobject.__lshift__(self, other)\nobject.__rshift__(self, other)\nobject.__and__(self, other)\nobject.__xor__(self, other)\nobject.__or__(self, other)\n\n These methods are called to implement the binary arithmetic\n operations (``+``, ``-``, ``*``, ``//``, ``%``, ``divmod()``,\n ``pow()``, ``**``, ``<<``, ``>>``, ``&``, ``^``, ``|``). For\n instance, to evaluate the expression ``x + y``, where *x* is an\n instance of a class that has an ``__add__()`` method,\n ``x.__add__(y)`` is called. The ``__divmod__()`` method should be\n the equivalent to using ``__floordiv__()`` and ``__mod__()``; it\n should not be related to ``__truediv__()`` (described below). Note\n that ``__pow__()`` should be defined to accept an optional third\n argument if the ternary version of the built-in ``pow()`` function\n is to be supported.\n\n If one of those methods does not support the operation with the\n supplied arguments, it should return ``NotImplemented``.\n\nobject.__div__(self, other)\nobject.__truediv__(self, other)\n\n The division operator (``/``) is implemented by these methods. The\n ``__truediv__()`` method is used when ``__future__.division`` is in\n effect, otherwise ``__div__()`` is used. If only one of these two\n methods is defined, the object will not support division in the\n alternate context; ``TypeError`` will be raised instead.\n\nobject.__radd__(self, other)\nobject.__rsub__(self, other)\nobject.__rmul__(self, other)\nobject.__rdiv__(self, other)\nobject.__rtruediv__(self, other)\nobject.__rfloordiv__(self, other)\nobject.__rmod__(self, other)\nobject.__rdivmod__(self, other)\nobject.__rpow__(self, other)\nobject.__rlshift__(self, other)\nobject.__rrshift__(self, other)\nobject.__rand__(self, other)\nobject.__rxor__(self, other)\nobject.__ror__(self, other)\n\n These methods are called to implement the binary arithmetic\n operations (``+``, ``-``, ``*``, ``/``, ``%``, ``divmod()``,\n ``pow()``, ``**``, ``<<``, ``>>``, ``&``, ``^``, ``|``) with\n reflected (swapped) operands. These functions are only called if\n the left operand does not support the corresponding operation and\n the operands are of different types. [3] For instance, to evaluate\n the expression ``x - y``, where *y* is an instance of a class that\n has an ``__rsub__()`` method, ``y.__rsub__(x)`` is called if\n ``x.__sub__(y)`` returns *NotImplemented*.\n\n Note that ternary ``pow()`` will not try calling ``__rpow__()``\n (the coercion rules would become too complicated).\n\n Note: If the right operand\'s type is a subclass of the left operand\'s\n type and that subclass provides the reflected method for the\n operation, this method will be called before the left operand\'s\n non-reflected method. This behavior allows subclasses to\n override their ancestors\' operations.\n\nobject.__iadd__(self, other)\nobject.__isub__(self, other)\nobject.__imul__(self, other)\nobject.__idiv__(self, other)\nobject.__itruediv__(self, other)\nobject.__ifloordiv__(self, other)\nobject.__imod__(self, other)\nobject.__ipow__(self, other[, modulo])\nobject.__ilshift__(self, other)\nobject.__irshift__(self, other)\nobject.__iand__(self, other)\nobject.__ixor__(self, other)\nobject.__ior__(self, other)\n\n These methods are called to implement the augmented arithmetic\n operations (``+=``, ``-=``, ``*=``, ``/=``, ``//=``, ``%=``,\n ``**=``, ``<<=``, ``>>=``, ``&=``, ``^=``, ``|=``). These methods\n should attempt to do the operation in-place (modifying *self*) and\n return the result (which could be, but does not have to be,\n *self*). If a specific method is not defined, the augmented\n operation falls back to the normal methods. For instance, to\n evaluate the expression ``x += y``, where *x* is an instance of a\n class that has an ``__iadd__()`` method, ``x.__iadd__(y)`` is\n called. If *x* is an instance of a class that does not define a\n ``__iadd__()`` method, ``x.__add__(y)`` and ``y.__radd__(x)`` are\n considered, as with the evaluation of ``x + y``.\n\nobject.__neg__(self)\nobject.__pos__(self)\nobject.__abs__(self)\nobject.__invert__(self)\n\n Called to implement the unary arithmetic operations (``-``, ``+``,\n ``abs()`` and ``~``).\n\nobject.__complex__(self)\nobject.__int__(self)\nobject.__long__(self)\nobject.__float__(self)\n\n Called to implement the built-in functions ``complex()``,\n ``int()``, ``long()``, and ``float()``. Should return a value of\n the appropriate type.\n\nobject.__oct__(self)\nobject.__hex__(self)\n\n Called to implement the built-in functions ``oct()`` and ``hex()``.\n Should return a string value.\n\nobject.__index__(self)\n\n Called to implement ``operator.index()``. Also called whenever\n Python needs an integer object (such as in slicing). Must return\n an integer (int or long).\n\n New in version 2.5.\n\nobject.__coerce__(self, other)\n\n Called to implement "mixed-mode" numeric arithmetic. Should either\n return a 2-tuple containing *self* and *other* converted to a\n common numeric type, or ``None`` if conversion is impossible. When\n the common type would be the type of ``other``, it is sufficient to\n return ``None``, since the interpreter will also ask the other\n object to attempt a coercion (but sometimes, if the implementation\n of the other type cannot be changed, it is useful to do the\n conversion to the other type here). A return value of\n ``NotImplemented`` is equivalent to returning ``None``.\n', 'objects': u'\nObjects, values and types\n*************************\n\n*Objects* are Python\'s abstraction for data. All data in a Python\nprogram is represented by objects or by relations between objects. (In\na sense, and in conformance to Von Neumann\'s model of a "stored\nprogram computer," code is also represented by objects.)\n\nEvery object has an identity, a type and a value. An object\'s\n*identity* never changes once it has been created; you may think of it\nas the object\'s address in memory. The \'``is``\' operator compares the\nidentity of two objects; the ``id()`` function returns an integer\nrepresenting its identity (currently implemented as its address). An\nobject\'s *type* is also unchangeable. [1] An object\'s type determines\nthe operations that the object supports (e.g., "does it have a\nlength?") and also defines the possible values for objects of that\ntype. The ``type()`` function returns an object\'s type (which is an\nobject itself). The *value* of some objects can change. Objects\nwhose value can change are said to be *mutable*; objects whose value\nis unchangeable once they are created are called *immutable*. (The\nvalue of an immutable container object that contains a reference to a\nmutable object can change when the latter\'s value is changed; however\nthe container is still considered immutable, because the collection of\nobjects it contains cannot be changed. So, immutability is not\nstrictly the same as having an unchangeable value, it is more subtle.)\nAn object\'s mutability is determined by its type; for instance,\nnumbers, strings and tuples are immutable, while dictionaries and\nlists are mutable.\n\nObjects are never explicitly destroyed; however, when they become\nunreachable they may be garbage-collected. An implementation is\nallowed to postpone garbage collection or omit it altogether --- it is\na matter of implementation quality how garbage collection is\nimplemented, as long as no objects are collected that are still\nreachable. (Implementation note: the current implementation uses a\nreference-counting scheme with (optional) delayed detection of\ncyclically linked garbage, which collects most objects as soon as they\nbecome unreachable, but is not guaranteed to collect garbage\ncontaining circular references. See the documentation of the ``gc``\nmodule for information on controlling the collection of cyclic\ngarbage.)\n\nNote that the use of the implementation\'s tracing or debugging\nfacilities may keep objects alive that would normally be collectable.\nAlso note that catching an exception with a \'``try``...``except``\'\nstatement may keep objects alive.\n\nSome objects contain references to "external" resources such as open\nfiles or windows. It is understood that these resources are freed\nwhen the object is garbage-collected, but since garbage collection is\nnot guaranteed to happen, such objects also provide an explicit way to\nrelease the external resource, usually a ``close()`` method. Programs\nare strongly recommended to explicitly close such objects. The\n\'``try``...``finally``\' statement provides a convenient way to do\nthis.\n\nSome objects contain references to other objects; these are called\n*containers*. Examples of containers are tuples, lists and\ndictionaries. The references are part of a container\'s value. In\nmost cases, when we talk about the value of a container, we imply the\nvalues, not the identities of the contained objects; however, when we\ntalk about the mutability of a container, only the identities of the\nimmediately contained objects are implied. So, if an immutable\ncontainer (like a tuple) contains a reference to a mutable object, its\nvalue changes if that mutable object is changed.\n\nTypes affect almost all aspects of object behavior. Even the\nimportance of object identity is affected in some sense: for immutable\ntypes, operations that compute new values may actually return a\nreference to any existing object with the same type and value, while\nfor mutable objects this is not allowed. E.g., after ``a = 1; b =\n1``, ``a`` and ``b`` may or may not refer to the same object with the\nvalue one, depending on the implementation, but after ``c = []; d =\n[]``, ``c`` and ``d`` are guaranteed to refer to two different,\nunique, newly created empty lists. (Note that ``c = d = []`` assigns\nthe same object to both ``c`` and ``d``.)\n', - 'operator-summary': u'\nSummary\n*******\n\nThe following table summarizes the operator precedences in Python,\nfrom lowest precedence (least binding) to highest precedence (most\nbinding). Operators in the same box have the same precedence. Unless\nthe syntax is explicitly given, operators are binary. Operators in\nthe same box group left to right (except for comparisons, including\ntests, which all have the same precedence and chain from left to right\n--- see section *Comparisons* --- and exponentiation, which groups\nfrom right to left).\n\n+-------------------------------------------------+---------------------------------------+\n| Operator | Description |\n+=================================================+=======================================+\n| ``lambda`` | Lambda expression |\n+-------------------------------------------------+---------------------------------------+\n| ``or`` | Boolean OR |\n+-------------------------------------------------+---------------------------------------+\n| ``and`` | Boolean AND |\n+-------------------------------------------------+---------------------------------------+\n| ``not`` *x* | Boolean NOT |\n+-------------------------------------------------+---------------------------------------+\n| ``in``, ``not`` ``in`` | Membership tests |\n+-------------------------------------------------+---------------------------------------+\n| ``is``, ``is not`` | Identity tests |\n+-------------------------------------------------+---------------------------------------+\n| ``<``, ``<=``, ``>``, ``>=``, ``<>``, ``!=``, | Comparisons |\n| ``==`` | |\n+-------------------------------------------------+---------------------------------------+\n| ``|`` | Bitwise OR |\n+-------------------------------------------------+---------------------------------------+\n| ``^`` | Bitwise XOR |\n+-------------------------------------------------+---------------------------------------+\n| ``&`` | Bitwise AND |\n+-------------------------------------------------+---------------------------------------+\n| ``<<``, ``>>`` | Shifts |\n+-------------------------------------------------+---------------------------------------+\n| ``+``, ``-`` | Addition and subtraction |\n+-------------------------------------------------+---------------------------------------+\n| ``*``, ``/``, ``%`` | Multiplication, division, remainder |\n+-------------------------------------------------+---------------------------------------+\n| ``+x``, ``-x`` | Positive, negative |\n+-------------------------------------------------+---------------------------------------+\n| ``~x`` | Bitwise not |\n+-------------------------------------------------+---------------------------------------+\n| ``**`` | Exponentiation |\n+-------------------------------------------------+---------------------------------------+\n| ``x.attribute`` | Attribute reference |\n+-------------------------------------------------+---------------------------------------+\n| ``x[index]`` | Subscription |\n+-------------------------------------------------+---------------------------------------+\n| ``x[index:index]`` | Slicing |\n+-------------------------------------------------+---------------------------------------+\n| ``f(arguments...)`` | Function call |\n+-------------------------------------------------+---------------------------------------+\n| ``(expressions...)`` | Binding or tuple display |\n+-------------------------------------------------+---------------------------------------+\n| ``[expressions...]`` | List display |\n+-------------------------------------------------+---------------------------------------+\n| ``{key:datum...}`` | Dictionary display |\n+-------------------------------------------------+---------------------------------------+\n| ```expressions...``` | String conversion |\n+-------------------------------------------------+---------------------------------------+\n\n-[ Footnotes ]-\n\n[1] In Python 2.3 and later releases, a list comprehension "leaks" the\n control variables of each ``for`` it contains into the containing\n scope. However, this behavior is deprecated, and relying on it\n will not work in Python 3.0\n\n[2] While ``abs(x%y) < abs(y)`` is true mathematically, for floats it\n may not be true numerically due to roundoff. For example, and\n assuming a platform on which a Python float is an IEEE 754 double-\n precision number, in order that ``-1e-100 % 1e100`` have the same\n sign as ``1e100``, the computed result is ``-1e-100 + 1e100``,\n which is numerically exactly equal to ``1e100``. Function\n ``fmod()`` in the ``math`` module returns a result whose sign\n matches the sign of the first argument instead, and so returns\n ``-1e-100`` in this case. Which approach is more appropriate\n depends on the application.\n\n[3] If x is very close to an exact integer multiple of y, it\'s\n possible for ``floor(x/y)`` to be one larger than ``(x-x%y)/y``\n due to rounding. In such cases, Python returns the latter result,\n in order to preserve that ``divmod(x,y)[0] * y + x % y`` be very\n close to ``x``.\n\n[4] While comparisons between unicode strings make sense at the byte\n level, they may be counter-intuitive to users. For example, the\n strings ``u"\\u00C7"`` and ``u"\\u0043\\u0327"`` compare differently,\n even though they both represent the same unicode character (LATIN\n CAPTITAL LETTER C WITH CEDILLA). To compare strings in a human\n recognizable way, compare using ``unicodedata.normalize()``.\n\n[5] The implementation computes this efficiently, without constructing\n lists or sorting.\n\n[6] Earlier versions of Python used lexicographic comparison of the\n sorted (key, value) lists, but this was very expensive for the\n common case of comparing for equality. An even earlier version of\n Python compared dictionaries by identity only, but this caused\n surprises because people expected to be able to test a dictionary\n for emptiness by comparing it to ``{}``.\n', + 'operator-summary': u'\nSummary\n*******\n\nThe following table summarizes the operator precedences in Python,\nfrom lowest precedence (least binding) to highest precedence (most\nbinding). Operators in the same box have the same precedence. Unless\nthe syntax is explicitly given, operators are binary. Operators in\nthe same box group left to right (except for comparisons, including\ntests, which all have the same precedence and chain from left to right\n--- see section *Comparisons* --- and exponentiation, which groups\nfrom right to left).\n\n+-------------------------------------------------+---------------------------------------+\n| Operator | Description |\n+=================================================+=======================================+\n| ``lambda`` | Lambda expression |\n+-------------------------------------------------+---------------------------------------+\n| ``or`` | Boolean OR |\n+-------------------------------------------------+---------------------------------------+\n| ``and`` | Boolean AND |\n+-------------------------------------------------+---------------------------------------+\n| ``not`` *x* | Boolean NOT |\n+-------------------------------------------------+---------------------------------------+\n| ``in``, ``not`` ``in`` | Membership tests |\n+-------------------------------------------------+---------------------------------------+\n| ``is``, ``is not`` | Identity tests |\n+-------------------------------------------------+---------------------------------------+\n| ``<``, ``<=``, ``>``, ``>=``, ``<>``, ``!=``, | Comparisons |\n| ``==`` | |\n+-------------------------------------------------+---------------------------------------+\n| ``|`` | Bitwise OR |\n+-------------------------------------------------+---------------------------------------+\n| ``^`` | Bitwise XOR |\n+-------------------------------------------------+---------------------------------------+\n| ``&`` | Bitwise AND |\n+-------------------------------------------------+---------------------------------------+\n| ``<<``, ``>>`` | Shifts |\n+-------------------------------------------------+---------------------------------------+\n| ``+``, ``-`` | Addition and subtraction |\n+-------------------------------------------------+---------------------------------------+\n| ``*``, ``/``, ``%`` | Multiplication, division, remainder |\n+-------------------------------------------------+---------------------------------------+\n| ``+x``, ``-x`` | Positive, negative |\n+-------------------------------------------------+---------------------------------------+\n| ``~x`` | Bitwise not |\n+-------------------------------------------------+---------------------------------------+\n| ``**`` | Exponentiation |\n+-------------------------------------------------+---------------------------------------+\n| ``x[index]`` | Subscription |\n+-------------------------------------------------+---------------------------------------+\n| ``x[index:index]`` | Slicing |\n+-------------------------------------------------+---------------------------------------+\n| ``x(arguments...)`` | Call |\n+-------------------------------------------------+---------------------------------------+\n| ``x.attribute`` | Attribute reference |\n+-------------------------------------------------+---------------------------------------+\n| ``(expressions...)`` | Binding or tuple display |\n+-------------------------------------------------+---------------------------------------+\n| ``[expressions...]`` | List display |\n+-------------------------------------------------+---------------------------------------+\n| ``{key:datum...}`` | Dictionary display |\n+-------------------------------------------------+---------------------------------------+\n| ```expressions...``` | String conversion |\n+-------------------------------------------------+---------------------------------------+\n\n-[ Footnotes ]-\n\n[1] In Python 2.3 and later releases, a list comprehension "leaks" the\n control variables of each ``for`` it contains into the containing\n scope. However, this behavior is deprecated, and relying on it\n will not work in Python 3.0\n\n[2] While ``abs(x%y) < abs(y)`` is true mathematically, for floats it\n may not be true numerically due to roundoff. For example, and\n assuming a platform on which a Python float is an IEEE 754 double-\n precision number, in order that ``-1e-100 % 1e100`` have the same\n sign as ``1e100``, the computed result is ``-1e-100 + 1e100``,\n which is numerically exactly equal to ``1e100``. Function\n ``fmod()`` in the ``math`` module returns a result whose sign\n matches the sign of the first argument instead, and so returns\n ``-1e-100`` in this case. Which approach is more appropriate\n depends on the application.\n\n[3] If x is very close to an exact integer multiple of y, it\'s\n possible for ``floor(x/y)`` to be one larger than ``(x-x%y)/y``\n due to rounding. In such cases, Python returns the latter result,\n in order to preserve that ``divmod(x,y)[0] * y + x % y`` be very\n close to ``x``.\n\n[4] While comparisons between unicode strings make sense at the byte\n level, they may be counter-intuitive to users. For example, the\n strings ``u"\\u00C7"`` and ``u"\\u0043\\u0327"`` compare differently,\n even though they both represent the same unicode character (LATIN\n CAPTITAL LETTER C WITH CEDILLA). To compare strings in a human\n recognizable way, compare using ``unicodedata.normalize()``.\n\n[5] The implementation computes this efficiently, without constructing\n lists or sorting.\n\n[6] Earlier versions of Python used lexicographic comparison of the\n sorted (key, value) lists, but this was very expensive for the\n common case of comparing for equality. An even earlier version of\n Python compared dictionaries by identity only, but this caused\n surprises because people expected to be able to test a dictionary\n for emptiness by comparing it to ``{}``.\n\n[7] Due to automatic garbage-collection, free lists, and the dynamic\n nature of descriptors, you may notice seemingly unusual behaviour\n in certain uses of the ``is`` operator, like those involving\n comparisons between instance methods, or constants. Check their\n documentation for more info.\n', 'pass': u'\nThe ``pass`` statement\n**********************\n\n pass_stmt ::= "pass"\n\n``pass`` is a null operation --- when it is executed, nothing happens.\nIt is useful as a placeholder when a statement is required\nsyntactically, but no code needs to be executed, for example:\n\n def f(arg): pass # a function that does nothing (yet)\n\n class C: pass # a class with no methods (yet)\n', 'power': u'\nThe power operator\n******************\n\nThe power operator binds more tightly than unary operators on its\nleft; it binds less tightly than unary operators on its right. The\nsyntax is:\n\n power ::= primary ["**" u_expr]\n\nThus, in an unparenthesized sequence of power and unary operators, the\noperators are evaluated from right to left (this does not constrain\nthe evaluation order for the operands): ``-1**2`` results in ``-1``.\n\nThe power operator has the same semantics as the built-in ``pow()``\nfunction, when called with two arguments: it yields its left argument\nraised to the power of its right argument. The numeric arguments are\nfirst converted to a common type. The result type is that of the\narguments after coercion.\n\nWith mixed operand types, the coercion rules for binary arithmetic\noperators apply. For int and long int operands, the result has the\nsame type as the operands (after coercion) unless the second argument\nis negative; in that case, all arguments are converted to float and a\nfloat result is delivered. For example, ``10**2`` returns ``100``, but\n``10**-2`` returns ``0.01``. (This last feature was added in Python\n2.2. In Python 2.1 and before, if both arguments were of integer types\nand the second argument was negative, an exception was raised).\n\nRaising ``0.0`` to a negative power results in a\n``ZeroDivisionError``. Raising a negative number to a fractional power\nresults in a ``ValueError``.\n', - 'print': u'\nThe ``print`` statement\n***********************\n\n print_stmt ::= "print" ([expression ("," expression)* [","]\n | ">>" expression [("," expression)+ [","])\n\n``print`` evaluates each expression in turn and writes the resulting\nobject to standard output (see below). If an object is not a string,\nit is first converted to a string using the rules for string\nconversions. The (resulting or original) string is then written. A\nspace is written before each object is (converted and) written, unless\nthe output system believes it is positioned at the beginning of a\nline. This is the case (1) when no characters have yet been written\nto standard output, (2) when the last character written to standard\noutput is ``\'\\n\'``, or (3) when the last write operation on standard\noutput was not a ``print`` statement. (In some cases it may be\nfunctional to write an empty string to standard output for this\nreason.)\n\nNote: Objects which act like file objects but which are not the built-in\n file objects often do not properly emulate this aspect of the file\n object\'s behavior, so it is best not to rely on this.\n\nA ``\'\\n\'`` character is written at the end, unless the ``print``\nstatement ends with a comma. This is the only action if the statement\ncontains just the keyword ``print``.\n\nStandard output is defined as the file object named ``stdout`` in the\nbuilt-in module ``sys``. If no such object exists, or if it does not\nhave a ``write()`` method, a ``RuntimeError`` exception is raised.\n\n``print`` also has an extended form, defined by the second portion of\nthe syntax described above. This form is sometimes referred to as\n"``print`` chevron." In this form, the first expression after the\n``>>`` must evaluate to a "file-like" object, specifically an object\nthat has a ``write()`` method as described above. With this extended\nform, the subsequent expressions are printed to this file object. If\nthe first expression evaluates to ``None``, then ``sys.stdout`` is\nused as the file for output.\n', + 'print': u'\nThe ``print`` statement\n***********************\n\n print_stmt ::= "print" ([expression ("," expression)* [","]]\n | ">>" expression [("," expression)+ [","]])\n\n``print`` evaluates each expression in turn and writes the resulting\nobject to standard output (see below). If an object is not a string,\nit is first converted to a string using the rules for string\nconversions. The (resulting or original) string is then written. A\nspace is written before each object is (converted and) written, unless\nthe output system believes it is positioned at the beginning of a\nline. This is the case (1) when no characters have yet been written\nto standard output, (2) when the last character written to standard\noutput is ``\'\\n\'``, or (3) when the last write operation on standard\noutput was not a ``print`` statement. (In some cases it may be\nfunctional to write an empty string to standard output for this\nreason.)\n\nNote: Objects which act like file objects but which are not the built-in\n file objects often do not properly emulate this aspect of the file\n object\'s behavior, so it is best not to rely on this.\n\nA ``\'\\n\'`` character is written at the end, unless the ``print``\nstatement ends with a comma. This is the only action if the statement\ncontains just the keyword ``print``.\n\nStandard output is defined as the file object named ``stdout`` in the\nbuilt-in module ``sys``. If no such object exists, or if it does not\nhave a ``write()`` method, a ``RuntimeError`` exception is raised.\n\n``print`` also has an extended form, defined by the second portion of\nthe syntax described above. This form is sometimes referred to as\n"``print`` chevron." In this form, the first expression after the\n``>>`` must evaluate to a "file-like" object, specifically an object\nthat has a ``write()`` method as described above. With this extended\nform, the subsequent expressions are printed to this file object. If\nthe first expression evaluates to ``None``, then ``sys.stdout`` is\nused as the file for output.\n', 'raise': u'\nThe ``raise`` statement\n***********************\n\n raise_stmt ::= "raise" [expression ["," expression ["," expression]]]\n\nIf no expressions are present, ``raise`` re-raises the last exception\nthat was active in the current scope. If no exception is active in\nthe current scope, a ``TypeError`` exception is raised indicating that\nthis is an error (if running under IDLE, a ``Queue.Empty`` exception\nis raised instead).\n\nOtherwise, ``raise`` evaluates the expressions to get three objects,\nusing ``None`` as the value of omitted expressions. The first two\nobjects are used to determine the *type* and *value* of the exception.\n\nIf the first object is an instance, the type of the exception is the\nclass of the instance, the instance itself is the value, and the\nsecond object must be ``None``.\n\nIf the first object is a class, it becomes the type of the exception.\nThe second object is used to determine the exception value: If it is\nan instance of the class, the instance becomes the exception value. If\nthe second object is a tuple, it is used as the argument list for the\nclass constructor; if it is ``None``, an empty argument list is used,\nand any other object is treated as a single argument to the\nconstructor. The instance so created by calling the constructor is\nused as the exception value.\n\nIf a third object is present and not ``None``, it must be a traceback\nobject (see section *The standard type hierarchy*), and it is\nsubstituted instead of the current location as the place where the\nexception occurred. If the third object is present and not a\ntraceback object or ``None``, a ``TypeError`` exception is raised.\nThe three-expression form of ``raise`` is useful to re-raise an\nexception transparently in an except clause, but ``raise`` with no\nexpressions should be preferred if the exception to be re-raised was\nthe most recently active exception in the current scope.\n\nAdditional information on exceptions can be found in section\n*Exceptions*, and information about handling exceptions is in section\n*The try statement*.\n', 'return': u'\nThe ``return`` statement\n************************\n\n return_stmt ::= "return" [expression_list]\n\n``return`` may only occur syntactically nested in a function\ndefinition, not within a nested class definition.\n\nIf an expression list is present, it is evaluated, else ``None`` is\nsubstituted.\n\n``return`` leaves the current function call with the expression list\n(or ``None``) as return value.\n\nWhen ``return`` passes control out of a ``try`` statement with a\n``finally`` clause, that ``finally`` clause is executed before really\nleaving the function.\n\nIn a generator function, the ``return`` statement is not allowed to\ninclude an **expression_list**. In that context, a bare ``return``\nindicates that the generator is done and will cause ``StopIteration``\nto be raised.\n', - 'sequence-methods': u'\nAdditional methods for emulation of sequence types\n**************************************************\n\nThe following optional methods can be defined to further emulate\nsequence objects. Immutable sequences methods should at most only\ndefine ``__getslice__()``; mutable sequences might define all three\nmethods.\n\nobject.__getslice__(self, i, j)\n\n Deprecated in version 2.0: Support slice objects as parameters to\n the ``__getitem__()`` method. (However, built-in types in CPython\n currently still implement ``__getslice__()``. Therefore, you have\n to override it in derived classes when implementing slicing.)\n\n Called to implement evaluation of ``self[i:j]``. The returned\n object should be of the same type as *self*. Note that missing *i*\n or *j* in the slice expression are replaced by zero or\n ``sys.maxint``, respectively. If negative indexes are used in the\n slice, the length of the sequence is added to that index. If the\n instance does not implement the ``__len__()`` method, an\n ``AttributeError`` is raised. No guarantee is made that indexes\n adjusted this way are not still negative. Indexes which are\n greater than the length of the sequence are not modified. If no\n ``__getslice__()`` is found, a slice object is created instead, and\n passed to ``__getitem__()`` instead.\n\nobject.__setslice__(self, i, j, sequence)\n\n Called to implement assignment to ``self[i:j]``. Same notes for *i*\n and *j* as for ``__getslice__()``.\n\n This method is deprecated. If no ``__setslice__()`` is found, or\n for extended slicing of the form ``self[i:j:k]``, a slice object is\n created, and passed to ``__setitem__()``, instead of\n ``__setslice__()`` being called.\n\nobject.__delslice__(self, i, j)\n\n Called to implement deletion of ``self[i:j]``. Same notes for *i*\n and *j* as for ``__getslice__()``. This method is deprecated. If no\n ``__delslice__()`` is found, or for extended slicing of the form\n ``self[i:j:k]``, a slice object is created, and passed to\n ``__delitem__()``, instead of ``__delslice__()`` being called.\n\nNotice that these methods are only invoked when a single slice with a\nsingle colon is used, and the slice method is available. For slice\noperations involving extended slice notation, or in absence of the\nslice methods, ``__getitem__()``, ``__setitem__()`` or\n``__delitem__()`` is called with a slice object as argument.\n\nThe following example demonstrate how to make your program or module\ncompatible with earlier versions of Python (assuming that methods\n``__getitem__()``, ``__setitem__()`` and ``__delitem__()`` support\nslice objects as arguments):\n\n class MyClass:\n ...\n def __getitem__(self, index):\n ...\n def __setitem__(self, index, value):\n ...\n def __delitem__(self, index):\n ...\n\n if sys.version_info < (2, 0):\n # They won\'t be defined if version is at least 2.0 final\n\n def __getslice__(self, i, j):\n return self[max(0, i):max(0, j):]\n def __setslice__(self, i, j, seq):\n self[max(0, i):max(0, j):] = seq\n def __delslice__(self, i, j):\n del self[max(0, i):max(0, j):]\n ...\n\nNote the calls to ``max()``; these are necessary because of the\nhandling of negative indices before the ``__*slice__()`` methods are\ncalled. When negative indexes are used, the ``__*item__()`` methods\nreceive them as provided, but the ``__*slice__()`` methods get a\n"cooked" form of the index values. For each negative index value, the\nlength of the sequence is added to the index before calling the method\n(which may still result in a negative index); this is the customary\nhandling of negative indexes by the built-in sequence types, and the\n``__*item__()`` methods are expected to do this as well. However,\nsince they should already be doing that, negative indexes cannot be\npassed in; they must be constrained to the bounds of the sequence\nbefore being passed to the ``__*item__()`` methods. Calling ``max(0,\ni)`` conveniently returns the proper value.\n', - 'sequence-types': u"\nEmulating container types\n*************************\n\nThe following methods can be defined to implement container objects.\nContainers usually are sequences (such as lists or tuples) or mappings\n(like dictionaries), but can represent other containers as well. The\nfirst set of methods is used either to emulate a sequence or to\nemulate a mapping; the difference is that for a sequence, the\nallowable keys should be the integers *k* for which ``0 <= k < N``\nwhere *N* is the length of the sequence, or slice objects, which\ndefine a range of items. (For backwards compatibility, the method\n``__getslice__()`` (see below) can also be defined to handle simple,\nbut not extended slices.) It is also recommended that mappings provide\nthe methods ``keys()``, ``values()``, ``items()``, ``has_key()``,\n``get()``, ``clear()``, ``setdefault()``, ``iterkeys()``,\n``itervalues()``, ``iteritems()``, ``pop()``, ``popitem()``,\n``copy()``, and ``update()`` behaving similar to those for Python's\nstandard dictionary objects. The ``UserDict`` module provides a\n``DictMixin`` class to help create those methods from a base set of\n``__getitem__()``, ``__setitem__()``, ``__delitem__()``, and\n``keys()``. Mutable sequences should provide methods ``append()``,\n``count()``, ``index()``, ``extend()``, ``insert()``, ``pop()``,\n``remove()``, ``reverse()`` and ``sort()``, like Python standard list\nobjects. Finally, sequence types should implement addition (meaning\nconcatenation) and multiplication (meaning repetition) by defining the\nmethods ``__add__()``, ``__radd__()``, ``__iadd__()``, ``__mul__()``,\n``__rmul__()`` and ``__imul__()`` described below; they should not\ndefine ``__coerce__()`` or other numerical operators. It is\nrecommended that both mappings and sequences implement the\n``__contains__()`` method to allow efficient use of the ``in``\noperator; for mappings, ``in`` should be equivalent of ``has_key()``;\nfor sequences, it should search through the values. It is further\nrecommended that both mappings and sequences implement the\n``__iter__()`` method to allow efficient iteration through the\ncontainer; for mappings, ``__iter__()`` should be the same as\n``iterkeys()``; for sequences, it should iterate through the values.\n\nobject.__len__(self)\n\n Called to implement the built-in function ``len()``. Should return\n the length of the object, an integer ``>=`` 0. Also, an object\n that doesn't define a ``__nonzero__()`` method and whose\n ``__len__()`` method returns zero is considered to be false in a\n Boolean context.\n\nobject.__getitem__(self, key)\n\n Called to implement evaluation of ``self[key]``. For sequence\n types, the accepted keys should be integers and slice objects.\n Note that the special interpretation of negative indexes (if the\n class wishes to emulate a sequence type) is up to the\n ``__getitem__()`` method. If *key* is of an inappropriate type,\n ``TypeError`` may be raised; if of a value outside the set of\n indexes for the sequence (after any special interpretation of\n negative values), ``IndexError`` should be raised. For mapping\n types, if *key* is missing (not in the container), ``KeyError``\n should be raised.\n\n Note: ``for`` loops expect that an ``IndexError`` will be raised for\n illegal indexes to allow proper detection of the end of the\n sequence.\n\nobject.__setitem__(self, key, value)\n\n Called to implement assignment to ``self[key]``. Same note as for\n ``__getitem__()``. This should only be implemented for mappings if\n the objects support changes to the values for keys, or if new keys\n can be added, or for sequences if elements can be replaced. The\n same exceptions should be raised for improper *key* values as for\n the ``__getitem__()`` method.\n\nobject.__delitem__(self, key)\n\n Called to implement deletion of ``self[key]``. Same note as for\n ``__getitem__()``. This should only be implemented for mappings if\n the objects support removal of keys, or for sequences if elements\n can be removed from the sequence. The same exceptions should be\n raised for improper *key* values as for the ``__getitem__()``\n method.\n\nobject.__iter__(self)\n\n This method is called when an iterator is required for a container.\n This method should return a new iterator object that can iterate\n over all the objects in the container. For mappings, it should\n iterate over the keys of the container, and should also be made\n available as the method ``iterkeys()``.\n\n Iterator objects also need to implement this method; they are\n required to return themselves. For more information on iterator\n objects, see *Iterator Types*.\n\nobject.__reversed__(self)\n\n Called (if present) by the ``reversed()`` builtin to implement\n reverse iteration. It should return a new iterator object that\n iterates over all the objects in the container in reverse order.\n\n If the ``__reversed__()`` method is not provided, the\n ``reversed()`` builtin will fall back to using the sequence\n protocol (``__len__()`` and ``__getitem__()``). Objects should\n normally only provide ``__reversed__()`` if they do not support the\n sequence protocol and an efficient implementation of reverse\n iteration is possible.\n\n Added in version 2.6.\n\nThe membership test operators (``in`` and ``not in``) are normally\nimplemented as an iteration through a sequence. However, container\nobjects can supply the following special method with a more efficient\nimplementation, which also does not require the object be a sequence.\n\nobject.__contains__(self, item)\n\n Called to implement membership test operators. Should return true\n if *item* is in *self*, false otherwise. For mapping objects, this\n should consider the keys of the mapping rather than the values or\n the key-item pairs.\n", + 'sequence-methods': u'\nAdditional methods for emulation of sequence types\n**************************************************\n\nThe following optional methods can be defined to further emulate\nsequence objects. Immutable sequences methods should at most only\ndefine ``__getslice__()``; mutable sequences might define all three\nmethods.\n\nobject.__getslice__(self, i, j)\n\n Deprecated since version 2.0: Support slice objects as parameters\n to the ``__getitem__()`` method. (However, built-in types in\n CPython currently still implement ``__getslice__()``. Therefore,\n you have to override it in derived classes when implementing\n slicing.)\n\n Called to implement evaluation of ``self[i:j]``. The returned\n object should be of the same type as *self*. Note that missing *i*\n or *j* in the slice expression are replaced by zero or\n ``sys.maxint``, respectively. If negative indexes are used in the\n slice, the length of the sequence is added to that index. If the\n instance does not implement the ``__len__()`` method, an\n ``AttributeError`` is raised. No guarantee is made that indexes\n adjusted this way are not still negative. Indexes which are\n greater than the length of the sequence are not modified. If no\n ``__getslice__()`` is found, a slice object is created instead, and\n passed to ``__getitem__()`` instead.\n\nobject.__setslice__(self, i, j, sequence)\n\n Called to implement assignment to ``self[i:j]``. Same notes for *i*\n and *j* as for ``__getslice__()``.\n\n This method is deprecated. If no ``__setslice__()`` is found, or\n for extended slicing of the form ``self[i:j:k]``, a slice object is\n created, and passed to ``__setitem__()``, instead of\n ``__setslice__()`` being called.\n\nobject.__delslice__(self, i, j)\n\n Called to implement deletion of ``self[i:j]``. Same notes for *i*\n and *j* as for ``__getslice__()``. This method is deprecated. If no\n ``__delslice__()`` is found, or for extended slicing of the form\n ``self[i:j:k]``, a slice object is created, and passed to\n ``__delitem__()``, instead of ``__delslice__()`` being called.\n\nNotice that these methods are only invoked when a single slice with a\nsingle colon is used, and the slice method is available. For slice\noperations involving extended slice notation, or in absence of the\nslice methods, ``__getitem__()``, ``__setitem__()`` or\n``__delitem__()`` is called with a slice object as argument.\n\nThe following example demonstrate how to make your program or module\ncompatible with earlier versions of Python (assuming that methods\n``__getitem__()``, ``__setitem__()`` and ``__delitem__()`` support\nslice objects as arguments):\n\n class MyClass:\n ...\n def __getitem__(self, index):\n ...\n def __setitem__(self, index, value):\n ...\n def __delitem__(self, index):\n ...\n\n if sys.version_info < (2, 0):\n # They won\'t be defined if version is at least 2.0 final\n\n def __getslice__(self, i, j):\n return self[max(0, i):max(0, j):]\n def __setslice__(self, i, j, seq):\n self[max(0, i):max(0, j):] = seq\n def __delslice__(self, i, j):\n del self[max(0, i):max(0, j):]\n ...\n\nNote the calls to ``max()``; these are necessary because of the\nhandling of negative indices before the ``__*slice__()`` methods are\ncalled. When negative indexes are used, the ``__*item__()`` methods\nreceive them as provided, but the ``__*slice__()`` methods get a\n"cooked" form of the index values. For each negative index value, the\nlength of the sequence is added to the index before calling the method\n(which may still result in a negative index); this is the customary\nhandling of negative indexes by the built-in sequence types, and the\n``__*item__()`` methods are expected to do this as well. However,\nsince they should already be doing that, negative indexes cannot be\npassed in; they must be constrained to the bounds of the sequence\nbefore being passed to the ``__*item__()`` methods. Calling ``max(0,\ni)`` conveniently returns the proper value.\n', + 'sequence-types': u"\nEmulating container types\n*************************\n\nThe following methods can be defined to implement container objects.\nContainers usually are sequences (such as lists or tuples) or mappings\n(like dictionaries), but can represent other containers as well. The\nfirst set of methods is used either to emulate a sequence or to\nemulate a mapping; the difference is that for a sequence, the\nallowable keys should be the integers *k* for which ``0 <= k < N``\nwhere *N* is the length of the sequence, or slice objects, which\ndefine a range of items. (For backwards compatibility, the method\n``__getslice__()`` (see below) can also be defined to handle simple,\nbut not extended slices.) It is also recommended that mappings provide\nthe methods ``keys()``, ``values()``, ``items()``, ``has_key()``,\n``get()``, ``clear()``, ``setdefault()``, ``iterkeys()``,\n``itervalues()``, ``iteritems()``, ``pop()``, ``popitem()``,\n``copy()``, and ``update()`` behaving similar to those for Python's\nstandard dictionary objects. The ``UserDict`` module provides a\n``DictMixin`` class to help create those methods from a base set of\n``__getitem__()``, ``__setitem__()``, ``__delitem__()``, and\n``keys()``. Mutable sequences should provide methods ``append()``,\n``count()``, ``index()``, ``extend()``, ``insert()``, ``pop()``,\n``remove()``, ``reverse()`` and ``sort()``, like Python standard list\nobjects. Finally, sequence types should implement addition (meaning\nconcatenation) and multiplication (meaning repetition) by defining the\nmethods ``__add__()``, ``__radd__()``, ``__iadd__()``, ``__mul__()``,\n``__rmul__()`` and ``__imul__()`` described below; they should not\ndefine ``__coerce__()`` or other numerical operators. It is\nrecommended that both mappings and sequences implement the\n``__contains__()`` method to allow efficient use of the ``in``\noperator; for mappings, ``in`` should be equivalent of ``has_key()``;\nfor sequences, it should search through the values. It is further\nrecommended that both mappings and sequences implement the\n``__iter__()`` method to allow efficient iteration through the\ncontainer; for mappings, ``__iter__()`` should be the same as\n``iterkeys()``; for sequences, it should iterate through the values.\n\nobject.__len__(self)\n\n Called to implement the built-in function ``len()``. Should return\n the length of the object, an integer ``>=`` 0. Also, an object\n that doesn't define a ``__nonzero__()`` method and whose\n ``__len__()`` method returns zero is considered to be false in a\n Boolean context.\n\nobject.__getitem__(self, key)\n\n Called to implement evaluation of ``self[key]``. For sequence\n types, the accepted keys should be integers and slice objects.\n Note that the special interpretation of negative indexes (if the\n class wishes to emulate a sequence type) is up to the\n ``__getitem__()`` method. If *key* is of an inappropriate type,\n ``TypeError`` may be raised; if of a value outside the set of\n indexes for the sequence (after any special interpretation of\n negative values), ``IndexError`` should be raised. For mapping\n types, if *key* is missing (not in the container), ``KeyError``\n should be raised.\n\n Note: ``for`` loops expect that an ``IndexError`` will be raised for\n illegal indexes to allow proper detection of the end of the\n sequence.\n\nobject.__setitem__(self, key, value)\n\n Called to implement assignment to ``self[key]``. Same note as for\n ``__getitem__()``. This should only be implemented for mappings if\n the objects support changes to the values for keys, or if new keys\n can be added, or for sequences if elements can be replaced. The\n same exceptions should be raised for improper *key* values as for\n the ``__getitem__()`` method.\n\nobject.__delitem__(self, key)\n\n Called to implement deletion of ``self[key]``. Same note as for\n ``__getitem__()``. This should only be implemented for mappings if\n the objects support removal of keys, or for sequences if elements\n can be removed from the sequence. The same exceptions should be\n raised for improper *key* values as for the ``__getitem__()``\n method.\n\nobject.__iter__(self)\n\n This method is called when an iterator is required for a container.\n This method should return a new iterator object that can iterate\n over all the objects in the container. For mappings, it should\n iterate over the keys of the container, and should also be made\n available as the method ``iterkeys()``.\n\n Iterator objects also need to implement this method; they are\n required to return themselves. For more information on iterator\n objects, see *Iterator Types*.\n\nobject.__reversed__(self)\n\n Called (if present) by the ``reversed()`` builtin to implement\n reverse iteration. It should return a new iterator object that\n iterates over all the objects in the container in reverse order.\n\n If the ``__reversed__()`` method is not provided, the\n ``reversed()`` builtin will fall back to using the sequence\n protocol (``__len__()`` and ``__getitem__()``). Objects should\n normally only provide ``__reversed__()`` if they do not support the\n sequence protocol and an efficient implementation of reverse\n iteration is possible.\n\n New in version 2.6.\n\nThe membership test operators (``in`` and ``not in``) are normally\nimplemented as an iteration through a sequence. However, container\nobjects can supply the following special method with a more efficient\nimplementation, which also does not require the object be a sequence.\n\nobject.__contains__(self, item)\n\n Called to implement membership test operators. Should return true\n if *item* is in *self*, false otherwise. For mapping objects, this\n should consider the keys of the mapping rather than the values or\n the key-item pairs.\n", 'shifting': u'\nShifting operations\n*******************\n\nThe shifting operations have lower priority than the arithmetic\noperations:\n\n shift_expr ::= a_expr | shift_expr ( "<<" | ">>" ) a_expr\n\nThese operators accept plain or long integers as arguments. The\narguments are converted to a common type. They shift the first\nargument to the left or right by the number of bits given by the\nsecond argument.\n\nA right shift by *n* bits is defined as division by ``pow(2, n)``. A\nleft shift by *n* bits is defined as multiplication with ``pow(2,\nn)``. Negative shift counts raise a ``ValueError`` exception.\n', 'slicings': u'\nSlicings\n********\n\nA slicing selects a range of items in a sequence object (e.g., a\nstring, tuple or list). Slicings may be used as expressions or as\ntargets in assignment or ``del`` statements. The syntax for a\nslicing:\n\n slicing ::= simple_slicing | extended_slicing\n simple_slicing ::= primary "[" short_slice "]"\n extended_slicing ::= primary "[" slice_list "]"\n slice_list ::= slice_item ("," slice_item)* [","]\n slice_item ::= expression | proper_slice | ellipsis\n proper_slice ::= short_slice | long_slice\n short_slice ::= [lower_bound] ":" [upper_bound]\n long_slice ::= short_slice ":" [stride]\n lower_bound ::= expression\n upper_bound ::= expression\n stride ::= expression\n ellipsis ::= "..."\n\nThere is ambiguity in the formal syntax here: anything that looks like\nan expression list also looks like a slice list, so any subscription\ncan be interpreted as a slicing. Rather than further complicating the\nsyntax, this is disambiguated by defining that in this case the\ninterpretation as a subscription takes priority over the\ninterpretation as a slicing (this is the case if the slice list\ncontains no proper slice nor ellipses). Similarly, when the slice\nlist has exactly one short slice and no trailing comma, the\ninterpretation as a simple slicing takes priority over that as an\nextended slicing.\n\nThe semantics for a simple slicing are as follows. The primary must\nevaluate to a sequence object. The lower and upper bound expressions,\nif present, must evaluate to plain integers; defaults are zero and the\n``sys.maxint``, respectively. If either bound is negative, the\nsequence\'s length is added to it. The slicing now selects all items\nwith index *k* such that ``i <= k < j`` where *i* and *j* are the\nspecified lower and upper bounds. This may be an empty sequence. It\nis not an error if *i* or *j* lie outside the range of valid indexes\n(such items don\'t exist so they aren\'t selected).\n\nThe semantics for an extended slicing are as follows. The primary\nmust evaluate to a mapping object, and it is indexed with a key that\nis constructed from the slice list, as follows. If the slice list\ncontains at least one comma, the key is a tuple containing the\nconversion of the slice items; otherwise, the conversion of the lone\nslice item is the key. The conversion of a slice item that is an\nexpression is that expression. The conversion of an ellipsis slice\nitem is the built-in ``Ellipsis`` object. The conversion of a proper\nslice is a slice object (see section *The standard type hierarchy*)\nwhose ``start``, ``stop`` and ``step`` attributes are the values of\nthe expressions given as lower bound, upper bound and stride,\nrespectively, substituting ``None`` for missing expressions.\n', - 'specialattrs': u"\nSpecial Attributes\n******************\n\nThe implementation adds a few special read-only attributes to several\nobject types, where they are relevant. Some of these are not reported\nby the ``dir()`` built-in function.\n\nobject.__dict__\n\n A dictionary or other mapping object used to store an object's\n (writable) attributes.\n\nobject.__methods__\n\n Deprecated in version 2.2: Use the built-in function ``dir()`` to\n get a list of an object's attributes. This attribute is no longer\n available.\n\nobject.__members__\n\n Deprecated in version 2.2: Use the built-in function ``dir()`` to\n get a list of an object's attributes. This attribute is no longer\n available.\n\ninstance.__class__\n\n The class to which a class instance belongs.\n\nclass.__bases__\n\n The tuple of base classes of a class object. If there are no base\n classes, this will be an empty tuple.\n\nclass.__name__\n\n The name of the class or type.\n\n-[ Footnotes ]-\n\n[1] Additional information on these special methods may be found in\n the Python Reference Manual (*Basic customization*).\n\n[2] As a consequence, the list ``[1, 2]`` is considered equal to\n ``[1.0, 2.0]``, and similarly for tuples.\n\n[3] They must have since the parser can't tell the type of the\n operands.\n\n[4] To format only a tuple you should therefore provide a singleton\n tuple whose only element is the tuple to be formatted.\n\n[5] These numbers are fairly arbitrary. They are intended to avoid\n printing endless strings of meaningless digits without hampering\n correct use and without having to know the exact precision of\n floating point values on a particular machine.\n\n[6] The advantage of leaving the newline on is that returning an empty\n string is then an unambiguous EOF indication. It is also possible\n (in cases where it might matter, for example, if you want to make\n an exact copy of a file while scanning its lines) to tell whether\n the last line of a file ended in a newline or not (yes this\n happens!).\n", - 'specialnames': u'\nSpecial method names\n********************\n\nA class can implement certain operations that are invoked by special\nsyntax (such as arithmetic operations or subscripting and slicing) by\ndefining methods with special names. This is Python\'s approach to\n*operator overloading*, allowing classes to define their own behavior\nwith respect to language operators. For instance, if a class defines\na method named ``__getitem__()``, and ``x`` is an instance of this\nclass, then ``x[i]`` is equivalent [2] to ``x.__getitem__(i)``.\nExcept where mentioned, attempts to execute an operation raise an\nexception when no appropriate method is defined.\n\nFor new-style classes, special methods are only guaranteed to work if\ndefined in an object\'s class, not in the object\'s instance dictionary.\nThat explains why this won\'t work:\n\n >>> class C:\n ... pass\n ...\n >>> c = C()\n >>> c.__len__ = lambda: 5\n >>> len(c)\n Traceback (most recent call last):\n File "", line 1, in \n TypeError: object of type \'C\' has no len()\n\nWhen implementing a class that emulates any built-in type, it is\nimportant that the emulation only be implemented to the degree that it\nmakes sense for the object being modelled. For example, some\nsequences may work well with retrieval of individual elements, but\nextracting a slice may not make sense. (One example of this is the\n``NodeList`` interface in the W3C\'s Document Object Model.)\n\n\nBasic customization\n===================\n\nobject.__new__(cls[, ...])\n\n Called to create a new instance of class *cls*. ``__new__()`` is a\n static method (special-cased so you need not declare it as such)\n that takes the class of which an instance was requested as its\n first argument. The remaining arguments are those passed to the\n object constructor expression (the call to the class). The return\n value of ``__new__()`` should be the new object instance (usually\n an instance of *cls*).\n\n Typical implementations create a new instance of the class by\n invoking the superclass\'s ``__new__()`` method using\n ``super(currentclass, cls).__new__(cls[, ...])`` with appropriate\n arguments and then modifying the newly-created instance as\n necessary before returning it.\n\n If ``__new__()`` returns an instance of *cls*, then the new\n instance\'s ``__init__()`` method will be invoked like\n ``__init__(self[, ...])``, where *self* is the new instance and the\n remaining arguments are the same as were passed to ``__new__()``.\n\n If ``__new__()`` does not return an instance of *cls*, then the new\n instance\'s ``__init__()`` method will not be invoked.\n\n ``__new__()`` is intended mainly to allow subclasses of immutable\n types (like int, str, or tuple) to customize instance creation. It\n is also commonly overridden in custom metaclasses in order to\n customize class creation.\n\nobject.__init__(self[, ...])\n\n Called when the instance is created. The arguments are those\n passed to the class constructor expression. If a base class has an\n ``__init__()`` method, the derived class\'s ``__init__()`` method,\n if any, must explicitly call it to ensure proper initialization of\n the base class part of the instance; for example:\n ``BaseClass.__init__(self, [args...])``. As a special constraint\n on constructors, no value may be returned; doing so will cause a\n ``TypeError`` to be raised at runtime.\n\nobject.__del__(self)\n\n Called when the instance is about to be destroyed. This is also\n called a destructor. If a base class has a ``__del__()`` method,\n the derived class\'s ``__del__()`` method, if any, must explicitly\n call it to ensure proper deletion of the base class part of the\n instance. Note that it is possible (though not recommended!) for\n the ``__del__()`` method to postpone destruction of the instance by\n creating a new reference to it. It may then be called at a later\n time when this new reference is deleted. It is not guaranteed that\n ``__del__()`` methods are called for objects that still exist when\n the interpreter exits.\n\n Note: ``del x`` doesn\'t directly call ``x.__del__()`` --- the former\n decrements the reference count for ``x`` by one, and the latter\n is only called when ``x``\'s reference count reaches zero. Some\n common situations that may prevent the reference count of an\n object from going to zero include: circular references between\n objects (e.g., a doubly-linked list or a tree data structure with\n parent and child pointers); a reference to the object on the\n stack frame of a function that caught an exception (the traceback\n stored in ``sys.exc_traceback`` keeps the stack frame alive); or\n a reference to the object on the stack frame that raised an\n unhandled exception in interactive mode (the traceback stored in\n ``sys.last_traceback`` keeps the stack frame alive). The first\n situation can only be remedied by explicitly breaking the cycles;\n the latter two situations can be resolved by storing ``None`` in\n ``sys.exc_traceback`` or ``sys.last_traceback``. Circular\n references which are garbage are detected when the option cycle\n detector is enabled (it\'s on by default), but can only be cleaned\n up if there are no Python-level ``__del__()`` methods involved.\n Refer to the documentation for the ``gc`` module for more\n information about how ``__del__()`` methods are handled by the\n cycle detector, particularly the description of the ``garbage``\n value.\n\n Warning: Due to the precarious circumstances under which ``__del__()``\n methods are invoked, exceptions that occur during their execution\n are ignored, and a warning is printed to ``sys.stderr`` instead.\n Also, when ``__del__()`` is invoked in response to a module being\n deleted (e.g., when execution of the program is done), other\n globals referenced by the ``__del__()`` method may already have\n been deleted. For this reason, ``__del__()`` methods should do\n the absolute minimum needed to maintain external invariants.\n Starting with version 1.5, Python guarantees that globals whose\n name begins with a single underscore are deleted from their\n module before other globals are deleted; if no other references\n to such globals exist, this may help in assuring that imported\n modules are still available at the time when the ``__del__()``\n method is called.\n\nobject.__repr__(self)\n\n Called by the ``repr()`` built-in function and by string\n conversions (reverse quotes) to compute the "official" string\n representation of an object. If at all possible, this should look\n like a valid Python expression that could be used to recreate an\n object with the same value (given an appropriate environment). If\n this is not possible, a string of the form ``<...some useful\n description...>`` should be returned. The return value must be a\n string object. If a class defines ``__repr__()`` but not\n ``__str__()``, then ``__repr__()`` is also used when an "informal"\n string representation of instances of that class is required.\n\n This is typically used for debugging, so it is important that the\n representation is information-rich and unambiguous.\n\nobject.__str__(self)\n\n Called by the ``str()`` built-in function and by the ``print``\n statement to compute the "informal" string representation of an\n object. This differs from ``__repr__()`` in that it does not have\n to be a valid Python expression: a more convenient or concise\n representation may be used instead. The return value must be a\n string object.\n\nobject.__lt__(self, other)\nobject.__le__(self, other)\nobject.__eq__(self, other)\nobject.__ne__(self, other)\nobject.__gt__(self, other)\nobject.__ge__(self, other)\n\n Added in version 2.1.\n\n These are the so-called "rich comparison" methods, and are called\n for comparison operators in preference to ``__cmp__()`` below. The\n correspondence between operator symbols and method names is as\n follows: ``xy`` call ``x.__ne__(y)``, ``x>y`` calls ``x.__gt__(y)``, and\n ``x>=y`` calls ``x.__ge__(y)``.\n\n A rich comparison method may return the singleton\n ``NotImplemented`` if it does not implement the operation for a\n given pair of arguments. By convention, ``False`` and ``True`` are\n returned for a successful comparison. However, these methods can\n return any value, so if the comparison operator is used in a\n Boolean context (e.g., in the condition of an ``if`` statement),\n Python will call ``bool()`` on the value to determine if the result\n is true or false.\n\n There are no implied relationships among the comparison operators.\n The truth of ``x==y`` does not imply that ``x!=y`` is false.\n Accordingly, when defining ``__eq__()``, one should also define\n ``__ne__()`` so that the operators will behave as expected. See\n the paragraph on ``__hash__()`` for some important notes on\n creating *hashable* objects which support custom comparison\n operations and are usable as dictionary keys.\n\n There are no swapped-argument versions of these methods (to be used\n when the left argument does not support the operation but the right\n argument does); rather, ``__lt__()`` and ``__gt__()`` are each\n other\'s reflection, ``__le__()`` and ``__ge__()`` are each other\'s\n reflection, and ``__eq__()`` and ``__ne__()`` are their own\n reflection.\n\n Arguments to rich comparison methods are never coerced.\n\nobject.__cmp__(self, other)\n\n Called by comparison operations if rich comparison (see above) is\n not defined. Should return a negative integer if ``self < other``,\n zero if ``self == other``, a positive integer if ``self > other``.\n If no ``__cmp__()``, ``__eq__()`` or ``__ne__()`` operation is\n defined, class instances are compared by object identity\n ("address"). See also the description of ``__hash__()`` for some\n important notes on creating *hashable* objects which support custom\n comparison operations and are usable as dictionary keys. (Note: the\n restriction that exceptions are not propagated by ``__cmp__()`` has\n been removed since Python 1.5.)\n\nobject.__rcmp__(self, other)\n\n Changed in version 2.1: No longer supported.\n\nobject.__hash__(self)\n\n Called for the key object for dictionary operations, and by the\n built-in function ``hash()``. Should return an integer usable as a\n hash value for dictionary operations. The only required property\n is that objects which compare equal have the same hash value; it is\n advised to somehow mix together (e.g., using exclusive or) the hash\n values for the components of the object that also play a part in\n comparison of objects.\n\n If a class does not define a ``__cmp__()`` or ``__eq__()`` method\n it should not define a ``__hash__()`` operation either; if it\n defines ``__cmp__()`` or ``__eq__()`` but not ``__hash__()``, its\n instances will not be usable as dictionary keys. If a class\n defines mutable objects and implements a ``__cmp__()`` or\n ``__eq__()`` method, it should not implement ``__hash__()``, since\n the dictionary implementation requires that a key\'s hash value is\n immutable (if the object\'s hash value changes, it will be in the\n wrong hash bucket).\n\n User-defined classes have ``__cmp__()`` and ``__hash__()`` methods\n by default; with them, all objects compare unequal and\n ``x.__hash__()`` returns ``id(x)``.\n\n Changed in version 2.5: ``__hash__()`` may now also return a long\n integer object; the 32-bit integer is then derived from the hash of\n that object.\n\nobject.__nonzero__(self)\n\n Called to implement truth value testing, and the built-in operation\n ``bool()``; should return ``False`` or ``True``, or their integer\n equivalents ``0`` or ``1``. When this method is not defined,\n ``__len__()`` is called, if it is defined (see below). If a class\n defines neither ``__len__()`` nor ``__nonzero__()``, all its\n instances are considered true.\n\nobject.__unicode__(self)\n\n Called to implement ``unicode()`` builtin; should return a Unicode\n object. When this method is not defined, string conversion is\n attempted, and the result of string conversion is converted to\n Unicode using the system default encoding.\n\n\nCustomizing attribute access\n============================\n\nThe following methods can be defined to customize the meaning of\nattribute access (use of, assignment to, or deletion of ``x.name``)\nfor class instances.\n\nobject.__getattr__(self, name)\n\n Called when an attribute lookup has not found the attribute in the\n usual places (i.e. it is not an instance attribute nor is it found\n in the class tree for ``self``). ``name`` is the attribute name.\n This method should return the (computed) attribute value or raise\n an ``AttributeError`` exception.\n\n Note that if the attribute is found through the normal mechanism,\n ``__getattr__()`` is not called. (This is an intentional asymmetry\n between ``__getattr__()`` and ``__setattr__()``.) This is done both\n for efficiency reasons and because otherwise ``__setattr__()``\n would have no way to access other attributes of the instance. Note\n that at least for instance variables, you can fake total control by\n not inserting any values in the instance attribute dictionary (but\n instead inserting them in another object). See the\n ``__getattribute__()`` method below for a way to actually get total\n control in new-style classes.\n\nobject.__setattr__(self, name, value)\n\n Called when an attribute assignment is attempted. This is called\n instead of the normal mechanism (i.e. store the value in the\n instance dictionary). *name* is the attribute name, *value* is the\n value to be assigned to it.\n\n If ``__setattr__()`` wants to assign to an instance attribute, it\n should not simply execute ``self.name = value`` --- this would\n cause a recursive call to itself. Instead, it should insert the\n value in the dictionary of instance attributes, e.g.,\n ``self.__dict__[name] = value``. For new-style classes, rather\n than accessing the instance dictionary, it should call the base\n class method with the same name, for example,\n ``object.__setattr__(self, name, value)``.\n\nobject.__delattr__(self, name)\n\n Like ``__setattr__()`` but for attribute deletion instead of\n assignment. This should only be implemented if ``del obj.name`` is\n meaningful for the object.\n\n\nMore attribute access for new-style classes\n-------------------------------------------\n\nThe following methods only apply to new-style classes.\n\nobject.__getattribute__(self, name)\n\n Called unconditionally to implement attribute accesses for\n instances of the class. If the class also defines\n ``__getattr__()``, the latter will not be called unless\n ``__getattribute__()`` either calls it explicitly or raises an\n ``AttributeError``. This method should return the (computed)\n attribute value or raise an ``AttributeError`` exception. In order\n to avoid infinite recursion in this method, its implementation\n should always call the base class method with the same name to\n access any attributes it needs, for example,\n ``object.__getattribute__(self, name)``.\n\n\nImplementing Descriptors\n------------------------\n\nThe following methods only apply when an instance of the class\ncontaining the method (a so-called *descriptor* class) appears in the\nclass dictionary of another new-style class, known as the *owner*\nclass. In the examples below, "the attribute" refers to the attribute\nwhose name is the key of the property in the owner class\'\n``__dict__``. Descriptors can only be implemented as new-style\nclasses themselves.\n\nobject.__get__(self, instance, owner)\n\n Called to get the attribute of the owner class (class attribute\n access) or of an instance of that class (instance attribute\n access). *owner* is always the owner class, while *instance* is the\n instance that the attribute was accessed through, or ``None`` when\n the attribute is accessed through the *owner*. This method should\n return the (computed) attribute value or raise an\n ``AttributeError`` exception.\n\nobject.__set__(self, instance, value)\n\n Called to set the attribute on an instance *instance* of the owner\n class to a new value, *value*.\n\nobject.__delete__(self, instance)\n\n Called to delete the attribute on an instance *instance* of the\n owner class.\n\n\nInvoking Descriptors\n--------------------\n\nIn general, a descriptor is an object attribute with "binding\nbehavior", one whose attribute access has been overridden by methods\nin the descriptor protocol: ``__get__()``, ``__set__()``, and\n``__delete__()``. If any of those methods are defined for an object,\nit is said to be a descriptor.\n\nThe default behavior for attribute access is to get, set, or delete\nthe attribute from an object\'s dictionary. For instance, ``a.x`` has a\nlookup chain starting with ``a.__dict__[\'x\']``, then\n``type(a).__dict__[\'x\']``, and continuing through the base classes of\n``type(a)`` excluding metaclasses.\n\nHowever, if the looked-up value is an object defining one of the\ndescriptor methods, then Python may override the default behavior and\ninvoke the descriptor method instead. Where this occurs in the\nprecedence chain depends on which descriptor methods were defined and\nhow they were called. Note that descriptors are only invoked for new\nstyle objects or classes (ones that subclass ``object()`` or\n``type()``).\n\nThe starting point for descriptor invocation is a binding, ``a.x``.\nHow the arguments are assembled depends on ``a``:\n\nDirect Call\n The simplest and least common call is when user code directly\n invokes a descriptor method: ``x.__get__(a)``.\n\nInstance Binding\n If binding to a new-style object instance, ``a.x`` is transformed\n into the call: ``type(a).__dict__[\'x\'].__get__(a, type(a))``.\n\nClass Binding\n If binding to a new-style class, ``A.x`` is transformed into the\n call: ``A.__dict__[\'x\'].__get__(None, A)``.\n\nSuper Binding\n If ``a`` is an instance of ``super``, then the binding ``super(B,\n obj).m()`` searches ``obj.__class__.__mro__`` for the base class\n ``A`` immediately preceding ``B`` and then invokes the descriptor\n with the call: ``A.__dict__[\'m\'].__get__(obj, A)``.\n\nFor instance bindings, the precedence of descriptor invocation depends\non the which descriptor methods are defined. Normally, data\ndescriptors define both ``__get__()`` and ``__set__()``, while non-\ndata descriptors have just the ``__get__()`` method. Data descriptors\nalways override a redefinition in an instance dictionary. In\ncontrast, non-data descriptors can be overridden by instances. [3]\n\nPython methods (including ``staticmethod()`` and ``classmethod()``)\nare implemented as non-data descriptors. Accordingly, instances can\nredefine and override methods. This allows individual instances to\nacquire behaviors that differ from other instances of the same class.\n\nThe ``property()`` function is implemented as a data descriptor.\nAccordingly, instances cannot override the behavior of a property.\n\n\n__slots__\n---------\n\nBy default, instances of both old and new-style classes have a\ndictionary for attribute storage. This wastes space for objects\nhaving very few instance variables. The space consumption can become\nacute when creating large numbers of instances.\n\nThe default can be overridden by defining *__slots__* in a new-style\nclass definition. The *__slots__* declaration takes a sequence of\ninstance variables and reserves just enough space in each instance to\nhold a value for each variable. Space is saved because *__dict__* is\nnot created for each instance.\n\n__slots__\n\n This class variable can be assigned a string, iterable, or sequence\n of strings with variable names used by instances. If defined in a\n new-style class, *__slots__* reserves space for the declared\n variables and prevents the automatic creation of *__dict__* and\n *__weakref__* for each instance.\n\n Added in version 2.2.\n\nNotes on using *__slots__*\n\n* Without a *__dict__* variable, instances cannot be assigned new\n variables not listed in the *__slots__* definition. Attempts to\n assign to an unlisted variable name raises ``AttributeError``. If\n dynamic assignment of new variables is desired, then add\n ``\'__dict__\'`` to the sequence of strings in the *__slots__*\n declaration.\n\n Changed in version 2.3: Previously, adding ``\'__dict__\'`` to the\n *__slots__* declaration would not enable the assignment of new\n attributes not specifically listed in the sequence of instance\n variable names.\n\n* Without a *__weakref__* variable for each instance, classes defining\n *__slots__* do not support weak references to its instances. If weak\n reference support is needed, then add ``\'__weakref__\'`` to the\n sequence of strings in the *__slots__* declaration.\n\n Changed in version 2.3: Previously, adding ``\'__weakref__\'`` to the\n *__slots__* declaration would not enable support for weak\n references.\n\n* *__slots__* are implemented at the class level by creating\n descriptors (*Implementing Descriptors*) for each variable name. As\n a result, class attributes cannot be used to set default values for\n instance variables defined by *__slots__*; otherwise, the class\n attribute would overwrite the descriptor assignment.\n\n* If a class defines a slot also defined in a base class, the instance\n variable defined by the base class slot is inaccessible (except by\n retrieving its descriptor directly from the base class). This\n renders the meaning of the program undefined. In the future, a\n check may be added to prevent this.\n\n* The action of a *__slots__* declaration is limited to the class\n where it is defined. As a result, subclasses will have a *__dict__*\n unless they also define *__slots__*.\n\n* *__slots__* do not work for classes derived from "variable-length"\n built-in types such as ``long``, ``str`` and ``tuple``.\n\n* Any non-string iterable may be assigned to *__slots__*. Mappings may\n also be used; however, in the future, special meaning may be\n assigned to the values corresponding to each key.\n\n* *__class__* assignment works only if both classes have the same\n *__slots__*.\n\n Changed in version 2.6: Previously, *__class__* assignment raised an\n error if either new or old class had *__slots__*.\n\n\nCustomizing class creation\n==========================\n\nBy default, new-style classes are constructed using ``type()``. A\nclass definition is read into a separate namespace and the value of\nclass name is bound to the result of ``type(name, bases, dict)``.\n\nWhen the class definition is read, if *__metaclass__* is defined then\nthe callable assigned to it will be called instead of ``type()``. This\nallows classes or functions to be written which monitor or alter the\nclass creation process:\n\n* Modifying the class dictionary prior to the class being created.\n\n* Returning an instance of another class -- essentially performing the\n role of a factory function.\n\nThese steps will have to be performed in the metaclass\'s ``__new__()``\nmethod -- ``type.__new__()`` can then be called from this method to\ncreate a class with different properties. This example adds a new\nelement to the class dictionary before creating the class:\n\n class metacls(type):\n def __new__(mcs, name, bases, dict):\n dict[\'foo\'] = \'metacls was here\'\n return type.__new__(mcs, name, bases, dict)\n\nYou can of course also override other class methods (or add new\nmethods); for example defining a custom ``__call__()`` method in the\nmetaclass allows custom behavior when the class is called, e.g. not\nalways creating a new instance.\n\n__metaclass__\n\n This variable can be any callable accepting arguments for ``name``,\n ``bases``, and ``dict``. Upon class creation, the callable is used\n instead of the built-in ``type()``.\n\n Added in version 2.2.\n\nThe appropriate metaclass is determined by the following precedence\nrules:\n\n* If ``dict[\'__metaclass__\']`` exists, it is used.\n\n* Otherwise, if there is at least one base class, its metaclass is\n used (this looks for a *__class__* attribute first and if not found,\n uses its type).\n\n* Otherwise, if a global variable named __metaclass__ exists, it is\n used.\n\n* Otherwise, the old-style, classic metaclass (types.ClassType) is\n used.\n\nThe potential uses for metaclasses are boundless. Some ideas that have\nbeen explored including logging, interface checking, automatic\ndelegation, automatic property creation, proxies, frameworks, and\nautomatic resource locking/synchronization.\n\n\nEmulating callable objects\n==========================\n\nobject.__call__(self[, args...])\n\n Called when the instance is "called" as a function; if this method\n is defined, ``x(arg1, arg2, ...)`` is a shorthand for\n ``x.__call__(arg1, arg2, ...)``.\n\n\nEmulating container types\n=========================\n\nThe following methods can be defined to implement container objects.\nContainers usually are sequences (such as lists or tuples) or mappings\n(like dictionaries), but can represent other containers as well. The\nfirst set of methods is used either to emulate a sequence or to\nemulate a mapping; the difference is that for a sequence, the\nallowable keys should be the integers *k* for which ``0 <= k < N``\nwhere *N* is the length of the sequence, or slice objects, which\ndefine a range of items. (For backwards compatibility, the method\n``__getslice__()`` (see below) can also be defined to handle simple,\nbut not extended slices.) It is also recommended that mappings provide\nthe methods ``keys()``, ``values()``, ``items()``, ``has_key()``,\n``get()``, ``clear()``, ``setdefault()``, ``iterkeys()``,\n``itervalues()``, ``iteritems()``, ``pop()``, ``popitem()``,\n``copy()``, and ``update()`` behaving similar to those for Python\'s\nstandard dictionary objects. The ``UserDict`` module provides a\n``DictMixin`` class to help create those methods from a base set of\n``__getitem__()``, ``__setitem__()``, ``__delitem__()``, and\n``keys()``. Mutable sequences should provide methods ``append()``,\n``count()``, ``index()``, ``extend()``, ``insert()``, ``pop()``,\n``remove()``, ``reverse()`` and ``sort()``, like Python standard list\nobjects. Finally, sequence types should implement addition (meaning\nconcatenation) and multiplication (meaning repetition) by defining the\nmethods ``__add__()``, ``__radd__()``, ``__iadd__()``, ``__mul__()``,\n``__rmul__()`` and ``__imul__()`` described below; they should not\ndefine ``__coerce__()`` or other numerical operators. It is\nrecommended that both mappings and sequences implement the\n``__contains__()`` method to allow efficient use of the ``in``\noperator; for mappings, ``in`` should be equivalent of ``has_key()``;\nfor sequences, it should search through the values. It is further\nrecommended that both mappings and sequences implement the\n``__iter__()`` method to allow efficient iteration through the\ncontainer; for mappings, ``__iter__()`` should be the same as\n``iterkeys()``; for sequences, it should iterate through the values.\n\nobject.__len__(self)\n\n Called to implement the built-in function ``len()``. Should return\n the length of the object, an integer ``>=`` 0. Also, an object\n that doesn\'t define a ``__nonzero__()`` method and whose\n ``__len__()`` method returns zero is considered to be false in a\n Boolean context.\n\nobject.__getitem__(self, key)\n\n Called to implement evaluation of ``self[key]``. For sequence\n types, the accepted keys should be integers and slice objects.\n Note that the special interpretation of negative indexes (if the\n class wishes to emulate a sequence type) is up to the\n ``__getitem__()`` method. If *key* is of an inappropriate type,\n ``TypeError`` may be raised; if of a value outside the set of\n indexes for the sequence (after any special interpretation of\n negative values), ``IndexError`` should be raised. For mapping\n types, if *key* is missing (not in the container), ``KeyError``\n should be raised.\n\n Note: ``for`` loops expect that an ``IndexError`` will be raised for\n illegal indexes to allow proper detection of the end of the\n sequence.\n\nobject.__setitem__(self, key, value)\n\n Called to implement assignment to ``self[key]``. Same note as for\n ``__getitem__()``. This should only be implemented for mappings if\n the objects support changes to the values for keys, or if new keys\n can be added, or for sequences if elements can be replaced. The\n same exceptions should be raised for improper *key* values as for\n the ``__getitem__()`` method.\n\nobject.__delitem__(self, key)\n\n Called to implement deletion of ``self[key]``. Same note as for\n ``__getitem__()``. This should only be implemented for mappings if\n the objects support removal of keys, or for sequences if elements\n can be removed from the sequence. The same exceptions should be\n raised for improper *key* values as for the ``__getitem__()``\n method.\n\nobject.__iter__(self)\n\n This method is called when an iterator is required for a container.\n This method should return a new iterator object that can iterate\n over all the objects in the container. For mappings, it should\n iterate over the keys of the container, and should also be made\n available as the method ``iterkeys()``.\n\n Iterator objects also need to implement this method; they are\n required to return themselves. For more information on iterator\n objects, see *Iterator Types*.\n\nobject.__reversed__(self)\n\n Called (if present) by the ``reversed()`` builtin to implement\n reverse iteration. It should return a new iterator object that\n iterates over all the objects in the container in reverse order.\n\n If the ``__reversed__()`` method is not provided, the\n ``reversed()`` builtin will fall back to using the sequence\n protocol (``__len__()`` and ``__getitem__()``). Objects should\n normally only provide ``__reversed__()`` if they do not support the\n sequence protocol and an efficient implementation of reverse\n iteration is possible.\n\n Added in version 2.6.\n\nThe membership test operators (``in`` and ``not in``) are normally\nimplemented as an iteration through a sequence. However, container\nobjects can supply the following special method with a more efficient\nimplementation, which also does not require the object be a sequence.\n\nobject.__contains__(self, item)\n\n Called to implement membership test operators. Should return true\n if *item* is in *self*, false otherwise. For mapping objects, this\n should consider the keys of the mapping rather than the values or\n the key-item pairs.\n\n\nAdditional methods for emulation of sequence types\n==================================================\n\nThe following optional methods can be defined to further emulate\nsequence objects. Immutable sequences methods should at most only\ndefine ``__getslice__()``; mutable sequences might define all three\nmethods.\n\nobject.__getslice__(self, i, j)\n\n Deprecated in version 2.0: Support slice objects as parameters to\n the ``__getitem__()`` method. (However, built-in types in CPython\n currently still implement ``__getslice__()``. Therefore, you have\n to override it in derived classes when implementing slicing.)\n\n Called to implement evaluation of ``self[i:j]``. The returned\n object should be of the same type as *self*. Note that missing *i*\n or *j* in the slice expression are replaced by zero or\n ``sys.maxint``, respectively. If negative indexes are used in the\n slice, the length of the sequence is added to that index. If the\n instance does not implement the ``__len__()`` method, an\n ``AttributeError`` is raised. No guarantee is made that indexes\n adjusted this way are not still negative. Indexes which are\n greater than the length of the sequence are not modified. If no\n ``__getslice__()`` is found, a slice object is created instead, and\n passed to ``__getitem__()`` instead.\n\nobject.__setslice__(self, i, j, sequence)\n\n Called to implement assignment to ``self[i:j]``. Same notes for *i*\n and *j* as for ``__getslice__()``.\n\n This method is deprecated. If no ``__setslice__()`` is found, or\n for extended slicing of the form ``self[i:j:k]``, a slice object is\n created, and passed to ``__setitem__()``, instead of\n ``__setslice__()`` being called.\n\nobject.__delslice__(self, i, j)\n\n Called to implement deletion of ``self[i:j]``. Same notes for *i*\n and *j* as for ``__getslice__()``. This method is deprecated. If no\n ``__delslice__()`` is found, or for extended slicing of the form\n ``self[i:j:k]``, a slice object is created, and passed to\n ``__delitem__()``, instead of ``__delslice__()`` being called.\n\nNotice that these methods are only invoked when a single slice with a\nsingle colon is used, and the slice method is available. For slice\noperations involving extended slice notation, or in absence of the\nslice methods, ``__getitem__()``, ``__setitem__()`` or\n``__delitem__()`` is called with a slice object as argument.\n\nThe following example demonstrate how to make your program or module\ncompatible with earlier versions of Python (assuming that methods\n``__getitem__()``, ``__setitem__()`` and ``__delitem__()`` support\nslice objects as arguments):\n\n class MyClass:\n ...\n def __getitem__(self, index):\n ...\n def __setitem__(self, index, value):\n ...\n def __delitem__(self, index):\n ...\n\n if sys.version_info < (2, 0):\n # They won\'t be defined if version is at least 2.0 final\n\n def __getslice__(self, i, j):\n return self[max(0, i):max(0, j):]\n def __setslice__(self, i, j, seq):\n self[max(0, i):max(0, j):] = seq\n def __delslice__(self, i, j):\n del self[max(0, i):max(0, j):]\n ...\n\nNote the calls to ``max()``; these are necessary because of the\nhandling of negative indices before the ``__*slice__()`` methods are\ncalled. When negative indexes are used, the ``__*item__()`` methods\nreceive them as provided, but the ``__*slice__()`` methods get a\n"cooked" form of the index values. For each negative index value, the\nlength of the sequence is added to the index before calling the method\n(which may still result in a negative index); this is the customary\nhandling of negative indexes by the built-in sequence types, and the\n``__*item__()`` methods are expected to do this as well. However,\nsince they should already be doing that, negative indexes cannot be\npassed in; they must be constrained to the bounds of the sequence\nbefore being passed to the ``__*item__()`` methods. Calling ``max(0,\ni)`` conveniently returns the proper value.\n\n\nEmulating numeric types\n=======================\n\nThe following methods can be defined to emulate numeric objects.\nMethods corresponding to operations that are not supported by the\nparticular kind of number implemented (e.g., bitwise operations for\nnon-integral numbers) should be left undefined.\n\nobject.__add__(self, other)\nobject.__sub__(self, other)\nobject.__mul__(self, other)\nobject.__floordiv__(self, other)\nobject.__mod__(self, other)\nobject.__divmod__(self, other)\nobject.__pow__(self, other[, modulo])\nobject.__lshift__(self, other)\nobject.__rshift__(self, other)\nobject.__and__(self, other)\nobject.__xor__(self, other)\nobject.__or__(self, other)\n\n These methods are called to implement the binary arithmetic\n operations (``+``, ``-``, ``*``, ``//``, ``%``, ``divmod()``,\n ``pow()``, ``**``, ``<<``, ``>>``, ``&``, ``^``, ``|``). For\n instance, to evaluate the expression *x*``+``*y*, where *x* is an\n instance of a class that has an ``__add__()`` method,\n ``x.__add__(y)`` is called. The ``__divmod__()`` method should be\n the equivalent to using ``__floordiv__()`` and ``__mod__()``; it\n should not be related to ``__truediv__()`` (described below). Note\n that ``__pow__()`` should be defined to accept an optional third\n argument if the ternary version of the built-in ``pow()`` function\n is to be supported.\n\n If one of those methods does not support the operation with the\n supplied arguments, it should return ``NotImplemented``.\n\nobject.__div__(self, other)\nobject.__truediv__(self, other)\n\n The division operator (``/``) is implemented by these methods. The\n ``__truediv__()`` method is used when ``__future__.division`` is in\n effect, otherwise ``__div__()`` is used. If only one of these two\n methods is defined, the object will not support division in the\n alternate context; ``TypeError`` will be raised instead.\n\nobject.__radd__(self, other)\nobject.__rsub__(self, other)\nobject.__rmul__(self, other)\nobject.__rdiv__(self, other)\nobject.__rtruediv__(self, other)\nobject.__rfloordiv__(self, other)\nobject.__rmod__(self, other)\nobject.__rdivmod__(self, other)\nobject.__rpow__(self, other)\nobject.__rlshift__(self, other)\nobject.__rrshift__(self, other)\nobject.__rand__(self, other)\nobject.__rxor__(self, other)\nobject.__ror__(self, other)\n\n These methods are called to implement the binary arithmetic\n operations (``+``, ``-``, ``*``, ``/``, ``%``, ``divmod()``,\n ``pow()``, ``**``, ``<<``, ``>>``, ``&``, ``^``, ``|``) with\n reflected (swapped) operands. These functions are only called if\n the left operand does not support the corresponding operation and\n the operands are of different types. [4] For instance, to evaluate\n the expression *x*``-``*y*, where *y* is an instance of a class\n that has an ``__rsub__()`` method, ``y.__rsub__(x)`` is called if\n ``x.__sub__(y)`` returns *NotImplemented*.\n\n Note that ternary ``pow()`` will not try calling ``__rpow__()``\n (the coercion rules would become too complicated).\n\n Note: If the right operand\'s type is a subclass of the left operand\'s\n type and that subclass provides the reflected method for the\n operation, this method will be called before the left operand\'s\n non-reflected method. This behavior allows subclasses to\n override their ancestors\' operations.\n\nobject.__iadd__(self, other)\nobject.__isub__(self, other)\nobject.__imul__(self, other)\nobject.__idiv__(self, other)\nobject.__itruediv__(self, other)\nobject.__ifloordiv__(self, other)\nobject.__imod__(self, other)\nobject.__ipow__(self, other[, modulo])\nobject.__ilshift__(self, other)\nobject.__irshift__(self, other)\nobject.__iand__(self, other)\nobject.__ixor__(self, other)\nobject.__ior__(self, other)\n\n These methods are called to implement the augmented arithmetic\n operations (``+=``, ``-=``, ``*=``, ``/=``, ``//=``, ``%=``,\n ``**=``, ``<<=``, ``>>=``, ``&=``, ``^=``, ``|=``). These methods\n should attempt to do the operation in-place (modifying *self*) and\n return the result (which could be, but does not have to be,\n *self*). If a specific method is not defined, the augmented\n operation falls back to the normal methods. For instance, to\n evaluate the expression *x*``+=``*y*, where *x* is an instance of a\n class that has an ``__iadd__()`` method, ``x.__iadd__(y)`` is\n called. If *x* is an instance of a class that does not define a\n ``__iadd__()`` method, ``x.__add__(y)`` and ``y.__radd__(x)`` are\n considered, as with the evaluation of *x*``+``*y*.\n\nobject.__neg__(self)\nobject.__pos__(self)\nobject.__abs__(self)\nobject.__invert__(self)\n\n Called to implement the unary arithmetic operations (``-``, ``+``,\n ``abs()`` and ``~``).\n\nobject.__complex__(self)\nobject.__int__(self)\nobject.__long__(self)\nobject.__float__(self)\n\n Called to implement the built-in functions ``complex()``,\n ``int()``, ``long()``, and ``float()``. Should return a value of\n the appropriate type.\n\nobject.__oct__(self)\nobject.__hex__(self)\n\n Called to implement the built-in functions ``oct()`` and ``hex()``.\n Should return a string value.\n\nobject.__index__(self)\n\n Called to implement ``operator.index()``. Also called whenever\n Python needs an integer object (such as in slicing). Must return\n an integer (int or long).\n\n Added in version 2.5.\n\nobject.__coerce__(self, other)\n\n Called to implement "mixed-mode" numeric arithmetic. Should either\n return a 2-tuple containing *self* and *other* converted to a\n common numeric type, or ``None`` if conversion is impossible. When\n the common type would be the type of ``other``, it is sufficient to\n return ``None``, since the interpreter will also ask the other\n object to attempt a coercion (but sometimes, if the implementation\n of the other type cannot be changed, it is useful to do the\n conversion to the other type here). A return value of\n ``NotImplemented`` is equivalent to returning ``None``.\n\n\nCoercion rules\n==============\n\nThis section used to document the rules for coercion. As the language\nhas evolved, the coercion rules have become hard to document\nprecisely; documenting what one version of one particular\nimplementation does is undesirable. Instead, here are some informal\nguidelines regarding coercion. In Python 3.0, coercion will not be\nsupported.\n\n* If the left operand of a % operator is a string or Unicode object,\n no coercion takes place and the string formatting operation is\n invoked instead.\n\n* It is no longer recommended to define a coercion operation. Mixed-\n mode operations on types that don\'t define coercion pass the\n original arguments to the operation.\n\n* New-style classes (those derived from ``object``) never invoke the\n ``__coerce__()`` method in response to a binary operator; the only\n time ``__coerce__()`` is invoked is when the built-in function\n ``coerce()`` is called.\n\n* For most intents and purposes, an operator that returns\n ``NotImplemented`` is treated the same as one that is not\n implemented at all.\n\n* Below, ``__op__()`` and ``__rop__()`` are used to signify the\n generic method names corresponding to an operator; ``__iop__()`` is\n used for the corresponding in-place operator. For example, for the\n operator \'``+``\', ``__add__()`` and ``__radd__()`` are used for the\n left and right variant of the binary operator, and ``__iadd__()``\n for the in-place variant.\n\n* For objects *x* and *y*, first ``x.__op__(y)`` is tried. If this is\n not implemented or returns ``NotImplemented``, ``y.__rop__(x)`` is\n tried. If this is also not implemented or returns\n ``NotImplemented``, a ``TypeError`` exception is raised. But see\n the following exception:\n\n* Exception to the previous item: if the left operand is an instance\n of a built-in type or a new-style class, and the right operand is an\n instance of a proper subclass of that type or class and overrides\n the base\'s ``__rop__()`` method, the right operand\'s ``__rop__()``\n method is tried *before* the left operand\'s ``__op__()`` method.\n\n This is done so that a subclass can completely override binary\n operators. Otherwise, the left operand\'s ``__op__()`` method would\n always accept the right operand: when an instance of a given class\n is expected, an instance of a subclass of that class is always\n acceptable.\n\n* When either operand type defines a coercion, this coercion is called\n before that type\'s ``__op__()`` or ``__rop__()`` method is called,\n but no sooner. If the coercion returns an object of a different\n type for the operand whose coercion is invoked, part of the process\n is redone using the new object.\n\n* When an in-place operator (like \'``+=``\') is used, if the left\n operand implements ``__iop__()``, it is invoked without any\n coercion. When the operation falls back to ``__op__()`` and/or\n ``__rop__()``, the normal coercion rules apply.\n\n* In *x*``+``*y*, if *x* is a sequence that implements sequence\n concatenation, sequence concatenation is invoked.\n\n* In *x*``*``*y*, if one operator is a sequence that implements\n sequence repetition, and the other is an integer (``int`` or\n ``long``), sequence repetition is invoked.\n\n* Rich comparisons (implemented by methods ``__eq__()`` and so on)\n never use coercion. Three-way comparison (implemented by\n ``__cmp__()``) does use coercion under the same conditions as other\n binary operations use it.\n\n* In the current implementation, the built-in numeric types ``int``,\n ``long`` and ``float`` do not use coercion; the type ``complex``\n however does use it. The difference can become apparent when\n subclassing these types. Over time, the type ``complex`` may be\n fixed to avoid coercion. All these types implement a\n ``__coerce__()`` method, for use by the built-in ``coerce()``\n function.\n\n\nWith Statement Context Managers\n===============================\n\nAdded in version 2.5.\n\nA *context manager* is an object that defines the runtime context to\nbe established when executing a ``with`` statement. The context\nmanager handles the entry into, and the exit from, the desired runtime\ncontext for the execution of the block of code. Context managers are\nnormally invoked using the ``with`` statement (described in section\n*The with statement*), but can also be used by directly invoking their\nmethods.\n\nTypical uses of context managers include saving and restoring various\nkinds of global state, locking and unlocking resources, closing opened\nfiles, etc.\n\nFor more information on context managers, see *Context Manager Types*.\n\nobject.__enter__(self)\n\n Enter the runtime context related to this object. The ``with``\n statement will bind this method\'s return value to the target(s)\n specified in the ``as`` clause of the statement, if any.\n\nobject.__exit__(self, exc_type, exc_value, traceback)\n\n Exit the runtime context related to this object. The parameters\n describe the exception that caused the context to be exited. If the\n context was exited without an exception, all three arguments will\n be ``None``.\n\n If an exception is supplied, and the method wishes to suppress the\n exception (i.e., prevent it from being propagated), it should\n return a true value. Otherwise, the exception will be processed\n normally upon exit from this method.\n\n Note that ``__exit__()`` methods should not reraise the passed-in\n exception; this is the caller\'s responsibility.\n\nSee also:\n\n **PEP 0343** - The "with" statement\n The specification, background, and examples for the Python\n ``with`` statement.\n\n-[ Footnotes ]-\n\n[1] Since Python 2.2, a gradual merging of types and classes has been\n started that makes this and a few other assertions made in this\n manual not 100% accurate and complete: for example, it *is* now\n possible in some cases to change an object\'s type, under certain\n controlled conditions. Until this manual undergoes extensive\n revision, it must now be taken as authoritative only regarding\n "classic classes", that are still the default, for compatibility\n purposes, in Python 2.2 and 2.3. For more information, see\n http://www.python.org/doc/newstyle/.\n\n[2] This, and other statements, are only roughly true for instances of\n new-style classes.\n\n[3] A descriptor can define any combination of ``__get__()``,\n ``__set__()`` and ``__delete__()``. If it does not define\n ``__get__()``, then accessing the attribute even on an instance\n will return the descriptor object itself. If the descriptor\n defines ``__set__()`` and/or ``__delete__()``, it is a data\n descriptor; if it defines neither, it is a non-data descriptor.\n\n[4] For operands of the same type, it is assumed that if the non-\n reflected method (such as ``__add__()``) fails the operation is\n not supported, which is why the reflected method is not called.\n', + 'specialattrs': u"\nSpecial Attributes\n******************\n\nThe implementation adds a few special read-only attributes to several\nobject types, where they are relevant. Some of these are not reported\nby the ``dir()`` built-in function.\n\nobject.__dict__\n\n A dictionary or other mapping object used to store an object's\n (writable) attributes.\n\nobject.__methods__\n\n Deprecated since version 2.2: Use the built-in function ``dir()``\n to get a list of an object's attributes. This attribute is no\n longer available.\n\nobject.__members__\n\n Deprecated since version 2.2: Use the built-in function ``dir()``\n to get a list of an object's attributes. This attribute is no\n longer available.\n\ninstance.__class__\n\n The class to which a class instance belongs.\n\nclass.__bases__\n\n The tuple of base classes of a class object. If there are no base\n classes, this will be an empty tuple.\n\nclass.__name__\n\n The name of the class or type.\n\n-[ Footnotes ]-\n\n[1] Additional information on these special methods may be found in\n the Python Reference Manual (*Basic customization*).\n\n[2] As a consequence, the list ``[1, 2]`` is considered equal to\n ``[1.0, 2.0]``, and similarly for tuples.\n\n[3] They must have since the parser can't tell the type of the\n operands.\n\n[4] To format only a tuple you should therefore provide a singleton\n tuple whose only element is the tuple to be formatted.\n\n[5] These numbers are fairly arbitrary. They are intended to avoid\n printing endless strings of meaningless digits without hampering\n correct use and without having to know the exact precision of\n floating point values on a particular machine.\n\n[6] The advantage of leaving the newline on is that returning an empty\n string is then an unambiguous EOF indication. It is also possible\n (in cases where it might matter, for example, if you want to make\n an exact copy of a file while scanning its lines) to tell whether\n the last line of a file ended in a newline or not (yes this\n happens!).\n", + 'specialnames': u'\nSpecial method names\n********************\n\nA class can implement certain operations that are invoked by special\nsyntax (such as arithmetic operations or subscripting and slicing) by\ndefining methods with special names. This is Python\'s approach to\n*operator overloading*, allowing classes to define their own behavior\nwith respect to language operators. For instance, if a class defines\na method named ``__getitem__()``, and ``x`` is an instance of this\nclass, then ``x[i]`` is roughly equivalent to ``x.__getitem__(i)`` for\nold-style classes and ``type(x).__getitem__(x, i)`` for new-style\nclasses. Except where mentioned, attempts to execute an operation\nraise an exception when no appropriate method is defined (typically\n``AttributeError`` or ``TypeError``).\n\nWhen implementing a class that emulates any built-in type, it is\nimportant that the emulation only be implemented to the degree that it\nmakes sense for the object being modelled. For example, some\nsequences may work well with retrieval of individual elements, but\nextracting a slice may not make sense. (One example of this is the\n``NodeList`` interface in the W3C\'s Document Object Model.)\n\n\nBasic customization\n===================\n\nobject.__new__(cls[, ...])\n\n Called to create a new instance of class *cls*. ``__new__()`` is a\n static method (special-cased so you need not declare it as such)\n that takes the class of which an instance was requested as its\n first argument. The remaining arguments are those passed to the\n object constructor expression (the call to the class). The return\n value of ``__new__()`` should be the new object instance (usually\n an instance of *cls*).\n\n Typical implementations create a new instance of the class by\n invoking the superclass\'s ``__new__()`` method using\n ``super(currentclass, cls).__new__(cls[, ...])`` with appropriate\n arguments and then modifying the newly-created instance as\n necessary before returning it.\n\n If ``__new__()`` returns an instance of *cls*, then the new\n instance\'s ``__init__()`` method will be invoked like\n ``__init__(self[, ...])``, where *self* is the new instance and the\n remaining arguments are the same as were passed to ``__new__()``.\n\n If ``__new__()`` does not return an instance of *cls*, then the new\n instance\'s ``__init__()`` method will not be invoked.\n\n ``__new__()`` is intended mainly to allow subclasses of immutable\n types (like int, str, or tuple) to customize instance creation. It\n is also commonly overridden in custom metaclasses in order to\n customize class creation.\n\nobject.__init__(self[, ...])\n\n Called when the instance is created. The arguments are those\n passed to the class constructor expression. If a base class has an\n ``__init__()`` method, the derived class\'s ``__init__()`` method,\n if any, must explicitly call it to ensure proper initialization of\n the base class part of the instance; for example:\n ``BaseClass.__init__(self, [args...])``. As a special constraint\n on constructors, no value may be returned; doing so will cause a\n ``TypeError`` to be raised at runtime.\n\nobject.__del__(self)\n\n Called when the instance is about to be destroyed. This is also\n called a destructor. If a base class has a ``__del__()`` method,\n the derived class\'s ``__del__()`` method, if any, must explicitly\n call it to ensure proper deletion of the base class part of the\n instance. Note that it is possible (though not recommended!) for\n the ``__del__()`` method to postpone destruction of the instance by\n creating a new reference to it. It may then be called at a later\n time when this new reference is deleted. It is not guaranteed that\n ``__del__()`` methods are called for objects that still exist when\n the interpreter exits.\n\n Note: ``del x`` doesn\'t directly call ``x.__del__()`` --- the former\n decrements the reference count for ``x`` by one, and the latter\n is only called when ``x``\'s reference count reaches zero. Some\n common situations that may prevent the reference count of an\n object from going to zero include: circular references between\n objects (e.g., a doubly-linked list or a tree data structure with\n parent and child pointers); a reference to the object on the\n stack frame of a function that caught an exception (the traceback\n stored in ``sys.exc_traceback`` keeps the stack frame alive); or\n a reference to the object on the stack frame that raised an\n unhandled exception in interactive mode (the traceback stored in\n ``sys.last_traceback`` keeps the stack frame alive). The first\n situation can only be remedied by explicitly breaking the cycles;\n the latter two situations can be resolved by storing ``None`` in\n ``sys.exc_traceback`` or ``sys.last_traceback``. Circular\n references which are garbage are detected when the option cycle\n detector is enabled (it\'s on by default), but can only be cleaned\n up if there are no Python-level ``__del__()`` methods involved.\n Refer to the documentation for the ``gc`` module for more\n information about how ``__del__()`` methods are handled by the\n cycle detector, particularly the description of the ``garbage``\n value.\n\n Warning: Due to the precarious circumstances under which ``__del__()``\n methods are invoked, exceptions that occur during their execution\n are ignored, and a warning is printed to ``sys.stderr`` instead.\n Also, when ``__del__()`` is invoked in response to a module being\n deleted (e.g., when execution of the program is done), other\n globals referenced by the ``__del__()`` method may already have\n been deleted. For this reason, ``__del__()`` methods should do\n the absolute minimum needed to maintain external invariants.\n Starting with version 1.5, Python guarantees that globals whose\n name begins with a single underscore are deleted from their\n module before other globals are deleted; if no other references\n to such globals exist, this may help in assuring that imported\n modules are still available at the time when the ``__del__()``\n method is called.\n\nobject.__repr__(self)\n\n Called by the ``repr()`` built-in function and by string\n conversions (reverse quotes) to compute the "official" string\n representation of an object. If at all possible, this should look\n like a valid Python expression that could be used to recreate an\n object with the same value (given an appropriate environment). If\n this is not possible, a string of the form ``<...some useful\n description...>`` should be returned. The return value must be a\n string object. If a class defines ``__repr__()`` but not\n ``__str__()``, then ``__repr__()`` is also used when an "informal"\n string representation of instances of that class is required.\n\n This is typically used for debugging, so it is important that the\n representation is information-rich and unambiguous.\n\nobject.__str__(self)\n\n Called by the ``str()`` built-in function and by the ``print``\n statement to compute the "informal" string representation of an\n object. This differs from ``__repr__()`` in that it does not have\n to be a valid Python expression: a more convenient or concise\n representation may be used instead. The return value must be a\n string object.\n\nobject.__lt__(self, other)\nobject.__le__(self, other)\nobject.__eq__(self, other)\nobject.__ne__(self, other)\nobject.__gt__(self, other)\nobject.__ge__(self, other)\n\n New in version 2.1.\n\n These are the so-called "rich comparison" methods, and are called\n for comparison operators in preference to ``__cmp__()`` below. The\n correspondence between operator symbols and method names is as\n follows: ``xy`` call ``x.__ne__(y)``, ``x>y`` calls ``x.__gt__(y)``, and\n ``x>=y`` calls ``x.__ge__(y)``.\n\n A rich comparison method may return the singleton\n ``NotImplemented`` if it does not implement the operation for a\n given pair of arguments. By convention, ``False`` and ``True`` are\n returned for a successful comparison. However, these methods can\n return any value, so if the comparison operator is used in a\n Boolean context (e.g., in the condition of an ``if`` statement),\n Python will call ``bool()`` on the value to determine if the result\n is true or false.\n\n There are no implied relationships among the comparison operators.\n The truth of ``x==y`` does not imply that ``x!=y`` is false.\n Accordingly, when defining ``__eq__()``, one should also define\n ``__ne__()`` so that the operators will behave as expected. See\n the paragraph on ``__hash__()`` for some important notes on\n creating *hashable* objects which support custom comparison\n operations and are usable as dictionary keys.\n\n There are no swapped-argument versions of these methods (to be used\n when the left argument does not support the operation but the right\n argument does); rather, ``__lt__()`` and ``__gt__()`` are each\n other\'s reflection, ``__le__()`` and ``__ge__()`` are each other\'s\n reflection, and ``__eq__()`` and ``__ne__()`` are their own\n reflection.\n\n Arguments to rich comparison methods are never coerced.\n\nobject.__cmp__(self, other)\n\n Called by comparison operations if rich comparison (see above) is\n not defined. Should return a negative integer if ``self < other``,\n zero if ``self == other``, a positive integer if ``self > other``.\n If no ``__cmp__()``, ``__eq__()`` or ``__ne__()`` operation is\n defined, class instances are compared by object identity\n ("address"). See also the description of ``__hash__()`` for some\n important notes on creating *hashable* objects which support custom\n comparison operations and are usable as dictionary keys. (Note: the\n restriction that exceptions are not propagated by ``__cmp__()`` has\n been removed since Python 1.5.)\n\nobject.__rcmp__(self, other)\n\n Changed in version 2.1: No longer supported.\n\nobject.__hash__(self)\n\n Called for the key object for dictionary operations, and by the\n built-in function ``hash()``. Should return an integer usable as a\n hash value for dictionary operations. The only required property\n is that objects which compare equal have the same hash value; it is\n advised to somehow mix together (e.g., using exclusive or) the hash\n values for the components of the object that also play a part in\n comparison of objects.\n\n If a class does not define a ``__cmp__()`` or ``__eq__()`` method\n it should not define a ``__hash__()`` operation either; if it\n defines ``__cmp__()`` or ``__eq__()`` but not ``__hash__()``, its\n instances will not be usable as dictionary keys. If a class\n defines mutable objects and implements a ``__cmp__()`` or\n ``__eq__()`` method, it should not implement ``__hash__()``, since\n the dictionary implementation requires that a key\'s hash value is\n immutable (if the object\'s hash value changes, it will be in the\n wrong hash bucket).\n\n User-defined classes have ``__cmp__()`` and ``__hash__()`` methods\n by default; with them, all objects compare unequal (except with\n themselves) and ``x.__hash__()`` returns ``id(x)``.\n\n Classes which inherit a ``__hash__()`` method from a parent class\n but change the meaning of ``__cmp__()`` or ``__eq__()`` such that\n the hash value returned is no longer appropriate (e.g. by switching\n to a value-based concept of equality instead of the default\n identity based equality) can explicitly flag themselves as being\n unhashable by setting ``__hash__ = None`` in the class definition.\n Doing so means that not only will instances of the class raise an\n appropriate ``TypeError`` when a program attempts to retrieve their\n hash value, but they will also be correctly identified as\n unhashable when checking ``isinstance(obj, collections.Hashable)``\n (unlike classes which define their own ``__hash__()`` to explicitly\n raise ``TypeError``).\n\n Changed in version 2.5: ``__hash__()`` may now also return a long\n integer object; the 32-bit integer is then derived from the hash of\n that object.\n\n Changed in version 2.6: ``__hash__`` may now be set to ``None`` to\n explicitly flag instances of a class as unhashable.\n\nobject.__nonzero__(self)\n\n Called to implement truth value testing, and the built-in operation\n ``bool()``; should return ``False`` or ``True``, or their integer\n equivalents ``0`` or ``1``. When this method is not defined,\n ``__len__()`` is called, if it is defined (see below). If a class\n defines neither ``__len__()`` nor ``__nonzero__()``, all its\n instances are considered true.\n\nobject.__unicode__(self)\n\n Called to implement ``unicode()`` builtin; should return a Unicode\n object. When this method is not defined, string conversion is\n attempted, and the result of string conversion is converted to\n Unicode using the system default encoding.\n\n\nCustomizing attribute access\n============================\n\nThe following methods can be defined to customize the meaning of\nattribute access (use of, assignment to, or deletion of ``x.name``)\nfor class instances.\n\nobject.__getattr__(self, name)\n\n Called when an attribute lookup has not found the attribute in the\n usual places (i.e. it is not an instance attribute nor is it found\n in the class tree for ``self``). ``name`` is the attribute name.\n This method should return the (computed) attribute value or raise\n an ``AttributeError`` exception.\n\n Note that if the attribute is found through the normal mechanism,\n ``__getattr__()`` is not called. (This is an intentional asymmetry\n between ``__getattr__()`` and ``__setattr__()``.) This is done both\n for efficiency reasons and because otherwise ``__getattr__()``\n would have no way to access other attributes of the instance. Note\n that at least for instance variables, you can fake total control by\n not inserting any values in the instance attribute dictionary (but\n instead inserting them in another object). See the\n ``__getattribute__()`` method below for a way to actually get total\n control in new-style classes.\n\nobject.__setattr__(self, name, value)\n\n Called when an attribute assignment is attempted. This is called\n instead of the normal mechanism (i.e. store the value in the\n instance dictionary). *name* is the attribute name, *value* is the\n value to be assigned to it.\n\n If ``__setattr__()`` wants to assign to an instance attribute, it\n should not simply execute ``self.name = value`` --- this would\n cause a recursive call to itself. Instead, it should insert the\n value in the dictionary of instance attributes, e.g.,\n ``self.__dict__[name] = value``. For new-style classes, rather\n than accessing the instance dictionary, it should call the base\n class method with the same name, for example,\n ``object.__setattr__(self, name, value)``.\n\nobject.__delattr__(self, name)\n\n Like ``__setattr__()`` but for attribute deletion instead of\n assignment. This should only be implemented if ``del obj.name`` is\n meaningful for the object.\n\n\nMore attribute access for new-style classes\n-------------------------------------------\n\nThe following methods only apply to new-style classes.\n\nobject.__getattribute__(self, name)\n\n Called unconditionally to implement attribute accesses for\n instances of the class. If the class also defines\n ``__getattr__()``, the latter will not be called unless\n ``__getattribute__()`` either calls it explicitly or raises an\n ``AttributeError``. This method should return the (computed)\n attribute value or raise an ``AttributeError`` exception. In order\n to avoid infinite recursion in this method, its implementation\n should always call the base class method with the same name to\n access any attributes it needs, for example,\n ``object.__getattribute__(self, name)``.\n\n Note: This method may still be bypassed when looking up special methods\n as the result of implicit invocation via language syntax or\n builtin functions. See *Special method lookup for new-style\n classes*.\n\n\nImplementing Descriptors\n------------------------\n\nThe following methods only apply when an instance of the class\ncontaining the method (a so-called *descriptor* class) appears in the\nclass dictionary of another new-style class, known as the *owner*\nclass. In the examples below, "the attribute" refers to the attribute\nwhose name is the key of the property in the owner class\'\n``__dict__``. Descriptors can only be implemented as new-style\nclasses themselves.\n\nobject.__get__(self, instance, owner)\n\n Called to get the attribute of the owner class (class attribute\n access) or of an instance of that class (instance attribute\n access). *owner* is always the owner class, while *instance* is the\n instance that the attribute was accessed through, or ``None`` when\n the attribute is accessed through the *owner*. This method should\n return the (computed) attribute value or raise an\n ``AttributeError`` exception.\n\nobject.__set__(self, instance, value)\n\n Called to set the attribute on an instance *instance* of the owner\n class to a new value, *value*.\n\nobject.__delete__(self, instance)\n\n Called to delete the attribute on an instance *instance* of the\n owner class.\n\n\nInvoking Descriptors\n--------------------\n\nIn general, a descriptor is an object attribute with "binding\nbehavior", one whose attribute access has been overridden by methods\nin the descriptor protocol: ``__get__()``, ``__set__()``, and\n``__delete__()``. If any of those methods are defined for an object,\nit is said to be a descriptor.\n\nThe default behavior for attribute access is to get, set, or delete\nthe attribute from an object\'s dictionary. For instance, ``a.x`` has a\nlookup chain starting with ``a.__dict__[\'x\']``, then\n``type(a).__dict__[\'x\']``, and continuing through the base classes of\n``type(a)`` excluding metaclasses.\n\nHowever, if the looked-up value is an object defining one of the\ndescriptor methods, then Python may override the default behavior and\ninvoke the descriptor method instead. Where this occurs in the\nprecedence chain depends on which descriptor methods were defined and\nhow they were called. Note that descriptors are only invoked for new\nstyle objects or classes (ones that subclass ``object()`` or\n``type()``).\n\nThe starting point for descriptor invocation is a binding, ``a.x``.\nHow the arguments are assembled depends on ``a``:\n\nDirect Call\n The simplest and least common call is when user code directly\n invokes a descriptor method: ``x.__get__(a)``.\n\nInstance Binding\n If binding to a new-style object instance, ``a.x`` is transformed\n into the call: ``type(a).__dict__[\'x\'].__get__(a, type(a))``.\n\nClass Binding\n If binding to a new-style class, ``A.x`` is transformed into the\n call: ``A.__dict__[\'x\'].__get__(None, A)``.\n\nSuper Binding\n If ``a`` is an instance of ``super``, then the binding ``super(B,\n obj).m()`` searches ``obj.__class__.__mro__`` for the base class\n ``A`` immediately preceding ``B`` and then invokes the descriptor\n with the call: ``A.__dict__[\'m\'].__get__(obj, A)``.\n\nFor instance bindings, the precedence of descriptor invocation depends\non the which descriptor methods are defined. Normally, data\ndescriptors define both ``__get__()`` and ``__set__()``, while non-\ndata descriptors have just the ``__get__()`` method. Data descriptors\nalways override a redefinition in an instance dictionary. In\ncontrast, non-data descriptors can be overridden by instances. [2]\n\nPython methods (including ``staticmethod()`` and ``classmethod()``)\nare implemented as non-data descriptors. Accordingly, instances can\nredefine and override methods. This allows individual instances to\nacquire behaviors that differ from other instances of the same class.\n\nThe ``property()`` function is implemented as a data descriptor.\nAccordingly, instances cannot override the behavior of a property.\n\n\n__slots__\n---------\n\nBy default, instances of both old and new-style classes have a\ndictionary for attribute storage. This wastes space for objects\nhaving very few instance variables. The space consumption can become\nacute when creating large numbers of instances.\n\nThe default can be overridden by defining *__slots__* in a new-style\nclass definition. The *__slots__* declaration takes a sequence of\ninstance variables and reserves just enough space in each instance to\nhold a value for each variable. Space is saved because *__dict__* is\nnot created for each instance.\n\n__slots__\n\n This class variable can be assigned a string, iterable, or sequence\n of strings with variable names used by instances. If defined in a\n new-style class, *__slots__* reserves space for the declared\n variables and prevents the automatic creation of *__dict__* and\n *__weakref__* for each instance.\n\n New in version 2.2.\n\nNotes on using *__slots__*\n\n* When inheriting from a class without *__slots__*, the *__dict__*\n attribute of that class will always be accessible, so a *__slots__*\n definition in the subclass is meaningless.\n\n* Without a *__dict__* variable, instances cannot be assigned new\n variables not listed in the *__slots__* definition. Attempts to\n assign to an unlisted variable name raises ``AttributeError``. If\n dynamic assignment of new variables is desired, then add\n ``\'__dict__\'`` to the sequence of strings in the *__slots__*\n declaration.\n\n Changed in version 2.3: Previously, adding ``\'__dict__\'`` to the\n *__slots__* declaration would not enable the assignment of new\n attributes not specifically listed in the sequence of instance\n variable names.\n\n* Without a *__weakref__* variable for each instance, classes defining\n *__slots__* do not support weak references to its instances. If weak\n reference support is needed, then add ``\'__weakref__\'`` to the\n sequence of strings in the *__slots__* declaration.\n\n Changed in version 2.3: Previously, adding ``\'__weakref__\'`` to the\n *__slots__* declaration would not enable support for weak\n references.\n\n* *__slots__* are implemented at the class level by creating\n descriptors (*Implementing Descriptors*) for each variable name. As\n a result, class attributes cannot be used to set default values for\n instance variables defined by *__slots__*; otherwise, the class\n attribute would overwrite the descriptor assignment.\n\n* If a class defines a slot also defined in a base class, the instance\n variable defined by the base class slot is inaccessible (except by\n retrieving its descriptor directly from the base class). This\n renders the meaning of the program undefined. In the future, a\n check may be added to prevent this.\n\n* The action of a *__slots__* declaration is limited to the class\n where it is defined. As a result, subclasses will have a *__dict__*\n unless they also define *__slots__*.\n\n* *__slots__* do not work for classes derived from "variable-length"\n built-in types such as ``long``, ``str`` and ``tuple``.\n\n* Any non-string iterable may be assigned to *__slots__*. Mappings may\n also be used; however, in the future, special meaning may be\n assigned to the values corresponding to each key.\n\n* *__class__* assignment works only if both classes have the same\n *__slots__*.\n\n Changed in version 2.6: Previously, *__class__* assignment raised an\n error if either new or old class had *__slots__*.\n\n\nCustomizing class creation\n==========================\n\nBy default, new-style classes are constructed using ``type()``. A\nclass definition is read into a separate namespace and the value of\nclass name is bound to the result of ``type(name, bases, dict)``.\n\nWhen the class definition is read, if *__metaclass__* is defined then\nthe callable assigned to it will be called instead of ``type()``. This\nallows classes or functions to be written which monitor or alter the\nclass creation process:\n\n* Modifying the class dictionary prior to the class being created.\n\n* Returning an instance of another class -- essentially performing the\n role of a factory function.\n\nThese steps will have to be performed in the metaclass\'s ``__new__()``\nmethod -- ``type.__new__()`` can then be called from this method to\ncreate a class with different properties. This example adds a new\nelement to the class dictionary before creating the class:\n\n class metacls(type):\n def __new__(mcs, name, bases, dict):\n dict[\'foo\'] = \'metacls was here\'\n return type.__new__(mcs, name, bases, dict)\n\nYou can of course also override other class methods (or add new\nmethods); for example defining a custom ``__call__()`` method in the\nmetaclass allows custom behavior when the class is called, e.g. not\nalways creating a new instance.\n\n__metaclass__\n\n This variable can be any callable accepting arguments for ``name``,\n ``bases``, and ``dict``. Upon class creation, the callable is used\n instead of the built-in ``type()``.\n\n New in version 2.2.\n\nThe appropriate metaclass is determined by the following precedence\nrules:\n\n* If ``dict[\'__metaclass__\']`` exists, it is used.\n\n* Otherwise, if there is at least one base class, its metaclass is\n used (this looks for a *__class__* attribute first and if not found,\n uses its type).\n\n* Otherwise, if a global variable named __metaclass__ exists, it is\n used.\n\n* Otherwise, the old-style, classic metaclass (types.ClassType) is\n used.\n\nThe potential uses for metaclasses are boundless. Some ideas that have\nbeen explored including logging, interface checking, automatic\ndelegation, automatic property creation, proxies, frameworks, and\nautomatic resource locking/synchronization.\n\n\nEmulating callable objects\n==========================\n\nobject.__call__(self[, args...])\n\n Called when the instance is "called" as a function; if this method\n is defined, ``x(arg1, arg2, ...)`` is a shorthand for\n ``x.__call__(arg1, arg2, ...)``.\n\n\nEmulating container types\n=========================\n\nThe following methods can be defined to implement container objects.\nContainers usually are sequences (such as lists or tuples) or mappings\n(like dictionaries), but can represent other containers as well. The\nfirst set of methods is used either to emulate a sequence or to\nemulate a mapping; the difference is that for a sequence, the\nallowable keys should be the integers *k* for which ``0 <= k < N``\nwhere *N* is the length of the sequence, or slice objects, which\ndefine a range of items. (For backwards compatibility, the method\n``__getslice__()`` (see below) can also be defined to handle simple,\nbut not extended slices.) It is also recommended that mappings provide\nthe methods ``keys()``, ``values()``, ``items()``, ``has_key()``,\n``get()``, ``clear()``, ``setdefault()``, ``iterkeys()``,\n``itervalues()``, ``iteritems()``, ``pop()``, ``popitem()``,\n``copy()``, and ``update()`` behaving similar to those for Python\'s\nstandard dictionary objects. The ``UserDict`` module provides a\n``DictMixin`` class to help create those methods from a base set of\n``__getitem__()``, ``__setitem__()``, ``__delitem__()``, and\n``keys()``. Mutable sequences should provide methods ``append()``,\n``count()``, ``index()``, ``extend()``, ``insert()``, ``pop()``,\n``remove()``, ``reverse()`` and ``sort()``, like Python standard list\nobjects. Finally, sequence types should implement addition (meaning\nconcatenation) and multiplication (meaning repetition) by defining the\nmethods ``__add__()``, ``__radd__()``, ``__iadd__()``, ``__mul__()``,\n``__rmul__()`` and ``__imul__()`` described below; they should not\ndefine ``__coerce__()`` or other numerical operators. It is\nrecommended that both mappings and sequences implement the\n``__contains__()`` method to allow efficient use of the ``in``\noperator; for mappings, ``in`` should be equivalent of ``has_key()``;\nfor sequences, it should search through the values. It is further\nrecommended that both mappings and sequences implement the\n``__iter__()`` method to allow efficient iteration through the\ncontainer; for mappings, ``__iter__()`` should be the same as\n``iterkeys()``; for sequences, it should iterate through the values.\n\nobject.__len__(self)\n\n Called to implement the built-in function ``len()``. Should return\n the length of the object, an integer ``>=`` 0. Also, an object\n that doesn\'t define a ``__nonzero__()`` method and whose\n ``__len__()`` method returns zero is considered to be false in a\n Boolean context.\n\nobject.__getitem__(self, key)\n\n Called to implement evaluation of ``self[key]``. For sequence\n types, the accepted keys should be integers and slice objects.\n Note that the special interpretation of negative indexes (if the\n class wishes to emulate a sequence type) is up to the\n ``__getitem__()`` method. If *key* is of an inappropriate type,\n ``TypeError`` may be raised; if of a value outside the set of\n indexes for the sequence (after any special interpretation of\n negative values), ``IndexError`` should be raised. For mapping\n types, if *key* is missing (not in the container), ``KeyError``\n should be raised.\n\n Note: ``for`` loops expect that an ``IndexError`` will be raised for\n illegal indexes to allow proper detection of the end of the\n sequence.\n\nobject.__setitem__(self, key, value)\n\n Called to implement assignment to ``self[key]``. Same note as for\n ``__getitem__()``. This should only be implemented for mappings if\n the objects support changes to the values for keys, or if new keys\n can be added, or for sequences if elements can be replaced. The\n same exceptions should be raised for improper *key* values as for\n the ``__getitem__()`` method.\n\nobject.__delitem__(self, key)\n\n Called to implement deletion of ``self[key]``. Same note as for\n ``__getitem__()``. This should only be implemented for mappings if\n the objects support removal of keys, or for sequences if elements\n can be removed from the sequence. The same exceptions should be\n raised for improper *key* values as for the ``__getitem__()``\n method.\n\nobject.__iter__(self)\n\n This method is called when an iterator is required for a container.\n This method should return a new iterator object that can iterate\n over all the objects in the container. For mappings, it should\n iterate over the keys of the container, and should also be made\n available as the method ``iterkeys()``.\n\n Iterator objects also need to implement this method; they are\n required to return themselves. For more information on iterator\n objects, see *Iterator Types*.\n\nobject.__reversed__(self)\n\n Called (if present) by the ``reversed()`` builtin to implement\n reverse iteration. It should return a new iterator object that\n iterates over all the objects in the container in reverse order.\n\n If the ``__reversed__()`` method is not provided, the\n ``reversed()`` builtin will fall back to using the sequence\n protocol (``__len__()`` and ``__getitem__()``). Objects should\n normally only provide ``__reversed__()`` if they do not support the\n sequence protocol and an efficient implementation of reverse\n iteration is possible.\n\n New in version 2.6.\n\nThe membership test operators (``in`` and ``not in``) are normally\nimplemented as an iteration through a sequence. However, container\nobjects can supply the following special method with a more efficient\nimplementation, which also does not require the object be a sequence.\n\nobject.__contains__(self, item)\n\n Called to implement membership test operators. Should return true\n if *item* is in *self*, false otherwise. For mapping objects, this\n should consider the keys of the mapping rather than the values or\n the key-item pairs.\n\n\nAdditional methods for emulation of sequence types\n==================================================\n\nThe following optional methods can be defined to further emulate\nsequence objects. Immutable sequences methods should at most only\ndefine ``__getslice__()``; mutable sequences might define all three\nmethods.\n\nobject.__getslice__(self, i, j)\n\n Deprecated since version 2.0: Support slice objects as parameters\n to the ``__getitem__()`` method. (However, built-in types in\n CPython currently still implement ``__getslice__()``. Therefore,\n you have to override it in derived classes when implementing\n slicing.)\n\n Called to implement evaluation of ``self[i:j]``. The returned\n object should be of the same type as *self*. Note that missing *i*\n or *j* in the slice expression are replaced by zero or\n ``sys.maxint``, respectively. If negative indexes are used in the\n slice, the length of the sequence is added to that index. If the\n instance does not implement the ``__len__()`` method, an\n ``AttributeError`` is raised. No guarantee is made that indexes\n adjusted this way are not still negative. Indexes which are\n greater than the length of the sequence are not modified. If no\n ``__getslice__()`` is found, a slice object is created instead, and\n passed to ``__getitem__()`` instead.\n\nobject.__setslice__(self, i, j, sequence)\n\n Called to implement assignment to ``self[i:j]``. Same notes for *i*\n and *j* as for ``__getslice__()``.\n\n This method is deprecated. If no ``__setslice__()`` is found, or\n for extended slicing of the form ``self[i:j:k]``, a slice object is\n created, and passed to ``__setitem__()``, instead of\n ``__setslice__()`` being called.\n\nobject.__delslice__(self, i, j)\n\n Called to implement deletion of ``self[i:j]``. Same notes for *i*\n and *j* as for ``__getslice__()``. This method is deprecated. If no\n ``__delslice__()`` is found, or for extended slicing of the form\n ``self[i:j:k]``, a slice object is created, and passed to\n ``__delitem__()``, instead of ``__delslice__()`` being called.\n\nNotice that these methods are only invoked when a single slice with a\nsingle colon is used, and the slice method is available. For slice\noperations involving extended slice notation, or in absence of the\nslice methods, ``__getitem__()``, ``__setitem__()`` or\n``__delitem__()`` is called with a slice object as argument.\n\nThe following example demonstrate how to make your program or module\ncompatible with earlier versions of Python (assuming that methods\n``__getitem__()``, ``__setitem__()`` and ``__delitem__()`` support\nslice objects as arguments):\n\n class MyClass:\n ...\n def __getitem__(self, index):\n ...\n def __setitem__(self, index, value):\n ...\n def __delitem__(self, index):\n ...\n\n if sys.version_info < (2, 0):\n # They won\'t be defined if version is at least 2.0 final\n\n def __getslice__(self, i, j):\n return self[max(0, i):max(0, j):]\n def __setslice__(self, i, j, seq):\n self[max(0, i):max(0, j):] = seq\n def __delslice__(self, i, j):\n del self[max(0, i):max(0, j):]\n ...\n\nNote the calls to ``max()``; these are necessary because of the\nhandling of negative indices before the ``__*slice__()`` methods are\ncalled. When negative indexes are used, the ``__*item__()`` methods\nreceive them as provided, but the ``__*slice__()`` methods get a\n"cooked" form of the index values. For each negative index value, the\nlength of the sequence is added to the index before calling the method\n(which may still result in a negative index); this is the customary\nhandling of negative indexes by the built-in sequence types, and the\n``__*item__()`` methods are expected to do this as well. However,\nsince they should already be doing that, negative indexes cannot be\npassed in; they must be constrained to the bounds of the sequence\nbefore being passed to the ``__*item__()`` methods. Calling ``max(0,\ni)`` conveniently returns the proper value.\n\n\nEmulating numeric types\n=======================\n\nThe following methods can be defined to emulate numeric objects.\nMethods corresponding to operations that are not supported by the\nparticular kind of number implemented (e.g., bitwise operations for\nnon-integral numbers) should be left undefined.\n\nobject.__add__(self, other)\nobject.__sub__(self, other)\nobject.__mul__(self, other)\nobject.__floordiv__(self, other)\nobject.__mod__(self, other)\nobject.__divmod__(self, other)\nobject.__pow__(self, other[, modulo])\nobject.__lshift__(self, other)\nobject.__rshift__(self, other)\nobject.__and__(self, other)\nobject.__xor__(self, other)\nobject.__or__(self, other)\n\n These methods are called to implement the binary arithmetic\n operations (``+``, ``-``, ``*``, ``//``, ``%``, ``divmod()``,\n ``pow()``, ``**``, ``<<``, ``>>``, ``&``, ``^``, ``|``). For\n instance, to evaluate the expression ``x + y``, where *x* is an\n instance of a class that has an ``__add__()`` method,\n ``x.__add__(y)`` is called. The ``__divmod__()`` method should be\n the equivalent to using ``__floordiv__()`` and ``__mod__()``; it\n should not be related to ``__truediv__()`` (described below). Note\n that ``__pow__()`` should be defined to accept an optional third\n argument if the ternary version of the built-in ``pow()`` function\n is to be supported.\n\n If one of those methods does not support the operation with the\n supplied arguments, it should return ``NotImplemented``.\n\nobject.__div__(self, other)\nobject.__truediv__(self, other)\n\n The division operator (``/``) is implemented by these methods. The\n ``__truediv__()`` method is used when ``__future__.division`` is in\n effect, otherwise ``__div__()`` is used. If only one of these two\n methods is defined, the object will not support division in the\n alternate context; ``TypeError`` will be raised instead.\n\nobject.__radd__(self, other)\nobject.__rsub__(self, other)\nobject.__rmul__(self, other)\nobject.__rdiv__(self, other)\nobject.__rtruediv__(self, other)\nobject.__rfloordiv__(self, other)\nobject.__rmod__(self, other)\nobject.__rdivmod__(self, other)\nobject.__rpow__(self, other)\nobject.__rlshift__(self, other)\nobject.__rrshift__(self, other)\nobject.__rand__(self, other)\nobject.__rxor__(self, other)\nobject.__ror__(self, other)\n\n These methods are called to implement the binary arithmetic\n operations (``+``, ``-``, ``*``, ``/``, ``%``, ``divmod()``,\n ``pow()``, ``**``, ``<<``, ``>>``, ``&``, ``^``, ``|``) with\n reflected (swapped) operands. These functions are only called if\n the left operand does not support the corresponding operation and\n the operands are of different types. [3] For instance, to evaluate\n the expression ``x - y``, where *y* is an instance of a class that\n has an ``__rsub__()`` method, ``y.__rsub__(x)`` is called if\n ``x.__sub__(y)`` returns *NotImplemented*.\n\n Note that ternary ``pow()`` will not try calling ``__rpow__()``\n (the coercion rules would become too complicated).\n\n Note: If the right operand\'s type is a subclass of the left operand\'s\n type and that subclass provides the reflected method for the\n operation, this method will be called before the left operand\'s\n non-reflected method. This behavior allows subclasses to\n override their ancestors\' operations.\n\nobject.__iadd__(self, other)\nobject.__isub__(self, other)\nobject.__imul__(self, other)\nobject.__idiv__(self, other)\nobject.__itruediv__(self, other)\nobject.__ifloordiv__(self, other)\nobject.__imod__(self, other)\nobject.__ipow__(self, other[, modulo])\nobject.__ilshift__(self, other)\nobject.__irshift__(self, other)\nobject.__iand__(self, other)\nobject.__ixor__(self, other)\nobject.__ior__(self, other)\n\n These methods are called to implement the augmented arithmetic\n operations (``+=``, ``-=``, ``*=``, ``/=``, ``//=``, ``%=``,\n ``**=``, ``<<=``, ``>>=``, ``&=``, ``^=``, ``|=``). These methods\n should attempt to do the operation in-place (modifying *self*) and\n return the result (which could be, but does not have to be,\n *self*). If a specific method is not defined, the augmented\n operation falls back to the normal methods. For instance, to\n evaluate the expression ``x += y``, where *x* is an instance of a\n class that has an ``__iadd__()`` method, ``x.__iadd__(y)`` is\n called. If *x* is an instance of a class that does not define a\n ``__iadd__()`` method, ``x.__add__(y)`` and ``y.__radd__(x)`` are\n considered, as with the evaluation of ``x + y``.\n\nobject.__neg__(self)\nobject.__pos__(self)\nobject.__abs__(self)\nobject.__invert__(self)\n\n Called to implement the unary arithmetic operations (``-``, ``+``,\n ``abs()`` and ``~``).\n\nobject.__complex__(self)\nobject.__int__(self)\nobject.__long__(self)\nobject.__float__(self)\n\n Called to implement the built-in functions ``complex()``,\n ``int()``, ``long()``, and ``float()``. Should return a value of\n the appropriate type.\n\nobject.__oct__(self)\nobject.__hex__(self)\n\n Called to implement the built-in functions ``oct()`` and ``hex()``.\n Should return a string value.\n\nobject.__index__(self)\n\n Called to implement ``operator.index()``. Also called whenever\n Python needs an integer object (such as in slicing). Must return\n an integer (int or long).\n\n New in version 2.5.\n\nobject.__coerce__(self, other)\n\n Called to implement "mixed-mode" numeric arithmetic. Should either\n return a 2-tuple containing *self* and *other* converted to a\n common numeric type, or ``None`` if conversion is impossible. When\n the common type would be the type of ``other``, it is sufficient to\n return ``None``, since the interpreter will also ask the other\n object to attempt a coercion (but sometimes, if the implementation\n of the other type cannot be changed, it is useful to do the\n conversion to the other type here). A return value of\n ``NotImplemented`` is equivalent to returning ``None``.\n\n\nCoercion rules\n==============\n\nThis section used to document the rules for coercion. As the language\nhas evolved, the coercion rules have become hard to document\nprecisely; documenting what one version of one particular\nimplementation does is undesirable. Instead, here are some informal\nguidelines regarding coercion. In Python 3.0, coercion will not be\nsupported.\n\n* If the left operand of a % operator is a string or Unicode object,\n no coercion takes place and the string formatting operation is\n invoked instead.\n\n* It is no longer recommended to define a coercion operation. Mixed-\n mode operations on types that don\'t define coercion pass the\n original arguments to the operation.\n\n* New-style classes (those derived from ``object``) never invoke the\n ``__coerce__()`` method in response to a binary operator; the only\n time ``__coerce__()`` is invoked is when the built-in function\n ``coerce()`` is called.\n\n* For most intents and purposes, an operator that returns\n ``NotImplemented`` is treated the same as one that is not\n implemented at all.\n\n* Below, ``__op__()`` and ``__rop__()`` are used to signify the\n generic method names corresponding to an operator; ``__iop__()`` is\n used for the corresponding in-place operator. For example, for the\n operator \'``+``\', ``__add__()`` and ``__radd__()`` are used for the\n left and right variant of the binary operator, and ``__iadd__()``\n for the in-place variant.\n\n* For objects *x* and *y*, first ``x.__op__(y)`` is tried. If this is\n not implemented or returns ``NotImplemented``, ``y.__rop__(x)`` is\n tried. If this is also not implemented or returns\n ``NotImplemented``, a ``TypeError`` exception is raised. But see\n the following exception:\n\n* Exception to the previous item: if the left operand is an instance\n of a built-in type or a new-style class, and the right operand is an\n instance of a proper subclass of that type or class and overrides\n the base\'s ``__rop__()`` method, the right operand\'s ``__rop__()``\n method is tried *before* the left operand\'s ``__op__()`` method.\n\n This is done so that a subclass can completely override binary\n operators. Otherwise, the left operand\'s ``__op__()`` method would\n always accept the right operand: when an instance of a given class\n is expected, an instance of a subclass of that class is always\n acceptable.\n\n* When either operand type defines a coercion, this coercion is called\n before that type\'s ``__op__()`` or ``__rop__()`` method is called,\n but no sooner. If the coercion returns an object of a different\n type for the operand whose coercion is invoked, part of the process\n is redone using the new object.\n\n* When an in-place operator (like \'``+=``\') is used, if the left\n operand implements ``__iop__()``, it is invoked without any\n coercion. When the operation falls back to ``__op__()`` and/or\n ``__rop__()``, the normal coercion rules apply.\n\n* In ``x + y``, if *x* is a sequence that implements sequence\n concatenation, sequence concatenation is invoked.\n\n* In ``x * y``, if one operator is a sequence that implements sequence\n repetition, and the other is an integer (``int`` or ``long``),\n sequence repetition is invoked.\n\n* Rich comparisons (implemented by methods ``__eq__()`` and so on)\n never use coercion. Three-way comparison (implemented by\n ``__cmp__()``) does use coercion under the same conditions as other\n binary operations use it.\n\n* In the current implementation, the built-in numeric types ``int``,\n ``long`` and ``float`` do not use coercion; the type ``complex``\n however does use it. The difference can become apparent when\n subclassing these types. Over time, the type ``complex`` may be\n fixed to avoid coercion. All these types implement a\n ``__coerce__()`` method, for use by the built-in ``coerce()``\n function.\n\n\nWith Statement Context Managers\n===============================\n\nNew in version 2.5.\n\nA *context manager* is an object that defines the runtime context to\nbe established when executing a ``with`` statement. The context\nmanager handles the entry into, and the exit from, the desired runtime\ncontext for the execution of the block of code. Context managers are\nnormally invoked using the ``with`` statement (described in section\n*The with statement*), but can also be used by directly invoking their\nmethods.\n\nTypical uses of context managers include saving and restoring various\nkinds of global state, locking and unlocking resources, closing opened\nfiles, etc.\n\nFor more information on context managers, see *Context Manager Types*.\n\nobject.__enter__(self)\n\n Enter the runtime context related to this object. The ``with``\n statement will bind this method\'s return value to the target(s)\n specified in the ``as`` clause of the statement, if any.\n\nobject.__exit__(self, exc_type, exc_value, traceback)\n\n Exit the runtime context related to this object. The parameters\n describe the exception that caused the context to be exited. If the\n context was exited without an exception, all three arguments will\n be ``None``.\n\n If an exception is supplied, and the method wishes to suppress the\n exception (i.e., prevent it from being propagated), it should\n return a true value. Otherwise, the exception will be processed\n normally upon exit from this method.\n\n Note that ``__exit__()`` methods should not reraise the passed-in\n exception; this is the caller\'s responsibility.\n\nSee also:\n\n **PEP 0343** - The "with" statement\n The specification, background, and examples for the Python\n ``with`` statement.\n\n\nSpecial method lookup for old-style classes\n===========================================\n\nFor old-style classes, special methods are always looked up in exactly\nthe same way as any other method or attribute. This is the case\nregardless of whether the method is being looked up explicitly as in\n``x.__getitem__(i)`` or implicitly as in ``x[i]``.\n\nThis behaviour means that special methods may exhibit different\nbehaviour for different instances of a single old-style class if the\nappropriate special attributes are set differently:\n\n >>> class C:\n ... pass\n ...\n >>> c1 = C()\n >>> c2 = C()\n >>> c1.__len__ = lambda: 5\n >>> c2.__len__ = lambda: 9\n >>> len(c1)\n 5\n >>> len(c2)\n 9\n\n\nSpecial method lookup for new-style classes\n===========================================\n\nFor new-style classes, implicit invocations of special methods are\nonly guaranteed to work correctly if defined on an object\'s type, not\nin the object\'s instance dictionary. That behaviour is the reason why\nthe following code raises an exception (unlike the equivalent example\nwith old-style classes):\n\n >>> class C(object):\n ... pass\n ...\n >>> c = C()\n >>> c.__len__ = lambda: 5\n >>> len(c)\n Traceback (most recent call last):\n File "", line 1, in \n TypeError: object of type \'C\' has no len()\n\nThe rationale behind this behaviour lies with a number of special\nmethods such as ``__hash__()`` and ``__repr__()`` that are implemented\nby all objects, including type objects. If the implicit lookup of\nthese methods used the conventional lookup process, they would fail\nwhen invoked on the type object itself:\n\n >>> 1 .__hash__() == hash(1)\n True\n >>> int.__hash__() == hash(int)\n Traceback (most recent call last):\n File "", line 1, in \n TypeError: descriptor \'__hash__\' of \'int\' object needs an argument\n\nIncorrectly attempting to invoke an unbound method of a class in this\nway is sometimes referred to as \'metaclass confusion\', and is avoided\nby bypassing the instance when looking up special methods:\n\n >>> type(1).__hash__(1) == hash(1)\n True\n >>> type(int).__hash__(int) == hash(int)\n True\n\nIn addition to bypassing any instance attributes in the interest of\ncorrectness, implicit special method lookup may also bypass the\n``__getattribute__()`` method even of the object\'s metaclass:\n\n >>> class Meta(type):\n ... def __getattribute__(*args):\n ... print "Metaclass getattribute invoked"\n ... return type.__getattribute__(*args)\n ...\n >>> class C(object):\n ... __metaclass__ = Meta\n ... def __len__(self):\n ... return 10\n ... def __getattribute__(*args):\n ... print "Class getattribute invoked"\n ... return object.__getattribute__(*args)\n ...\n >>> c = C()\n >>> c.__len__() # Explicit lookup via instance\n Class getattribute invoked\n 10\n >>> type(c).__len__(c) # Explicit lookup via type\n Metaclass getattribute invoked\n 10\n >>> len(c) # Implicit lookup\n 10\n\nBypassing the ``__getattribute__()`` machinery in this fashion\nprovides significant scope for speed optimisations within the\ninterpreter, at the cost of some flexibility in the handling of\nspecial methods (the special method *must* be set on the class object\nitself in order to be consistently invoked by the interpreter).\n\n-[ Footnotes ]-\n\n[1] It *is* possible in some cases to change an object\'s type, under\n certain controlled conditions. It generally isn\'t a good idea\n though, since it can lead to some very strange behaviour if it is\n handled incorrectly.\n\n[2] A descriptor can define any combination of ``__get__()``,\n ``__set__()`` and ``__delete__()``. If it does not define\n ``__get__()``, then accessing the attribute even on an instance\n will return the descriptor object itself. If the descriptor\n defines ``__set__()`` and/or ``__delete__()``, it is a data\n descriptor; if it defines neither, it is a non-data descriptor.\n\n[3] For operands of the same type, it is assumed that if the non-\n reflected method (such as ``__add__()``) fails the operation is\n not supported, which is why the reflected method is not called.\n', 'string-conversions': u'\nString conversions\n******************\n\nA string conversion is an expression list enclosed in reverse (a.k.a.\nbackward) quotes:\n\n string_conversion ::= "\'" expression_list "\'"\n\nA string conversion evaluates the contained expression list and\nconverts the resulting object into a string according to rules\nspecific to its type.\n\nIf the object is a string, a number, ``None``, or a tuple, list or\ndictionary containing only objects whose type is one of these, the\nresulting string is a valid Python expression which can be passed to\nthe built-in function ``eval()`` to yield an expression with the same\nvalue (or an approximation, if floating point numbers are involved).\n\n(In particular, converting a string adds quotes around it and converts\n"funny" characters to escape sequences that are safe to print.)\n\nRecursive objects (for example, lists or dictionaries that contain a\nreference to themselves, directly or indirectly) use ``...`` to\nindicate a recursive reference, and the result cannot be passed to\n``eval()`` to get an equal value (``SyntaxError`` will be raised\ninstead).\n\nThe built-in function ``repr()`` performs exactly the same conversion\nin its argument as enclosing it in parentheses and reverse quotes\ndoes. The built-in function ``str()`` performs a similar but more\nuser-friendly conversion.\n', - 'string-methods': u'\nString Methods\n**************\n\nBelow are listed the string methods which both 8-bit strings and\nUnicode objects support. Note that none of these methods take keyword\narguments.\n\nIn addition, Python\'s strings support the sequence type methods\ndescribed in the *Sequence Types --- str, unicode, list, tuple,\nbuffer, xrange* section. To output formatted strings use template\nstrings or the ``%`` operator described in the *String Formatting\nOperations* section. Also, see the ``re`` module for string functions\nbased on regular expressions.\n\nstr.capitalize()\n\n Return a copy of the string with only its first character\n capitalized.\n\n For 8-bit strings, this method is locale-dependent.\n\nstr.center(width[, fillchar])\n\n Return centered in a string of length *width*. Padding is done\n using the specified *fillchar* (default is a space).\n\n Changed in version 2.4: Support for the *fillchar* argument.\n\nstr.count(sub[, start[, end]])\n\n Return the number of occurrences of substring *sub* in the range\n [*start*, *end*]. Optional arguments *start* and *end* are\n interpreted as in slice notation.\n\nstr.decode([encoding[, errors]])\n\n Decodes the string using the codec registered for *encoding*.\n *encoding* defaults to the default string encoding. *errors* may\n be given to set a different error handling scheme. The default is\n ``\'strict\'``, meaning that encoding errors raise ``UnicodeError``.\n Other possible values are ``\'ignore\'``, ``\'replace\'`` and any other\n name registered via ``codecs.register_error()``, see section *Codec\n Base Classes*.\n\n Added in version 2.2.\n\n Changed in version 2.3: Support for other error handling schemes\n added.\n\nstr.encode([encoding[, errors]])\n\n Return an encoded version of the string. Default encoding is the\n current default string encoding. *errors* may be given to set a\n different error handling scheme. The default for *errors* is\n ``\'strict\'``, meaning that encoding errors raise a\n ``UnicodeError``. Other possible values are ``\'ignore\'``,\n ``\'replace\'``, ``\'xmlcharrefreplace\'``, ``\'backslashreplace\'`` and\n any other name registered via ``codecs.register_error()``, see\n section *Codec Base Classes*. For a list of possible encodings, see\n section *Standard Encodings*.\n\n Added in version 2.0.\n\n Changed in version 2.3: Support for ``\'xmlcharrefreplace\'`` and\n ``\'backslashreplace\'`` and other error handling schemes added.\n\nstr.endswith(suffix[, start[, end]])\n\n Return ``True`` if the string ends with the specified *suffix*,\n otherwise return ``False``. *suffix* can also be a tuple of\n suffixes to look for. With optional *start*, test beginning at\n that position. With optional *end*, stop comparing at that\n position.\n\n Changed in version 2.5: Accept tuples as *suffix*.\n\nstr.expandtabs([tabsize])\n\n Return a copy of the string where all tab characters are replaced\n by one or more spaces, depending on the current column and the\n given tab size. The column number is reset to zero after each\n newline occurring in the string. If *tabsize* is not given, a tab\n size of ``8`` characters is assumed. This doesn\'t understand other\n non-printing characters or escape sequences.\n\nstr.find(sub[, start[, end]])\n\n Return the lowest index in the string where substring *sub* is\n found, such that *sub* is contained in the range [*start*, *end*].\n Optional arguments *start* and *end* are interpreted as in slice\n notation. Return ``-1`` if *sub* is not found.\n\nstr.format(format_string, *args, **kwargs)\n\n Perform a string formatting operation. The *format_string*\n argument can contain literal text or replacement fields delimited\n by braces ``{}``. Each replacement field contains either the\n numeric index of a positional argument, or the name of a keyword\n argument. Returns a copy of *format_string* where each replacement\n field is replaced with the string value of the corresponding\n argument.\n\n >>> "The sum of 1 + 2 is {0}".format(1+2)\n \'The sum of 1 + 2 is 3\'\n\n See *Format String Syntax* for a description of the various\n formatting options that can be specified in format strings.\n\n This method of string formatting is the new standard in Python 3.0,\n and should be preferred to the ``%`` formatting described in\n *String Formatting Operations* in new code.\n\n Added in version 2.6.\n\nstr.index(sub[, start[, end]])\n\n Like ``find()``, but raise ``ValueError`` when the substring is not\n found.\n\nstr.isalnum()\n\n Return true if all characters in the string are alphanumeric and\n there is at least one character, false otherwise.\n\n For 8-bit strings, this method is locale-dependent.\n\nstr.isalpha()\n\n Return true if all characters in the string are alphabetic and\n there is at least one character, false otherwise.\n\n For 8-bit strings, this method is locale-dependent.\n\nstr.isdigit()\n\n Return true if all characters in the string are digits and there is\n at least one character, false otherwise.\n\n For 8-bit strings, this method is locale-dependent.\n\nstr.islower()\n\n Return true if all cased characters in the string are lowercase and\n there is at least one cased character, false otherwise.\n\n For 8-bit strings, this method is locale-dependent.\n\nstr.isspace()\n\n Return true if there are only whitespace characters in the string\n and there is at least one character, false otherwise.\n\n For 8-bit strings, this method is locale-dependent.\n\nstr.istitle()\n\n Return true if the string is a titlecased string and there is at\n least one character, for example uppercase characters may only\n follow uncased characters and lowercase characters only cased ones.\n Return false otherwise.\n\n For 8-bit strings, this method is locale-dependent.\n\nstr.isupper()\n\n Return true if all cased characters in the string are uppercase and\n there is at least one cased character, false otherwise.\n\n For 8-bit strings, this method is locale-dependent.\n\nstr.join(seq)\n\n Return a string which is the concatenation of the strings in the\n sequence *seq*. The separator between elements is the string\n providing this method.\n\nstr.ljust(width[, fillchar])\n\n Return the string left justified in a string of length *width*.\n Padding is done using the specified *fillchar* (default is a\n space). The original string is returned if *width* is less than\n ``len(s)``.\n\n Changed in version 2.4: Support for the *fillchar* argument.\n\nstr.lower()\n\n Return a copy of the string converted to lowercase.\n\n For 8-bit strings, this method is locale-dependent.\n\nstr.lstrip([chars])\n\n Return a copy of the string with leading characters removed. The\n *chars* argument is a string specifying the set of characters to be\n removed. If omitted or ``None``, the *chars* argument defaults to\n removing whitespace. The *chars* argument is not a prefix; rather,\n all combinations of its values are stripped:\n\n >>> \' spacious \'.lstrip()\n \'spacious \'\n >>> \'www.example.com\'.lstrip(\'cmowz.\')\n \'example.com\'\n\n Changed in version 2.2.2: Support for the *chars* argument.\n\nstr.partition(sep)\n\n Split the string at the first occurrence of *sep*, and return a\n 3-tuple containing the part before the separator, the separator\n itself, and the part after the separator. If the separator is not\n found, return a 3-tuple containing the string itself, followed by\n two empty strings.\n\n Added in version 2.5.\n\nstr.replace(old, new[, count])\n\n Return a copy of the string with all occurrences of substring *old*\n replaced by *new*. If the optional argument *count* is given, only\n the first *count* occurrences are replaced.\n\nstr.rfind(sub[, start[, end]])\n\n Return the highest index in the string where substring *sub* is\n found, such that *sub* is contained within s[start,end]. Optional\n arguments *start* and *end* are interpreted as in slice notation.\n Return ``-1`` on failure.\n\nstr.rindex(sub[, start[, end]])\n\n Like ``rfind()`` but raises ``ValueError`` when the substring *sub*\n is not found.\n\nstr.rjust(width[, fillchar])\n\n Return the string right justified in a string of length *width*.\n Padding is done using the specified *fillchar* (default is a\n space). The original string is returned if *width* is less than\n ``len(s)``.\n\n Changed in version 2.4: Support for the *fillchar* argument.\n\nstr.rpartition(sep)\n\n Split the string at the last occurrence of *sep*, and return a\n 3-tuple containing the part before the separator, the separator\n itself, and the part after the separator. If the separator is not\n found, return a 3-tuple containing two empty strings, followed by\n the string itself.\n\n Added in version 2.5.\n\nstr.rsplit([sep[, maxsplit]])\n\n Return a list of the words in the string, using *sep* as the\n delimiter string. If *maxsplit* is given, at most *maxsplit* splits\n are done, the *rightmost* ones. If *sep* is not specified or\n ``None``, any whitespace string is a separator. Except for\n splitting from the right, ``rsplit()`` behaves like ``split()``\n which is described in detail below.\n\n Added in version 2.4.\n\nstr.rstrip([chars])\n\n Return a copy of the string with trailing characters removed. The\n *chars* argument is a string specifying the set of characters to be\n removed. If omitted or ``None``, the *chars* argument defaults to\n removing whitespace. The *chars* argument is not a suffix; rather,\n all combinations of its values are stripped:\n\n >>> \' spacious \'.rstrip()\n \' spacious\'\n >>> \'mississippi\'.rstrip(\'ipz\')\n \'mississ\'\n\n Changed in version 2.2.2: Support for the *chars* argument.\n\nstr.split([sep[, maxsplit]])\n\n Return a list of the words in the string, using *sep* as the\n delimiter string. If *maxsplit* is given, at most *maxsplit*\n splits are done (thus, the list will have at most ``maxsplit+1``\n elements). If *maxsplit* is not specified, then there is no limit\n on the number of splits (all possible splits are made).\n\n If *sep* is given, consecutive delimiters are not grouped together\n and are deemed to delimit empty strings (for example,\n ``\'1,,2\'.split(\',\')`` returns ``[\'1\', \'\', \'2\']``). The *sep*\n argument may consist of multiple characters (for example,\n ``\'1<>2<>3\'.split(\'<>\')`` returns ``[\'1\', \'2\', \'3\']``). Splitting\n an empty string with a specified separator returns ``[\'\']``.\n\n If *sep* is not specified or is ``None``, a different splitting\n algorithm is applied: runs of consecutive whitespace are regarded\n as a single separator, and the result will contain no empty strings\n at the start or end if the string has leading or trailing\n whitespace. Consequently, splitting an empty string or a string\n consisting of just whitespace with a ``None`` separator returns\n ``[]``.\n\n For example, ``\' 1 2 3 \'.split()`` returns ``[\'1\', \'2\', \'3\']``,\n and ``\' 1 2 3 \'.split(None, 1)`` returns ``[\'1\', \'2 3 \']``.\n\nstr.splitlines([keepends])\n\n Return a list of the lines in the string, breaking at line\n boundaries. Line breaks are not included in the resulting list\n unless *keepends* is given and true.\n\nstr.startswith(prefix[, start[, end]])\n\n Return ``True`` if string starts with the *prefix*, otherwise\n return ``False``. *prefix* can also be a tuple of prefixes to look\n for. With optional *start*, test string beginning at that\n position. With optional *end*, stop comparing string at that\n position.\n\n Changed in version 2.5: Accept tuples as *prefix*.\n\nstr.strip([chars])\n\n Return a copy of the string with the leading and trailing\n characters removed. The *chars* argument is a string specifying the\n set of characters to be removed. If omitted or ``None``, the\n *chars* argument defaults to removing whitespace. The *chars*\n argument is not a prefix or suffix; rather, all combinations of its\n values are stripped:\n\n >>> \' spacious \'.strip()\n \'spacious\'\n >>> \'www.example.com\'.strip(\'cmowz.\')\n \'example\'\n\n Changed in version 2.2.2: Support for the *chars* argument.\n\nstr.swapcase()\n\n Return a copy of the string with uppercase characters converted to\n lowercase and vice versa.\n\n For 8-bit strings, this method is locale-dependent.\n\nstr.title()\n\n Return a titlecased version of the string: words start with\n uppercase characters, all remaining cased characters are lowercase.\n\n For 8-bit strings, this method is locale-dependent.\n\nstr.translate(table[, deletechars])\n\n Return a copy of the string where all characters occurring in the\n optional argument *deletechars* are removed, and the remaining\n characters have been mapped through the given translation table,\n which must be a string of length 256.\n\n You can use the ``maketrans()`` helper function in the ``string``\n module to create a translation table. For string objects, set the\n *table* argument to ``None`` for translations that only delete\n characters:\n\n >>> \'read this short text\'.translate(None, \'aeiou\')\n \'rd ths shrt txt\'\n\n Added in version 2.6: Support for a ``None`` *table* argument.\n\n For Unicode objects, the ``translate()`` method does not accept the\n optional *deletechars* argument. Instead, it returns a copy of the\n *s* where all characters have been mapped through the given\n translation table which must be a mapping of Unicode ordinals to\n Unicode ordinals, Unicode strings or ``None``. Unmapped characters\n are left untouched. Characters mapped to ``None`` are deleted.\n Note, a more flexible approach is to create a custom character\n mapping codec using the ``codecs`` module (see ``encodings.cp1251``\n for an example).\n\nstr.upper()\n\n Return a copy of the string converted to uppercase.\n\n For 8-bit strings, this method is locale-dependent.\n\nstr.zfill(width)\n\n Return the numeric string left filled with zeros in a string of\n length *width*. A sign prefix is handled correctly. The original\n string is returned if *width* is less than ``len(s)``.\n\n Added in version 2.2.2.\n\nThe following methods are present only on unicode objects:\n\nunicode.isnumeric()\n\n Return ``True`` if there are only numeric characters in S,\n ``False`` otherwise. Numeric characters include digit characters,\n and all characters that have the Unicode numeric value property,\n e.g. U+2155, VULGAR FRACTION ONE FIFTH.\n\nunicode.isdecimal()\n\n Return ``True`` if there are only decimal characters in S,\n ``False`` otherwise. Decimal characters include digit characters,\n and all characters that that can be used to form decimal-radix\n numbers, e.g. U+0660, ARABIC-INDIC DIGIT ZERO.\n', - 'strings': u'\nString literals\n***************\n\nString literals are described by the following lexical definitions:\n\n stringliteral ::= [stringprefix](shortstring | longstring)\n stringprefix ::= "r" | "u" | "ur" | "R" | "U" | "UR" | "Ur" | "uR"\n shortstring ::= "\'" shortstringitem* "\'" | \'"\' shortstringitem* \'"\'\n longstring ::= ""\'" longstringitem* ""\'"\n | \'"""\' longstringitem* \'"""\'\n shortstringitem ::= shortstringchar | escapeseq\n longstringitem ::= longstringchar | escapeseq\n shortstringchar ::= \n longstringchar ::= \n escapeseq ::= "\\" \n\nOne syntactic restriction not indicated by these productions is that\nwhitespace is not allowed between the **stringprefix** and the rest of\nthe string literal. The source character set is defined by the\nencoding declaration; it is ASCII if no encoding declaration is given\nin the source file; see section *Encoding declarations*.\n\nIn plain English: String literals can be enclosed in matching single\nquotes (``\'``) or double quotes (``"``). They can also be enclosed in\nmatching groups of three single or double quotes (these are generally\nreferred to as *triple-quoted strings*). The backslash (``\\``)\ncharacter is used to escape characters that otherwise have a special\nmeaning, such as newline, backslash itself, or the quote character.\nString literals may optionally be prefixed with a letter ``\'r\'`` or\n``\'R\'``; such strings are called *raw strings* and use different rules\nfor interpreting backslash escape sequences. A prefix of ``\'u\'`` or\n``\'U\'`` makes the string a Unicode string. Unicode strings use the\nUnicode character set as defined by the Unicode Consortium and ISO\n10646. Some additional escape sequences, described below, are\navailable in Unicode strings. The two prefix characters may be\ncombined; in this case, ``\'u\'`` must appear before ``\'r\'``.\n\nIn triple-quoted strings, unescaped newlines and quotes are allowed\n(and are retained), except that three unescaped quotes in a row\nterminate the string. (A "quote" is the character used to open the\nstring, i.e. either ``\'`` or ``"``.)\n\nUnless an ``\'r\'`` or ``\'R\'`` prefix is present, escape sequences in\nstrings are interpreted according to rules similar to those used by\nStandard C. The recognized escape sequences are:\n\n+-------------------+-----------------------------------+---------+\n| Escape Sequence | Meaning | Notes |\n+===================+===================================+=========+\n| ``\\newline`` | Ignored | |\n+-------------------+-----------------------------------+---------+\n| ``\\\\`` | Backslash (``\\``) | |\n+-------------------+-----------------------------------+---------+\n| ``\\\'`` | Single quote (``\'``) | |\n+-------------------+-----------------------------------+---------+\n| ``\\"`` | Double quote (``"``) | |\n+-------------------+-----------------------------------+---------+\n| ``\\a`` | ASCII Bell (BEL) | |\n+-------------------+-----------------------------------+---------+\n| ``\\b`` | ASCII Backspace (BS) | |\n+-------------------+-----------------------------------+---------+\n| ``\\f`` | ASCII Formfeed (FF) | |\n+-------------------+-----------------------------------+---------+\n| ``\\n`` | ASCII Linefeed (LF) | |\n+-------------------+-----------------------------------+---------+\n| ``\\N{name}`` | Character named *name* in the | |\n| | Unicode database (Unicode only) | |\n+-------------------+-----------------------------------+---------+\n| ``\\r`` | ASCII Carriage Return (CR) | |\n+-------------------+-----------------------------------+---------+\n| ``\\t`` | ASCII Horizontal Tab (TAB) | |\n+-------------------+-----------------------------------+---------+\n| ``\\uxxxx`` | Character with 16-bit hex value | (1) |\n| | *xxxx* (Unicode only) | |\n+-------------------+-----------------------------------+---------+\n| ``\\Uxxxxxxxx`` | Character with 32-bit hex value | (2) |\n| | *xxxxxxxx* (Unicode only) | |\n+-------------------+-----------------------------------+---------+\n| ``\\v`` | ASCII Vertical Tab (VT) | |\n+-------------------+-----------------------------------+---------+\n| ``\\ooo`` | Character with octal value *ooo* | (3,5) |\n+-------------------+-----------------------------------+---------+\n| ``\\xhh`` | Character with hex value *hh* | (4,5) |\n+-------------------+-----------------------------------+---------+\n\nNotes:\n\n1. Individual code units which form parts of a surrogate pair can be\n encoded using this escape sequence.\n\n2. Any Unicode character can be encoded this way, but characters\n outside the Basic Multilingual Plane (BMP) will be encoded using a\n surrogate pair if Python is compiled to use 16-bit code units (the\n default). Individual code units which form parts of a surrogate\n pair can be encoded using this escape sequence.\n\n3. As in Standard C, up to three octal digits are accepted.\n\n4. Unlike in Standard C, exactly two hex digits are required.\n\n5. In a string literal, hexadecimal and octal escapes denote the byte\n with the given value; it is not necessary that the byte encodes a\n character in the source character set. In a Unicode literal, these\n escapes denote a Unicode character with the given value.\n\nUnlike Standard C, all unrecognized escape sequences are left in the\nstring unchanged, i.e., *the backslash is left in the string*. (This\nbehavior is useful when debugging: if an escape sequence is mistyped,\nthe resulting output is more easily recognized as broken.) It is also\nimportant to note that the escape sequences marked as "(Unicode only)"\nin the table above fall into the category of unrecognized escapes for\nnon-Unicode string literals.\n\nWhen an ``\'r\'`` or ``\'R\'`` prefix is present, a character following a\nbackslash is included in the string without change, and *all\nbackslashes are left in the string*. For example, the string literal\n``r"\\n"`` consists of two characters: a backslash and a lowercase\n``\'n\'``. String quotes can be escaped with a backslash, but the\nbackslash remains in the string; for example, ``r"\\""`` is a valid\nstring literal consisting of two characters: a backslash and a double\nquote; ``r"\\"`` is not a valid string literal (even a raw string\ncannot end in an odd number of backslashes). Specifically, *a raw\nstring cannot end in a single backslash* (since the backslash would\nescape the following quote character). Note also that a single\nbackslash followed by a newline is interpreted as those two characters\nas part of the string, *not* as a line continuation.\n\nWhen an ``\'r\'`` or ``\'R\'`` prefix is used in conjunction with a\n``\'u\'`` or ``\'U\'`` prefix, then the ``\\uXXXX`` and ``\\UXXXXXXXX``\nescape sequences are processed while *all other backslashes are left\nin the string*. For example, the string literal ``ur"\\u0062\\n"``\nconsists of three Unicode characters: \'LATIN SMALL LETTER B\', \'REVERSE\nSOLIDUS\', and \'LATIN SMALL LETTER N\'. Backslashes can be escaped with\na preceding backslash; however, both remain in the string. As a\nresult, ``\\uXXXX`` escape sequences are only recognized when there are\nan odd number of backslashes.\n', + 'string-methods': u'\nString Methods\n**************\n\nBelow are listed the string methods which both 8-bit strings and\nUnicode objects support. Note that none of these methods take keyword\narguments.\n\nIn addition, Python\'s strings support the sequence type methods\ndescribed in the *Sequence Types --- str, unicode, list, tuple,\nbuffer, xrange* section. To output formatted strings use template\nstrings or the ``%`` operator described in the *String Formatting\nOperations* section. Also, see the ``re`` module for string functions\nbased on regular expressions.\n\nstr.capitalize()\n\n Return a copy of the string with only its first character\n capitalized.\n\n For 8-bit strings, this method is locale-dependent.\n\nstr.center(width[, fillchar])\n\n Return centered in a string of length *width*. Padding is done\n using the specified *fillchar* (default is a space).\n\n Changed in version 2.4: Support for the *fillchar* argument.\n\nstr.count(sub[, start[, end]])\n\n Return the number of occurrences of substring *sub* in the range\n [*start*, *end*]. Optional arguments *start* and *end* are\n interpreted as in slice notation.\n\nstr.decode([encoding[, errors]])\n\n Decodes the string using the codec registered for *encoding*.\n *encoding* defaults to the default string encoding. *errors* may\n be given to set a different error handling scheme. The default is\n ``\'strict\'``, meaning that encoding errors raise ``UnicodeError``.\n Other possible values are ``\'ignore\'``, ``\'replace\'`` and any other\n name registered via ``codecs.register_error()``, see section *Codec\n Base Classes*.\n\n New in version 2.2.\n\n Changed in version 2.3: Support for other error handling schemes\n added.\n\nstr.encode([encoding[, errors]])\n\n Return an encoded version of the string. Default encoding is the\n current default string encoding. *errors* may be given to set a\n different error handling scheme. The default for *errors* is\n ``\'strict\'``, meaning that encoding errors raise a\n ``UnicodeError``. Other possible values are ``\'ignore\'``,\n ``\'replace\'``, ``\'xmlcharrefreplace\'``, ``\'backslashreplace\'`` and\n any other name registered via ``codecs.register_error()``, see\n section *Codec Base Classes*. For a list of possible encodings, see\n section *Standard Encodings*.\n\n New in version 2.0.\n\n Changed in version 2.3: Support for ``\'xmlcharrefreplace\'`` and\n ``\'backslashreplace\'`` and other error handling schemes added.\n\nstr.endswith(suffix[, start[, end]])\n\n Return ``True`` if the string ends with the specified *suffix*,\n otherwise return ``False``. *suffix* can also be a tuple of\n suffixes to look for. With optional *start*, test beginning at\n that position. With optional *end*, stop comparing at that\n position.\n\n Changed in version 2.5: Accept tuples as *suffix*.\n\nstr.expandtabs([tabsize])\n\n Return a copy of the string where all tab characters are replaced\n by one or more spaces, depending on the current column and the\n given tab size. The column number is reset to zero after each\n newline occurring in the string. If *tabsize* is not given, a tab\n size of ``8`` characters is assumed. This doesn\'t understand other\n non-printing characters or escape sequences.\n\nstr.find(sub[, start[, end]])\n\n Return the lowest index in the string where substring *sub* is\n found, such that *sub* is contained in the range [*start*, *end*].\n Optional arguments *start* and *end* are interpreted as in slice\n notation. Return ``-1`` if *sub* is not found.\n\nstr.format(format_string, *args, **kwargs)\n\n Perform a string formatting operation. The *format_string*\n argument can contain literal text or replacement fields delimited\n by braces ``{}``. Each replacement field contains either the\n numeric index of a positional argument, or the name of a keyword\n argument. Returns a copy of *format_string* where each replacement\n field is replaced with the string value of the corresponding\n argument.\n\n >>> "The sum of 1 + 2 is {0}".format(1+2)\n \'The sum of 1 + 2 is 3\'\n\n See *Format String Syntax* for a description of the various\n formatting options that can be specified in format strings.\n\n This method of string formatting is the new standard in Python 3.0,\n and should be preferred to the ``%`` formatting described in\n *String Formatting Operations* in new code.\n\n New in version 2.6.\n\nstr.index(sub[, start[, end]])\n\n Like ``find()``, but raise ``ValueError`` when the substring is not\n found.\n\nstr.isalnum()\n\n Return true if all characters in the string are alphanumeric and\n there is at least one character, false otherwise.\n\n For 8-bit strings, this method is locale-dependent.\n\nstr.isalpha()\n\n Return true if all characters in the string are alphabetic and\n there is at least one character, false otherwise.\n\n For 8-bit strings, this method is locale-dependent.\n\nstr.isdigit()\n\n Return true if all characters in the string are digits and there is\n at least one character, false otherwise.\n\n For 8-bit strings, this method is locale-dependent.\n\nstr.islower()\n\n Return true if all cased characters in the string are lowercase and\n there is at least one cased character, false otherwise.\n\n For 8-bit strings, this method is locale-dependent.\n\nstr.isspace()\n\n Return true if there are only whitespace characters in the string\n and there is at least one character, false otherwise.\n\n For 8-bit strings, this method is locale-dependent.\n\nstr.istitle()\n\n Return true if the string is a titlecased string and there is at\n least one character, for example uppercase characters may only\n follow uncased characters and lowercase characters only cased ones.\n Return false otherwise.\n\n For 8-bit strings, this method is locale-dependent.\n\nstr.isupper()\n\n Return true if all cased characters in the string are uppercase and\n there is at least one cased character, false otherwise.\n\n For 8-bit strings, this method is locale-dependent.\n\nstr.join(seq)\n\n Return a string which is the concatenation of the strings in the\n sequence *seq*. The separator between elements is the string\n providing this method.\n\nstr.ljust(width[, fillchar])\n\n Return the string left justified in a string of length *width*.\n Padding is done using the specified *fillchar* (default is a\n space). The original string is returned if *width* is less than\n ``len(s)``.\n\n Changed in version 2.4: Support for the *fillchar* argument.\n\nstr.lower()\n\n Return a copy of the string converted to lowercase.\n\n For 8-bit strings, this method is locale-dependent.\n\nstr.lstrip([chars])\n\n Return a copy of the string with leading characters removed. The\n *chars* argument is a string specifying the set of characters to be\n removed. If omitted or ``None``, the *chars* argument defaults to\n removing whitespace. The *chars* argument is not a prefix; rather,\n all combinations of its values are stripped:\n\n >>> \' spacious \'.lstrip()\n \'spacious \'\n >>> \'www.example.com\'.lstrip(\'cmowz.\')\n \'example.com\'\n\n Changed in version 2.2.2: Support for the *chars* argument.\n\nstr.partition(sep)\n\n Split the string at the first occurrence of *sep*, and return a\n 3-tuple containing the part before the separator, the separator\n itself, and the part after the separator. If the separator is not\n found, return a 3-tuple containing the string itself, followed by\n two empty strings.\n\n New in version 2.5.\n\nstr.replace(old, new[, count])\n\n Return a copy of the string with all occurrences of substring *old*\n replaced by *new*. If the optional argument *count* is given, only\n the first *count* occurrences are replaced.\n\nstr.rfind(sub[, start[, end]])\n\n Return the highest index in the string where substring *sub* is\n found, such that *sub* is contained within s[start,end]. Optional\n arguments *start* and *end* are interpreted as in slice notation.\n Return ``-1`` on failure.\n\nstr.rindex(sub[, start[, end]])\n\n Like ``rfind()`` but raises ``ValueError`` when the substring *sub*\n is not found.\n\nstr.rjust(width[, fillchar])\n\n Return the string right justified in a string of length *width*.\n Padding is done using the specified *fillchar* (default is a\n space). The original string is returned if *width* is less than\n ``len(s)``.\n\n Changed in version 2.4: Support for the *fillchar* argument.\n\nstr.rpartition(sep)\n\n Split the string at the last occurrence of *sep*, and return a\n 3-tuple containing the part before the separator, the separator\n itself, and the part after the separator. If the separator is not\n found, return a 3-tuple containing two empty strings, followed by\n the string itself.\n\n New in version 2.5.\n\nstr.rsplit([sep[, maxsplit]])\n\n Return a list of the words in the string, using *sep* as the\n delimiter string. If *maxsplit* is given, at most *maxsplit* splits\n are done, the *rightmost* ones. If *sep* is not specified or\n ``None``, any whitespace string is a separator. Except for\n splitting from the right, ``rsplit()`` behaves like ``split()``\n which is described in detail below.\n\n New in version 2.4.\n\nstr.rstrip([chars])\n\n Return a copy of the string with trailing characters removed. The\n *chars* argument is a string specifying the set of characters to be\n removed. If omitted or ``None``, the *chars* argument defaults to\n removing whitespace. The *chars* argument is not a suffix; rather,\n all combinations of its values are stripped:\n\n >>> \' spacious \'.rstrip()\n \' spacious\'\n >>> \'mississippi\'.rstrip(\'ipz\')\n \'mississ\'\n\n Changed in version 2.2.2: Support for the *chars* argument.\n\nstr.split([sep[, maxsplit]])\n\n Return a list of the words in the string, using *sep* as the\n delimiter string. If *maxsplit* is given, at most *maxsplit*\n splits are done (thus, the list will have at most ``maxsplit+1``\n elements). If *maxsplit* is not specified, then there is no limit\n on the number of splits (all possible splits are made).\n\n If *sep* is given, consecutive delimiters are not grouped together\n and are deemed to delimit empty strings (for example,\n ``\'1,,2\'.split(\',\')`` returns ``[\'1\', \'\', \'2\']``). The *sep*\n argument may consist of multiple characters (for example,\n ``\'1<>2<>3\'.split(\'<>\')`` returns ``[\'1\', \'2\', \'3\']``). Splitting\n an empty string with a specified separator returns ``[\'\']``.\n\n If *sep* is not specified or is ``None``, a different splitting\n algorithm is applied: runs of consecutive whitespace are regarded\n as a single separator, and the result will contain no empty strings\n at the start or end if the string has leading or trailing\n whitespace. Consequently, splitting an empty string or a string\n consisting of just whitespace with a ``None`` separator returns\n ``[]``.\n\n For example, ``\' 1 2 3 \'.split()`` returns ``[\'1\', \'2\', \'3\']``,\n and ``\' 1 2 3 \'.split(None, 1)`` returns ``[\'1\', \'2 3 \']``.\n\nstr.splitlines([keepends])\n\n Return a list of the lines in the string, breaking at line\n boundaries. Line breaks are not included in the resulting list\n unless *keepends* is given and true.\n\nstr.startswith(prefix[, start[, end]])\n\n Return ``True`` if string starts with the *prefix*, otherwise\n return ``False``. *prefix* can also be a tuple of prefixes to look\n for. With optional *start*, test string beginning at that\n position. With optional *end*, stop comparing string at that\n position.\n\n Changed in version 2.5: Accept tuples as *prefix*.\n\nstr.strip([chars])\n\n Return a copy of the string with the leading and trailing\n characters removed. The *chars* argument is a string specifying the\n set of characters to be removed. If omitted or ``None``, the\n *chars* argument defaults to removing whitespace. The *chars*\n argument is not a prefix or suffix; rather, all combinations of its\n values are stripped:\n\n >>> \' spacious \'.strip()\n \'spacious\'\n >>> \'www.example.com\'.strip(\'cmowz.\')\n \'example\'\n\n Changed in version 2.2.2: Support for the *chars* argument.\n\nstr.swapcase()\n\n Return a copy of the string with uppercase characters converted to\n lowercase and vice versa.\n\n For 8-bit strings, this method is locale-dependent.\n\nstr.title()\n\n Return a titlecased version of the string: words start with\n uppercase characters, all remaining cased characters are lowercase.\n\n For 8-bit strings, this method is locale-dependent.\n\nstr.translate(table[, deletechars])\n\n Return a copy of the string where all characters occurring in the\n optional argument *deletechars* are removed, and the remaining\n characters have been mapped through the given translation table,\n which must be a string of length 256.\n\n You can use the ``maketrans()`` helper function in the ``string``\n module to create a translation table. For string objects, set the\n *table* argument to ``None`` for translations that only delete\n characters:\n\n >>> \'read this short text\'.translate(None, \'aeiou\')\n \'rd ths shrt txt\'\n\n New in version 2.6: Support for a ``None`` *table* argument.\n\n For Unicode objects, the ``translate()`` method does not accept the\n optional *deletechars* argument. Instead, it returns a copy of the\n *s* where all characters have been mapped through the given\n translation table which must be a mapping of Unicode ordinals to\n Unicode ordinals, Unicode strings or ``None``. Unmapped characters\n are left untouched. Characters mapped to ``None`` are deleted.\n Note, a more flexible approach is to create a custom character\n mapping codec using the ``codecs`` module (see ``encodings.cp1251``\n for an example).\n\nstr.upper()\n\n Return a copy of the string converted to uppercase.\n\n For 8-bit strings, this method is locale-dependent.\n\nstr.zfill(width)\n\n Return the numeric string left filled with zeros in a string of\n length *width*. A sign prefix is handled correctly. The original\n string is returned if *width* is less than ``len(s)``.\n\n New in version 2.2.2.\n\nThe following methods are present only on unicode objects:\n\nunicode.isnumeric()\n\n Return ``True`` if there are only numeric characters in S,\n ``False`` otherwise. Numeric characters include digit characters,\n and all characters that have the Unicode numeric value property,\n e.g. U+2155, VULGAR FRACTION ONE FIFTH.\n\nunicode.isdecimal()\n\n Return ``True`` if there are only decimal characters in S,\n ``False`` otherwise. Decimal characters include digit characters,\n and all characters that that can be used to form decimal-radix\n numbers, e.g. U+0660, ARABIC-INDIC DIGIT ZERO.\n', + 'strings': u'\nString literals\n***************\n\nString literals are described by the following lexical definitions:\n\n stringliteral ::= [stringprefix](shortstring | longstring)\n stringprefix ::= "r" | "u" | "ur" | "R" | "U" | "UR" | "Ur" | "uR"\n shortstring ::= "\'" shortstringitem* "\'" | \'"\' shortstringitem* \'"\'\n longstring ::= "\'\'\'" longstringitem* "\'\'\'"\n | \'"""\' longstringitem* \'"""\'\n shortstringitem ::= shortstringchar | escapeseq\n longstringitem ::= longstringchar | escapeseq\n shortstringchar ::= \n longstringchar ::= \n escapeseq ::= "\\" \n\nOne syntactic restriction not indicated by these productions is that\nwhitespace is not allowed between the **stringprefix** and the rest of\nthe string literal. The source character set is defined by the\nencoding declaration; it is ASCII if no encoding declaration is given\nin the source file; see section *Encoding declarations*.\n\nIn plain English: String literals can be enclosed in matching single\nquotes (``\'``) or double quotes (``"``). They can also be enclosed in\nmatching groups of three single or double quotes (these are generally\nreferred to as *triple-quoted strings*). The backslash (``\\``)\ncharacter is used to escape characters that otherwise have a special\nmeaning, such as newline, backslash itself, or the quote character.\nString literals may optionally be prefixed with a letter ``\'r\'`` or\n``\'R\'``; such strings are called *raw strings* and use different rules\nfor interpreting backslash escape sequences. A prefix of ``\'u\'`` or\n``\'U\'`` makes the string a Unicode string. Unicode strings use the\nUnicode character set as defined by the Unicode Consortium and ISO\n10646. Some additional escape sequences, described below, are\navailable in Unicode strings. The two prefix characters may be\ncombined; in this case, ``\'u\'`` must appear before ``\'r\'``.\n\nIn triple-quoted strings, unescaped newlines and quotes are allowed\n(and are retained), except that three unescaped quotes in a row\nterminate the string. (A "quote" is the character used to open the\nstring, i.e. either ``\'`` or ``"``.)\n\nUnless an ``\'r\'`` or ``\'R\'`` prefix is present, escape sequences in\nstrings are interpreted according to rules similar to those used by\nStandard C. The recognized escape sequences are:\n\n+-------------------+-----------------------------------+---------+\n| Escape Sequence | Meaning | Notes |\n+===================+===================================+=========+\n| ``\\newline`` | Ignored | |\n+-------------------+-----------------------------------+---------+\n| ``\\\\`` | Backslash (``\\``) | |\n+-------------------+-----------------------------------+---------+\n| ``\\\'`` | Single quote (``\'``) | |\n+-------------------+-----------------------------------+---------+\n| ``\\"`` | Double quote (``"``) | |\n+-------------------+-----------------------------------+---------+\n| ``\\a`` | ASCII Bell (BEL) | |\n+-------------------+-----------------------------------+---------+\n| ``\\b`` | ASCII Backspace (BS) | |\n+-------------------+-----------------------------------+---------+\n| ``\\f`` | ASCII Formfeed (FF) | |\n+-------------------+-----------------------------------+---------+\n| ``\\n`` | ASCII Linefeed (LF) | |\n+-------------------+-----------------------------------+---------+\n| ``\\N{name}`` | Character named *name* in the | |\n| | Unicode database (Unicode only) | |\n+-------------------+-----------------------------------+---------+\n| ``\\r`` | ASCII Carriage Return (CR) | |\n+-------------------+-----------------------------------+---------+\n| ``\\t`` | ASCII Horizontal Tab (TAB) | |\n+-------------------+-----------------------------------+---------+\n| ``\\uxxxx`` | Character with 16-bit hex value | (1) |\n| | *xxxx* (Unicode only) | |\n+-------------------+-----------------------------------+---------+\n| ``\\Uxxxxxxxx`` | Character with 32-bit hex value | (2) |\n| | *xxxxxxxx* (Unicode only) | |\n+-------------------+-----------------------------------+---------+\n| ``\\v`` | ASCII Vertical Tab (VT) | |\n+-------------------+-----------------------------------+---------+\n| ``\\ooo`` | Character with octal value *ooo* | (3,5) |\n+-------------------+-----------------------------------+---------+\n| ``\\xhh`` | Character with hex value *hh* | (4,5) |\n+-------------------+-----------------------------------+---------+\n\nNotes:\n\n1. Individual code units which form parts of a surrogate pair can be\n encoded using this escape sequence.\n\n2. Any Unicode character can be encoded this way, but characters\n outside the Basic Multilingual Plane (BMP) will be encoded using a\n surrogate pair if Python is compiled to use 16-bit code units (the\n default). Individual code units which form parts of a surrogate\n pair can be encoded using this escape sequence.\n\n3. As in Standard C, up to three octal digits are accepted.\n\n4. Unlike in Standard C, exactly two hex digits are required.\n\n5. In a string literal, hexadecimal and octal escapes denote the byte\n with the given value; it is not necessary that the byte encodes a\n character in the source character set. In a Unicode literal, these\n escapes denote a Unicode character with the given value.\n\nUnlike Standard C, all unrecognized escape sequences are left in the\nstring unchanged, i.e., *the backslash is left in the string*. (This\nbehavior is useful when debugging: if an escape sequence is mistyped,\nthe resulting output is more easily recognized as broken.) It is also\nimportant to note that the escape sequences marked as "(Unicode only)"\nin the table above fall into the category of unrecognized escapes for\nnon-Unicode string literals.\n\nWhen an ``\'r\'`` or ``\'R\'`` prefix is present, a character following a\nbackslash is included in the string without change, and *all\nbackslashes are left in the string*. For example, the string literal\n``r"\\n"`` consists of two characters: a backslash and a lowercase\n``\'n\'``. String quotes can be escaped with a backslash, but the\nbackslash remains in the string; for example, ``r"\\""`` is a valid\nstring literal consisting of two characters: a backslash and a double\nquote; ``r"\\"`` is not a valid string literal (even a raw string\ncannot end in an odd number of backslashes). Specifically, *a raw\nstring cannot end in a single backslash* (since the backslash would\nescape the following quote character). Note also that a single\nbackslash followed by a newline is interpreted as those two characters\nas part of the string, *not* as a line continuation.\n\nWhen an ``\'r\'`` or ``\'R\'`` prefix is used in conjunction with a\n``\'u\'`` or ``\'U\'`` prefix, then the ``\\uXXXX`` and ``\\UXXXXXXXX``\nescape sequences are processed while *all other backslashes are left\nin the string*. For example, the string literal ``ur"\\u0062\\n"``\nconsists of three Unicode characters: \'LATIN SMALL LETTER B\', \'REVERSE\nSOLIDUS\', and \'LATIN SMALL LETTER N\'. Backslashes can be escaped with\na preceding backslash; however, both remain in the string. As a\nresult, ``\\uXXXX`` escape sequences are only recognized when there are\nan odd number of backslashes.\n', 'subscriptions': u'\nSubscriptions\n*************\n\nA subscription selects an item of a sequence (string, tuple or list)\nor mapping (dictionary) object:\n\n subscription ::= primary "[" expression_list "]"\n\nThe primary must evaluate to an object of a sequence or mapping type.\n\nIf the primary is a mapping, the expression list must evaluate to an\nobject whose value is one of the keys of the mapping, and the\nsubscription selects the value in the mapping that corresponds to that\nkey. (The expression list is a tuple except if it has exactly one\nitem.)\n\nIf the primary is a sequence, the expression (list) must evaluate to a\nplain integer. If this value is negative, the length of the sequence\nis added to it (so that, e.g., ``x[-1]`` selects the last item of\n``x``.) The resulting value must be a nonnegative integer less than\nthe number of items in the sequence, and the subscription selects the\nitem whose index is that value (counting from zero).\n\nA string\'s items are characters. A character is not a separate data\ntype but a string of exactly one character.\n', 'truth': u"\nTruth Value Testing\n*******************\n\nAny object can be tested for truth value, for use in an ``if`` or\n``while`` condition or as operand of the Boolean operations below. The\nfollowing values are considered false:\n\n* ``None``\n\n* ``False``\n\n* zero of any numeric type, for example, ``0``, ``0L``, ``0.0``,\n ``0j``.\n\n* any empty sequence, for example, ``''``, ``()``, ``[]``.\n\n* any empty mapping, for example, ``{}``.\n\n* instances of user-defined classes, if the class defines a\n ``__nonzero__()`` or ``__len__()`` method, when that method returns\n the integer zero or ``bool`` value ``False``. [1]\n\nAll other values are considered true --- so objects of many types are\nalways true.\n\nOperations and built-in functions that have a Boolean result always\nreturn ``0`` or ``False`` for false and ``1`` or ``True`` for true,\nunless otherwise stated. (Important exception: the Boolean operations\n``or`` and ``and`` always return one of their operands.)\n", 'try': u'\nThe ``try`` statement\n*********************\n\nThe ``try`` statement specifies exception handlers and/or cleanup code\nfor a group of statements:\n\n try_stmt ::= try1_stmt | try2_stmt\n try1_stmt ::= "try" ":" suite\n ("except" [expression ["," target]] ":" suite)+\n ["else" ":" suite]\n ["finally" ":" suite]\n try2_stmt ::= "try" ":" suite\n "finally" ":" suite\n\nChanged in version 2.5: In previous versions of Python,\n``try``...``except``...``finally`` did not work. ``try``...``except``\nhad to be nested in ``try``...``finally``.\n\nThe ``except`` clause(s) specify one or more exception handlers. When\nno exception occurs in the ``try`` clause, no exception handler is\nexecuted. When an exception occurs in the ``try`` suite, a search for\nan exception handler is started. This search inspects the except\nclauses in turn until one is found that matches the exception. An\nexpression-less except clause, if present, must be last; it matches\nany exception. For an except clause with an expression, that\nexpression is evaluated, and the clause matches the exception if the\nresulting object is "compatible" with the exception. An object is\ncompatible with an exception if it is the class or a base class of the\nexception object, a tuple containing an item compatible with the\nexception, or, in the (deprecated) case of string exceptions, is the\nraised string itself (note that the object identities must match, i.e.\nit must be the same string object, not just a string with the same\nvalue).\n\nIf no except clause matches the exception, the search for an exception\nhandler continues in the surrounding code and on the invocation stack.\n[1]\n\nIf the evaluation of an expression in the header of an except clause\nraises an exception, the original search for a handler is canceled and\na search starts for the new exception in the surrounding code and on\nthe call stack (it is treated as if the entire ``try`` statement\nraised the exception).\n\nWhen a matching except clause is found, the exception is assigned to\nthe target specified in that except clause, if present, and the except\nclause\'s suite is executed. All except clauses must have an\nexecutable block. When the end of this block is reached, execution\ncontinues normally after the entire try statement. (This means that\nif two nested handlers exist for the same exception, and the exception\noccurs in the try clause of the inner handler, the outer handler will\nnot handle the exception.)\n\nBefore an except clause\'s suite is executed, details about the\nexception are assigned to three variables in the ``sys`` module:\n``sys.exc_type`` receives the object identifying the exception;\n``sys.exc_value`` receives the exception\'s parameter;\n``sys.exc_traceback`` receives a traceback object (see section *The\nstandard type hierarchy*) identifying the point in the program where\nthe exception occurred. These details are also available through the\n``sys.exc_info()`` function, which returns a tuple ``(exc_type,\nexc_value, exc_traceback)``. Use of the corresponding variables is\ndeprecated in favor of this function, since their use is unsafe in a\nthreaded program. As of Python 1.5, the variables are restored to\ntheir previous values (before the call) when returning from a function\nthat handled an exception.\n\nThe optional ``else`` clause is executed if and when control flows off\nthe end of the ``try`` clause. [2] Exceptions in the ``else`` clause\nare not handled by the preceding ``except`` clauses.\n\nIf ``finally`` is present, it specifies a \'cleanup\' handler. The\n``try`` clause is executed, including any ``except`` and ``else``\nclauses. If an exception occurs in any of the clauses and is not\nhandled, the exception is temporarily saved. The ``finally`` clause is\nexecuted. If there is a saved exception, it is re-raised at the end\nof the ``finally`` clause. If the ``finally`` clause raises another\nexception or executes a ``return`` or ``break`` statement, the saved\nexception is lost. The exception information is not available to the\nprogram during execution of the ``finally`` clause.\n\nWhen a ``return``, ``break`` or ``continue`` statement is executed in\nthe ``try`` suite of a ``try``...``finally`` statement, the\n``finally`` clause is also executed \'on the way out.\' A ``continue``\nstatement is illegal in the ``finally`` clause. (The reason is a\nproblem with the current implementation --- this restriction may be\nlifted in the future).\n\nAdditional information on exceptions can be found in section\n*Exceptions*, and information on using the ``raise`` statement to\ngenerate exceptions may be found in section *The raise statement*.\n', - 'types': u'\nThe standard type hierarchy\n***************************\n\nBelow is a list of the types that are built into Python. Extension\nmodules (written in C, Java, or other languages, depending on the\nimplementation) can define additional types. Future versions of\nPython may add types to the type hierarchy (e.g., rational numbers,\nefficiently stored arrays of integers, etc.).\n\nSome of the type descriptions below contain a paragraph listing\n\'special attributes.\' These are attributes that provide access to the\nimplementation and are not intended for general use. Their definition\nmay change in the future.\n\nNone\n This type has a single value. There is a single object with this\n value. This object is accessed through the built-in name ``None``.\n It is used to signify the absence of a value in many situations,\n e.g., it is returned from functions that don\'t explicitly return\n anything. Its truth value is false.\n\nNotImplemented\n This type has a single value. There is a single object with this\n value. This object is accessed through the built-in name\n ``NotImplemented``. Numeric methods and rich comparison methods may\n return this value if they do not implement the operation for the\n operands provided. (The interpreter will then try the reflected\n operation, or some other fallback, depending on the operator.) Its\n truth value is true.\n\nEllipsis\n This type has a single value. There is a single object with this\n value. This object is accessed through the built-in name\n ``Ellipsis``. It is used to indicate the presence of the ``...``\n syntax in a slice. Its truth value is true.\n\n``numbers.Number``\n These are created by numeric literals and returned as results by\n arithmetic operators and arithmetic built-in functions. Numeric\n objects are immutable; once created their value never changes.\n Python numbers are of course strongly related to mathematical\n numbers, but subject to the limitations of numerical representation\n in computers.\n\n Python distinguishes between integers, floating point numbers, and\n complex numbers:\n\n ``numbers.Integral``\n These represent elements from the mathematical set of integers\n (positive and negative).\n\n There are three types of integers:\n\n Plain integers\n These represent numbers in the range -2147483648 through\n 2147483647. (The range may be larger on machines with a\n larger natural word size, but not smaller.) When the result\n of an operation would fall outside this range, the result is\n normally returned as a long integer (in some cases, the\n exception ``OverflowError`` is raised instead). For the\n purpose of shift and mask operations, integers are assumed to\n have a binary, 2\'s complement notation using 32 or more bits,\n and hiding no bits from the user (i.e., all 4294967296\n different bit patterns correspond to different values).\n\n Long integers\n These represent numbers in an unlimited range, subject to\n available (virtual) memory only. For the purpose of shift\n and mask operations, a binary representation is assumed, and\n negative numbers are represented in a variant of 2\'s\n complement which gives the illusion of an infinite string of\n sign bits extending to the left.\n\n Booleans\n These represent the truth values False and True. The two\n objects representing the values False and True are the only\n Boolean objects. The Boolean type is a subtype of plain\n integers, and Boolean values behave like the values 0 and 1,\n respectively, in almost all contexts, the exception being\n that when converted to a string, the strings ``"False"`` or\n ``"True"`` are returned, respectively.\n\n The rules for integer representation are intended to give the\n most meaningful interpretation of shift and mask operations\n involving negative integers and the least surprises when\n switching between the plain and long integer domains. Any\n operation, if it yields a result in the plain integer domain,\n will yield the same result in the long integer domain or when\n using mixed operands. The switch between domains is transparent\n to the programmer.\n\n ``numbers.Real`` (``float``)\n These represent machine-level double precision floating point\n numbers. You are at the mercy of the underlying machine\n architecture (and C or Java implementation) for the accepted\n range and handling of overflow. Python does not support single-\n precision floating point numbers; the savings in processor and\n memory usage that are usually the reason for using these is\n dwarfed by the overhead of using objects in Python, so there is\n no reason to complicate the language with two kinds of floating\n point numbers.\n\n ``numbers.Complex``\n These represent complex numbers as a pair of machine-level\n double precision floating point numbers. The same caveats apply\n as for floating point numbers. The real and imaginary parts of a\n complex number ``z`` can be retrieved through the read-only\n attributes ``z.real`` and ``z.imag``.\n\nSequences\n These represent finite ordered sets indexed by non-negative\n numbers. The built-in function ``len()`` returns the number of\n items of a sequence. When the length of a sequence is *n*, the\n index set contains the numbers 0, 1, ..., *n*-1. Item *i* of\n sequence *a* is selected by ``a[i]``.\n\n Sequences also support slicing: ``a[i:j]`` selects all items with\n index *k* such that *i* ``<=`` *k* ``<`` *j*. When used as an\n expression, a slice is a sequence of the same type. This implies\n that the index set is renumbered so that it starts at 0.\n\n Some sequences also support "extended slicing" with a third "step"\n parameter: ``a[i:j:k]`` selects all items of *a* with index *x*\n where ``x = i + n*k``, *n* ``>=`` ``0`` and *i* ``<=`` *x* ``<``\n *j*.\n\n Sequences are distinguished according to their mutability:\n\n Immutable sequences\n An object of an immutable sequence type cannot change once it is\n created. (If the object contains references to other objects,\n these other objects may be mutable and may be changed; however,\n the collection of objects directly referenced by an immutable\n object cannot change.)\n\n The following types are immutable sequences:\n\n Strings\n The items of a string are characters. There is no separate\n character type; a character is represented by a string of one\n item. Characters represent (at least) 8-bit bytes. The\n built-in functions ``chr()`` and ``ord()`` convert between\n characters and nonnegative integers representing the byte\n values. Bytes with the values 0-127 usually represent the\n corresponding ASCII values, but the interpretation of values\n is up to the program. The string data type is also used to\n represent arrays of bytes, e.g., to hold data read from a\n file.\n\n (On systems whose native character set is not ASCII, strings\n may use EBCDIC in their internal representation, provided the\n functions ``chr()`` and ``ord()`` implement a mapping between\n ASCII and EBCDIC, and string comparison preserves the ASCII\n order. Or perhaps someone can propose a better rule?)\n\n Unicode\n The items of a Unicode object are Unicode code units. A\n Unicode code unit is represented by a Unicode object of one\n item and can hold either a 16-bit or 32-bit value\n representing a Unicode ordinal (the maximum value for the\n ordinal is given in ``sys.maxunicode``, and depends on how\n Python is configured at compile time). Surrogate pairs may\n be present in the Unicode object, and will be reported as two\n separate items. The built-in functions ``unichr()`` and\n ``ord()`` convert between code units and nonnegative integers\n representing the Unicode ordinals as defined in the Unicode\n Standard 3.0. Conversion from and to other encodings are\n possible through the Unicode method ``encode()`` and the\n built-in function ``unicode()``.\n\n Tuples\n The items of a tuple are arbitrary Python objects. Tuples of\n two or more items are formed by comma-separated lists of\n expressions. A tuple of one item (a \'singleton\') can be\n formed by affixing a comma to an expression (an expression by\n itself does not create a tuple, since parentheses must be\n usable for grouping of expressions). An empty tuple can be\n formed by an empty pair of parentheses.\n\n Mutable sequences\n Mutable sequences can be changed after they are created. The\n subscription and slicing notations can be used as the target of\n assignment and ``del`` (delete) statements.\n\n There is currently a single intrinsic mutable sequence type:\n\n Lists\n The items of a list are arbitrary Python objects. Lists are\n formed by placing a comma-separated list of expressions in\n square brackets. (Note that there are no special cases needed\n to form lists of length 0 or 1.)\n\n The extension module ``array`` provides an additional example of\n a mutable sequence type.\n\nSet types\n These represent unordered, finite sets of unique, immutable\n objects. As such, they cannot be indexed by any subscript. However,\n they can be iterated over, and the built-in function ``len()``\n returns the number of items in a set. Common uses for sets are fast\n membership testing, removing duplicates from a sequence, and\n computing mathematical operations such as intersection, union,\n difference, and symmetric difference.\n\n For set elements, the same immutability rules apply as for\n dictionary keys. Note that numeric types obey the normal rules for\n numeric comparison: if two numbers compare equal (e.g., ``1`` and\n ``1.0``), only one of them can be contained in a set.\n\n There are currently two intrinsic set types:\n\n Sets\n These represent a mutable set. They are created by the built-in\n ``set()`` constructor and can be modified afterwards by several\n methods, such as ``add()``.\n\n Frozen sets\n These represent an immutable set. They are created by the\n built-in ``frozenset()`` constructor. As a frozenset is\n immutable and *hashable*, it can be used again as an element of\n another set, or as a dictionary key.\n\nMappings\n These represent finite sets of objects indexed by arbitrary index\n sets. The subscript notation ``a[k]`` selects the item indexed by\n ``k`` from the mapping ``a``; this can be used in expressions and\n as the target of assignments or ``del`` statements. The built-in\n function ``len()`` returns the number of items in a mapping.\n\n There is currently a single intrinsic mapping type:\n\n Dictionaries\n These represent finite sets of objects indexed by nearly\n arbitrary values. The only types of values not acceptable as\n keys are values containing lists or dictionaries or other\n mutable types that are compared by value rather than by object\n identity, the reason being that the efficient implementation of\n dictionaries requires a key\'s hash value to remain constant.\n Numeric types used for keys obey the normal rules for numeric\n comparison: if two numbers compare equal (e.g., ``1`` and\n ``1.0``) then they can be used interchangeably to index the same\n dictionary entry.\n\n Dictionaries are mutable; they can be created by the ``{...}``\n notation (see section *Dictionary displays*).\n\n The extension modules ``dbm``, ``gdbm``, and ``bsddb`` provide\n additional examples of mapping types.\n\nCallable types\n These are the types to which the function call operation (see\n section *Calls*) can be applied:\n\n User-defined functions\n A user-defined function object is created by a function\n definition (see section *Function definitions*). It should be\n called with an argument list containing the same number of items\n as the function\'s formal parameter list.\n\n Special attributes:\n\n +-------------------------+---------------------------------+-------------+\n | Attribute | Meaning | |\n +=========================+=================================+=============+\n | ``func_doc`` | The function\'s documentation | Writable |\n | | string, or ``None`` if | |\n | | unavailable | |\n +-------------------------+---------------------------------+-------------+\n | ``__doc__`` | Another way of spelling | Writable |\n | | ``func_doc`` | |\n +-------------------------+---------------------------------+-------------+\n | ``func_name`` | The function\'s name | Writable |\n +-------------------------+---------------------------------+-------------+\n | ``__name__`` | Another way of spelling | Writable |\n | | ``func_name`` | |\n +-------------------------+---------------------------------+-------------+\n | ``__module__`` | The name of the module the | Writable |\n | | function was defined in, or | |\n | | ``None`` if unavailable. | |\n +-------------------------+---------------------------------+-------------+\n | ``func_defaults`` | A tuple containing default | Writable |\n | | argument values for those | |\n | | arguments that have defaults, | |\n | | or ``None`` if no arguments | |\n | | have a default value | |\n +-------------------------+---------------------------------+-------------+\n | ``func_code`` | The code object representing | Writable |\n | | the compiled function body. | |\n +-------------------------+---------------------------------+-------------+\n | ``func_globals`` | A reference to the dictionary | Read-only |\n | | that holds the function\'s | |\n | | global variables --- the global | |\n | | namespace of the module in | |\n | | which the function was defined. | |\n +-------------------------+---------------------------------+-------------+\n | ``func_dict`` | The namespace supporting | Writable |\n | | arbitrary function attributes. | |\n +-------------------------+---------------------------------+-------------+\n | ``func_closure`` | ``None`` or a tuple of cells | Read-only |\n | | that contain bindings for the | |\n | | function\'s free variables. | |\n +-------------------------+---------------------------------+-------------+\n\n Most of the attributes labelled "Writable" check the type of the\n assigned value.\n\n Changed in version 2.4: ``func_name`` is now writable.\n\n Function objects also support getting and setting arbitrary\n attributes, which can be used, for example, to attach metadata\n to functions. Regular attribute dot-notation is used to get and\n set such attributes. *Note that the current implementation only\n supports function attributes on user-defined functions. Function\n attributes on built-in functions may be supported in the\n future.*\n\n Additional information about a function\'s definition can be\n retrieved from its code object; see the description of internal\n types below.\n\n User-defined methods\n A user-defined method object combines a class, a class instance\n (or ``None``) and any callable object (normally a user-defined\n function).\n\n Special read-only attributes: ``im_self`` is the class instance\n object, ``im_func`` is the function object; ``im_class`` is the\n class of ``im_self`` for bound methods or the class that asked\n for the method for unbound methods; ``__doc__`` is the method\'s\n documentation (same as ``im_func.__doc__``); ``__name__`` is the\n method name (same as ``im_func.__name__``); ``__module__`` is\n the name of the module the method was defined in, or ``None`` if\n unavailable.\n\n Changed in version 2.2: ``im_self`` used to refer to the class\n that defined the method.\n\n Changed in version 2.6: For 3.0 forward-compatibility,\n ``im_func`` is also available as ``__func__``, and ``im_self``\n as ``__self__``.\n\n Methods also support accessing (but not setting) the arbitrary\n function attributes on the underlying function object.\n\n User-defined method objects may be created when getting an\n attribute of a class (perhaps via an instance of that class), if\n that attribute is a user-defined function object, an unbound\n user-defined method object, or a class method object. When the\n attribute is a user-defined method object, a new method object\n is only created if the class from which it is being retrieved is\n the same as, or a derived class of, the class stored in the\n original method object; otherwise, the original method object is\n used as it is.\n\n When a user-defined method object is created by retrieving a\n user-defined function object from a class, its ``im_self``\n attribute is ``None`` and the method object is said to be\n unbound. When one is created by retrieving a user-defined\n function object from a class via one of its instances, its\n ``im_self`` attribute is the instance, and the method object is\n said to be bound. In either case, the new method\'s ``im_class``\n attribute is the class from which the retrieval takes place, and\n its ``im_func`` attribute is the original function object.\n\n When a user-defined method object is created by retrieving\n another method object from a class or instance, the behaviour is\n the same as for a function object, except that the ``im_func``\n attribute of the new instance is not the original method object\n but its ``im_func`` attribute.\n\n When a user-defined method object is created by retrieving a\n class method object from a class or instance, its ``im_self``\n attribute is the class itself (the same as the ``im_class``\n attribute), and its ``im_func`` attribute is the function object\n underlying the class method.\n\n When an unbound user-defined method object is called, the\n underlying function (``im_func``) is called, with the\n restriction that the first argument must be an instance of the\n proper class (``im_class``) or of a derived class thereof.\n\n When a bound user-defined method object is called, the\n underlying function (``im_func``) is called, inserting the class\n instance (``im_self``) in front of the argument list. For\n instance, when ``C`` is a class which contains a definition for\n a function ``f()``, and ``x`` is an instance of ``C``, calling\n ``x.f(1)`` is equivalent to calling ``C.f(x, 1)``.\n\n When a user-defined method object is derived from a class method\n object, the "class instance" stored in ``im_self`` will actually\n be the class itself, so that calling either ``x.f(1)`` or\n ``C.f(1)`` is equivalent to calling ``f(C,1)`` where ``f`` is\n the underlying function.\n\n Note that the transformation from function object to (unbound or\n bound) method object happens each time the attribute is\n retrieved from the class or instance. In some cases, a fruitful\n optimization is to assign the attribute to a local variable and\n call that local variable. Also notice that this transformation\n only happens for user-defined functions; other callable objects\n (and all non-callable objects) are retrieved without\n transformation. It is also important to note that user-defined\n functions which are attributes of a class instance are not\n converted to bound methods; this *only* happens when the\n function is an attribute of the class.\n\n Generator functions\n A function or method which uses the ``yield`` statement (see\n section *The yield statement*) is called a *generator function*.\n Such a function, when called, always returns an iterator object\n which can be used to execute the body of the function: calling\n the iterator\'s ``next()`` method will cause the function to\n execute until it provides a value using the ``yield`` statement.\n When the function executes a ``return`` statement or falls off\n the end, a ``StopIteration`` exception is raised and the\n iterator will have reached the end of the set of values to be\n returned.\n\n Built-in functions\n A built-in function object is a wrapper around a C function.\n Examples of built-in functions are ``len()`` and ``math.sin()``\n (``math`` is a standard built-in module). The number and type of\n the arguments are determined by the C function. Special read-\n only attributes: ``__doc__`` is the function\'s documentation\n string, or ``None`` if unavailable; ``__name__`` is the\n function\'s name; ``__self__`` is set to ``None`` (but see the\n next item); ``__module__`` is the name of the module the\n function was defined in or ``None`` if unavailable.\n\n Built-in methods\n This is really a different disguise of a built-in function, this\n time containing an object passed to the C function as an\n implicit extra argument. An example of a built-in method is\n ``alist.append()``, assuming *alist* is a list object. In this\n case, the special read-only attribute ``__self__`` is set to the\n object denoted by *list*.\n\n Class Types\n Class types, or "new-style classes," are callable. These\n objects normally act as factories for new instances of\n themselves, but variations are possible for class types that\n override ``__new__()``. The arguments of the call are passed to\n ``__new__()`` and, in the typical case, to ``__init__()`` to\n initialize the new instance.\n\n Classic Classes\n Class objects are described below. When a class object is\n called, a new class instance (also described below) is created\n and returned. This implies a call to the class\'s ``__init__()``\n method if it has one. Any arguments are passed on to the\n ``__init__()`` method. If there is no ``__init__()`` method,\n the class must be called without arguments.\n\n Class instances\n Class instances are described below. Class instances are\n callable only when the class has a ``__call__()`` method;\n ``x(arguments)`` is a shorthand for ``x.__call__(arguments)``.\n\nModules\n Modules are imported by the ``import`` statement (see section *The\n import statement*). A module object has a namespace implemented by\n a dictionary object (this is the dictionary referenced by the\n func_globals attribute of functions defined in the module).\n Attribute references are translated to lookups in this dictionary,\n e.g., ``m.x`` is equivalent to ``m.__dict__["x"]``. A module object\n does not contain the code object used to initialize the module\n (since it isn\'t needed once the initialization is done).\n\n Attribute assignment updates the module\'s namespace dictionary,\n e.g., ``m.x = 1`` is equivalent to ``m.__dict__["x"] = 1``.\n\n Special read-only attribute: ``__dict__`` is the module\'s namespace\n as a dictionary object.\n\n Predefined (writable) attributes: ``__name__`` is the module\'s\n name; ``__doc__`` is the module\'s documentation string, or ``None``\n if unavailable; ``__file__`` is the pathname of the file from which\n the module was loaded, if it was loaded from a file. The\n ``__file__`` attribute is not present for C modules that are\n statically linked into the interpreter; for extension modules\n loaded dynamically from a shared library, it is the pathname of the\n shared library file.\n\nClasses\n Class objects are created by class definitions (see section *Class\n definitions*). A class has a namespace implemented by a dictionary\n object. Class attribute references are translated to lookups in\n this dictionary, e.g., ``C.x`` is translated to\n ``C.__dict__["x"]``. When the attribute name is not found there,\n the attribute search continues in the base classes. The search is\n depth-first, left-to-right in the order of occurrence in the base\n class list.\n\n When a class attribute reference (for class ``C``, say) would yield\n a user-defined function object or an unbound user-defined method\n object whose associated class is either ``C`` or one of its base\n classes, it is transformed into an unbound user-defined method\n object whose ``im_class`` attribute is ``C``. When it would yield a\n class method object, it is transformed into a bound user-defined\n method object whose ``im_class`` and ``im_self`` attributes are\n both ``C``. When it would yield a static method object, it is\n transformed into the object wrapped by the static method object.\n See section *Implementing Descriptors* for another way in which\n attributes retrieved from a class may differ from those actually\n contained in its ``__dict__``.\n\n Class attribute assignments update the class\'s dictionary, never\n the dictionary of a base class.\n\n A class object can be called (see above) to yield a class instance\n (see below).\n\n Special attributes: ``__name__`` is the class name; ``__module__``\n is the module name in which the class was defined; ``__dict__`` is\n the dictionary containing the class\'s namespace; ``__bases__`` is a\n tuple (possibly empty or a singleton) containing the base classes,\n in the order of their occurrence in the base class list;\n ``__doc__`` is the class\'s documentation string, or None if\n undefined.\n\nClass instances\n A class instance is created by calling a class object (see above).\n A class instance has a namespace implemented as a dictionary which\n is the first place in which attribute references are searched.\n When an attribute is not found there, and the instance\'s class has\n an attribute by that name, the search continues with the class\n attributes. If a class attribute is found that is a user-defined\n function object or an unbound user-defined method object whose\n associated class is the class (call it ``C``) of the instance for\n which the attribute reference was initiated or one of its bases, it\n is transformed into a bound user-defined method object whose\n ``im_class`` attribute is ``C`` and whose ``im_self`` attribute is\n the instance. Static method and class method objects are also\n transformed, as if they had been retrieved from class ``C``; see\n above under "Classes". See section *Implementing Descriptors* for\n another way in which attributes of a class retrieved via its\n instances may differ from the objects actually stored in the\n class\'s ``__dict__``. If no class attribute is found, and the\n object\'s class has a ``__getattr__()`` method, that is called to\n satisfy the lookup.\n\n Attribute assignments and deletions update the instance\'s\n dictionary, never a class\'s dictionary. If the class has a\n ``__setattr__()`` or ``__delattr__()`` method, this is called\n instead of updating the instance dictionary directly.\n\n Class instances can pretend to be numbers, sequences, or mappings\n if they have methods with certain special names. See section\n *Special method names*.\n\n Special attributes: ``__dict__`` is the attribute dictionary;\n ``__class__`` is the instance\'s class.\n\nFiles\n A file object represents an open file. File objects are created by\n the ``open()`` built-in function, and also by ``os.popen()``,\n ``os.fdopen()``, and the ``makefile()`` method of socket objects\n (and perhaps by other functions or methods provided by extension\n modules). The objects ``sys.stdin``, ``sys.stdout`` and\n ``sys.stderr`` are initialized to file objects corresponding to the\n interpreter\'s standard input, output and error streams. See *File\n Objects* for complete documentation of file objects.\n\nInternal types\n A few types used internally by the interpreter are exposed to the\n user. Their definitions may change with future versions of the\n interpreter, but they are mentioned here for completeness.\n\n Code objects\n Code objects represent *byte-compiled* executable Python code,\n or *bytecode*. The difference between a code object and a\n function object is that the function object contains an explicit\n reference to the function\'s globals (the module in which it was\n defined), while a code object contains no context; also the\n default argument values are stored in the function object, not\n in the code object (because they represent values calculated at\n run-time). Unlike function objects, code objects are immutable\n and contain no references (directly or indirectly) to mutable\n objects.\n\n Special read-only attributes: ``co_name`` gives the function\n name; ``co_argcount`` is the number of positional arguments\n (including arguments with default values); ``co_nlocals`` is the\n number of local variables used by the function (including\n arguments); ``co_varnames`` is a tuple containing the names of\n the local variables (starting with the argument names);\n ``co_cellvars`` is a tuple containing the names of local\n variables that are referenced by nested functions;\n ``co_freevars`` is a tuple containing the names of free\n variables; ``co_code`` is a string representing the sequence of\n bytecode instructions; ``co_consts`` is a tuple containing the\n literals used by the bytecode; ``co_names`` is a tuple\n containing the names used by the bytecode; ``co_filename`` is\n the filename from which the code was compiled;\n ``co_firstlineno`` is the first line number of the function;\n ``co_lnotab`` is a string encoding the mapping from bytecode\n offsets to line numbers (for details see the source code of the\n interpreter); ``co_stacksize`` is the required stack size\n (including local variables); ``co_flags`` is an integer encoding\n a number of flags for the interpreter.\n\n The following flag bits are defined for ``co_flags``: bit\n ``0x04`` is set if the function uses the ``*arguments`` syntax\n to accept an arbitrary number of positional arguments; bit\n ``0x08`` is set if the function uses the ``**keywords`` syntax\n to accept arbitrary keyword arguments; bit ``0x20`` is set if\n the function is a generator.\n\n Future feature declarations (``from __future__ import\n division``) also use bits in ``co_flags`` to indicate whether a\n code object was compiled with a particular feature enabled: bit\n ``0x2000`` is set if the function was compiled with future\n division enabled; bits ``0x10`` and ``0x1000`` were used in\n earlier versions of Python.\n\n Other bits in ``co_flags`` are reserved for internal use.\n\n If a code object represents a function, the first item in\n ``co_consts`` is the documentation string of the function, or\n ``None`` if undefined.\n\n Frame objects\n Frame objects represent execution frames. They may occur in\n traceback objects (see below).\n\n Special read-only attributes: ``f_back`` is to the previous\n stack frame (towards the caller), or ``None`` if this is the\n bottom stack frame; ``f_code`` is the code object being executed\n in this frame; ``f_locals`` is the dictionary used to look up\n local variables; ``f_globals`` is used for global variables;\n ``f_builtins`` is used for built-in (intrinsic) names;\n ``f_restricted`` is a flag indicating whether the function is\n executing in restricted execution mode; ``f_lasti`` gives the\n precise instruction (this is an index into the bytecode string\n of the code object).\n\n Special writable attributes: ``f_trace``, if not ``None``, is a\n function called at the start of each source code line (this is\n used by the debugger); ``f_exc_type``, ``f_exc_value``,\n ``f_exc_traceback`` represent the last exception raised in the\n parent frame provided another exception was ever raised in the\n current frame (in all other cases they are None); ``f_lineno``\n is the current line number of the frame --- writing to this from\n within a trace function jumps to the given line (only for the\n bottom-most frame). A debugger can implement a Jump command\n (aka Set Next Statement) by writing to f_lineno.\n\n Traceback objects\n Traceback objects represent a stack trace of an exception. A\n traceback object is created when an exception occurs. When the\n search for an exception handler unwinds the execution stack, at\n each unwound level a traceback object is inserted in front of\n the current traceback. When an exception handler is entered,\n the stack trace is made available to the program. (See section\n *The try statement*.) It is accessible as ``sys.exc_traceback``,\n and also as the third item of the tuple returned by\n ``sys.exc_info()``. The latter is the preferred interface,\n since it works correctly when the program is using multiple\n threads. When the program contains no suitable handler, the\n stack trace is written (nicely formatted) to the standard error\n stream; if the interpreter is interactive, it is also made\n available to the user as ``sys.last_traceback``.\n\n Special read-only attributes: ``tb_next`` is the next level in\n the stack trace (towards the frame where the exception\n occurred), or ``None`` if there is no next level; ``tb_frame``\n points to the execution frame of the current level;\n ``tb_lineno`` gives the line number where the exception\n occurred; ``tb_lasti`` indicates the precise instruction. The\n line number and last instruction in the traceback may differ\n from the line number of its frame object if the exception\n occurred in a ``try`` statement with no matching except clause\n or with a finally clause.\n\n Slice objects\n Slice objects are used to represent slices when *extended slice\n syntax* is used. This is a slice using two colons, or multiple\n slices or ellipses separated by commas, e.g., ``a[i:j:step]``,\n ``a[i:j, k:l]``, or ``a[..., i:j]``. They are also created by\n the built-in ``slice()`` function.\n\n Special read-only attributes: ``start`` is the lower bound;\n ``stop`` is the upper bound; ``step`` is the step value; each is\n ``None`` if omitted. These attributes can have any type.\n\n Slice objects support one method:\n\n slice.indices(self, length)\n\n This method takes a single integer argument *length* and\n computes information about the extended slice that the slice\n object would describe if applied to a sequence of *length*\n items. It returns a tuple of three integers; respectively\n these are the *start* and *stop* indices and the *step* or\n stride length of the slice. Missing or out-of-bounds indices\n are handled in a manner consistent with regular slices.\n\n Added in version 2.3.\n\n Static method objects\n Static method objects provide a way of defeating the\n transformation of function objects to method objects described\n above. A static method object is a wrapper around any other\n object, usually a user-defined method object. When a static\n method object is retrieved from a class or a class instance, the\n object actually returned is the wrapped object, which is not\n subject to any further transformation. Static method objects are\n not themselves callable, although the objects they wrap usually\n are. Static method objects are created by the built-in\n ``staticmethod()`` constructor.\n\n Class method objects\n A class method object, like a static method object, is a wrapper\n around another object that alters the way in which that object\n is retrieved from classes and class instances. The behaviour of\n class method objects upon such retrieval is described above,\n under "User-defined methods". Class method objects are created\n by the built-in ``classmethod()`` constructor.\n', + 'types': u'\nThe standard type hierarchy\n***************************\n\nBelow is a list of the types that are built into Python. Extension\nmodules (written in C, Java, or other languages, depending on the\nimplementation) can define additional types. Future versions of\nPython may add types to the type hierarchy (e.g., rational numbers,\nefficiently stored arrays of integers, etc.).\n\nSome of the type descriptions below contain a paragraph listing\n\'special attributes.\' These are attributes that provide access to the\nimplementation and are not intended for general use. Their definition\nmay change in the future.\n\nNone\n This type has a single value. There is a single object with this\n value. This object is accessed through the built-in name ``None``.\n It is used to signify the absence of a value in many situations,\n e.g., it is returned from functions that don\'t explicitly return\n anything. Its truth value is false.\n\nNotImplemented\n This type has a single value. There is a single object with this\n value. This object is accessed through the built-in name\n ``NotImplemented``. Numeric methods and rich comparison methods may\n return this value if they do not implement the operation for the\n operands provided. (The interpreter will then try the reflected\n operation, or some other fallback, depending on the operator.) Its\n truth value is true.\n\nEllipsis\n This type has a single value. There is a single object with this\n value. This object is accessed through the built-in name\n ``Ellipsis``. It is used to indicate the presence of the ``...``\n syntax in a slice. Its truth value is true.\n\n``numbers.Number``\n These are created by numeric literals and returned as results by\n arithmetic operators and arithmetic built-in functions. Numeric\n objects are immutable; once created their value never changes.\n Python numbers are of course strongly related to mathematical\n numbers, but subject to the limitations of numerical representation\n in computers.\n\n Python distinguishes between integers, floating point numbers, and\n complex numbers:\n\n ``numbers.Integral``\n These represent elements from the mathematical set of integers\n (positive and negative).\n\n There are three types of integers:\n\n Plain integers\n These represent numbers in the range -2147483648 through\n 2147483647. (The range may be larger on machines with a\n larger natural word size, but not smaller.) When the result\n of an operation would fall outside this range, the result is\n normally returned as a long integer (in some cases, the\n exception ``OverflowError`` is raised instead). For the\n purpose of shift and mask operations, integers are assumed to\n have a binary, 2\'s complement notation using 32 or more bits,\n and hiding no bits from the user (i.e., all 4294967296\n different bit patterns correspond to different values).\n\n Long integers\n These represent numbers in an unlimited range, subject to\n available (virtual) memory only. For the purpose of shift\n and mask operations, a binary representation is assumed, and\n negative numbers are represented in a variant of 2\'s\n complement which gives the illusion of an infinite string of\n sign bits extending to the left.\n\n Booleans\n These represent the truth values False and True. The two\n objects representing the values False and True are the only\n Boolean objects. The Boolean type is a subtype of plain\n integers, and Boolean values behave like the values 0 and 1,\n respectively, in almost all contexts, the exception being\n that when converted to a string, the strings ``"False"`` or\n ``"True"`` are returned, respectively.\n\n The rules for integer representation are intended to give the\n most meaningful interpretation of shift and mask operations\n involving negative integers and the least surprises when\n switching between the plain and long integer domains. Any\n operation, if it yields a result in the plain integer domain,\n will yield the same result in the long integer domain or when\n using mixed operands. The switch between domains is transparent\n to the programmer.\n\n ``numbers.Real`` (``float``)\n These represent machine-level double precision floating point\n numbers. You are at the mercy of the underlying machine\n architecture (and C or Java implementation) for the accepted\n range and handling of overflow. Python does not support single-\n precision floating point numbers; the savings in processor and\n memory usage that are usually the reason for using these is\n dwarfed by the overhead of using objects in Python, so there is\n no reason to complicate the language with two kinds of floating\n point numbers.\n\n ``numbers.Complex``\n These represent complex numbers as a pair of machine-level\n double precision floating point numbers. The same caveats apply\n as for floating point numbers. The real and imaginary parts of a\n complex number ``z`` can be retrieved through the read-only\n attributes ``z.real`` and ``z.imag``.\n\nSequences\n These represent finite ordered sets indexed by non-negative\n numbers. The built-in function ``len()`` returns the number of\n items of a sequence. When the length of a sequence is *n*, the\n index set contains the numbers 0, 1, ..., *n*-1. Item *i* of\n sequence *a* is selected by ``a[i]``.\n\n Sequences also support slicing: ``a[i:j]`` selects all items with\n index *k* such that *i* ``<=`` *k* ``<`` *j*. When used as an\n expression, a slice is a sequence of the same type. This implies\n that the index set is renumbered so that it starts at 0.\n\n Some sequences also support "extended slicing" with a third "step"\n parameter: ``a[i:j:k]`` selects all items of *a* with index *x*\n where ``x = i + n*k``, *n* ``>=`` ``0`` and *i* ``<=`` *x* ``<``\n *j*.\n\n Sequences are distinguished according to their mutability:\n\n Immutable sequences\n An object of an immutable sequence type cannot change once it is\n created. (If the object contains references to other objects,\n these other objects may be mutable and may be changed; however,\n the collection of objects directly referenced by an immutable\n object cannot change.)\n\n The following types are immutable sequences:\n\n Strings\n The items of a string are characters. There is no separate\n character type; a character is represented by a string of one\n item. Characters represent (at least) 8-bit bytes. The\n built-in functions ``chr()`` and ``ord()`` convert between\n characters and nonnegative integers representing the byte\n values. Bytes with the values 0-127 usually represent the\n corresponding ASCII values, but the interpretation of values\n is up to the program. The string data type is also used to\n represent arrays of bytes, e.g., to hold data read from a\n file.\n\n (On systems whose native character set is not ASCII, strings\n may use EBCDIC in their internal representation, provided the\n functions ``chr()`` and ``ord()`` implement a mapping between\n ASCII and EBCDIC, and string comparison preserves the ASCII\n order. Or perhaps someone can propose a better rule?)\n\n Unicode\n The items of a Unicode object are Unicode code units. A\n Unicode code unit is represented by a Unicode object of one\n item and can hold either a 16-bit or 32-bit value\n representing a Unicode ordinal (the maximum value for the\n ordinal is given in ``sys.maxunicode``, and depends on how\n Python is configured at compile time). Surrogate pairs may\n be present in the Unicode object, and will be reported as two\n separate items. The built-in functions ``unichr()`` and\n ``ord()`` convert between code units and nonnegative integers\n representing the Unicode ordinals as defined in the Unicode\n Standard 3.0. Conversion from and to other encodings are\n possible through the Unicode method ``encode()`` and the\n built-in function ``unicode()``.\n\n Tuples\n The items of a tuple are arbitrary Python objects. Tuples of\n two or more items are formed by comma-separated lists of\n expressions. A tuple of one item (a \'singleton\') can be\n formed by affixing a comma to an expression (an expression by\n itself does not create a tuple, since parentheses must be\n usable for grouping of expressions). An empty tuple can be\n formed by an empty pair of parentheses.\n\n Mutable sequences\n Mutable sequences can be changed after they are created. The\n subscription and slicing notations can be used as the target of\n assignment and ``del`` (delete) statements.\n\n There is currently a single intrinsic mutable sequence type:\n\n Lists\n The items of a list are arbitrary Python objects. Lists are\n formed by placing a comma-separated list of expressions in\n square brackets. (Note that there are no special cases needed\n to form lists of length 0 or 1.)\n\n The extension module ``array`` provides an additional example of\n a mutable sequence type.\n\nSet types\n These represent unordered, finite sets of unique, immutable\n objects. As such, they cannot be indexed by any subscript. However,\n they can be iterated over, and the built-in function ``len()``\n returns the number of items in a set. Common uses for sets are fast\n membership testing, removing duplicates from a sequence, and\n computing mathematical operations such as intersection, union,\n difference, and symmetric difference.\n\n For set elements, the same immutability rules apply as for\n dictionary keys. Note that numeric types obey the normal rules for\n numeric comparison: if two numbers compare equal (e.g., ``1`` and\n ``1.0``), only one of them can be contained in a set.\n\n There are currently two intrinsic set types:\n\n Sets\n These represent a mutable set. They are created by the built-in\n ``set()`` constructor and can be modified afterwards by several\n methods, such as ``add()``.\n\n Frozen sets\n These represent an immutable set. They are created by the\n built-in ``frozenset()`` constructor. As a frozenset is\n immutable and *hashable*, it can be used again as an element of\n another set, or as a dictionary key.\n\nMappings\n These represent finite sets of objects indexed by arbitrary index\n sets. The subscript notation ``a[k]`` selects the item indexed by\n ``k`` from the mapping ``a``; this can be used in expressions and\n as the target of assignments or ``del`` statements. The built-in\n function ``len()`` returns the number of items in a mapping.\n\n There is currently a single intrinsic mapping type:\n\n Dictionaries\n These represent finite sets of objects indexed by nearly\n arbitrary values. The only types of values not acceptable as\n keys are values containing lists or dictionaries or other\n mutable types that are compared by value rather than by object\n identity, the reason being that the efficient implementation of\n dictionaries requires a key\'s hash value to remain constant.\n Numeric types used for keys obey the normal rules for numeric\n comparison: if two numbers compare equal (e.g., ``1`` and\n ``1.0``) then they can be used interchangeably to index the same\n dictionary entry.\n\n Dictionaries are mutable; they can be created by the ``{...}``\n notation (see section *Dictionary displays*).\n\n The extension modules ``dbm``, ``gdbm``, and ``bsddb`` provide\n additional examples of mapping types.\n\nCallable types\n These are the types to which the function call operation (see\n section *Calls*) can be applied:\n\n User-defined functions\n A user-defined function object is created by a function\n definition (see section *Function definitions*). It should be\n called with an argument list containing the same number of items\n as the function\'s formal parameter list.\n\n Special attributes:\n\n +-------------------------+---------------------------------+-------------+\n | Attribute | Meaning | |\n +=========================+=================================+=============+\n | ``func_doc`` | The function\'s documentation | Writable |\n | | string, or ``None`` if | |\n | | unavailable | |\n +-------------------------+---------------------------------+-------------+\n | ``__doc__`` | Another way of spelling | Writable |\n | | ``func_doc`` | |\n +-------------------------+---------------------------------+-------------+\n | ``func_name`` | The function\'s name | Writable |\n +-------------------------+---------------------------------+-------------+\n | ``__name__`` | Another way of spelling | Writable |\n | | ``func_name`` | |\n +-------------------------+---------------------------------+-------------+\n | ``__module__`` | The name of the module the | Writable |\n | | function was defined in, or | |\n | | ``None`` if unavailable. | |\n +-------------------------+---------------------------------+-------------+\n | ``func_defaults`` | A tuple containing default | Writable |\n | | argument values for those | |\n | | arguments that have defaults, | |\n | | or ``None`` if no arguments | |\n | | have a default value | |\n +-------------------------+---------------------------------+-------------+\n | ``func_code`` | The code object representing | Writable |\n | | the compiled function body. | |\n +-------------------------+---------------------------------+-------------+\n | ``func_globals`` | A reference to the dictionary | Read-only |\n | | that holds the function\'s | |\n | | global variables --- the global | |\n | | namespace of the module in | |\n | | which the function was defined. | |\n +-------------------------+---------------------------------+-------------+\n | ``func_dict`` | The namespace supporting | Writable |\n | | arbitrary function attributes. | |\n +-------------------------+---------------------------------+-------------+\n | ``func_closure`` | ``None`` or a tuple of cells | Read-only |\n | | that contain bindings for the | |\n | | function\'s free variables. | |\n +-------------------------+---------------------------------+-------------+\n\n Most of the attributes labelled "Writable" check the type of the\n assigned value.\n\n Changed in version 2.4: ``func_name`` is now writable.\n\n Function objects also support getting and setting arbitrary\n attributes, which can be used, for example, to attach metadata\n to functions. Regular attribute dot-notation is used to get and\n set such attributes. *Note that the current implementation only\n supports function attributes on user-defined functions. Function\n attributes on built-in functions may be supported in the\n future.*\n\n Additional information about a function\'s definition can be\n retrieved from its code object; see the description of internal\n types below.\n\n User-defined methods\n A user-defined method object combines a class, a class instance\n (or ``None``) and any callable object (normally a user-defined\n function).\n\n Special read-only attributes: ``im_self`` is the class instance\n object, ``im_func`` is the function object; ``im_class`` is the\n class of ``im_self`` for bound methods or the class that asked\n for the method for unbound methods; ``__doc__`` is the method\'s\n documentation (same as ``im_func.__doc__``); ``__name__`` is the\n method name (same as ``im_func.__name__``); ``__module__`` is\n the name of the module the method was defined in, or ``None`` if\n unavailable.\n\n Changed in version 2.2: ``im_self`` used to refer to the class\n that defined the method.\n\n Changed in version 2.6: For 3.0 forward-compatibility,\n ``im_func`` is also available as ``__func__``, and ``im_self``\n as ``__self__``.\n\n Methods also support accessing (but not setting) the arbitrary\n function attributes on the underlying function object.\n\n User-defined method objects may be created when getting an\n attribute of a class (perhaps via an instance of that class), if\n that attribute is a user-defined function object, an unbound\n user-defined method object, or a class method object. When the\n attribute is a user-defined method object, a new method object\n is only created if the class from which it is being retrieved is\n the same as, or a derived class of, the class stored in the\n original method object; otherwise, the original method object is\n used as it is.\n\n When a user-defined method object is created by retrieving a\n user-defined function object from a class, its ``im_self``\n attribute is ``None`` and the method object is said to be\n unbound. When one is created by retrieving a user-defined\n function object from a class via one of its instances, its\n ``im_self`` attribute is the instance, and the method object is\n said to be bound. In either case, the new method\'s ``im_class``\n attribute is the class from which the retrieval takes place, and\n its ``im_func`` attribute is the original function object.\n\n When a user-defined method object is created by retrieving\n another method object from a class or instance, the behaviour is\n the same as for a function object, except that the ``im_func``\n attribute of the new instance is not the original method object\n but its ``im_func`` attribute.\n\n When a user-defined method object is created by retrieving a\n class method object from a class or instance, its ``im_self``\n attribute is the class itself (the same as the ``im_class``\n attribute), and its ``im_func`` attribute is the function object\n underlying the class method.\n\n When an unbound user-defined method object is called, the\n underlying function (``im_func``) is called, with the\n restriction that the first argument must be an instance of the\n proper class (``im_class``) or of a derived class thereof.\n\n When a bound user-defined method object is called, the\n underlying function (``im_func``) is called, inserting the class\n instance (``im_self``) in front of the argument list. For\n instance, when ``C`` is a class which contains a definition for\n a function ``f()``, and ``x`` is an instance of ``C``, calling\n ``x.f(1)`` is equivalent to calling ``C.f(x, 1)``.\n\n When a user-defined method object is derived from a class method\n object, the "class instance" stored in ``im_self`` will actually\n be the class itself, so that calling either ``x.f(1)`` or\n ``C.f(1)`` is equivalent to calling ``f(C,1)`` where ``f`` is\n the underlying function.\n\n Note that the transformation from function object to (unbound or\n bound) method object happens each time the attribute is\n retrieved from the class or instance. In some cases, a fruitful\n optimization is to assign the attribute to a local variable and\n call that local variable. Also notice that this transformation\n only happens for user-defined functions; other callable objects\n (and all non-callable objects) are retrieved without\n transformation. It is also important to note that user-defined\n functions which are attributes of a class instance are not\n converted to bound methods; this *only* happens when the\n function is an attribute of the class.\n\n Generator functions\n A function or method which uses the ``yield`` statement (see\n section *The yield statement*) is called a *generator function*.\n Such a function, when called, always returns an iterator object\n which can be used to execute the body of the function: calling\n the iterator\'s ``next()`` method will cause the function to\n execute until it provides a value using the ``yield`` statement.\n When the function executes a ``return`` statement or falls off\n the end, a ``StopIteration`` exception is raised and the\n iterator will have reached the end of the set of values to be\n returned.\n\n Built-in functions\n A built-in function object is a wrapper around a C function.\n Examples of built-in functions are ``len()`` and ``math.sin()``\n (``math`` is a standard built-in module). The number and type of\n the arguments are determined by the C function. Special read-\n only attributes: ``__doc__`` is the function\'s documentation\n string, or ``None`` if unavailable; ``__name__`` is the\n function\'s name; ``__self__`` is set to ``None`` (but see the\n next item); ``__module__`` is the name of the module the\n function was defined in or ``None`` if unavailable.\n\n Built-in methods\n This is really a different disguise of a built-in function, this\n time containing an object passed to the C function as an\n implicit extra argument. An example of a built-in method is\n ``alist.append()``, assuming *alist* is a list object. In this\n case, the special read-only attribute ``__self__`` is set to the\n object denoted by *list*.\n\n Class Types\n Class types, or "new-style classes," are callable. These\n objects normally act as factories for new instances of\n themselves, but variations are possible for class types that\n override ``__new__()``. The arguments of the call are passed to\n ``__new__()`` and, in the typical case, to ``__init__()`` to\n initialize the new instance.\n\n Classic Classes\n Class objects are described below. When a class object is\n called, a new class instance (also described below) is created\n and returned. This implies a call to the class\'s ``__init__()``\n method if it has one. Any arguments are passed on to the\n ``__init__()`` method. If there is no ``__init__()`` method,\n the class must be called without arguments.\n\n Class instances\n Class instances are described below. Class instances are\n callable only when the class has a ``__call__()`` method;\n ``x(arguments)`` is a shorthand for ``x.__call__(arguments)``.\n\nModules\n Modules are imported by the ``import`` statement (see section *The\n import statement*). A module object has a namespace implemented by\n a dictionary object (this is the dictionary referenced by the\n func_globals attribute of functions defined in the module).\n Attribute references are translated to lookups in this dictionary,\n e.g., ``m.x`` is equivalent to ``m.__dict__["x"]``. A module object\n does not contain the code object used to initialize the module\n (since it isn\'t needed once the initialization is done).\n\n Attribute assignment updates the module\'s namespace dictionary,\n e.g., ``m.x = 1`` is equivalent to ``m.__dict__["x"] = 1``.\n\n Special read-only attribute: ``__dict__`` is the module\'s namespace\n as a dictionary object.\n\n Predefined (writable) attributes: ``__name__`` is the module\'s\n name; ``__doc__`` is the module\'s documentation string, or ``None``\n if unavailable; ``__file__`` is the pathname of the file from which\n the module was loaded, if it was loaded from a file. The\n ``__file__`` attribute is not present for C modules that are\n statically linked into the interpreter; for extension modules\n loaded dynamically from a shared library, it is the pathname of the\n shared library file.\n\nClasses\n Both class types (new-style classes) and class objects (old-\n style/classic classes) are typically created by class definitions\n (see section *Class definitions*). A class has a namespace\n implemented by a dictionary object. Class attribute references are\n translated to lookups in this dictionary, e.g., ``C.x`` is\n translated to ``C.__dict__["x"]`` (although for new-style classes\n in particular there are a number of hooks which allow for other\n means of locating attributes). When the attribute name is not found\n there, the attribute search continues in the base classes. For\n old-style classes, the search is depth-first, left-to-right in the\n order of occurrence in the base class list. New-style classes use\n the more complex C3 method resolution order which behaves correctly\n even in the presence of \'diamond\' inheritance structures where\n there are multiple inheritance paths leading back to a common\n ancestor. Additional details on the C3 MRO used by new-style\n classes can be found in the documentation accompanying the 2.3\n release at http://www.python.org/download/releases/2.3/mro/.\n\n When a class attribute reference (for class ``C``, say) would yield\n a user-defined function object or an unbound user-defined method\n object whose associated class is either ``C`` or one of its base\n classes, it is transformed into an unbound user-defined method\n object whose ``im_class`` attribute is ``C``. When it would yield a\n class method object, it is transformed into a bound user-defined\n method object whose ``im_class`` and ``im_self`` attributes are\n both ``C``. When it would yield a static method object, it is\n transformed into the object wrapped by the static method object.\n See section *Implementing Descriptors* for another way in which\n attributes retrieved from a class may differ from those actually\n contained in its ``__dict__`` (note that only new-style classes\n support descriptors).\n\n Class attribute assignments update the class\'s dictionary, never\n the dictionary of a base class.\n\n A class object can be called (see above) to yield a class instance\n (see below).\n\n Special attributes: ``__name__`` is the class name; ``__module__``\n is the module name in which the class was defined; ``__dict__`` is\n the dictionary containing the class\'s namespace; ``__bases__`` is a\n tuple (possibly empty or a singleton) containing the base classes,\n in the order of their occurrence in the base class list;\n ``__doc__`` is the class\'s documentation string, or None if\n undefined.\n\nClass instances\n A class instance is created by calling a class object (see above).\n A class instance has a namespace implemented as a dictionary which\n is the first place in which attribute references are searched.\n When an attribute is not found there, and the instance\'s class has\n an attribute by that name, the search continues with the class\n attributes. If a class attribute is found that is a user-defined\n function object or an unbound user-defined method object whose\n associated class is the class (call it ``C``) of the instance for\n which the attribute reference was initiated or one of its bases, it\n is transformed into a bound user-defined method object whose\n ``im_class`` attribute is ``C`` and whose ``im_self`` attribute is\n the instance. Static method and class method objects are also\n transformed, as if they had been retrieved from class ``C``; see\n above under "Classes". See section *Implementing Descriptors* for\n another way in which attributes of a class retrieved via its\n instances may differ from the objects actually stored in the\n class\'s ``__dict__``. If no class attribute is found, and the\n object\'s class has a ``__getattr__()`` method, that is called to\n satisfy the lookup.\n\n Attribute assignments and deletions update the instance\'s\n dictionary, never a class\'s dictionary. If the class has a\n ``__setattr__()`` or ``__delattr__()`` method, this is called\n instead of updating the instance dictionary directly.\n\n Class instances can pretend to be numbers, sequences, or mappings\n if they have methods with certain special names. See section\n *Special method names*.\n\n Special attributes: ``__dict__`` is the attribute dictionary;\n ``__class__`` is the instance\'s class.\n\nFiles\n A file object represents an open file. File objects are created by\n the ``open()`` built-in function, and also by ``os.popen()``,\n ``os.fdopen()``, and the ``makefile()`` method of socket objects\n (and perhaps by other functions or methods provided by extension\n modules). The objects ``sys.stdin``, ``sys.stdout`` and\n ``sys.stderr`` are initialized to file objects corresponding to the\n interpreter\'s standard input, output and error streams. See *File\n Objects* for complete documentation of file objects.\n\nInternal types\n A few types used internally by the interpreter are exposed to the\n user. Their definitions may change with future versions of the\n interpreter, but they are mentioned here for completeness.\n\n Code objects\n Code objects represent *byte-compiled* executable Python code,\n or *bytecode*. The difference between a code object and a\n function object is that the function object contains an explicit\n reference to the function\'s globals (the module in which it was\n defined), while a code object contains no context; also the\n default argument values are stored in the function object, not\n in the code object (because they represent values calculated at\n run-time). Unlike function objects, code objects are immutable\n and contain no references (directly or indirectly) to mutable\n objects.\n\n Special read-only attributes: ``co_name`` gives the function\n name; ``co_argcount`` is the number of positional arguments\n (including arguments with default values); ``co_nlocals`` is the\n number of local variables used by the function (including\n arguments); ``co_varnames`` is a tuple containing the names of\n the local variables (starting with the argument names);\n ``co_cellvars`` is a tuple containing the names of local\n variables that are referenced by nested functions;\n ``co_freevars`` is a tuple containing the names of free\n variables; ``co_code`` is a string representing the sequence of\n bytecode instructions; ``co_consts`` is a tuple containing the\n literals used by the bytecode; ``co_names`` is a tuple\n containing the names used by the bytecode; ``co_filename`` is\n the filename from which the code was compiled;\n ``co_firstlineno`` is the first line number of the function;\n ``co_lnotab`` is a string encoding the mapping from bytecode\n offsets to line numbers (for details see the source code of the\n interpreter); ``co_stacksize`` is the required stack size\n (including local variables); ``co_flags`` is an integer encoding\n a number of flags for the interpreter.\n\n The following flag bits are defined for ``co_flags``: bit\n ``0x04`` is set if the function uses the ``*arguments`` syntax\n to accept an arbitrary number of positional arguments; bit\n ``0x08`` is set if the function uses the ``**keywords`` syntax\n to accept arbitrary keyword arguments; bit ``0x20`` is set if\n the function is a generator.\n\n Future feature declarations (``from __future__ import\n division``) also use bits in ``co_flags`` to indicate whether a\n code object was compiled with a particular feature enabled: bit\n ``0x2000`` is set if the function was compiled with future\n division enabled; bits ``0x10`` and ``0x1000`` were used in\n earlier versions of Python.\n\n Other bits in ``co_flags`` are reserved for internal use.\n\n If a code object represents a function, the first item in\n ``co_consts`` is the documentation string of the function, or\n ``None`` if undefined.\n\n Frame objects\n Frame objects represent execution frames. They may occur in\n traceback objects (see below).\n\n Special read-only attributes: ``f_back`` is to the previous\n stack frame (towards the caller), or ``None`` if this is the\n bottom stack frame; ``f_code`` is the code object being executed\n in this frame; ``f_locals`` is the dictionary used to look up\n local variables; ``f_globals`` is used for global variables;\n ``f_builtins`` is used for built-in (intrinsic) names;\n ``f_restricted`` is a flag indicating whether the function is\n executing in restricted execution mode; ``f_lasti`` gives the\n precise instruction (this is an index into the bytecode string\n of the code object).\n\n Special writable attributes: ``f_trace``, if not ``None``, is a\n function called at the start of each source code line (this is\n used by the debugger); ``f_exc_type``, ``f_exc_value``,\n ``f_exc_traceback`` represent the last exception raised in the\n parent frame provided another exception was ever raised in the\n current frame (in all other cases they are None); ``f_lineno``\n is the current line number of the frame --- writing to this from\n within a trace function jumps to the given line (only for the\n bottom-most frame). A debugger can implement a Jump command\n (aka Set Next Statement) by writing to f_lineno.\n\n Traceback objects\n Traceback objects represent a stack trace of an exception. A\n traceback object is created when an exception occurs. When the\n search for an exception handler unwinds the execution stack, at\n each unwound level a traceback object is inserted in front of\n the current traceback. When an exception handler is entered,\n the stack trace is made available to the program. (See section\n *The try statement*.) It is accessible as ``sys.exc_traceback``,\n and also as the third item of the tuple returned by\n ``sys.exc_info()``. The latter is the preferred interface,\n since it works correctly when the program is using multiple\n threads. When the program contains no suitable handler, the\n stack trace is written (nicely formatted) to the standard error\n stream; if the interpreter is interactive, it is also made\n available to the user as ``sys.last_traceback``.\n\n Special read-only attributes: ``tb_next`` is the next level in\n the stack trace (towards the frame where the exception\n occurred), or ``None`` if there is no next level; ``tb_frame``\n points to the execution frame of the current level;\n ``tb_lineno`` gives the line number where the exception\n occurred; ``tb_lasti`` indicates the precise instruction. The\n line number and last instruction in the traceback may differ\n from the line number of its frame object if the exception\n occurred in a ``try`` statement with no matching except clause\n or with a finally clause.\n\n Slice objects\n Slice objects are used to represent slices when *extended slice\n syntax* is used. This is a slice using two colons, or multiple\n slices or ellipses separated by commas, e.g., ``a[i:j:step]``,\n ``a[i:j, k:l]``, or ``a[..., i:j]``. They are also created by\n the built-in ``slice()`` function.\n\n Special read-only attributes: ``start`` is the lower bound;\n ``stop`` is the upper bound; ``step`` is the step value; each is\n ``None`` if omitted. These attributes can have any type.\n\n Slice objects support one method:\n\n slice.indices(self, length)\n\n This method takes a single integer argument *length* and\n computes information about the extended slice that the slice\n object would describe if applied to a sequence of *length*\n items. It returns a tuple of three integers; respectively\n these are the *start* and *stop* indices and the *step* or\n stride length of the slice. Missing or out-of-bounds indices\n are handled in a manner consistent with regular slices.\n\n New in version 2.3.\n\n Static method objects\n Static method objects provide a way of defeating the\n transformation of function objects to method objects described\n above. A static method object is a wrapper around any other\n object, usually a user-defined method object. When a static\n method object is retrieved from a class or a class instance, the\n object actually returned is the wrapped object, which is not\n subject to any further transformation. Static method objects are\n not themselves callable, although the objects they wrap usually\n are. Static method objects are created by the built-in\n ``staticmethod()`` constructor.\n\n Class method objects\n A class method object, like a static method object, is a wrapper\n around another object that alters the way in which that object\n is retrieved from classes and class instances. The behaviour of\n class method objects upon such retrieval is described above,\n under "User-defined methods". Class method objects are created\n by the built-in ``classmethod()`` constructor.\n', 'typesfunctions': u'\nFunctions\n*********\n\nFunction objects are created by function definitions. The only\noperation on a function object is to call it: ``func(argument-list)``.\n\nThere are really two flavors of function objects: built-in functions\nand user-defined functions. Both support the same operation (to call\nthe function), but the implementation is different, hence the\ndifferent object types.\n\nSee *Function definitions* for more information.\n', - 'typesmapping': u'\nMapping Types --- ``dict``\n**************************\n\nA *mapping* object maps *hashable* values to arbitrary objects.\nMappings are mutable objects. There is currently only one standard\nmapping type, the *dictionary*. (For other containers see the built\nin ``list``, ``set``, and ``tuple`` classes, and the ``collections``\nmodule.)\n\nA dictionary\'s keys are *almost* arbitrary values. Values that are\nnot *hashable*, that is, values containing lists, dictionaries or\nother mutable types (that are compared by value rather than by object\nidentity) may not be used as keys. Numeric types used for keys obey\nthe normal rules for numeric comparison: if two numbers compare equal\n(such as ``1`` and ``1.0``) then they can be used interchangeably to\nindex the same dictionary entry. (Note however, that since computers\nstore floating-point numbers as approximations it is usually unwise to\nuse them as dictionary keys.)\n\nDictionaries can be created by placing a comma-separated list of\n``key: value`` pairs within braces, for example: ``{\'jack\': 4098,\n\'sjoerd\': 4127}`` or ``{4098: \'jack\', 4127: \'sjoerd\'}``, or by the\n``dict`` constructor.\n\nclass dict([arg])\n\n Return a new dictionary initialized from an optional positional\n argument or from a set of keyword arguments. If no arguments are\n given, return a new empty dictionary. If the positional argument\n *arg* is a mapping object, return a dictionary mapping the same\n keys to the same values as does the mapping object. Otherwise the\n positional argument must be a sequence, a container that supports\n iteration, or an iterator object. The elements of the argument\n must each also be of one of those kinds, and each must in turn\n contain exactly two objects. The first is used as a key in the new\n dictionary, and the second as the key\'s value. If a given key is\n seen more than once, the last value associated with it is retained\n in the new dictionary.\n\n If keyword arguments are given, the keywords themselves with their\n associated values are added as items to the dictionary. If a key is\n specified both in the positional argument and as a keyword\n argument, the value associated with the keyword is retained in the\n dictionary. For example, these all return a dictionary equal to\n ``{"one": 2, "two": 3}``:\n\n * ``dict(one=2, two=3)``\n\n * ``dict({\'one\': 2, \'two\': 3})``\n\n * ``dict(zip((\'one\', \'two\'), (2, 3)))``\n\n * ``dict([[\'two\', 3], [\'one\', 2]])``\n\n The first example only works for keys that are valid Python\n identifiers; the others work with any valid keys.\n\n Added in version 2.2.\n\n Changed in version 2.3: Support for building a dictionary from\n keyword arguments added.\n\n These are the operations that dictionaries support (and therefore,\n custom mapping types should support too):\n\n len(d)\n\n Return the number of items in the dictionary *d*.\n\n d[key]\n\n Return the item of *d* with key *key*. Raises a ``KeyError`` if\n *key* is not in the map.\n\n Added in version 2.5: If a subclass of dict defines a method\n ``__missing__()``, if the key *key* is not present, the\n ``d[key]`` operation calls that method with the key *key* as\n argument. The ``d[key]`` operation then returns or raises\n whatever is returned or raised by the ``__missing__(key)`` call\n if the key is not present. No other operations or methods invoke\n ``__missing__()``. If ``__missing__()`` is not defined,\n ``KeyError`` is raised. ``__missing__()`` must be a method; it\n cannot be an instance variable. For an example, see\n ``collections.defaultdict``.\n\n d[key] = value\n\n Set ``d[key]`` to *value*.\n\n del d[key]\n\n Remove ``d[key]`` from *d*. Raises a ``KeyError`` if *key* is\n not in the map.\n\n key in d\n\n Return ``True`` if *d* has a key *key*, else ``False``.\n\n Added in version 2.2.\n\n key not in d\n\n Equivalent to ``not key in d``.\n\n Added in version 2.2.\n\n clear()\n\n Remove all items from the dictionary.\n\n copy()\n\n Return a shallow copy of the dictionary.\n\n fromkeys(seq[, value])\n\n Create a new dictionary with keys from *seq* and values set to\n *value*.\n\n ``fromkeys()`` is a class method that returns a new dictionary.\n *value* defaults to ``None``.\n\n Added in version 2.3.\n\n get(key[, default])\n\n Return the value for *key* if *key* is in the dictionary, else\n *default*. If *default* is not given, it defaults to ``None``,\n so that this method never raises a ``KeyError``.\n\n has_key(key)\n\n ``dict.has_key(key)`` is equivalent to ``key in d``, but\n deprecated.\n\n items()\n\n Return a copy of the dictionary\'s list of ``(key, value)``\n pairs.\n\n Note: Keys and values are listed in an arbitrary order which is non-\n random, varies across Python implementations, and depends on\n the dictionary\'s history of insertions and deletions. If\n ``items()``, ``keys()``, ``values()``, ``iteritems()``,\n ``iterkeys()``, and ``itervalues()`` are called with no\n intervening modifications to the dictionary, the lists will\n directly correspond. This allows the creation of ``(value,\n key)`` pairs using ``zip()``: ``pairs = zip(d.values(),\n d.keys())``. The same relationship holds for the\n ``iterkeys()`` and ``itervalues()`` methods: ``pairs =\n zip(d.itervalues(), d.iterkeys())`` provides the same value\n for ``pairs``. Another way to create the same list is ``pairs\n = [(v, k) for (k, v) in d.iteritems()]``.\n\n iteritems()\n\n Return an iterator over the dictionary\'s ``(key, value)`` pairs.\n See the note for ``dict.items()``.\n\n Added in version 2.2.\n\n iterkeys()\n\n Return an iterator over the dictionary\'s keys. See the note for\n ``dict.items()``.\n\n Added in version 2.2.\n\n itervalues()\n\n Return an iterator over the dictionary\'s values. See the note\n for ``dict.items()``.\n\n Added in version 2.2.\n\n keys()\n\n Return a copy of the dictionary\'s list of keys. See the note\n for ``dict.items()``.\n\n pop(key[, default])\n\n If *key* is in the dictionary, remove it and return its value,\n else return *default*. If *default* is not given and *key* is\n not in the dictionary, a ``KeyError`` is raised.\n\n Added in version 2.3.\n\n popitem()\n\n Remove and return an arbitrary ``(key, value)`` pair from the\n dictionary.\n\n ``popitem()`` is useful to destructively iterate over a\n dictionary, as often used in set algorithms. If the dictionary\n is empty, calling ``popitem()`` raises a ``KeyError``.\n\n setdefault(key[, default])\n\n If *key* is in the dictionary, return its value. If not, insert\n *key* with a value of *default* and return *default*. *default*\n defaults to ``None``.\n\n update([other])\n\n Update the dictionary with the key/value pairs from *other*,\n overwriting existing keys. Return ``None``.\n\n ``update()`` accepts either another dictionary object or an\n iterable of key/value pairs (as a tuple or other iterable of\n length two). If keyword arguments are specified, the dictionary\n is then is updated with those key/value pairs: ``d.update(red=1,\n blue=2)``.\n\n Changed in version 2.4: Allowed the argument to be an iterable\n of key/value pairs and allowed keyword arguments.\n\n values()\n\n Return a copy of the dictionary\'s list of values. See the note\n for ``dict.items()``.\n', + 'typesmapping': u'\nMapping Types --- ``dict``\n**************************\n\nA *mapping* object maps *hashable* values to arbitrary objects.\nMappings are mutable objects. There is currently only one standard\nmapping type, the *dictionary*. (For other containers see the built\nin ``list``, ``set``, and ``tuple`` classes, and the ``collections``\nmodule.)\n\nA dictionary\'s keys are *almost* arbitrary values. Values that are\nnot *hashable*, that is, values containing lists, dictionaries or\nother mutable types (that are compared by value rather than by object\nidentity) may not be used as keys. Numeric types used for keys obey\nthe normal rules for numeric comparison: if two numbers compare equal\n(such as ``1`` and ``1.0``) then they can be used interchangeably to\nindex the same dictionary entry. (Note however, that since computers\nstore floating-point numbers as approximations it is usually unwise to\nuse them as dictionary keys.)\n\nDictionaries can be created by placing a comma-separated list of\n``key: value`` pairs within braces, for example: ``{\'jack\': 4098,\n\'sjoerd\': 4127}`` or ``{4098: \'jack\', 4127: \'sjoerd\'}``, or by the\n``dict`` constructor.\n\nclass dict([arg])\n\n Return a new dictionary initialized from an optional positional\n argument or from a set of keyword arguments. If no arguments are\n given, return a new empty dictionary. If the positional argument\n *arg* is a mapping object, return a dictionary mapping the same\n keys to the same values as does the mapping object. Otherwise the\n positional argument must be a sequence, a container that supports\n iteration, or an iterator object. The elements of the argument\n must each also be of one of those kinds, and each must in turn\n contain exactly two objects. The first is used as a key in the new\n dictionary, and the second as the key\'s value. If a given key is\n seen more than once, the last value associated with it is retained\n in the new dictionary.\n\n If keyword arguments are given, the keywords themselves with their\n associated values are added as items to the dictionary. If a key is\n specified both in the positional argument and as a keyword\n argument, the value associated with the keyword is retained in the\n dictionary. For example, these all return a dictionary equal to\n ``{"one": 2, "two": 3}``:\n\n * ``dict(one=2, two=3)``\n\n * ``dict({\'one\': 2, \'two\': 3})``\n\n * ``dict(zip((\'one\', \'two\'), (2, 3)))``\n\n * ``dict([[\'two\', 3], [\'one\', 2]])``\n\n The first example only works for keys that are valid Python\n identifiers; the others work with any valid keys.\n\n New in version 2.2.\n\n Changed in version 2.3: Support for building a dictionary from\n keyword arguments added.\n\n These are the operations that dictionaries support (and therefore,\n custom mapping types should support too):\n\n len(d)\n\n Return the number of items in the dictionary *d*.\n\n d[key]\n\n Return the item of *d* with key *key*. Raises a ``KeyError`` if\n *key* is not in the map.\n\n New in version 2.5: If a subclass of dict defines a method\n ``__missing__()``, if the key *key* is not present, the\n ``d[key]`` operation calls that method with the key *key* as\n argument. The ``d[key]`` operation then returns or raises\n whatever is returned or raised by the ``__missing__(key)`` call\n if the key is not present. No other operations or methods invoke\n ``__missing__()``. If ``__missing__()`` is not defined,\n ``KeyError`` is raised. ``__missing__()`` must be a method; it\n cannot be an instance variable. For an example, see\n ``collections.defaultdict``.\n\n d[key] = value\n\n Set ``d[key]`` to *value*.\n\n del d[key]\n\n Remove ``d[key]`` from *d*. Raises a ``KeyError`` if *key* is\n not in the map.\n\n key in d\n\n Return ``True`` if *d* has a key *key*, else ``False``.\n\n New in version 2.2.\n\n key not in d\n\n Equivalent to ``not key in d``.\n\n New in version 2.2.\n\n clear()\n\n Remove all items from the dictionary.\n\n copy()\n\n Return a shallow copy of the dictionary.\n\n fromkeys(seq[, value])\n\n Create a new dictionary with keys from *seq* and values set to\n *value*.\n\n ``fromkeys()`` is a class method that returns a new dictionary.\n *value* defaults to ``None``.\n\n New in version 2.3.\n\n get(key[, default])\n\n Return the value for *key* if *key* is in the dictionary, else\n *default*. If *default* is not given, it defaults to ``None``,\n so that this method never raises a ``KeyError``.\n\n has_key(key)\n\n ``dict.has_key(key)`` is equivalent to ``key in d``, but\n deprecated.\n\n items()\n\n Return a copy of the dictionary\'s list of ``(key, value)``\n pairs.\n\n Note: Keys and values are listed in an arbitrary order which is non-\n random, varies across Python implementations, and depends on\n the dictionary\'s history of insertions and deletions. If\n ``items()``, ``keys()``, ``values()``, ``iteritems()``,\n ``iterkeys()``, and ``itervalues()`` are called with no\n intervening modifications to the dictionary, the lists will\n directly correspond. This allows the creation of ``(value,\n key)`` pairs using ``zip()``: ``pairs = zip(d.values(),\n d.keys())``. The same relationship holds for the\n ``iterkeys()`` and ``itervalues()`` methods: ``pairs =\n zip(d.itervalues(), d.iterkeys())`` provides the same value\n for ``pairs``. Another way to create the same list is ``pairs\n = [(v, k) for (k, v) in d.iteritems()]``.\n\n iteritems()\n\n Return an iterator over the dictionary\'s ``(key, value)`` pairs.\n See the note for ``dict.items()``.\n\n New in version 2.2.\n\n iterkeys()\n\n Return an iterator over the dictionary\'s keys. See the note for\n ``dict.items()``.\n\n New in version 2.2.\n\n itervalues()\n\n Return an iterator over the dictionary\'s values. See the note\n for ``dict.items()``.\n\n New in version 2.2.\n\n keys()\n\n Return a copy of the dictionary\'s list of keys. See the note\n for ``dict.items()``.\n\n pop(key[, default])\n\n If *key* is in the dictionary, remove it and return its value,\n else return *default*. If *default* is not given and *key* is\n not in the dictionary, a ``KeyError`` is raised.\n\n New in version 2.3.\n\n popitem()\n\n Remove and return an arbitrary ``(key, value)`` pair from the\n dictionary.\n\n ``popitem()`` is useful to destructively iterate over a\n dictionary, as often used in set algorithms. If the dictionary\n is empty, calling ``popitem()`` raises a ``KeyError``.\n\n setdefault(key[, default])\n\n If *key* is in the dictionary, return its value. If not, insert\n *key* with a value of *default* and return *default*. *default*\n defaults to ``None``.\n\n update([other])\n\n Update the dictionary with the key/value pairs from *other*,\n overwriting existing keys. Return ``None``.\n\n ``update()`` accepts either another dictionary object or an\n iterable of key/value pairs (as a tuple or other iterable of\n length two). If keyword arguments are specified, the dictionary\n is then is updated with those key/value pairs: ``d.update(red=1,\n blue=2)``.\n\n Changed in version 2.4: Allowed the argument to be an iterable\n of key/value pairs and allowed keyword arguments.\n\n values()\n\n Return a copy of the dictionary\'s list of values. See the note\n for ``dict.items()``.\n', 'typesmethods': u"\nMethods\n*******\n\nMethods are functions that are called using the attribute notation.\nThere are two flavors: built-in methods (such as ``append()`` on\nlists) and class instance methods. Built-in methods are described\nwith the types that support them.\n\nThe implementation adds two special read-only attributes to class\ninstance methods: ``m.im_self`` is the object on which the method\noperates, and ``m.im_func`` is the function implementing the method.\nCalling ``m(arg-1, arg-2, ..., arg-n)`` is completely equivalent to\ncalling ``m.im_func(m.im_self, arg-1, arg-2, ..., arg-n)``.\n\nClass instance methods are either *bound* or *unbound*, referring to\nwhether the method was accessed through an instance or a class,\nrespectively. When a method is unbound, its ``im_self`` attribute\nwill be ``None`` and if called, an explicit ``self`` object must be\npassed as the first argument. In this case, ``self`` must be an\ninstance of the unbound method's class (or a subclass of that class),\notherwise a ``TypeError`` is raised.\n\nLike function objects, methods objects support getting arbitrary\nattributes. However, since method attributes are actually stored on\nthe underlying function object (``meth.im_func``), setting method\nattributes on either bound or unbound methods is disallowed.\nAttempting to set a method attribute results in a ``TypeError`` being\nraised. In order to set a method attribute, you need to explicitly\nset it on the underlying function object:\n\n class C:\n def method(self):\n pass\n\n c = C()\n c.method.im_func.whoami = 'my name is c'\n\nSee *The standard type hierarchy* for more information.\n", 'typesmodules': u"\nModules\n*******\n\nThe only special operation on a module is attribute access:\n``m.name``, where *m* is a module and *name* accesses a name defined\nin *m*'s symbol table. Module attributes can be assigned to. (Note\nthat the ``import`` statement is not, strictly speaking, an operation\non a module object; ``import foo`` does not require a module object\nnamed *foo* to exist, rather it requires an (external) *definition*\nfor a module named *foo* somewhere.)\n\nA special member of every module is ``__dict__``. This is the\ndictionary containing the module's symbol table. Modifying this\ndictionary will actually change the module's symbol table, but direct\nassignment to the ``__dict__`` attribute is not possible (you can\nwrite ``m.__dict__['a'] = 1``, which defines ``m.a`` to be ``1``, but\nyou can't write ``m.__dict__ = {}``). Modifying ``__dict__`` directly\nis not recommended.\n\nModules built into the interpreter are written like this: ````. If loaded from a file, they are written as\n````.\n", - 'typesseq': u'\nSequence Types --- ``str``, ``unicode``, ``list``, ``tuple``, ``buffer``, ``xrange``\n************************************************************************************\n\nThere are six sequence types: strings, Unicode strings, lists, tuples,\nbuffers, and xrange objects. (For other containers see the built in\n``dict``, ``list``, ``set``, and ``tuple`` classes, and the\n``collections`` module.)\n\nString literals are written in single or double quotes: ``\'xyzzy\'``,\n``"frobozz"``. See *String literals* for more about string literals.\nUnicode strings are much like strings, but are specified in the syntax\nusing a preceding ``\'u\'`` character: ``u\'abc\'``, ``u"def"``. In\naddition to the functionality described here, there are also string-\nspecific methods described in the *String Methods* section. Lists are\nconstructed with square brackets, separating items with commas: ``[a,\nb, c]``. Tuples are constructed by the comma operator (not within\nsquare brackets), with or without enclosing parentheses, but an empty\ntuple must have the enclosing parentheses, such as ``a, b, c`` or\n``()``. A single item tuple must have a trailing comma, such as\n``(d,)``.\n\nBuffer objects are not directly supported by Python syntax, but can be\ncreated by calling the builtin function ``buffer()``. They don\'t\nsupport concatenation or repetition.\n\nObjects of type xrange are similar to buffers in that there is no\nspecific syntax to create them, but they are created using the\n``xrange()`` function. They don\'t support slicing, concatenation or\nrepetition, and using ``in``, ``not in``, ``min()`` or ``max()`` on\nthem is inefficient.\n\nMost sequence types support the following operations. The ``in`` and\n``not in`` operations have the same priorities as the comparison\noperations. The ``+`` and ``*`` operations have the same priority as\nthe corresponding numeric operations. [3] Additional methods are\nprovided for *Mutable Sequence Types*.\n\nThis table lists the sequence operations sorted in ascending priority\n(operations in the same box have the same priority). In the table,\n*s* and *t* are sequences of the same type; *n*, *i* and *j* are\nintegers:\n\n+--------------------+----------------------------------+------------+\n| Operation | Result | Notes |\n+====================+==================================+============+\n| ``x in s`` | ``True`` if an item of *s* is | (1) |\n| | equal to *x*, else ``False`` | |\n+--------------------+----------------------------------+------------+\n| ``x not in s`` | ``False`` if an item of *s* is | (1) |\n| | equal to *x*, else ``True`` | |\n+--------------------+----------------------------------+------------+\n| ``s + t`` | the concatenation of *s* and *t* | (6) |\n+--------------------+----------------------------------+------------+\n| ``s * n, n * s`` | *n* shallow copies of *s* | (2) |\n| | concatenated | |\n+--------------------+----------------------------------+------------+\n| ``s[i]`` | *i*\'th item of *s*, origin 0 | (3) |\n+--------------------+----------------------------------+------------+\n| ``s[i:j]`` | slice of *s* from *i* to *j* | (3)(4) |\n+--------------------+----------------------------------+------------+\n| ``s[i:j:k]`` | slice of *s* from *i* to *j* | (3)(5) |\n| | with step *k* | |\n+--------------------+----------------------------------+------------+\n| ``len(s)`` | length of *s* | |\n+--------------------+----------------------------------+------------+\n| ``min(s)`` | smallest item of *s* | |\n+--------------------+----------------------------------+------------+\n| ``max(s)`` | largest item of *s* | |\n+--------------------+----------------------------------+------------+\n\nSequence types also support comparisons. In particular, tuples and\nlists are compared lexicographically by comparing corresponding\nelements. This means that to compare equal, every element must compare\nequal and the two sequences must be of the same type and have the same\nlength. (For full details see *Comparisons* in the language\nreference.)\n\nNotes:\n\n1. When *s* is a string or Unicode string object the ``in`` and ``not\n in`` operations act like a substring test. In Python versions\n before 2.3, *x* had to be a string of length 1. In Python 2.3 and\n beyond, *x* may be a string of any length.\n\n2. Values of *n* less than ``0`` are treated as ``0`` (which yields an\n empty sequence of the same type as *s*). Note also that the copies\n are shallow; nested structures are not copied. This often haunts\n new Python programmers; consider:\n\n >>> lists = [[]] * 3\n >>> lists\n [[], [], []]\n >>> lists[0].append(3)\n >>> lists\n [[3], [3], [3]]\n\n What has happened is that ``[[]]`` is a one-element list containing\n an empty list, so all three elements of ``[[]] * 3`` are (pointers\n to) this single empty list. Modifying any of the elements of\n ``lists`` modifies this single list. You can create a list of\n different lists this way:\n\n >>> lists = [[] for i in range(3)]\n >>> lists[0].append(3)\n >>> lists[1].append(5)\n >>> lists[2].append(7)\n >>> lists\n [[3], [5], [7]]\n\n3. If *i* or *j* is negative, the index is relative to the end of the\n string: ``len(s) + i`` or ``len(s) + j`` is substituted. But note\n that ``-0`` is still ``0``.\n\n4. The slice of *s* from *i* to *j* is defined as the sequence of\n items with index *k* such that ``i <= k < j``. If *i* or *j* is\n greater than ``len(s)``, use ``len(s)``. If *i* is omitted or\n ``None``, use ``0``. If *j* is omitted or ``None``, use\n ``len(s)``. If *i* is greater than or equal to *j*, the slice is\n empty.\n\n5. The slice of *s* from *i* to *j* with step *k* is defined as the\n sequence of items with index ``x = i + n*k`` such that ``0 <= n <\n (j-i)/k``. In other words, the indices are ``i``, ``i+k``,\n ``i+2*k``, ``i+3*k`` and so on, stopping when *j* is reached (but\n never including *j*). If *i* or *j* is greater than ``len(s)``,\n use ``len(s)``. If *i* or *j* are omitted or ``None``, they become\n "end" values (which end depends on the sign of *k*). Note, *k*\n cannot be zero. If *k* is ``None``, it is treated like ``1``.\n\n6. If *s* and *t* are both strings, some Python implementations such\n as CPython can usually perform an in-place optimization for\n assignments of the form ``s=s+t`` or ``s+=t``. When applicable,\n this optimization makes quadratic run-time much less likely. This\n optimization is both version and implementation dependent. For\n performance sensitive code, it is preferable to use the\n ``str.join()`` method which assures consistent linear concatenation\n performance across versions and implementations.\n\n Changed in version 2.4: Formerly, string concatenation never\n occurred in-place.\n\n\nString Methods\n==============\n\nBelow are listed the string methods which both 8-bit strings and\nUnicode objects support. Note that none of these methods take keyword\narguments.\n\nIn addition, Python\'s strings support the sequence type methods\ndescribed in the *Sequence Types --- str, unicode, list, tuple,\nbuffer, xrange* section. To output formatted strings use template\nstrings or the ``%`` operator described in the *String Formatting\nOperations* section. Also, see the ``re`` module for string functions\nbased on regular expressions.\n\nstr.capitalize()\n\n Return a copy of the string with only its first character\n capitalized.\n\n For 8-bit strings, this method is locale-dependent.\n\nstr.center(width[, fillchar])\n\n Return centered in a string of length *width*. Padding is done\n using the specified *fillchar* (default is a space).\n\n Changed in version 2.4: Support for the *fillchar* argument.\n\nstr.count(sub[, start[, end]])\n\n Return the number of occurrences of substring *sub* in the range\n [*start*, *end*]. Optional arguments *start* and *end* are\n interpreted as in slice notation.\n\nstr.decode([encoding[, errors]])\n\n Decodes the string using the codec registered for *encoding*.\n *encoding* defaults to the default string encoding. *errors* may\n be given to set a different error handling scheme. The default is\n ``\'strict\'``, meaning that encoding errors raise ``UnicodeError``.\n Other possible values are ``\'ignore\'``, ``\'replace\'`` and any other\n name registered via ``codecs.register_error()``, see section *Codec\n Base Classes*.\n\n Added in version 2.2.\n\n Changed in version 2.3: Support for other error handling schemes\n added.\n\nstr.encode([encoding[, errors]])\n\n Return an encoded version of the string. Default encoding is the\n current default string encoding. *errors* may be given to set a\n different error handling scheme. The default for *errors* is\n ``\'strict\'``, meaning that encoding errors raise a\n ``UnicodeError``. Other possible values are ``\'ignore\'``,\n ``\'replace\'``, ``\'xmlcharrefreplace\'``, ``\'backslashreplace\'`` and\n any other name registered via ``codecs.register_error()``, see\n section *Codec Base Classes*. For a list of possible encodings, see\n section *Standard Encodings*.\n\n Added in version 2.0.\n\n Changed in version 2.3: Support for ``\'xmlcharrefreplace\'`` and\n ``\'backslashreplace\'`` and other error handling schemes added.\n\nstr.endswith(suffix[, start[, end]])\n\n Return ``True`` if the string ends with the specified *suffix*,\n otherwise return ``False``. *suffix* can also be a tuple of\n suffixes to look for. With optional *start*, test beginning at\n that position. With optional *end*, stop comparing at that\n position.\n\n Changed in version 2.5: Accept tuples as *suffix*.\n\nstr.expandtabs([tabsize])\n\n Return a copy of the string where all tab characters are replaced\n by one or more spaces, depending on the current column and the\n given tab size. The column number is reset to zero after each\n newline occurring in the string. If *tabsize* is not given, a tab\n size of ``8`` characters is assumed. This doesn\'t understand other\n non-printing characters or escape sequences.\n\nstr.find(sub[, start[, end]])\n\n Return the lowest index in the string where substring *sub* is\n found, such that *sub* is contained in the range [*start*, *end*].\n Optional arguments *start* and *end* are interpreted as in slice\n notation. Return ``-1`` if *sub* is not found.\n\nstr.format(format_string, *args, **kwargs)\n\n Perform a string formatting operation. The *format_string*\n argument can contain literal text or replacement fields delimited\n by braces ``{}``. Each replacement field contains either the\n numeric index of a positional argument, or the name of a keyword\n argument. Returns a copy of *format_string* where each replacement\n field is replaced with the string value of the corresponding\n argument.\n\n >>> "The sum of 1 + 2 is {0}".format(1+2)\n \'The sum of 1 + 2 is 3\'\n\n See *Format String Syntax* for a description of the various\n formatting options that can be specified in format strings.\n\n This method of string formatting is the new standard in Python 3.0,\n and should be preferred to the ``%`` formatting described in\n *String Formatting Operations* in new code.\n\n Added in version 2.6.\n\nstr.index(sub[, start[, end]])\n\n Like ``find()``, but raise ``ValueError`` when the substring is not\n found.\n\nstr.isalnum()\n\n Return true if all characters in the string are alphanumeric and\n there is at least one character, false otherwise.\n\n For 8-bit strings, this method is locale-dependent.\n\nstr.isalpha()\n\n Return true if all characters in the string are alphabetic and\n there is at least one character, false otherwise.\n\n For 8-bit strings, this method is locale-dependent.\n\nstr.isdigit()\n\n Return true if all characters in the string are digits and there is\n at least one character, false otherwise.\n\n For 8-bit strings, this method is locale-dependent.\n\nstr.islower()\n\n Return true if all cased characters in the string are lowercase and\n there is at least one cased character, false otherwise.\n\n For 8-bit strings, this method is locale-dependent.\n\nstr.isspace()\n\n Return true if there are only whitespace characters in the string\n and there is at least one character, false otherwise.\n\n For 8-bit strings, this method is locale-dependent.\n\nstr.istitle()\n\n Return true if the string is a titlecased string and there is at\n least one character, for example uppercase characters may only\n follow uncased characters and lowercase characters only cased ones.\n Return false otherwise.\n\n For 8-bit strings, this method is locale-dependent.\n\nstr.isupper()\n\n Return true if all cased characters in the string are uppercase and\n there is at least one cased character, false otherwise.\n\n For 8-bit strings, this method is locale-dependent.\n\nstr.join(seq)\n\n Return a string which is the concatenation of the strings in the\n sequence *seq*. The separator between elements is the string\n providing this method.\n\nstr.ljust(width[, fillchar])\n\n Return the string left justified in a string of length *width*.\n Padding is done using the specified *fillchar* (default is a\n space). The original string is returned if *width* is less than\n ``len(s)``.\n\n Changed in version 2.4: Support for the *fillchar* argument.\n\nstr.lower()\n\n Return a copy of the string converted to lowercase.\n\n For 8-bit strings, this method is locale-dependent.\n\nstr.lstrip([chars])\n\n Return a copy of the string with leading characters removed. The\n *chars* argument is a string specifying the set of characters to be\n removed. If omitted or ``None``, the *chars* argument defaults to\n removing whitespace. The *chars* argument is not a prefix; rather,\n all combinations of its values are stripped:\n\n >>> \' spacious \'.lstrip()\n \'spacious \'\n >>> \'www.example.com\'.lstrip(\'cmowz.\')\n \'example.com\'\n\n Changed in version 2.2.2: Support for the *chars* argument.\n\nstr.partition(sep)\n\n Split the string at the first occurrence of *sep*, and return a\n 3-tuple containing the part before the separator, the separator\n itself, and the part after the separator. If the separator is not\n found, return a 3-tuple containing the string itself, followed by\n two empty strings.\n\n Added in version 2.5.\n\nstr.replace(old, new[, count])\n\n Return a copy of the string with all occurrences of substring *old*\n replaced by *new*. If the optional argument *count* is given, only\n the first *count* occurrences are replaced.\n\nstr.rfind(sub[, start[, end]])\n\n Return the highest index in the string where substring *sub* is\n found, such that *sub* is contained within s[start,end]. Optional\n arguments *start* and *end* are interpreted as in slice notation.\n Return ``-1`` on failure.\n\nstr.rindex(sub[, start[, end]])\n\n Like ``rfind()`` but raises ``ValueError`` when the substring *sub*\n is not found.\n\nstr.rjust(width[, fillchar])\n\n Return the string right justified in a string of length *width*.\n Padding is done using the specified *fillchar* (default is a\n space). The original string is returned if *width* is less than\n ``len(s)``.\n\n Changed in version 2.4: Support for the *fillchar* argument.\n\nstr.rpartition(sep)\n\n Split the string at the last occurrence of *sep*, and return a\n 3-tuple containing the part before the separator, the separator\n itself, and the part after the separator. If the separator is not\n found, return a 3-tuple containing two empty strings, followed by\n the string itself.\n\n Added in version 2.5.\n\nstr.rsplit([sep[, maxsplit]])\n\n Return a list of the words in the string, using *sep* as the\n delimiter string. If *maxsplit* is given, at most *maxsplit* splits\n are done, the *rightmost* ones. If *sep* is not specified or\n ``None``, any whitespace string is a separator. Except for\n splitting from the right, ``rsplit()`` behaves like ``split()``\n which is described in detail below.\n\n Added in version 2.4.\n\nstr.rstrip([chars])\n\n Return a copy of the string with trailing characters removed. The\n *chars* argument is a string specifying the set of characters to be\n removed. If omitted or ``None``, the *chars* argument defaults to\n removing whitespace. The *chars* argument is not a suffix; rather,\n all combinations of its values are stripped:\n\n >>> \' spacious \'.rstrip()\n \' spacious\'\n >>> \'mississippi\'.rstrip(\'ipz\')\n \'mississ\'\n\n Changed in version 2.2.2: Support for the *chars* argument.\n\nstr.split([sep[, maxsplit]])\n\n Return a list of the words in the string, using *sep* as the\n delimiter string. If *maxsplit* is given, at most *maxsplit*\n splits are done (thus, the list will have at most ``maxsplit+1``\n elements). If *maxsplit* is not specified, then there is no limit\n on the number of splits (all possible splits are made).\n\n If *sep* is given, consecutive delimiters are not grouped together\n and are deemed to delimit empty strings (for example,\n ``\'1,,2\'.split(\',\')`` returns ``[\'1\', \'\', \'2\']``). The *sep*\n argument may consist of multiple characters (for example,\n ``\'1<>2<>3\'.split(\'<>\')`` returns ``[\'1\', \'2\', \'3\']``). Splitting\n an empty string with a specified separator returns ``[\'\']``.\n\n If *sep* is not specified or is ``None``, a different splitting\n algorithm is applied: runs of consecutive whitespace are regarded\n as a single separator, and the result will contain no empty strings\n at the start or end if the string has leading or trailing\n whitespace. Consequently, splitting an empty string or a string\n consisting of just whitespace with a ``None`` separator returns\n ``[]``.\n\n For example, ``\' 1 2 3 \'.split()`` returns ``[\'1\', \'2\', \'3\']``,\n and ``\' 1 2 3 \'.split(None, 1)`` returns ``[\'1\', \'2 3 \']``.\n\nstr.splitlines([keepends])\n\n Return a list of the lines in the string, breaking at line\n boundaries. Line breaks are not included in the resulting list\n unless *keepends* is given and true.\n\nstr.startswith(prefix[, start[, end]])\n\n Return ``True`` if string starts with the *prefix*, otherwise\n return ``False``. *prefix* can also be a tuple of prefixes to look\n for. With optional *start*, test string beginning at that\n position. With optional *end*, stop comparing string at that\n position.\n\n Changed in version 2.5: Accept tuples as *prefix*.\n\nstr.strip([chars])\n\n Return a copy of the string with the leading and trailing\n characters removed. The *chars* argument is a string specifying the\n set of characters to be removed. If omitted or ``None``, the\n *chars* argument defaults to removing whitespace. The *chars*\n argument is not a prefix or suffix; rather, all combinations of its\n values are stripped:\n\n >>> \' spacious \'.strip()\n \'spacious\'\n >>> \'www.example.com\'.strip(\'cmowz.\')\n \'example\'\n\n Changed in version 2.2.2: Support for the *chars* argument.\n\nstr.swapcase()\n\n Return a copy of the string with uppercase characters converted to\n lowercase and vice versa.\n\n For 8-bit strings, this method is locale-dependent.\n\nstr.title()\n\n Return a titlecased version of the string: words start with\n uppercase characters, all remaining cased characters are lowercase.\n\n For 8-bit strings, this method is locale-dependent.\n\nstr.translate(table[, deletechars])\n\n Return a copy of the string where all characters occurring in the\n optional argument *deletechars* are removed, and the remaining\n characters have been mapped through the given translation table,\n which must be a string of length 256.\n\n You can use the ``maketrans()`` helper function in the ``string``\n module to create a translation table. For string objects, set the\n *table* argument to ``None`` for translations that only delete\n characters:\n\n >>> \'read this short text\'.translate(None, \'aeiou\')\n \'rd ths shrt txt\'\n\n Added in version 2.6: Support for a ``None`` *table* argument.\n\n For Unicode objects, the ``translate()`` method does not accept the\n optional *deletechars* argument. Instead, it returns a copy of the\n *s* where all characters have been mapped through the given\n translation table which must be a mapping of Unicode ordinals to\n Unicode ordinals, Unicode strings or ``None``. Unmapped characters\n are left untouched. Characters mapped to ``None`` are deleted.\n Note, a more flexible approach is to create a custom character\n mapping codec using the ``codecs`` module (see ``encodings.cp1251``\n for an example).\n\nstr.upper()\n\n Return a copy of the string converted to uppercase.\n\n For 8-bit strings, this method is locale-dependent.\n\nstr.zfill(width)\n\n Return the numeric string left filled with zeros in a string of\n length *width*. A sign prefix is handled correctly. The original\n string is returned if *width* is less than ``len(s)``.\n\n Added in version 2.2.2.\n\nThe following methods are present only on unicode objects:\n\nunicode.isnumeric()\n\n Return ``True`` if there are only numeric characters in S,\n ``False`` otherwise. Numeric characters include digit characters,\n and all characters that have the Unicode numeric value property,\n e.g. U+2155, VULGAR FRACTION ONE FIFTH.\n\nunicode.isdecimal()\n\n Return ``True`` if there are only decimal characters in S,\n ``False`` otherwise. Decimal characters include digit characters,\n and all characters that that can be used to form decimal-radix\n numbers, e.g. U+0660, ARABIC-INDIC DIGIT ZERO.\n\n\nString Formatting Operations\n============================\n\nString and Unicode objects have one unique built-in operation: the\n``%`` operator (modulo). This is also known as the string\n*formatting* or *interpolation* operator. Given ``format % values``\n(where *format* is a string or Unicode object), ``%`` conversion\nspecifications in *format* are replaced with zero or more elements of\n*values*. The effect is similar to the using ``sprintf`` in the C\nlanguage. If *format* is a Unicode object, or if any of the objects\nbeing converted using the ``%s`` conversion are Unicode objects, the\nresult will also be a Unicode object.\n\nIf *format* requires a single argument, *values* may be a single non-\ntuple object. [4] Otherwise, *values* must be a tuple with exactly\nthe number of items specified by the format string, or a single\nmapping object (for example, a dictionary).\n\nA conversion specifier contains two or more characters and has the\nfollowing components, which must occur in this order:\n\n1. The ``\'%\'`` character, which marks the start of the specifier.\n\n2. Mapping key (optional), consisting of a parenthesised sequence of\n characters (for example, ``(somename)``).\n\n3. Conversion flags (optional), which affect the result of some\n conversion types.\n\n4. Minimum field width (optional). If specified as an ``\'*\'``\n (asterisk), the actual width is read from the next element of the\n tuple in *values*, and the object to convert comes after the\n minimum field width and optional precision.\n\n5. Precision (optional), given as a ``\'.\'`` (dot) followed by the\n precision. If specified as ``\'*\'`` (an asterisk), the actual width\n is read from the next element of the tuple in *values*, and the\n value to convert comes after the precision.\n\n6. Length modifier (optional).\n\n7. Conversion type.\n\nWhen the right argument is a dictionary (or other mapping type), then\nthe formats in the string *must* include a parenthesised mapping key\ninto that dictionary inserted immediately after the ``\'%\'`` character.\nThe mapping key selects the value to be formatted from the mapping.\nFor example:\n\n>>> print \'%(language)s has %(#)03d quote types.\' % \\\n... {\'language\': "Python", "#": 2}\nPython has 002 quote types.\n\nIn this case no ``*`` specifiers may occur in a format (since they\nrequire a sequential parameter list).\n\nThe conversion flag characters are:\n\n+-----------+-----------------------------------------------------------------------+\n| Flag | Meaning |\n+===========+=======================================================================+\n| ``\'#\'`` | The value conversion will use the "alternate form" (where defined |\n| | below). |\n+-----------+-----------------------------------------------------------------------+\n| ``\'0\'`` | The conversion will be zero padded for numeric values. |\n+-----------+-----------------------------------------------------------------------+\n| ``\'-\'`` | The converted value is left adjusted (overrides the ``\'0\'`` |\n| | conversion if both are given). |\n+-----------+-----------------------------------------------------------------------+\n| ``\' \'`` | (a space) A blank should be left before a positive number (or empty |\n| | string) produced by a signed conversion. |\n+-----------+-----------------------------------------------------------------------+\n| ``\'+\'`` | A sign character (``\'+\'`` or ``\'-\'``) will precede the conversion |\n| | (overrides a "space" flag). |\n+-----------+-----------------------------------------------------------------------+\n\nA length modifier (``h``, ``l``, or ``L``) may be present, but is\nignored as it is not necessary for Python -- so e.g. ``%ld`` is\nidentical to ``%d``.\n\nThe conversion types are:\n\n+--------------+-------------------------------------------------------+---------+\n| Conversion | Meaning | Notes |\n+==============+=======================================================+=========+\n| ``\'d\'`` | Signed integer decimal. | |\n+--------------+-------------------------------------------------------+---------+\n| ``\'i\'`` | Signed integer decimal. | |\n+--------------+-------------------------------------------------------+---------+\n| ``\'o\'`` | Signed octal value. | (1) |\n+--------------+-------------------------------------------------------+---------+\n| ``\'u\'`` | Obselete type -- it is identical to ``\'d\'``. | (7) |\n+--------------+-------------------------------------------------------+---------+\n| ``\'x\'`` | Signed hexadecimal (lowercase). | (2) |\n+--------------+-------------------------------------------------------+---------+\n| ``\'X\'`` | Signed hexadecimal (uppercase). | (2) |\n+--------------+-------------------------------------------------------+---------+\n| ``\'e\'`` | Floating point exponential format (lowercase). | (3) |\n+--------------+-------------------------------------------------------+---------+\n| ``\'E\'`` | Floating point exponential format (uppercase). | (3) |\n+--------------+-------------------------------------------------------+---------+\n| ``\'f\'`` | Floating point decimal format. | (3) |\n+--------------+-------------------------------------------------------+---------+\n| ``\'F\'`` | Floating point decimal format. | (3) |\n+--------------+-------------------------------------------------------+---------+\n| ``\'g\'`` | Floating point format. Uses lowercase exponential | (4) |\n| | format if exponent is less than -4 or not less than | |\n| | precision, decimal format otherwise. | |\n+--------------+-------------------------------------------------------+---------+\n| ``\'G\'`` | Floating point format. Uses uppercase exponential | (4) |\n| | format if exponent is less than -4 or not less than | |\n| | precision, decimal format otherwise. | |\n+--------------+-------------------------------------------------------+---------+\n| ``\'c\'`` | Single character (accepts integer or single character | |\n| | string). | |\n+--------------+-------------------------------------------------------+---------+\n| ``\'r\'`` | String (converts any python object using ``repr()``). | (5) |\n+--------------+-------------------------------------------------------+---------+\n| ``\'s\'`` | String (converts any python object using ``str()``). | (6) |\n+--------------+-------------------------------------------------------+---------+\n| ``\'%\'`` | No argument is converted, results in a ``\'%\'`` | |\n| | character in the result. | |\n+--------------+-------------------------------------------------------+---------+\n\nNotes:\n\n1. The alternate form causes a leading zero (``\'0\'``) to be inserted\n between left-hand padding and the formatting of the number if the\n leading character of the result is not already a zero.\n\n2. The alternate form causes a leading ``\'0x\'`` or ``\'0X\'`` (depending\n on whether the ``\'x\'`` or ``\'X\'`` format was used) to be inserted\n between left-hand padding and the formatting of the number if the\n leading character of the result is not already a zero.\n\n3. The alternate form causes the result to always contain a decimal\n point, even if no digits follow it.\n\n The precision determines the number of digits after the decimal\n point and defaults to 6.\n\n4. The alternate form causes the result to always contain a decimal\n point, and trailing zeroes are not removed as they would otherwise\n be.\n\n The precision determines the number of significant digits before\n and after the decimal point and defaults to 6.\n\n5. The ``%r`` conversion was added in Python 2.0.\n\n The precision determines the maximal number of characters used.\n\n6. If the object or format provided is a ``unicode`` string, the\n resulting string will also be ``unicode``.\n\n The precision determines the maximal number of characters used.\n\n7. See **PEP 237**.\n\nSince Python strings have an explicit length, ``%s`` conversions do\nnot assume that ``\'\\0\'`` is the end of the string.\n\nFor safety reasons, floating point precisions are clipped to 50;\n``%f`` conversions for numbers whose absolute value is over 1e25 are\nreplaced by ``%g`` conversions. [5] All other errors raise\nexceptions.\n\nAdditional string operations are defined in standard modules\n``string`` and ``re``.\n\n\nXRange Type\n===========\n\nThe ``xrange`` type is an immutable sequence which is commonly used\nfor looping. The advantage of the ``xrange`` type is that an\n``xrange`` object will always take the same amount of memory, no\nmatter the size of the range it represents. There are no consistent\nperformance advantages.\n\nXRange objects have very little behavior: they only support indexing,\niteration, and the ``len()`` function.\n\n\nMutable Sequence Types\n======================\n\nList objects support additional operations that allow in-place\nmodification of the object. Other mutable sequence types (when added\nto the language) should also support these operations. Strings and\ntuples are immutable sequence types: such objects cannot be modified\nonce created. The following operations are defined on mutable sequence\ntypes (where *x* is an arbitrary object):\n\n+--------------------------------+----------------------------------+-----------------------+\n| Operation | Result | Notes |\n+================================+==================================+=======================+\n| ``s[i] = x`` | item *i* of *s* is replaced by | |\n| | *x* | |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s[i:j] = t`` | slice of *s* from *i* to *j* is | |\n| | replaced by the contents of the | |\n| | iterable *t* | |\n+--------------------------------+----------------------------------+-----------------------+\n| ``del s[i:j]`` | same as ``s[i:j] = []`` | |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s[i:j:k] = t`` | the elements of ``s[i:j:k]`` are | (1) |\n| | replaced by those of *t* | |\n+--------------------------------+----------------------------------+-----------------------+\n| ``del s[i:j:k]`` | removes the elements of | |\n| | ``s[i:j:k]`` from the list | |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s.append(x)`` | same as ``s[len(s):len(s)] = | (2) |\n| | [x]`` | |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s.extend(x)`` | same as ``s[len(s):len(s)] = x`` | (3) |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s.count(x)`` | return number of *i*\'s for which | |\n| | ``s[i] == x`` | |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s.index(x[, i[, j]])`` | return smallest *k* such that | (4) |\n| | ``s[k] == x`` and ``i <= k < j`` | |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s.insert(i, x)`` | same as ``s[i:i] = [x]`` | (5) |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s.pop([i])`` | same as ``x = s[i]; del s[i]; | (6) |\n| | return x`` | |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s.remove(x)`` | same as ``del s[s.index(x)]`` | (4) |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s.reverse()`` | reverses the items of *s* in | (7) |\n| | place | |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s.sort([cmp[, key[, | sort the items of *s* in place | (7)(8)(9)(10) |\n| reverse]]])`` | | |\n+--------------------------------+----------------------------------+-----------------------+\n\nNotes:\n\n1. *t* must have the same length as the slice it is replacing.\n\n2. The C implementation of Python has historically accepted multiple\n parameters and implicitly joined them into a tuple; this no longer\n works in Python 2.0. Use of this misfeature has been deprecated\n since Python 1.4.\n\n3. *x* can be any iterable object.\n\n4. Raises ``ValueError`` when *x* is not found in *s*. When a negative\n index is passed as the second or third parameter to the ``index()``\n method, the list length is added, as for slice indices. If it is\n still negative, it is truncated to zero, as for slice indices.\n\n Changed in version 2.3: Previously, ``index()`` didn\'t have\n arguments for specifying start and stop positions.\n\n5. When a negative index is passed as the first parameter to the\n ``insert()`` method, the list length is added, as for slice\n indices. If it is still negative, it is truncated to zero, as for\n slice indices.\n\n Changed in version 2.3: Previously, all negative indices were\n truncated to zero.\n\n6. The ``pop()`` method is only supported by the list and array types.\n The optional argument *i* defaults to ``-1``, so that by default\n the last item is removed and returned.\n\n7. The ``sort()`` and ``reverse()`` methods modify the list in place\n for economy of space when sorting or reversing a large list. To\n remind you that they operate by side effect, they don\'t return the\n sorted or reversed list.\n\n8. The ``sort()`` method takes optional arguments for controlling the\n comparisons.\n\n *cmp* specifies a custom comparison function of two arguments (list\n items) which should return a negative, zero or positive number\n depending on whether the first argument is considered smaller than,\n equal to, or larger than the second argument: ``cmp=lambda x,y:\n cmp(x.lower(), y.lower())``. The default value is ``None``.\n\n *key* specifies a function of one argument that is used to extract\n a comparison key from each list element: ``key=str.lower``. The\n default value is ``None``.\n\n *reverse* is a boolean value. If set to ``True``, then the list\n elements are sorted as if each comparison were reversed.\n\n In general, the *key* and *reverse* conversion processes are much\n faster than specifying an equivalent *cmp* function. This is\n because *cmp* is called multiple times for each list element while\n *key* and *reverse* touch each element only once.\n\n Changed in version 2.3: Support for ``None`` as an equivalent to\n omitting *cmp* was added.\n\n Changed in version 2.4: Support for *key* and *reverse* was added.\n\n9. Starting with Python 2.3, the ``sort()`` method is guaranteed to be\n stable. A sort is stable if it guarantees not to change the\n relative order of elements that compare equal --- this is helpful\n for sorting in multiple passes (for example, sort by department,\n then by salary grade).\n\n10. While a list is being sorted, the effect of attempting to mutate,\n or even inspect, the list is undefined. The C implementation of\n Python 2.3 and newer makes the list appear empty for the duration,\n and raises ``ValueError`` if it can detect that the list has been\n mutated during a sort.\n', + 'typesseq': u'\nSequence Types --- ``str``, ``unicode``, ``list``, ``tuple``, ``buffer``, ``xrange``\n************************************************************************************\n\nThere are six sequence types: strings, Unicode strings, lists, tuples,\nbuffers, and xrange objects. (For other containers see the built in\n``dict``, ``list``, ``set``, and ``tuple`` classes, and the\n``collections`` module.)\n\nString literals are written in single or double quotes: ``\'xyzzy\'``,\n``"frobozz"``. See *String literals* for more about string literals.\nUnicode strings are much like strings, but are specified in the syntax\nusing a preceding ``\'u\'`` character: ``u\'abc\'``, ``u"def"``. In\naddition to the functionality described here, there are also string-\nspecific methods described in the *String Methods* section. Lists are\nconstructed with square brackets, separating items with commas: ``[a,\nb, c]``. Tuples are constructed by the comma operator (not within\nsquare brackets), with or without enclosing parentheses, but an empty\ntuple must have the enclosing parentheses, such as ``a, b, c`` or\n``()``. A single item tuple must have a trailing comma, such as\n``(d,)``.\n\nBuffer objects are not directly supported by Python syntax, but can be\ncreated by calling the builtin function ``buffer()``. They don\'t\nsupport concatenation or repetition.\n\nObjects of type xrange are similar to buffers in that there is no\nspecific syntax to create them, but they are created using the\n``xrange()`` function. They don\'t support slicing, concatenation or\nrepetition, and using ``in``, ``not in``, ``min()`` or ``max()`` on\nthem is inefficient.\n\nMost sequence types support the following operations. The ``in`` and\n``not in`` operations have the same priorities as the comparison\noperations. The ``+`` and ``*`` operations have the same priority as\nthe corresponding numeric operations. [3] Additional methods are\nprovided for *Mutable Sequence Types*.\n\nThis table lists the sequence operations sorted in ascending priority\n(operations in the same box have the same priority). In the table,\n*s* and *t* are sequences of the same type; *n*, *i* and *j* are\nintegers:\n\n+--------------------+----------------------------------+------------+\n| Operation | Result | Notes |\n+====================+==================================+============+\n| ``x in s`` | ``True`` if an item of *s* is | (1) |\n| | equal to *x*, else ``False`` | |\n+--------------------+----------------------------------+------------+\n| ``x not in s`` | ``False`` if an item of *s* is | (1) |\n| | equal to *x*, else ``True`` | |\n+--------------------+----------------------------------+------------+\n| ``s + t`` | the concatenation of *s* and *t* | (6) |\n+--------------------+----------------------------------+------------+\n| ``s * n, n * s`` | *n* shallow copies of *s* | (2) |\n| | concatenated | |\n+--------------------+----------------------------------+------------+\n| ``s[i]`` | *i*\'th item of *s*, origin 0 | (3) |\n+--------------------+----------------------------------+------------+\n| ``s[i:j]`` | slice of *s* from *i* to *j* | (3)(4) |\n+--------------------+----------------------------------+------------+\n| ``s[i:j:k]`` | slice of *s* from *i* to *j* | (3)(5) |\n| | with step *k* | |\n+--------------------+----------------------------------+------------+\n| ``len(s)`` | length of *s* | |\n+--------------------+----------------------------------+------------+\n| ``min(s)`` | smallest item of *s* | |\n+--------------------+----------------------------------+------------+\n| ``max(s)`` | largest item of *s* | |\n+--------------------+----------------------------------+------------+\n\nSequence types also support comparisons. In particular, tuples and\nlists are compared lexicographically by comparing corresponding\nelements. This means that to compare equal, every element must compare\nequal and the two sequences must be of the same type and have the same\nlength. (For full details see *Comparisons* in the language\nreference.)\n\nNotes:\n\n1. When *s* is a string or Unicode string object the ``in`` and ``not\n in`` operations act like a substring test. In Python versions\n before 2.3, *x* had to be a string of length 1. In Python 2.3 and\n beyond, *x* may be a string of any length.\n\n2. Values of *n* less than ``0`` are treated as ``0`` (which yields an\n empty sequence of the same type as *s*). Note also that the copies\n are shallow; nested structures are not copied. This often haunts\n new Python programmers; consider:\n\n >>> lists = [[]] * 3\n >>> lists\n [[], [], []]\n >>> lists[0].append(3)\n >>> lists\n [[3], [3], [3]]\n\n What has happened is that ``[[]]`` is a one-element list containing\n an empty list, so all three elements of ``[[]] * 3`` are (pointers\n to) this single empty list. Modifying any of the elements of\n ``lists`` modifies this single list. You can create a list of\n different lists this way:\n\n >>> lists = [[] for i in range(3)]\n >>> lists[0].append(3)\n >>> lists[1].append(5)\n >>> lists[2].append(7)\n >>> lists\n [[3], [5], [7]]\n\n3. If *i* or *j* is negative, the index is relative to the end of the\n string: ``len(s) + i`` or ``len(s) + j`` is substituted. But note\n that ``-0`` is still ``0``.\n\n4. The slice of *s* from *i* to *j* is defined as the sequence of\n items with index *k* such that ``i <= k < j``. If *i* or *j* is\n greater than ``len(s)``, use ``len(s)``. If *i* is omitted or\n ``None``, use ``0``. If *j* is omitted or ``None``, use\n ``len(s)``. If *i* is greater than or equal to *j*, the slice is\n empty.\n\n5. The slice of *s* from *i* to *j* with step *k* is defined as the\n sequence of items with index ``x = i + n*k`` such that ``0 <= n <\n (j-i)/k``. In other words, the indices are ``i``, ``i+k``,\n ``i+2*k``, ``i+3*k`` and so on, stopping when *j* is reached (but\n never including *j*). If *i* or *j* is greater than ``len(s)``,\n use ``len(s)``. If *i* or *j* are omitted or ``None``, they become\n "end" values (which end depends on the sign of *k*). Note, *k*\n cannot be zero. If *k* is ``None``, it is treated like ``1``.\n\n6. If *s* and *t* are both strings, some Python implementations such\n as CPython can usually perform an in-place optimization for\n assignments of the form ``s=s+t`` or ``s+=t``. When applicable,\n this optimization makes quadratic run-time much less likely. This\n optimization is both version and implementation dependent. For\n performance sensitive code, it is preferable to use the\n ``str.join()`` method which assures consistent linear concatenation\n performance across versions and implementations.\n\n Changed in version 2.4: Formerly, string concatenation never\n occurred in-place.\n\n\nString Methods\n==============\n\nBelow are listed the string methods which both 8-bit strings and\nUnicode objects support. Note that none of these methods take keyword\narguments.\n\nIn addition, Python\'s strings support the sequence type methods\ndescribed in the *Sequence Types --- str, unicode, list, tuple,\nbuffer, xrange* section. To output formatted strings use template\nstrings or the ``%`` operator described in the *String Formatting\nOperations* section. Also, see the ``re`` module for string functions\nbased on regular expressions.\n\nstr.capitalize()\n\n Return a copy of the string with only its first character\n capitalized.\n\n For 8-bit strings, this method is locale-dependent.\n\nstr.center(width[, fillchar])\n\n Return centered in a string of length *width*. Padding is done\n using the specified *fillchar* (default is a space).\n\n Changed in version 2.4: Support for the *fillchar* argument.\n\nstr.count(sub[, start[, end]])\n\n Return the number of occurrences of substring *sub* in the range\n [*start*, *end*]. Optional arguments *start* and *end* are\n interpreted as in slice notation.\n\nstr.decode([encoding[, errors]])\n\n Decodes the string using the codec registered for *encoding*.\n *encoding* defaults to the default string encoding. *errors* may\n be given to set a different error handling scheme. The default is\n ``\'strict\'``, meaning that encoding errors raise ``UnicodeError``.\n Other possible values are ``\'ignore\'``, ``\'replace\'`` and any other\n name registered via ``codecs.register_error()``, see section *Codec\n Base Classes*.\n\n New in version 2.2.\n\n Changed in version 2.3: Support for other error handling schemes\n added.\n\nstr.encode([encoding[, errors]])\n\n Return an encoded version of the string. Default encoding is the\n current default string encoding. *errors* may be given to set a\n different error handling scheme. The default for *errors* is\n ``\'strict\'``, meaning that encoding errors raise a\n ``UnicodeError``. Other possible values are ``\'ignore\'``,\n ``\'replace\'``, ``\'xmlcharrefreplace\'``, ``\'backslashreplace\'`` and\n any other name registered via ``codecs.register_error()``, see\n section *Codec Base Classes*. For a list of possible encodings, see\n section *Standard Encodings*.\n\n New in version 2.0.\n\n Changed in version 2.3: Support for ``\'xmlcharrefreplace\'`` and\n ``\'backslashreplace\'`` and other error handling schemes added.\n\nstr.endswith(suffix[, start[, end]])\n\n Return ``True`` if the string ends with the specified *suffix*,\n otherwise return ``False``. *suffix* can also be a tuple of\n suffixes to look for. With optional *start*, test beginning at\n that position. With optional *end*, stop comparing at that\n position.\n\n Changed in version 2.5: Accept tuples as *suffix*.\n\nstr.expandtabs([tabsize])\n\n Return a copy of the string where all tab characters are replaced\n by one or more spaces, depending on the current column and the\n given tab size. The column number is reset to zero after each\n newline occurring in the string. If *tabsize* is not given, a tab\n size of ``8`` characters is assumed. This doesn\'t understand other\n non-printing characters or escape sequences.\n\nstr.find(sub[, start[, end]])\n\n Return the lowest index in the string where substring *sub* is\n found, such that *sub* is contained in the range [*start*, *end*].\n Optional arguments *start* and *end* are interpreted as in slice\n notation. Return ``-1`` if *sub* is not found.\n\nstr.format(format_string, *args, **kwargs)\n\n Perform a string formatting operation. The *format_string*\n argument can contain literal text or replacement fields delimited\n by braces ``{}``. Each replacement field contains either the\n numeric index of a positional argument, or the name of a keyword\n argument. Returns a copy of *format_string* where each replacement\n field is replaced with the string value of the corresponding\n argument.\n\n >>> "The sum of 1 + 2 is {0}".format(1+2)\n \'The sum of 1 + 2 is 3\'\n\n See *Format String Syntax* for a description of the various\n formatting options that can be specified in format strings.\n\n This method of string formatting is the new standard in Python 3.0,\n and should be preferred to the ``%`` formatting described in\n *String Formatting Operations* in new code.\n\n New in version 2.6.\n\nstr.index(sub[, start[, end]])\n\n Like ``find()``, but raise ``ValueError`` when the substring is not\n found.\n\nstr.isalnum()\n\n Return true if all characters in the string are alphanumeric and\n there is at least one character, false otherwise.\n\n For 8-bit strings, this method is locale-dependent.\n\nstr.isalpha()\n\n Return true if all characters in the string are alphabetic and\n there is at least one character, false otherwise.\n\n For 8-bit strings, this method is locale-dependent.\n\nstr.isdigit()\n\n Return true if all characters in the string are digits and there is\n at least one character, false otherwise.\n\n For 8-bit strings, this method is locale-dependent.\n\nstr.islower()\n\n Return true if all cased characters in the string are lowercase and\n there is at least one cased character, false otherwise.\n\n For 8-bit strings, this method is locale-dependent.\n\nstr.isspace()\n\n Return true if there are only whitespace characters in the string\n and there is at least one character, false otherwise.\n\n For 8-bit strings, this method is locale-dependent.\n\nstr.istitle()\n\n Return true if the string is a titlecased string and there is at\n least one character, for example uppercase characters may only\n follow uncased characters and lowercase characters only cased ones.\n Return false otherwise.\n\n For 8-bit strings, this method is locale-dependent.\n\nstr.isupper()\n\n Return true if all cased characters in the string are uppercase and\n there is at least one cased character, false otherwise.\n\n For 8-bit strings, this method is locale-dependent.\n\nstr.join(seq)\n\n Return a string which is the concatenation of the strings in the\n sequence *seq*. The separator between elements is the string\n providing this method.\n\nstr.ljust(width[, fillchar])\n\n Return the string left justified in a string of length *width*.\n Padding is done using the specified *fillchar* (default is a\n space). The original string is returned if *width* is less than\n ``len(s)``.\n\n Changed in version 2.4: Support for the *fillchar* argument.\n\nstr.lower()\n\n Return a copy of the string converted to lowercase.\n\n For 8-bit strings, this method is locale-dependent.\n\nstr.lstrip([chars])\n\n Return a copy of the string with leading characters removed. The\n *chars* argument is a string specifying the set of characters to be\n removed. If omitted or ``None``, the *chars* argument defaults to\n removing whitespace. The *chars* argument is not a prefix; rather,\n all combinations of its values are stripped:\n\n >>> \' spacious \'.lstrip()\n \'spacious \'\n >>> \'www.example.com\'.lstrip(\'cmowz.\')\n \'example.com\'\n\n Changed in version 2.2.2: Support for the *chars* argument.\n\nstr.partition(sep)\n\n Split the string at the first occurrence of *sep*, and return a\n 3-tuple containing the part before the separator, the separator\n itself, and the part after the separator. If the separator is not\n found, return a 3-tuple containing the string itself, followed by\n two empty strings.\n\n New in version 2.5.\n\nstr.replace(old, new[, count])\n\n Return a copy of the string with all occurrences of substring *old*\n replaced by *new*. If the optional argument *count* is given, only\n the first *count* occurrences are replaced.\n\nstr.rfind(sub[, start[, end]])\n\n Return the highest index in the string where substring *sub* is\n found, such that *sub* is contained within s[start,end]. Optional\n arguments *start* and *end* are interpreted as in slice notation.\n Return ``-1`` on failure.\n\nstr.rindex(sub[, start[, end]])\n\n Like ``rfind()`` but raises ``ValueError`` when the substring *sub*\n is not found.\n\nstr.rjust(width[, fillchar])\n\n Return the string right justified in a string of length *width*.\n Padding is done using the specified *fillchar* (default is a\n space). The original string is returned if *width* is less than\n ``len(s)``.\n\n Changed in version 2.4: Support for the *fillchar* argument.\n\nstr.rpartition(sep)\n\n Split the string at the last occurrence of *sep*, and return a\n 3-tuple containing the part before the separator, the separator\n itself, and the part after the separator. If the separator is not\n found, return a 3-tuple containing two empty strings, followed by\n the string itself.\n\n New in version 2.5.\n\nstr.rsplit([sep[, maxsplit]])\n\n Return a list of the words in the string, using *sep* as the\n delimiter string. If *maxsplit* is given, at most *maxsplit* splits\n are done, the *rightmost* ones. If *sep* is not specified or\n ``None``, any whitespace string is a separator. Except for\n splitting from the right, ``rsplit()`` behaves like ``split()``\n which is described in detail below.\n\n New in version 2.4.\n\nstr.rstrip([chars])\n\n Return a copy of the string with trailing characters removed. The\n *chars* argument is a string specifying the set of characters to be\n removed. If omitted or ``None``, the *chars* argument defaults to\n removing whitespace. The *chars* argument is not a suffix; rather,\n all combinations of its values are stripped:\n\n >>> \' spacious \'.rstrip()\n \' spacious\'\n >>> \'mississippi\'.rstrip(\'ipz\')\n \'mississ\'\n\n Changed in version 2.2.2: Support for the *chars* argument.\n\nstr.split([sep[, maxsplit]])\n\n Return a list of the words in the string, using *sep* as the\n delimiter string. If *maxsplit* is given, at most *maxsplit*\n splits are done (thus, the list will have at most ``maxsplit+1``\n elements). If *maxsplit* is not specified, then there is no limit\n on the number of splits (all possible splits are made).\n\n If *sep* is given, consecutive delimiters are not grouped together\n and are deemed to delimit empty strings (for example,\n ``\'1,,2\'.split(\',\')`` returns ``[\'1\', \'\', \'2\']``). The *sep*\n argument may consist of multiple characters (for example,\n ``\'1<>2<>3\'.split(\'<>\')`` returns ``[\'1\', \'2\', \'3\']``). Splitting\n an empty string with a specified separator returns ``[\'\']``.\n\n If *sep* is not specified or is ``None``, a different splitting\n algorithm is applied: runs of consecutive whitespace are regarded\n as a single separator, and the result will contain no empty strings\n at the start or end if the string has leading or trailing\n whitespace. Consequently, splitting an empty string or a string\n consisting of just whitespace with a ``None`` separator returns\n ``[]``.\n\n For example, ``\' 1 2 3 \'.split()`` returns ``[\'1\', \'2\', \'3\']``,\n and ``\' 1 2 3 \'.split(None, 1)`` returns ``[\'1\', \'2 3 \']``.\n\nstr.splitlines([keepends])\n\n Return a list of the lines in the string, breaking at line\n boundaries. Line breaks are not included in the resulting list\n unless *keepends* is given and true.\n\nstr.startswith(prefix[, start[, end]])\n\n Return ``True`` if string starts with the *prefix*, otherwise\n return ``False``. *prefix* can also be a tuple of prefixes to look\n for. With optional *start*, test string beginning at that\n position. With optional *end*, stop comparing string at that\n position.\n\n Changed in version 2.5: Accept tuples as *prefix*.\n\nstr.strip([chars])\n\n Return a copy of the string with the leading and trailing\n characters removed. The *chars* argument is a string specifying the\n set of characters to be removed. If omitted or ``None``, the\n *chars* argument defaults to removing whitespace. The *chars*\n argument is not a prefix or suffix; rather, all combinations of its\n values are stripped:\n\n >>> \' spacious \'.strip()\n \'spacious\'\n >>> \'www.example.com\'.strip(\'cmowz.\')\n \'example\'\n\n Changed in version 2.2.2: Support for the *chars* argument.\n\nstr.swapcase()\n\n Return a copy of the string with uppercase characters converted to\n lowercase and vice versa.\n\n For 8-bit strings, this method is locale-dependent.\n\nstr.title()\n\n Return a titlecased version of the string: words start with\n uppercase characters, all remaining cased characters are lowercase.\n\n For 8-bit strings, this method is locale-dependent.\n\nstr.translate(table[, deletechars])\n\n Return a copy of the string where all characters occurring in the\n optional argument *deletechars* are removed, and the remaining\n characters have been mapped through the given translation table,\n which must be a string of length 256.\n\n You can use the ``maketrans()`` helper function in the ``string``\n module to create a translation table. For string objects, set the\n *table* argument to ``None`` for translations that only delete\n characters:\n\n >>> \'read this short text\'.translate(None, \'aeiou\')\n \'rd ths shrt txt\'\n\n New in version 2.6: Support for a ``None`` *table* argument.\n\n For Unicode objects, the ``translate()`` method does not accept the\n optional *deletechars* argument. Instead, it returns a copy of the\n *s* where all characters have been mapped through the given\n translation table which must be a mapping of Unicode ordinals to\n Unicode ordinals, Unicode strings or ``None``. Unmapped characters\n are left untouched. Characters mapped to ``None`` are deleted.\n Note, a more flexible approach is to create a custom character\n mapping codec using the ``codecs`` module (see ``encodings.cp1251``\n for an example).\n\nstr.upper()\n\n Return a copy of the string converted to uppercase.\n\n For 8-bit strings, this method is locale-dependent.\n\nstr.zfill(width)\n\n Return the numeric string left filled with zeros in a string of\n length *width*. A sign prefix is handled correctly. The original\n string is returned if *width* is less than ``len(s)``.\n\n New in version 2.2.2.\n\nThe following methods are present only on unicode objects:\n\nunicode.isnumeric()\n\n Return ``True`` if there are only numeric characters in S,\n ``False`` otherwise. Numeric characters include digit characters,\n and all characters that have the Unicode numeric value property,\n e.g. U+2155, VULGAR FRACTION ONE FIFTH.\n\nunicode.isdecimal()\n\n Return ``True`` if there are only decimal characters in S,\n ``False`` otherwise. Decimal characters include digit characters,\n and all characters that that can be used to form decimal-radix\n numbers, e.g. U+0660, ARABIC-INDIC DIGIT ZERO.\n\n\nString Formatting Operations\n============================\n\nString and Unicode objects have one unique built-in operation: the\n``%`` operator (modulo). This is also known as the string\n*formatting* or *interpolation* operator. Given ``format % values``\n(where *format* is a string or Unicode object), ``%`` conversion\nspecifications in *format* are replaced with zero or more elements of\n*values*. The effect is similar to the using ``sprintf`` in the C\nlanguage. If *format* is a Unicode object, or if any of the objects\nbeing converted using the ``%s`` conversion are Unicode objects, the\nresult will also be a Unicode object.\n\nIf *format* requires a single argument, *values* may be a single non-\ntuple object. [4] Otherwise, *values* must be a tuple with exactly\nthe number of items specified by the format string, or a single\nmapping object (for example, a dictionary).\n\nA conversion specifier contains two or more characters and has the\nfollowing components, which must occur in this order:\n\n1. The ``\'%\'`` character, which marks the start of the specifier.\n\n2. Mapping key (optional), consisting of a parenthesised sequence of\n characters (for example, ``(somename)``).\n\n3. Conversion flags (optional), which affect the result of some\n conversion types.\n\n4. Minimum field width (optional). If specified as an ``\'*\'``\n (asterisk), the actual width is read from the next element of the\n tuple in *values*, and the object to convert comes after the\n minimum field width and optional precision.\n\n5. Precision (optional), given as a ``\'.\'`` (dot) followed by the\n precision. If specified as ``\'*\'`` (an asterisk), the actual width\n is read from the next element of the tuple in *values*, and the\n value to convert comes after the precision.\n\n6. Length modifier (optional).\n\n7. Conversion type.\n\nWhen the right argument is a dictionary (or other mapping type), then\nthe formats in the string *must* include a parenthesised mapping key\ninto that dictionary inserted immediately after the ``\'%\'`` character.\nThe mapping key selects the value to be formatted from the mapping.\nFor example:\n\n>>> print \'%(language)s has %(#)03d quote types.\' % \\\n... {\'language\': "Python", "#": 2}\nPython has 002 quote types.\n\nIn this case no ``*`` specifiers may occur in a format (since they\nrequire a sequential parameter list).\n\nThe conversion flag characters are:\n\n+-----------+-----------------------------------------------------------------------+\n| Flag | Meaning |\n+===========+=======================================================================+\n| ``\'#\'`` | The value conversion will use the "alternate form" (where defined |\n| | below). |\n+-----------+-----------------------------------------------------------------------+\n| ``\'0\'`` | The conversion will be zero padded for numeric values. |\n+-----------+-----------------------------------------------------------------------+\n| ``\'-\'`` | The converted value is left adjusted (overrides the ``\'0\'`` |\n| | conversion if both are given). |\n+-----------+-----------------------------------------------------------------------+\n| ``\' \'`` | (a space) A blank should be left before a positive number (or empty |\n| | string) produced by a signed conversion. |\n+-----------+-----------------------------------------------------------------------+\n| ``\'+\'`` | A sign character (``\'+\'`` or ``\'-\'``) will precede the conversion |\n| | (overrides a "space" flag). |\n+-----------+-----------------------------------------------------------------------+\n\nA length modifier (``h``, ``l``, or ``L``) may be present, but is\nignored as it is not necessary for Python -- so e.g. ``%ld`` is\nidentical to ``%d``.\n\nThe conversion types are:\n\n+--------------+-------------------------------------------------------+---------+\n| Conversion | Meaning | Notes |\n+==============+=======================================================+=========+\n| ``\'d\'`` | Signed integer decimal. | |\n+--------------+-------------------------------------------------------+---------+\n| ``\'i\'`` | Signed integer decimal. | |\n+--------------+-------------------------------------------------------+---------+\n| ``\'o\'`` | Signed octal value. | (1) |\n+--------------+-------------------------------------------------------+---------+\n| ``\'u\'`` | Obselete type -- it is identical to ``\'d\'``. | (7) |\n+--------------+-------------------------------------------------------+---------+\n| ``\'x\'`` | Signed hexadecimal (lowercase). | (2) |\n+--------------+-------------------------------------------------------+---------+\n| ``\'X\'`` | Signed hexadecimal (uppercase). | (2) |\n+--------------+-------------------------------------------------------+---------+\n| ``\'e\'`` | Floating point exponential format (lowercase). | (3) |\n+--------------+-------------------------------------------------------+---------+\n| ``\'E\'`` | Floating point exponential format (uppercase). | (3) |\n+--------------+-------------------------------------------------------+---------+\n| ``\'f\'`` | Floating point decimal format. | (3) |\n+--------------+-------------------------------------------------------+---------+\n| ``\'F\'`` | Floating point decimal format. | (3) |\n+--------------+-------------------------------------------------------+---------+\n| ``\'g\'`` | Floating point format. Uses lowercase exponential | (4) |\n| | format if exponent is less than -4 or not less than | |\n| | precision, decimal format otherwise. | |\n+--------------+-------------------------------------------------------+---------+\n| ``\'G\'`` | Floating point format. Uses uppercase exponential | (4) |\n| | format if exponent is less than -4 or not less than | |\n| | precision, decimal format otherwise. | |\n+--------------+-------------------------------------------------------+---------+\n| ``\'c\'`` | Single character (accepts integer or single character | |\n| | string). | |\n+--------------+-------------------------------------------------------+---------+\n| ``\'r\'`` | String (converts any python object using ``repr()``). | (5) |\n+--------------+-------------------------------------------------------+---------+\n| ``\'s\'`` | String (converts any python object using ``str()``). | (6) |\n+--------------+-------------------------------------------------------+---------+\n| ``\'%\'`` | No argument is converted, results in a ``\'%\'`` | |\n| | character in the result. | |\n+--------------+-------------------------------------------------------+---------+\n\nNotes:\n\n1. The alternate form causes a leading zero (``\'0\'``) to be inserted\n between left-hand padding and the formatting of the number if the\n leading character of the result is not already a zero.\n\n2. The alternate form causes a leading ``\'0x\'`` or ``\'0X\'`` (depending\n on whether the ``\'x\'`` or ``\'X\'`` format was used) to be inserted\n between left-hand padding and the formatting of the number if the\n leading character of the result is not already a zero.\n\n3. The alternate form causes the result to always contain a decimal\n point, even if no digits follow it.\n\n The precision determines the number of digits after the decimal\n point and defaults to 6.\n\n4. The alternate form causes the result to always contain a decimal\n point, and trailing zeroes are not removed as they would otherwise\n be.\n\n The precision determines the number of significant digits before\n and after the decimal point and defaults to 6.\n\n5. The ``%r`` conversion was added in Python 2.0.\n\n The precision determines the maximal number of characters used.\n\n6. If the object or format provided is a ``unicode`` string, the\n resulting string will also be ``unicode``.\n\n The precision determines the maximal number of characters used.\n\n7. See **PEP 237**.\n\nSince Python strings have an explicit length, ``%s`` conversions do\nnot assume that ``\'\\0\'`` is the end of the string.\n\nFor safety reasons, floating point precisions are clipped to 50;\n``%f`` conversions for numbers whose absolute value is over 1e25 are\nreplaced by ``%g`` conversions. [5] All other errors raise\nexceptions.\n\nAdditional string operations are defined in standard modules\n``string`` and ``re``.\n\n\nXRange Type\n===========\n\nThe ``xrange`` type is an immutable sequence which is commonly used\nfor looping. The advantage of the ``xrange`` type is that an\n``xrange`` object will always take the same amount of memory, no\nmatter the size of the range it represents. There are no consistent\nperformance advantages.\n\nXRange objects have very little behavior: they only support indexing,\niteration, and the ``len()`` function.\n\n\nMutable Sequence Types\n======================\n\nList objects support additional operations that allow in-place\nmodification of the object. Other mutable sequence types (when added\nto the language) should also support these operations. Strings and\ntuples are immutable sequence types: such objects cannot be modified\nonce created. The following operations are defined on mutable sequence\ntypes (where *x* is an arbitrary object):\n\n+--------------------------------+----------------------------------+-----------------------+\n| Operation | Result | Notes |\n+================================+==================================+=======================+\n| ``s[i] = x`` | item *i* of *s* is replaced by | |\n| | *x* | |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s[i:j] = t`` | slice of *s* from *i* to *j* is | |\n| | replaced by the contents of the | |\n| | iterable *t* | |\n+--------------------------------+----------------------------------+-----------------------+\n| ``del s[i:j]`` | same as ``s[i:j] = []`` | |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s[i:j:k] = t`` | the elements of ``s[i:j:k]`` are | (1) |\n| | replaced by those of *t* | |\n+--------------------------------+----------------------------------+-----------------------+\n| ``del s[i:j:k]`` | removes the elements of | |\n| | ``s[i:j:k]`` from the list | |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s.append(x)`` | same as ``s[len(s):len(s)] = | (2) |\n| | [x]`` | |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s.extend(x)`` | same as ``s[len(s):len(s)] = x`` | (3) |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s.count(x)`` | return number of *i*\'s for which | |\n| | ``s[i] == x`` | |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s.index(x[, i[, j]])`` | return smallest *k* such that | (4) |\n| | ``s[k] == x`` and ``i <= k < j`` | |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s.insert(i, x)`` | same as ``s[i:i] = [x]`` | (5) |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s.pop([i])`` | same as ``x = s[i]; del s[i]; | (6) |\n| | return x`` | |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s.remove(x)`` | same as ``del s[s.index(x)]`` | (4) |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s.reverse()`` | reverses the items of *s* in | (7) |\n| | place | |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s.sort([cmp[, key[, | sort the items of *s* in place | (7)(8)(9)(10) |\n| reverse]]])`` | | |\n+--------------------------------+----------------------------------+-----------------------+\n\nNotes:\n\n1. *t* must have the same length as the slice it is replacing.\n\n2. The C implementation of Python has historically accepted multiple\n parameters and implicitly joined them into a tuple; this no longer\n works in Python 2.0. Use of this misfeature has been deprecated\n since Python 1.4.\n\n3. *x* can be any iterable object.\n\n4. Raises ``ValueError`` when *x* is not found in *s*. When a negative\n index is passed as the second or third parameter to the ``index()``\n method, the list length is added, as for slice indices. If it is\n still negative, it is truncated to zero, as for slice indices.\n\n Changed in version 2.3: Previously, ``index()`` didn\'t have\n arguments for specifying start and stop positions.\n\n5. When a negative index is passed as the first parameter to the\n ``insert()`` method, the list length is added, as for slice\n indices. If it is still negative, it is truncated to zero, as for\n slice indices.\n\n Changed in version 2.3: Previously, all negative indices were\n truncated to zero.\n\n6. The ``pop()`` method is only supported by the list and array types.\n The optional argument *i* defaults to ``-1``, so that by default\n the last item is removed and returned.\n\n7. The ``sort()`` and ``reverse()`` methods modify the list in place\n for economy of space when sorting or reversing a large list. To\n remind you that they operate by side effect, they don\'t return the\n sorted or reversed list.\n\n8. The ``sort()`` method takes optional arguments for controlling the\n comparisons.\n\n *cmp* specifies a custom comparison function of two arguments (list\n items) which should return a negative, zero or positive number\n depending on whether the first argument is considered smaller than,\n equal to, or larger than the second argument: ``cmp=lambda x,y:\n cmp(x.lower(), y.lower())``. The default value is ``None``.\n\n *key* specifies a function of one argument that is used to extract\n a comparison key from each list element: ``key=str.lower``. The\n default value is ``None``.\n\n *reverse* is a boolean value. If set to ``True``, then the list\n elements are sorted as if each comparison were reversed.\n\n In general, the *key* and *reverse* conversion processes are much\n faster than specifying an equivalent *cmp* function. This is\n because *cmp* is called multiple times for each list element while\n *key* and *reverse* touch each element only once.\n\n Changed in version 2.3: Support for ``None`` as an equivalent to\n omitting *cmp* was added.\n\n Changed in version 2.4: Support for *key* and *reverse* was added.\n\n9. Starting with Python 2.3, the ``sort()`` method is guaranteed to be\n stable. A sort is stable if it guarantees not to change the\n relative order of elements that compare equal --- this is helpful\n for sorting in multiple passes (for example, sort by department,\n then by salary grade).\n\n10. While a list is being sorted, the effect of attempting to mutate,\n or even inspect, the list is undefined. The C implementation of\n Python 2.3 and newer makes the list appear empty for the duration,\n and raises ``ValueError`` if it can detect that the list has been\n mutated during a sort.\n', 'typesseq-mutable': u"\nMutable Sequence Types\n**********************\n\nList objects support additional operations that allow in-place\nmodification of the object. Other mutable sequence types (when added\nto the language) should also support these operations. Strings and\ntuples are immutable sequence types: such objects cannot be modified\nonce created. The following operations are defined on mutable sequence\ntypes (where *x* is an arbitrary object):\n\n+--------------------------------+----------------------------------+-----------------------+\n| Operation | Result | Notes |\n+================================+==================================+=======================+\n| ``s[i] = x`` | item *i* of *s* is replaced by | |\n| | *x* | |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s[i:j] = t`` | slice of *s* from *i* to *j* is | |\n| | replaced by the contents of the | |\n| | iterable *t* | |\n+--------------------------------+----------------------------------+-----------------------+\n| ``del s[i:j]`` | same as ``s[i:j] = []`` | |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s[i:j:k] = t`` | the elements of ``s[i:j:k]`` are | (1) |\n| | replaced by those of *t* | |\n+--------------------------------+----------------------------------+-----------------------+\n| ``del s[i:j:k]`` | removes the elements of | |\n| | ``s[i:j:k]`` from the list | |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s.append(x)`` | same as ``s[len(s):len(s)] = | (2) |\n| | [x]`` | |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s.extend(x)`` | same as ``s[len(s):len(s)] = x`` | (3) |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s.count(x)`` | return number of *i*'s for which | |\n| | ``s[i] == x`` | |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s.index(x[, i[, j]])`` | return smallest *k* such that | (4) |\n| | ``s[k] == x`` and ``i <= k < j`` | |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s.insert(i, x)`` | same as ``s[i:i] = [x]`` | (5) |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s.pop([i])`` | same as ``x = s[i]; del s[i]; | (6) |\n| | return x`` | |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s.remove(x)`` | same as ``del s[s.index(x)]`` | (4) |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s.reverse()`` | reverses the items of *s* in | (7) |\n| | place | |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s.sort([cmp[, key[, | sort the items of *s* in place | (7)(8)(9)(10) |\n| reverse]]])`` | | |\n+--------------------------------+----------------------------------+-----------------------+\n\nNotes:\n\n1. *t* must have the same length as the slice it is replacing.\n\n2. The C implementation of Python has historically accepted multiple\n parameters and implicitly joined them into a tuple; this no longer\n works in Python 2.0. Use of this misfeature has been deprecated\n since Python 1.4.\n\n3. *x* can be any iterable object.\n\n4. Raises ``ValueError`` when *x* is not found in *s*. When a negative\n index is passed as the second or third parameter to the ``index()``\n method, the list length is added, as for slice indices. If it is\n still negative, it is truncated to zero, as for slice indices.\n\n Changed in version 2.3: Previously, ``index()`` didn't have\n arguments for specifying start and stop positions.\n\n5. When a negative index is passed as the first parameter to the\n ``insert()`` method, the list length is added, as for slice\n indices. If it is still negative, it is truncated to zero, as for\n slice indices.\n\n Changed in version 2.3: Previously, all negative indices were\n truncated to zero.\n\n6. The ``pop()`` method is only supported by the list and array types.\n The optional argument *i* defaults to ``-1``, so that by default\n the last item is removed and returned.\n\n7. The ``sort()`` and ``reverse()`` methods modify the list in place\n for economy of space when sorting or reversing a large list. To\n remind you that they operate by side effect, they don't return the\n sorted or reversed list.\n\n8. The ``sort()`` method takes optional arguments for controlling the\n comparisons.\n\n *cmp* specifies a custom comparison function of two arguments (list\n items) which should return a negative, zero or positive number\n depending on whether the first argument is considered smaller than,\n equal to, or larger than the second argument: ``cmp=lambda x,y:\n cmp(x.lower(), y.lower())``. The default value is ``None``.\n\n *key* specifies a function of one argument that is used to extract\n a comparison key from each list element: ``key=str.lower``. The\n default value is ``None``.\n\n *reverse* is a boolean value. If set to ``True``, then the list\n elements are sorted as if each comparison were reversed.\n\n In general, the *key* and *reverse* conversion processes are much\n faster than specifying an equivalent *cmp* function. This is\n because *cmp* is called multiple times for each list element while\n *key* and *reverse* touch each element only once.\n\n Changed in version 2.3: Support for ``None`` as an equivalent to\n omitting *cmp* was added.\n\n Changed in version 2.4: Support for *key* and *reverse* was added.\n\n9. Starting with Python 2.3, the ``sort()`` method is guaranteed to be\n stable. A sort is stable if it guarantees not to change the\n relative order of elements that compare equal --- this is helpful\n for sorting in multiple passes (for example, sort by department,\n then by salary grade).\n\n10. While a list is being sorted, the effect of attempting to mutate,\n or even inspect, the list is undefined. The C implementation of\n Python 2.3 and newer makes the list appear empty for the duration,\n and raises ``ValueError`` if it can detect that the list has been\n mutated during a sort.\n", 'unary': u'\nUnary arithmetic operations\n***************************\n\nAll unary arithmetic (and bitwise) operations have the same priority:\n\n u_expr ::= power | "-" u_expr | "+" u_expr | "~" u_expr\n\nThe unary ``-`` (minus) operator yields the negation of its numeric\nargument.\n\nThe unary ``+`` (plus) operator yields its numeric argument unchanged.\n\nThe unary ``~`` (invert) operator yields the bitwise inversion of its\nplain or long integer argument. The bitwise inversion of ``x`` is\ndefined as ``-(x+1)``. It only applies to integral numbers.\n\nIn all three cases, if the argument does not have the proper type, a\n``TypeError`` exception is raised.\n', 'while': u'\nThe ``while`` statement\n***********************\n\nThe ``while`` statement is used for repeated execution as long as an\nexpression is true:\n\n while_stmt ::= "while" expression ":" suite\n ["else" ":" suite]\n\nThis repeatedly tests the expression and, if it is true, executes the\nfirst suite; if the expression is false (which may be the first time\nit is tested) the suite of the ``else`` clause, if present, is\nexecuted and the loop terminates.\n\nA ``break`` statement executed in the first suite terminates the loop\nwithout executing the ``else`` clause\'s suite. A ``continue``\nstatement executed in the first suite skips the rest of the suite and\ngoes back to testing the expression.\n', - 'with': u'\nThe ``with`` statement\n**********************\n\nAdded in version 2.5.\n\nThe ``with`` statement is used to wrap the execution of a block with\nmethods defined by a context manager (see section *With Statement\nContext Managers*). This allows common\n``try``...``except``...``finally`` usage patterns to be encapsulated\nfor convenient reuse.\n\n with_stmt ::= "with" expression ["as" target] ":" suite\n\nThe execution of the ``with`` statement proceeds as follows:\n\n1. The context expression is evaluated to obtain a context manager.\n\n2. The context manager\'s ``__enter__()`` method is invoked.\n\n3. If a target was included in the ``with`` statement, the return\n value from ``__enter__()`` is assigned to it.\n\n Note: The ``with`` statement guarantees that if the ``__enter__()``\n method returns without an error, then ``__exit__()`` will always\n be called. Thus, if an error occurs during the assignment to the\n target list, it will be treated the same as an error occurring\n within the suite would be. See step 5 below.\n\n4. The suite is executed.\n\n5. The context manager\'s ``__exit__()`` method is invoked. If an\n exception caused the suite to be exited, its type, value, and\n traceback are passed as arguments to ``__exit__()``. Otherwise,\n three ``None`` arguments are supplied.\n\n If the suite was exited due to an exception, and the return value\n from the ``__exit__()`` method was false, the exception is\n reraised. If the return value was true, the exception is\n suppressed, and execution continues with the statement following\n the ``with`` statement.\n\n If the suite was exited for any reason other than an exception, the\n return value from ``__exit__()`` is ignored, and execution proceeds\n at the normal location for the kind of exit that was taken.\n\nNote: In Python 2.5, the ``with`` statement is only allowed when the\n ``with_statement`` feature has been enabled. It is always enabled\n in Python 2.6.\n\nSee also:\n\n **PEP 0343** - The "with" statement\n The specification, background, and examples for the Python\n ``with`` statement.\n', + 'with': u'\nThe ``with`` statement\n**********************\n\nNew in version 2.5.\n\nThe ``with`` statement is used to wrap the execution of a block with\nmethods defined by a context manager (see section *With Statement\nContext Managers*). This allows common\n``try``...``except``...``finally`` usage patterns to be encapsulated\nfor convenient reuse.\n\n with_stmt ::= "with" expression ["as" target] ":" suite\n\nThe execution of the ``with`` statement proceeds as follows:\n\n1. The context expression is evaluated to obtain a context manager.\n\n2. The context manager\'s ``__enter__()`` method is invoked.\n\n3. If a target was included in the ``with`` statement, the return\n value from ``__enter__()`` is assigned to it.\n\n Note: The ``with`` statement guarantees that if the ``__enter__()``\n method returns without an error, then ``__exit__()`` will always\n be called. Thus, if an error occurs during the assignment to the\n target list, it will be treated the same as an error occurring\n within the suite would be. See step 5 below.\n\n4. The suite is executed.\n\n5. The context manager\'s ``__exit__()`` method is invoked. If an\n exception caused the suite to be exited, its type, value, and\n traceback are passed as arguments to ``__exit__()``. Otherwise,\n three ``None`` arguments are supplied.\n\n If the suite was exited due to an exception, and the return value\n from the ``__exit__()`` method was false, the exception is\n reraised. If the return value was true, the exception is\n suppressed, and execution continues with the statement following\n the ``with`` statement.\n\n If the suite was exited for any reason other than an exception, the\n return value from ``__exit__()`` is ignored, and execution proceeds\n at the normal location for the kind of exit that was taken.\n\nNote: In Python 2.5, the ``with`` statement is only allowed when the\n ``with_statement`` feature has been enabled. It is always enabled\n in Python 2.6.\n\nSee also:\n\n **PEP 0343** - The "with" statement\n The specification, background, and examples for the Python\n ``with`` statement.\n', 'yield': u'\nThe ``yield`` statement\n***********************\n\n yield_stmt ::= yield_expression\n\nThe ``yield`` statement is only used when defining a generator\nfunction, and is only used in the body of the generator function.\nUsing a ``yield`` statement in a function definition is sufficient to\ncause that definition to create a generator function instead of a\nnormal function.\n\nWhen a generator function is called, it returns an iterator known as a\ngenerator iterator, or more commonly, a generator. The body of the\ngenerator function is executed by calling the generator\'s ``next()``\nmethod repeatedly until it raises an exception.\n\nWhen a ``yield`` statement is executed, the state of the generator is\nfrozen and the value of **expression_list** is returned to\n``next()``\'s caller. By "frozen" we mean that all local state is\nretained, including the current bindings of local variables, the\ninstruction pointer, and the internal evaluation stack: enough\ninformation is saved so that the next time ``next()`` is invoked, the\nfunction can proceed exactly as if the ``yield`` statement were just\nanother external call.\n\nAs of Python version 2.5, the ``yield`` statement is now allowed in\nthe ``try`` clause of a ``try`` ... ``finally`` construct. If the\ngenerator is not resumed before it is finalized (by reaching a zero\nreference count or by being garbage collected), the generator-\niterator\'s ``close()`` method will be called, allowing any pending\n``finally`` clauses to execute.\n\nNote: In Python 2.2, the ``yield`` statement was only allowed when the\n ``generators`` feature has been enabled. This ``__future__`` import\n statement was used to enable the feature:\n\n from __future__ import generators\n\nSee also:\n\n **PEP 0255** - Simple Generators\n The proposal for adding generators and the ``yield`` statement\n to Python.\n\n **PEP 0342** - Coroutines via Enhanced Generators\n The proposal that, among other generator enhancements, proposed\n allowing ``yield`` to appear inside a ``try`` ... ``finally``\n block.\n'} From python-checkins at python.org Sat Oct 4 09:32:52 2008 From: python-checkins at python.org (neal.norwitz) Date: Sat, 4 Oct 2008 09:32:52 +0200 (CEST) Subject: [Python-checkins] r66762 - python/branches/release26-maint/Misc/build.sh Message-ID: <20081004073252.0BB431E4008@bag.python.org> Author: neal.norwitz Date: Fri Oct 3 06:10:46 2008 New Revision: 66762 Log: Disable the build for 2.6, only build docs Modified: python/branches/release26-maint/Misc/build.sh Modified: python/branches/release26-maint/Misc/build.sh ============================================================================== --- python/branches/release26-maint/Misc/build.sh (original) +++ python/branches/release26-maint/Misc/build.sh Fri Oct 3 06:10:46 2008 @@ -50,9 +50,9 @@ #FAILURE_CC="optional--uncomment and set to desired address" REMOTE_SYSTEM="neal at dinsdale.python.org" -REMOTE_DIR="/data/ftp.python.org/pub/docs.python.org/dev/" +REMOTE_DIR="/data/ftp.python.org/pub/docs.python.org/dev/2.6" RESULT_FILE="$DIR/build/index.html" -INSTALL_DIR="/tmp/python-test/local" +INSTALL_DIR="/tmp/python-test-2.6/local" RSYNC_OPTS="-aC -e ssh" # Always run the installed version of Python. @@ -77,7 +77,7 @@ LEAKY_SKIPS="-x test_compiler test_logging" # Change this flag to "yes" for old releases to only update/build the docs. -BUILD_DISABLED="no" +BUILD_DISABLED="yes" ## utility functions current_time() { From python-checkins at python.org Sat Oct 4 09:33:04 2008 From: python-checkins at python.org (hirokazu.yamamoto) Date: Sat, 4 Oct 2008 09:33:04 +0200 (CEST) Subject: [Python-checkins] r66768 - in python/trunk/PC/VC6: pythoncore.dsp readme.txt Message-ID: <20081004073304.549A21E4015@bag.python.org> Author: hirokazu.yamamoto Date: Fri Oct 3 18:07:28 2008 New Revision: 66768 Log: Follows to python's version change (VC6) Modified: python/trunk/PC/VC6/pythoncore.dsp python/trunk/PC/VC6/readme.txt Modified: python/trunk/PC/VC6/pythoncore.dsp ============================================================================== --- python/trunk/PC/VC6/pythoncore.dsp (original) +++ python/trunk/PC/VC6/pythoncore.dsp Fri Oct 3 18:07:28 2008 @@ -54,7 +54,7 @@ # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /machine:I386 -# ADD LINK32 largeint.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /base:"0x1e000000" /subsystem:windows /dll /debug /machine:I386 /nodefaultlib:"libc" /out:"./python26.dll" +# ADD LINK32 largeint.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /base:"0x1e000000" /subsystem:windows /dll /debug /machine:I386 /nodefaultlib:"libc" /out:"./python27.dll" # SUBTRACT LINK32 /pdb:none !ELSEIF "$(CFG)" == "pythoncore - Win32 Debug" @@ -82,7 +82,7 @@ # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /debug /machine:I386 /pdbtype:sept -# ADD LINK32 largeint.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /base:"0x1e000000" /subsystem:windows /dll /debug /machine:I386 /nodefaultlib:"libc" /out:"./python26_d.dll" /pdbtype:sept +# ADD LINK32 largeint.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /base:"0x1e000000" /subsystem:windows /dll /debug /machine:I386 /nodefaultlib:"libc" /out:"./python27_d.dll" /pdbtype:sept # SUBTRACT LINK32 /pdb:none !ENDIF Modified: python/trunk/PC/VC6/readme.txt ============================================================================== --- python/trunk/PC/VC6/readme.txt (original) +++ python/trunk/PC/VC6/readme.txt Fri Oct 3 18:07:28 2008 @@ -11,7 +11,7 @@ The proper order to build subprojects: 1) pythoncore (this builds the main Python DLL and library files, - python26.{dll, lib} in Release mode) + python27.{dll, lib} in Release mode) 2) python (this builds the main Python executable, python.exe in Release mode) @@ -22,7 +22,7 @@ to the subsystems they implement; see SUBPROJECTS below) When using the Debug setting, the output files have a _d added to -their name: python26_d.dll, python_d.exe, pyexpat_d.pyd, and so on. +their name: python27_d.dll, python_d.exe, pyexpat_d.pyd, and so on. SUBPROJECTS ----------- From python-checkins at python.org Sat Oct 4 09:33:21 2008 From: python-checkins at python.org (hirokazu.yamamoto) Date: Sat, 4 Oct 2008 09:33:21 +0200 (CEST) Subject: [Python-checkins] r66771 - python/trunk/Lib/test/test_docxmlrpc.py Message-ID: <20081004073321.327F91E4002@bag.python.org> Author: hirokazu.yamamoto Date: Fri Oct 3 18:18:42 2008 New Revision: 66771 Log: Fixed following error when DocXMLRPCServer failed. UnboundLocalError: local variable 'serv' referenced before assignment Modified: python/trunk/Lib/test/test_docxmlrpc.py Modified: python/trunk/Lib/test/test_docxmlrpc.py ============================================================================== --- python/trunk/Lib/test/test_docxmlrpc.py (original) +++ python/trunk/Lib/test/test_docxmlrpc.py Fri Oct 3 18:18:42 2008 @@ -9,9 +9,9 @@ PORT = None def server(evt, numrequests): - try: - serv = DocXMLRPCServer(("localhost", 0), logRequests=False) + serv = DocXMLRPCServer(("localhost", 0), logRequests=False) + try: global PORT PORT = serv.socket.getsockname()[1] From python-checkins at python.org Sat Oct 4 09:33:22 2008 From: python-checkins at python.org (andrew.kuchling) Date: Sat, 4 Oct 2008 09:33:22 +0200 (CEST) Subject: [Python-checkins] r66772 - python/trunk/Objects/setobject.c Message-ID: <20081004073322.8558C1E4002@bag.python.org> Author: andrew.kuchling Date: Fri Oct 3 18:29:19 2008 New Revision: 66772 Log: Mention exception in docstring Modified: python/trunk/Objects/setobject.c Modified: python/trunk/Objects/setobject.c ============================================================================== --- python/trunk/Objects/setobject.c (original) +++ python/trunk/Objects/setobject.c Fri Oct 3 18:29:19 2008 @@ -754,7 +754,8 @@ return key; } -PyDoc_STRVAR(pop_doc, "Remove and return an arbitrary set element."); +PyDoc_STRVAR(pop_doc, "Remove and return an arbitrary set element.\n\ +Raises KeyError if the set is empty."); static int set_traverse(PySetObject *so, visitproc visit, void *arg) From python-checkins at python.org Sat Oct 4 09:33:25 2008 From: python-checkins at python.org (andrew.kuchling) Date: Sat, 4 Oct 2008 09:33:25 +0200 (CEST) Subject: [Python-checkins] r66774 - in python/trunk: Doc/whatsnew/2.2.rst Lib/test/test_datetime.py Message-ID: <20081004073325.7F5251E402D@bag.python.org> Author: andrew.kuchling Date: Fri Oct 3 18:42:52 2008 New Revision: 66774 Log: Typo fix Modified: python/trunk/Doc/whatsnew/2.2.rst python/trunk/Lib/test/test_datetime.py Modified: python/trunk/Doc/whatsnew/2.2.rst ============================================================================== --- python/trunk/Doc/whatsnew/2.2.rst (original) +++ python/trunk/Doc/whatsnew/2.2.rst Fri Oct 3 18:42:52 2008 @@ -714,7 +714,7 @@ presented with two integer arguments: it returns an integer result that's truncated down when there would be a fractional part. For example, ``3/2`` is 1, not 1.5, and ``(-1)/2`` is -1, not -0.5. This means that the results of -divison can vary unexpectedly depending on the type of the two operands and +division can vary unexpectedly depending on the type of the two operands and because Python is dynamically typed, it can be difficult to determine the possible types of the operands. Modified: python/trunk/Lib/test/test_datetime.py ============================================================================== --- python/trunk/Lib/test/test_datetime.py (original) +++ python/trunk/Lib/test/test_datetime.py Fri Oct 3 18:42:52 2008 @@ -253,7 +253,7 @@ self.assertRaises(TypeError, lambda: a // x) self.assertRaises(TypeError, lambda: x // a) - # Divison of int by timedelta doesn't make sense. + # Division of int by timedelta doesn't make sense. # Division by zero doesn't make sense. for zero in 0, 0L: self.assertRaises(TypeError, lambda: zero // a) From python-checkins at python.org Sat Oct 4 09:33:27 2008 From: python-checkins at python.org (collin.winter) Date: Sat, 4 Oct 2008 09:33:27 +0200 (CEST) Subject: [Python-checkins] r66775 - in sandbox/trunk/2to3/lib2to3: pytree.py tests/data/README tests/data/infinite_recursion.py Message-ID: <20081004073327.8CB261E402F@bag.python.org> Author: collin.winter Date: Fri Oct 3 19:08:26 2008 New Revision: 66775 Log: Add an alternative iterative pattern matching system that, while slower, correctly parses files that cause the faster recursive pattern matcher to fail with a recursion error. lib2to3 falls back to the iterative matcher if the recursive one fails. Fixes http://bugs.python.org/issue2532. Thanks to Nick Edds. Added: sandbox/trunk/2to3/lib2to3/tests/data/README sandbox/trunk/2to3/lib2to3/tests/data/infinite_recursion.py Modified: sandbox/trunk/2to3/lib2to3/pytree.py Modified: sandbox/trunk/2to3/lib2to3/pytree.py ============================================================================== --- sandbox/trunk/2to3/lib2to3/pytree.py (original) +++ sandbox/trunk/2to3/lib2to3/pytree.py Fri Oct 3 19:08:26 2008 @@ -655,10 +655,47 @@ elif self.name == "bare_name": yield self._bare_name_matches(nodes) else: - for count, r in self._recursive_matches(nodes, 0): - if self.name: - r[self.name] = nodes[:count] - yield count, r + try: + for count, r in self._recursive_matches(nodes, 0): + if self.name: + r[self.name] = nodes[:count] + yield count, r + except RuntimeError: + # We fall back to the iterative pattern matching scheme if the recursive + # scheme hits the recursion limit. + for count, r in self._iterative_matches(nodes): + if self.name: + r[self.name] = nodes[:count] + yield count, r + + def _iterative_matches(self, nodes): + """Helper to iteratively yield the matches.""" + nodelen = len(nodes) + if 0 >= self.min: + yield 0, {} + + results = [] + # generate matches that use just one alt from self.content + for alt in self.content: + for c, r in generate_matches(alt, nodes): + yield c, r + results.append((c, r)) + + # for each match, iterate down the nodes + while results: + new_results = [] + for c0, r0 in results: + # stop if the entire set of nodes has been matched + if c0 < nodelen and c0 <= self.max: + for alt in self.content: + for c1, r1 in generate_matches(alt, nodes[c0:]): + if c1 > 0: + r = {} + r.update(r0) + r.update(r1) + yield c0 + c1, r + new_results.append((c0 + c1, r)) + results = new_results def _bare_name_matches(self, nodes): """Special optimized matcher for bare_name.""" Added: sandbox/trunk/2to3/lib2to3/tests/data/README ============================================================================== --- (empty file) +++ sandbox/trunk/2to3/lib2to3/tests/data/README Fri Oct 3 19:08:26 2008 @@ -0,0 +1,5 @@ +Files in this directory: +- py2_test_grammar.py -- test file that exercises most/all of Python 2.x's grammar. +- py3_test_grammar.py -- test file that exercises most/all of Python 3.x's grammar. +- infinite_recursion.py -- test file that causes lib2to3's faster recursive pattern matching + scheme to fail, but passes when lib2to3 falls back to iterative pattern matching. Added: sandbox/trunk/2to3/lib2to3/tests/data/infinite_recursion.py ============================================================================== --- (empty file) +++ sandbox/trunk/2to3/lib2to3/tests/data/infinite_recursion.py Fri Oct 3 19:08:26 2008 @@ -0,0 +1,2669 @@ +# This file is used to verify that 2to3 falls back to a slower, iterative pattern matching +# scheme in the event that the faster recursive system fails due to infinite recursion. +from ctypes import * +STRING = c_char_p + + +OSUnknownByteOrder = 0 +UIT_PROMPT = 1 +P_PGID = 2 +P_PID = 1 +UIT_ERROR = 5 +UIT_INFO = 4 +UIT_NONE = 0 +P_ALL = 0 +UIT_VERIFY = 2 +OSBigEndian = 2 +UIT_BOOLEAN = 3 +OSLittleEndian = 1 +__darwin_nl_item = c_int +__darwin_wctrans_t = c_int +__darwin_wctype_t = c_ulong +__int8_t = c_byte +__uint8_t = c_ubyte +__int16_t = c_short +__uint16_t = c_ushort +__int32_t = c_int +__uint32_t = c_uint +__int64_t = c_longlong +__uint64_t = c_ulonglong +__darwin_intptr_t = c_long +__darwin_natural_t = c_uint +__darwin_ct_rune_t = c_int +class __mbstate_t(Union): + pass +__mbstate_t._pack_ = 4 +__mbstate_t._fields_ = [ + ('__mbstate8', c_char * 128), + ('_mbstateL', c_longlong), +] +assert sizeof(__mbstate_t) == 128, sizeof(__mbstate_t) +assert alignment(__mbstate_t) == 4, alignment(__mbstate_t) +__darwin_mbstate_t = __mbstate_t +__darwin_ptrdiff_t = c_int +__darwin_size_t = c_ulong +__darwin_va_list = STRING +__darwin_wchar_t = c_int +__darwin_rune_t = __darwin_wchar_t +__darwin_wint_t = c_int +__darwin_clock_t = c_ulong +__darwin_socklen_t = __uint32_t +__darwin_ssize_t = c_long +__darwin_time_t = c_long +sig_atomic_t = c_int +class sigcontext(Structure): + pass +sigcontext._fields_ = [ + ('sc_onstack', c_int), + ('sc_mask', c_int), + ('sc_eax', c_uint), + ('sc_ebx', c_uint), + ('sc_ecx', c_uint), + ('sc_edx', c_uint), + ('sc_edi', c_uint), + ('sc_esi', c_uint), + ('sc_ebp', c_uint), + ('sc_esp', c_uint), + ('sc_ss', c_uint), + ('sc_eflags', c_uint), + ('sc_eip', c_uint), + ('sc_cs', c_uint), + ('sc_ds', c_uint), + ('sc_es', c_uint), + ('sc_fs', c_uint), + ('sc_gs', c_uint), +] +assert sizeof(sigcontext) == 72, sizeof(sigcontext) +assert alignment(sigcontext) == 4, alignment(sigcontext) +u_int8_t = c_ubyte +u_int16_t = c_ushort +u_int32_t = c_uint +u_int64_t = c_ulonglong +int32_t = c_int +register_t = int32_t +user_addr_t = u_int64_t +user_size_t = u_int64_t +int64_t = c_longlong +user_ssize_t = int64_t +user_long_t = int64_t +user_ulong_t = u_int64_t +user_time_t = int64_t +syscall_arg_t = u_int64_t + +# values for unnamed enumeration +class aes_key_st(Structure): + pass +aes_key_st._fields_ = [ + ('rd_key', c_ulong * 60), + ('rounds', c_int), +] +assert sizeof(aes_key_st) == 244, sizeof(aes_key_st) +assert alignment(aes_key_st) == 4, alignment(aes_key_st) +AES_KEY = aes_key_st +class asn1_ctx_st(Structure): + pass +asn1_ctx_st._fields_ = [ + ('p', POINTER(c_ubyte)), + ('eos', c_int), + ('error', c_int), + ('inf', c_int), + ('tag', c_int), + ('xclass', c_int), + ('slen', c_long), + ('max', POINTER(c_ubyte)), + ('q', POINTER(c_ubyte)), + ('pp', POINTER(POINTER(c_ubyte))), + ('line', c_int), +] +assert sizeof(asn1_ctx_st) == 44, sizeof(asn1_ctx_st) +assert alignment(asn1_ctx_st) == 4, alignment(asn1_ctx_st) +ASN1_CTX = asn1_ctx_st +class asn1_object_st(Structure): + pass +asn1_object_st._fields_ = [ + ('sn', STRING), + ('ln', STRING), + ('nid', c_int), + ('length', c_int), + ('data', POINTER(c_ubyte)), + ('flags', c_int), +] +assert sizeof(asn1_object_st) == 24, sizeof(asn1_object_st) +assert alignment(asn1_object_st) == 4, alignment(asn1_object_st) +ASN1_OBJECT = asn1_object_st +class asn1_string_st(Structure): + pass +asn1_string_st._fields_ = [ + ('length', c_int), + ('type', c_int), + ('data', POINTER(c_ubyte)), + ('flags', c_long), +] +assert sizeof(asn1_string_st) == 16, sizeof(asn1_string_st) +assert alignment(asn1_string_st) == 4, alignment(asn1_string_st) +ASN1_STRING = asn1_string_st +class ASN1_ENCODING_st(Structure): + pass +ASN1_ENCODING_st._fields_ = [ + ('enc', POINTER(c_ubyte)), + ('len', c_long), + ('modified', c_int), +] +assert sizeof(ASN1_ENCODING_st) == 12, sizeof(ASN1_ENCODING_st) +assert alignment(ASN1_ENCODING_st) == 4, alignment(ASN1_ENCODING_st) +ASN1_ENCODING = ASN1_ENCODING_st +class asn1_string_table_st(Structure): + pass +asn1_string_table_st._fields_ = [ + ('nid', c_int), + ('minsize', c_long), + ('maxsize', c_long), + ('mask', c_ulong), + ('flags', c_ulong), +] +assert sizeof(asn1_string_table_st) == 20, sizeof(asn1_string_table_st) +assert alignment(asn1_string_table_st) == 4, alignment(asn1_string_table_st) +ASN1_STRING_TABLE = asn1_string_table_st +class ASN1_TEMPLATE_st(Structure): + pass +ASN1_TEMPLATE_st._fields_ = [ +] +ASN1_TEMPLATE = ASN1_TEMPLATE_st +class ASN1_ITEM_st(Structure): + pass +ASN1_ITEM = ASN1_ITEM_st +ASN1_ITEM_st._fields_ = [ +] +class ASN1_TLC_st(Structure): + pass +ASN1_TLC = ASN1_TLC_st +ASN1_TLC_st._fields_ = [ +] +class ASN1_VALUE_st(Structure): + pass +ASN1_VALUE_st._fields_ = [ +] +ASN1_VALUE = ASN1_VALUE_st +ASN1_ITEM_EXP = ASN1_ITEM +class asn1_type_st(Structure): + pass +class N12asn1_type_st4DOLLAR_11E(Union): + pass +ASN1_BOOLEAN = c_int +ASN1_INTEGER = asn1_string_st +ASN1_ENUMERATED = asn1_string_st +ASN1_BIT_STRING = asn1_string_st +ASN1_OCTET_STRING = asn1_string_st +ASN1_PRINTABLESTRING = asn1_string_st +ASN1_T61STRING = asn1_string_st +ASN1_IA5STRING = asn1_string_st +ASN1_GENERALSTRING = asn1_string_st +ASN1_BMPSTRING = asn1_string_st +ASN1_UNIVERSALSTRING = asn1_string_st +ASN1_UTCTIME = asn1_string_st +ASN1_GENERALIZEDTIME = asn1_string_st +ASN1_VISIBLESTRING = asn1_string_st +ASN1_UTF8STRING = asn1_string_st +N12asn1_type_st4DOLLAR_11E._fields_ = [ + ('ptr', STRING), + ('boolean', ASN1_BOOLEAN), + ('asn1_string', POINTER(ASN1_STRING)), + ('object', POINTER(ASN1_OBJECT)), + ('integer', POINTER(ASN1_INTEGER)), + ('enumerated', POINTER(ASN1_ENUMERATED)), + ('bit_string', POINTER(ASN1_BIT_STRING)), + ('octet_string', POINTER(ASN1_OCTET_STRING)), + ('printablestring', POINTER(ASN1_PRINTABLESTRING)), + ('t61string', POINTER(ASN1_T61STRING)), + ('ia5string', POINTER(ASN1_IA5STRING)), + ('generalstring', POINTER(ASN1_GENERALSTRING)), + ('bmpstring', POINTER(ASN1_BMPSTRING)), + ('universalstring', POINTER(ASN1_UNIVERSALSTRING)), + ('utctime', POINTER(ASN1_UTCTIME)), + ('generalizedtime', POINTER(ASN1_GENERALIZEDTIME)), + ('visiblestring', POINTER(ASN1_VISIBLESTRING)), + ('utf8string', POINTER(ASN1_UTF8STRING)), + ('set', POINTER(ASN1_STRING)), + ('sequence', POINTER(ASN1_STRING)), +] +assert sizeof(N12asn1_type_st4DOLLAR_11E) == 4, sizeof(N12asn1_type_st4DOLLAR_11E) +assert alignment(N12asn1_type_st4DOLLAR_11E) == 4, alignment(N12asn1_type_st4DOLLAR_11E) +asn1_type_st._fields_ = [ + ('type', c_int), + ('value', N12asn1_type_st4DOLLAR_11E), +] +assert sizeof(asn1_type_st) == 8, sizeof(asn1_type_st) +assert alignment(asn1_type_st) == 4, alignment(asn1_type_st) +ASN1_TYPE = asn1_type_st +class asn1_method_st(Structure): + pass +asn1_method_st._fields_ = [ + ('i2d', CFUNCTYPE(c_int)), + ('d2i', CFUNCTYPE(STRING)), + ('create', CFUNCTYPE(STRING)), + ('destroy', CFUNCTYPE(None)), +] +assert sizeof(asn1_method_st) == 16, sizeof(asn1_method_st) +assert alignment(asn1_method_st) == 4, alignment(asn1_method_st) +ASN1_METHOD = asn1_method_st +class asn1_header_st(Structure): + pass +asn1_header_st._fields_ = [ + ('header', POINTER(ASN1_OCTET_STRING)), + ('data', STRING), + ('meth', POINTER(ASN1_METHOD)), +] +assert sizeof(asn1_header_st) == 12, sizeof(asn1_header_st) +assert alignment(asn1_header_st) == 4, alignment(asn1_header_st) +ASN1_HEADER = asn1_header_st +class BIT_STRING_BITNAME_st(Structure): + pass +BIT_STRING_BITNAME_st._fields_ = [ + ('bitnum', c_int), + ('lname', STRING), + ('sname', STRING), +] +assert sizeof(BIT_STRING_BITNAME_st) == 12, sizeof(BIT_STRING_BITNAME_st) +assert alignment(BIT_STRING_BITNAME_st) == 4, alignment(BIT_STRING_BITNAME_st) +BIT_STRING_BITNAME = BIT_STRING_BITNAME_st +class bio_st(Structure): + pass +BIO = bio_st +bio_info_cb = CFUNCTYPE(None, POINTER(bio_st), c_int, STRING, c_int, c_long, c_long) +class bio_method_st(Structure): + pass +bio_method_st._fields_ = [ + ('type', c_int), + ('name', STRING), + ('bwrite', CFUNCTYPE(c_int, POINTER(BIO), STRING, c_int)), + ('bread', CFUNCTYPE(c_int, POINTER(BIO), STRING, c_int)), + ('bputs', CFUNCTYPE(c_int, POINTER(BIO), STRING)), + ('bgets', CFUNCTYPE(c_int, POINTER(BIO), STRING, c_int)), + ('ctrl', CFUNCTYPE(c_long, POINTER(BIO), c_int, c_long, c_void_p)), + ('create', CFUNCTYPE(c_int, POINTER(BIO))), + ('destroy', CFUNCTYPE(c_int, POINTER(BIO))), + ('callback_ctrl', CFUNCTYPE(c_long, POINTER(BIO), c_int, POINTER(bio_info_cb))), +] +assert sizeof(bio_method_st) == 40, sizeof(bio_method_st) +assert alignment(bio_method_st) == 4, alignment(bio_method_st) +BIO_METHOD = bio_method_st +class crypto_ex_data_st(Structure): + pass +class stack_st(Structure): + pass +STACK = stack_st +crypto_ex_data_st._fields_ = [ + ('sk', POINTER(STACK)), + ('dummy', c_int), +] +assert sizeof(crypto_ex_data_st) == 8, sizeof(crypto_ex_data_st) +assert alignment(crypto_ex_data_st) == 4, alignment(crypto_ex_data_st) +CRYPTO_EX_DATA = crypto_ex_data_st +bio_st._fields_ = [ + ('method', POINTER(BIO_METHOD)), + ('callback', CFUNCTYPE(c_long, POINTER(bio_st), c_int, STRING, c_int, c_long, c_long)), + ('cb_arg', STRING), + ('init', c_int), + ('shutdown', c_int), + ('flags', c_int), + ('retry_reason', c_int), + ('num', c_int), + ('ptr', c_void_p), + ('next_bio', POINTER(bio_st)), + ('prev_bio', POINTER(bio_st)), + ('references', c_int), + ('num_read', c_ulong), + ('num_write', c_ulong), + ('ex_data', CRYPTO_EX_DATA), +] +assert sizeof(bio_st) == 64, sizeof(bio_st) +assert alignment(bio_st) == 4, alignment(bio_st) +class bio_f_buffer_ctx_struct(Structure): + pass +bio_f_buffer_ctx_struct._fields_ = [ + ('ibuf_size', c_int), + ('obuf_size', c_int), + ('ibuf', STRING), + ('ibuf_len', c_int), + ('ibuf_off', c_int), + ('obuf', STRING), + ('obuf_len', c_int), + ('obuf_off', c_int), +] +assert sizeof(bio_f_buffer_ctx_struct) == 32, sizeof(bio_f_buffer_ctx_struct) +assert alignment(bio_f_buffer_ctx_struct) == 4, alignment(bio_f_buffer_ctx_struct) +BIO_F_BUFFER_CTX = bio_f_buffer_ctx_struct +class hostent(Structure): + pass +hostent._fields_ = [ +] +class bf_key_st(Structure): + pass +bf_key_st._fields_ = [ + ('P', c_uint * 18), + ('S', c_uint * 1024), +] +assert sizeof(bf_key_st) == 4168, sizeof(bf_key_st) +assert alignment(bf_key_st) == 4, alignment(bf_key_st) +BF_KEY = bf_key_st +class bignum_st(Structure): + pass +bignum_st._fields_ = [ + ('d', POINTER(c_ulong)), + ('top', c_int), + ('dmax', c_int), + ('neg', c_int), + ('flags', c_int), +] +assert sizeof(bignum_st) == 20, sizeof(bignum_st) +assert alignment(bignum_st) == 4, alignment(bignum_st) +BIGNUM = bignum_st +class bignum_ctx(Structure): + pass +bignum_ctx._fields_ = [ +] +BN_CTX = bignum_ctx +class bn_blinding_st(Structure): + pass +bn_blinding_st._fields_ = [ + ('init', c_int), + ('A', POINTER(BIGNUM)), + ('Ai', POINTER(BIGNUM)), + ('mod', POINTER(BIGNUM)), + ('thread_id', c_ulong), +] +assert sizeof(bn_blinding_st) == 20, sizeof(bn_blinding_st) +assert alignment(bn_blinding_st) == 4, alignment(bn_blinding_st) +BN_BLINDING = bn_blinding_st +class bn_mont_ctx_st(Structure): + pass +bn_mont_ctx_st._fields_ = [ + ('ri', c_int), + ('RR', BIGNUM), + ('N', BIGNUM), + ('Ni', BIGNUM), + ('n0', c_ulong), + ('flags', c_int), +] +assert sizeof(bn_mont_ctx_st) == 72, sizeof(bn_mont_ctx_st) +assert alignment(bn_mont_ctx_st) == 4, alignment(bn_mont_ctx_st) +BN_MONT_CTX = bn_mont_ctx_st +class bn_recp_ctx_st(Structure): + pass +bn_recp_ctx_st._fields_ = [ + ('N', BIGNUM), + ('Nr', BIGNUM), + ('num_bits', c_int), + ('shift', c_int), + ('flags', c_int), +] +assert sizeof(bn_recp_ctx_st) == 52, sizeof(bn_recp_ctx_st) +assert alignment(bn_recp_ctx_st) == 4, alignment(bn_recp_ctx_st) +BN_RECP_CTX = bn_recp_ctx_st +class buf_mem_st(Structure): + pass +buf_mem_st._fields_ = [ + ('length', c_int), + ('data', STRING), + ('max', c_int), +] +assert sizeof(buf_mem_st) == 12, sizeof(buf_mem_st) +assert alignment(buf_mem_st) == 4, alignment(buf_mem_st) +BUF_MEM = buf_mem_st +class cast_key_st(Structure): + pass +cast_key_st._fields_ = [ + ('data', c_ulong * 32), + ('short_key', c_int), +] +assert sizeof(cast_key_st) == 132, sizeof(cast_key_st) +assert alignment(cast_key_st) == 4, alignment(cast_key_st) +CAST_KEY = cast_key_st +class comp_method_st(Structure): + pass +comp_method_st._fields_ = [ + ('type', c_int), + ('name', STRING), + ('init', CFUNCTYPE(c_int)), + ('finish', CFUNCTYPE(None)), + ('compress', CFUNCTYPE(c_int)), + ('expand', CFUNCTYPE(c_int)), + ('ctrl', CFUNCTYPE(c_long)), + ('callback_ctrl', CFUNCTYPE(c_long)), +] +assert sizeof(comp_method_st) == 32, sizeof(comp_method_st) +assert alignment(comp_method_st) == 4, alignment(comp_method_st) +COMP_METHOD = comp_method_st +class comp_ctx_st(Structure): + pass +comp_ctx_st._fields_ = [ + ('meth', POINTER(COMP_METHOD)), + ('compress_in', c_ulong), + ('compress_out', c_ulong), + ('expand_in', c_ulong), + ('expand_out', c_ulong), + ('ex_data', CRYPTO_EX_DATA), +] +assert sizeof(comp_ctx_st) == 28, sizeof(comp_ctx_st) +assert alignment(comp_ctx_st) == 4, alignment(comp_ctx_st) +COMP_CTX = comp_ctx_st +class CRYPTO_dynlock_value(Structure): + pass +CRYPTO_dynlock_value._fields_ = [ +] +class CRYPTO_dynlock(Structure): + pass +CRYPTO_dynlock._fields_ = [ + ('references', c_int), + ('data', POINTER(CRYPTO_dynlock_value)), +] +assert sizeof(CRYPTO_dynlock) == 8, sizeof(CRYPTO_dynlock) +assert alignment(CRYPTO_dynlock) == 4, alignment(CRYPTO_dynlock) +BIO_dummy = bio_st +CRYPTO_EX_new = CFUNCTYPE(c_int, c_void_p, c_void_p, POINTER(CRYPTO_EX_DATA), c_int, c_long, c_void_p) +CRYPTO_EX_free = CFUNCTYPE(None, c_void_p, c_void_p, POINTER(CRYPTO_EX_DATA), c_int, c_long, c_void_p) +CRYPTO_EX_dup = CFUNCTYPE(c_int, POINTER(CRYPTO_EX_DATA), POINTER(CRYPTO_EX_DATA), c_void_p, c_int, c_long, c_void_p) +class crypto_ex_data_func_st(Structure): + pass +crypto_ex_data_func_st._fields_ = [ + ('argl', c_long), + ('argp', c_void_p), + ('new_func', POINTER(CRYPTO_EX_new)), + ('free_func', POINTER(CRYPTO_EX_free)), + ('dup_func', POINTER(CRYPTO_EX_dup)), +] +assert sizeof(crypto_ex_data_func_st) == 20, sizeof(crypto_ex_data_func_st) +assert alignment(crypto_ex_data_func_st) == 4, alignment(crypto_ex_data_func_st) +CRYPTO_EX_DATA_FUNCS = crypto_ex_data_func_st +class st_CRYPTO_EX_DATA_IMPL(Structure): + pass +CRYPTO_EX_DATA_IMPL = st_CRYPTO_EX_DATA_IMPL +st_CRYPTO_EX_DATA_IMPL._fields_ = [ +] +CRYPTO_MEM_LEAK_CB = CFUNCTYPE(c_void_p, c_ulong, STRING, c_int, c_int, c_void_p) +DES_cblock = c_ubyte * 8 +const_DES_cblock = c_ubyte * 8 +class DES_ks(Structure): + pass +class N6DES_ks3DOLLAR_9E(Union): + pass +N6DES_ks3DOLLAR_9E._fields_ = [ + ('cblock', DES_cblock), + ('deslong', c_ulong * 2), +] +assert sizeof(N6DES_ks3DOLLAR_9E) == 8, sizeof(N6DES_ks3DOLLAR_9E) +assert alignment(N6DES_ks3DOLLAR_9E) == 4, alignment(N6DES_ks3DOLLAR_9E) +DES_ks._fields_ = [ + ('ks', N6DES_ks3DOLLAR_9E * 16), +] +assert sizeof(DES_ks) == 128, sizeof(DES_ks) +assert alignment(DES_ks) == 4, alignment(DES_ks) +DES_key_schedule = DES_ks +_ossl_old_des_cblock = c_ubyte * 8 +class _ossl_old_des_ks_struct(Structure): + pass +class N23_ossl_old_des_ks_struct4DOLLAR_10E(Union): + pass +N23_ossl_old_des_ks_struct4DOLLAR_10E._fields_ = [ + ('_', _ossl_old_des_cblock), + ('pad', c_ulong * 2), +] +assert sizeof(N23_ossl_old_des_ks_struct4DOLLAR_10E) == 8, sizeof(N23_ossl_old_des_ks_struct4DOLLAR_10E) +assert alignment(N23_ossl_old_des_ks_struct4DOLLAR_10E) == 4, alignment(N23_ossl_old_des_ks_struct4DOLLAR_10E) +_ossl_old_des_ks_struct._fields_ = [ + ('ks', N23_ossl_old_des_ks_struct4DOLLAR_10E), +] +assert sizeof(_ossl_old_des_ks_struct) == 8, sizeof(_ossl_old_des_ks_struct) +assert alignment(_ossl_old_des_ks_struct) == 4, alignment(_ossl_old_des_ks_struct) +_ossl_old_des_key_schedule = _ossl_old_des_ks_struct * 16 +class dh_st(Structure): + pass +DH = dh_st +class dh_method(Structure): + pass +dh_method._fields_ = [ + ('name', STRING), + ('generate_key', CFUNCTYPE(c_int, POINTER(DH))), + ('compute_key', CFUNCTYPE(c_int, POINTER(c_ubyte), POINTER(BIGNUM), POINTER(DH))), + ('bn_mod_exp', CFUNCTYPE(c_int, POINTER(DH), POINTER(BIGNUM), POINTER(BIGNUM), POINTER(BIGNUM), POINTER(BIGNUM), POINTER(BN_CTX), POINTER(BN_MONT_CTX))), + ('init', CFUNCTYPE(c_int, POINTER(DH))), + ('finish', CFUNCTYPE(c_int, POINTER(DH))), + ('flags', c_int), + ('app_data', STRING), +] +assert sizeof(dh_method) == 32, sizeof(dh_method) +assert alignment(dh_method) == 4, alignment(dh_method) +DH_METHOD = dh_method +class engine_st(Structure): + pass +ENGINE = engine_st +dh_st._fields_ = [ + ('pad', c_int), + ('version', c_int), + ('p', POINTER(BIGNUM)), + ('g', POINTER(BIGNUM)), + ('length', c_long), + ('pub_key', POINTER(BIGNUM)), + ('priv_key', POINTER(BIGNUM)), + ('flags', c_int), + ('method_mont_p', STRING), + ('q', POINTER(BIGNUM)), + ('j', POINTER(BIGNUM)), + ('seed', POINTER(c_ubyte)), + ('seedlen', c_int), + ('counter', POINTER(BIGNUM)), + ('references', c_int), + ('ex_data', CRYPTO_EX_DATA), + ('meth', POINTER(DH_METHOD)), + ('engine', POINTER(ENGINE)), +] +assert sizeof(dh_st) == 76, sizeof(dh_st) +assert alignment(dh_st) == 4, alignment(dh_st) +class dsa_st(Structure): + pass +DSA = dsa_st +class DSA_SIG_st(Structure): + pass +DSA_SIG_st._fields_ = [ + ('r', POINTER(BIGNUM)), + ('s', POINTER(BIGNUM)), +] +assert sizeof(DSA_SIG_st) == 8, sizeof(DSA_SIG_st) +assert alignment(DSA_SIG_st) == 4, alignment(DSA_SIG_st) +DSA_SIG = DSA_SIG_st +class dsa_method(Structure): + pass +dsa_method._fields_ = [ + ('name', STRING), + ('dsa_do_sign', CFUNCTYPE(POINTER(DSA_SIG), POINTER(c_ubyte), c_int, POINTER(DSA))), + ('dsa_sign_setup', CFUNCTYPE(c_int, POINTER(DSA), POINTER(BN_CTX), POINTER(POINTER(BIGNUM)), POINTER(POINTER(BIGNUM)))), + ('dsa_do_verify', CFUNCTYPE(c_int, POINTER(c_ubyte), c_int, POINTER(DSA_SIG), POINTER(DSA))), + ('dsa_mod_exp', CFUNCTYPE(c_int, POINTER(DSA), POINTER(BIGNUM), POINTER(BIGNUM), POINTER(BIGNUM), POINTER(BIGNUM), POINTER(BIGNUM), POINTER(BIGNUM), POINTER(BN_CTX), POINTER(BN_MONT_CTX))), + ('bn_mod_exp', CFUNCTYPE(c_int, POINTER(DSA), POINTER(BIGNUM), POINTER(BIGNUM), POINTER(BIGNUM), POINTER(BIGNUM), POINTER(BN_CTX), POINTER(BN_MONT_CTX))), + ('init', CFUNCTYPE(c_int, POINTER(DSA))), + ('finish', CFUNCTYPE(c_int, POINTER(DSA))), + ('flags', c_int), + ('app_data', STRING), +] +assert sizeof(dsa_method) == 40, sizeof(dsa_method) +assert alignment(dsa_method) == 4, alignment(dsa_method) +DSA_METHOD = dsa_method +dsa_st._fields_ = [ + ('pad', c_int), + ('version', c_long), + ('write_params', c_int), + ('p', POINTER(BIGNUM)), + ('q', POINTER(BIGNUM)), + ('g', POINTER(BIGNUM)), + ('pub_key', POINTER(BIGNUM)), + ('priv_key', POINTER(BIGNUM)), + ('kinv', POINTER(BIGNUM)), + ('r', POINTER(BIGNUM)), + ('flags', c_int), + ('method_mont_p', STRING), + ('references', c_int), + ('ex_data', CRYPTO_EX_DATA), + ('meth', POINTER(DSA_METHOD)), + ('engine', POINTER(ENGINE)), +] +assert sizeof(dsa_st) == 68, sizeof(dsa_st) +assert alignment(dsa_st) == 4, alignment(dsa_st) +class evp_pkey_st(Structure): + pass +class N11evp_pkey_st4DOLLAR_12E(Union): + pass +class rsa_st(Structure): + pass +N11evp_pkey_st4DOLLAR_12E._fields_ = [ + ('ptr', STRING), + ('rsa', POINTER(rsa_st)), + ('dsa', POINTER(dsa_st)), + ('dh', POINTER(dh_st)), +] +assert sizeof(N11evp_pkey_st4DOLLAR_12E) == 4, sizeof(N11evp_pkey_st4DOLLAR_12E) +assert alignment(N11evp_pkey_st4DOLLAR_12E) == 4, alignment(N11evp_pkey_st4DOLLAR_12E) +evp_pkey_st._fields_ = [ + ('type', c_int), + ('save_type', c_int), + ('references', c_int), + ('pkey', N11evp_pkey_st4DOLLAR_12E), + ('save_parameters', c_int), + ('attributes', POINTER(STACK)), +] +assert sizeof(evp_pkey_st) == 24, sizeof(evp_pkey_st) +assert alignment(evp_pkey_st) == 4, alignment(evp_pkey_st) +class env_md_st(Structure): + pass +class env_md_ctx_st(Structure): + pass +EVP_MD_CTX = env_md_ctx_st +env_md_st._fields_ = [ + ('type', c_int), + ('pkey_type', c_int), + ('md_size', c_int), + ('flags', c_ulong), + ('init', CFUNCTYPE(c_int, POINTER(EVP_MD_CTX))), + ('update', CFUNCTYPE(c_int, POINTER(EVP_MD_CTX), c_void_p, c_ulong)), + ('final', CFUNCTYPE(c_int, POINTER(EVP_MD_CTX), POINTER(c_ubyte))), + ('copy', CFUNCTYPE(c_int, POINTER(EVP_MD_CTX), POINTER(EVP_MD_CTX))), + ('cleanup', CFUNCTYPE(c_int, POINTER(EVP_MD_CTX))), + ('sign', CFUNCTYPE(c_int)), + ('verify', CFUNCTYPE(c_int)), + ('required_pkey_type', c_int * 5), + ('block_size', c_int), + ('ctx_size', c_int), +] +assert sizeof(env_md_st) == 72, sizeof(env_md_st) +assert alignment(env_md_st) == 4, alignment(env_md_st) +EVP_MD = env_md_st +env_md_ctx_st._fields_ = [ + ('digest', POINTER(EVP_MD)), + ('engine', POINTER(ENGINE)), + ('flags', c_ulong), + ('md_data', c_void_p), +] +assert sizeof(env_md_ctx_st) == 16, sizeof(env_md_ctx_st) +assert alignment(env_md_ctx_st) == 4, alignment(env_md_ctx_st) +class evp_cipher_st(Structure): + pass +class evp_cipher_ctx_st(Structure): + pass +EVP_CIPHER_CTX = evp_cipher_ctx_st +evp_cipher_st._fields_ = [ + ('nid', c_int), + ('block_size', c_int), + ('key_len', c_int), + ('iv_len', c_int), + ('flags', c_ulong), + ('init', CFUNCTYPE(c_int, POINTER(EVP_CIPHER_CTX), POINTER(c_ubyte), POINTER(c_ubyte), c_int)), + ('do_cipher', CFUNCTYPE(c_int, POINTER(EVP_CIPHER_CTX), POINTER(c_ubyte), POINTER(c_ubyte), c_uint)), + ('cleanup', CFUNCTYPE(c_int, POINTER(EVP_CIPHER_CTX))), + ('ctx_size', c_int), + ('set_asn1_parameters', CFUNCTYPE(c_int, POINTER(EVP_CIPHER_CTX), POINTER(ASN1_TYPE))), + ('get_asn1_parameters', CFUNCTYPE(c_int, POINTER(EVP_CIPHER_CTX), POINTER(ASN1_TYPE))), + ('ctrl', CFUNCTYPE(c_int, POINTER(EVP_CIPHER_CTX), c_int, c_int, c_void_p)), + ('app_data', c_void_p), +] +assert sizeof(evp_cipher_st) == 52, sizeof(evp_cipher_st) +assert alignment(evp_cipher_st) == 4, alignment(evp_cipher_st) +class evp_cipher_info_st(Structure): + pass +EVP_CIPHER = evp_cipher_st +evp_cipher_info_st._fields_ = [ + ('cipher', POINTER(EVP_CIPHER)), + ('iv', c_ubyte * 16), +] +assert sizeof(evp_cipher_info_st) == 20, sizeof(evp_cipher_info_st) +assert alignment(evp_cipher_info_st) == 4, alignment(evp_cipher_info_st) +EVP_CIPHER_INFO = evp_cipher_info_st +evp_cipher_ctx_st._fields_ = [ + ('cipher', POINTER(EVP_CIPHER)), + ('engine', POINTER(ENGINE)), + ('encrypt', c_int), + ('buf_len', c_int), + ('oiv', c_ubyte * 16), + ('iv', c_ubyte * 16), + ('buf', c_ubyte * 32), + ('num', c_int), + ('app_data', c_void_p), + ('key_len', c_int), + ('flags', c_ulong), + ('cipher_data', c_void_p), + ('final_used', c_int), + ('block_mask', c_int), + ('final', c_ubyte * 32), +] +assert sizeof(evp_cipher_ctx_st) == 140, sizeof(evp_cipher_ctx_st) +assert alignment(evp_cipher_ctx_st) == 4, alignment(evp_cipher_ctx_st) +class evp_Encode_Ctx_st(Structure): + pass +evp_Encode_Ctx_st._fields_ = [ + ('num', c_int), + ('length', c_int), + ('enc_data', c_ubyte * 80), + ('line_num', c_int), + ('expect_nl', c_int), +] +assert sizeof(evp_Encode_Ctx_st) == 96, sizeof(evp_Encode_Ctx_st) +assert alignment(evp_Encode_Ctx_st) == 4, alignment(evp_Encode_Ctx_st) +EVP_ENCODE_CTX = evp_Encode_Ctx_st +EVP_PBE_KEYGEN = CFUNCTYPE(c_int, POINTER(EVP_CIPHER_CTX), STRING, c_int, POINTER(ASN1_TYPE), POINTER(EVP_CIPHER), POINTER(EVP_MD), c_int) +class lhash_node_st(Structure): + pass +lhash_node_st._fields_ = [ + ('data', c_void_p), + ('next', POINTER(lhash_node_st)), + ('hash', c_ulong), +] +assert sizeof(lhash_node_st) == 12, sizeof(lhash_node_st) +assert alignment(lhash_node_st) == 4, alignment(lhash_node_st) +LHASH_NODE = lhash_node_st +LHASH_COMP_FN_TYPE = CFUNCTYPE(c_int, c_void_p, c_void_p) +LHASH_HASH_FN_TYPE = CFUNCTYPE(c_ulong, c_void_p) +LHASH_DOALL_FN_TYPE = CFUNCTYPE(None, c_void_p) +LHASH_DOALL_ARG_FN_TYPE = CFUNCTYPE(None, c_void_p, c_void_p) +class lhash_st(Structure): + pass +lhash_st._fields_ = [ + ('b', POINTER(POINTER(LHASH_NODE))), + ('comp', LHASH_COMP_FN_TYPE), + ('hash', LHASH_HASH_FN_TYPE), + ('num_nodes', c_uint), + ('num_alloc_nodes', c_uint), + ('p', c_uint), + ('pmax', c_uint), + ('up_load', c_ulong), + ('down_load', c_ulong), + ('num_items', c_ulong), + ('num_expands', c_ulong), + ('num_expand_reallocs', c_ulong), + ('num_contracts', c_ulong), + ('num_contract_reallocs', c_ulong), + ('num_hash_calls', c_ulong), + ('num_comp_calls', c_ulong), + ('num_insert', c_ulong), + ('num_replace', c_ulong), + ('num_delete', c_ulong), + ('num_no_delete', c_ulong), + ('num_retrieve', c_ulong), + ('num_retrieve_miss', c_ulong), + ('num_hash_comps', c_ulong), + ('error', c_int), +] +assert sizeof(lhash_st) == 96, sizeof(lhash_st) +assert alignment(lhash_st) == 4, alignment(lhash_st) +LHASH = lhash_st +class MD2state_st(Structure): + pass +MD2state_st._fields_ = [ + ('num', c_int), + ('data', c_ubyte * 16), + ('cksm', c_uint * 16), + ('state', c_uint * 16), +] +assert sizeof(MD2state_st) == 148, sizeof(MD2state_st) +assert alignment(MD2state_st) == 4, alignment(MD2state_st) +MD2_CTX = MD2state_st +class MD4state_st(Structure): + pass +MD4state_st._fields_ = [ + ('A', c_uint), + ('B', c_uint), + ('C', c_uint), + ('D', c_uint), + ('Nl', c_uint), + ('Nh', c_uint), + ('data', c_uint * 16), + ('num', c_int), +] +assert sizeof(MD4state_st) == 92, sizeof(MD4state_st) +assert alignment(MD4state_st) == 4, alignment(MD4state_st) +MD4_CTX = MD4state_st +class MD5state_st(Structure): + pass +MD5state_st._fields_ = [ + ('A', c_uint), + ('B', c_uint), + ('C', c_uint), + ('D', c_uint), + ('Nl', c_uint), + ('Nh', c_uint), + ('data', c_uint * 16), + ('num', c_int), +] +assert sizeof(MD5state_st) == 92, sizeof(MD5state_st) +assert alignment(MD5state_st) == 4, alignment(MD5state_st) +MD5_CTX = MD5state_st +class mdc2_ctx_st(Structure): + pass +mdc2_ctx_st._fields_ = [ + ('num', c_int), + ('data', c_ubyte * 8), + ('h', DES_cblock), + ('hh', DES_cblock), + ('pad_type', c_int), +] +assert sizeof(mdc2_ctx_st) == 32, sizeof(mdc2_ctx_st) +assert alignment(mdc2_ctx_st) == 4, alignment(mdc2_ctx_st) +MDC2_CTX = mdc2_ctx_st +class obj_name_st(Structure): + pass +obj_name_st._fields_ = [ + ('type', c_int), + ('alias', c_int), + ('name', STRING), + ('data', STRING), +] +assert sizeof(obj_name_st) == 16, sizeof(obj_name_st) +assert alignment(obj_name_st) == 4, alignment(obj_name_st) +OBJ_NAME = obj_name_st +ASN1_TIME = asn1_string_st +ASN1_NULL = c_int +EVP_PKEY = evp_pkey_st +class x509_st(Structure): + pass +X509 = x509_st +class X509_algor_st(Structure): + pass +X509_ALGOR = X509_algor_st +class X509_crl_st(Structure): + pass +X509_CRL = X509_crl_st +class X509_name_st(Structure): + pass +X509_NAME = X509_name_st +class x509_store_st(Structure): + pass +X509_STORE = x509_store_st +class x509_store_ctx_st(Structure): + pass +X509_STORE_CTX = x509_store_ctx_st +engine_st._fields_ = [ +] +class PEM_Encode_Seal_st(Structure): + pass +PEM_Encode_Seal_st._fields_ = [ + ('encode', EVP_ENCODE_CTX), + ('md', EVP_MD_CTX), + ('cipher', EVP_CIPHER_CTX), +] +assert sizeof(PEM_Encode_Seal_st) == 252, sizeof(PEM_Encode_Seal_st) +assert alignment(PEM_Encode_Seal_st) == 4, alignment(PEM_Encode_Seal_st) +PEM_ENCODE_SEAL_CTX = PEM_Encode_Seal_st +class pem_recip_st(Structure): + pass +pem_recip_st._fields_ = [ + ('name', STRING), + ('dn', POINTER(X509_NAME)), + ('cipher', c_int), + ('key_enc', c_int), +] +assert sizeof(pem_recip_st) == 16, sizeof(pem_recip_st) +assert alignment(pem_recip_st) == 4, alignment(pem_recip_st) +PEM_USER = pem_recip_st +class pem_ctx_st(Structure): + pass +class N10pem_ctx_st4DOLLAR_16E(Structure): + pass +N10pem_ctx_st4DOLLAR_16E._fields_ = [ + ('version', c_int), + ('mode', c_int), +] +assert sizeof(N10pem_ctx_st4DOLLAR_16E) == 8, sizeof(N10pem_ctx_st4DOLLAR_16E) +assert alignment(N10pem_ctx_st4DOLLAR_16E) == 4, alignment(N10pem_ctx_st4DOLLAR_16E) +class N10pem_ctx_st4DOLLAR_17E(Structure): + pass +N10pem_ctx_st4DOLLAR_17E._fields_ = [ + ('cipher', c_int), +] +assert sizeof(N10pem_ctx_st4DOLLAR_17E) == 4, sizeof(N10pem_ctx_st4DOLLAR_17E) +assert alignment(N10pem_ctx_st4DOLLAR_17E) == 4, alignment(N10pem_ctx_st4DOLLAR_17E) +pem_ctx_st._fields_ = [ + ('type', c_int), + ('proc_type', N10pem_ctx_st4DOLLAR_16E), + ('domain', STRING), + ('DEK_info', N10pem_ctx_st4DOLLAR_17E), + ('originator', POINTER(PEM_USER)), + ('num_recipient', c_int), + ('recipient', POINTER(POINTER(PEM_USER))), + ('x509_chain', POINTER(STACK)), + ('md', POINTER(EVP_MD)), + ('md_enc', c_int), + ('md_len', c_int), + ('md_data', STRING), + ('dec', POINTER(EVP_CIPHER)), + ('key_len', c_int), + ('key', POINTER(c_ubyte)), + ('data_enc', c_int), + ('data_len', c_int), + ('data', POINTER(c_ubyte)), +] +assert sizeof(pem_ctx_st) == 76, sizeof(pem_ctx_st) +assert alignment(pem_ctx_st) == 4, alignment(pem_ctx_st) +PEM_CTX = pem_ctx_st +pem_password_cb = CFUNCTYPE(c_int, STRING, c_int, c_int, c_void_p) +class pkcs7_issuer_and_serial_st(Structure): + pass +pkcs7_issuer_and_serial_st._fields_ = [ + ('issuer', POINTER(X509_NAME)), + ('serial', POINTER(ASN1_INTEGER)), +] +assert sizeof(pkcs7_issuer_and_serial_st) == 8, sizeof(pkcs7_issuer_and_serial_st) +assert alignment(pkcs7_issuer_and_serial_st) == 4, alignment(pkcs7_issuer_and_serial_st) +PKCS7_ISSUER_AND_SERIAL = pkcs7_issuer_and_serial_st +class pkcs7_signer_info_st(Structure): + pass +pkcs7_signer_info_st._fields_ = [ + ('version', POINTER(ASN1_INTEGER)), + ('issuer_and_serial', POINTER(PKCS7_ISSUER_AND_SERIAL)), + ('digest_alg', POINTER(X509_ALGOR)), + ('auth_attr', POINTER(STACK)), + ('digest_enc_alg', POINTER(X509_ALGOR)), + ('enc_digest', POINTER(ASN1_OCTET_STRING)), + ('unauth_attr', POINTER(STACK)), + ('pkey', POINTER(EVP_PKEY)), +] +assert sizeof(pkcs7_signer_info_st) == 32, sizeof(pkcs7_signer_info_st) +assert alignment(pkcs7_signer_info_st) == 4, alignment(pkcs7_signer_info_st) +PKCS7_SIGNER_INFO = pkcs7_signer_info_st +class pkcs7_recip_info_st(Structure): + pass +pkcs7_recip_info_st._fields_ = [ + ('version', POINTER(ASN1_INTEGER)), + ('issuer_and_serial', POINTER(PKCS7_ISSUER_AND_SERIAL)), + ('key_enc_algor', POINTER(X509_ALGOR)), + ('enc_key', POINTER(ASN1_OCTET_STRING)), + ('cert', POINTER(X509)), +] +assert sizeof(pkcs7_recip_info_st) == 20, sizeof(pkcs7_recip_info_st) +assert alignment(pkcs7_recip_info_st) == 4, alignment(pkcs7_recip_info_st) +PKCS7_RECIP_INFO = pkcs7_recip_info_st +class pkcs7_signed_st(Structure): + pass +class pkcs7_st(Structure): + pass +pkcs7_signed_st._fields_ = [ + ('version', POINTER(ASN1_INTEGER)), + ('md_algs', POINTER(STACK)), + ('cert', POINTER(STACK)), + ('crl', POINTER(STACK)), + ('signer_info', POINTER(STACK)), + ('contents', POINTER(pkcs7_st)), +] +assert sizeof(pkcs7_signed_st) == 24, sizeof(pkcs7_signed_st) +assert alignment(pkcs7_signed_st) == 4, alignment(pkcs7_signed_st) +PKCS7_SIGNED = pkcs7_signed_st +class pkcs7_enc_content_st(Structure): + pass +pkcs7_enc_content_st._fields_ = [ + ('content_type', POINTER(ASN1_OBJECT)), + ('algorithm', POINTER(X509_ALGOR)), + ('enc_data', POINTER(ASN1_OCTET_STRING)), + ('cipher', POINTER(EVP_CIPHER)), +] +assert sizeof(pkcs7_enc_content_st) == 16, sizeof(pkcs7_enc_content_st) +assert alignment(pkcs7_enc_content_st) == 4, alignment(pkcs7_enc_content_st) +PKCS7_ENC_CONTENT = pkcs7_enc_content_st +class pkcs7_enveloped_st(Structure): + pass +pkcs7_enveloped_st._fields_ = [ + ('version', POINTER(ASN1_INTEGER)), + ('recipientinfo', POINTER(STACK)), + ('enc_data', POINTER(PKCS7_ENC_CONTENT)), +] +assert sizeof(pkcs7_enveloped_st) == 12, sizeof(pkcs7_enveloped_st) +assert alignment(pkcs7_enveloped_st) == 4, alignment(pkcs7_enveloped_st) +PKCS7_ENVELOPE = pkcs7_enveloped_st +class pkcs7_signedandenveloped_st(Structure): + pass +pkcs7_signedandenveloped_st._fields_ = [ + ('version', POINTER(ASN1_INTEGER)), + ('md_algs', POINTER(STACK)), + ('cert', POINTER(STACK)), + ('crl', POINTER(STACK)), + ('signer_info', POINTER(STACK)), + ('enc_data', POINTER(PKCS7_ENC_CONTENT)), + ('recipientinfo', POINTER(STACK)), +] +assert sizeof(pkcs7_signedandenveloped_st) == 28, sizeof(pkcs7_signedandenveloped_st) +assert alignment(pkcs7_signedandenveloped_st) == 4, alignment(pkcs7_signedandenveloped_st) +PKCS7_SIGN_ENVELOPE = pkcs7_signedandenveloped_st +class pkcs7_digest_st(Structure): + pass +pkcs7_digest_st._fields_ = [ + ('version', POINTER(ASN1_INTEGER)), + ('md', POINTER(X509_ALGOR)), + ('contents', POINTER(pkcs7_st)), + ('digest', POINTER(ASN1_OCTET_STRING)), +] +assert sizeof(pkcs7_digest_st) == 16, sizeof(pkcs7_digest_st) +assert alignment(pkcs7_digest_st) == 4, alignment(pkcs7_digest_st) +PKCS7_DIGEST = pkcs7_digest_st +class pkcs7_encrypted_st(Structure): + pass +pkcs7_encrypted_st._fields_ = [ + ('version', POINTER(ASN1_INTEGER)), + ('enc_data', POINTER(PKCS7_ENC_CONTENT)), +] +assert sizeof(pkcs7_encrypted_st) == 8, sizeof(pkcs7_encrypted_st) +assert alignment(pkcs7_encrypted_st) == 4, alignment(pkcs7_encrypted_st) +PKCS7_ENCRYPT = pkcs7_encrypted_st +class N8pkcs7_st4DOLLAR_15E(Union): + pass +N8pkcs7_st4DOLLAR_15E._fields_ = [ + ('ptr', STRING), + ('data', POINTER(ASN1_OCTET_STRING)), + ('sign', POINTER(PKCS7_SIGNED)), + ('enveloped', POINTER(PKCS7_ENVELOPE)), + ('signed_and_enveloped', POINTER(PKCS7_SIGN_ENVELOPE)), + ('digest', POINTER(PKCS7_DIGEST)), + ('encrypted', POINTER(PKCS7_ENCRYPT)), + ('other', POINTER(ASN1_TYPE)), +] +assert sizeof(N8pkcs7_st4DOLLAR_15E) == 4, sizeof(N8pkcs7_st4DOLLAR_15E) +assert alignment(N8pkcs7_st4DOLLAR_15E) == 4, alignment(N8pkcs7_st4DOLLAR_15E) +pkcs7_st._fields_ = [ + ('asn1', POINTER(c_ubyte)), + ('length', c_long), + ('state', c_int), + ('detached', c_int), + ('type', POINTER(ASN1_OBJECT)), + ('d', N8pkcs7_st4DOLLAR_15E), +] +assert sizeof(pkcs7_st) == 24, sizeof(pkcs7_st) +assert alignment(pkcs7_st) == 4, alignment(pkcs7_st) +PKCS7 = pkcs7_st +class rc2_key_st(Structure): + pass +rc2_key_st._fields_ = [ + ('data', c_uint * 64), +] +assert sizeof(rc2_key_st) == 256, sizeof(rc2_key_st) +assert alignment(rc2_key_st) == 4, alignment(rc2_key_st) +RC2_KEY = rc2_key_st +class rc4_key_st(Structure): + pass +rc4_key_st._fields_ = [ + ('x', c_ubyte), + ('y', c_ubyte), + ('data', c_ubyte * 256), +] +assert sizeof(rc4_key_st) == 258, sizeof(rc4_key_st) +assert alignment(rc4_key_st) == 1, alignment(rc4_key_st) +RC4_KEY = rc4_key_st +class rc5_key_st(Structure): + pass +rc5_key_st._fields_ = [ + ('rounds', c_int), + ('data', c_ulong * 34), +] +assert sizeof(rc5_key_st) == 140, sizeof(rc5_key_st) +assert alignment(rc5_key_st) == 4, alignment(rc5_key_st) +RC5_32_KEY = rc5_key_st +class RIPEMD160state_st(Structure): + pass +RIPEMD160state_st._fields_ = [ + ('A', c_uint), + ('B', c_uint), + ('C', c_uint), + ('D', c_uint), + ('E', c_uint), + ('Nl', c_uint), + ('Nh', c_uint), + ('data', c_uint * 16), + ('num', c_int), +] +assert sizeof(RIPEMD160state_st) == 96, sizeof(RIPEMD160state_st) +assert alignment(RIPEMD160state_st) == 4, alignment(RIPEMD160state_st) +RIPEMD160_CTX = RIPEMD160state_st +RSA = rsa_st +class rsa_meth_st(Structure): + pass +rsa_meth_st._fields_ = [ + ('name', STRING), + ('rsa_pub_enc', CFUNCTYPE(c_int, c_int, POINTER(c_ubyte), POINTER(c_ubyte), POINTER(RSA), c_int)), + ('rsa_pub_dec', CFUNCTYPE(c_int, c_int, POINTER(c_ubyte), POINTER(c_ubyte), POINTER(RSA), c_int)), + ('rsa_priv_enc', CFUNCTYPE(c_int, c_int, POINTER(c_ubyte), POINTER(c_ubyte), POINTER(RSA), c_int)), + ('rsa_priv_dec', CFUNCTYPE(c_int, c_int, POINTER(c_ubyte), POINTER(c_ubyte), POINTER(RSA), c_int)), + ('rsa_mod_exp', CFUNCTYPE(c_int, POINTER(BIGNUM), POINTER(BIGNUM), POINTER(RSA))), + ('bn_mod_exp', CFUNCTYPE(c_int, POINTER(BIGNUM), POINTER(BIGNUM), POINTER(BIGNUM), POINTER(BIGNUM), POINTER(BN_CTX), POINTER(BN_MONT_CTX))), + ('init', CFUNCTYPE(c_int, POINTER(RSA))), + ('finish', CFUNCTYPE(c_int, POINTER(RSA))), + ('flags', c_int), + ('app_data', STRING), + ('rsa_sign', CFUNCTYPE(c_int, c_int, POINTER(c_ubyte), c_uint, POINTER(c_ubyte), POINTER(c_uint), POINTER(RSA))), + ('rsa_verify', CFUNCTYPE(c_int, c_int, POINTER(c_ubyte), c_uint, POINTER(c_ubyte), c_uint, POINTER(RSA))), +] +assert sizeof(rsa_meth_st) == 52, sizeof(rsa_meth_st) +assert alignment(rsa_meth_st) == 4, alignment(rsa_meth_st) +RSA_METHOD = rsa_meth_st +rsa_st._fields_ = [ + ('pad', c_int), + ('version', c_long), + ('meth', POINTER(RSA_METHOD)), + ('engine', POINTER(ENGINE)), + ('n', POINTER(BIGNUM)), + ('e', POINTER(BIGNUM)), + ('d', POINTER(BIGNUM)), + ('p', POINTER(BIGNUM)), + ('q', POINTER(BIGNUM)), + ('dmp1', POINTER(BIGNUM)), + ('dmq1', POINTER(BIGNUM)), + ('iqmp', POINTER(BIGNUM)), + ('ex_data', CRYPTO_EX_DATA), + ('references', c_int), + ('flags', c_int), + ('_method_mod_n', POINTER(BN_MONT_CTX)), + ('_method_mod_p', POINTER(BN_MONT_CTX)), + ('_method_mod_q', POINTER(BN_MONT_CTX)), + ('bignum_data', STRING), + ('blinding', POINTER(BN_BLINDING)), +] +assert sizeof(rsa_st) == 84, sizeof(rsa_st) +assert alignment(rsa_st) == 4, alignment(rsa_st) +openssl_fptr = CFUNCTYPE(None) +class SHAstate_st(Structure): + pass +SHAstate_st._fields_ = [ + ('h0', c_uint), + ('h1', c_uint), + ('h2', c_uint), + ('h3', c_uint), + ('h4', c_uint), + ('Nl', c_uint), + ('Nh', c_uint), + ('data', c_uint * 16), + ('num', c_int), +] +assert sizeof(SHAstate_st) == 96, sizeof(SHAstate_st) +assert alignment(SHAstate_st) == 4, alignment(SHAstate_st) +SHA_CTX = SHAstate_st +class ssl_st(Structure): + pass +ssl_crock_st = POINTER(ssl_st) +class ssl_cipher_st(Structure): + pass +ssl_cipher_st._fields_ = [ + ('valid', c_int), + ('name', STRING), + ('id', c_ulong), + ('algorithms', c_ulong), + ('algo_strength', c_ulong), + ('algorithm2', c_ulong), + ('strength_bits', c_int), + ('alg_bits', c_int), + ('mask', c_ulong), + ('mask_strength', c_ulong), +] +assert sizeof(ssl_cipher_st) == 40, sizeof(ssl_cipher_st) +assert alignment(ssl_cipher_st) == 4, alignment(ssl_cipher_st) +SSL_CIPHER = ssl_cipher_st +SSL = ssl_st +class ssl_ctx_st(Structure): + pass +SSL_CTX = ssl_ctx_st +class ssl_method_st(Structure): + pass +class ssl3_enc_method(Structure): + pass +ssl_method_st._fields_ = [ + ('version', c_int), + ('ssl_new', CFUNCTYPE(c_int, POINTER(SSL))), + ('ssl_clear', CFUNCTYPE(None, POINTER(SSL))), + ('ssl_free', CFUNCTYPE(None, POINTER(SSL))), + ('ssl_accept', CFUNCTYPE(c_int, POINTER(SSL))), + ('ssl_connect', CFUNCTYPE(c_int, POINTER(SSL))), + ('ssl_read', CFUNCTYPE(c_int, POINTER(SSL), c_void_p, c_int)), + ('ssl_peek', CFUNCTYPE(c_int, POINTER(SSL), c_void_p, c_int)), + ('ssl_write', CFUNCTYPE(c_int, POINTER(SSL), c_void_p, c_int)), + ('ssl_shutdown', CFUNCTYPE(c_int, POINTER(SSL))), + ('ssl_renegotiate', CFUNCTYPE(c_int, POINTER(SSL))), + ('ssl_renegotiate_check', CFUNCTYPE(c_int, POINTER(SSL))), + ('ssl_ctrl', CFUNCTYPE(c_long, POINTER(SSL), c_int, c_long, c_void_p)), + ('ssl_ctx_ctrl', CFUNCTYPE(c_long, POINTER(SSL_CTX), c_int, c_long, c_void_p)), + ('get_cipher_by_char', CFUNCTYPE(POINTER(SSL_CIPHER), POINTER(c_ubyte))), + ('put_cipher_by_char', CFUNCTYPE(c_int, POINTER(SSL_CIPHER), POINTER(c_ubyte))), + ('ssl_pending', CFUNCTYPE(c_int, POINTER(SSL))), + ('num_ciphers', CFUNCTYPE(c_int)), + ('get_cipher', CFUNCTYPE(POINTER(SSL_CIPHER), c_uint)), + ('get_ssl_method', CFUNCTYPE(POINTER(ssl_method_st), c_int)), + ('get_timeout', CFUNCTYPE(c_long)), + ('ssl3_enc', POINTER(ssl3_enc_method)), + ('ssl_version', CFUNCTYPE(c_int)), + ('ssl_callback_ctrl', CFUNCTYPE(c_long, POINTER(SSL), c_int, CFUNCTYPE(None))), + ('ssl_ctx_callback_ctrl', CFUNCTYPE(c_long, POINTER(SSL_CTX), c_int, CFUNCTYPE(None))), +] +assert sizeof(ssl_method_st) == 100, sizeof(ssl_method_st) +assert alignment(ssl_method_st) == 4, alignment(ssl_method_st) +ssl3_enc_method._fields_ = [ +] +SSL_METHOD = ssl_method_st +class ssl_session_st(Structure): + pass +class sess_cert_st(Structure): + pass +ssl_session_st._fields_ = [ + ('ssl_version', c_int), + ('key_arg_length', c_uint), + ('key_arg', c_ubyte * 8), + ('master_key_length', c_int), + ('master_key', c_ubyte * 48), + ('session_id_length', c_uint), + ('session_id', c_ubyte * 32), + ('sid_ctx_length', c_uint), + ('sid_ctx', c_ubyte * 32), + ('not_resumable', c_int), + ('sess_cert', POINTER(sess_cert_st)), + ('peer', POINTER(X509)), + ('verify_result', c_long), + ('references', c_int), + ('timeout', c_long), + ('time', c_long), + ('compress_meth', c_int), + ('cipher', POINTER(SSL_CIPHER)), + ('cipher_id', c_ulong), + ('ciphers', POINTER(STACK)), + ('ex_data', CRYPTO_EX_DATA), + ('prev', POINTER(ssl_session_st)), + ('next', POINTER(ssl_session_st)), +] +assert sizeof(ssl_session_st) == 200, sizeof(ssl_session_st) +assert alignment(ssl_session_st) == 4, alignment(ssl_session_st) +sess_cert_st._fields_ = [ +] +SSL_SESSION = ssl_session_st +GEN_SESSION_CB = CFUNCTYPE(c_int, POINTER(SSL), POINTER(c_ubyte), POINTER(c_uint)) +class ssl_comp_st(Structure): + pass +ssl_comp_st._fields_ = [ + ('id', c_int), + ('name', STRING), + ('method', POINTER(COMP_METHOD)), +] +assert sizeof(ssl_comp_st) == 12, sizeof(ssl_comp_st) +assert alignment(ssl_comp_st) == 4, alignment(ssl_comp_st) +SSL_COMP = ssl_comp_st +class N10ssl_ctx_st4DOLLAR_18E(Structure): + pass +N10ssl_ctx_st4DOLLAR_18E._fields_ = [ + ('sess_connect', c_int), + ('sess_connect_renegotiate', c_int), + ('sess_connect_good', c_int), + ('sess_accept', c_int), + ('sess_accept_renegotiate', c_int), + ('sess_accept_good', c_int), + ('sess_miss', c_int), + ('sess_timeout', c_int), + ('sess_cache_full', c_int), + ('sess_hit', c_int), + ('sess_cb_hit', c_int), +] +assert sizeof(N10ssl_ctx_st4DOLLAR_18E) == 44, sizeof(N10ssl_ctx_st4DOLLAR_18E) +assert alignment(N10ssl_ctx_st4DOLLAR_18E) == 4, alignment(N10ssl_ctx_st4DOLLAR_18E) +class cert_st(Structure): + pass +ssl_ctx_st._fields_ = [ + ('method', POINTER(SSL_METHOD)), + ('cipher_list', POINTER(STACK)), + ('cipher_list_by_id', POINTER(STACK)), + ('cert_store', POINTER(x509_store_st)), + ('sessions', POINTER(lhash_st)), + ('session_cache_size', c_ulong), + ('session_cache_head', POINTER(ssl_session_st)), + ('session_cache_tail', POINTER(ssl_session_st)), + ('session_cache_mode', c_int), + ('session_timeout', c_long), + ('new_session_cb', CFUNCTYPE(c_int, POINTER(ssl_st), POINTER(SSL_SESSION))), + ('remove_session_cb', CFUNCTYPE(None, POINTER(ssl_ctx_st), POINTER(SSL_SESSION))), + ('get_session_cb', CFUNCTYPE(POINTER(SSL_SESSION), POINTER(ssl_st), POINTER(c_ubyte), c_int, POINTER(c_int))), + ('stats', N10ssl_ctx_st4DOLLAR_18E), + ('references', c_int), + ('app_verify_callback', CFUNCTYPE(c_int, POINTER(X509_STORE_CTX), c_void_p)), + ('app_verify_arg', c_void_p), + ('default_passwd_callback', POINTER(pem_password_cb)), + ('default_passwd_callback_userdata', c_void_p), + ('client_cert_cb', CFUNCTYPE(c_int, POINTER(SSL), POINTER(POINTER(X509)), POINTER(POINTER(EVP_PKEY)))), + ('ex_data', CRYPTO_EX_DATA), + ('rsa_md5', POINTER(EVP_MD)), + ('md5', POINTER(EVP_MD)), + ('sha1', POINTER(EVP_MD)), + ('extra_certs', POINTER(STACK)), + ('comp_methods', POINTER(STACK)), + ('info_callback', CFUNCTYPE(None, POINTER(SSL), c_int, c_int)), + ('client_CA', POINTER(STACK)), + ('options', c_ulong), + ('mode', c_ulong), + ('max_cert_list', c_long), + ('cert', POINTER(cert_st)), + ('read_ahead', c_int), + ('msg_callback', CFUNCTYPE(None, c_int, c_int, c_int, c_void_p, c_ulong, POINTER(SSL), c_void_p)), + ('msg_callback_arg', c_void_p), + ('verify_mode', c_int), + ('verify_depth', c_int), + ('sid_ctx_length', c_uint), + ('sid_ctx', c_ubyte * 32), + ('default_verify_callback', CFUNCTYPE(c_int, c_int, POINTER(X509_STORE_CTX))), + ('generate_session_id', GEN_SESSION_CB), + ('purpose', c_int), + ('trust', c_int), + ('quiet_shutdown', c_int), +] +assert sizeof(ssl_ctx_st) == 248, sizeof(ssl_ctx_st) +assert alignment(ssl_ctx_st) == 4, alignment(ssl_ctx_st) +cert_st._fields_ = [ +] +class ssl2_state_st(Structure): + pass +class ssl3_state_st(Structure): + pass +ssl_st._fields_ = [ + ('version', c_int), + ('type', c_int), + ('method', POINTER(SSL_METHOD)), + ('rbio', POINTER(BIO)), + ('wbio', POINTER(BIO)), + ('bbio', POINTER(BIO)), + ('rwstate', c_int), + ('in_handshake', c_int), + ('handshake_func', CFUNCTYPE(c_int)), + ('server', c_int), + ('new_session', c_int), + ('quiet_shutdown', c_int), + ('shutdown', c_int), + ('state', c_int), + ('rstate', c_int), + ('init_buf', POINTER(BUF_MEM)), + ('init_msg', c_void_p), + ('init_num', c_int), + ('init_off', c_int), + ('packet', POINTER(c_ubyte)), + ('packet_length', c_uint), + ('s2', POINTER(ssl2_state_st)), + ('s3', POINTER(ssl3_state_st)), + ('read_ahead', c_int), + ('msg_callback', CFUNCTYPE(None, c_int, c_int, c_int, c_void_p, c_ulong, POINTER(SSL), c_void_p)), + ('msg_callback_arg', c_void_p), + ('hit', c_int), + ('purpose', c_int), + ('trust', c_int), + ('cipher_list', POINTER(STACK)), + ('cipher_list_by_id', POINTER(STACK)), + ('enc_read_ctx', POINTER(EVP_CIPHER_CTX)), + ('read_hash', POINTER(EVP_MD)), + ('expand', POINTER(COMP_CTX)), + ('enc_write_ctx', POINTER(EVP_CIPHER_CTX)), + ('write_hash', POINTER(EVP_MD)), + ('compress', POINTER(COMP_CTX)), + ('cert', POINTER(cert_st)), + ('sid_ctx_length', c_uint), + ('sid_ctx', c_ubyte * 32), + ('session', POINTER(SSL_SESSION)), + ('generate_session_id', GEN_SESSION_CB), + ('verify_mode', c_int), + ('verify_depth', c_int), + ('verify_callback', CFUNCTYPE(c_int, c_int, POINTER(X509_STORE_CTX))), + ('info_callback', CFUNCTYPE(None, POINTER(SSL), c_int, c_int)), + ('error', c_int), + ('error_code', c_int), + ('ctx', POINTER(SSL_CTX)), + ('debug', c_int), + ('verify_result', c_long), + ('ex_data', CRYPTO_EX_DATA), + ('client_CA', POINTER(STACK)), + ('references', c_int), + ('options', c_ulong), + ('mode', c_ulong), + ('max_cert_list', c_long), + ('first_packet', c_int), + ('client_version', c_int), +] +assert sizeof(ssl_st) == 268, sizeof(ssl_st) +assert alignment(ssl_st) == 4, alignment(ssl_st) +class N13ssl2_state_st4DOLLAR_19E(Structure): + pass +N13ssl2_state_st4DOLLAR_19E._fields_ = [ + ('conn_id_length', c_uint), + ('cert_type', c_uint), + ('cert_length', c_uint), + ('csl', c_uint), + ('clear', c_uint), + ('enc', c_uint), + ('ccl', c_ubyte * 32), + ('cipher_spec_length', c_uint), + ('session_id_length', c_uint), + ('clen', c_uint), + ('rlen', c_uint), +] +assert sizeof(N13ssl2_state_st4DOLLAR_19E) == 72, sizeof(N13ssl2_state_st4DOLLAR_19E) +assert alignment(N13ssl2_state_st4DOLLAR_19E) == 4, alignment(N13ssl2_state_st4DOLLAR_19E) +ssl2_state_st._fields_ = [ + ('three_byte_header', c_int), + ('clear_text', c_int), + ('escape', c_int), + ('ssl2_rollback', c_int), + ('wnum', c_uint), + ('wpend_tot', c_int), + ('wpend_buf', POINTER(c_ubyte)), + ('wpend_off', c_int), + ('wpend_len', c_int), + ('wpend_ret', c_int), + ('rbuf_left', c_int), + ('rbuf_offs', c_int), + ('rbuf', POINTER(c_ubyte)), + ('wbuf', POINTER(c_ubyte)), + ('write_ptr', POINTER(c_ubyte)), + ('padding', c_uint), + ('rlength', c_uint), + ('ract_data_length', c_int), + ('wlength', c_uint), + ('wact_data_length', c_int), + ('ract_data', POINTER(c_ubyte)), + ('wact_data', POINTER(c_ubyte)), + ('mac_data', POINTER(c_ubyte)), + ('read_key', POINTER(c_ubyte)), + ('write_key', POINTER(c_ubyte)), + ('challenge_length', c_uint), + ('challenge', c_ubyte * 32), + ('conn_id_length', c_uint), + ('conn_id', c_ubyte * 16), + ('key_material_length', c_uint), + ('key_material', c_ubyte * 48), + ('read_sequence', c_ulong), + ('write_sequence', c_ulong), + ('tmp', N13ssl2_state_st4DOLLAR_19E), +] +assert sizeof(ssl2_state_st) == 288, sizeof(ssl2_state_st) +assert alignment(ssl2_state_st) == 4, alignment(ssl2_state_st) +SSL2_STATE = ssl2_state_st +class ssl3_record_st(Structure): + pass +ssl3_record_st._fields_ = [ + ('type', c_int), + ('length', c_uint), + ('off', c_uint), + ('data', POINTER(c_ubyte)), + ('input', POINTER(c_ubyte)), + ('comp', POINTER(c_ubyte)), +] +assert sizeof(ssl3_record_st) == 24, sizeof(ssl3_record_st) +assert alignment(ssl3_record_st) == 4, alignment(ssl3_record_st) +SSL3_RECORD = ssl3_record_st +class ssl3_buffer_st(Structure): + pass +size_t = __darwin_size_t +ssl3_buffer_st._fields_ = [ + ('buf', POINTER(c_ubyte)), + ('len', size_t), + ('offset', c_int), + ('left', c_int), +] +assert sizeof(ssl3_buffer_st) == 16, sizeof(ssl3_buffer_st) +assert alignment(ssl3_buffer_st) == 4, alignment(ssl3_buffer_st) +SSL3_BUFFER = ssl3_buffer_st +class N13ssl3_state_st4DOLLAR_20E(Structure): + pass +N13ssl3_state_st4DOLLAR_20E._fields_ = [ + ('cert_verify_md', c_ubyte * 72), + ('finish_md', c_ubyte * 72), + ('finish_md_len', c_int), + ('peer_finish_md', c_ubyte * 72), + ('peer_finish_md_len', c_int), + ('message_size', c_ulong), + ('message_type', c_int), + ('new_cipher', POINTER(SSL_CIPHER)), + ('dh', POINTER(DH)), + ('next_state', c_int), + ('reuse_message', c_int), + ('cert_req', c_int), + ('ctype_num', c_int), + ('ctype', c_char * 7), + ('ca_names', POINTER(STACK)), + ('use_rsa_tmp', c_int), + ('key_block_length', c_int), + ('key_block', POINTER(c_ubyte)), + ('new_sym_enc', POINTER(EVP_CIPHER)), + ('new_hash', POINTER(EVP_MD)), + ('new_compression', POINTER(SSL_COMP)), + ('cert_request', c_int), +] +assert sizeof(N13ssl3_state_st4DOLLAR_20E) == 296, sizeof(N13ssl3_state_st4DOLLAR_20E) +assert alignment(N13ssl3_state_st4DOLLAR_20E) == 4, alignment(N13ssl3_state_st4DOLLAR_20E) +ssl3_state_st._fields_ = [ + ('flags', c_long), + ('delay_buf_pop_ret', c_int), + ('read_sequence', c_ubyte * 8), + ('read_mac_secret', c_ubyte * 36), + ('write_sequence', c_ubyte * 8), + ('write_mac_secret', c_ubyte * 36), + ('server_random', c_ubyte * 32), + ('client_random', c_ubyte * 32), + ('need_empty_fragments', c_int), + ('empty_fragment_done', c_int), + ('rbuf', SSL3_BUFFER), + ('wbuf', SSL3_BUFFER), + ('rrec', SSL3_RECORD), + ('wrec', SSL3_RECORD), + ('alert_fragment', c_ubyte * 2), + ('alert_fragment_len', c_uint), + ('handshake_fragment', c_ubyte * 4), + ('handshake_fragment_len', c_uint), + ('wnum', c_uint), + ('wpend_tot', c_int), + ('wpend_type', c_int), + ('wpend_ret', c_int), + ('wpend_buf', POINTER(c_ubyte)), + ('finish_dgst1', EVP_MD_CTX), + ('finish_dgst2', EVP_MD_CTX), + ('change_cipher_spec', c_int), + ('warn_alert', c_int), + ('fatal_alert', c_int), + ('alert_dispatch', c_int), + ('send_alert', c_ubyte * 2), + ('renegotiate', c_int), + ('total_renegotiations', c_int), + ('num_renegotiations', c_int), + ('in_read_app_data', c_int), + ('tmp', N13ssl3_state_st4DOLLAR_20E), +] +assert sizeof(ssl3_state_st) == 648, sizeof(ssl3_state_st) +assert alignment(ssl3_state_st) == 4, alignment(ssl3_state_st) +SSL3_STATE = ssl3_state_st +stack_st._fields_ = [ + ('num', c_int), + ('data', POINTER(STRING)), + ('sorted', c_int), + ('num_alloc', c_int), + ('comp', CFUNCTYPE(c_int, POINTER(STRING), POINTER(STRING))), +] +assert sizeof(stack_st) == 20, sizeof(stack_st) +assert alignment(stack_st) == 4, alignment(stack_st) +class ui_st(Structure): + pass +ui_st._fields_ = [ +] +UI = ui_st +class ui_method_st(Structure): + pass +ui_method_st._fields_ = [ +] +UI_METHOD = ui_method_st +class ui_string_st(Structure): + pass +ui_string_st._fields_ = [ +] +UI_STRING = ui_string_st + +# values for enumeration 'UI_string_types' +UI_string_types = c_int # enum +class X509_objects_st(Structure): + pass +X509_objects_st._fields_ = [ + ('nid', c_int), + ('a2i', CFUNCTYPE(c_int)), + ('i2a', CFUNCTYPE(c_int)), +] +assert sizeof(X509_objects_st) == 12, sizeof(X509_objects_st) +assert alignment(X509_objects_st) == 4, alignment(X509_objects_st) +X509_OBJECTS = X509_objects_st +X509_algor_st._fields_ = [ + ('algorithm', POINTER(ASN1_OBJECT)), + ('parameter', POINTER(ASN1_TYPE)), +] +assert sizeof(X509_algor_st) == 8, sizeof(X509_algor_st) +assert alignment(X509_algor_st) == 4, alignment(X509_algor_st) +class X509_val_st(Structure): + pass +X509_val_st._fields_ = [ + ('notBefore', POINTER(ASN1_TIME)), + ('notAfter', POINTER(ASN1_TIME)), +] +assert sizeof(X509_val_st) == 8, sizeof(X509_val_st) +assert alignment(X509_val_st) == 4, alignment(X509_val_st) +X509_VAL = X509_val_st +class X509_pubkey_st(Structure): + pass +X509_pubkey_st._fields_ = [ + ('algor', POINTER(X509_ALGOR)), + ('public_key', POINTER(ASN1_BIT_STRING)), + ('pkey', POINTER(EVP_PKEY)), +] +assert sizeof(X509_pubkey_st) == 12, sizeof(X509_pubkey_st) +assert alignment(X509_pubkey_st) == 4, alignment(X509_pubkey_st) +X509_PUBKEY = X509_pubkey_st +class X509_sig_st(Structure): + pass +X509_sig_st._fields_ = [ + ('algor', POINTER(X509_ALGOR)), + ('digest', POINTER(ASN1_OCTET_STRING)), +] +assert sizeof(X509_sig_st) == 8, sizeof(X509_sig_st) +assert alignment(X509_sig_st) == 4, alignment(X509_sig_st) +X509_SIG = X509_sig_st +class X509_name_entry_st(Structure): + pass +X509_name_entry_st._fields_ = [ + ('object', POINTER(ASN1_OBJECT)), + ('value', POINTER(ASN1_STRING)), + ('set', c_int), + ('size', c_int), +] +assert sizeof(X509_name_entry_st) == 16, sizeof(X509_name_entry_st) +assert alignment(X509_name_entry_st) == 4, alignment(X509_name_entry_st) +X509_NAME_ENTRY = X509_name_entry_st +X509_name_st._fields_ = [ + ('entries', POINTER(STACK)), + ('modified', c_int), + ('bytes', POINTER(BUF_MEM)), + ('hash', c_ulong), +] +assert sizeof(X509_name_st) == 16, sizeof(X509_name_st) +assert alignment(X509_name_st) == 4, alignment(X509_name_st) +class X509_extension_st(Structure): + pass +X509_extension_st._fields_ = [ + ('object', POINTER(ASN1_OBJECT)), + ('critical', ASN1_BOOLEAN), + ('value', POINTER(ASN1_OCTET_STRING)), +] +assert sizeof(X509_extension_st) == 12, sizeof(X509_extension_st) +assert alignment(X509_extension_st) == 4, alignment(X509_extension_st) +X509_EXTENSION = X509_extension_st +class x509_attributes_st(Structure): + pass +class N18x509_attributes_st4DOLLAR_13E(Union): + pass +N18x509_attributes_st4DOLLAR_13E._fields_ = [ + ('ptr', STRING), + ('set', POINTER(STACK)), + ('single', POINTER(ASN1_TYPE)), +] +assert sizeof(N18x509_attributes_st4DOLLAR_13E) == 4, sizeof(N18x509_attributes_st4DOLLAR_13E) +assert alignment(N18x509_attributes_st4DOLLAR_13E) == 4, alignment(N18x509_attributes_st4DOLLAR_13E) +x509_attributes_st._fields_ = [ + ('object', POINTER(ASN1_OBJECT)), + ('single', c_int), + ('value', N18x509_attributes_st4DOLLAR_13E), +] +assert sizeof(x509_attributes_st) == 12, sizeof(x509_attributes_st) +assert alignment(x509_attributes_st) == 4, alignment(x509_attributes_st) +X509_ATTRIBUTE = x509_attributes_st +class X509_req_info_st(Structure): + pass +X509_req_info_st._fields_ = [ + ('enc', ASN1_ENCODING), + ('version', POINTER(ASN1_INTEGER)), + ('subject', POINTER(X509_NAME)), + ('pubkey', POINTER(X509_PUBKEY)), + ('attributes', POINTER(STACK)), +] +assert sizeof(X509_req_info_st) == 28, sizeof(X509_req_info_st) +assert alignment(X509_req_info_st) == 4, alignment(X509_req_info_st) +X509_REQ_INFO = X509_req_info_st +class X509_req_st(Structure): + pass +X509_req_st._fields_ = [ + ('req_info', POINTER(X509_REQ_INFO)), + ('sig_alg', POINTER(X509_ALGOR)), + ('signature', POINTER(ASN1_BIT_STRING)), + ('references', c_int), +] +assert sizeof(X509_req_st) == 16, sizeof(X509_req_st) +assert alignment(X509_req_st) == 4, alignment(X509_req_st) +X509_REQ = X509_req_st +class x509_cinf_st(Structure): + pass +x509_cinf_st._fields_ = [ + ('version', POINTER(ASN1_INTEGER)), + ('serialNumber', POINTER(ASN1_INTEGER)), + ('signature', POINTER(X509_ALGOR)), + ('issuer', POINTER(X509_NAME)), + ('validity', POINTER(X509_VAL)), + ('subject', POINTER(X509_NAME)), + ('key', POINTER(X509_PUBKEY)), + ('issuerUID', POINTER(ASN1_BIT_STRING)), + ('subjectUID', POINTER(ASN1_BIT_STRING)), + ('extensions', POINTER(STACK)), +] +assert sizeof(x509_cinf_st) == 40, sizeof(x509_cinf_st) +assert alignment(x509_cinf_st) == 4, alignment(x509_cinf_st) +X509_CINF = x509_cinf_st +class x509_cert_aux_st(Structure): + pass +x509_cert_aux_st._fields_ = [ + ('trust', POINTER(STACK)), + ('reject', POINTER(STACK)), + ('alias', POINTER(ASN1_UTF8STRING)), + ('keyid', POINTER(ASN1_OCTET_STRING)), + ('other', POINTER(STACK)), +] +assert sizeof(x509_cert_aux_st) == 20, sizeof(x509_cert_aux_st) +assert alignment(x509_cert_aux_st) == 4, alignment(x509_cert_aux_st) +X509_CERT_AUX = x509_cert_aux_st +class AUTHORITY_KEYID_st(Structure): + pass +x509_st._fields_ = [ + ('cert_info', POINTER(X509_CINF)), + ('sig_alg', POINTER(X509_ALGOR)), + ('signature', POINTER(ASN1_BIT_STRING)), + ('valid', c_int), + ('references', c_int), + ('name', STRING), + ('ex_data', CRYPTO_EX_DATA), + ('ex_pathlen', c_long), + ('ex_flags', c_ulong), + ('ex_kusage', c_ulong), + ('ex_xkusage', c_ulong), + ('ex_nscert', c_ulong), + ('skid', POINTER(ASN1_OCTET_STRING)), + ('akid', POINTER(AUTHORITY_KEYID_st)), + ('sha1_hash', c_ubyte * 20), + ('aux', POINTER(X509_CERT_AUX)), +] +assert sizeof(x509_st) == 84, sizeof(x509_st) +assert alignment(x509_st) == 4, alignment(x509_st) +AUTHORITY_KEYID_st._fields_ = [ +] +class x509_trust_st(Structure): + pass +x509_trust_st._fields_ = [ + ('trust', c_int), + ('flags', c_int), + ('check_trust', CFUNCTYPE(c_int, POINTER(x509_trust_st), POINTER(X509), c_int)), + ('name', STRING), + ('arg1', c_int), + ('arg2', c_void_p), +] +assert sizeof(x509_trust_st) == 24, sizeof(x509_trust_st) +assert alignment(x509_trust_st) == 4, alignment(x509_trust_st) +X509_TRUST = x509_trust_st +class X509_revoked_st(Structure): + pass +X509_revoked_st._fields_ = [ + ('serialNumber', POINTER(ASN1_INTEGER)), + ('revocationDate', POINTER(ASN1_TIME)), + ('extensions', POINTER(STACK)), + ('sequence', c_int), +] +assert sizeof(X509_revoked_st) == 16, sizeof(X509_revoked_st) +assert alignment(X509_revoked_st) == 4, alignment(X509_revoked_st) +X509_REVOKED = X509_revoked_st +class X509_crl_info_st(Structure): + pass +X509_crl_info_st._fields_ = [ + ('version', POINTER(ASN1_INTEGER)), + ('sig_alg', POINTER(X509_ALGOR)), + ('issuer', POINTER(X509_NAME)), + ('lastUpdate', POINTER(ASN1_TIME)), + ('nextUpdate', POINTER(ASN1_TIME)), + ('revoked', POINTER(STACK)), + ('extensions', POINTER(STACK)), + ('enc', ASN1_ENCODING), +] +assert sizeof(X509_crl_info_st) == 40, sizeof(X509_crl_info_st) +assert alignment(X509_crl_info_st) == 4, alignment(X509_crl_info_st) +X509_CRL_INFO = X509_crl_info_st +X509_crl_st._fields_ = [ + ('crl', POINTER(X509_CRL_INFO)), + ('sig_alg', POINTER(X509_ALGOR)), + ('signature', POINTER(ASN1_BIT_STRING)), + ('references', c_int), +] +assert sizeof(X509_crl_st) == 16, sizeof(X509_crl_st) +assert alignment(X509_crl_st) == 4, alignment(X509_crl_st) +class private_key_st(Structure): + pass +private_key_st._fields_ = [ + ('version', c_int), + ('enc_algor', POINTER(X509_ALGOR)), + ('enc_pkey', POINTER(ASN1_OCTET_STRING)), + ('dec_pkey', POINTER(EVP_PKEY)), + ('key_length', c_int), + ('key_data', STRING), + ('key_free', c_int), + ('cipher', EVP_CIPHER_INFO), + ('references', c_int), +] +assert sizeof(private_key_st) == 52, sizeof(private_key_st) +assert alignment(private_key_st) == 4, alignment(private_key_st) +X509_PKEY = private_key_st +class X509_info_st(Structure): + pass +X509_info_st._fields_ = [ + ('x509', POINTER(X509)), + ('crl', POINTER(X509_CRL)), + ('x_pkey', POINTER(X509_PKEY)), + ('enc_cipher', EVP_CIPHER_INFO), + ('enc_len', c_int), + ('enc_data', STRING), + ('references', c_int), +] +assert sizeof(X509_info_st) == 44, sizeof(X509_info_st) +assert alignment(X509_info_st) == 4, alignment(X509_info_st) +X509_INFO = X509_info_st +class Netscape_spkac_st(Structure): + pass +Netscape_spkac_st._fields_ = [ + ('pubkey', POINTER(X509_PUBKEY)), + ('challenge', POINTER(ASN1_IA5STRING)), +] +assert sizeof(Netscape_spkac_st) == 8, sizeof(Netscape_spkac_st) +assert alignment(Netscape_spkac_st) == 4, alignment(Netscape_spkac_st) +NETSCAPE_SPKAC = Netscape_spkac_st +class Netscape_spki_st(Structure): + pass +Netscape_spki_st._fields_ = [ + ('spkac', POINTER(NETSCAPE_SPKAC)), + ('sig_algor', POINTER(X509_ALGOR)), + ('signature', POINTER(ASN1_BIT_STRING)), +] +assert sizeof(Netscape_spki_st) == 12, sizeof(Netscape_spki_st) +assert alignment(Netscape_spki_st) == 4, alignment(Netscape_spki_st) +NETSCAPE_SPKI = Netscape_spki_st +class Netscape_certificate_sequence(Structure): + pass +Netscape_certificate_sequence._fields_ = [ + ('type', POINTER(ASN1_OBJECT)), + ('certs', POINTER(STACK)), +] +assert sizeof(Netscape_certificate_sequence) == 8, sizeof(Netscape_certificate_sequence) +assert alignment(Netscape_certificate_sequence) == 4, alignment(Netscape_certificate_sequence) +NETSCAPE_CERT_SEQUENCE = Netscape_certificate_sequence +class PBEPARAM_st(Structure): + pass +PBEPARAM_st._fields_ = [ + ('salt', POINTER(ASN1_OCTET_STRING)), + ('iter', POINTER(ASN1_INTEGER)), +] +assert sizeof(PBEPARAM_st) == 8, sizeof(PBEPARAM_st) +assert alignment(PBEPARAM_st) == 4, alignment(PBEPARAM_st) +PBEPARAM = PBEPARAM_st +class PBE2PARAM_st(Structure): + pass +PBE2PARAM_st._fields_ = [ + ('keyfunc', POINTER(X509_ALGOR)), + ('encryption', POINTER(X509_ALGOR)), +] +assert sizeof(PBE2PARAM_st) == 8, sizeof(PBE2PARAM_st) +assert alignment(PBE2PARAM_st) == 4, alignment(PBE2PARAM_st) +PBE2PARAM = PBE2PARAM_st +class PBKDF2PARAM_st(Structure): + pass +PBKDF2PARAM_st._fields_ = [ + ('salt', POINTER(ASN1_TYPE)), + ('iter', POINTER(ASN1_INTEGER)), + ('keylength', POINTER(ASN1_INTEGER)), + ('prf', POINTER(X509_ALGOR)), +] +assert sizeof(PBKDF2PARAM_st) == 16, sizeof(PBKDF2PARAM_st) +assert alignment(PBKDF2PARAM_st) == 4, alignment(PBKDF2PARAM_st) +PBKDF2PARAM = PBKDF2PARAM_st +class pkcs8_priv_key_info_st(Structure): + pass +pkcs8_priv_key_info_st._fields_ = [ + ('broken', c_int), + ('version', POINTER(ASN1_INTEGER)), + ('pkeyalg', POINTER(X509_ALGOR)), + ('pkey', POINTER(ASN1_TYPE)), + ('attributes', POINTER(STACK)), +] +assert sizeof(pkcs8_priv_key_info_st) == 20, sizeof(pkcs8_priv_key_info_st) +assert alignment(pkcs8_priv_key_info_st) == 4, alignment(pkcs8_priv_key_info_st) +PKCS8_PRIV_KEY_INFO = pkcs8_priv_key_info_st +class x509_hash_dir_st(Structure): + pass +x509_hash_dir_st._fields_ = [ + ('num_dirs', c_int), + ('dirs', POINTER(STRING)), + ('dirs_type', POINTER(c_int)), + ('num_dirs_alloced', c_int), +] +assert sizeof(x509_hash_dir_st) == 16, sizeof(x509_hash_dir_st) +assert alignment(x509_hash_dir_st) == 4, alignment(x509_hash_dir_st) +X509_HASH_DIR_CTX = x509_hash_dir_st +class x509_file_st(Structure): + pass +x509_file_st._fields_ = [ + ('num_paths', c_int), + ('num_alloced', c_int), + ('paths', POINTER(STRING)), + ('path_type', POINTER(c_int)), +] +assert sizeof(x509_file_st) == 16, sizeof(x509_file_st) +assert alignment(x509_file_st) == 4, alignment(x509_file_st) +X509_CERT_FILE_CTX = x509_file_st +class x509_object_st(Structure): + pass +class N14x509_object_st4DOLLAR_14E(Union): + pass +N14x509_object_st4DOLLAR_14E._fields_ = [ + ('ptr', STRING), + ('x509', POINTER(X509)), + ('crl', POINTER(X509_CRL)), + ('pkey', POINTER(EVP_PKEY)), +] +assert sizeof(N14x509_object_st4DOLLAR_14E) == 4, sizeof(N14x509_object_st4DOLLAR_14E) +assert alignment(N14x509_object_st4DOLLAR_14E) == 4, alignment(N14x509_object_st4DOLLAR_14E) +x509_object_st._fields_ = [ + ('type', c_int), + ('data', N14x509_object_st4DOLLAR_14E), +] +assert sizeof(x509_object_st) == 8, sizeof(x509_object_st) +assert alignment(x509_object_st) == 4, alignment(x509_object_st) +X509_OBJECT = x509_object_st +class x509_lookup_st(Structure): + pass +X509_LOOKUP = x509_lookup_st +class x509_lookup_method_st(Structure): + pass +x509_lookup_method_st._fields_ = [ + ('name', STRING), + ('new_item', CFUNCTYPE(c_int, POINTER(X509_LOOKUP))), + ('free', CFUNCTYPE(None, POINTER(X509_LOOKUP))), + ('init', CFUNCTYPE(c_int, POINTER(X509_LOOKUP))), + ('shutdown', CFUNCTYPE(c_int, POINTER(X509_LOOKUP))), + ('ctrl', CFUNCTYPE(c_int, POINTER(X509_LOOKUP), c_int, STRING, c_long, POINTER(STRING))), + ('get_by_subject', CFUNCTYPE(c_int, POINTER(X509_LOOKUP), c_int, POINTER(X509_NAME), POINTER(X509_OBJECT))), + ('get_by_issuer_serial', CFUNCTYPE(c_int, POINTER(X509_LOOKUP), c_int, POINTER(X509_NAME), POINTER(ASN1_INTEGER), POINTER(X509_OBJECT))), + ('get_by_fingerprint', CFUNCTYPE(c_int, POINTER(X509_LOOKUP), c_int, POINTER(c_ubyte), c_int, POINTER(X509_OBJECT))), + ('get_by_alias', CFUNCTYPE(c_int, POINTER(X509_LOOKUP), c_int, STRING, c_int, POINTER(X509_OBJECT))), +] +assert sizeof(x509_lookup_method_st) == 40, sizeof(x509_lookup_method_st) +assert alignment(x509_lookup_method_st) == 4, alignment(x509_lookup_method_st) +X509_LOOKUP_METHOD = x509_lookup_method_st +x509_store_st._fields_ = [ + ('cache', c_int), + ('objs', POINTER(STACK)), + ('get_cert_methods', POINTER(STACK)), + ('flags', c_ulong), + ('purpose', c_int), + ('trust', c_int), + ('verify', CFUNCTYPE(c_int, POINTER(X509_STORE_CTX))), + ('verify_cb', CFUNCTYPE(c_int, c_int, POINTER(X509_STORE_CTX))), + ('get_issuer', CFUNCTYPE(c_int, POINTER(POINTER(X509)), POINTER(X509_STORE_CTX), POINTER(X509))), + ('check_issued', CFUNCTYPE(c_int, POINTER(X509_STORE_CTX), POINTER(X509), POINTER(X509))), + ('check_revocation', CFUNCTYPE(c_int, POINTER(X509_STORE_CTX))), + ('get_crl', CFUNCTYPE(c_int, POINTER(X509_STORE_CTX), POINTER(POINTER(X509_CRL)), POINTER(X509))), + ('check_crl', CFUNCTYPE(c_int, POINTER(X509_STORE_CTX), POINTER(X509_CRL))), + ('cert_crl', CFUNCTYPE(c_int, POINTER(X509_STORE_CTX), POINTER(X509_CRL), POINTER(X509))), + ('cleanup', CFUNCTYPE(c_int, POINTER(X509_STORE_CTX))), + ('ex_data', CRYPTO_EX_DATA), + ('references', c_int), + ('depth', c_int), +] +assert sizeof(x509_store_st) == 76, sizeof(x509_store_st) +assert alignment(x509_store_st) == 4, alignment(x509_store_st) +x509_lookup_st._fields_ = [ + ('init', c_int), + ('skip', c_int), + ('method', POINTER(X509_LOOKUP_METHOD)), + ('method_data', STRING), + ('store_ctx', POINTER(X509_STORE)), +] +assert sizeof(x509_lookup_st) == 20, sizeof(x509_lookup_st) +assert alignment(x509_lookup_st) == 4, alignment(x509_lookup_st) +time_t = __darwin_time_t +x509_store_ctx_st._fields_ = [ + ('ctx', POINTER(X509_STORE)), + ('current_method', c_int), + ('cert', POINTER(X509)), + ('untrusted', POINTER(STACK)), + ('purpose', c_int), + ('trust', c_int), + ('check_time', time_t), + ('flags', c_ulong), + ('other_ctx', c_void_p), + ('verify', CFUNCTYPE(c_int, POINTER(X509_STORE_CTX))), + ('verify_cb', CFUNCTYPE(c_int, c_int, POINTER(X509_STORE_CTX))), + ('get_issuer', CFUNCTYPE(c_int, POINTER(POINTER(X509)), POINTER(X509_STORE_CTX), POINTER(X509))), + ('check_issued', CFUNCTYPE(c_int, POINTER(X509_STORE_CTX), POINTER(X509), POINTER(X509))), + ('check_revocation', CFUNCTYPE(c_int, POINTER(X509_STORE_CTX))), + ('get_crl', CFUNCTYPE(c_int, POINTER(X509_STORE_CTX), POINTER(POINTER(X509_CRL)), POINTER(X509))), + ('check_crl', CFUNCTYPE(c_int, POINTER(X509_STORE_CTX), POINTER(X509_CRL))), + ('cert_crl', CFUNCTYPE(c_int, POINTER(X509_STORE_CTX), POINTER(X509_CRL), POINTER(X509))), + ('cleanup', CFUNCTYPE(c_int, POINTER(X509_STORE_CTX))), + ('depth', c_int), + ('valid', c_int), + ('last_untrusted', c_int), + ('chain', POINTER(STACK)), + ('error_depth', c_int), + ('error', c_int), + ('current_cert', POINTER(X509)), + ('current_issuer', POINTER(X509)), + ('current_crl', POINTER(X509_CRL)), + ('ex_data', CRYPTO_EX_DATA), +] +assert sizeof(x509_store_ctx_st) == 116, sizeof(x509_store_ctx_st) +assert alignment(x509_store_ctx_st) == 4, alignment(x509_store_ctx_st) +va_list = __darwin_va_list +__darwin_off_t = __int64_t +fpos_t = __darwin_off_t +class __sbuf(Structure): + pass +__sbuf._fields_ = [ + ('_base', POINTER(c_ubyte)), + ('_size', c_int), +] +assert sizeof(__sbuf) == 8, sizeof(__sbuf) +assert alignment(__sbuf) == 4, alignment(__sbuf) +class __sFILEX(Structure): + pass +__sFILEX._fields_ = [ +] +class __sFILE(Structure): + pass +__sFILE._pack_ = 4 +__sFILE._fields_ = [ + ('_p', POINTER(c_ubyte)), + ('_r', c_int), + ('_w', c_int), + ('_flags', c_short), + ('_file', c_short), + ('_bf', __sbuf), + ('_lbfsize', c_int), + ('_cookie', c_void_p), + ('_close', CFUNCTYPE(c_int, c_void_p)), + ('_read', CFUNCTYPE(c_int, c_void_p, STRING, c_int)), + ('_seek', CFUNCTYPE(fpos_t, c_void_p, c_longlong, c_int)), + ('_write', CFUNCTYPE(c_int, c_void_p, STRING, c_int)), + ('_ub', __sbuf), + ('_extra', POINTER(__sFILEX)), + ('_ur', c_int), + ('_ubuf', c_ubyte * 3), + ('_nbuf', c_ubyte * 1), + ('_lb', __sbuf), + ('_blksize', c_int), + ('_offset', fpos_t), +] +assert sizeof(__sFILE) == 88, sizeof(__sFILE) +assert alignment(__sFILE) == 4, alignment(__sFILE) +FILE = __sFILE +ct_rune_t = __darwin_ct_rune_t +rune_t = __darwin_rune_t +class div_t(Structure): + pass +div_t._fields_ = [ + ('quot', c_int), + ('rem', c_int), +] +assert sizeof(div_t) == 8, sizeof(div_t) +assert alignment(div_t) == 4, alignment(div_t) +class ldiv_t(Structure): + pass +ldiv_t._fields_ = [ + ('quot', c_long), + ('rem', c_long), +] +assert sizeof(ldiv_t) == 8, sizeof(ldiv_t) +assert alignment(ldiv_t) == 4, alignment(ldiv_t) +class lldiv_t(Structure): + pass +lldiv_t._pack_ = 4 +lldiv_t._fields_ = [ + ('quot', c_longlong), + ('rem', c_longlong), +] +assert sizeof(lldiv_t) == 16, sizeof(lldiv_t) +assert alignment(lldiv_t) == 4, alignment(lldiv_t) +__darwin_dev_t = __int32_t +dev_t = __darwin_dev_t +__darwin_mode_t = __uint16_t +mode_t = __darwin_mode_t +class mcontext(Structure): + pass +mcontext._fields_ = [ +] +class mcontext64(Structure): + pass +mcontext64._fields_ = [ +] +class __darwin_pthread_handler_rec(Structure): + pass +__darwin_pthread_handler_rec._fields_ = [ + ('__routine', CFUNCTYPE(None, c_void_p)), + ('__arg', c_void_p), + ('__next', POINTER(__darwin_pthread_handler_rec)), +] +assert sizeof(__darwin_pthread_handler_rec) == 12, sizeof(__darwin_pthread_handler_rec) +assert alignment(__darwin_pthread_handler_rec) == 4, alignment(__darwin_pthread_handler_rec) +class _opaque_pthread_attr_t(Structure): + pass +_opaque_pthread_attr_t._fields_ = [ + ('__sig', c_long), + ('__opaque', c_char * 36), +] +assert sizeof(_opaque_pthread_attr_t) == 40, sizeof(_opaque_pthread_attr_t) +assert alignment(_opaque_pthread_attr_t) == 4, alignment(_opaque_pthread_attr_t) +class _opaque_pthread_cond_t(Structure): + pass +_opaque_pthread_cond_t._fields_ = [ + ('__sig', c_long), + ('__opaque', c_char * 24), +] +assert sizeof(_opaque_pthread_cond_t) == 28, sizeof(_opaque_pthread_cond_t) +assert alignment(_opaque_pthread_cond_t) == 4, alignment(_opaque_pthread_cond_t) +class _opaque_pthread_condattr_t(Structure): + pass +_opaque_pthread_condattr_t._fields_ = [ + ('__sig', c_long), + ('__opaque', c_char * 4), +] +assert sizeof(_opaque_pthread_condattr_t) == 8, sizeof(_opaque_pthread_condattr_t) +assert alignment(_opaque_pthread_condattr_t) == 4, alignment(_opaque_pthread_condattr_t) +class _opaque_pthread_mutex_t(Structure): + pass +_opaque_pthread_mutex_t._fields_ = [ + ('__sig', c_long), + ('__opaque', c_char * 40), +] +assert sizeof(_opaque_pthread_mutex_t) == 44, sizeof(_opaque_pthread_mutex_t) +assert alignment(_opaque_pthread_mutex_t) == 4, alignment(_opaque_pthread_mutex_t) +class _opaque_pthread_mutexattr_t(Structure): + pass +_opaque_pthread_mutexattr_t._fields_ = [ + ('__sig', c_long), + ('__opaque', c_char * 8), +] +assert sizeof(_opaque_pthread_mutexattr_t) == 12, sizeof(_opaque_pthread_mutexattr_t) +assert alignment(_opaque_pthread_mutexattr_t) == 4, alignment(_opaque_pthread_mutexattr_t) +class _opaque_pthread_once_t(Structure): + pass +_opaque_pthread_once_t._fields_ = [ + ('__sig', c_long), + ('__opaque', c_char * 4), +] +assert sizeof(_opaque_pthread_once_t) == 8, sizeof(_opaque_pthread_once_t) +assert alignment(_opaque_pthread_once_t) == 4, alignment(_opaque_pthread_once_t) +class _opaque_pthread_rwlock_t(Structure): + pass +_opaque_pthread_rwlock_t._fields_ = [ + ('__sig', c_long), + ('__opaque', c_char * 124), +] +assert sizeof(_opaque_pthread_rwlock_t) == 128, sizeof(_opaque_pthread_rwlock_t) +assert alignment(_opaque_pthread_rwlock_t) == 4, alignment(_opaque_pthread_rwlock_t) +class _opaque_pthread_rwlockattr_t(Structure): + pass +_opaque_pthread_rwlockattr_t._fields_ = [ + ('__sig', c_long), + ('__opaque', c_char * 12), +] +assert sizeof(_opaque_pthread_rwlockattr_t) == 16, sizeof(_opaque_pthread_rwlockattr_t) +assert alignment(_opaque_pthread_rwlockattr_t) == 4, alignment(_opaque_pthread_rwlockattr_t) +class _opaque_pthread_t(Structure): + pass +_opaque_pthread_t._fields_ = [ + ('__sig', c_long), + ('__cleanup_stack', POINTER(__darwin_pthread_handler_rec)), + ('__opaque', c_char * 596), +] +assert sizeof(_opaque_pthread_t) == 604, sizeof(_opaque_pthread_t) +assert alignment(_opaque_pthread_t) == 4, alignment(_opaque_pthread_t) +__darwin_blkcnt_t = __int64_t +__darwin_blksize_t = __int32_t +__darwin_fsblkcnt_t = c_uint +__darwin_fsfilcnt_t = c_uint +__darwin_gid_t = __uint32_t +__darwin_id_t = __uint32_t +__darwin_ino_t = __uint32_t +__darwin_mach_port_name_t = __darwin_natural_t +__darwin_mach_port_t = __darwin_mach_port_name_t +__darwin_mcontext_t = POINTER(mcontext) +__darwin_mcontext64_t = POINTER(mcontext64) +__darwin_pid_t = __int32_t +__darwin_pthread_attr_t = _opaque_pthread_attr_t +__darwin_pthread_cond_t = _opaque_pthread_cond_t +__darwin_pthread_condattr_t = _opaque_pthread_condattr_t +__darwin_pthread_key_t = c_ulong +__darwin_pthread_mutex_t = _opaque_pthread_mutex_t +__darwin_pthread_mutexattr_t = _opaque_pthread_mutexattr_t +__darwin_pthread_once_t = _opaque_pthread_once_t +__darwin_pthread_rwlock_t = _opaque_pthread_rwlock_t +__darwin_pthread_rwlockattr_t = _opaque_pthread_rwlockattr_t +__darwin_pthread_t = POINTER(_opaque_pthread_t) +__darwin_sigset_t = __uint32_t +__darwin_suseconds_t = __int32_t +__darwin_uid_t = __uint32_t +__darwin_useconds_t = __uint32_t +__darwin_uuid_t = c_ubyte * 16 +class sigaltstack(Structure): + pass +sigaltstack._fields_ = [ + ('ss_sp', c_void_p), + ('ss_size', __darwin_size_t), + ('ss_flags', c_int), +] +assert sizeof(sigaltstack) == 12, sizeof(sigaltstack) +assert alignment(sigaltstack) == 4, alignment(sigaltstack) +__darwin_stack_t = sigaltstack +class ucontext(Structure): + pass +ucontext._fields_ = [ + ('uc_onstack', c_int), + ('uc_sigmask', __darwin_sigset_t), + ('uc_stack', __darwin_stack_t), + ('uc_link', POINTER(ucontext)), + ('uc_mcsize', __darwin_size_t), + ('uc_mcontext', __darwin_mcontext_t), +] +assert sizeof(ucontext) == 32, sizeof(ucontext) +assert alignment(ucontext) == 4, alignment(ucontext) +__darwin_ucontext_t = ucontext +class ucontext64(Structure): + pass +ucontext64._fields_ = [ + ('uc_onstack', c_int), + ('uc_sigmask', __darwin_sigset_t), + ('uc_stack', __darwin_stack_t), + ('uc_link', POINTER(ucontext64)), + ('uc_mcsize', __darwin_size_t), + ('uc_mcontext64', __darwin_mcontext64_t), +] +assert sizeof(ucontext64) == 32, sizeof(ucontext64) +assert alignment(ucontext64) == 4, alignment(ucontext64) +__darwin_ucontext64_t = ucontext64 +class timeval(Structure): + pass +timeval._fields_ = [ + ('tv_sec', __darwin_time_t), + ('tv_usec', __darwin_suseconds_t), +] +assert sizeof(timeval) == 8, sizeof(timeval) +assert alignment(timeval) == 4, alignment(timeval) +rlim_t = __int64_t +class rusage(Structure): + pass +rusage._fields_ = [ + ('ru_utime', timeval), + ('ru_stime', timeval), + ('ru_maxrss', c_long), + ('ru_ixrss', c_long), + ('ru_idrss', c_long), + ('ru_isrss', c_long), + ('ru_minflt', c_long), + ('ru_majflt', c_long), + ('ru_nswap', c_long), + ('ru_inblock', c_long), + ('ru_oublock', c_long), + ('ru_msgsnd', c_long), + ('ru_msgrcv', c_long), + ('ru_nsignals', c_long), + ('ru_nvcsw', c_long), + ('ru_nivcsw', c_long), +] +assert sizeof(rusage) == 72, sizeof(rusage) +assert alignment(rusage) == 4, alignment(rusage) +class rlimit(Structure): + pass +rlimit._pack_ = 4 +rlimit._fields_ = [ + ('rlim_cur', rlim_t), + ('rlim_max', rlim_t), +] +assert sizeof(rlimit) == 16, sizeof(rlimit) +assert alignment(rlimit) == 4, alignment(rlimit) +mcontext_t = __darwin_mcontext_t +mcontext64_t = __darwin_mcontext64_t +pthread_attr_t = __darwin_pthread_attr_t +sigset_t = __darwin_sigset_t +ucontext_t = __darwin_ucontext_t +ucontext64_t = __darwin_ucontext64_t +uid_t = __darwin_uid_t +class sigval(Union): + pass +sigval._fields_ = [ + ('sival_int', c_int), + ('sival_ptr', c_void_p), +] +assert sizeof(sigval) == 4, sizeof(sigval) +assert alignment(sigval) == 4, alignment(sigval) +class sigevent(Structure): + pass +sigevent._fields_ = [ + ('sigev_notify', c_int), + ('sigev_signo', c_int), + ('sigev_value', sigval), + ('sigev_notify_function', CFUNCTYPE(None, sigval)), + ('sigev_notify_attributes', POINTER(pthread_attr_t)), +] +assert sizeof(sigevent) == 20, sizeof(sigevent) +assert alignment(sigevent) == 4, alignment(sigevent) +class __siginfo(Structure): + pass +pid_t = __darwin_pid_t +__siginfo._fields_ = [ + ('si_signo', c_int), + ('si_errno', c_int), + ('si_code', c_int), + ('si_pid', pid_t), + ('si_uid', uid_t), + ('si_status', c_int), + ('si_addr', c_void_p), + ('si_value', sigval), + ('si_band', c_long), + ('pad', c_ulong * 7), +] +assert sizeof(__siginfo) == 64, sizeof(__siginfo) +assert alignment(__siginfo) == 4, alignment(__siginfo) +siginfo_t = __siginfo +class __sigaction_u(Union): + pass +__sigaction_u._fields_ = [ + ('__sa_handler', CFUNCTYPE(None, c_int)), + ('__sa_sigaction', CFUNCTYPE(None, c_int, POINTER(__siginfo), c_void_p)), +] +assert sizeof(__sigaction_u) == 4, sizeof(__sigaction_u) +assert alignment(__sigaction_u) == 4, alignment(__sigaction_u) +class __sigaction(Structure): + pass +__sigaction._fields_ = [ + ('__sigaction_u', __sigaction_u), + ('sa_tramp', CFUNCTYPE(None, c_void_p, c_int, c_int, POINTER(siginfo_t), c_void_p)), + ('sa_mask', sigset_t), + ('sa_flags', c_int), +] +assert sizeof(__sigaction) == 16, sizeof(__sigaction) +assert alignment(__sigaction) == 4, alignment(__sigaction) +class sigaction(Structure): + pass +sigaction._fields_ = [ + ('__sigaction_u', __sigaction_u), + ('sa_mask', sigset_t), + ('sa_flags', c_int), +] +assert sizeof(sigaction) == 12, sizeof(sigaction) +assert alignment(sigaction) == 4, alignment(sigaction) +sig_t = CFUNCTYPE(None, c_int) +stack_t = __darwin_stack_t +class sigvec(Structure): + pass +sigvec._fields_ = [ + ('sv_handler', CFUNCTYPE(None, c_int)), + ('sv_mask', c_int), + ('sv_flags', c_int), +] +assert sizeof(sigvec) == 12, sizeof(sigvec) +assert alignment(sigvec) == 4, alignment(sigvec) +class sigstack(Structure): + pass +sigstack._fields_ = [ + ('ss_sp', STRING), + ('ss_onstack', c_int), +] +assert sizeof(sigstack) == 8, sizeof(sigstack) +assert alignment(sigstack) == 4, alignment(sigstack) +u_char = c_ubyte +u_short = c_ushort +u_int = c_uint +u_long = c_ulong +ushort = c_ushort +uint = c_uint +u_quad_t = u_int64_t +quad_t = int64_t +qaddr_t = POINTER(quad_t) +caddr_t = STRING +daddr_t = int32_t +fixpt_t = u_int32_t +blkcnt_t = __darwin_blkcnt_t +blksize_t = __darwin_blksize_t +gid_t = __darwin_gid_t +in_addr_t = __uint32_t +in_port_t = __uint16_t +ino_t = __darwin_ino_t +key_t = __int32_t +nlink_t = __uint16_t +off_t = __darwin_off_t +segsz_t = int32_t +swblk_t = int32_t +clock_t = __darwin_clock_t +ssize_t = __darwin_ssize_t +useconds_t = __darwin_useconds_t +suseconds_t = __darwin_suseconds_t +fd_mask = __int32_t +class fd_set(Structure): + pass +fd_set._fields_ = [ + ('fds_bits', __int32_t * 32), +] +assert sizeof(fd_set) == 128, sizeof(fd_set) +assert alignment(fd_set) == 4, alignment(fd_set) +pthread_cond_t = __darwin_pthread_cond_t +pthread_condattr_t = __darwin_pthread_condattr_t +pthread_mutex_t = __darwin_pthread_mutex_t +pthread_mutexattr_t = __darwin_pthread_mutexattr_t +pthread_once_t = __darwin_pthread_once_t +pthread_rwlock_t = __darwin_pthread_rwlock_t +pthread_rwlockattr_t = __darwin_pthread_rwlockattr_t +pthread_t = __darwin_pthread_t +pthread_key_t = __darwin_pthread_key_t +fsblkcnt_t = __darwin_fsblkcnt_t +fsfilcnt_t = __darwin_fsfilcnt_t + +# values for enumeration 'idtype_t' +idtype_t = c_int # enum +id_t = __darwin_id_t +class wait(Union): + pass +class N4wait3DOLLAR_3E(Structure): + pass +N4wait3DOLLAR_3E._fields_ = [ + ('w_Termsig', c_uint, 7), + ('w_Coredump', c_uint, 1), + ('w_Retcode', c_uint, 8), + ('w_Filler', c_uint, 16), +] +assert sizeof(N4wait3DOLLAR_3E) == 4, sizeof(N4wait3DOLLAR_3E) +assert alignment(N4wait3DOLLAR_3E) == 4, alignment(N4wait3DOLLAR_3E) +class N4wait3DOLLAR_4E(Structure): + pass +N4wait3DOLLAR_4E._fields_ = [ + ('w_Stopval', c_uint, 8), + ('w_Stopsig', c_uint, 8), + ('w_Filler', c_uint, 16), +] +assert sizeof(N4wait3DOLLAR_4E) == 4, sizeof(N4wait3DOLLAR_4E) +assert alignment(N4wait3DOLLAR_4E) == 4, alignment(N4wait3DOLLAR_4E) +wait._fields_ = [ + ('w_status', c_int), + ('w_T', N4wait3DOLLAR_3E), + ('w_S', N4wait3DOLLAR_4E), +] +assert sizeof(wait) == 4, sizeof(wait) +assert alignment(wait) == 4, alignment(wait) +class timespec(Structure): + pass +timespec._fields_ = [ + ('tv_sec', time_t), + ('tv_nsec', c_long), +] +assert sizeof(timespec) == 8, sizeof(timespec) +assert alignment(timespec) == 4, alignment(timespec) +class tm(Structure): + pass +tm._fields_ = [ + ('tm_sec', c_int), + ('tm_min', c_int), + ('tm_hour', c_int), + ('tm_mday', c_int), + ('tm_mon', c_int), + ('tm_year', c_int), + ('tm_wday', c_int), + ('tm_yday', c_int), + ('tm_isdst', c_int), + ('tm_gmtoff', c_long), + ('tm_zone', STRING), +] +assert sizeof(tm) == 44, sizeof(tm) +assert alignment(tm) == 4, alignment(tm) +__gnuc_va_list = STRING +ptrdiff_t = c_int +int8_t = c_byte +int16_t = c_short +uint8_t = c_ubyte +uint16_t = c_ushort +uint32_t = c_uint +uint64_t = c_ulonglong +int_least8_t = int8_t +int_least16_t = int16_t +int_least32_t = int32_t +int_least64_t = int64_t +uint_least8_t = uint8_t +uint_least16_t = uint16_t +uint_least32_t = uint32_t +uint_least64_t = uint64_t +int_fast8_t = int8_t +int_fast16_t = int16_t +int_fast32_t = int32_t +int_fast64_t = int64_t +uint_fast8_t = uint8_t +uint_fast16_t = uint16_t +uint_fast32_t = uint32_t +uint_fast64_t = uint64_t +intptr_t = c_long +uintptr_t = c_ulong +intmax_t = c_longlong +uintmax_t = c_ulonglong +__all__ = ['ENGINE', 'pkcs7_enc_content_st', '__int16_t', + 'X509_REVOKED', 'SSL_CTX', 'UIT_BOOLEAN', + '__darwin_time_t', 'ucontext64_t', 'int_fast32_t', + 'pem_ctx_st', 'uint8_t', 'fpos_t', 'X509', 'COMP_CTX', + 'tm', 'N10pem_ctx_st4DOLLAR_17E', 'swblk_t', + 'ASN1_TEMPLATE', '__darwin_pthread_t', 'fixpt_t', + 'BIO_METHOD', 'ASN1_PRINTABLESTRING', 'EVP_ENCODE_CTX', + 'dh_method', 'bio_f_buffer_ctx_struct', 'in_port_t', + 'X509_SIG', '__darwin_ssize_t', '__darwin_sigset_t', + 'wait', 'uint_fast16_t', 'N12asn1_type_st4DOLLAR_11E', + 'uint_least8_t', 'pthread_rwlock_t', 'ASN1_IA5STRING', + 'fsfilcnt_t', 'ucontext', '__uint64_t', 'timespec', + 'x509_cinf_st', 'COMP_METHOD', 'MD5_CTX', 'buf_mem_st', + 'ASN1_ENCODING_st', 'PBEPARAM', 'X509_NAME_ENTRY', + '__darwin_va_list', 'ucontext_t', 'lhash_st', + 'N4wait3DOLLAR_4E', '__darwin_uuid_t', + '_ossl_old_des_ks_struct', 'id_t', 'ASN1_BIT_STRING', + 'va_list', '__darwin_wchar_t', 'pthread_key_t', + 'pkcs7_signer_info_st', 'ASN1_METHOD', 'DSA_SIG', 'DSA', + 'UIT_NONE', 'pthread_t', '__darwin_useconds_t', + 'uint_fast8_t', 'UI_STRING', 'DES_cblock', + '__darwin_mcontext64_t', 'rlim_t', 'PEM_Encode_Seal_st', + 'SHAstate_st', 'u_quad_t', 'openssl_fptr', + '_opaque_pthread_rwlockattr_t', + 'N18x509_attributes_st4DOLLAR_13E', + '__darwin_pthread_rwlock_t', 'daddr_t', 'ui_string_st', + 'x509_file_st', 'X509_req_info_st', 'int_least64_t', + 'evp_Encode_Ctx_st', 'X509_OBJECTS', 'CRYPTO_EX_DATA', + '__int8_t', 'AUTHORITY_KEYID_st', '_opaque_pthread_attr_t', + 'sigstack', 'EVP_CIPHER_CTX', 'X509_extension_st', 'pid_t', + 'RSA_METHOD', 'PEM_USER', 'pem_recip_st', 'env_md_ctx_st', + 'rc5_key_st', 'ui_st', 'X509_PUBKEY', 'u_int8_t', + 'ASN1_ITEM_st', 'pkcs7_recip_info_st', 'ssl2_state_st', + 'off_t', 'N10ssl_ctx_st4DOLLAR_18E', 'crypto_ex_data_st', + 'ui_method_st', '__darwin_pthread_rwlockattr_t', + 'CRYPTO_EX_dup', '__darwin_ino_t', '__sFILE', + 'OSUnknownByteOrder', 'BN_MONT_CTX', 'ASN1_NULL', 'time_t', + 'CRYPTO_EX_new', 'asn1_type_st', 'CRYPTO_EX_DATA_FUNCS', + 'user_time_t', 'BIGNUM', 'pthread_rwlockattr_t', + 'ASN1_VALUE_st', 'DH_METHOD', '__darwin_off_t', + '_opaque_pthread_t', 'bn_blinding_st', 'RSA', 'ssize_t', + 'mcontext64_t', 'user_long_t', 'fsblkcnt_t', 'cert_st', + '__darwin_pthread_condattr_t', 'X509_PKEY', + '__darwin_id_t', '__darwin_nl_item', 'SSL2_STATE', 'FILE', + 'pthread_mutexattr_t', 'size_t', + '_ossl_old_des_key_schedule', 'pkcs7_issuer_and_serial_st', + 'sigval', 'CRYPTO_MEM_LEAK_CB', 'X509_NAME', 'blkcnt_t', + 'uint_least16_t', '__darwin_dev_t', 'evp_cipher_info_st', + 'BN_BLINDING', 'ssl3_state_st', 'uint_least64_t', + 'user_addr_t', 'DES_key_schedule', 'RIPEMD160_CTX', + 'u_char', 'X509_algor_st', 'uid_t', 'sess_cert_st', + 'u_int64_t', 'u_int16_t', 'sigset_t', '__darwin_ptrdiff_t', + 'ASN1_CTX', 'STACK', '__int32_t', 'UI_METHOD', + 'NETSCAPE_SPKI', 'UIT_PROMPT', 'st_CRYPTO_EX_DATA_IMPL', + 'cast_key_st', 'X509_HASH_DIR_CTX', 'sigevent', + 'user_ssize_t', 'clock_t', 'aes_key_st', + '__darwin_socklen_t', '__darwin_intptr_t', 'int_fast64_t', + 'asn1_string_table_st', 'uint_fast32_t', + 'ASN1_VISIBLESTRING', 'DSA_SIG_st', 'obj_name_st', + 'X509_LOOKUP_METHOD', 'u_int32_t', 'EVP_CIPHER_INFO', + '__gnuc_va_list', 'AES_KEY', 'PKCS7_ISSUER_AND_SERIAL', + 'BN_CTX', '__darwin_blkcnt_t', 'key_t', 'SHA_CTX', + 'pkcs7_signed_st', 'SSL', 'N10pem_ctx_st4DOLLAR_16E', + 'pthread_attr_t', 'EVP_MD', 'uint', 'ASN1_BOOLEAN', + 'ino_t', '__darwin_clock_t', 'ASN1_OCTET_STRING', + 'asn1_ctx_st', 'BIO_F_BUFFER_CTX', 'bn_mont_ctx_st', + 'X509_REQ_INFO', 'PEM_CTX', 'sigvec', + '__darwin_pthread_mutexattr_t', 'x509_attributes_st', + 'stack_t', '__darwin_mode_t', '__mbstate_t', + 'asn1_object_st', 'ASN1_ENCODING', '__uint8_t', + 'LHASH_NODE', 'PKCS7_SIGNER_INFO', 'asn1_method_st', + 'stack_st', 'bio_info_cb', 'div_t', 'UIT_VERIFY', + 'PBEPARAM_st', 'N4wait3DOLLAR_3E', 'quad_t', '__siginfo', + '__darwin_mbstate_t', 'rsa_st', 'ASN1_UNIVERSALSTRING', + 'uint64_t', 'ssl_comp_st', 'X509_OBJECT', 'pthread_cond_t', + 'DH', '__darwin_wctype_t', 'PKCS7_ENVELOPE', 'ASN1_TLC_st', + 'sig_atomic_t', 'BIO', 'nlink_t', 'BUF_MEM', 'SSL3_RECORD', + 'bio_method_st', 'timeval', 'UI_string_types', 'BIO_dummy', + 'ssl_ctx_st', 'NETSCAPE_CERT_SEQUENCE', + 'BIT_STRING_BITNAME_st', '__darwin_pthread_attr_t', + 'int8_t', '__darwin_wint_t', 'OBJ_NAME', + 'PKCS8_PRIV_KEY_INFO', 'PBE2PARAM_st', + 'LHASH_DOALL_FN_TYPE', 'x509_st', 'X509_VAL', 'dev_t', + 'ASN1_TEMPLATE_st', 'MD5state_st', '__uint16_t', + 'LHASH_DOALL_ARG_FN_TYPE', 'mdc2_ctx_st', 'SSL3_STATE', + 'ssl3_buffer_st', 'ASN1_ITEM_EXP', + '_opaque_pthread_condattr_t', 'mode_t', 'ASN1_VALUE', + 'qaddr_t', '__darwin_gid_t', 'EVP_PKEY', 'CRYPTO_EX_free', + '_ossl_old_des_cblock', 'X509_INFO', 'asn1_string_st', + 'intptr_t', 'UIT_INFO', 'int_fast8_t', 'sigaltstack', + 'env_md_st', 'LHASH', '__darwin_ucontext_t', + 'PKCS7_SIGN_ENVELOPE', '__darwin_mcontext_t', 'ct_rune_t', + 'MD2_CTX', 'pthread_once_t', 'SSL3_BUFFER', 'fd_mask', + 'ASN1_TYPE', 'PKCS7_SIGNED', 'ssl3_record_st', 'BF_KEY', + 'MD4state_st', 'MD4_CTX', 'int16_t', 'SSL_CIPHER', + 'rune_t', 'X509_TRUST', 'siginfo_t', 'X509_STORE', + '__sbuf', 'X509_STORE_CTX', '__darwin_blksize_t', 'ldiv_t', + 'ASN1_TIME', 'SSL_METHOD', 'X509_LOOKUP', + 'Netscape_spki_st', 'P_PID', 'sigaction', 'sig_t', + 'hostent', 'x509_cert_aux_st', '_opaque_pthread_cond_t', + 'segsz_t', 'ushort', '__darwin_ct_rune_t', 'fd_set', + 'BN_RECP_CTX', 'x509_lookup_st', 'uint16_t', 'pkcs7_st', + 'asn1_header_st', '__darwin_pthread_key_t', + 'x509_trust_st', '__darwin_pthread_handler_rec', 'int32_t', + 'X509_CRL_INFO', 'N11evp_pkey_st4DOLLAR_12E', 'MDC2_CTX', + 'N23_ossl_old_des_ks_struct4DOLLAR_10E', 'ASN1_HEADER', + 'X509_crl_info_st', 'LHASH_HASH_FN_TYPE', + '_opaque_pthread_mutexattr_t', 'ssl_st', + 'N8pkcs7_st4DOLLAR_15E', 'evp_pkey_st', + 'pkcs7_signedandenveloped_st', '__darwin_mach_port_t', + 'EVP_PBE_KEYGEN', '_opaque_pthread_mutex_t', + 'ASN1_UTCTIME', 'mcontext', 'crypto_ex_data_func_st', + 'u_long', 'PBKDF2PARAM_st', 'rc4_key_st', 'DSA_METHOD', + 'EVP_CIPHER', 'BIT_STRING_BITNAME', 'PKCS7_RECIP_INFO', + 'ssl3_enc_method', 'X509_CERT_AUX', 'uintmax_t', + 'int_fast16_t', 'RC5_32_KEY', 'ucontext64', 'ASN1_INTEGER', + 'u_short', 'N14x509_object_st4DOLLAR_14E', 'mcontext64', + 'X509_sig_st', 'ASN1_GENERALSTRING', 'PKCS7', '__sFILEX', + 'X509_name_entry_st', 'ssl_session_st', 'caddr_t', + 'bignum_st', 'X509_CINF', '__darwin_pthread_cond_t', + 'ASN1_TLC', 'PKCS7_ENCRYPT', 'NETSCAPE_SPKAC', + 'Netscape_spkac_st', 'idtype_t', 'UIT_ERROR', + 'uint_fast64_t', 'in_addr_t', 'pthread_mutex_t', + '__int64_t', 'ASN1_BMPSTRING', 'uint32_t', + 'PEM_ENCODE_SEAL_CTX', 'suseconds_t', 'ASN1_OBJECT', + 'X509_val_st', 'private_key_st', 'CRYPTO_dynlock', + 'X509_objects_st', 'CRYPTO_EX_DATA_IMPL', + 'pthread_condattr_t', 'PKCS7_DIGEST', 'uint_least32_t', + 'ASN1_STRING', '__uint32_t', 'P_PGID', 'rsa_meth_st', + 'X509_crl_st', 'RC2_KEY', '__darwin_fsfilcnt_t', + 'X509_revoked_st', 'PBE2PARAM', 'blksize_t', + 'Netscape_certificate_sequence', 'ssl_cipher_st', + 'bignum_ctx', 'register_t', 'ASN1_UTF8STRING', + 'pkcs7_encrypted_st', 'RC4_KEY', '__darwin_ucontext64_t', + 'N13ssl2_state_st4DOLLAR_19E', 'bn_recp_ctx_st', + 'CAST_KEY', 'X509_ATTRIBUTE', '__darwin_suseconds_t', + '__sigaction', 'user_ulong_t', 'syscall_arg_t', + 'evp_cipher_ctx_st', 'X509_ALGOR', 'mcontext_t', + 'const_DES_cblock', '__darwin_fsblkcnt_t', 'dsa_st', + 'int_least8_t', 'MD2state_st', 'X509_EXTENSION', + 'GEN_SESSION_CB', 'int_least16_t', '__darwin_wctrans_t', + 'PBKDF2PARAM', 'x509_lookup_method_st', 'pem_password_cb', + 'X509_info_st', 'x509_store_st', '__darwin_natural_t', + 'X509_pubkey_st', 'pkcs7_digest_st', '__darwin_size_t', + 'ASN1_STRING_TABLE', 'OSLittleEndian', 'RIPEMD160state_st', + 'pkcs7_enveloped_st', 'UI', 'ptrdiff_t', 'X509_REQ', + 'CRYPTO_dynlock_value', 'X509_req_st', 'x509_store_ctx_st', + 'N13ssl3_state_st4DOLLAR_20E', 'lhash_node_st', + '__darwin_pthread_mutex_t', 'LHASH_COMP_FN_TYPE', + '__darwin_rune_t', 'rlimit', '__darwin_pthread_once_t', + 'OSBigEndian', 'uintptr_t', '__darwin_uid_t', 'u_int', + 'ASN1_T61STRING', 'gid_t', 'ssl_method_st', 'ASN1_ITEM', + 'ASN1_ENUMERATED', '_opaque_pthread_rwlock_t', + 'pkcs8_priv_key_info_st', 'intmax_t', 'sigcontext', + 'X509_CRL', 'rc2_key_st', 'engine_st', 'x509_object_st', + '_opaque_pthread_once_t', 'DES_ks', 'SSL_COMP', + 'dsa_method', 'int64_t', 'bio_st', 'bf_key_st', + 'ASN1_GENERALIZEDTIME', 'PKCS7_ENC_CONTENT', + '__darwin_pid_t', 'lldiv_t', 'comp_method_st', + 'EVP_MD_CTX', 'evp_cipher_st', 'X509_name_st', + 'x509_hash_dir_st', '__darwin_mach_port_name_t', + 'useconds_t', 'user_size_t', 'SSL_SESSION', 'rusage', + 'ssl_crock_st', 'int_least32_t', '__sigaction_u', 'dh_st', + 'P_ALL', '__darwin_stack_t', 'N6DES_ks3DOLLAR_9E', + 'comp_ctx_st', 'X509_CERT_FILE_CTX'] From python-checkins at python.org Sat Oct 4 09:33:29 2008 From: python-checkins at python.org (hirokazu.yamamoto) Date: Sat, 4 Oct 2008 09:33:29 +0200 (CEST) Subject: [Python-checkins] r66776 - python/trunk/setup.py Message-ID: <20081004073329.6ADE81E4046@bag.python.org> Author: hirokazu.yamamoto Date: Fri Oct 3 19:34:49 2008 New Revision: 66776 Log: Issue #1706863: Fixed "'NoneType' object has no attribute 'rfind'" error when sqlite libfile not found. Modified: python/trunk/setup.py Modified: python/trunk/setup.py ============================================================================== --- python/trunk/setup.py (original) +++ python/trunk/setup.py Fri Oct 3 19:34:49 2008 @@ -934,7 +934,8 @@ ] sqlite_libfile = self.compiler.find_library_file( sqlite_dirs_to_check + lib_dirs, 'sqlite3') - sqlite_libdir = [os.path.abspath(os.path.dirname(sqlite_libfile))] + if sqlite_libfile: + sqlite_libdir = [os.path.abspath(os.path.dirname(sqlite_libfile))] if sqlite_incdir and sqlite_libdir: sqlite_srcs = ['_sqlite/cache.c', From python-checkins at python.org Sat Oct 4 09:33:47 2008 From: python-checkins at python.org (benjamin.peterson) Date: Sat, 4 Oct 2008 09:33:47 +0200 (CEST) Subject: [Python-checkins] r66782 - in sandbox/trunk/2to3/lib2to3: fixes/fix_getcwdu.py tests/test_fixers.py Message-ID: <20081004073347.D88891E4006@bag.python.org> Author: benjamin.peterson Date: Sat Oct 4 00:51:36 2008 New Revision: 66782 Log: add Victor Stinner's fixer for os.getcwdu -> os.getcwd #4023 Added: sandbox/trunk/2to3/lib2to3/fixes/fix_getcwdu.py (contents, props changed) Modified: sandbox/trunk/2to3/lib2to3/tests/test_fixers.py Added: sandbox/trunk/2to3/lib2to3/fixes/fix_getcwdu.py ============================================================================== --- (empty file) +++ sandbox/trunk/2to3/lib2to3/fixes/fix_getcwdu.py Sat Oct 4 00:51:36 2008 @@ -0,0 +1,18 @@ +""" +Fixer that changes os.getcwdu() to os.getcwd(). +""" +# Author: Victor Stinner + +# Local imports +from .. import fixer_base +from ..fixer_util import Name + +class FixGetcwdu(fixer_base.BaseFix): + + PATTERN = """ + power< 'os' trailer< dot='.' name='getcwdu' > any* > + """ + + def transform(self, node, results): + name = results["name"] + name.replace(Name("getcwd", prefix=name.get_prefix())) Modified: sandbox/trunk/2to3/lib2to3/tests/test_fixers.py ============================================================================== --- sandbox/trunk/2to3/lib2to3/tests/test_fixers.py (original) +++ sandbox/trunk/2to3/lib2to3/tests/test_fixers.py Sat Oct 4 00:51:36 2008 @@ -3603,6 +3603,67 @@ self.check(b, a) +class Test_getcwdu(FixerTestCase): + + fixer = 'getcwdu' + + def test_basic(self): + b = """os.getcwdu""" + a = """os.getcwd""" + self.check(b, a) + + b = """os.getcwdu()""" + a = """os.getcwd()""" + self.check(b, a) + + b = """meth = os.getcwdu""" + a = """meth = os.getcwd""" + self.check(b, a) + + b = """os.getcwdu(args)""" + a = """os.getcwd(args)""" + self.check(b, a) + + def test_comment(self): + b = """os.getcwdu() # Foo""" + a = """os.getcwd() # Foo""" + self.check(b, a) + + def test_unchanged(self): + s = """os.getcwd()""" + self.unchanged(s) + + s = """getcwdu()""" + self.unchanged(s) + + s = """os.getcwdb()""" + self.unchanged(s) + + def test_indentation(self): + b = """ + if 1: + os.getcwdu() + """ + a = """ + if 1: + os.getcwd() + """ + self.check(b, a) + + def test_multilation(self): + b = """os .getcwdu()""" + a = """os .getcwd()""" + self.check(b, a) + + b = """os. getcwdu""" + a = """os. getcwd""" + self.check(b, a) + + b = """os.getcwdu ( )""" + a = """os.getcwd ( )""" + self.check(b, a) + + if __name__ == "__main__": import __main__ support.run_all_tests(__main__) From python-checkins at python.org Sat Oct 4 09:33:49 2008 From: python-checkins at python.org (andrew.kuchling) Date: Sat, 4 Oct 2008 09:33:49 +0200 (CEST) Subject: [Python-checkins] r66783 - python/trunk/Objects/floatobject.c Message-ID: <20081004073349.1C9061E4007@bag.python.org> Author: andrew.kuchling Date: Sat Oct 4 03:02:29 2008 New Revision: 66783 Log: Use correct capitalization of NaN Modified: python/trunk/Objects/floatobject.c Modified: python/trunk/Objects/floatobject.c ============================================================================== --- python/trunk/Objects/floatobject.c (original) +++ python/trunk/Objects/floatobject.c Sat Oct 4 03:02:29 2008 @@ -1548,7 +1548,7 @@ #ifdef Py_NAN if (Py_IS_NAN(self)) { PyErr_SetString(PyExc_ValueError, - "Cannot pass nan to float.as_integer_ratio."); + "Cannot pass NaN to float.as_integer_ratio."); return NULL; } #endif @@ -1607,7 +1607,7 @@ "\n" "Returns a pair of integers, whose ratio is exactly equal to the original\n" "float and with a positive denominator.\n" -"Raises OverflowError on infinities and a ValueError on nans.\n" +"Raises OverflowError on infinities and a ValueError on NaNs.\n" "\n" ">>> (10.0).as_integer_ratio()\n" "(10, 1)\n" From python-checkins at python.org Sat Oct 4 09:33:50 2008 From: python-checkins at python.org (andrew.kuchling) Date: Sat, 4 Oct 2008 09:33:50 +0200 (CEST) Subject: [Python-checkins] r66784 - python/trunk/Objects/tupleobject.c Message-ID: <20081004073350.7575D1E402A@bag.python.org> Author: andrew.kuchling Date: Sat Oct 4 03:03:42 2008 New Revision: 66784 Log: Docstring change: Specify exception raised Modified: python/trunk/Objects/tupleobject.c Modified: python/trunk/Objects/tupleobject.c ============================================================================== --- python/trunk/Objects/tupleobject.c (original) +++ python/trunk/Objects/tupleobject.c Sat Oct 4 03:03:42 2008 @@ -719,7 +719,9 @@ } PyDoc_STRVAR(index_doc, -"T.index(value, [start, [stop]]) -> integer -- return first index of value"); +"T.index(value, [start, [stop]]) -> integer -- return first index of value.\n" +"Raises ValueError if the value is not present." +); PyDoc_STRVAR(count_doc, "T.count(value) -> integer -- return number of occurrences of value"); PyDoc_STRVAR(sizeof_doc, From python-checkins at python.org Sat Oct 4 09:33:52 2008 From: python-checkins at python.org (andrew.kuchling) Date: Sat, 4 Oct 2008 09:33:52 +0200 (CEST) Subject: [Python-checkins] r66785 - python/trunk/Objects/listobject.c Message-ID: <20081004073352.11FE71E4015@bag.python.org> Author: andrew.kuchling Date: Sat Oct 4 03:04:24 2008 New Revision: 66785 Log: Docstring changes: Specify exceptions raised Modified: python/trunk/Objects/listobject.c Modified: python/trunk/Objects/listobject.c ============================================================================== --- python/trunk/Objects/listobject.c (original) +++ python/trunk/Objects/listobject.c Sat Oct 4 03:04:24 2008 @@ -2459,11 +2459,14 @@ PyDoc_STRVAR(insert_doc, "L.insert(index, object) -- insert object before index"); PyDoc_STRVAR(pop_doc, -"L.pop([index]) -> item -- remove and return item at index (default last)"); +"L.pop([index]) -> item -- remove and return item at index (default last).\n" +"Raises IndexError if list is empty or index is out of range."); PyDoc_STRVAR(remove_doc, -"L.remove(value) -- remove first occurrence of value"); +"L.remove(value) -- remove first occurrence of value.\n" +"Raises ValueError if the value is not present."); PyDoc_STRVAR(index_doc, -"L.index(value, [start, [stop]]) -> integer -- return first index of value"); +"L.index(value, [start, [stop]]) -> integer -- return first index of value.\n" +"Raises ValueError if the value is not present."); PyDoc_STRVAR(count_doc, "L.count(value) -> integer -- return number of occurrences of value"); PyDoc_STRVAR(reverse_doc, From python-checkins at python.org Sat Oct 4 09:33:59 2008 From: python-checkins at python.org (andrew.kuchling) Date: Sat, 4 Oct 2008 09:33:59 +0200 (CEST) Subject: [Python-checkins] r66786 - in python/trunk/Objects: stringobject.c unicodeobject.c Message-ID: <20081004073359.1B23C1E4002@bag.python.org> Author: andrew.kuchling Date: Sat Oct 4 03:05:56 2008 New Revision: 66786 Log: Docstring change for *partition: use same tense as other docstrings. Hyphenate left- and right-justified. Fix 'registerd' typo Modified: python/trunk/Objects/stringobject.c python/trunk/Objects/unicodeobject.c Modified: python/trunk/Objects/stringobject.c ============================================================================== --- python/trunk/Objects/stringobject.c (original) +++ python/trunk/Objects/stringobject.c Sat Oct 4 03:05:56 2008 @@ -1591,9 +1591,9 @@ PyDoc_STRVAR(partition__doc__, "S.partition(sep) -> (head, sep, tail)\n\ \n\ -Searches for the separator sep in S, and returns the part before it,\n\ +Search for the separator sep in S, and return the part before it,\n\ the separator itself, and the part after it. If the separator is not\n\ -found, returns S and two empty strings."); +found, return S and two empty strings."); static PyObject * string_partition(PyStringObject *self, PyObject *sep_obj) @@ -1622,9 +1622,9 @@ PyDoc_STRVAR(rpartition__doc__, "S.rpartition(sep) -> (tail, sep, head)\n\ \n\ -Searches for the separator sep in S, starting at the end of S, and returns\n\ +Search for the separator sep in S, starting at the end of S, and return\n\ the part before it, the separator itself, and the part after it. If the\n\ -separator is not found, returns two empty strings and S."); +separator is not found, return two empty strings and S."); static PyObject * string_rpartition(PyStringObject *self, PyObject *sep_obj) @@ -3357,7 +3357,7 @@ to the default encoding. errors may be given to set a different error\n\ handling scheme. Default is 'strict' meaning that encoding errors raise\n\ a UnicodeDecodeError. Other possible values are 'ignore' and 'replace'\n\ -as well as any other name registerd with codecs.register_error that is\n\ +as well as any other name registered with codecs.register_error that is\n\ able to handle UnicodeDecodeErrors."); static PyObject * @@ -3506,7 +3506,7 @@ PyDoc_STRVAR(ljust__doc__, "S.ljust(width[, fillchar]) -> string\n" "\n" -"Return S left justified in a string of length width. Padding is\n" +"Return S left-justified in a string of length width. Padding is\n" "done using the specified fill character (default is a space)."); static PyObject * @@ -3530,7 +3530,7 @@ PyDoc_STRVAR(rjust__doc__, "S.rjust(width[, fillchar]) -> string\n" "\n" -"Return S right justified in a string of length width. Padding is\n" +"Return S right-justified in a string of length width. Padding is\n" "done using the specified fill character (default is a space)"); static PyObject * Modified: python/trunk/Objects/unicodeobject.c ============================================================================== --- python/trunk/Objects/unicodeobject.c (original) +++ python/trunk/Objects/unicodeobject.c Sat Oct 4 03:05:56 2008 @@ -7070,7 +7070,7 @@ PyDoc_STRVAR(ljust__doc__, "S.ljust(width[, fillchar]) -> int\n\ \n\ -Return S left justified in a Unicode string of length width. Padding is\n\ +Return S left-justified in a Unicode string of length width. Padding is\n\ done using the specified fill character (default is a space)."); static PyObject * @@ -7456,7 +7456,7 @@ PyDoc_STRVAR(rjust__doc__, "S.rjust(width[, fillchar]) -> unicode\n\ \n\ -Return S right justified in a Unicode string of length width. Padding is\n\ +Return S right-justified in a Unicode string of length width. Padding is\n\ done using the specified fill character (default is a space)."); static PyObject * @@ -7606,9 +7606,9 @@ PyDoc_STRVAR(partition__doc__, "S.partition(sep) -> (head, sep, tail)\n\ \n\ -Searches for the separator sep in S, and returns the part before it,\n\ +Search for the separator sep in S, and return the part before it,\n\ the separator itself, and the part after it. If the separator is not\n\ -found, returns S and two empty strings."); +found, return S and two empty strings."); static PyObject* unicode_partition(PyUnicodeObject *self, PyObject *separator) @@ -7619,9 +7619,9 @@ PyDoc_STRVAR(rpartition__doc__, "S.rpartition(sep) -> (tail, sep, head)\n\ \n\ -Searches for the separator sep in S, starting at the end of S, and returns\n\ +Search for the separator sep in S, starting at the end of S, and return\n\ the part before it, the separator itself, and the part after it. If the\n\ -separator is not found, returns two empty strings and S."); +separator is not found, return two empty strings and S."); static PyObject* unicode_rpartition(PyUnicodeObject *self, PyObject *separator) From python-checkins at python.org Sat Oct 4 09:34:01 2008 From: python-checkins at python.org (andrew.kuchling) Date: Sat, 4 Oct 2008 09:34:01 +0200 (CEST) Subject: [Python-checkins] r66787 - python/trunk/Doc/whatsnew/2.6.rst Message-ID: <20081004073401.072341E4025@bag.python.org> Author: andrew.kuchling Date: Sat Oct 4 05:08:56 2008 New Revision: 66787 Log: two corrections Modified: python/trunk/Doc/whatsnew/2.6.rst Modified: python/trunk/Doc/whatsnew/2.6.rst ============================================================================== --- python/trunk/Doc/whatsnew/2.6.rst (original) +++ python/trunk/Doc/whatsnew/2.6.rst Sat Oct 4 05:08:56 2008 @@ -2753,7 +2753,7 @@ returns the resulting value. A literal expression is a Python expression containing only strings, numbers, dictionaries, etc. but no statements or function calls. If you need to -evaluate an expression but accept the security risk of using an +evaluate an expression but cannot accept the security risk of using an :func:`eval` call, :func:`literal_eval` will handle it safely:: >>> literal = '("a", "b", {2:4, 3:8, 1:2})' @@ -3039,7 +3039,7 @@ ``numfree``, and a macro ``Py_MAXFREELIST`` is always defined. -* A new Makefile target, "make check", prepares the Python source tree +* A new Makefile target, "make patchcheck", prepares the Python source tree for making a patch: it fixes trailing whitespace in all modified ``.py`` files, checks whether the documentation has been changed, and reports whether the :file:`Misc/ACKS` and :file:`Misc/NEWS` files @@ -3267,6 +3267,6 @@ The author would like to thank the following people for offering suggestions, corrections and assistance with various drafts of this -article: Georg Brandl, Steve Brown, Nick Coghlan, Jim Jewett, Kent -Johnson, Chris Lambacher, Antoine Pitrou. +article: Georg Brandl, Steve Brown, Nick Coghlan, Ralph Corderoy, +Jim Jewett, Kent Johnson, Chris Lambacher, Antoine Pitrou, Brian Warner. From martin at v.loewis.de Sat Oct 4 09:40:26 2008 From: martin at v.loewis.de (=?ISO-8859-1?Q?=22Martin_v=2E_L=F6wis=22?=) Date: Sat, 04 Oct 2008 09:40:26 +0200 Subject: [Python-checkins] python-checkins seems broken In-Reply-To: <20081004001740.GA20814@amk.local> References: <20081004001740.GA20814@amk.local> Message-ID: <48E71DEA.5060205@v.loewis.de> > I know there's a transition to new IP addresses going on for the > python.org machines, but Thomas or Sean probably needs to do something > with the DNS for this. IIUC, it would be sufficient if these addresses get recognized as local. Meanwhile, I have disabled the new interfaces. Regards, Martin From python-checkins at python.org Sat Oct 4 10:11:42 2008 From: python-checkins at python.org (georg.brandl) Date: Sat, 4 Oct 2008 10:11:42 +0200 (CEST) Subject: [Python-checkins] r66788 - python/branches/release26-maint/Doc/tools/sphinxext/download.html Message-ID: <20081004081142.76B5C1E4002@bag.python.org> Author: georg.brandl Date: Sat Oct 4 10:11:42 2008 New Revision: 66788 Log: Continuously built downloads are in /current. Modified: python/branches/release26-maint/Doc/tools/sphinxext/download.html Modified: python/branches/release26-maint/Doc/tools/sphinxext/download.html ============================================================================== --- python/branches/release26-maint/Doc/tools/sphinxext/download.html (original) +++ python/branches/release26-maint/Doc/tools/sphinxext/download.html Sat Oct 4 10:11:42 2008 @@ -1,6 +1,6 @@ {% extends "layout.html" %} {% set title = 'Download' %} -{% set dlbase = 'http://docs.python.org/ftp/python/doc/' + release %} +{% set dlbase = 'http://docs.python.org/ftp/python/doc/current' %} {% block body %}

    Download Python {{ release }} Documentation

    From python-checkins at python.org Sat Oct 4 10:13:56 2008 From: python-checkins at python.org (georg.brandl) Date: Sat, 4 Oct 2008 10:13:56 +0200 (CEST) Subject: [Python-checkins] r66789 - python/branches/release26-maint/Misc/build.sh Message-ID: <20081004081356.E67BE1E4002@bag.python.org> Author: georg.brandl Date: Sat Oct 4 10:13:56 2008 New Revision: 66789 Log: Add step to build downloadable docs. Modified: python/branches/release26-maint/Misc/build.sh Modified: python/branches/release26-maint/Misc/build.sh ============================================================================== --- python/branches/release26-maint/Misc/build.sh (original) +++ python/branches/release26-maint/Misc/build.sh Sat Oct 4 10:13:56 2008 @@ -50,7 +50,8 @@ #FAILURE_CC="optional--uncomment and set to desired address" REMOTE_SYSTEM="neal at dinsdale.python.org" -REMOTE_DIR="/data/ftp.python.org/pub/docs.python.org/dev/2.6" +REMOTE_DIR="/data/ftp.python.org/pub/www.python.org/doc/current" +REMOTE_DIR_DIST="/data/ftp.python.org/pub/python/doc/current" RESULT_FILE="$DIR/build/index.html" INSTALL_DIR="/tmp/python-test-2.6/local" RSYNC_OPTS="-aC -e ssh" @@ -271,11 +272,24 @@ mail_on_failure "doc" ../build/$F fi +F="make-doc-dist.out" +start=`current_time` +if [ $conflict_count == 0 ]; then + make dist >& ../build/$F + err=$? +fi +update_status "Making downloadable doc" "$F" $start +if [ $err != 0 ]; then + NUM_FAILURES=1 + mail_on_failure "doc dist" ../build/$F +fi + echo "" >> $RESULT_FILE echo "" >> $RESULT_FILE echo "" >> $RESULT_FILE ## copy results rsync $RSYNC_OPTS build/html/* $REMOTE_SYSTEM:$REMOTE_DIR +rsync $RSYNC_OPTS dist/* $REMOTE_SYSTEM:$REMOTE_DIR_DIST cd ../build rsync $RSYNC_OPTS index.html *.out $REMOTE_SYSTEM:$REMOTE_DIR/results/ From nnorwitz at gmail.com Sat Oct 4 11:20:23 2008 From: nnorwitz at gmail.com (Neal Norwitz) Date: Sat, 4 Oct 2008 05:20:23 -0400 Subject: [Python-checkins] Python Regression Test Failures doc dist (1) Message-ID: <20081004092023.GA8235@python.psfb.org> rm -rf dist mkdir -p dist # archive the HTML make html make[1]: Entering directory `/home/neal/python/r26/Doc' mkdir -p build/html build/doctrees python tools/sphinx-build.py -b html -d build/doctrees -D latex_paper_size= . build/html Sphinx v0.5, building html loading pickled environment... done building [html]: targets for 0 source files that are out of date updating environment: 0 added, 0 changed, 0 removed no targets are out of date. Build finished. The HTML pages are in build/html. make[1]: Leaving directory `/home/neal/python/r26/Doc' cp -pPR build/html dist/python-docs-html tar -C dist -cf dist/python-docs-html.tar python-docs-html bzip2 -9 -k dist/python-docs-html.tar (cd dist; zip -q -r -9 python-docs-html.zip python-docs-html) /bin/sh: line 1: zip: command not found make: *** [dist] Error 127 From nnorwitz at gmail.com Sat Oct 4 12:20:23 2008 From: nnorwitz at gmail.com (Neal Norwitz) Date: Sat, 4 Oct 2008 06:20:23 -0400 Subject: [Python-checkins] Python Regression Test Failures doc dist (1) Message-ID: <20081004102023.GA8456@python.psfb.org> rm -rf dist mkdir -p dist # archive the HTML make html make[1]: Entering directory `/home/neal/python/r26/Doc' mkdir -p build/html build/doctrees python tools/sphinx-build.py -b html -d build/doctrees -D latex_paper_size= . build/html Sphinx v0.5, building html loading pickled environment... done building [html]: targets for 0 source files that are out of date updating environment: 0 added, 0 changed, 0 removed no targets are out of date. Build finished. The HTML pages are in build/html. make[1]: Leaving directory `/home/neal/python/r26/Doc' cp -pPR build/html dist/python-docs-html tar -C dist -cf dist/python-docs-html.tar python-docs-html bzip2 -9 -k dist/python-docs-html.tar (cd dist; zip -q -r -9 python-docs-html.zip python-docs-html) /bin/sh: line 1: zip: command not found make: *** [dist] Error 127 From nnorwitz at gmail.com Sat Oct 4 13:20:23 2008 From: nnorwitz at gmail.com (Neal Norwitz) Date: Sat, 4 Oct 2008 07:20:23 -0400 Subject: [Python-checkins] Python Regression Test Failures doc dist (1) Message-ID: <20081004112023.GA8694@python.psfb.org> rm -rf dist mkdir -p dist # archive the HTML make html make[1]: Entering directory `/home/neal/python/r26/Doc' mkdir -p build/html build/doctrees python tools/sphinx-build.py -b html -d build/doctrees -D latex_paper_size= . build/html Sphinx v0.5, building html loading pickled environment... done building [html]: targets for 0 source files that are out of date updating environment: 0 added, 0 changed, 0 removed no targets are out of date. Build finished. The HTML pages are in build/html. make[1]: Leaving directory `/home/neal/python/r26/Doc' cp -pPR build/html dist/python-docs-html tar -C dist -cf dist/python-docs-html.tar python-docs-html bzip2 -9 -k dist/python-docs-html.tar (cd dist; zip -q -r -9 python-docs-html.zip python-docs-html) /bin/sh: line 1: zip: command not found make: *** [dist] Error 127 From nnorwitz at gmail.com Sat Oct 4 14:20:22 2008 From: nnorwitz at gmail.com (Neal Norwitz) Date: Sat, 4 Oct 2008 08:20:22 -0400 Subject: [Python-checkins] Python Regression Test Failures doc dist (1) Message-ID: <20081004122022.GA8915@python.psfb.org> rm -rf dist mkdir -p dist # archive the HTML make html make[1]: Entering directory `/home/neal/python/r26/Doc' mkdir -p build/html build/doctrees python tools/sphinx-build.py -b html -d build/doctrees -D latex_paper_size= . build/html Sphinx v0.5, building html loading pickled environment... done building [html]: targets for 0 source files that are out of date updating environment: 0 added, 0 changed, 0 removed no targets are out of date. Build finished. The HTML pages are in build/html. make[1]: Leaving directory `/home/neal/python/r26/Doc' cp -pPR build/html dist/python-docs-html tar -C dist -cf dist/python-docs-html.tar python-docs-html bzip2 -9 -k dist/python-docs-html.tar (cd dist; zip -q -r -9 python-docs-html.zip python-docs-html) /bin/sh: line 1: zip: command not found make: *** [dist] Error 127 From nnorwitz at gmail.com Sat Oct 4 15:20:23 2008 From: nnorwitz at gmail.com (Neal Norwitz) Date: Sat, 4 Oct 2008 09:20:23 -0400 Subject: [Python-checkins] Python Regression Test Failures doc dist (1) Message-ID: <20081004132023.GA9182@python.psfb.org> rm -rf dist mkdir -p dist # archive the HTML make html make[1]: Entering directory `/home/neal/python/r26/Doc' mkdir -p build/html build/doctrees python tools/sphinx-build.py -b html -d build/doctrees -D latex_paper_size= . build/html Sphinx v0.5, building html loading pickled environment... done building [html]: targets for 0 source files that are out of date updating environment: 0 added, 0 changed, 0 removed no targets are out of date. Build finished. The HTML pages are in build/html. make[1]: Leaving directory `/home/neal/python/r26/Doc' cp -pPR build/html dist/python-docs-html tar -C dist -cf dist/python-docs-html.tar python-docs-html bzip2 -9 -k dist/python-docs-html.tar (cd dist; zip -q -r -9 python-docs-html.zip python-docs-html) /bin/sh: line 1: zip: command not found make: *** [dist] Error 127 From nnorwitz at gmail.com Sat Oct 4 16:20:23 2008 From: nnorwitz at gmail.com (Neal Norwitz) Date: Sat, 4 Oct 2008 10:20:23 -0400 Subject: [Python-checkins] Python Regression Test Failures doc dist (1) Message-ID: <20081004142023.GA9408@python.psfb.org> rm -rf dist mkdir -p dist # archive the HTML make html make[1]: Entering directory `/home/neal/python/r26/Doc' mkdir -p build/html build/doctrees python tools/sphinx-build.py -b html -d build/doctrees -D latex_paper_size= . build/html Sphinx v0.5, building html loading pickled environment... done building [html]: targets for 0 source files that are out of date updating environment: 0 added, 0 changed, 0 removed no targets are out of date. Build finished. The HTML pages are in build/html. make[1]: Leaving directory `/home/neal/python/r26/Doc' cp -pPR build/html dist/python-docs-html tar -C dist -cf dist/python-docs-html.tar python-docs-html bzip2 -9 -k dist/python-docs-html.tar (cd dist; zip -q -r -9 python-docs-html.zip python-docs-html) /bin/sh: line 1: zip: command not found make: *** [dist] Error 127 From nnorwitz at gmail.com Sat Oct 4 17:20:22 2008 From: nnorwitz at gmail.com (Neal Norwitz) Date: Sat, 4 Oct 2008 11:20:22 -0400 Subject: [Python-checkins] Python Regression Test Failures doc dist (1) Message-ID: <20081004152022.GA9634@python.psfb.org> rm -rf dist mkdir -p dist # archive the HTML make html make[1]: Entering directory `/home/neal/python/r26/Doc' mkdir -p build/html build/doctrees python tools/sphinx-build.py -b html -d build/doctrees -D latex_paper_size= . build/html Sphinx v0.5, building html loading pickled environment... done building [html]: targets for 0 source files that are out of date updating environment: 0 added, 0 changed, 0 removed no targets are out of date. Build finished. The HTML pages are in build/html. make[1]: Leaving directory `/home/neal/python/r26/Doc' cp -pPR build/html dist/python-docs-html tar -C dist -cf dist/python-docs-html.tar python-docs-html bzip2 -9 -k dist/python-docs-html.tar (cd dist; zip -q -r -9 python-docs-html.zip python-docs-html) /bin/sh: line 1: zip: command not found make: *** [dist] Error 127 From nnorwitz at gmail.com Sat Oct 4 18:20:22 2008 From: nnorwitz at gmail.com (Neal Norwitz) Date: Sat, 4 Oct 2008 12:20:22 -0400 Subject: [Python-checkins] Python Regression Test Failures doc dist (1) Message-ID: <20081004162022.GA9860@python.psfb.org> rm -rf dist mkdir -p dist # archive the HTML make html make[1]: Entering directory `/home/neal/python/r26/Doc' mkdir -p build/html build/doctrees python tools/sphinx-build.py -b html -d build/doctrees -D latex_paper_size= . build/html Sphinx v0.5, building html loading pickled environment... done building [html]: targets for 0 source files that are out of date updating environment: 0 added, 0 changed, 0 removed no targets are out of date. Build finished. The HTML pages are in build/html. make[1]: Leaving directory `/home/neal/python/r26/Doc' cp -pPR build/html dist/python-docs-html tar -C dist -cf dist/python-docs-html.tar python-docs-html bzip2 -9 -k dist/python-docs-html.tar (cd dist; zip -q -r -9 python-docs-html.zip python-docs-html) /bin/sh: line 1: zip: command not found make: *** [dist] Error 127 From python-checkins at python.org Sat Oct 4 18:52:01 2008 From: python-checkins at python.org (andrew.kuchling) Date: Sat, 4 Oct 2008 18:52:01 +0200 (CEST) Subject: [Python-checkins] r66790 - python/trunk/Doc/whatsnew/2.6.rst Message-ID: <20081004165201.887B51E4002@bag.python.org> Author: andrew.kuchling Date: Sat Oct 4 18:52:01 2008 New Revision: 66790 Log: Set svn:keywords Modified: python/trunk/Doc/whatsnew/2.6.rst (contents, props changed) Modified: python/trunk/Doc/whatsnew/2.6.rst ============================================================================== --- python/trunk/Doc/whatsnew/2.6.rst (original) +++ python/trunk/Doc/whatsnew/2.6.rst Sat Oct 4 18:52:01 2008 @@ -8,7 +8,7 @@ :Release: |release| :Date: |today| -.. $Id: whatsnew26.tex 55746 2007-06-02 18:33:53Z neal.norwitz $ +.. $Id$ Rules for maintenance: * Anyone can add text to this document. Do not spend very much time From python-checkins at python.org Sat Oct 4 18:52:31 2008 From: python-checkins at python.org (andrew.kuchling) Date: Sat, 4 Oct 2008 18:52:31 +0200 (CEST) Subject: [Python-checkins] r66791 - in python/trunk/Doc: contents.rst whatsnew/2.7.rst Message-ID: <20081004165231.6CCD51E4002@bag.python.org> Author: andrew.kuchling Date: Sat Oct 4 18:52:31 2008 New Revision: 66791 Log: Add What's New for 2.7 Added: python/trunk/Doc/whatsnew/2.7.rst (contents, props changed) Modified: python/trunk/Doc/contents.rst Modified: python/trunk/Doc/contents.rst ============================================================================== --- python/trunk/Doc/contents.rst (original) +++ python/trunk/Doc/contents.rst Sat Oct 4 18:52:31 2008 @@ -4,7 +4,7 @@ .. toctree:: - whatsnew/2.6.rst + whatsnew/2.7.rst tutorial/index.rst using/index.rst reference/index.rst Added: python/trunk/Doc/whatsnew/2.7.rst ============================================================================== --- (empty file) +++ python/trunk/Doc/whatsnew/2.7.rst Sat Oct 4 18:52:31 2008 @@ -0,0 +1,138 @@ +**************************** + What's New in Python 2.7 +**************************** + +:Author: A.M. Kuchling (amk at amk.ca) +:Release: |release| +:Date: |today| + +.. $Id$ + Rules for maintenance: + + * Anyone can add text to this document. Do not spend very much time + on the wording of your changes, because your text will probably + get rewritten to some degree. + + * The maintainer will go through Misc/NEWS periodically and add + changes; it's therefore more important to add your changes to + Misc/NEWS than to this file. + + * This is not a complete list of every single change; completeness + is the purpose of Misc/NEWS. Some changes I consider too small + or esoteric to include. If such a change is added to the text, + I'll just remove it. (This is another reason you shouldn't spend + too much time on writing your addition.) + + * If you want to draw your new text to the attention of the + maintainer, add 'XXX' to the beginning of the paragraph or + section. + + * It's OK to just add a fragmentary note about a change. For + example: "XXX Describe the transmogrify() function added to the + socket module." The maintainer will research the change and + write the necessary text. + + * You can comment out your additions if you like, but it's not + necessary (especially when a final release is some months away). + + * Credit the author of a patch or bugfix. Just the name is + sufficient; the e-mail address isn't necessary. + + * It's helpful to add the bug/patch number in a parenthetical comment. + + XXX Describe the transmogrify() function added to the socket + module. + (Contributed by P.Y. Developer; :issue:`12345`.) + + This saves the maintainer some effort going through the SVN logs + when researching a change. + +This article explains the new features in Python 2.7. +No release schedule has been decided yet for 2.7. + +.. Compare with previous release in 2 - 3 sentences here. + add hyperlink when the documentation becomes available online. + +.. ======================================================================== +.. Large, PEP-level features and changes should be described here. +.. Should there be a new section here for 3k migration? +.. Or perhaps a more general section describing module changes/deprecation? +.. ======================================================================== + + + +Other Language Changes +====================== + +Some smaller changes made to the core Python language are: + +* List of changes to be written here. + +.. ====================================================================== + + +Optimizations +------------- + +To be written. + +.. ====================================================================== + +New, Improved, and Deprecated Modules +===================================== + +As in every release, Python's standard library received a number of +enhancements and bug fixes. Here's a partial list of the most notable +changes, sorted alphabetically by module name. Consult the +:file:`Misc/NEWS` file in the source tree for a more complete list of +changes, or look through the Subversion logs for all the details. + +* To be written. + +.. ====================================================================== +.. whole new modules get described in subsections here + +.. ====================================================================== + + +Build and C API Changes +======================= + +Changes to Python's build process and to the C API include: + +* To be written. + +.. ====================================================================== + +Port-Specific Changes: Windows +----------------------------------- + + +.. ====================================================================== + +Port-Specific Changes: Mac OS X +----------------------------------- + + +.. ====================================================================== + +Porting to Python 2.7 +===================== + +This section lists previously described changes and other bugfixes +that may require changes to your code: + +To be written. + +.. ====================================================================== + + +.. _acks27: + +Acknowledgements +================ + +The author would like to thank the following people for offering +suggestions, corrections and assistance with various drafts of this +article: no one yet. + From python-checkins at python.org Sat Oct 4 19:10:14 2008 From: python-checkins at python.org (benjamin.peterson) Date: Sat, 4 Oct 2008 19:10:14 +0200 (CEST) Subject: [Python-checkins] r66792 - python/trunk/Doc/conf.py Message-ID: <20081004171014.C13B71E4002@bag.python.org> Author: benjamin.peterson Date: Sat Oct 4 19:10:14 2008 New Revision: 66792 Log: silence Sphinx warning Modified: python/trunk/Doc/conf.py Modified: python/trunk/Doc/conf.py ============================================================================== --- python/trunk/Doc/conf.py (original) +++ python/trunk/Doc/conf.py Sat Oct 4 19:10:14 2008 @@ -47,6 +47,7 @@ 'whatsnew/2.3', 'whatsnew/2.4', 'whatsnew/2.5', + 'whatsnew/2.6', 'maclib/scrap', 'library/xmllib', 'library/xml.etree', From nnorwitz at gmail.com Sat Oct 4 19:20:24 2008 From: nnorwitz at gmail.com (Neal Norwitz) Date: Sat, 4 Oct 2008 13:20:24 -0400 Subject: [Python-checkins] Python Regression Test Failures doc dist (1) Message-ID: <20081004172024.GA10087@python.psfb.org> rm -rf dist mkdir -p dist # archive the HTML make html make[1]: Entering directory `/home/neal/python/r26/Doc' mkdir -p build/html build/doctrees python tools/sphinx-build.py -b html -d build/doctrees -D latex_paper_size= . build/html Sphinx v0.5, building html loading pickled environment... done building [html]: targets for 0 source files that are out of date updating environment: 0 added, 0 changed, 0 removed no targets are out of date. Build finished. The HTML pages are in build/html. make[1]: Leaving directory `/home/neal/python/r26/Doc' cp -pPR build/html dist/python-docs-html tar -C dist -cf dist/python-docs-html.tar python-docs-html bzip2 -9 -k dist/python-docs-html.tar (cd dist; zip -q -r -9 python-docs-html.zip python-docs-html) /bin/sh: line 1: zip: command not found make: *** [dist] Error 127 From nnorwitz at gmail.com Sat Oct 4 20:20:22 2008 From: nnorwitz at gmail.com (Neal Norwitz) Date: Sat, 4 Oct 2008 14:20:22 -0400 Subject: [Python-checkins] Python Regression Test Failures doc dist (1) Message-ID: <20081004182022.GA10313@python.psfb.org> rm -rf dist mkdir -p dist # archive the HTML make html make[1]: Entering directory `/home/neal/python/r26/Doc' mkdir -p build/html build/doctrees python tools/sphinx-build.py -b html -d build/doctrees -D latex_paper_size= . build/html Sphinx v0.5, building html loading pickled environment... done building [html]: targets for 0 source files that are out of date updating environment: 0 added, 0 changed, 0 removed no targets are out of date. Build finished. The HTML pages are in build/html. make[1]: Leaving directory `/home/neal/python/r26/Doc' cp -pPR build/html dist/python-docs-html tar -C dist -cf dist/python-docs-html.tar python-docs-html bzip2 -9 -k dist/python-docs-html.tar (cd dist; zip -q -r -9 python-docs-html.zip python-docs-html) /bin/sh: line 1: zip: command not found make: *** [dist] Error 127 From python-checkins at python.org Sat Oct 4 20:26:02 2008 From: python-checkins at python.org (georg.brandl) Date: Sat, 4 Oct 2008 20:26:02 +0200 (CEST) Subject: [Python-checkins] r66793 - python/trunk/Doc/library/functions.rst Message-ID: <20081004182602.332831E4006@bag.python.org> Author: georg.brandl Date: Sat Oct 4 20:26:01 2008 New Revision: 66793 Log: #4041: don't refer to removed and outdated modules. Modified: python/trunk/Doc/library/functions.rst Modified: python/trunk/Doc/library/functions.rst ============================================================================== --- python/trunk/Doc/library/functions.rst (original) +++ python/trunk/Doc/library/functions.rst Sat Oct 4 20:26:01 2008 @@ -24,10 +24,8 @@ The function is invoked by the :keyword:`import` statement. It mainly exists so that you can replace it with another function that has a compatible interface, in order to change the semantics of the :keyword:`import` statement. - For examples of why and how you would do this, see the standard library modules - :mod:`ihooks` and :mod:`rexec`. See also the built-in module :mod:`imp`, which - defines some useful operations out of which you can build your own - :func:`__import__` function. + See the built-in module :mod:`imp`, which defines some useful operations out + of which you can build your own :func:`__import__` function. For example, the statement ``import spam`` results in the following call: ``__import__('spam', globals(), locals(), [], -1)``; the statement From nnorwitz at gmail.com Sat Oct 4 21:23:54 2008 From: nnorwitz at gmail.com (Neal Norwitz) Date: Sat, 4 Oct 2008 15:23:54 -0400 Subject: [Python-checkins] Python Regression Test Failures doc dist (1) Message-ID: <20081004192354.GA14401@python.psfb.org> rm -rf dist mkdir -p dist # archive the HTML make html make[1]: Entering directory `/home/neal/python/r26/Doc' mkdir -p build/html build/doctrees python tools/sphinx-build.py -b html -d build/doctrees -D latex_paper_size= . build/html Sphinx v0.5, building html loading pickled environment... done building [html]: targets for 0 source files that are out of date updating environment: 0 added, 0 changed, 0 removed no targets are out of date. Build finished. The HTML pages are in build/html. make[1]: Leaving directory `/home/neal/python/r26/Doc' cp -pPR build/html dist/python-docs-html tar -C dist -cf dist/python-docs-html.tar python-docs-html bzip2 -9 -k dist/python-docs-html.tar (cd dist; zip -q -r -9 python-docs-html.zip python-docs-html) rm -r dist/python-docs-html rm dist/python-docs-html.tar # archive the text build make text make[1]: Entering directory `/home/neal/python/r26/Doc' mkdir -p build/text build/doctrees python tools/sphinx-build.py -b text -d build/doctrees -D latex_paper_size= . build/text Sphinx v0.5, building text loading pickled environment... done building [text]: targets for 450 source files that are out of date updating environment: 0 added, 0 changed, 0 removed preparing documents... done writing output... about bugs c-api/abstract c-api/allocation c-api/arg c-api/bool c-api/buffer c-api/bytearray c-api/cell c-api/class c-api/cobject c-api/complex c-api/concrete c-api/conversion c-api/datetime c-api/descriptor c-api/dict c-api/exceptions c-api/file c-api/float c-api/function c-api/gcsupport c-api/gen c-api/import c-api/index c-api/init c-api/int c-api/intro c-api/iter c-api/iterator c-api/list c-api/long c-api/mapping c-api/marshal c-api/memory c-api/method c-api/module c-api/none c-api/number c-api/objbuffer c-api/object c-api/objimpl c-api/refcounting c-api/reflection c-api/sequence c-api/set c-api/slice c-api/string c-api/structures c-api/sys c-api/tuple c-api/type c-api/typeobj c-api/unicode c-api/utilities c-api/veryhigh c-api/weakref contents copyright distutils/apiref distutils/builtdist distutils/commandref distutils/configfile distutils/examples distutils/extending distutils/index distutils/introduction distutils/packageindex distutils/setupscript distutils/sourcedist distutils/uploading documenting/fromlatex documenting/index documenting/intro documenting/markup documenting/rest documenting/sphinx documenting/style extending/building extending/embedding extending/extending extending/index extending/newtypes extending/windows glossary howto/advocacy howto/cporting howto/curses howto/doanddont howto/functional howto/index howto/regex howto/sockets howto/unicode howto/urllib2 howto/webservers install/index library/2to3 library/__builtin__ library/__future__ library/__main__ library/_winreg library/abc library/aepack library/aetools library/aetypes library/aifc library/al library/allos library/anydbm library/archiving library/array library/ast library/asynchat library/asyncore library/atexit library/audioop library/autogil library/base64 library/basehttpserver library/bastion library/bdb library/binascii library/binhex library/bisect library/bsddb library/bz2 library/calendar library/carbon library/cd library/cgi library/cgihttpserver library/cgitb library/chunk library/cmath library/cmd library/code library/codecs library/codeop library/collections library/colorpicker library/colorsys library/commands library/compileall library/compiler library/configparser library/constants library/contextlib library/cookie library/cookielib library/copy library/copy_reg library/crypt library/crypto library/csv library/ctypes library/curses library/curses.ascii library/curses.panel library/custominterp library/datatypes library/datetime library/dbhash library/dbm library/debug library/decimal library/development library/difflib library/dircache library/dis library/distutils library/dl library/doctest library/docxmlrpcserver library/dumbdbm library/dummy_thread library/dummy_threading library/easydialogs library/email library/email-examples library/email.charset library/email.encoders library/email.errors library/email.generator library/email.header library/email.iterators library/email.message library/email.mime library/email.parser library/email.util library/errno library/exceptions library/fcntl library/filecmp library/fileformats library/fileinput library/filesys library/fl library/fm library/fnmatch library/formatter library/fpectl library/fpformat library/fractions library/framework library/frameworks library/ftplib library/functions library/functools library/future_builtins library/gc library/gdbm library/gensuitemodule library/getopt library/getpass library/gettext library/gl library/glob library/grp library/gzip library/hashlib library/heapq library/hmac library/hotshot library/htmllib library/htmlparser library/httplib library/i18n library/ic library/idle library/imageop library/imaplib library/imgfile library/imghdr library/imp library/imputil library/index library/inspect library/internet library/intro library/io library/ipc library/itertools library/jpeg library/json library/keyword library/language library/linecache library/locale library/logging library/mac library/macos library/macosa library/macostools library/macpath library/mailbox library/mailcap library/markup library/marshal library/math library/md5 library/mhlib library/mimetools library/mimetypes library/mimewriter library/mimify library/miniaeframe library/misc library/mm library/mmap library/modulefinder library/modules library/msilib library/msvcrt library/multifile library/multiprocessing library/mutex library/netdata library/netrc library/new library/nis library/nntplib library/numbers library/numeric library/objects library/operator library/optparse library/os library/os.path library/ossaudiodev library/othergui library/parser library/pdb library/persistence library/pickle library/pickletools library/pipes library/pkgutil library/platform library/plistlib library/popen2 library/poplib library/posix library/posixfile library/pprint library/profile library/pty library/pwd library/py_compile library/pyclbr library/pydoc library/pyexpat library/python library/queue library/quopri library/random library/re library/readline library/repr library/resource library/restricted library/rexec library/rfc822 library/rlcompleter library/robotparser library/runpy library/sched library/scrolledtext library/select library/sets library/sgi library/sgmllib library/sha library/shelve library/shlex library/shutil library/signal library/simplehttpserver library/simplexmlrpcserver library/site library/smtpd library/smtplib library/sndhdr library/socket library/socketserver library/someos library/spwd library/sqlite3 library/ssl library/stat library/statvfs library/stdtypes library/string library/stringio library/stringprep library/strings library/struct library/subprocess library/sun library/sunau library/sunaudio library/symbol library/symtable library/sys library/syslog library/tabnanny library/tarfile library/telnetlib library/tempfile library/termios library/test library/textwrap library/thread library/threading library/time library/timeit library/tix library/tk library/tkinter library/token library/tokenize library/trace library/traceback library/tty library/turtle library/types library/undoc library/unicodedata library/unittest library/unix library/urllib library/urllib2 library/urlparse library/user library/userdict library/uu library/uuid library/warnings library/wave library/weakref library/webbrowser library/whichdb library/windows library/winsound library/wsgiref library/xdrlib library/xml.dom library/xml.dom.minidom library/xml.dom.pulldom library/xml.etree.elementtree library/xml.sax library/xml.sax.handler library/xml.sax.reader library/xml.sax.utils library/xmlrpclib library/zipfile library/zipimport library/zlib license reference/compound_stmts reference/datamodel reference/executionmodel reference/expressions reference/grammar reference/index reference/introduction reference/lexical_analysis reference/simple_stmts reference/toplevel_components tutorial/appetite tutorial/classes tutorial/controlflow tutorial/datastructures tutorial/errors tutorial/floatingpoint tutorial/index tutorial/inputoutput tutorial/interactive tutorial/interpreter tutorial/introduction tutorial/modules tutorial/stdlib tutorial/stdlib2 tutorial/whatnow using/cmdline using/index using/mac using/unix using/windows whatsnew/2.6 build succeeded. Build finished; the text files are in build/text. make[1]: Leaving directory `/home/neal/python/r26/Doc' cp -pPR build/text dist/python-docs-text tar -C dist -cf dist/python-docs-text.tar python-docs-text bzip2 -9 -k dist/python-docs-text.tar (cd dist; zip -q -r -9 python-docs-text.zip python-docs-text) rm -r dist/python-docs-text rm dist/python-docs-text.tar # archive the A4 latex rm -r build/latex rm: cannot remove `build/latex': No such file or directory make: [dist] Error 1 (ignored) make latex PAPER=a4 make[1]: Entering directory `/home/neal/python/r26/Doc' mkdir -p build/latex build/doctrees python tools/sphinx-build.py -b latex -d build/doctrees -D latex_paper_size=a4 . build/latex Sphinx v0.5, building latex loading pickled environment... done building [latex]: all documents updating environment: 0 added, 0 changed, 0 removed processing c-api.tex... c-api/index c-api/intro c-api/veryhigh c-api/refcounting c-api/exceptions c-api/utilities c-api/sys c-api/import c-api/marshal c-api/arg c-api/conversion c-api/reflection c-api/abstract c-api/object c-api/number c-api/sequence c-api/mapping c-api/iter c-api/objbuffer c-api/concrete c-api/type c-api/none c-api/int c-api/bool c-api/long c-api/float c-api/complex c-api/bytearray c-api/string c-api/unicode c-api/buffer c-api/tuple c-api/list c-api/dict c-api/class c-api/function c-api/method c-api/file c-api/module c-api/iterator c-api/descriptor c-api/slice c-api/weakref c-api/cobject c-api/cell c-api/gen c-api/datetime c-api/set c-api/init c-api/memory c-api/objimpl c-api/allocation c-api/structures c-api/typeobj c-api/gcsupport resolving references... writing... done processing distutils.tex... distutils/index distutils/introduction distutils/setupscript distutils/configfile distutils/sourcedist distutils/builtdist distutils/packageindex distutils/uploading distutils/examples distutils/extending distutils/commandref distutils/apiref resolving references... writing... done processing documenting.tex... documenting/index documenting/intro documenting/style documenting/rest documenting/markup documenting/fromlatex documenting/sphinx resolving references... writing... done processing extending.tex... extending/index extending/extending extending/newtypes extending/building extending/windows extending/embedding resolving references... writing... done processing install.tex... install/index resolving references... writing... done processing library.tex... library/index library/intro library/functions library/constants library/objects library/stdtypes library/exceptions library/strings library/string library/re library/struct library/difflib library/stringio library/textwrap library/codecs library/unicodedata library/stringprep library/fpformat library/datatypes library/datetime library/calendar library/collections library/heapq library/bisect library/array library/sets library/sched library/mutex library/queue library/weakref library/userdict library/types library/new library/copy library/pprint library/repr library/numeric library/numbers library/math library/cmath library/decimal library/fractions library/random library/itertools library/functools library/operator library/filesys library/os.path library/fileinput library/stat library/statvfs library/filecmp library/tempfile library/glob library/fnmatch library/linecache library/shutil library/dircache library/macpath library/persistence library/pickle library/copy_reg library/shelve library/marshal library/anydbm library/whichdb library/dbm library/gdbm library/dbhash library/bsddb library/dumbdbm library/sqlite3 library/archiving library/zlib library/gzip library/bz2 library/zipfile library/tarfile library/fileformats library/csv library/configparser library/robotparser library/netrc library/xdrlib library/plistlib library/crypto library/hashlib library/hmac library/md5 library/sha library/allos library/os library/io library/time library/optparse library/getopt library/logging library/getpass library/curses library/curses.ascii library/curses.panel library/platform library/errno library/ctypes library/someos library/select library/threading library/thread library/dummy_threading library/dummy_thread library/multiprocessing library/mmap library/readline library/rlcompleter library/ipc library/subprocess library/socket library/ssl library/signal library/popen2 library/asyncore library/asynchat library/netdata library/email library/email.message library/email.parser library/email.generator library/email.mime library/email.header library/email.charset library/email.encoders library/email.errors library/email.util library/email.iterators library/email-examples library/json library/mailcap library/mailbox library/mhlib library/mimetools library/mimetypes library/mimewriter library/mimify library/multifile library/rfc822 library/base64 library/binhex library/binascii library/quopri library/uu library/markup library/htmlparser library/sgmllib library/htmllib library/pyexpat library/xml.dom library/xml.dom.minidom library/xml.dom.pulldom library/xml.sax library/xml.sax.handler library/xml.sax.utils library/xml.sax.reader library/xml.etree.elementtree library/internet library/webbrowser library/cgi library/cgitb library/wsgiref library/urllib library/urllib2 library/httplib library/ftplib library/poplib library/imaplib library/nntplib library/smtplib library/smtpd library/telnetlib library/uuid library/urlparse library/socketserver library/basehttpserver library/simplehttpserver library/cgihttpserver library/cookielib library/cookie library/xmlrpclib library/simplexmlrpcserver library/docxmlrpcserver library/mm library/audioop library/imageop library/aifc library/sunau library/wave library/chunk library/colorsys library/imghdr library/sndhdr library/ossaudiodev library/i18n library/gettext library/locale library/frameworks library/cmd library/shlex library/tk library/tkinter library/tix library/scrolledtext library/turtle library/idle library/othergui library/development library/pydoc library/doctest library/unittest library/2to3 library/test library/debug library/bdb library/pdb library/profile library/hotshot library/timeit library/trace library/python library/sys library/__builtin__ library/future_builtins library/__main__ library/warnings library/contextlib library/abc library/atexit library/traceback library/__future__ library/gc library/inspect library/site library/user library/fpectl library/custominterp library/code library/codeop library/restricted library/rexec library/bastion library/modules library/imp library/imputil library/zipimport library/pkgutil library/modulefinder library/runpy library/language library/parser library/ast library/symtable library/symbol library/token library/keyword library/tokenize library/tabnanny library/pyclbr library/py_compile library/compileall library/dis library/pickletools library/distutils library/compiler library/misc library/formatter library/windows library/msilib library/msvcrt library/_winreg library/winsound library/unix library/posix library/pwd library/spwd library/grp library/crypt library/dl library/termios library/tty library/pty library/fcntl library/pipes library/posixfile library/resource library/nis library/syslog library/commands library/mac library/ic library/macos library/macostools library/easydialogs library/framework library/autogil library/carbon library/colorpicker library/macosa library/gensuitemodule library/aetools library/aepack library/aetypes library/miniaeframe library/sgi library/al library/cd library/fl library/fm library/gl library/imgfile library/jpeg library/sun library/sunaudio library/undoc resolving references... writing... done processing reference.tex... reference/index reference/introduction reference/lexical_analysis reference/datamodel reference/executionmodel reference/expressions reference/simple_stmts reference/compound_stmts reference/toplevel_components reference/grammar resolving references... writing... done processing tutorial.tex... tutorial/index tutorial/appetite tutorial/interpreter tutorial/introduction tutorial/controlflow tutorial/datastructures tutorial/modules tutorial/inputoutput tutorial/errors tutorial/classes tutorial/stdlib tutorial/stdlib2 tutorial/whatnow tutorial/interactive tutorial/floatingpoint resolving references... writing... done processing using.tex... using/index using/cmdline using/unix using/windows using/mac resolving references... writing... done processing whatsnew.tex... whatsnew/2.6 resolving references... writing... done processing howto-doanddont.tex... howto/doanddont resolving references... writing... done processing howto-advocacy.tex... howto/advocacy resolving references... writing... done processing howto-functional.tex... howto/functional resolving references... writing... done processing howto-regex.tex... howto/regex resolving references... writing... done processing howto-sockets.tex... howto/sockets resolving references... writing... done processing howto-urllib2.tex... howto/urllib2 resolving references... writing... done processing howto-webservers.tex... howto/webservers resolving references... writing... done processing howto-curses.tex... howto/curses resolving references... writing... done processing howto-cporting.tex... howto/cporting resolving references... writing... done processing howto-unicode.tex... howto/unicode resolving references... writing... done copying TeX support files... done build succeeded. Build finished; the LaTeX files are in build/latex. Run `make all-pdf' or `make all-ps' in that directory to run these through (pdf)latex. make[1]: Leaving directory `/home/neal/python/r26/Doc' (cd build/latex; make clean && make all-pdf && make FMT=pdf zip bz2) make[1]: Entering directory `/home/neal/python/r26/Doc/build/latex' rm -f *.pdf *.dvi *.ps rm -f *.log *.ind *.aux *.toc *.syn *.idx *.out *.ilg *.pla make[1]: Leaving directory `/home/neal/python/r26/Doc/build/latex' make[1]: Entering directory `/home/neal/python/r26/Doc/build/latex' pdflatex 'c-api.tex' This is pdfTeX, Version 3.14159-1.10b (Web2C 7.4.5) (./c-api.tex{/usr/share/texmf/pdftex/config/pdftex.cfg} LaTeX2e <2001/06/01> Babel and hyphenation patterns for american, french, german, ngerman, n ohyphenation, loaded. (./manual.cls Document Class: manual 2008/09/12 Document class (Sphinx manual) (/usr/share/texmf/tex/latex/misc/fancybox.sty Style option: `fancybox' v1.3 <2000/09/19> (tvz) ) (/usr/share/texmf/tex/latex/base/report.cls Document Class: report 2001/04/21 v1.4e Standard LaTeX document class (/usr/share/texmf/tex/latex/base/size10.clo)) (./sphinx.sty (/usr/share/texmf/tex/latex/base/textcomp.sty (/usr/share/texmf/tex/latex/base/ts1enc.def)) (/usr/share/texmf/tex/latex/fancyvrb/fancyvrb.sty Style option: `fancyvrb' v2.7, with DG/SPQR fixes <2000/03/21> (tvz) (/usr/share/texmf/tex/latex/graphics/keyval.sty)) (/usr/share/texmf/tex/latex/fancyhdr/fancyhdr.sty) (/usr/share/texmf/tex/latex/titlesec/titlesec.sty) (./tabulary.sty (/usr/share/texmf/tex/latex/tools/array.sty)) (/usr/share/texmf/tex/latex/amsmath/amsmath.sty For additional information on amsmath, use the `?' option. (/usr/share/texmf/tex/latex/amsmath/amstext.sty (/usr/share/texmf/tex/latex/amsmath/amsgen.sty)) (/usr/share/texmf/tex/latex/amsmath/amsbsy.sty) (/usr/share/texmf/tex/latex/amsmath/amsopn.sty)) (/usr/share/texmf/tex/latex/graphics/color.sty (/usr/share/texmf/tex/latex/config/color.cfg) (/usr/share/texmf/tex/latex/graphics/pdftex.def)) (/usr/share/texmf/tex/latex/hyperref/hyperref.sty (/usr/share/texmf/tex/latex/hyperref/pd1enc.def) (/usr/share/texmf/tex/latex/config/hyperref.cfg) Implicit mode ON; LaTeX internals redefined (/usr/share/texmf/tex/latex/html/url.sty)) *hyperref using default driver hpdftex* (/usr/share/texmf/tex/latex/hyperref/hpdftex.def (/usr/share/texmf/tex/latex/psnfss/pifont.sty (/usr/share/texmf/tex/latex/psnfss/upzd.fd) (/usr/share/texmf/tex/latex/psnfss/upsy.fd))) (/usr/share/texmf/tex/latex/misc/framed.sty) (/usr/share/texmf/tex/latex/graphics/graphicx.sty (/usr/share/texmf/tex/latex/graphics/graphics.sty (/usr/share/texmf/tex/latex/graphics/trig.sty) (/usr/share/texmf/tex/latex/config/graphics.cfg))) (/usr/share/texmf/pdftex/plain/misc/pdfcolor.tex)) (/usr/share/texmf/tex/latex/base/makeidx.sty)) (/usr/share/texmf/tex/latex/base/inputenc.sty ! LaTeX Error: File `utf8.def' not found. Type X to quit or to proceed, or enter new name. (Default extension: def) Enter file name: ! Emergency stop. l.118 \endinput ^^M No pages of output. Transcript written on c-api.log. make[1]: *** [c-api.pdf] Error 1 make[1]: Leaving directory `/home/neal/python/r26/Doc/build/latex' make: *** [dist] Error 2 From python-checkins at python.org Sat Oct 4 22:06:31 2008 From: python-checkins at python.org (benjamin.peterson) Date: Sat, 4 Oct 2008 22:06:31 +0200 (CEST) Subject: [Python-checkins] r66796 - doctools/trunk/sphinx/application.py Message-ID: <20081004200631.4F7DF1E4002@bag.python.org> Author: benjamin.peterson Date: Sat Oct 4 22:06:30 2008 New Revision: 66796 Log: silence some deprecation warnings Modified: doctools/trunk/sphinx/application.py Modified: doctools/trunk/sphinx/application.py ============================================================================== --- doctools/trunk/sphinx/application.py (original) +++ doctools/trunk/sphinx/application.py Sat Oct 4 22:06:30 2008 @@ -39,7 +39,7 @@ category = 'Extension error' def __init__(self, message, orig_exc=None): - self.message = message + super(ExtensionError, self).__init__(message) self.orig_exc = orig_exc def __repr__(self): @@ -49,9 +49,10 @@ return '%s(%r)' % (self.__class__.__name__, self.message) def __str__(self): + parent_str = super(ExtensionError, self).__str__() if self.orig_exc: - return '%s (exception: %s)' % (self.message, self.orig_exc) - return self.message + return '%s (exception: %s)' % (parent_str, self.orig_exc) + return parent_str # List of all known core events. Maps name to arguments description. From python-checkins at python.org Sat Oct 4 22:55:51 2008 From: python-checkins at python.org (benjamin.peterson) Date: Sat, 4 Oct 2008 22:55:51 +0200 (CEST) Subject: [Python-checkins] r66797 - in python/trunk/Lib/lib2to3: fixes/fix_getcwdu.py fixes/fix_import.py pytree.py tests/data/README tests/data/infinite_recursion.py tests/test_fixers.py Message-ID: <20081004205551.1EAF91E4006@bag.python.org> Author: benjamin.peterson Date: Sat Oct 4 22:55:50 2008 New Revision: 66797 Log: Merged revisions 66707,66775,66782 via svnmerge from svn+ssh://pythondev at svn.python.org/sandbox/trunk/2to3/lib2to3 ........ r66707 | benjamin.peterson | 2008-09-30 18:27:10 -0500 (Tue, 30 Sep 2008) | 1 line fix #4001: fix_imports didn't check for __init__.py before converting to relative imports ........ r66775 | collin.winter | 2008-10-03 12:08:26 -0500 (Fri, 03 Oct 2008) | 4 lines Add an alternative iterative pattern matching system that, while slower, correctly parses files that cause the faster recursive pattern matcher to fail with a recursion error. lib2to3 falls back to the iterative matcher if the recursive one fails. Fixes http://bugs.python.org/issue2532. Thanks to Nick Edds. ........ r66782 | benjamin.peterson | 2008-10-03 17:51:36 -0500 (Fri, 03 Oct 2008) | 1 line add Victor Stinner's fixer for os.getcwdu -> os.getcwd #4023 ........ Added: python/trunk/Lib/lib2to3/fixes/fix_getcwdu.py - copied unchanged from r66782, /sandbox/trunk/2to3/lib2to3/fixes/fix_getcwdu.py python/trunk/Lib/lib2to3/tests/data/README - copied unchanged from r66782, /sandbox/trunk/2to3/lib2to3/tests/data/README python/trunk/Lib/lib2to3/tests/data/infinite_recursion.py - copied unchanged from r66782, /sandbox/trunk/2to3/lib2to3/tests/data/infinite_recursion.py Modified: python/trunk/Lib/lib2to3/ (props changed) python/trunk/Lib/lib2to3/fixes/fix_import.py python/trunk/Lib/lib2to3/pytree.py python/trunk/Lib/lib2to3/tests/test_fixers.py Modified: python/trunk/Lib/lib2to3/fixes/fix_import.py ============================================================================== --- python/trunk/Lib/lib2to3/fixes/fix_import.py (original) +++ python/trunk/Lib/lib2to3/fixes/fix_import.py Sat Oct 4 22:55:50 2008 @@ -54,6 +54,10 @@ imp_name = imp_name.split('.', 1)[0].strip() base_path = dirname(file_path) base_path = join(base_path, imp_name) + # If there is no __init__.py next to the file its not in a package + # so can't be a relative import. + if not exists(join(dirname(base_path), '__init__.py')): + return False for ext in ['.py', pathsep, '.pyc', '.so', '.sl', '.pyd']: if exists(base_path + ext): return True Modified: python/trunk/Lib/lib2to3/pytree.py ============================================================================== --- python/trunk/Lib/lib2to3/pytree.py (original) +++ python/trunk/Lib/lib2to3/pytree.py Sat Oct 4 22:55:50 2008 @@ -655,10 +655,47 @@ elif self.name == "bare_name": yield self._bare_name_matches(nodes) else: - for count, r in self._recursive_matches(nodes, 0): - if self.name: - r[self.name] = nodes[:count] - yield count, r + try: + for count, r in self._recursive_matches(nodes, 0): + if self.name: + r[self.name] = nodes[:count] + yield count, r + except RuntimeError: + # We fall back to the iterative pattern matching scheme if the recursive + # scheme hits the recursion limit. + for count, r in self._iterative_matches(nodes): + if self.name: + r[self.name] = nodes[:count] + yield count, r + + def _iterative_matches(self, nodes): + """Helper to iteratively yield the matches.""" + nodelen = len(nodes) + if 0 >= self.min: + yield 0, {} + + results = [] + # generate matches that use just one alt from self.content + for alt in self.content: + for c, r in generate_matches(alt, nodes): + yield c, r + results.append((c, r)) + + # for each match, iterate down the nodes + while results: + new_results = [] + for c0, r0 in results: + # stop if the entire set of nodes has been matched + if c0 < nodelen and c0 <= self.max: + for alt in self.content: + for c1, r1 in generate_matches(alt, nodes[c0:]): + if c1 > 0: + r = {} + r.update(r0) + r.update(r1) + yield c0 + c1, r + new_results.append((c0 + c1, r)) + results = new_results def _bare_name_matches(self, nodes): """Special optimized matcher for bare_name.""" Modified: python/trunk/Lib/lib2to3/tests/test_fixers.py ============================================================================== --- python/trunk/Lib/lib2to3/tests/test_fixers.py (original) +++ python/trunk/Lib/lib2to3/tests/test_fixers.py Sat Oct 4 22:55:50 2008 @@ -9,10 +9,10 @@ import support # Python imports +import os import unittest from itertools import chain from operator import itemgetter -from os.path import dirname, pathsep # Local imports from .. import pygram @@ -3274,14 +3274,19 @@ # Need to replace fix_import's exists method # so we can check that it's doing the right thing self.files_checked = [] + self.present_files = set() self.always_exists = True def fake_exists(name): self.files_checked.append(name) - return self.always_exists + return self.always_exists or (name in self.present_files) from ..fixes import fix_import fix_import.exists = fake_exists + def tearDown(self): + from lib2to3.fixes import fix_import + fix_import.exists = os.path.exists + def check_both(self, b, a): self.always_exists = True FixerTestCase.check(self, b, a) @@ -3291,10 +3296,12 @@ def test_files_checked(self): def p(path): # Takes a unix path and returns a path with correct separators - return pathsep.join(path.split("/")) + return os.path.pathsep.join(path.split("/")) self.always_exists = False - expected_extensions = ('.py', pathsep, '.pyc', '.so', '.sl', '.pyd') + self.present_files = set(['__init__.py']) + expected_extensions = ('.py', os.path.pathsep, '.pyc', '.so', + '.sl', '.pyd') names_to_test = (p("/spam/eggs.py"), "ni.py", p("../../shrubbery.py")) for name in names_to_test: @@ -3302,11 +3309,32 @@ self.filename = name self.unchanged("import jam") - if dirname(name): name = dirname(name) + '/jam' - else: name = 'jam' + if os.path.dirname(name): + name = os.path.dirname(name) + '/jam' + else: + name = 'jam' expected_checks = set(name + ext for ext in expected_extensions) + expected_checks.add("__init__.py") + + self.assertEqual(set(self.files_checked), expected_checks) - self.failUnlessEqual(set(self.files_checked), expected_checks) + def test_not_in_package(self): + s = "import bar" + self.always_exists = False + self.present_files = set(["bar.py"]) + self.unchanged(s) + + def test_in_package(self): + b = "import bar" + a = "from . import bar" + self.always_exists = False + self.present_files = set(["__init__.py", "bar.py"]) + self.check(b, a) + + def test_comments_and_indent(self): + b = "import bar # Foo" + a = "from . import bar # Foo" + self.check(b, a) def test_from(self): b = "from foo import bar, baz" @@ -3577,6 +3605,67 @@ self.check(b, a) +class Test_getcwdu(FixerTestCase): + + fixer = 'getcwdu' + + def test_basic(self): + b = """os.getcwdu""" + a = """os.getcwd""" + self.check(b, a) + + b = """os.getcwdu()""" + a = """os.getcwd()""" + self.check(b, a) + + b = """meth = os.getcwdu""" + a = """meth = os.getcwd""" + self.check(b, a) + + b = """os.getcwdu(args)""" + a = """os.getcwd(args)""" + self.check(b, a) + + def test_comment(self): + b = """os.getcwdu() # Foo""" + a = """os.getcwd() # Foo""" + self.check(b, a) + + def test_unchanged(self): + s = """os.getcwd()""" + self.unchanged(s) + + s = """getcwdu()""" + self.unchanged(s) + + s = """os.getcwdb()""" + self.unchanged(s) + + def test_indentation(self): + b = """ + if 1: + os.getcwdu() + """ + a = """ + if 1: + os.getcwd() + """ + self.check(b, a) + + def test_multilation(self): + b = """os .getcwdu()""" + a = """os .getcwd()""" + self.check(b, a) + + b = """os. getcwdu""" + a = """os. getcwd""" + self.check(b, a) + + b = """os.getcwdu ( )""" + a = """os.getcwd ( )""" + self.check(b, a) + + if __name__ == "__main__": import __main__ support.run_all_tests(__main__) From python-checkins at python.org Sat Oct 4 23:06:12 2008 From: python-checkins at python.org (benjamin.peterson) Date: Sat, 4 Oct 2008 23:06:12 +0200 (CEST) Subject: [Python-checkins] r66799 - python/branches/release26-maint Message-ID: <20081004210612.05B041E4002@bag.python.org> Author: benjamin.peterson Date: Sat Oct 4 23:06:11 2008 New Revision: 66799 Log: Blocked revisions 66721-66722,66744-66745,66752,66756,66763-66765,66768,66791-66792 via svnmerge ........ r66721 | barry.warsaw | 2008-10-01 22:33:51 -0500 (Wed, 01 Oct 2008) | 1 line Bump to 2.7a0 ........ r66722 | martin.v.loewis | 2008-10-02 06:44:17 -0500 (Thu, 02 Oct 2008) | 1 line Use CRT 9 policy files. ........ r66744 | benjamin.peterson | 2008-10-02 14:00:31 -0500 (Thu, 02 Oct 2008) | 1 line we're in 2.7 now ........ r66745 | georg.brandl | 2008-10-02 14:09:47 -0500 (Thu, 02 Oct 2008) | 2 lines Forward-port r66736. ........ r66752 | martin.v.loewis | 2008-10-02 15:04:47 -0500 (Thu, 02 Oct 2008) | 2 lines Add UUID for 2.7. ........ r66756 | benjamin.peterson | 2008-10-02 15:46:58 -0500 (Thu, 02 Oct 2008) | 1 line update pydoc topics ........ r66763 | neal.norwitz | 2008-10-02 23:13:08 -0500 (Thu, 02 Oct 2008) | 1 line Update the version to 2.7. Hopefully this fixes the test_distutils failure ........ r66764 | martin.v.loewis | 2008-10-03 03:59:41 -0500 (Fri, 03 Oct 2008) | 2 lines Bump version to 2.7. Regenerate. ........ r66765 | martin.v.loewis | 2008-10-03 05:59:55 -0500 (Fri, 03 Oct 2008) | 1 line Update version number to 2.7. ........ r66768 | hirokazu.yamamoto | 2008-10-03 11:07:28 -0500 (Fri, 03 Oct 2008) | 1 line Follows to python's version change (VC6) ........ r66791 | andrew.kuchling | 2008-10-04 11:52:31 -0500 (Sat, 04 Oct 2008) | 1 line Add What's New for 2.7 ........ r66792 | benjamin.peterson | 2008-10-04 12:10:14 -0500 (Sat, 04 Oct 2008) | 1 line silence Sphinx warning ........ Modified: python/branches/release26-maint/ (props changed) From brett at python.org Sat Oct 4 23:10:53 2008 From: brett at python.org (Brett Cannon) Date: Sat, 4 Oct 2008 14:10:53 -0700 Subject: [Python-checkins] r66799 - python/branches/release26-maint In-Reply-To: <20081004210612.05B041E4002@bag.python.org> References: <20081004210612.05B041E4002@bag.python.org> Message-ID: On Sat, Oct 4, 2008 at 2:06 PM, benjamin. peterson wrote: > Author: benjamin.peterson > Date: Sat Oct 4 23:06:11 2008 > New Revision: 66799 > > Log: > Blocked revisions 66721-66722,66744-66745,66752,66756,66763-66765,66768,66791-66792 via svnmerge > If we have to block every change made in 2.7 that should not be backported that is going to get old REALLY fast. If we use svnmerge on 2.6 I think it should only be through explicit merging of specific revisions and never through a across-the-board merge. -Brett > ........ > r66721 | barry.warsaw | 2008-10-01 22:33:51 -0500 (Wed, 01 Oct 2008) | 1 line > > Bump to 2.7a0 > ........ > r66722 | martin.v.loewis | 2008-10-02 06:44:17 -0500 (Thu, 02 Oct 2008) | 1 line > > Use CRT 9 policy files. > ........ > r66744 | benjamin.peterson | 2008-10-02 14:00:31 -0500 (Thu, 02 Oct 2008) | 1 line > > we're in 2.7 now > ........ > r66745 | georg.brandl | 2008-10-02 14:09:47 -0500 (Thu, 02 Oct 2008) | 2 lines > > Forward-port r66736. > ........ > r66752 | martin.v.loewis | 2008-10-02 15:04:47 -0500 (Thu, 02 Oct 2008) | 2 lines > > Add UUID for 2.7. > ........ > r66756 | benjamin.peterson | 2008-10-02 15:46:58 -0500 (Thu, 02 Oct 2008) | 1 line > > update pydoc topics > ........ > r66763 | neal.norwitz | 2008-10-02 23:13:08 -0500 (Thu, 02 Oct 2008) | 1 line > > Update the version to 2.7. Hopefully this fixes the test_distutils failure > ........ > r66764 | martin.v.loewis | 2008-10-03 03:59:41 -0500 (Fri, 03 Oct 2008) | 2 lines > > Bump version to 2.7. Regenerate. > ........ > r66765 | martin.v.loewis | 2008-10-03 05:59:55 -0500 (Fri, 03 Oct 2008) | 1 line > > Update version number to 2.7. > ........ > r66768 | hirokazu.yamamoto | 2008-10-03 11:07:28 -0500 (Fri, 03 Oct 2008) | 1 line > > Follows to python's version change (VC6) > ........ > r66791 | andrew.kuchling | 2008-10-04 11:52:31 -0500 (Sat, 04 Oct 2008) | 1 line > > Add What's New for 2.7 > ........ > r66792 | benjamin.peterson | 2008-10-04 12:10:14 -0500 (Sat, 04 Oct 2008) | 1 line > > silence Sphinx warning > ........ > > > Modified: > python/branches/release26-maint/ (props changed) > _______________________________________________ > Python-checkins mailing list > Python-checkins at python.org > http://mail.python.org/mailman/listinfo/python-checkins > From musiccomposition at gmail.com Sat Oct 4 23:12:17 2008 From: musiccomposition at gmail.com (Benjamin Peterson) Date: Sat, 4 Oct 2008 16:12:17 -0500 Subject: [Python-checkins] r66799 - python/branches/release26-maint In-Reply-To: References: <20081004210612.05B041E4002@bag.python.org> Message-ID: <1afaf6160810041412i620c2d8cr997f42764165c35b@mail.gmail.com> On Sat, Oct 4, 2008 at 4:10 PM, Brett Cannon wrote: > On Sat, Oct 4, 2008 at 2:06 PM, benjamin. peterson > wrote: >> Author: benjamin.peterson >> Date: Sat Oct 4 23:06:11 2008 >> New Revision: 66799 >> >> Log: >> Blocked revisions 66721-66722,66744-66745,66752,66756,66763-66765,66768,66791-66792 via svnmerge >> > > If we have to block every change made in 2.7 that should not be > backported that is going to get old REALLY fast. If we use svnmerge on > 2.6 I think it should only be through explicit merging of specific > revisions and never through a across-the-board merge. I totally agree. -- Cheers, Benjamin Peterson "There's nothing quite as beautiful as an oboe... except a chicken stuck in a vacuum cleaner." From python-checkins at python.org Sat Oct 4 23:33:09 2008 From: python-checkins at python.org (benjamin.peterson) Date: Sat, 4 Oct 2008 23:33:09 +0200 (CEST) Subject: [Python-checkins] r66800 - in python/branches/release26-maint: Doc/library/functions.rst Doc/whatsnew/2.2.rst Doc/whatsnew/2.6.rst Lib/lib2to3 Lib/lib2to3/fixes/fix_getcwdu.py Lib/lib2to3/fixes/fix_import.py Lib/lib2to3/pytree.py Lib/lib2to3/tests/data/README Lib/lib2to3/tests/data/infinite_recursion.py Lib/lib2to3/tests/test_fixers.py Lib/test/test_datetime.py Lib/test/test_docxmlrpc.py Mac/BuildScript/build-installer.py Modules/_codecsmodule.c Modules/cjkcodecs/multibytecodec.c Objects/floatobject.c Objects/listobject.c Objects/setobject.c Objects/stringobject.c Objects/tupleobject.c Objects/unicodeobject.c setup.py Message-ID: <20081004213309.8B0CA1E4006@bag.python.org> Author: benjamin.peterson Date: Sat Oct 4 23:33:08 2008 New Revision: 66800 Log: Merged revisions 66766-66767,66771-66772,66774,66776,66783-66787,66790,66793,66797 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ................ r66766 | benjamin.peterson | 2008-10-03 06:52:06 -0500 (Fri, 03 Oct 2008) | 1 line update the mac installer script ................ r66767 | andrew.kuchling | 2008-10-03 07:26:42 -0500 (Fri, 03 Oct 2008) | 1 line Docstring typo. ................ r66771 | hirokazu.yamamoto | 2008-10-03 11:18:42 -0500 (Fri, 03 Oct 2008) | 2 lines Fixed following error when DocXMLRPCServer failed. UnboundLocalError: local variable 'serv' referenced before assignment ................ r66772 | andrew.kuchling | 2008-10-03 11:29:19 -0500 (Fri, 03 Oct 2008) | 1 line Mention exception in docstring ................ r66774 | andrew.kuchling | 2008-10-03 11:42:52 -0500 (Fri, 03 Oct 2008) | 1 line Typo fix ................ r66776 | hirokazu.yamamoto | 2008-10-03 12:34:49 -0500 (Fri, 03 Oct 2008) | 2 lines Issue #1706863: Fixed "'NoneType' object has no attribute 'rfind'" error when sqlite libfile not found. ................ r66783 | andrew.kuchling | 2008-10-03 20:02:29 -0500 (Fri, 03 Oct 2008) | 1 line Use correct capitalization of NaN ................ r66784 | andrew.kuchling | 2008-10-03 20:03:42 -0500 (Fri, 03 Oct 2008) | 1 line Docstring change: Specify exception raised ................ r66785 | andrew.kuchling | 2008-10-03 20:04:24 -0500 (Fri, 03 Oct 2008) | 1 line Docstring changes: Specify exceptions raised ................ r66786 | andrew.kuchling | 2008-10-03 20:05:56 -0500 (Fri, 03 Oct 2008) | 3 lines Docstring change for *partition: use same tense as other docstrings. Hyphenate left- and right-justified. Fix 'registerd' typo ................ r66787 | andrew.kuchling | 2008-10-03 22:08:56 -0500 (Fri, 03 Oct 2008) | 1 line two corrections ................ r66790 | andrew.kuchling | 2008-10-04 11:52:01 -0500 (Sat, 04 Oct 2008) | 1 line Set svn:keywords ................ r66793 | georg.brandl | 2008-10-04 13:26:01 -0500 (Sat, 04 Oct 2008) | 2 lines #4041: don't refer to removed and outdated modules. ................ r66797 | benjamin.peterson | 2008-10-04 15:55:50 -0500 (Sat, 04 Oct 2008) | 19 lines Merged revisions 66707,66775,66782 via svnmerge from svn+ssh://pythondev at svn.python.org/sandbox/trunk/2to3/lib2to3 ........ r66707 | benjamin.peterson | 2008-09-30 18:27:10 -0500 (Tue, 30 Sep 2008) | 1 line fix #4001: fix_imports didn't check for __init__.py before converting to relative imports ........ r66775 | collin.winter | 2008-10-03 12:08:26 -0500 (Fri, 03 Oct 2008) | 4 lines Add an alternative iterative pattern matching system that, while slower, correctly parses files that cause the faster recursive pattern matcher to fail with a recursion error. lib2to3 falls back to the iterative matcher if the recursive one fails. Fixes http://bugs.python.org/issue2532. Thanks to Nick Edds. ........ r66782 | benjamin.peterson | 2008-10-03 17:51:36 -0500 (Fri, 03 Oct 2008) | 1 line add Victor Stinner's fixer for os.getcwdu -> os.getcwd #4023 ........ ................ Added: python/branches/release26-maint/Lib/lib2to3/fixes/fix_getcwdu.py - copied unchanged from r66797, /python/trunk/Lib/lib2to3/fixes/fix_getcwdu.py python/branches/release26-maint/Lib/lib2to3/tests/data/README - copied unchanged from r66797, /python/trunk/Lib/lib2to3/tests/data/README python/branches/release26-maint/Lib/lib2to3/tests/data/infinite_recursion.py - copied unchanged from r66797, /python/trunk/Lib/lib2to3/tests/data/infinite_recursion.py Modified: python/branches/release26-maint/ (props changed) python/branches/release26-maint/Doc/library/functions.rst python/branches/release26-maint/Doc/whatsnew/2.2.rst python/branches/release26-maint/Doc/whatsnew/2.6.rst (contents, props changed) python/branches/release26-maint/Lib/lib2to3/ (props changed) python/branches/release26-maint/Lib/lib2to3/fixes/fix_import.py python/branches/release26-maint/Lib/lib2to3/pytree.py python/branches/release26-maint/Lib/lib2to3/tests/test_fixers.py python/branches/release26-maint/Lib/test/test_datetime.py python/branches/release26-maint/Lib/test/test_docxmlrpc.py python/branches/release26-maint/Mac/BuildScript/build-installer.py python/branches/release26-maint/Modules/_codecsmodule.c python/branches/release26-maint/Modules/cjkcodecs/multibytecodec.c python/branches/release26-maint/Objects/floatobject.c python/branches/release26-maint/Objects/listobject.c python/branches/release26-maint/Objects/setobject.c python/branches/release26-maint/Objects/stringobject.c python/branches/release26-maint/Objects/tupleobject.c python/branches/release26-maint/Objects/unicodeobject.c python/branches/release26-maint/setup.py Modified: python/branches/release26-maint/Doc/library/functions.rst ============================================================================== --- python/branches/release26-maint/Doc/library/functions.rst (original) +++ python/branches/release26-maint/Doc/library/functions.rst Sat Oct 4 23:33:08 2008 @@ -24,10 +24,8 @@ The function is invoked by the :keyword:`import` statement. It mainly exists so that you can replace it with another function that has a compatible interface, in order to change the semantics of the :keyword:`import` statement. - For examples of why and how you would do this, see the standard library modules - :mod:`ihooks` and :mod:`rexec`. See also the built-in module :mod:`imp`, which - defines some useful operations out of which you can build your own - :func:`__import__` function. + See the built-in module :mod:`imp`, which defines some useful operations out + of which you can build your own :func:`__import__` function. For example, the statement ``import spam`` results in the following call: ``__import__('spam', globals(), locals(), [], -1)``; the statement Modified: python/branches/release26-maint/Doc/whatsnew/2.2.rst ============================================================================== --- python/branches/release26-maint/Doc/whatsnew/2.2.rst (original) +++ python/branches/release26-maint/Doc/whatsnew/2.2.rst Sat Oct 4 23:33:08 2008 @@ -714,7 +714,7 @@ presented with two integer arguments: it returns an integer result that's truncated down when there would be a fractional part. For example, ``3/2`` is 1, not 1.5, and ``(-1)/2`` is -1, not -0.5. This means that the results of -divison can vary unexpectedly depending on the type of the two operands and +division can vary unexpectedly depending on the type of the two operands and because Python is dynamically typed, it can be difficult to determine the possible types of the operands. Modified: python/branches/release26-maint/Doc/whatsnew/2.6.rst ============================================================================== --- python/branches/release26-maint/Doc/whatsnew/2.6.rst (original) +++ python/branches/release26-maint/Doc/whatsnew/2.6.rst Sat Oct 4 23:33:08 2008 @@ -8,7 +8,7 @@ :Release: |release| :Date: |today| -.. $Id: whatsnew26.tex 55746 2007-06-02 18:33:53Z neal.norwitz $ +.. $Id$ Rules for maintenance: * Anyone can add text to this document. Do not spend very much time @@ -2753,7 +2753,7 @@ returns the resulting value. A literal expression is a Python expression containing only strings, numbers, dictionaries, etc. but no statements or function calls. If you need to -evaluate an expression but accept the security risk of using an +evaluate an expression but cannot accept the security risk of using an :func:`eval` call, :func:`literal_eval` will handle it safely:: >>> literal = '("a", "b", {2:4, 3:8, 1:2})' @@ -3039,7 +3039,7 @@ ``numfree``, and a macro ``Py_MAXFREELIST`` is always defined. -* A new Makefile target, "make check", prepares the Python source tree +* A new Makefile target, "make patchcheck", prepares the Python source tree for making a patch: it fixes trailing whitespace in all modified ``.py`` files, checks whether the documentation has been changed, and reports whether the :file:`Misc/ACKS` and :file:`Misc/NEWS` files @@ -3267,6 +3267,6 @@ The author would like to thank the following people for offering suggestions, corrections and assistance with various drafts of this -article: Georg Brandl, Steve Brown, Nick Coghlan, Jim Jewett, Kent -Johnson, Chris Lambacher, Antoine Pitrou. +article: Georg Brandl, Steve Brown, Nick Coghlan, Ralph Corderoy, +Jim Jewett, Kent Johnson, Chris Lambacher, Antoine Pitrou, Brian Warner. Modified: python/branches/release26-maint/Lib/lib2to3/fixes/fix_import.py ============================================================================== --- python/branches/release26-maint/Lib/lib2to3/fixes/fix_import.py (original) +++ python/branches/release26-maint/Lib/lib2to3/fixes/fix_import.py Sat Oct 4 23:33:08 2008 @@ -54,6 +54,10 @@ imp_name = imp_name.split('.', 1)[0].strip() base_path = dirname(file_path) base_path = join(base_path, imp_name) + # If there is no __init__.py next to the file its not in a package + # so can't be a relative import. + if not exists(join(dirname(base_path), '__init__.py')): + return False for ext in ['.py', pathsep, '.pyc', '.so', '.sl', '.pyd']: if exists(base_path + ext): return True Modified: python/branches/release26-maint/Lib/lib2to3/pytree.py ============================================================================== --- python/branches/release26-maint/Lib/lib2to3/pytree.py (original) +++ python/branches/release26-maint/Lib/lib2to3/pytree.py Sat Oct 4 23:33:08 2008 @@ -655,10 +655,47 @@ elif self.name == "bare_name": yield self._bare_name_matches(nodes) else: - for count, r in self._recursive_matches(nodes, 0): - if self.name: - r[self.name] = nodes[:count] - yield count, r + try: + for count, r in self._recursive_matches(nodes, 0): + if self.name: + r[self.name] = nodes[:count] + yield count, r + except RuntimeError: + # We fall back to the iterative pattern matching scheme if the recursive + # scheme hits the recursion limit. + for count, r in self._iterative_matches(nodes): + if self.name: + r[self.name] = nodes[:count] + yield count, r + + def _iterative_matches(self, nodes): + """Helper to iteratively yield the matches.""" + nodelen = len(nodes) + if 0 >= self.min: + yield 0, {} + + results = [] + # generate matches that use just one alt from self.content + for alt in self.content: + for c, r in generate_matches(alt, nodes): + yield c, r + results.append((c, r)) + + # for each match, iterate down the nodes + while results: + new_results = [] + for c0, r0 in results: + # stop if the entire set of nodes has been matched + if c0 < nodelen and c0 <= self.max: + for alt in self.content: + for c1, r1 in generate_matches(alt, nodes[c0:]): + if c1 > 0: + r = {} + r.update(r0) + r.update(r1) + yield c0 + c1, r + new_results.append((c0 + c1, r)) + results = new_results def _bare_name_matches(self, nodes): """Special optimized matcher for bare_name.""" Modified: python/branches/release26-maint/Lib/lib2to3/tests/test_fixers.py ============================================================================== --- python/branches/release26-maint/Lib/lib2to3/tests/test_fixers.py (original) +++ python/branches/release26-maint/Lib/lib2to3/tests/test_fixers.py Sat Oct 4 23:33:08 2008 @@ -9,10 +9,10 @@ import support # Python imports +import os import unittest from itertools import chain from operator import itemgetter -from os.path import dirname, pathsep # Local imports from .. import pygram @@ -3274,14 +3274,19 @@ # Need to replace fix_import's exists method # so we can check that it's doing the right thing self.files_checked = [] + self.present_files = set() self.always_exists = True def fake_exists(name): self.files_checked.append(name) - return self.always_exists + return self.always_exists or (name in self.present_files) from ..fixes import fix_import fix_import.exists = fake_exists + def tearDown(self): + from lib2to3.fixes import fix_import + fix_import.exists = os.path.exists + def check_both(self, b, a): self.always_exists = True FixerTestCase.check(self, b, a) @@ -3291,10 +3296,12 @@ def test_files_checked(self): def p(path): # Takes a unix path and returns a path with correct separators - return pathsep.join(path.split("/")) + return os.path.pathsep.join(path.split("/")) self.always_exists = False - expected_extensions = ('.py', pathsep, '.pyc', '.so', '.sl', '.pyd') + self.present_files = set(['__init__.py']) + expected_extensions = ('.py', os.path.pathsep, '.pyc', '.so', + '.sl', '.pyd') names_to_test = (p("/spam/eggs.py"), "ni.py", p("../../shrubbery.py")) for name in names_to_test: @@ -3302,11 +3309,32 @@ self.filename = name self.unchanged("import jam") - if dirname(name): name = dirname(name) + '/jam' - else: name = 'jam' + if os.path.dirname(name): + name = os.path.dirname(name) + '/jam' + else: + name = 'jam' expected_checks = set(name + ext for ext in expected_extensions) + expected_checks.add("__init__.py") + + self.assertEqual(set(self.files_checked), expected_checks) - self.failUnlessEqual(set(self.files_checked), expected_checks) + def test_not_in_package(self): + s = "import bar" + self.always_exists = False + self.present_files = set(["bar.py"]) + self.unchanged(s) + + def test_in_package(self): + b = "import bar" + a = "from . import bar" + self.always_exists = False + self.present_files = set(["__init__.py", "bar.py"]) + self.check(b, a) + + def test_comments_and_indent(self): + b = "import bar # Foo" + a = "from . import bar # Foo" + self.check(b, a) def test_from(self): b = "from foo import bar, baz" @@ -3577,6 +3605,67 @@ self.check(b, a) +class Test_getcwdu(FixerTestCase): + + fixer = 'getcwdu' + + def test_basic(self): + b = """os.getcwdu""" + a = """os.getcwd""" + self.check(b, a) + + b = """os.getcwdu()""" + a = """os.getcwd()""" + self.check(b, a) + + b = """meth = os.getcwdu""" + a = """meth = os.getcwd""" + self.check(b, a) + + b = """os.getcwdu(args)""" + a = """os.getcwd(args)""" + self.check(b, a) + + def test_comment(self): + b = """os.getcwdu() # Foo""" + a = """os.getcwd() # Foo""" + self.check(b, a) + + def test_unchanged(self): + s = """os.getcwd()""" + self.unchanged(s) + + s = """getcwdu()""" + self.unchanged(s) + + s = """os.getcwdb()""" + self.unchanged(s) + + def test_indentation(self): + b = """ + if 1: + os.getcwdu() + """ + a = """ + if 1: + os.getcwd() + """ + self.check(b, a) + + def test_multilation(self): + b = """os .getcwdu()""" + a = """os .getcwd()""" + self.check(b, a) + + b = """os. getcwdu""" + a = """os. getcwd""" + self.check(b, a) + + b = """os.getcwdu ( )""" + a = """os.getcwd ( )""" + self.check(b, a) + + if __name__ == "__main__": import __main__ support.run_all_tests(__main__) Modified: python/branches/release26-maint/Lib/test/test_datetime.py ============================================================================== --- python/branches/release26-maint/Lib/test/test_datetime.py (original) +++ python/branches/release26-maint/Lib/test/test_datetime.py Sat Oct 4 23:33:08 2008 @@ -253,7 +253,7 @@ self.assertRaises(TypeError, lambda: a // x) self.assertRaises(TypeError, lambda: x // a) - # Divison of int by timedelta doesn't make sense. + # Division of int by timedelta doesn't make sense. # Division by zero doesn't make sense. for zero in 0, 0L: self.assertRaises(TypeError, lambda: zero // a) Modified: python/branches/release26-maint/Lib/test/test_docxmlrpc.py ============================================================================== --- python/branches/release26-maint/Lib/test/test_docxmlrpc.py (original) +++ python/branches/release26-maint/Lib/test/test_docxmlrpc.py Sat Oct 4 23:33:08 2008 @@ -9,9 +9,9 @@ PORT = None def server(evt, numrequests): - try: - serv = DocXMLRPCServer(("localhost", 0), logRequests=False) + serv = DocXMLRPCServer(("localhost", 0), logRequests=False) + try: global PORT PORT = serv.socket.getsockname()[1] Modified: python/branches/release26-maint/Mac/BuildScript/build-installer.py ============================================================================== --- python/branches/release26-maint/Mac/BuildScript/build-installer.py (original) +++ python/branches/release26-maint/Mac/BuildScript/build-installer.py Sat Oct 4 23:33:08 2008 @@ -129,8 +129,8 @@ ), dict( - name="SQLite 3.3.5", - url="http://www.sqlite.org/sqlite-3.3.5.tar.gz", + name="SQLite 3.6.3", + url="http://www.sqlite.org/sqlite-3.6.3.tar.gz", checksum='93f742986e8bc2dfa34792e16df017a6feccf3a2', configure_pre=[ '--enable-threadsafe', @@ -170,8 +170,8 @@ ), ), dict( - name="Sleepycat DB 4.4", - url="http://downloads.sleepycat.com/db-4.4.20.tar.gz", + name="Sleepycat DB 4.7.25", + url="http://download.oracle.com/berkeley-db/db-4.7.25.tar.gz", #name="Sleepycat DB 4.3.29", #url="http://downloads.sleepycat.com/db-4.3.29.tar.gz", buildDir="build_unix", @@ -585,21 +585,23 @@ version = getVersion() docdir = os.path.join(rootDir, 'pydocs') + novername = 'python-docs-html.tar.bz2' name = 'html-%s.tar.bz2'%(getFullVersion(),) sourceArchive = os.path.join(DEPSRC, name) if os.path.exists(sourceArchive): print "Using local copy of %s"%(name,) else: - print "Downloading %s"%(name,) + print "Downloading %s"%(novername,) downloadURL('http://www.python.org/ftp/python/doc/%s/%s'%( - getFullVersion(), name), sourceArchive) + getFullVersion(), novername), sourceArchive) print "Archive for %s stored as %s"%(name, sourceArchive) extractArchive(os.path.dirname(docdir), sourceArchive) + os.rename( os.path.join( - os.path.dirname(docdir), 'Python-Docs-%s'%(getFullVersion(),)), + os.path.dirname(docdir), 'python-docs-html'), docdir) @@ -1028,11 +1030,11 @@ buildPython() buildPythonDocs() fn = os.path.join(WORKDIR, "_root", "Applications", - "MacPython %s"%(getVersion(),), "Update Shell Profile.command") + "Python %s"%(getVersion(),), "Update Shell Profile.command") patchFile("scripts/postflight.patch-profile", fn) os.chmod(fn, 0755) - folder = os.path.join(WORKDIR, "_root", "Applications", "MacPython %s"%( + folder = os.path.join(WORKDIR, "_root", "Applications", "Python %s"%( getVersion(),)) os.chmod(folder, 0755) setIcon(folder, "../Icons/Python Folder.icns") Modified: python/branches/release26-maint/Modules/_codecsmodule.c ============================================================================== --- python/branches/release26-maint/Modules/_codecsmodule.c (original) +++ python/branches/release26-maint/Modules/_codecsmodule.c Sat Oct 4 23:33:08 2008 @@ -115,7 +115,7 @@ to the default encoding. errors may be given to set a different error\n\ handling scheme. Default is 'strict' meaning that encoding errors raise\n\ a ValueError. Other possible values are 'ignore' and 'replace'\n\ -as well as any other name registerd with codecs.register_error that is\n\ +as well as any other name registered with codecs.register_error that is\n\ able to handle ValueErrors."); static PyObject * Modified: python/branches/release26-maint/Modules/cjkcodecs/multibytecodec.c ============================================================================== --- python/branches/release26-maint/Modules/cjkcodecs/multibytecodec.c (original) +++ python/branches/release26-maint/Modules/cjkcodecs/multibytecodec.c Sat Oct 4 23:33:08 2008 @@ -36,7 +36,7 @@ Decodes `string' using I, an MultibyteCodec instance. errors may be given\n\ to set a different error handling scheme. Default is 'strict' meaning\n\ that encoding errors raise a UnicodeDecodeError. Other possible values\n\ -are 'ignore' and 'replace' as well as any other name registerd with\n\ +are 'ignore' and 'replace' as well as any other name registered with\n\ codecs.register_error that is able to handle UnicodeDecodeErrors."); static char *codeckwarglist[] = {"input", "errors", NULL}; Modified: python/branches/release26-maint/Objects/floatobject.c ============================================================================== --- python/branches/release26-maint/Objects/floatobject.c (original) +++ python/branches/release26-maint/Objects/floatobject.c Sat Oct 4 23:33:08 2008 @@ -1548,7 +1548,7 @@ #ifdef Py_NAN if (Py_IS_NAN(self)) { PyErr_SetString(PyExc_ValueError, - "Cannot pass nan to float.as_integer_ratio."); + "Cannot pass NaN to float.as_integer_ratio."); return NULL; } #endif @@ -1607,7 +1607,7 @@ "\n" "Returns a pair of integers, whose ratio is exactly equal to the original\n" "float and with a positive denominator.\n" -"Raises OverflowError on infinities and a ValueError on nans.\n" +"Raises OverflowError on infinities and a ValueError on NaNs.\n" "\n" ">>> (10.0).as_integer_ratio()\n" "(10, 1)\n" Modified: python/branches/release26-maint/Objects/listobject.c ============================================================================== --- python/branches/release26-maint/Objects/listobject.c (original) +++ python/branches/release26-maint/Objects/listobject.c Sat Oct 4 23:33:08 2008 @@ -2459,11 +2459,14 @@ PyDoc_STRVAR(insert_doc, "L.insert(index, object) -- insert object before index"); PyDoc_STRVAR(pop_doc, -"L.pop([index]) -> item -- remove and return item at index (default last)"); +"L.pop([index]) -> item -- remove and return item at index (default last).\n" +"Raises IndexError if list is empty or index is out of range."); PyDoc_STRVAR(remove_doc, -"L.remove(value) -- remove first occurrence of value"); +"L.remove(value) -- remove first occurrence of value.\n" +"Raises ValueError if the value is not present."); PyDoc_STRVAR(index_doc, -"L.index(value, [start, [stop]]) -> integer -- return first index of value"); +"L.index(value, [start, [stop]]) -> integer -- return first index of value.\n" +"Raises ValueError if the value is not present."); PyDoc_STRVAR(count_doc, "L.count(value) -> integer -- return number of occurrences of value"); PyDoc_STRVAR(reverse_doc, Modified: python/branches/release26-maint/Objects/setobject.c ============================================================================== --- python/branches/release26-maint/Objects/setobject.c (original) +++ python/branches/release26-maint/Objects/setobject.c Sat Oct 4 23:33:08 2008 @@ -754,7 +754,8 @@ return key; } -PyDoc_STRVAR(pop_doc, "Remove and return an arbitrary set element."); +PyDoc_STRVAR(pop_doc, "Remove and return an arbitrary set element.\n\ +Raises KeyError if the set is empty."); static int set_traverse(PySetObject *so, visitproc visit, void *arg) Modified: python/branches/release26-maint/Objects/stringobject.c ============================================================================== --- python/branches/release26-maint/Objects/stringobject.c (original) +++ python/branches/release26-maint/Objects/stringobject.c Sat Oct 4 23:33:08 2008 @@ -1591,9 +1591,9 @@ PyDoc_STRVAR(partition__doc__, "S.partition(sep) -> (head, sep, tail)\n\ \n\ -Searches for the separator sep in S, and returns the part before it,\n\ +Search for the separator sep in S, and return the part before it,\n\ the separator itself, and the part after it. If the separator is not\n\ -found, returns S and two empty strings."); +found, return S and two empty strings."); static PyObject * string_partition(PyStringObject *self, PyObject *sep_obj) @@ -1622,9 +1622,9 @@ PyDoc_STRVAR(rpartition__doc__, "S.rpartition(sep) -> (tail, sep, head)\n\ \n\ -Searches for the separator sep in S, starting at the end of S, and returns\n\ +Search for the separator sep in S, starting at the end of S, and return\n\ the part before it, the separator itself, and the part after it. If the\n\ -separator is not found, returns two empty strings and S."); +separator is not found, return two empty strings and S."); static PyObject * string_rpartition(PyStringObject *self, PyObject *sep_obj) @@ -3357,7 +3357,7 @@ to the default encoding. errors may be given to set a different error\n\ handling scheme. Default is 'strict' meaning that encoding errors raise\n\ a UnicodeDecodeError. Other possible values are 'ignore' and 'replace'\n\ -as well as any other name registerd with codecs.register_error that is\n\ +as well as any other name registered with codecs.register_error that is\n\ able to handle UnicodeDecodeErrors."); static PyObject * @@ -3506,7 +3506,7 @@ PyDoc_STRVAR(ljust__doc__, "S.ljust(width[, fillchar]) -> string\n" "\n" -"Return S left justified in a string of length width. Padding is\n" +"Return S left-justified in a string of length width. Padding is\n" "done using the specified fill character (default is a space)."); static PyObject * @@ -3530,7 +3530,7 @@ PyDoc_STRVAR(rjust__doc__, "S.rjust(width[, fillchar]) -> string\n" "\n" -"Return S right justified in a string of length width. Padding is\n" +"Return S right-justified in a string of length width. Padding is\n" "done using the specified fill character (default is a space)"); static PyObject * Modified: python/branches/release26-maint/Objects/tupleobject.c ============================================================================== --- python/branches/release26-maint/Objects/tupleobject.c (original) +++ python/branches/release26-maint/Objects/tupleobject.c Sat Oct 4 23:33:08 2008 @@ -719,7 +719,9 @@ } PyDoc_STRVAR(index_doc, -"T.index(value, [start, [stop]]) -> integer -- return first index of value"); +"T.index(value, [start, [stop]]) -> integer -- return first index of value.\n" +"Raises ValueError if the value is not present." +); PyDoc_STRVAR(count_doc, "T.count(value) -> integer -- return number of occurrences of value"); PyDoc_STRVAR(sizeof_doc, Modified: python/branches/release26-maint/Objects/unicodeobject.c ============================================================================== --- python/branches/release26-maint/Objects/unicodeobject.c (original) +++ python/branches/release26-maint/Objects/unicodeobject.c Sat Oct 4 23:33:08 2008 @@ -7070,7 +7070,7 @@ PyDoc_STRVAR(ljust__doc__, "S.ljust(width[, fillchar]) -> int\n\ \n\ -Return S left justified in a Unicode string of length width. Padding is\n\ +Return S left-justified in a Unicode string of length width. Padding is\n\ done using the specified fill character (default is a space)."); static PyObject * @@ -7456,7 +7456,7 @@ PyDoc_STRVAR(rjust__doc__, "S.rjust(width[, fillchar]) -> unicode\n\ \n\ -Return S right justified in a Unicode string of length width. Padding is\n\ +Return S right-justified in a Unicode string of length width. Padding is\n\ done using the specified fill character (default is a space)."); static PyObject * @@ -7606,9 +7606,9 @@ PyDoc_STRVAR(partition__doc__, "S.partition(sep) -> (head, sep, tail)\n\ \n\ -Searches for the separator sep in S, and returns the part before it,\n\ +Search for the separator sep in S, and return the part before it,\n\ the separator itself, and the part after it. If the separator is not\n\ -found, returns S and two empty strings."); +found, return S and two empty strings."); static PyObject* unicode_partition(PyUnicodeObject *self, PyObject *separator) @@ -7619,9 +7619,9 @@ PyDoc_STRVAR(rpartition__doc__, "S.rpartition(sep) -> (tail, sep, head)\n\ \n\ -Searches for the separator sep in S, starting at the end of S, and returns\n\ +Search for the separator sep in S, starting at the end of S, and return\n\ the part before it, the separator itself, and the part after it. If the\n\ -separator is not found, returns two empty strings and S."); +separator is not found, return two empty strings and S."); static PyObject* unicode_rpartition(PyUnicodeObject *self, PyObject *separator) Modified: python/branches/release26-maint/setup.py ============================================================================== --- python/branches/release26-maint/setup.py (original) +++ python/branches/release26-maint/setup.py Sat Oct 4 23:33:08 2008 @@ -934,7 +934,8 @@ ] sqlite_libfile = self.compiler.find_library_file( sqlite_dirs_to_check + lib_dirs, 'sqlite3') - sqlite_libdir = [os.path.abspath(os.path.dirname(sqlite_libfile))] + if sqlite_libfile: + sqlite_libdir = [os.path.abspath(os.path.dirname(sqlite_libfile))] if sqlite_incdir and sqlite_libdir: sqlite_srcs = ['_sqlite/cache.c', From g.brandl at gmx.net Sat Oct 4 23:48:11 2008 From: g.brandl at gmx.net (Georg Brandl) Date: Sat, 04 Oct 2008 23:48:11 +0200 Subject: [Python-checkins] r66799 - python/branches/release26-maint In-Reply-To: References: <20081004210612.05B041E4002@bag.python.org> Message-ID: Brett Cannon schrieb: > On Sat, Oct 4, 2008 at 2:06 PM, benjamin. peterson > wrote: >> Author: benjamin.peterson >> Date: Sat Oct 4 23:06:11 2008 >> New Revision: 66799 >> >> Log: >> Blocked revisions 66721-66722,66744-66745,66752,66756,66763-66765,66768,66791-66792 via svnmerge >> > > If we have to block every change made in 2.7 that should not be > backported that is going to get old REALLY fast. If we use svnmerge on > 2.6 I think it should only be through explicit merging of specific > revisions and never through a across-the-board merge. Which is why I would have preferred merging in the other direction. Merging only manually loses one important factor of using svnmerge in the first place: not overlooking revisions to merge. Georg -- Thus spake the Lord: Thou shalt indent with four spaces. No more, no less. Four shall be the number of spaces thou shalt indent, and the number of thy indenting shall be four. Eight shalt thou not indent, nor either indent thou two, excepting that thou then proceed to four. Tabs are right out. From python-checkins at python.org Sat Oct 4 23:51:59 2008 From: python-checkins at python.org (andrew.kuchling) Date: Sat, 4 Oct 2008 23:51:59 +0200 (CEST) Subject: [Python-checkins] r66801 - python/trunk/Objects/dictobject.c Message-ID: <20081004215159.55ED21E4002@bag.python.org> Author: andrew.kuchling Date: Sat Oct 4 23:51:59 2008 New Revision: 66801 Log: Punctuation fix; expand dict.update docstring to be clearer Modified: python/trunk/Objects/dictobject.c Modified: python/trunk/Objects/dictobject.c ============================================================================== --- python/trunk/Objects/dictobject.c (original) +++ python/trunk/Objects/dictobject.c Sat Oct 4 23:51:59 2008 @@ -2065,12 +2065,12 @@ "D.setdefault(k[,d]) -> D.get(k,d), also set D[k]=d if k not in D"); PyDoc_STRVAR(pop__doc__, -"D.pop(k[,d]) -> v, remove specified key and return the corresponding value\n\ +"D.pop(k[,d]) -> v, remove specified key and return the corresponding value.\n\ If key is not found, d is returned if given, otherwise KeyError is raised"); PyDoc_STRVAR(popitem__doc__, "D.popitem() -> (k, v), remove and return some (key, value) pair as a\n\ -2-tuple; but raise KeyError if D is empty"); +2-tuple; but raise KeyError if D is empty."); PyDoc_STRVAR(keys__doc__, "D.keys() -> list of D's keys"); @@ -2082,8 +2082,10 @@ "D.values() -> list of D's values"); PyDoc_STRVAR(update__doc__, -"D.update(E, **F) -> None. Update D from E and F: for k in E: D[k] = E[k]\n\ -(if E has keys else: for (k, v) in E: D[k] = v) then: for k in F: D[k] = F[k]"); +"D.update(E, **F) -> None. Update D from dict/iterable E and F.\n" +"If E has a .keys() method, does: for k in E: D[k] = E[k]\n\ +If E lacks .keys() method, does: for (k, v) in E: D[k] = v\n\ +In either case, this is followed by: for k in F: D[k] = F[k]"); PyDoc_STRVAR(fromkeys__doc__, "dict.fromkeys(S[,v]) -> New dict with keys from S and values equal to v.\n\ From nnorwitz at gmail.com Sat Oct 4 23:57:11 2008 From: nnorwitz at gmail.com (Neal Norwitz) Date: Sat, 4 Oct 2008 17:57:11 -0400 Subject: [Python-checkins] Python Regression Test Failures doc (1) Message-ID: <20081004215711.GA2981@python.psfb.org> svn update tools/sphinx U tools/sphinx/application.py Updated to revision 66800. svn update tools/docutils At revision 66800. svn update tools/jinja At revision 66800. svn update tools/pygments At revision 66800. mkdir -p build/html build/doctrees python tools/sphinx-build.py -b html -d build/doctrees -D latex_paper_size= . build/html Sphinx v0.5, building html loading pickled environment... done building [html]: targets for 3 source files that are out of date updating environment: [config changed] 450 added, 0 changed, 1 removed reading sources... about bugs c-api/abstract c-api/allocation c-api/arg c-api/bool c-api/buffer c-api/bytearray c-api/cell c-api/class c-api/cobject c-api/complex c-api/concrete c-api/conversion c-api/datetime c-api/descriptor c-api/dict c-api/exceptions c-api/file c-api/float c-api/function c-api/gcsupport c-api/gen c-api/import c-api/index c-api/init c-api/int c-api/intro c-api/iter c-api/iterator c-api/list c-api/long c-api/mapping c-api/marshal c-api/memory c-api/method c-api/module c-api/none c-api/number c-api/objbuffer c-api/object c-api/objimpl c-api/refcounting c-api/reflection c-api/sequence c-api/set c-api/slice c-api/string c-api/structures c-api/sys c-api/tuple c-api/type c-api/typeobj c-api/unicode c-api/utilities c-api/veryhigh c-api/weakref contents copyright distutils/apiref distutils/builtdist distutils/commandref distutils/configfile distutils/examples distutils/extending distutils/index distutils/introduction distutils/packageindex distutils/setupscript distutils/sourcedist distutils/uploading documenting/fromlatex documenting/index documenting/intro documenting/markup documenting/rest documenting/sphinx documenting/style extending/building extending/embedding extending/extending extending/index extending/newtypes extending/windows glossary howto/advocacy howto/cporting howto/curses howto/doanddont howto/functional howto/index howto/regex howto/sockets howto/unicode howto/urllib2 howto/webservers install/index library/2to3 library/__builtin__ library/__future__ library/__main__ library/_winreg library/abc library/aepack library/aetools library/aetypes library/aifc library/al library/allos library/anydbm library/archiving library/array library/ast library/asynchat library/asyncore library/atexit library/audioop library/autogil library/base64 library/basehttpserver library/bastion library/bdb library/binascii library/binhex library/bisect library/bsddb library/bz2 library/calendar library/carbon library/cd library/cgi library/cgihttpserver library/cgitb library/chunk library/cmath library/cmd library/code library/codecs library/codeop library/collections library/colorpicker library/colorsys library/commands library/compileall library/compiler library/configparser library/constants library/contextlib library/cookie library/cookielib library/copy library/copy_reg library/crypt library/crypto library/csv library/ctypes library/curses library/curses.ascii library/curses.panel library/custominterp library/datatypes library/datetime library/dbhash library/dbm library/debug library/decimal library/development library/difflib library/dircache library/dis library/distutils library/dl library/doctest library/docxmlrpcserver library/dumbdbm library/dummy_thread library/dummy_threading library/easydialogs library/email library/email-examples library/email.charset library/email.encoders library/email.errors library/email.generator library/email.header library/email.iterators library/email.message library/email.mime library/email.parser library/email.util library/errno library/exceptions library/fcntl library/filecmp library/fileformats library/fileinput library/filesys library/fl library/fm library/fnmatch library/formatter library/fpectl library/fpformat library/fractions library/framework library/frameworks library/ftplib library/functions library/functools library/future_builtins library/gc library/gdbm library/gensuitemodule library/getopt library/getpass library/gettext library/gl library/glob library/grp library/gzip library/hashlib library/heapq library/hmac library/hotshot library/htmllib library/htmlparser library/httplib library/i18n library/ic library/idle library/imageop library/imaplib library/imgfile library/imghdr library/imp library/imputil library/index library/inspect library/internet library/intro library/io library/ipc library/itertools library/jpeg library/json library/keyword library/language library/linecache library/locale library/logging library/mac library/macos library/macosa library/macostools library/macpath library/mailbox library/mailcap library/markup library/marshal library/math library/md5 library/mhlib library/mimetools library/mimetypes library/mimewriter library/mimify library/miniaeframe library/misc library/mm library/mmap library/modulefinder library/modules library/msilib library/msvcrt library/multifile library/multiprocessing library/mutex library/netdata library/netrc library/new library/nis library/nntplib library/numbers library/numeric library/objects library/operator library/optparse library/os library/os.path library/ossaudiodev library/othergui library/parser library/pdb library/persistence library/pickle library/pickletools library/pipes library/pkgutil library/platform library/plistlib library/popen2 library/poplib library/posix library/posixfile library/pprint library/profile library/pty library/pwd library/py_compile library/pyclbr library/pydoc library/pyexpat library/python library/queue library/quopri library/random library/re library/readline library/repr library/resource library/restricted library/rexec library/rfc822 library/rlcompleter library/robotparser library/runpy library/sched library/scrolledtext library/select library/sets library/sgi library/sgmllib library/sha library/shelve library/shlex library/shutil library/signal library/simplehttpserver library/simplexmlrpcserver library/site library/smtpd library/smtplib library/sndhdr library/socket library/socketserver library/someos library/spwd library/sqlite3 library/ssl library/stat library/statvfs library/stdtypes library/string library/stringio library/stringprep library/strings library/struct library/subprocess library/sun library/sunau library/sunaudio library/symbol library/symtable library/sys library/syslog library/tabnanny library/tarfile library/telnetlib library/tempfile library/termios library/test library/textwrap library/thread library/threading library/time library/timeit library/tix library/tk library/tkinter library/token library/tokenize library/trace library/traceback library/tty library/turtle library/types library/undoc library/unicodedata library/unittest library/unix library/urllib library/urllib2 library/urlparse library/user library/userdict library/uu library/uuid library/warnings library/wave library/weakref library/webbrowser library/whichdb library/windows library/winsound library/wsgiref library/xdrlib library/xml.dom library/xml.dom.minidom library/xml.dom.pulldom library/xml.etree.elementtree library/xml.sax library/xml.sax.handler library/xml.sax.reader library/xml.sax.utils library/xmlrpclib library/zipfile library/zipimport library/zlib license reference/compound_stmts reference/datamodel reference/executionmodel reference/expressions reference/grammar reference/index reference/introduction reference/lexical_analysis reference/simple_stmts reference/toplevel_components tutorial/appetite tutorial/classes tutorial/controlflow tutorial/datastructures tutorial/errors tutorial/floatingpoint tutorial/index tutorial/inputoutput tutorial/interactive tutorial/interpreter tutorial/introduction tutorial/modules tutorial/stdlib tutorial/stdlib2 tutorial/whatnow using/cmdline using/index using/mac using/unix using/windows whatsnew/2.7 pickling environment... done checking consistency... done preparing documents... done writing output... about bugs c-api/abstract c-api/allocation c-api/arg c-api/bool c-api/buffer c-api/bytearray c-api/cell c-api/class c-api/cobject c-api/complex c-api/concrete c-api/conversion c-api/datetime c-api/descriptor c-api/dict c-api/exceptions c-api/file c-api/float c-api/function c-api/gcsupport c-api/gen c-api/import c-api/index c-api/init c-api/int c-api/intro c-api/iter c-api/iterator c-api/list c-api/long c-api/mapping c-api/marshal c-api/memory c-api/method c-api/module c-api/none c-api/number c-api/objbuffer c-api/object c-api/objimpl c-api/refcounting c-api/reflection c-api/sequence c-api/set c-api/slice c-api/string c-api/structures c-api/sys c-api/tuple c-api/type c-api/typeobj c-api/unicode c-api/utilities c-api/veryhigh c-api/weakref contents copyright distutils/apiref distutils/builtdist distutils/commandref distutils/configfile distutils/examples distutils/extending distutils/index distutils/introduction distutils/packageindex distutils/setupscript distutils/sourcedist distutils/uploading documenting/fromlatex documenting/index documenting/intro documenting/markup documenting/rest documenting/sphinx documenting/style extending/building extending/embedding extending/extending extending/index extending/newtypes extending/windows glossary howto/advocacy howto/cporting howto/curses howto/doanddont howto/functional howto/index howto/regex howto/sockets howto/unicode howto/urllib2 howto/webservers install/index library/2to3 library/__builtin__ library/__future__ library/__main__ library/_winreg library/abc library/aepack library/aetools library/aetypes library/aifc library/al library/allos library/anydbm library/archiving library/array library/ast library/asynchat library/asyncore library/atexit library/audioop library/autogil library/base64 library/basehttpserver library/bastion library/bdb library/binascii library/binhex library/bisect library/bsddb library/bz2 library/calendar library/carbon library/cd library/cgi library/cgihttpserver library/cgitb library/chunk library/cmath library/cmd library/code library/codecs library/codeop library/collections library/colorpicker library/colorsys library/commands library/compileall library/compiler library/configparser library/constants library/contextlib library/cookie library/cookielib library/copy library/copy_reg library/crypt library/crypto library/csv library/ctypes library/curses library/curses.ascii library/curses.panel library/custominterp library/datatypes library/datetime library/dbhash library/dbm library/debug library/decimal library/development library/difflib library/dircache library/dis library/distutils library/dl library/doctest library/docxmlrpcserver library/dumbdbm library/dummy_thread library/dummy_threading library/easydialogs library/email library/email-examples library/email.charset library/email.encoders library/email.errors library/email.generator library/email.header library/email.iterators library/email.message library/email.mime library/email.parser library/email.util library/errno library/exceptions library/fcntl library/filecmp library/fileformats library/fileinput library/filesys library/fl library/fm library/fnmatch library/formatter library/fpectl library/fpformat library/fractions library/framework library/frameworks library/ftplib library/functions library/functools library/future_builtins library/gc library/gdbm library/gensuitemodule library/getopt library/getpass library/gettext library/gl library/glob library/grp library/gzip library/hashlib library/heapq library/hmac library/hotshot library/htmllib library/htmlparser library/httplib library/i18n library/ic library/idle library/imageop library/imaplib library/imgfile library/imghdr library/imp library/imputil library/index library/inspect library/internet library/intro library/io library/ipc library/itertools library/jpeg library/json library/keyword library/language library/linecache library/locale library/logging library/mac library/macos library/macosa library/macostools library/macpath library/mailbox library/mailcap library/markup library/marshal library/math library/md5 library/mhlib library/mimetools library/mimetypes library/mimewriter library/mimify library/miniaeframe library/misc library/mm library/mmap library/modulefinder library/modules library/msilib library/msvcrt library/multifile library/multiprocessing library/mutex library/netdata library/netrc library/new library/nis library/nntplib library/numbers library/numeric library/objects library/operator library/optparse library/os library/os.path library/ossaudiodev library/othergui library/parser library/pdb library/persistence library/pickle library/pickletools library/pipes library/pkgutil library/platform library/plistlib library/popen2 library/poplib library/posix library/posixfile library/pprint library/profile library/pty library/pwd library/py_compile library/pyclbr library/pydoc library/pyexpat library/python library/queue library/quopri library/random library/re library/readline library/repr library/resource library/restricted library/rexec library/rfc822 library/rlcompleter library/robotparser library/runpy library/sched library/scrolledtext library/select library/sets library/sgi library/sgmllib library/sha library/shelve library/shlex library/shutil library/signal library/simplehttpserver library/simplexmlrpcserver library/site library/smtpd library/smtplib library/sndhdr library/socket library/socketserver library/someos library/spwd library/sqlite3 library/ssl library/stat library/statvfs library/stdtypes library/string library/stringio library/stringprep library/strings library/struct library/subprocess library/sun library/sunau library/sunaudio library/symbol library/symtable library/sys library/syslog library/tabnanny library/tarfile library/telnetlib library/tempfile library/termios library/test library/textwrap library/thread library/threading library/time library/timeit library/tix library/tk library/tkinter library/token library/tokenize library/trace library/traceback library/tty library/turtle library/types library/undoc library/unicodedata library/unittest library/unix library/urllib library/urllib2 library/urlparse library/user library/userdict library/uu library/uuid library/warnings library/wave library/weakref library/webbrowser library/whichdb library/windows library/winsound library/wsgiref library/xdrlib library/xml.dom library/xml.dom.minidom library/xml.dom.pulldom library/xml.etree.elementtree library/xml.sax library/xml.sax.handler library/xml.sax.reader library/xml.sax.utils library/xmlrpclib library/zipfile library/zipimport library/zlib license reference/compound_stmts reference/datamodel reference/executionmodel reference/expressions reference/grammar reference/index reference/introduction reference/lexical_analysis reference/simple_stmts reference/toplevel_components tutorial/appetite tutorial/classes tutorial/controlflow tutorial/datastructures tutorial/errors tutorial/floatingpoint tutorial/index tutorial/inputoutput tutorial/interactive tutorial/interpreter tutorial/introduction tutorial/modules tutorial/stdlib tutorial/stdlib2 tutorial/whatnow using/cmdline using/index using/mac using/unix using/windows whatsnew/2.6 Exception occurred: File "/home/neal/python/trunk/Doc/tools/sphinx/environment.py", line 747, in get_toc_for toc = self.tocs[docname].deepcopy() KeyError: 'whatsnew/2.6' The full traceback has been saved in /tmp/sphinx-err-3LGF3G.log, if you want to report the issue to the author. Please also report this if it was a user error, so that a better error message can be provided next time. Send reports to sphinx-dev at googlegroups.com. Thanks! make: *** [build] Error 1 From buildbot at python.org Sun Oct 5 00:09:34 2008 From: buildbot at python.org (buildbot at python.org) Date: Sat, 04 Oct 2008 22:09:34 +0000 Subject: [Python-checkins] buildbot failure in PPC64 Debian 3.0 Message-ID: <20081004220934.43C101E4002@bag.python.org> The Buildbot has detected a new failure of PPC64 Debian 3.0. Full details are available at: http://www.python.org/dev/buildbot/all/PPC64%20Debian%203.0/builds/1724 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-debian-ppc64 Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: benjamin.peterson,georg.brandl BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_smtplib make: *** [buildbottest] Error 1 sincerely, -The Buildbot From python-checkins at python.org Sun Oct 5 00:15:32 2008 From: python-checkins at python.org (benjamin.peterson) Date: Sun, 5 Oct 2008 00:15:32 +0200 (CEST) Subject: [Python-checkins] r66803 - python/trunk/Doc/library/ftplib.rst Message-ID: <20081004221532.3EF761E4002@bag.python.org> Author: benjamin.peterson Date: Sun Oct 5 00:15:31 2008 New Revision: 66803 Log: fix typo Modified: python/trunk/Doc/library/ftplib.rst Modified: python/trunk/Doc/library/ftplib.rst ============================================================================== --- python/trunk/Doc/library/ftplib.rst (original) +++ python/trunk/Doc/library/ftplib.rst Sun Oct 5 00:15:31 2008 @@ -315,7 +315,7 @@ .. method:: FTP.quit() Send a ``QUIT`` command to the server and close the connection. This is the - "polite" way to close a connection, but it may raise an exception of the server + "polite" way to close a connection, but it may raise an exception if the server responds with an error to the ``QUIT`` command. This implies a call to the :meth:`close` method which renders the :class:`FTP` instance useless for subsequent calls (see below). From brett at python.org Sun Oct 5 00:41:06 2008 From: brett at python.org (Brett Cannon) Date: Sat, 4 Oct 2008 15:41:06 -0700 Subject: [Python-checkins] r66799 - python/branches/release26-maint In-Reply-To: References: <20081004210612.05B041E4002@bag.python.org> Message-ID: On Sat, Oct 4, 2008 at 2:48 PM, Georg Brandl wrote: > Brett Cannon schrieb: >> On Sat, Oct 4, 2008 at 2:06 PM, benjamin. peterson >> wrote: >>> Author: benjamin.peterson >>> Date: Sat Oct 4 23:06:11 2008 >>> New Revision: 66799 >>> >>> Log: >>> Blocked revisions 66721-66722,66744-66745,66752,66756,66763-66765,66768,66791-66792 via svnmerge >>> >> >> If we have to block every change made in 2.7 that should not be >> backported that is going to get old REALLY fast. If we use svnmerge on >> 2.6 I think it should only be through explicit merging of specific >> revisions and never through a across-the-board merge. > > Which is why I would have preferred merging in the other direction. > > Merging only manually loses one important factor of using svnmerge in the > first place: not overlooking revisions to merge. > Going the other direction works for me. Makes sense to have the changes percolate up the versions. -Brett From musiccomposition at gmail.com Sun Oct 5 00:44:17 2008 From: musiccomposition at gmail.com (Benjamin Peterson) Date: Sat, 4 Oct 2008 17:44:17 -0500 Subject: [Python-checkins] r66799 - python/branches/release26-maint In-Reply-To: References: <20081004210612.05B041E4002@bag.python.org> Message-ID: <1afaf6160810041544x6a3bd4b9q6dad6a5620add0b5@mail.gmail.com> On Sat, Oct 4, 2008 at 5:41 PM, Brett Cannon wrote: > On Sat, Oct 4, 2008 at 2:48 PM, Georg Brandl wrote: >> Brett Cannon schrieb: >>> On Sat, Oct 4, 2008 at 2:06 PM, benjamin. peterson >>> wrote: >>>> Author: benjamin.peterson >>>> Date: Sat Oct 4 23:06:11 2008 >>>> New Revision: 66799 >>>> >>>> Log: >>>> Blocked revisions 66721-66722,66744-66745,66752,66756,66763-66765,66768,66791-66792 via svnmerge >>>> >>> >>> If we have to block every change made in 2.7 that should not be >>> backported that is going to get old REALLY fast. If we use svnmerge on >>> 2.6 I think it should only be through explicit merging of specific >>> revisions and never through a across-the-board merge. >> >> Which is why I would have preferred merging in the other direction. >> >> Merging only manually loses one important factor of using svnmerge in the >> first place: not overlooking revisions to merge. >> > > Going the other direction works for me. Makes sense to have the > changes percolate up the versions. The problem with that is it makes blocking individual revisions for the py3k branch very hard. -- Cheers, Benjamin Peterson "There's nothing quite as beautiful as an oboe... except a chicken stuck in a vacuum cleaner." From brett at python.org Sun Oct 5 00:46:23 2008 From: brett at python.org (Brett Cannon) Date: Sat, 4 Oct 2008 15:46:23 -0700 Subject: [Python-checkins] r66799 - python/branches/release26-maint In-Reply-To: <1afaf6160810041544x6a3bd4b9q6dad6a5620add0b5@mail.gmail.com> References: <20081004210612.05B041E4002@bag.python.org> <1afaf6160810041544x6a3bd4b9q6dad6a5620add0b5@mail.gmail.com> Message-ID: On Sat, Oct 4, 2008 at 3:44 PM, Benjamin Peterson wrote: > On Sat, Oct 4, 2008 at 5:41 PM, Brett Cannon wrote: >> On Sat, Oct 4, 2008 at 2:48 PM, Georg Brandl wrote: >>> Brett Cannon schrieb: >>>> On Sat, Oct 4, 2008 at 2:06 PM, benjamin. peterson >>>> wrote: >>>>> Author: benjamin.peterson >>>>> Date: Sat Oct 4 23:06:11 2008 >>>>> New Revision: 66799 >>>>> >>>>> Log: >>>>> Blocked revisions 66721-66722,66744-66745,66752,66756,66763-66765,66768,66791-66792 via svnmerge >>>>> >>>> >>>> If we have to block every change made in 2.7 that should not be >>>> backported that is going to get old REALLY fast. If we use svnmerge on >>>> 2.6 I think it should only be through explicit merging of specific >>>> revisions and never through a across-the-board merge. >>> >>> Which is why I would have preferred merging in the other direction. >>> >>> Merging only manually loses one important factor of using svnmerge in the >>> first place: not overlooking revisions to merge. >>> >> >> Going the other direction works for me. Makes sense to have the >> changes percolate up the versions. > > The problem with that is it makes blocking individual revisions for > the py3k branch very hard. > How so? Can't you just block the revision that handled the merge to the trunk? Or are you worried about the properties on '.' being merged? -Brett From g.brandl at gmx.net Sun Oct 5 00:46:44 2008 From: g.brandl at gmx.net (Georg Brandl) Date: Sun, 05 Oct 2008 00:46:44 +0200 Subject: [Python-checkins] r66799 - python/branches/release26-maint In-Reply-To: <1afaf6160810041544x6a3bd4b9q6dad6a5620add0b5@mail.gmail.com> References: <20081004210612.05B041E4002@bag.python.org> <1afaf6160810041544x6a3bd4b9q6dad6a5620add0b5@mail.gmail.com> Message-ID: Benjamin Peterson schrieb: >>> Which is why I would have preferred merging in the other direction. >>> >>> Merging only manually loses one important factor of using svnmerge in the >>> first place: not overlooking revisions to merge. >>> >> >> Going the other direction works for me. Makes sense to have the >> changes percolate up the versions. > > The problem with that is it makes blocking individual revisions for > the py3k branch very hard. Well, they can be merged to trunk in a separate svnmerge commit. Since they shouldn't occur too often, this isn't as tiresome as the blocking used now. Georg -- Thus spake the Lord: Thou shalt indent with four spaces. No more, no less. Four shall be the number of spaces thou shalt indent, and the number of thy indenting shall be four. Eight shalt thou not indent, nor either indent thou two, excepting that thou then proceed to four. Tabs are right out. From g.brandl at gmx.net Sun Oct 5 00:49:45 2008 From: g.brandl at gmx.net (Georg Brandl) Date: Sun, 05 Oct 2008 00:49:45 +0200 Subject: [Python-checkins] r66799 - python/branches/release26-maint In-Reply-To: References: <20081004210612.05B041E4002@bag.python.org> <1afaf6160810041544x6a3bd4b9q6dad6a5620add0b5@mail.gmail.com> Message-ID: Brett Cannon schrieb: >>> Going the other direction works for me. Makes sense to have the >>> changes percolate up the versions. >> >> The problem with that is it makes blocking individual revisions for >> the py3k branch very hard. >> > > How so? Can't you just block the revision that handled the merge to > the trunk? Or are you worried about the properties on '.' being > merged? The issue is that a merge of an arbitrary number of commits on 2.6 forms a single commit on trunk. If there are commits among them that should have been blocked for 3k, this isn't possible. But as I said, this shouldn't occur too often, and if it does it can either be ignored (in the case of e.g. changes to 3k-removed modules) or merged separately to form a blockable revision on trunk. Georg -- Thus spake the Lord: Thou shalt indent with four spaces. No more, no less. Four shall be the number of spaces thou shalt indent, and the number of thy indenting shall be four. Eight shalt thou not indent, nor either indent thou two, excepting that thou then proceed to four. Tabs are right out. From martin at v.loewis.de Sun Oct 5 01:01:39 2008 From: martin at v.loewis.de (=?ISO-8859-1?Q?=22Martin_v=2E_L=F6wis=22?=) Date: Sun, 05 Oct 2008 01:01:39 +0200 Subject: [Python-checkins] r66799 - python/branches/release26-maint In-Reply-To: References: <20081004210612.05B041E4002@bag.python.org> <1afaf6160810041544x6a3bd4b9q6dad6a5620add0b5@mail.gmail.com> Message-ID: <48E7F5D3.4030208@v.loewis.de> > The issue is that a merge of an arbitrary number of commits on 2.6 forms a > single commit on trunk. If there are commits among them that should have > been blocked for 3k, this isn't possible. > > But as I said, this shouldn't occur too often, and if it does it can either > be ignored (in the case of e.g. changes to 3k-removed modules) or merged > separately to form a blockable revision on trunk. I would advise against merging changes from the 2.6 branch to the trunk. With such setup, 2.6 won't see many bug fixes, as all the bug fixes committed to the trunk won't be merged at all. Regards, Martin From buildbot at python.org Sun Oct 5 01:03:28 2008 From: buildbot at python.org (buildbot at python.org) Date: Sat, 04 Oct 2008 23:03:28 +0000 Subject: [Python-checkins] buildbot failure in x86 W2k8 3.0 Message-ID: <20081004230328.415E71E4002@bag.python.org> The Buildbot has detected a new failure of x86 W2k8 3.0. Full details are available at: http://www.python.org/dev/buildbot/all/x86%20W2k8%203.0/builds/318 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: nelson-windows Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: benjamin.peterson BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_threadedtempfile sincerely, -The Buildbot From buildbot at python.org Sun Oct 5 01:13:29 2008 From: buildbot at python.org (buildbot at python.org) Date: Sat, 04 Oct 2008 23:13:29 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.0 Message-ID: <20081004231329.39F191E4002@bag.python.org> The Buildbot has detected a new failure of sparc solaris10 gcc 3.0. Full details are available at: http://www.python.org/dev/buildbot/all/sparc%20solaris10%20gcc%203.0/builds/633 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: loewis-sun Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: benjamin.peterson,georg.brandl BUILD FAILED: failed test Excerpt from the test logfile: 2 tests failed: test_distutils test_posix ====================================================================== FAIL: test_get_python_inc (distutils.tests.test_sysconfig.SysconfigTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/distutils/tests/test_sysconfig.py", line 43, in test_get_python_inc self.assert_(os.path.isdir(inc_dir), inc_dir) AssertionError: /home2/buildbot/slave/3.0.loewis-sun/build/@test.getcwd/Include ====================================================================== ERROR: test_getcwd_long_pathnames (test.test_posix.PosixTester) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/test/test_posix.py", line 252, in test_getcwd_long_pathnames support.rmtree(base_path) File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/test/support.py", line 98, in rmtree shutil.rmtree(path) File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/shutil.py", line 225, in rmtree onerror(os.rmdir, path, sys.exc_info()) File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/shutil.py", line 223, in rmtree os.rmdir(path) OSError: [Errno 22] Invalid argument: '/home2/buildbot/slave/3.0.loewis-sun/build/@test.getcwd/@test.getcwd' sincerely, -The Buildbot From python-checkins at python.org Sun Oct 5 02:11:57 2008 From: python-checkins at python.org (andrew.kuchling) Date: Sun, 5 Oct 2008 02:11:57 +0200 (CEST) Subject: [Python-checkins] r66804 - python/trunk/Lib/optparse.py Message-ID: <20081005001157.21BDB1E4002@bag.python.org> Author: andrew.kuchling Date: Sun Oct 5 02:11:56 2008 New Revision: 66804 Log: #1415508 from Rocky Bernstein: add docstrings for enable_interspersed_args(), disable_interspersed_args() Modified: python/trunk/Lib/optparse.py Modified: python/trunk/Lib/optparse.py ============================================================================== --- python/trunk/Lib/optparse.py (original) +++ python/trunk/Lib/optparse.py Sun Oct 5 02:11:56 2008 @@ -1274,9 +1274,19 @@ self.usage = usage def enable_interspersed_args(self): + """Set parsing to not stop on the first non-option, allowing + interspersing switches with command arguments. This is the + default behavior. See also disable_interspersed_args() and the + class documentation description of the attribute + allow_interspersed_args.""" self.allow_interspersed_args = True def disable_interspersed_args(self): + """Set parsing to stop on the first non-option. Use this if + you have a command processor which runs another command that + has options of its own and you want to make sure these options + don't get confused. + """ self.allow_interspersed_args = False def set_process_default_values(self, process): From python-checkins at python.org Sun Oct 5 03:11:03 2008 From: python-checkins at python.org (benjamin.peterson) Date: Sun, 5 Oct 2008 03:11:03 +0200 (CEST) Subject: [Python-checkins] r66805 - sandbox/trunk/2to3/lib2to3/tests/data/README Message-ID: <20081005011103.34DB61E401F@bag.python.org> Author: benjamin.peterson Date: Sun Oct 5 03:11:02 2008 New Revision: 66805 Log: mention what the fixes directory is for Modified: sandbox/trunk/2to3/lib2to3/tests/data/README Modified: sandbox/trunk/2to3/lib2to3/tests/data/README ============================================================================== --- sandbox/trunk/2to3/lib2to3/tests/data/README (original) +++ sandbox/trunk/2to3/lib2to3/tests/data/README Sun Oct 5 03:11:02 2008 @@ -1,5 +1,6 @@ -Files in this directory: +In this directory: - py2_test_grammar.py -- test file that exercises most/all of Python 2.x's grammar. - py3_test_grammar.py -- test file that exercises most/all of Python 3.x's grammar. - infinite_recursion.py -- test file that causes lib2to3's faster recursive pattern matching scheme to fail, but passes when lib2to3 falls back to iterative pattern matching. +- fixes/ -- for use by test_refactor.py From nnorwitz at gmail.com Sun Oct 5 07:22:53 2008 From: nnorwitz at gmail.com (Neal Norwitz) Date: Sun, 5 Oct 2008 01:22:53 -0400 Subject: [Python-checkins] Python Regression Test Failures doc dist (1) Message-ID: <20081005052253.GA13998@python.psfb.org> rm -rf dist mkdir -p dist # archive the HTML make html make[1]: Entering directory `/home/neal/python/r26/Doc' mkdir -p build/html build/doctrees python tools/sphinx-build.py -b html -d build/doctrees -D latex_paper_size= . build/html Sphinx v0.5, building html loading pickled environment... done building [html]: targets for 0 source files that are out of date updating environment: 0 added, 0 changed, 0 removed no targets are out of date. Build finished. The HTML pages are in build/html. make[1]: Leaving directory `/home/neal/python/r26/Doc' cp -pPR build/html dist/python-docs-html tar -C dist -cf dist/python-docs-html.tar python-docs-html bzip2 -9 -k dist/python-docs-html.tar (cd dist; zip -q -r -9 python-docs-html.zip python-docs-html) rm -r dist/python-docs-html rm dist/python-docs-html.tar # archive the text build make text make[1]: Entering directory `/home/neal/python/r26/Doc' mkdir -p build/text build/doctrees python tools/sphinx-build.py -b text -d build/doctrees -D latex_paper_size= . build/text Sphinx v0.5, building text loading pickled environment... done building [text]: targets for 2 source files that are out of date updating environment: 0 added, 0 changed, 0 removed preparing documents... done writing output... contents library/functions library/index whatsnew/2.6 build succeeded. Build finished; the text files are in build/text. make[1]: Leaving directory `/home/neal/python/r26/Doc' cp -pPR build/text dist/python-docs-text tar -C dist -cf dist/python-docs-text.tar python-docs-text bzip2 -9 -k dist/python-docs-text.tar (cd dist; zip -q -r -9 python-docs-text.zip python-docs-text) rm -r dist/python-docs-text rm dist/python-docs-text.tar # archive the A4 latex rm -r build/latex make latex PAPER=a4 make[1]: Entering directory `/home/neal/python/r26/Doc' mkdir -p build/latex build/doctrees python tools/sphinx-build.py -b latex -d build/doctrees -D latex_paper_size=a4 . build/latex Sphinx v0.5, building latex loading pickled environment... done building [latex]: all documents updating environment: 0 added, 0 changed, 0 removed processing c-api.tex... c-api/index c-api/intro c-api/veryhigh c-api/refcounting c-api/exceptions c-api/utilities c-api/sys c-api/import c-api/marshal c-api/arg c-api/conversion c-api/reflection c-api/abstract c-api/object c-api/number c-api/sequence c-api/mapping c-api/iter c-api/objbuffer c-api/concrete c-api/type c-api/none c-api/int c-api/bool c-api/long c-api/float c-api/complex c-api/bytearray c-api/string c-api/unicode c-api/buffer c-api/tuple c-api/list c-api/dict c-api/class c-api/function c-api/method c-api/file c-api/module c-api/iterator c-api/descriptor c-api/slice c-api/weakref c-api/cobject c-api/cell c-api/gen c-api/datetime c-api/set c-api/init c-api/memory c-api/objimpl c-api/allocation c-api/structures c-api/typeobj c-api/gcsupport resolving references... writing... done processing distutils.tex... distutils/index distutils/introduction distutils/setupscript distutils/configfile distutils/sourcedist distutils/builtdist distutils/packageindex distutils/uploading distutils/examples distutils/extending distutils/commandref distutils/apiref resolving references... writing... done processing documenting.tex... documenting/index documenting/intro documenting/style documenting/rest documenting/markup documenting/fromlatex documenting/sphinx resolving references... writing... done processing extending.tex... extending/index extending/extending extending/newtypes extending/building extending/windows extending/embedding resolving references... writing... done processing install.tex... install/index resolving references... writing... done processing library.tex... library/index library/intro library/functions library/constants library/objects library/stdtypes library/exceptions library/strings library/string library/re library/struct library/difflib library/stringio library/textwrap library/codecs library/unicodedata library/stringprep library/fpformat library/datatypes library/datetime library/calendar library/collections library/heapq library/bisect library/array library/sets library/sched library/mutex library/queue library/weakref library/userdict library/types library/new library/copy library/pprint library/repr library/numeric library/numbers library/math library/cmath library/decimal library/fractions library/random library/itertools library/functools library/operator library/filesys library/os.path library/fileinput library/stat library/statvfs library/filecmp library/tempfile library/glob library/fnmatch library/linecache library/shutil library/dircache library/macpath library/persistence library/pickle library/copy_reg library/shelve library/marshal library/anydbm library/whichdb library/dbm library/gdbm library/dbhash library/bsddb library/dumbdbm library/sqlite3 library/archiving library/zlib library/gzip library/bz2 library/zipfile library/tarfile library/fileformats library/csv library/configparser library/robotparser library/netrc library/xdrlib library/plistlib library/crypto library/hashlib library/hmac library/md5 library/sha library/allos library/os library/io library/time library/optparse library/getopt library/logging library/getpass library/curses library/curses.ascii library/curses.panel library/platform library/errno library/ctypes library/someos library/select library/threading library/thread library/dummy_threading library/dummy_thread library/multiprocessing library/mmap library/readline library/rlcompleter library/ipc library/subprocess library/socket library/ssl library/signal library/popen2 library/asyncore library/asynchat library/netdata library/email library/email.message library/email.parser library/email.generator library/email.mime library/email.header library/email.charset library/email.encoders library/email.errors library/email.util library/email.iterators library/email-examples library/json library/mailcap library/mailbox library/mhlib library/mimetools library/mimetypes library/mimewriter library/mimify library/multifile library/rfc822 library/base64 library/binhex library/binascii library/quopri library/uu library/markup library/htmlparser library/sgmllib library/htmllib library/pyexpat library/xml.dom library/xml.dom.minidom library/xml.dom.pulldom library/xml.sax library/xml.sax.handler library/xml.sax.utils library/xml.sax.reader library/xml.etree.elementtree library/internet library/webbrowser library/cgi library/cgitb library/wsgiref library/urllib library/urllib2 library/httplib library/ftplib library/poplib library/imaplib library/nntplib library/smtplib library/smtpd library/telnetlib library/uuid library/urlparse library/socketserver library/basehttpserver library/simplehttpserver library/cgihttpserver library/cookielib library/cookie library/xmlrpclib library/simplexmlrpcserver library/docxmlrpcserver library/mm library/audioop library/imageop library/aifc library/sunau library/wave library/chunk library/colorsys library/imghdr library/sndhdr library/ossaudiodev library/i18n library/gettext library/locale library/frameworks library/cmd library/shlex library/tk library/tkinter library/tix library/scrolledtext library/turtle library/idle library/othergui library/development library/pydoc library/doctest library/unittest library/2to3 library/test library/debug library/bdb library/pdb library/profile library/hotshot library/timeit library/trace library/python library/sys library/__builtin__ library/future_builtins library/__main__ library/warnings library/contextlib library/abc library/atexit library/traceback library/__future__ library/gc library/inspect library/site library/user library/fpectl library/custominterp library/code library/codeop library/restricted library/rexec library/bastion library/modules library/imp library/imputil library/zipimport library/pkgutil library/modulefinder library/runpy library/language library/parser library/ast library/symtable library/symbol library/token library/keyword library/tokenize library/tabnanny library/pyclbr library/py_compile library/compileall library/dis library/pickletools library/distutils library/compiler library/misc library/formatter library/windows library/msilib library/msvcrt library/_winreg library/winsound library/unix library/posix library/pwd library/spwd library/grp library/crypt library/dl library/termios library/tty library/pty library/fcntl library/pipes library/posixfile library/resource library/nis library/syslog library/commands library/mac library/ic library/macos library/macostools library/easydialogs library/framework library/autogil library/carbon library/colorpicker library/macosa library/gensuitemodule library/aetools library/aepack library/aetypes library/miniaeframe library/sgi library/al library/cd library/fl library/fm library/gl library/imgfile library/jpeg library/sun library/sunaudio library/undoc resolving references... writing... done processing reference.tex... reference/index reference/introduction reference/lexical_analysis reference/datamodel reference/executionmodel reference/expressions reference/simple_stmts reference/compound_stmts reference/toplevel_components reference/grammar resolving references... writing... done processing tutorial.tex... tutorial/index tutorial/appetite tutorial/interpreter tutorial/introduction tutorial/controlflow tutorial/datastructures tutorial/modules tutorial/inputoutput tutorial/errors tutorial/classes tutorial/stdlib tutorial/stdlib2 tutorial/whatnow tutorial/interactive tutorial/floatingpoint resolving references... writing... done processing using.tex... using/index using/cmdline using/unix using/windows using/mac resolving references... writing... done processing whatsnew.tex... whatsnew/2.6 resolving references... writing... done processing howto-doanddont.tex... howto/doanddont resolving references... writing... done processing howto-advocacy.tex... howto/advocacy resolving references... writing... done processing howto-functional.tex... howto/functional resolving references... writing... done processing howto-regex.tex... howto/regex resolving references... writing... done processing howto-sockets.tex... howto/sockets resolving references... writing... done processing howto-urllib2.tex... howto/urllib2 resolving references... writing... done processing howto-webservers.tex... howto/webservers resolving references... writing... done processing howto-curses.tex... howto/curses resolving references... writing... done processing howto-cporting.tex... howto/cporting resolving references... writing... done processing howto-unicode.tex... howto/unicode resolving references... writing... done copying TeX support files... done build succeeded. Build finished; the LaTeX files are in build/latex. Run `make all-pdf' or `make all-ps' in that directory to run these through (pdf)latex. make[1]: Leaving directory `/home/neal/python/r26/Doc' (cd build/latex; make clean && make all-pdf && make FMT=pdf zip bz2) make[1]: Entering directory `/home/neal/python/r26/Doc/build/latex' rm -f *.pdf *.dvi *.ps rm -f *.log *.ind *.aux *.toc *.syn *.idx *.out *.ilg *.pla make[1]: Leaving directory `/home/neal/python/r26/Doc/build/latex' make[1]: Entering directory `/home/neal/python/r26/Doc/build/latex' pdflatex 'c-api.tex' This is pdfTeX, Version 3.14159-1.10b (Web2C 7.4.5) (./c-api.tex{/usr/share/texmf/pdftex/config/pdftex.cfg} LaTeX2e <2001/06/01> Babel and hyphenation patterns for american, french, german, ngerman, n ohyphenation, loaded. (./manual.cls Document Class: manual 2008/09/12 Document class (Sphinx manual) (/usr/share/texmf/tex/latex/misc/fancybox.sty Style option: `fancybox' v1.3 <2000/09/19> (tvz) ) (/usr/share/texmf/tex/latex/base/report.cls Document Class: report 2001/04/21 v1.4e Standard LaTeX document class (/usr/share/texmf/tex/latex/base/size10.clo)) (./sphinx.sty (/usr/share/texmf/tex/latex/base/textcomp.sty (/usr/share/texmf/tex/latex/base/ts1enc.def)) (/usr/share/texmf/tex/latex/fancyvrb/fancyvrb.sty Style option: `fancyvrb' v2.7, with DG/SPQR fixes <2000/03/21> (tvz) (/usr/share/texmf/tex/latex/graphics/keyval.sty)) (/usr/share/texmf/tex/latex/fancyhdr/fancyhdr.sty) (/usr/share/texmf/tex/latex/titlesec/titlesec.sty) (./tabulary.sty (/usr/share/texmf/tex/latex/tools/array.sty)) (/usr/share/texmf/tex/latex/amsmath/amsmath.sty For additional information on amsmath, use the `?' option. (/usr/share/texmf/tex/latex/amsmath/amstext.sty (/usr/share/texmf/tex/latex/amsmath/amsgen.sty)) (/usr/share/texmf/tex/latex/amsmath/amsbsy.sty) (/usr/share/texmf/tex/latex/amsmath/amsopn.sty)) (/usr/share/texmf/tex/latex/graphics/color.sty (/usr/share/texmf/tex/latex/config/color.cfg) (/usr/share/texmf/tex/latex/graphics/pdftex.def)) (/usr/share/texmf/tex/latex/hyperref/hyperref.sty (/usr/share/texmf/tex/latex/hyperref/pd1enc.def) (/usr/share/texmf/tex/latex/config/hyperref.cfg) Implicit mode ON; LaTeX internals redefined (/usr/share/texmf/tex/latex/html/url.sty)) *hyperref using default driver hpdftex* (/usr/share/texmf/tex/latex/hyperref/hpdftex.def (/usr/share/texmf/tex/latex/psnfss/pifont.sty (/usr/share/texmf/tex/latex/psnfss/upzd.fd) (/usr/share/texmf/tex/latex/psnfss/upsy.fd))) (/usr/share/texmf/tex/latex/misc/framed.sty) (/usr/share/texmf/tex/latex/graphics/graphicx.sty (/usr/share/texmf/tex/latex/graphics/graphics.sty (/usr/share/texmf/tex/latex/graphics/trig.sty) (/usr/share/texmf/tex/latex/config/graphics.cfg))) (/usr/share/texmf/pdftex/plain/misc/pdfcolor.tex)) (/usr/share/texmf/tex/latex/base/makeidx.sty)) (/usr/share/texmf/tex/latex/base/inputenc.sty ! LaTeX Error: File `utf8.def' not found. Type X to quit or to proceed, or enter new name. (Default extension: def) Enter file name: ! Emergency stop. l.118 \endinput ^^M No pages of output. Transcript written on c-api.log. make[1]: *** [c-api.pdf] Error 1 make[1]: Leaving directory `/home/neal/python/r26/Doc/build/latex' make: *** [dist] Error 2 From g.brandl at gmx.net Sun Oct 5 09:25:32 2008 From: g.brandl at gmx.net (Georg Brandl) Date: Sun, 05 Oct 2008 09:25:32 +0200 Subject: [Python-checkins] r66799 - python/branches/release26-maint In-Reply-To: <48E7F5D3.4030208@v.loewis.de> References: <20081004210612.05B041E4002@bag.python.org> <1afaf6160810041544x6a3bd4b9q6dad6a5620add0b5@mail.gmail.com> <48E7F5D3.4030208@v.loewis.de> Message-ID: Martin v. L?wis schrieb: >> The issue is that a merge of an arbitrary number of commits on 2.6 forms a >> single commit on trunk. If there are commits among them that should have >> been blocked for 3k, this isn't possible. >> >> But as I said, this shouldn't occur too often, and if it does it can either >> be ignored (in the case of e.g. changes to 3k-removed modules) or merged >> separately to form a blockable revision on trunk. > > I would advise against merging changes from the 2.6 branch to the trunk. > With such setup, 2.6 won't see many bug fixes, as all the bug fixes > committed to the trunk won't be merged at all. They would all need to be committed to 2.6, of course. But I see the danger of people not remembering that... Georg -- Thus spake the Lord: Thou shalt indent with four spaces. No more, no less. Four shall be the number of spaces thou shalt indent, and the number of thy indenting shall be four. Eight shalt thou not indent, nor either indent thou two, excepting that thou then proceed to four. Tabs are right out. From martin at v.loewis.de Sun Oct 5 10:58:01 2008 From: martin at v.loewis.de (=?ISO-8859-1?Q?=22Martin_v=2E_L=F6wis=22?=) Date: Sun, 05 Oct 2008 10:58:01 +0200 Subject: [Python-checkins] r66799 - python/branches/release26-maint In-Reply-To: References: <20081004210612.05B041E4002@bag.python.org> <1afaf6160810041544x6a3bd4b9q6dad6a5620add0b5@mail.gmail.com> <48E7F5D3.4030208@v.loewis.de> Message-ID: <48E88199.8020201@v.loewis.de> > They would all need to be committed to 2.6, of course. But I see the danger of > people not remembering that... It's not so much about forgetting it, but of not caring. It's more work: it requires a 2.6 checkout, it requires mastership of svnmerge, you have to run the tests twice. So some people won't port across the branches, regardless of what the setup is. If 2.7 is to be released a year from now, it may not even be worth it. Regards, Martin From g.brandl at gmx.net Sun Oct 5 11:11:08 2008 From: g.brandl at gmx.net (Georg Brandl) Date: Sun, 05 Oct 2008 11:11:08 +0200 Subject: [Python-checkins] r66799 - python/branches/release26-maint In-Reply-To: <48E88199.8020201@v.loewis.de> References: <20081004210612.05B041E4002@bag.python.org> <1afaf6160810041544x6a3bd4b9q6dad6a5620add0b5@mail.gmail.com> <48E7F5D3.4030208@v.loewis.de> <48E88199.8020201@v.loewis.de> Message-ID: Martin v. L?wis schrieb: >> They would all need to be committed to 2.6, of course. But I see the danger of >> people not remembering that... > > It's not so much about forgetting it, but of not caring. It's more work: > it requires a 2.6 checkout, it requires mastership of svnmerge, you have > to run the tests twice. So some people won't port across the branches, > regardless of what the setup is. If 2.7 is to be released a year from > now, it may not even be worth it. It would need a 2.6 checkout, yes. But the actual merging and running the tests would usually be done, like for 3.0 now, by another person merging a bulk of changes. Georg -- Thus spake the Lord: Thou shalt indent with four spaces. No more, no less. Four shall be the number of spaces thou shalt indent, and the number of thy indenting shall be four. Eight shalt thou not indent, nor either indent thou two, excepting that thou then proceed to four. Tabs are right out. From buildbot at python.org Sun Oct 5 11:23:25 2008 From: buildbot at python.org (buildbot at python.org) Date: Sun, 05 Oct 2008 09:23:25 +0000 Subject: [Python-checkins] buildbot failure in amd64 gentoo 3.0 Message-ID: <20081005092326.206141E4002@bag.python.org> The Buildbot has detected a new failure of amd64 gentoo 3.0. Full details are available at: http://www.python.org/dev/buildbot/all/amd64%20gentoo%203.0/builds/1182 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: norwitz-amd64 Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: mark.hammond BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_smtplib make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Sun Oct 5 11:24:18 2008 From: buildbot at python.org (buildbot at python.org) Date: Sun, 05 Oct 2008 09:24:18 +0000 Subject: [Python-checkins] buildbot failure in AMD64 W2k8 3.0 Message-ID: <20081005092418.809DB1E4002@bag.python.org> The Buildbot has detected a new failure of AMD64 W2k8 3.0. Full details are available at: http://www.python.org/dev/buildbot/all/AMD64%20W2k8%203.0/builds/848 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: nelson-win64 Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: mark.hammond BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_asynchat sincerely, -The Buildbot From buildbot at python.org Sun Oct 5 11:26:23 2008 From: buildbot at python.org (buildbot at python.org) Date: Sun, 05 Oct 2008 09:26:23 +0000 Subject: [Python-checkins] buildbot failure in x86 gentoo 3.0 Message-ID: <20081005092623.2CFB31E4002@bag.python.org> The Buildbot has detected a new failure of x86 gentoo 3.0. Full details are available at: http://www.python.org/dev/buildbot/all/x86%20gentoo%203.0/builds/1660 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: norwitz-x86 Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: mark.hammond BUILD FAILED: failed test Excerpt from the test logfile: make: *** [buildbottest] Unknown signal 32 sincerely, -The Buildbot From buildbot at python.org Sun Oct 5 12:05:21 2008 From: buildbot at python.org (buildbot at python.org) Date: Sun, 05 Oct 2008 10:05:21 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.0 Message-ID: <20081005100521.6DBFC1E4002@bag.python.org> The Buildbot has detected a new failure of sparc solaris10 gcc 3.0. Full details are available at: http://www.python.org/dev/buildbot/all/sparc%20solaris10%20gcc%203.0/builds/635 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: loewis-sun Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: mark.hammond BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_posix ====================================================================== ERROR: test_getcwd_long_pathnames (test.test_posix.PosixTester) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/test/test_posix.py", line 252, in test_getcwd_long_pathnames support.rmtree(base_path) File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/test/support.py", line 98, in rmtree shutil.rmtree(path) File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/shutil.py", line 225, in rmtree onerror(os.rmdir, path, sys.exc_info()) File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/shutil.py", line 223, in rmtree os.rmdir(path) OSError: [Errno 22] Invalid argument: '/home2/buildbot/slave/3.0.loewis-sun/build/@test.getcwd/@test.getcwd' sincerely, -The Buildbot From python-checkins at python.org Mon Oct 6 03:57:04 2008 From: python-checkins at python.org (hirokazu.yamamoto) Date: Mon, 6 Oct 2008 03:57:04 +0200 (CEST) Subject: [Python-checkins] r66809 - python/trunk/Lib/test/test_platform.py Message-ID: <20081006015704.59DD71E4002@bag.python.org> Author: hirokazu.yamamoto Date: Mon Oct 6 03:57:03 2008 New Revision: 66809 Log: Added the patch for issue3762. Modified: python/trunk/Lib/test/test_platform.py Modified: python/trunk/Lib/test/test_platform.py ============================================================================== --- python/trunk/Lib/test/test_platform.py (original) +++ python/trunk/Lib/test/test_platform.py Mon Oct 6 03:57:03 2008 @@ -2,6 +2,7 @@ import os import unittest import platform +import subprocess from test import test_support @@ -9,6 +10,20 @@ def test_architecture(self): res = platform.architecture() + if hasattr(os, "symlink"): + def test_architecture_via_symlink(self): # issue3762 + def get(python): + cmd = [python, '-c', + 'import platform; print platform.architecture()'] + p = subprocess.Popen(cmd, stdout=subprocess.PIPE) + return p.communicate() + symlink = os.path.abspath(test_support.TESTFN) + os.symlink(sys.executable, symlink) + try: + self.assertEqual(get(sys.executable), get(symlink)) + finally: + os.remove(symlink) + def test_machine(self): res = platform.machine() From buildbot at python.org Mon Oct 6 04:22:03 2008 From: buildbot at python.org (buildbot at python.org) Date: Mon, 06 Oct 2008 02:22:03 +0000 Subject: [Python-checkins] buildbot failure in x86 gentoo trunk Message-ID: <20081006022203.8564C1E4002@bag.python.org> The Buildbot has detected a new failure of x86 gentoo trunk. Full details are available at: http://www.python.org/dev/buildbot/all/x86%20gentoo%20trunk/builds/4224 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: norwitz-x86 Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: hirokazu.yamamoto BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_pickletools make: *** [buildbottest] Error 1 sincerely, -The Buildbot From python-checkins at python.org Mon Oct 6 04:42:00 2008 From: python-checkins at python.org (hirokazu.yamamoto) Date: Mon, 6 Oct 2008 04:42:00 +0200 (CEST) Subject: [Python-checkins] r66810 - python/trunk/Lib/test/test_platform.py Message-ID: <20081006024200.34E211E4002@bag.python.org> Author: hirokazu.yamamoto Date: Mon Oct 6 04:41:59 2008 New Revision: 66810 Log: More strict test. Consider the case sys.executable itself is symlink. Modified: python/trunk/Lib/test/test_platform.py Modified: python/trunk/Lib/test/test_platform.py ============================================================================== --- python/trunk/Lib/test/test_platform.py (original) +++ python/trunk/Lib/test/test_platform.py Mon Oct 6 04:41:59 2008 @@ -17,12 +17,13 @@ 'import platform; print platform.architecture()'] p = subprocess.Popen(cmd, stdout=subprocess.PIPE) return p.communicate() - symlink = os.path.abspath(test_support.TESTFN) - os.symlink(sys.executable, symlink) + real = os.path.realpath(sys.executable) + link = os.path.abspath(test_support.TESTFN) + os.symlink(real, link) try: - self.assertEqual(get(sys.executable), get(symlink)) + self.assertEqual(get(real), get(link)) finally: - os.remove(symlink) + os.remove(link) def test_machine(self): res = platform.machine() From buildbot at python.org Mon Oct 6 05:27:33 2008 From: buildbot at python.org (buildbot at python.org) Date: Mon, 06 Oct 2008 03:27:33 +0000 Subject: [Python-checkins] buildbot failure in g4 osx.4 trunk Message-ID: <20081006032734.43C7E1E4002@bag.python.org> The Buildbot has detected a new failure of g4 osx.4 trunk. Full details are available at: http://www.python.org/dev/buildbot/all/g4%20osx.4%20trunk/builds/4003 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: psf-g4 Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: hirokazu.yamamoto BUILD FAILED: failed test Excerpt from the test logfile: Traceback (most recent call last): File "/Users/buildslave/bb/trunk.psf-g4/build/Lib/threading.py", line 522, in __bootstrap_inner self.run() File "/Users/buildslave/bb/trunk.psf-g4/build/Lib/test/test_ftplib.py", line 203, in run asyncore.loop(timeout=0.1, count=1) File "/Users/buildslave/bb/trunk.psf-g4/build/Lib/asyncore.py", line 204, in loop poll_fun(timeout, map) File "/Users/buildslave/bb/trunk.psf-g4/build/Lib/asyncore.py", line 141, in poll read(obj) File "/Users/buildslave/bb/trunk.psf-g4/build/Lib/asyncore.py", line 78, in read obj.handle_error() File "/Users/buildslave/bb/trunk.psf-g4/build/Lib/asyncore.py", line 74, in read obj.handle_read_event() File "/Users/buildslave/bb/trunk.psf-g4/build/Lib/asyncore.py", line 413, in handle_read_event self.handle_read() File "/Users/buildslave/bb/trunk.psf-g4/build/Lib/test/test_ssl.py", line 408, in handle_read self.send(data.lower()) File "/Users/buildslave/bb/trunk.psf-g4/build/Lib/asyncore.py", line 519, in send self.initiate_send() File "/Users/buildslave/bb/trunk.psf-g4/build/Lib/asyncore.py", line 506, in initiate_send num_sent = dispatcher.send(self, self.out_buffer[:512]) File "/Users/buildslave/bb/trunk.psf-g4/build/Lib/asyncore.py", line 349, in send result = self.socket.send(data) File "/Users/buildslave/bb/trunk.psf-g4/build/Lib/socket.py", line 165, in _dummy raise error(EBADF, 'Bad file descriptor') error: [Errno 9] Bad file descriptor sincerely, -The Buildbot From python-checkins at python.org Mon Oct 6 06:50:34 2008 From: python-checkins at python.org (hirokazu.yamamoto) Date: Mon, 6 Oct 2008 06:50:34 +0200 (CEST) Subject: [Python-checkins] r66809 - svn:log Message-ID: <20081006045034.CD7E41E4002@bag.python.org> Author: hirokazu.yamamoto Revision: 66809 Property Name: svn:log Action: modified Property diff: --- old property value +++ new property value @@ -1 +1 @@ -Added the patch for issue3762. \ No newline at end of file +Added the test for issue3762. \ No newline at end of file From nnorwitz at gmail.com Mon Oct 6 07:22:28 2008 From: nnorwitz at gmail.com (Neal Norwitz) Date: Mon, 6 Oct 2008 01:22:28 -0400 Subject: [Python-checkins] Python Regression Test Failures doc dist (1) Message-ID: <20081006052228.GA29075@python.psfb.org> rm -rf dist mkdir -p dist # archive the HTML make html make[1]: Entering directory `/home/neal/python/r26/Doc' mkdir -p build/html build/doctrees python tools/sphinx-build.py -b html -d build/doctrees -D latex_paper_size= . build/html Sphinx v0.5, building html loading pickled environment... done building [html]: targets for 0 source files that are out of date updating environment: 0 added, 0 changed, 0 removed no targets are out of date. Build finished. The HTML pages are in build/html. make[1]: Leaving directory `/home/neal/python/r26/Doc' cp -pPR build/html dist/python-docs-html tar -C dist -cf dist/python-docs-html.tar python-docs-html bzip2 -9 -k dist/python-docs-html.tar (cd dist; zip -q -r -9 python-docs-html.zip python-docs-html) rm -r dist/python-docs-html rm dist/python-docs-html.tar # archive the text build make text make[1]: Entering directory `/home/neal/python/r26/Doc' mkdir -p build/text build/doctrees python tools/sphinx-build.py -b text -d build/doctrees -D latex_paper_size= . build/text Sphinx v0.5, building text loading pickled environment... done building [text]: targets for 0 source files that are out of date updating environment: 0 added, 0 changed, 0 removed no targets are out of date. Build finished; the text files are in build/text. make[1]: Leaving directory `/home/neal/python/r26/Doc' cp -pPR build/text dist/python-docs-text tar -C dist -cf dist/python-docs-text.tar python-docs-text bzip2 -9 -k dist/python-docs-text.tar (cd dist; zip -q -r -9 python-docs-text.zip python-docs-text) rm -r dist/python-docs-text rm dist/python-docs-text.tar # archive the A4 latex rm -r build/latex make latex PAPER=a4 make[1]: Entering directory `/home/neal/python/r26/Doc' mkdir -p build/latex build/doctrees python tools/sphinx-build.py -b latex -d build/doctrees -D latex_paper_size=a4 . build/latex Sphinx v0.5, building latex loading pickled environment... done building [latex]: all documents updating environment: 0 added, 0 changed, 0 removed processing c-api.tex... c-api/index c-api/intro c-api/veryhigh c-api/refcounting c-api/exceptions c-api/utilities c-api/sys c-api/import c-api/marshal c-api/arg c-api/conversion c-api/reflection c-api/abstract c-api/object c-api/number c-api/sequence c-api/mapping c-api/iter c-api/objbuffer c-api/concrete c-api/type c-api/none c-api/int c-api/bool c-api/long c-api/float c-api/complex c-api/bytearray c-api/string c-api/unicode c-api/buffer c-api/tuple c-api/list c-api/dict c-api/class c-api/function c-api/method c-api/file c-api/module c-api/iterator c-api/descriptor c-api/slice c-api/weakref c-api/cobject c-api/cell c-api/gen c-api/datetime c-api/set c-api/init c-api/memory c-api/objimpl c-api/allocation c-api/structures c-api/typeobj c-api/gcsupport resolving references... writing... done processing distutils.tex... distutils/index distutils/introduction distutils/setupscript distutils/configfile distutils/sourcedist distutils/builtdist distutils/packageindex distutils/uploading distutils/examples distutils/extending distutils/commandref distutils/apiref resolving references... writing... done processing documenting.tex... documenting/index documenting/intro documenting/style documenting/rest documenting/markup documenting/fromlatex documenting/sphinx resolving references... writing... done processing extending.tex... extending/index extending/extending extending/newtypes extending/building extending/windows extending/embedding resolving references... writing... done processing install.tex... install/index resolving references... writing... done processing library.tex... library/index library/intro library/functions library/constants library/objects library/stdtypes library/exceptions library/strings library/string library/re library/struct library/difflib library/stringio library/textwrap library/codecs library/unicodedata library/stringprep library/fpformat library/datatypes library/datetime library/calendar library/collections library/heapq library/bisect library/array library/sets library/sched library/mutex library/queue library/weakref library/userdict library/types library/new library/copy library/pprint library/repr library/numeric library/numbers library/math library/cmath library/decimal library/fractions library/random library/itertools library/functools library/operator library/filesys library/os.path library/fileinput library/stat library/statvfs library/filecmp library/tempfile library/glob library/fnmatch library/linecache library/shutil library/dircache library/macpath library/persistence library/pickle library/copy_reg library/shelve library/marshal library/anydbm library/whichdb library/dbm library/gdbm library/dbhash library/bsddb library/dumbdbm library/sqlite3 library/archiving library/zlib library/gzip library/bz2 library/zipfile library/tarfile library/fileformats library/csv library/configparser library/robotparser library/netrc library/xdrlib library/plistlib library/crypto library/hashlib library/hmac library/md5 library/sha library/allos library/os library/io library/time library/optparse library/getopt library/logging library/getpass library/curses library/curses.ascii library/curses.panel library/platform library/errno library/ctypes library/someos library/select library/threading library/thread library/dummy_threading library/dummy_thread library/multiprocessing library/mmap library/readline library/rlcompleter library/ipc library/subprocess library/socket library/ssl library/signal library/popen2 library/asyncore library/asynchat library/netdata library/email library/email.message library/email.parser library/email.generator library/email.mime library/email.header library/email.charset library/email.encoders library/email.errors library/email.util library/email.iterators library/email-examples library/json library/mailcap library/mailbox library/mhlib library/mimetools library/mimetypes library/mimewriter library/mimify library/multifile library/rfc822 library/base64 library/binhex library/binascii library/quopri library/uu library/markup library/htmlparser library/sgmllib library/htmllib library/pyexpat library/xml.dom library/xml.dom.minidom library/xml.dom.pulldom library/xml.sax library/xml.sax.handler library/xml.sax.utils library/xml.sax.reader library/xml.etree.elementtree library/internet library/webbrowser library/cgi library/cgitb library/wsgiref library/urllib library/urllib2 library/httplib library/ftplib library/poplib library/imaplib library/nntplib library/smtplib library/smtpd library/telnetlib library/uuid library/urlparse library/socketserver library/basehttpserver library/simplehttpserver library/cgihttpserver library/cookielib library/cookie library/xmlrpclib library/simplexmlrpcserver library/docxmlrpcserver library/mm library/audioop library/imageop library/aifc library/sunau library/wave library/chunk library/colorsys library/imghdr library/sndhdr library/ossaudiodev library/i18n library/gettext library/locale library/frameworks library/cmd library/shlex library/tk library/tkinter library/tix library/scrolledtext library/turtle library/idle library/othergui library/development library/pydoc library/doctest library/unittest library/2to3 library/test library/debug library/bdb library/pdb library/profile library/hotshot library/timeit library/trace library/python library/sys library/__builtin__ library/future_builtins library/__main__ library/warnings library/contextlib library/abc library/atexit library/traceback library/__future__ library/gc library/inspect library/site library/user library/fpectl library/custominterp library/code library/codeop library/restricted library/rexec library/bastion library/modules library/imp library/imputil library/zipimport library/pkgutil library/modulefinder library/runpy library/language library/parser library/ast library/symtable library/symbol library/token library/keyword library/tokenize library/tabnanny library/pyclbr library/py_compile library/compileall library/dis library/pickletools library/distutils library/compiler library/misc library/formatter library/windows library/msilib library/msvcrt library/_winreg library/winsound library/unix library/posix library/pwd library/spwd library/grp library/crypt library/dl library/termios library/tty library/pty library/fcntl library/pipes library/posixfile library/resource library/nis library/syslog library/commands library/mac library/ic library/macos library/macostools library/easydialogs library/framework library/autogil library/carbon library/colorpicker library/macosa library/gensuitemodule library/aetools library/aepack library/aetypes library/miniaeframe library/sgi library/al library/cd library/fl library/fm library/gl library/imgfile library/jpeg library/sun library/sunaudio library/undoc resolving references... writing... done processing reference.tex... reference/index reference/introduction reference/lexical_analysis reference/datamodel reference/executionmodel reference/expressions reference/simple_stmts reference/compound_stmts reference/toplevel_components reference/grammar resolving references... writing... done processing tutorial.tex... tutorial/index tutorial/appetite tutorial/interpreter tutorial/introduction tutorial/controlflow tutorial/datastructures tutorial/modules tutorial/inputoutput tutorial/errors tutorial/classes tutorial/stdlib tutorial/stdlib2 tutorial/whatnow tutorial/interactive tutorial/floatingpoint resolving references... writing... done processing using.tex... using/index using/cmdline using/unix using/windows using/mac resolving references... writing... done processing whatsnew.tex... whatsnew/2.6 resolving references... writing... done processing howto-doanddont.tex... howto/doanddont resolving references... writing... done processing howto-advocacy.tex... howto/advocacy resolving references... writing... done processing howto-functional.tex... howto/functional resolving references... writing... done processing howto-regex.tex... howto/regex resolving references... writing... done processing howto-sockets.tex... howto/sockets resolving references... writing... done processing howto-urllib2.tex... howto/urllib2 resolving references... writing... done processing howto-webservers.tex... howto/webservers resolving references... writing... done processing howto-curses.tex... howto/curses resolving references... writing... done processing howto-cporting.tex... howto/cporting resolving references... writing... done processing howto-unicode.tex... howto/unicode resolving references... writing... done copying TeX support files... done build succeeded. Build finished; the LaTeX files are in build/latex. Run `make all-pdf' or `make all-ps' in that directory to run these through (pdf)latex. make[1]: Leaving directory `/home/neal/python/r26/Doc' (cd build/latex; make clean && make all-pdf && make FMT=pdf zip bz2) make[1]: Entering directory `/home/neal/python/r26/Doc/build/latex' rm -f *.pdf *.dvi *.ps rm -f *.log *.ind *.aux *.toc *.syn *.idx *.out *.ilg *.pla make[1]: Leaving directory `/home/neal/python/r26/Doc/build/latex' make[1]: Entering directory `/home/neal/python/r26/Doc/build/latex' pdflatex 'c-api.tex' This is pdfTeX, Version 3.14159-1.10b (Web2C 7.4.5) (./c-api.tex{/usr/share/texmf/pdftex/config/pdftex.cfg} LaTeX2e <2001/06/01> Babel and hyphenation patterns for american, french, german, ngerman, n ohyphenation, loaded. (./manual.cls Document Class: manual 2008/09/12 Document class (Sphinx manual) (/usr/share/texmf/tex/latex/misc/fancybox.sty Style option: `fancybox' v1.3 <2000/09/19> (tvz) ) (/usr/share/texmf/tex/latex/base/report.cls Document Class: report 2001/04/21 v1.4e Standard LaTeX document class (/usr/share/texmf/tex/latex/base/size10.clo)) (./sphinx.sty (/usr/share/texmf/tex/latex/base/textcomp.sty (/usr/share/texmf/tex/latex/base/ts1enc.def)) (/usr/share/texmf/tex/latex/fancyvrb/fancyvrb.sty Style option: `fancyvrb' v2.7, with DG/SPQR fixes <2000/03/21> (tvz) (/usr/share/texmf/tex/latex/graphics/keyval.sty)) (/usr/share/texmf/tex/latex/fancyhdr/fancyhdr.sty) (/usr/share/texmf/tex/latex/titlesec/titlesec.sty) (./tabulary.sty (/usr/share/texmf/tex/latex/tools/array.sty)) (/usr/share/texmf/tex/latex/amsmath/amsmath.sty For additional information on amsmath, use the `?' option. (/usr/share/texmf/tex/latex/amsmath/amstext.sty (/usr/share/texmf/tex/latex/amsmath/amsgen.sty)) (/usr/share/texmf/tex/latex/amsmath/amsbsy.sty) (/usr/share/texmf/tex/latex/amsmath/amsopn.sty)) (/usr/share/texmf/tex/latex/graphics/color.sty (/usr/share/texmf/tex/latex/config/color.cfg) (/usr/share/texmf/tex/latex/graphics/pdftex.def)) (/usr/share/texmf/tex/latex/hyperref/hyperref.sty (/usr/share/texmf/tex/latex/hyperref/pd1enc.def) (/usr/share/texmf/tex/latex/config/hyperref.cfg) Implicit mode ON; LaTeX internals redefined (/usr/share/texmf/tex/latex/html/url.sty)) *hyperref using default driver hpdftex* (/usr/share/texmf/tex/latex/hyperref/hpdftex.def (/usr/share/texmf/tex/latex/psnfss/pifont.sty (/usr/share/texmf/tex/latex/psnfss/upzd.fd) (/usr/share/texmf/tex/latex/psnfss/upsy.fd))) (/usr/share/texmf/tex/latex/misc/framed.sty) (/usr/share/texmf/tex/latex/graphics/graphicx.sty (/usr/share/texmf/tex/latex/graphics/graphics.sty (/usr/share/texmf/tex/latex/graphics/trig.sty) (/usr/share/texmf/tex/latex/config/graphics.cfg))) (/usr/share/texmf/pdftex/plain/misc/pdfcolor.tex)) (/usr/share/texmf/tex/latex/base/makeidx.sty)) (/usr/share/texmf/tex/latex/base/inputenc.sty ! LaTeX Error: File `utf8.def' not found. Type X to quit or to proceed, or enter new name. (Default extension: def) Enter file name: ! Emergency stop. l.118 \endinput ^^M No pages of output. Transcript written on c-api.log. make[1]: *** [c-api.pdf] Error 1 make[1]: Leaving directory `/home/neal/python/r26/Doc/build/latex' make: *** [dist] Error 2 From python-checkins at python.org Mon Oct 6 14:07:04 2008 From: python-checkins at python.org (andrew.kuchling) Date: Mon, 6 Oct 2008 14:07:04 +0200 (CEST) Subject: [Python-checkins] r66813 - python/trunk/Lib/optparse.py Message-ID: <20081006120704.E9C8E1E404A@bag.python.org> Author: andrew.kuchling Date: Mon Oct 6 14:07:04 2008 New Revision: 66813 Log: Per Greg Ward, optparse is no longer being externally maintained. I'll look at the bugs in the Optik bug tracker and copy them to the Python bug tracker if they're still relevant. Modified: python/trunk/Lib/optparse.py Modified: python/trunk/Lib/optparse.py ============================================================================== --- python/trunk/Lib/optparse.py (original) +++ python/trunk/Lib/optparse.py Mon Oct 6 14:07:04 2008 @@ -1,21 +1,13 @@ -"""optparse - a powerful, extensible, and easy-to-use option parser. +"""A powerful, extensible, and easy-to-use option parser. By Greg Ward -Originally distributed as Optik; see http://optik.sourceforge.net/ . - -If you have problems with this module, please do not file bugs, -patches, or feature requests with Python; instead, use Optik's -SourceForge project page: - http://sourceforge.net/projects/optik +Originally distributed as Optik. For support, use the optik-users at lists.sourceforge.net mailing list (http://lists.sourceforge.net/lists/listinfo/optik-users). """ -# Python developers: please do not make changes to this file, since -# it is automatically generated from the Optik source code. - __version__ = "1.5.3" __all__ = ['Option', From buildbot at python.org Mon Oct 6 14:50:06 2008 From: buildbot at python.org (buildbot at python.org) Date: Mon, 06 Oct 2008 12:50:06 +0000 Subject: [Python-checkins] buildbot failure in ppc Debian unstable trunk Message-ID: <20081006125006.E191A1E4002@bag.python.org> The Buildbot has detected a new failure of ppc Debian unstable trunk. Full details are available at: http://www.python.org/dev/buildbot/all/ppc%20Debian%20unstable%20trunk/builds/2039 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-debian-ppc Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: andrew.kuchling BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_bsddb3 make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Mon Oct 6 14:59:50 2008 From: buildbot at python.org (buildbot at python.org) Date: Mon, 06 Oct 2008 12:59:50 +0000 Subject: [Python-checkins] buildbot failure in AMD64 W2k8 trunk Message-ID: <20081006125950.429F41E4002@bag.python.org> The Buildbot has detected a new failure of AMD64 W2k8 trunk. Full details are available at: http://www.python.org/dev/buildbot/all/AMD64%20W2k8%20trunk/builds/1004 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: nelson-win64 Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: andrew.kuchling BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_bsddb3 sincerely, -The Buildbot From python-checkins at python.org Mon Oct 6 17:15:41 2008 From: python-checkins at python.org (martin.v.loewis) Date: Mon, 6 Oct 2008 17:15:41 +0200 (CEST) Subject: [Python-checkins] r66814 - in python/trunk: Misc/NEWS setup.py Message-ID: <20081006151541.45C701E402F@bag.python.org> Author: martin.v.loewis Date: Mon Oct 6 17:15:40 2008 New Revision: 66814 Log: Issue #4014: Don't claim that Python has an Alpha release status, in addition to claiming it is Mature. Modified: python/trunk/Misc/NEWS python/trunk/setup.py Modified: python/trunk/Misc/NEWS ============================================================================== --- python/trunk/Misc/NEWS (original) +++ python/trunk/Misc/NEWS Mon Oct 6 17:15:40 2008 @@ -15,6 +15,9 @@ Library ------- +- Issue #4014: Don't claim that Python has an Alpha release status, in addition + to claiming it is Mature. + What's New in Python 2.6 final ============================== Modified: python/trunk/setup.py ============================================================================== --- python/trunk/setup.py (original) +++ python/trunk/setup.py Mon Oct 6 17:15:40 2008 @@ -1837,7 +1837,6 @@ """ CLASSIFIERS = """ -Development Status :: 3 - Alpha Development Status :: 6 - Mature License :: OSI Approved :: Python Software Foundation License Natural Language :: English From python-checkins at python.org Mon Oct 6 17:17:35 2008 From: python-checkins at python.org (martin.v.loewis) Date: Mon, 6 Oct 2008 17:17:35 +0200 (CEST) Subject: [Python-checkins] r66815 - in python/branches/release26-maint: Misc/NEWS setup.py Message-ID: <20081006151735.EE7E91E400C@bag.python.org> Author: martin.v.loewis Date: Mon Oct 6 17:17:35 2008 New Revision: 66815 Log: Merged revisions 66814 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r66814 | martin.v.loewis | 2008-10-06 17:15:40 +0200 (Mo, 06 Okt 2008) | 3 lines Issue #4014: Don't claim that Python has an Alpha release status, in addition to claiming it is Mature. ........ Modified: python/branches/release26-maint/ (props changed) python/branches/release26-maint/Misc/NEWS python/branches/release26-maint/setup.py Modified: python/branches/release26-maint/Misc/NEWS ============================================================================== --- python/branches/release26-maint/Misc/NEWS (original) +++ python/branches/release26-maint/Misc/NEWS Mon Oct 6 17:17:35 2008 @@ -18,6 +18,9 @@ Library ------- +- Issue #4014: Don't claim that Python has an Alpha release status, in addition + to claiming it is Mature. + What's New in Python 2.6 final ============================== Modified: python/branches/release26-maint/setup.py ============================================================================== --- python/branches/release26-maint/setup.py (original) +++ python/branches/release26-maint/setup.py Mon Oct 6 17:17:35 2008 @@ -1837,7 +1837,6 @@ """ CLASSIFIERS = """ -Development Status :: 3 - Alpha Development Status :: 6 - Mature License :: OSI Approved :: Python Software Foundation License Natural Language :: English From buildbot at python.org Mon Oct 6 18:03:10 2008 From: buildbot at python.org (buildbot at python.org) Date: Mon, 06 Oct 2008 16:03:10 +0000 Subject: [Python-checkins] buildbot failure in amd64 gentoo 3.0 Message-ID: <20081006160311.28AB81E4002@bag.python.org> The Buildbot has detected a new failure of amd64 gentoo 3.0. Full details are available at: http://www.python.org/dev/buildbot/all/amd64%20gentoo%203.0/builds/1184 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: norwitz-amd64 Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: martin.v.loewis BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_io ====================================================================== ERROR: testBasicIO (test.test_io.TextIOWrapperTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/buildbot/slave/py-build/3.0.norwitz-amd64/build/Lib/test/test_io.py", line 900, in testBasicIO self.assertEquals(f.write("abc"), 3) File "/home/buildbot/slave/py-build/3.0.norwitz-amd64/build/Lib/io.py", line 1485, in write b = encoder.encode(s) File "/home/buildbot/slave/py-build/3.0.norwitz-amd64/build/Lib/encodings/ascii.py", line 22, in encode return codecs.ascii_encode(input, self.errors)[0] AttributeError: 'NoneType' object has no attribute 'ascii_encode' ====================================================================== ERROR: testEncodingErrorsReading (test.test_io.TextIOWrapperTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/buildbot/slave/py-build/3.0.norwitz-amd64/build/Lib/test/test_io.py", line 738, in testEncodingErrorsReading self.assertRaises(UnicodeError, t.read) File "/home/buildbot/slave/py-build/3.0.norwitz-amd64/build/Lib/unittest.py", line 311, in failUnlessRaises callableObj(*args, **kwargs) File "/home/buildbot/slave/py-build/3.0.norwitz-amd64/build/Lib/io.py", line 1718, in read decoder.decode(self.buffer.read(), final=True)) File "/home/buildbot/slave/py-build/3.0.norwitz-amd64/build/Lib/io.py", line 1293, in decode output = self.decoder.decode(input, final=final) File "/home/buildbot/slave/py-build/3.0.norwitz-amd64/build/Lib/encodings/ascii.py", line 26, in decode return codecs.ascii_decode(input, self.errors)[0] AttributeError: 'NoneType' object has no attribute 'ascii_decode' ====================================================================== ERROR: testEncodingErrorsWriting (test.test_io.TextIOWrapperTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/buildbot/slave/py-build/3.0.norwitz-amd64/build/Lib/test/test_io.py", line 756, in testEncodingErrorsWriting self.assertRaises(UnicodeError, t.write, "\xff") File "/home/buildbot/slave/py-build/3.0.norwitz-amd64/build/Lib/unittest.py", line 311, in failUnlessRaises callableObj(*args, **kwargs) File "/home/buildbot/slave/py-build/3.0.norwitz-amd64/build/Lib/io.py", line 1485, in write b = encoder.encode(s) File "/home/buildbot/slave/py-build/3.0.norwitz-amd64/build/Lib/encodings/ascii.py", line 22, in encode return codecs.ascii_encode(input, self.errors)[0] AttributeError: 'NoneType' object has no attribute 'ascii_encode' ====================================================================== ERROR: testNewlinesInput (test.test_io.TextIOWrapperTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/buildbot/slave/py-build/3.0.norwitz-amd64/build/Lib/test/test_io.py", line 861, in testNewlinesInput self.assertEquals(txt.readlines(), expected) File "/home/buildbot/slave/py-build/3.0.norwitz-amd64/build/Lib/io.py", line 539, in readlines return list(self) File "/home/buildbot/slave/py-build/3.0.norwitz-amd64/build/Lib/io.py", line 1733, in __next__ line = self.readline() File "/home/buildbot/slave/py-build/3.0.norwitz-amd64/build/Lib/io.py", line 1807, in readline while self._read_chunk(): File "/home/buildbot/slave/py-build/3.0.norwitz-amd64/build/Lib/io.py", line 1556, in _read_chunk self._set_decoded_chars(self._decoder.decode(input_chunk, eof)) File "/home/buildbot/slave/py-build/3.0.norwitz-amd64/build/Lib/io.py", line 1293, in decode output = self.decoder.decode(input, final=final) File "/home/buildbot/slave/py-build/3.0.norwitz-amd64/build/Lib/encodings/ascii.py", line 26, in decode return codecs.ascii_decode(input, self.errors)[0] AttributeError: 'NoneType' object has no attribute 'ascii_decode' ====================================================================== ERROR: testNewlinesOutput (test.test_io.TextIOWrapperTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/buildbot/slave/py-build/3.0.norwitz-amd64/build/Lib/test/test_io.py", line 886, in testNewlinesOutput txt.write(data) File "/home/buildbot/slave/py-build/3.0.norwitz-amd64/build/Lib/io.py", line 1485, in write b = encoder.encode(s) File "/home/buildbot/slave/py-build/3.0.norwitz-amd64/build/Lib/encodings/ascii.py", line 22, in encode return codecs.ascii_encode(input, self.errors)[0] AttributeError: 'NoneType' object has no attribute 'ascii_encode' ====================================================================== ERROR: test_issue1395_1 (test.test_io.TextIOWrapperTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/buildbot/slave/py-build/3.0.norwitz-amd64/build/Lib/test/test_io.py", line 1122, in test_issue1395_1 c = txt.read(1) File "/home/buildbot/slave/py-build/3.0.norwitz-amd64/build/Lib/io.py", line 1727, in read eof = not self._read_chunk() File "/home/buildbot/slave/py-build/3.0.norwitz-amd64/build/Lib/io.py", line 1556, in _read_chunk self._set_decoded_chars(self._decoder.decode(input_chunk, eof)) File "/home/buildbot/slave/py-build/3.0.norwitz-amd64/build/Lib/io.py", line 1293, in decode output = self.decoder.decode(input, final=final) File "/home/buildbot/slave/py-build/3.0.norwitz-amd64/build/Lib/encodings/ascii.py", line 26, in decode return codecs.ascii_decode(input, self.errors)[0] AttributeError: 'NoneType' object has no attribute 'ascii_decode' ====================================================================== ERROR: test_issue1395_2 (test.test_io.TextIOWrapperTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/buildbot/slave/py-build/3.0.norwitz-amd64/build/Lib/test/test_io.py", line 1134, in test_issue1395_2 c = txt.read(4) File "/home/buildbot/slave/py-build/3.0.norwitz-amd64/build/Lib/io.py", line 1727, in read eof = not self._read_chunk() File "/home/buildbot/slave/py-build/3.0.norwitz-amd64/build/Lib/io.py", line 1556, in _read_chunk self._set_decoded_chars(self._decoder.decode(input_chunk, eof)) File "/home/buildbot/slave/py-build/3.0.norwitz-amd64/build/Lib/io.py", line 1293, in decode output = self.decoder.decode(input, final=final) File "/home/buildbot/slave/py-build/3.0.norwitz-amd64/build/Lib/encodings/ascii.py", line 26, in decode return codecs.ascii_decode(input, self.errors)[0] AttributeError: 'NoneType' object has no attribute 'ascii_decode' ====================================================================== ERROR: test_issue1395_3 (test.test_io.TextIOWrapperTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/buildbot/slave/py-build/3.0.norwitz-amd64/build/Lib/test/test_io.py", line 1144, in test_issue1395_3 reads = txt.read(4) File "/home/buildbot/slave/py-build/3.0.norwitz-amd64/build/Lib/io.py", line 1727, in read eof = not self._read_chunk() File "/home/buildbot/slave/py-build/3.0.norwitz-amd64/build/Lib/io.py", line 1556, in _read_chunk self._set_decoded_chars(self._decoder.decode(input_chunk, eof)) File "/home/buildbot/slave/py-build/3.0.norwitz-amd64/build/Lib/io.py", line 1293, in decode output = self.decoder.decode(input, final=final) File "/home/buildbot/slave/py-build/3.0.norwitz-amd64/build/Lib/encodings/ascii.py", line 26, in decode return codecs.ascii_decode(input, self.errors)[0] AttributeError: 'NoneType' object has no attribute 'ascii_decode' ====================================================================== ERROR: test_issue1395_4 (test.test_io.TextIOWrapperTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/buildbot/slave/py-build/3.0.norwitz-amd64/build/Lib/test/test_io.py", line 1155, in test_issue1395_4 reads = txt.read(4) File "/home/buildbot/slave/py-build/3.0.norwitz-amd64/build/Lib/io.py", line 1727, in read eof = not self._read_chunk() File "/home/buildbot/slave/py-build/3.0.norwitz-amd64/build/Lib/io.py", line 1556, in _read_chunk self._set_decoded_chars(self._decoder.decode(input_chunk, eof)) File "/home/buildbot/slave/py-build/3.0.norwitz-amd64/build/Lib/io.py", line 1293, in decode output = self.decoder.decode(input, final=final) File "/home/buildbot/slave/py-build/3.0.norwitz-amd64/build/Lib/encodings/ascii.py", line 26, in decode return codecs.ascii_decode(input, self.errors)[0] AttributeError: 'NoneType' object has no attribute 'ascii_decode' ====================================================================== ERROR: test_issue1395_5 (test.test_io.TextIOWrapperTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/buildbot/slave/py-build/3.0.norwitz-amd64/build/Lib/test/test_io.py", line 1163, in test_issue1395_5 reads = txt.read(4) File "/home/buildbot/slave/py-build/3.0.norwitz-amd64/build/Lib/io.py", line 1727, in read eof = not self._read_chunk() File "/home/buildbot/slave/py-build/3.0.norwitz-amd64/build/Lib/io.py", line 1556, in _read_chunk self._set_decoded_chars(self._decoder.decode(input_chunk, eof)) File "/home/buildbot/slave/py-build/3.0.norwitz-amd64/build/Lib/io.py", line 1293, in decode output = self.decoder.decode(input, final=final) File "/home/buildbot/slave/py-build/3.0.norwitz-amd64/build/Lib/encodings/ascii.py", line 26, in decode return codecs.ascii_decode(input, self.errors)[0] AttributeError: 'NoneType' object has no attribute 'ascii_decode' make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Mon Oct 6 18:06:01 2008 From: buildbot at python.org (buildbot at python.org) Date: Mon, 06 Oct 2008 16:06:01 +0000 Subject: [Python-checkins] buildbot failure in x86 W2k8 trunk Message-ID: <20081006160601.AC5721E4002@bag.python.org> The Buildbot has detected a new failure of x86 W2k8 trunk. Full details are available at: http://www.python.org/dev/buildbot/all/x86%20W2k8%20trunk/builds/253 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: nelson-windows Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: martin.v.loewis BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_bsddb3 sincerely, -The Buildbot From buildbot at python.org Mon Oct 6 19:40:03 2008 From: buildbot at python.org (buildbot at python.org) Date: Mon, 06 Oct 2008 17:40:03 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.0 Message-ID: <20081006174003.7260D1E4002@bag.python.org> The Buildbot has detected a new failure of sparc solaris10 gcc 3.0. Full details are available at: http://www.python.org/dev/buildbot/all/sparc%20solaris10%20gcc%203.0/builds/637 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: loewis-sun Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: martin.v.loewis BUILD FAILED: failed test Excerpt from the test logfile: 3 tests failed: test_distutils test_posix test_subprocess ====================================================================== FAIL: test_get_python_inc (distutils.tests.test_sysconfig.SysconfigTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/distutils/tests/test_sysconfig.py", line 43, in test_get_python_inc self.assert_(os.path.isdir(inc_dir), inc_dir) AssertionError: /home2/buildbot/slave/3.0.loewis-sun/build/@test.getcwd/Include ====================================================================== ERROR: test_getcwd_long_pathnames (test.test_posix.PosixTester) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/test/test_posix.py", line 252, in test_getcwd_long_pathnames support.rmtree(base_path) File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/test/support.py", line 98, in rmtree shutil.rmtree(path) File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/shutil.py", line 225, in rmtree onerror(os.rmdir, path, sys.exc_info()) File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/shutil.py", line 223, in rmtree os.rmdir(path) OSError: [Errno 22] Invalid argument: '/home2/buildbot/slave/3.0.loewis-sun/build/@test.getcwd/@test.getcwd' ====================================================================== FAIL: test_executable (test.test_subprocess.ProcessTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/test/test_subprocess.py", line 115, in test_executable self.assertEqual(p.returncode, 47) AssertionError: -6 != 47 sincerely, -The Buildbot From buildbot at python.org Mon Oct 6 23:21:31 2008 From: buildbot at python.org (buildbot at python.org) Date: Mon, 06 Oct 2008 21:21:31 +0000 Subject: [Python-checkins] buildbot failure in OS X x86 3.0 Message-ID: <20081006212132.3B81B1E40C2@bag.python.org> The Buildbot has detected a new failure of OS X x86 3.0. Full details are available at: http://www.python.org/dev/buildbot/all/OS%20X%20x86%203.0/builds/438 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: noller-osx86 Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: benjamin.peterson BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_profile make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Mon Oct 6 23:24:06 2008 From: buildbot at python.org (buildbot at python.org) Date: Mon, 06 Oct 2008 21:24:06 +0000 Subject: [Python-checkins] buildbot failure in x86 W2k8 3.0 Message-ID: <20081006212407.2F2AB1E4002@bag.python.org> The Buildbot has detected a new failure of x86 W2k8 3.0. Full details are available at: http://www.python.org/dev/buildbot/all/x86%20W2k8%203.0/builds/322 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: nelson-windows Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: benjamin.peterson BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_profile sincerely, -The Buildbot From buildbot at python.org Mon Oct 6 23:34:33 2008 From: buildbot at python.org (buildbot at python.org) Date: Mon, 06 Oct 2008 21:34:33 +0000 Subject: [Python-checkins] buildbot failure in ppc Debian unstable 3.0 Message-ID: <20081006213435.4EC4E1E4002@bag.python.org> The Buildbot has detected a new failure of ppc Debian unstable 3.0. Full details are available at: http://www.python.org/dev/buildbot/all/ppc%20Debian%20unstable%203.0/builds/1626 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-debian-ppc Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: benjamin.peterson BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_profile make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Mon Oct 6 23:49:21 2008 From: buildbot at python.org (buildbot at python.org) Date: Mon, 06 Oct 2008 21:49:21 +0000 Subject: [Python-checkins] buildbot failure in x86 W2k8 3.0 Message-ID: <20081006214921.831191E402B@bag.python.org> The Buildbot has detected a new failure of x86 W2k8 3.0. Full details are available at: http://www.python.org/dev/buildbot/all/x86%20W2k8%203.0/builds/324 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: nelson-windows Build Reason: The web-page 'force build' button was pressed by 'amaury': test_cprofile.py was not correctly updated Build Source Stamp: [branch empty] HEAD Blamelist: BUILD FAILED: failed svn sincerely, -The Buildbot From buildbot at python.org Mon Oct 6 23:52:16 2008 From: buildbot at python.org (buildbot at python.org) Date: Mon, 06 Oct 2008 21:52:16 +0000 Subject: [Python-checkins] buildbot failure in g4 osx.4 3.0 Message-ID: <20081006215216.74D371E400C@bag.python.org> The Buildbot has detected a new failure of g4 osx.4 3.0. Full details are available at: http://www.python.org/dev/buildbot/all/g4%20osx.4%203.0/builds/1483 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: psf-g4 Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: benjamin.peterson BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_asynchat make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Tue Oct 7 00:06:19 2008 From: buildbot at python.org (buildbot at python.org) Date: Mon, 06 Oct 2008 22:06:19 +0000 Subject: [Python-checkins] buildbot failure in x86 W2k8 3.0 Message-ID: <20081006220619.5A93F1E4002@bag.python.org> The Buildbot has detected a new failure of x86 W2k8 3.0. Full details are available at: http://www.python.org/dev/buildbot/all/x86%20W2k8%203.0/builds/326 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: nelson-windows Build Reason: The web-page 'force build' button was pressed by '': Build Source Stamp: [branch branches/py3k] HEAD Blamelist: BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_profile sincerely, -The Buildbot From buildbot at python.org Tue Oct 7 00:28:29 2008 From: buildbot at python.org (buildbot at python.org) Date: Mon, 06 Oct 2008 22:28:29 +0000 Subject: [Python-checkins] buildbot failure in sparc Debian 3.0 Message-ID: <20081006222830.142EB1E400C@bag.python.org> The Buildbot has detected a new failure of sparc Debian 3.0. Full details are available at: http://www.python.org/dev/buildbot/all/sparc%20Debian%203.0/builds/604 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-debian-sparc Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: benjamin.peterson BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_profile make: *** [buildbottest] Error 1 sincerely, -The Buildbot From python-checkins at python.org Tue Oct 7 00:44:37 2008 From: python-checkins at python.org (brett.cannon) Date: Tue, 7 Oct 2008 00:44:37 +0200 (CEST) Subject: [Python-checkins] r66819 - in python/trunk: Makefile.pre.in Misc/NEWS Message-ID: <20081006224437.AE9E61E4002@bag.python.org> Author: brett.cannon Date: Tue Oct 7 00:44:37 2008 New Revision: 66819 Log: Add the 'patchcheck' build target to .PHONY. Re-closes issue 3758. Thanks to Ralph Corderoy for the catch. Modified: python/trunk/Makefile.pre.in python/trunk/Misc/NEWS Modified: python/trunk/Makefile.pre.in ============================================================================== --- python/trunk/Makefile.pre.in (original) +++ python/trunk/Makefile.pre.in Tue Oct 7 00:44:37 2008 @@ -1204,6 +1204,6 @@ .PHONY: frameworkinstall frameworkinstallframework frameworkinstallstructure .PHONY: frameworkinstallmaclib frameworkinstallapps frameworkinstallunixtools .PHONY: frameworkaltinstallunixtools recheck autoconf clean clobber distclean -.PHONY: smelly funny +.PHONY: smelly funny patchcheck # IF YOU PUT ANYTHING HERE IT WILL GO AWAY Modified: python/trunk/Misc/NEWS ============================================================================== --- python/trunk/Misc/NEWS (original) +++ python/trunk/Misc/NEWS Tue Oct 7 00:44:37 2008 @@ -18,6 +18,11 @@ - Issue #4014: Don't claim that Python has an Alpha release status, in addition to claiming it is Mature. +Build +----- + +- Issue #3758: Add ``patchcheck`` build target to .PHONY. + What's New in Python 2.6 final ============================== From python-checkins at python.org Tue Oct 7 00:47:19 2008 From: python-checkins at python.org (brett.cannon) Date: Tue, 7 Oct 2008 00:47:19 +0200 (CEST) Subject: [Python-checkins] r66820 - in python/branches/release26-maint: Makefile.pre.in Misc/NEWS Message-ID: <20081006224719.35E391E4002@bag.python.org> Author: brett.cannon Date: Tue Oct 7 00:47:18 2008 New Revision: 66820 Log: Merged revisions 66819 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r66819 | brett.cannon | 2008-10-06 15:44:37 -0700 (Mon, 06 Oct 2008) | 4 lines Add the 'patchcheck' build target to .PHONY. Re-closes issue 3758. Thanks to Ralph Corderoy for the catch. ........ Modified: python/branches/release26-maint/ (props changed) python/branches/release26-maint/Makefile.pre.in python/branches/release26-maint/Misc/NEWS Modified: python/branches/release26-maint/Makefile.pre.in ============================================================================== --- python/branches/release26-maint/Makefile.pre.in (original) +++ python/branches/release26-maint/Makefile.pre.in Tue Oct 7 00:47:18 2008 @@ -1204,6 +1204,6 @@ .PHONY: frameworkinstall frameworkinstallframework frameworkinstallstructure .PHONY: frameworkinstallmaclib frameworkinstallapps frameworkinstallunixtools .PHONY: frameworkaltinstallunixtools recheck autoconf clean clobber distclean -.PHONY: smelly funny +.PHONY: smelly funny patchcheck # IF YOU PUT ANYTHING HERE IT WILL GO AWAY Modified: python/branches/release26-maint/Misc/NEWS ============================================================================== --- python/branches/release26-maint/Misc/NEWS (original) +++ python/branches/release26-maint/Misc/NEWS Tue Oct 7 00:47:18 2008 @@ -21,6 +21,11 @@ - Issue #4014: Don't claim that Python has an Alpha release status, in addition to claiming it is Mature. +Build +----- + +- Issue #3758: Add ``patchcheck`` build target to .PHONY. + What's New in Python 2.6 final ============================== From buildbot at python.org Tue Oct 7 01:31:08 2008 From: buildbot at python.org (buildbot at python.org) Date: Mon, 06 Oct 2008 23:31:08 +0000 Subject: [Python-checkins] buildbot failure in amd64 gentoo 3.0 Message-ID: <20081006233108.7B6ED1E400C@bag.python.org> The Buildbot has detected a new failure of amd64 gentoo 3.0. Full details are available at: http://www.python.org/dev/buildbot/all/amd64%20gentoo%203.0/builds/1188 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: norwitz-amd64 Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: brett.cannon BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_smtplib make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Tue Oct 7 01:36:48 2008 From: buildbot at python.org (buildbot at python.org) Date: Mon, 06 Oct 2008 23:36:48 +0000 Subject: [Python-checkins] buildbot failure in AMD64 W2k8 trunk Message-ID: <20081006233648.B97E21E4002@bag.python.org> The Buildbot has detected a new failure of AMD64 W2k8 trunk. Full details are available at: http://www.python.org/dev/buildbot/all/AMD64%20W2k8%20trunk/builds/1006 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: nelson-win64 Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: brett.cannon BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_bsddb3 sincerely, -The Buildbot From buildbot at python.org Tue Oct 7 02:21:20 2008 From: buildbot at python.org (buildbot at python.org) Date: Tue, 07 Oct 2008 00:21:20 +0000 Subject: [Python-checkins] buildbot failure in ppc Debian unstable 3.0 Message-ID: <20081007002120.A2F081E4002@bag.python.org> The Buildbot has detected a new failure of ppc Debian unstable 3.0. Full details are available at: http://www.python.org/dev/buildbot/all/ppc%20Debian%20unstable%203.0/builds/1628 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-debian-ppc Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: brett.cannon BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_smtplib make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Tue Oct 7 02:35:45 2008 From: buildbot at python.org (buildbot at python.org) Date: Tue, 07 Oct 2008 00:35:45 +0000 Subject: [Python-checkins] buildbot failure in g4 osx.4 3.0 Message-ID: <20081007003545.C7B3E1E4002@bag.python.org> The Buildbot has detected a new failure of g4 osx.4 3.0. Full details are available at: http://www.python.org/dev/buildbot/all/g4%20osx.4%203.0/builds/1485 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: psf-g4 Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: brett.cannon BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_asynchat make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Tue Oct 7 02:36:31 2008 From: buildbot at python.org (buildbot at python.org) Date: Tue, 07 Oct 2008 00:36:31 +0000 Subject: [Python-checkins] buildbot failure in PPC64 Debian 3.0 Message-ID: <20081007003631.E4B081E4002@bag.python.org> The Buildbot has detected a new failure of PPC64 Debian 3.0. Full details are available at: http://www.python.org/dev/buildbot/all/PPC64%20Debian%203.0/builds/1731 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-debian-ppc64 Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: brett.cannon BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_smtplib make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Tue Oct 7 02:58:23 2008 From: buildbot at python.org (buildbot at python.org) Date: Tue, 07 Oct 2008 00:58:23 +0000 Subject: [Python-checkins] buildbot failure in S-390 Debian 3.0 Message-ID: <20081007005823.BB4781E402C@bag.python.org> The Buildbot has detected a new failure of S-390 Debian 3.0. Full details are available at: http://www.python.org/dev/buildbot/all/S-390%20Debian%203.0/builds/966 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-debian-s390 Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: brett.cannon BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_smtplib make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Tue Oct 7 03:21:32 2008 From: buildbot at python.org (buildbot at python.org) Date: Tue, 07 Oct 2008 01:21:32 +0000 Subject: [Python-checkins] buildbot failure in sparc Debian 3.0 Message-ID: <20081007012132.EF1711E4002@bag.python.org> The Buildbot has detected a new failure of sparc Debian 3.0. Full details are available at: http://www.python.org/dev/buildbot/all/sparc%20Debian%203.0/builds/606 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-debian-sparc Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: brett.cannon BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_subprocess make: *** [buildbottest] Error 1 sincerely, -The Buildbot From python-checkins at python.org Tue Oct 7 03:55:20 2008 From: python-checkins at python.org (skip.montanaro) Date: Tue, 7 Oct 2008 03:55:20 +0200 (CEST) Subject: [Python-checkins] r66822 - python/trunk/Lib/test/test_atexit.py Message-ID: <20081007015520.58BB91E4010@bag.python.org> Author: skip.montanaro Date: Tue Oct 7 03:55:20 2008 New Revision: 66822 Log: Simplify individual tests by defining setUp and tearDown methods. Modified: python/trunk/Lib/test/test_atexit.py Modified: python/trunk/Lib/test/test_atexit.py ============================================================================== --- python/trunk/Lib/test/test_atexit.py (original) +++ python/trunk/Lib/test/test_atexit.py Tue Oct 7 03:55:20 2008 @@ -5,86 +5,52 @@ from test import test_support class TestCase(unittest.TestCase): - def test_args(self): - # be sure args are handled properly + def setUp(self): s = StringIO.StringIO() - sys.stdout = sys.stderr = s - save_handlers = atexit._exithandlers + sys.stdout = sys.stderr = self.subst_io = s + self.save_handlers = atexit._exithandlers atexit._exithandlers = [] - try: - atexit.register(self.h1) - atexit.register(self.h4) - atexit.register(self.h4, 4, kw="abc") - atexit._run_exitfuncs() - finally: - sys.stdout = sys.__stdout__ - sys.stderr = sys.__stderr__ - atexit._exithandlers = save_handlers - self.assertEqual(s.getvalue(), "h4 (4,) {'kw': 'abc'}\nh4 () {}\nh1\n") + + def tearDown(self): + sys.stdout = sys.__stdout__ + sys.stderr = sys.__stderr__ + atexit._exithandlers = self.save_handlers + + def test_args(self): + atexit.register(self.h1) + atexit.register(self.h4) + atexit.register(self.h4, 4, kw="abc") + atexit._run_exitfuncs() + self.assertEqual(self.subst_io.getvalue(), + "h4 (4,) {'kw': 'abc'}\nh4 () {}\nh1\n") def test_badargs(self): - s = StringIO.StringIO() - sys.stdout = sys.stderr = s - save_handlers = atexit._exithandlers - atexit._exithandlers = [] - try: - atexit.register(lambda: 1, 0, 0, (x for x in (1,2)), 0, 0) - self.assertRaises(TypeError, atexit._run_exitfuncs) - finally: - sys.stdout = sys.__stdout__ - sys.stderr = sys.__stderr__ - atexit._exithandlers = save_handlers + atexit.register(lambda: 1, 0, 0, (x for x in (1,2)), 0, 0) + self.assertRaises(TypeError, atexit._run_exitfuncs) def test_order(self): - # be sure handlers are executed in reverse order - s = StringIO.StringIO() - sys.stdout = sys.stderr = s - save_handlers = atexit._exithandlers - atexit._exithandlers = [] - try: - atexit.register(self.h1) - atexit.register(self.h2) - atexit.register(self.h3) - atexit._run_exitfuncs() - finally: - sys.stdout = sys.__stdout__ - sys.stderr = sys.__stderr__ - atexit._exithandlers = save_handlers - self.assertEqual(s.getvalue(), "h3\nh2\nh1\n") + atexit.register(self.h1) + atexit.register(self.h2) + atexit.register(self.h3) + atexit._run_exitfuncs() + self.assertEqual(self.subst_io.getvalue(), "h3\nh2\nh1\n") def test_sys_override(self): # be sure a preset sys.exitfunc is handled properly - save_handlers = atexit._exithandlers - atexit._exithandlers = [] exfunc = sys.exitfunc sys.exitfunc = self.h1 reload(atexit) - s = StringIO.StringIO() - sys.stdout = sys.stderr = s try: atexit.register(self.h2) atexit._run_exitfuncs() finally: - sys.stdout = sys.__stdout__ - sys.stderr = sys.__stderr__ - atexit._exithandlers = save_handlers sys.exitfunc = exfunc - self.assertEqual(s.getvalue(), "h2\nh1\n") + self.assertEqual(self.subst_io.getvalue(), "h2\nh1\n") def test_raise(self): - # be sure raises are handled properly - s = StringIO.StringIO() - sys.stdout = sys.stderr = s - save_handlers = atexit._exithandlers - atexit._exithandlers = [] - try: - atexit.register(self.raise1) - atexit.register(self.raise2) - self.assertRaises(TypeError, atexit._run_exitfuncs) - finally: - sys.stdout = sys.__stdout__ - sys.stderr = sys.__stderr__ - atexit._exithandlers = save_handlers + atexit.register(self.raise1) + atexit.register(self.raise2) + self.assertRaises(TypeError, atexit._run_exitfuncs) ### helpers def h1(self): From python-checkins at python.org Tue Oct 7 04:02:00 2008 From: python-checkins at python.org (skip.montanaro) Date: Tue, 7 Oct 2008 04:02:00 +0200 (CEST) Subject: [Python-checkins] r66823 - python/trunk/setup.py Message-ID: <20081007020200.9D6E21E4002@bag.python.org> Author: skip.montanaro Date: Tue Oct 7 04:02:00 2008 New Revision: 66823 Log: Pay attention to -R entries in LDFLAGS. Modified: python/trunk/setup.py Modified: python/trunk/setup.py ============================================================================== --- python/trunk/setup.py (original) +++ python/trunk/setup.py Tue Oct 7 04:02:00 2008 @@ -320,12 +320,13 @@ # the environment variable is not set even though the value were passed # into configure and stored in the Makefile (issue found on OS X 10.3). for env_var, arg_name, dir_list in ( + ('LDFLAGS', '-R', self.compiler.runtime_library_dirs), ('LDFLAGS', '-L', self.compiler.library_dirs), ('CPPFLAGS', '-I', self.compiler.include_dirs)): env_val = sysconfig.get_config_var(env_var) if env_val: # To prevent optparse from raising an exception about any - # options in env_val that is doesn't know about we strip out + # options in env_val that it doesn't know about we strip out # all double dashes and any dashes followed by a character # that is not for the option we are dealing with. # From python-checkins at python.org Tue Oct 7 04:04:16 2008 From: python-checkins at python.org (skip.montanaro) Date: Tue, 7 Oct 2008 04:04:16 +0200 (CEST) Subject: [Python-checkins] r66824 - python/branches/release26-maint/setup.py Message-ID: <20081007020416.4D6DC1E4002@bag.python.org> Author: skip.montanaro Date: Tue Oct 7 04:04:16 2008 New Revision: 66824 Log: backport Modified: python/branches/release26-maint/setup.py Modified: python/branches/release26-maint/setup.py ============================================================================== --- python/branches/release26-maint/setup.py (original) +++ python/branches/release26-maint/setup.py Tue Oct 7 04:04:16 2008 @@ -320,12 +320,13 @@ # the environment variable is not set even though the value were passed # into configure and stored in the Makefile (issue found on OS X 10.3). for env_var, arg_name, dir_list in ( + ('LDFLAGS', '-R', self.compiler.runtime_library_dirs), ('LDFLAGS', '-L', self.compiler.library_dirs), ('CPPFLAGS', '-I', self.compiler.include_dirs)): env_val = sysconfig.get_config_var(env_var) if env_val: # To prevent optparse from raising an exception about any - # options in env_val that is doesn't know about we strip out + # options in env_val that it doesn't know about we strip out # all double dashes and any dashes followed by a character # that is not for the option we are dealing with. # From python-checkins at python.org Tue Oct 7 04:05:00 2008 From: python-checkins at python.org (skip.montanaro) Date: Tue, 7 Oct 2008 04:05:00 +0200 (CEST) Subject: [Python-checkins] r66825 - python/branches/release26-maint/Lib/test/test_atexit.py Message-ID: <20081007020500.7EE251E400C@bag.python.org> Author: skip.montanaro Date: Tue Oct 7 04:05:00 2008 New Revision: 66825 Log: backport Modified: python/branches/release26-maint/Lib/test/test_atexit.py Modified: python/branches/release26-maint/Lib/test/test_atexit.py ============================================================================== --- python/branches/release26-maint/Lib/test/test_atexit.py (original) +++ python/branches/release26-maint/Lib/test/test_atexit.py Tue Oct 7 04:05:00 2008 @@ -5,86 +5,52 @@ from test import test_support class TestCase(unittest.TestCase): - def test_args(self): - # be sure args are handled properly + def setUp(self): s = StringIO.StringIO() - sys.stdout = sys.stderr = s - save_handlers = atexit._exithandlers + sys.stdout = sys.stderr = self.subst_io = s + self.save_handlers = atexit._exithandlers atexit._exithandlers = [] - try: - atexit.register(self.h1) - atexit.register(self.h4) - atexit.register(self.h4, 4, kw="abc") - atexit._run_exitfuncs() - finally: - sys.stdout = sys.__stdout__ - sys.stderr = sys.__stderr__ - atexit._exithandlers = save_handlers - self.assertEqual(s.getvalue(), "h4 (4,) {'kw': 'abc'}\nh4 () {}\nh1\n") + + def tearDown(self): + sys.stdout = sys.__stdout__ + sys.stderr = sys.__stderr__ + atexit._exithandlers = self.save_handlers + + def test_args(self): + atexit.register(self.h1) + atexit.register(self.h4) + atexit.register(self.h4, 4, kw="abc") + atexit._run_exitfuncs() + self.assertEqual(self.subst_io.getvalue(), + "h4 (4,) {'kw': 'abc'}\nh4 () {}\nh1\n") def test_badargs(self): - s = StringIO.StringIO() - sys.stdout = sys.stderr = s - save_handlers = atexit._exithandlers - atexit._exithandlers = [] - try: - atexit.register(lambda: 1, 0, 0, (x for x in (1,2)), 0, 0) - self.assertRaises(TypeError, atexit._run_exitfuncs) - finally: - sys.stdout = sys.__stdout__ - sys.stderr = sys.__stderr__ - atexit._exithandlers = save_handlers + atexit.register(lambda: 1, 0, 0, (x for x in (1,2)), 0, 0) + self.assertRaises(TypeError, atexit._run_exitfuncs) def test_order(self): - # be sure handlers are executed in reverse order - s = StringIO.StringIO() - sys.stdout = sys.stderr = s - save_handlers = atexit._exithandlers - atexit._exithandlers = [] - try: - atexit.register(self.h1) - atexit.register(self.h2) - atexit.register(self.h3) - atexit._run_exitfuncs() - finally: - sys.stdout = sys.__stdout__ - sys.stderr = sys.__stderr__ - atexit._exithandlers = save_handlers - self.assertEqual(s.getvalue(), "h3\nh2\nh1\n") + atexit.register(self.h1) + atexit.register(self.h2) + atexit.register(self.h3) + atexit._run_exitfuncs() + self.assertEqual(self.subst_io.getvalue(), "h3\nh2\nh1\n") def test_sys_override(self): # be sure a preset sys.exitfunc is handled properly - save_handlers = atexit._exithandlers - atexit._exithandlers = [] exfunc = sys.exitfunc sys.exitfunc = self.h1 reload(atexit) - s = StringIO.StringIO() - sys.stdout = sys.stderr = s try: atexit.register(self.h2) atexit._run_exitfuncs() finally: - sys.stdout = sys.__stdout__ - sys.stderr = sys.__stderr__ - atexit._exithandlers = save_handlers sys.exitfunc = exfunc - self.assertEqual(s.getvalue(), "h2\nh1\n") + self.assertEqual(self.subst_io.getvalue(), "h2\nh1\n") def test_raise(self): - # be sure raises are handled properly - s = StringIO.StringIO() - sys.stdout = sys.stderr = s - save_handlers = atexit._exithandlers - atexit._exithandlers = [] - try: - atexit.register(self.raise1) - atexit.register(self.raise2) - self.assertRaises(TypeError, atexit._run_exitfuncs) - finally: - sys.stdout = sys.__stdout__ - sys.stderr = sys.__stderr__ - atexit._exithandlers = save_handlers + atexit.register(self.raise1) + atexit.register(self.raise2) + self.assertRaises(TypeError, atexit._run_exitfuncs) ### helpers def h1(self): From buildbot at python.org Tue Oct 7 04:36:37 2008 From: buildbot at python.org (buildbot at python.org) Date: Tue, 07 Oct 2008 02:36:37 +0000 Subject: [Python-checkins] buildbot failure in x86 W2k8 trunk Message-ID: <20081007023637.F24E41E404C@bag.python.org> The Buildbot has detected a new failure of x86 W2k8 trunk. Full details are available at: http://www.python.org/dev/buildbot/all/x86%20W2k8%20trunk/builds/255 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: nelson-windows Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: skip.montanaro BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_pickletools sincerely, -The Buildbot From buildbot at python.org Tue Oct 7 04:42:52 2008 From: buildbot at python.org (buildbot at python.org) Date: Tue, 07 Oct 2008 02:42:52 +0000 Subject: [Python-checkins] buildbot failure in x86 gentoo trunk Message-ID: <20081007024252.9376B1E4002@bag.python.org> The Buildbot has detected a new failure of x86 gentoo trunk. Full details are available at: http://www.python.org/dev/buildbot/all/x86%20gentoo%20trunk/builds/4230 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: norwitz-x86 Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: skip.montanaro BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_pickletools make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Tue Oct 7 04:55:44 2008 From: buildbot at python.org (buildbot at python.org) Date: Tue, 07 Oct 2008 02:55:44 +0000 Subject: [Python-checkins] buildbot failure in g4 osx.4 trunk Message-ID: <20081007025544.BFB151E4002@bag.python.org> The Buildbot has detected a new failure of g4 osx.4 trunk. Full details are available at: http://www.python.org/dev/buildbot/all/g4%20osx.4%20trunk/builds/4008 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: psf-g4 Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: skip.montanaro BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_asynchat make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Tue Oct 7 06:13:36 2008 From: buildbot at python.org (buildbot at python.org) Date: Tue, 07 Oct 2008 04:13:36 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.0 Message-ID: <20081007041336.D5BFD1E4002@bag.python.org> The Buildbot has detected a new failure of sparc solaris10 gcc 3.0. Full details are available at: http://www.python.org/dev/buildbot/all/sparc%20solaris10%20gcc%203.0/builds/641 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: loewis-sun Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: benjamin.peterson BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_posix ====================================================================== ERROR: test_getcwd_long_pathnames (test.test_posix.PosixTester) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/test/test_posix.py", line 252, in test_getcwd_long_pathnames support.rmtree(base_path) File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/test/support.py", line 98, in rmtree shutil.rmtree(path) File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/shutil.py", line 225, in rmtree onerror(os.rmdir, path, sys.exc_info()) File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/shutil.py", line 223, in rmtree os.rmdir(path) OSError: [Errno 22] Invalid argument: '/home2/buildbot/slave/3.0.loewis-sun/build/@test.getcwd/@test.getcwd' sincerely, -The Buildbot From buildbot at python.org Tue Oct 7 06:29:24 2008 From: buildbot at python.org (buildbot at python.org) Date: Tue, 07 Oct 2008 04:29:24 +0000 Subject: [Python-checkins] buildbot failure in g4 osx.4 3.0 Message-ID: <20081007042924.971CA1E4002@bag.python.org> The Buildbot has detected a new failure of g4 osx.4 3.0. Full details are available at: http://www.python.org/dev/buildbot/all/g4%20osx.4%203.0/builds/1487 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: psf-g4 Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: benjamin.peterson,skip.montanaro BUILD FAILED: failed svn sincerely, -The Buildbot From nnorwitz at gmail.com Tue Oct 7 07:22:26 2008 From: nnorwitz at gmail.com (Neal Norwitz) Date: Tue, 7 Oct 2008 01:22:26 -0400 Subject: [Python-checkins] Python Regression Test Failures doc dist (1) Message-ID: <20081007052226.GA12501@python.psfb.org> rm -rf dist mkdir -p dist # archive the HTML make html make[1]: Entering directory `/home/neal/python/r26/Doc' mkdir -p build/html build/doctrees python tools/sphinx-build.py -b html -d build/doctrees -D latex_paper_size= . build/html Sphinx v0.5, building html loading pickled environment... done building [html]: targets for 0 source files that are out of date updating environment: 0 added, 0 changed, 0 removed no targets are out of date. Build finished. The HTML pages are in build/html. make[1]: Leaving directory `/home/neal/python/r26/Doc' cp -pPR build/html dist/python-docs-html tar -C dist -cf dist/python-docs-html.tar python-docs-html bzip2 -9 -k dist/python-docs-html.tar (cd dist; zip -q -r -9 python-docs-html.zip python-docs-html) rm -r dist/python-docs-html rm dist/python-docs-html.tar # archive the text build make text make[1]: Entering directory `/home/neal/python/r26/Doc' mkdir -p build/text build/doctrees python tools/sphinx-build.py -b text -d build/doctrees -D latex_paper_size= . build/text Sphinx v0.5, building text loading pickled environment... done building [text]: targets for 0 source files that are out of date updating environment: 0 added, 0 changed, 0 removed no targets are out of date. Build finished; the text files are in build/text. make[1]: Leaving directory `/home/neal/python/r26/Doc' cp -pPR build/text dist/python-docs-text tar -C dist -cf dist/python-docs-text.tar python-docs-text bzip2 -9 -k dist/python-docs-text.tar (cd dist; zip -q -r -9 python-docs-text.zip python-docs-text) rm -r dist/python-docs-text rm dist/python-docs-text.tar # archive the A4 latex rm -r build/latex make latex PAPER=a4 make[1]: Entering directory `/home/neal/python/r26/Doc' mkdir -p build/latex build/doctrees python tools/sphinx-build.py -b latex -d build/doctrees -D latex_paper_size=a4 . build/latex Sphinx v0.5, building latex loading pickled environment... done building [latex]: all documents updating environment: 0 added, 0 changed, 0 removed processing c-api.tex... c-api/index c-api/intro c-api/veryhigh c-api/refcounting c-api/exceptions c-api/utilities c-api/sys c-api/import c-api/marshal c-api/arg c-api/conversion c-api/reflection c-api/abstract c-api/object c-api/number c-api/sequence c-api/mapping c-api/iter c-api/objbuffer c-api/concrete c-api/type c-api/none c-api/int c-api/bool c-api/long c-api/float c-api/complex c-api/bytearray c-api/string c-api/unicode c-api/buffer c-api/tuple c-api/list c-api/dict c-api/class c-api/function c-api/method c-api/file c-api/module c-api/iterator c-api/descriptor c-api/slice c-api/weakref c-api/cobject c-api/cell c-api/gen c-api/datetime c-api/set c-api/init c-api/memory c-api/objimpl c-api/allocation c-api/structures c-api/typeobj c-api/gcsupport resolving references... writing... done processing distutils.tex... distutils/index distutils/introduction distutils/setupscript distutils/configfile distutils/sourcedist distutils/builtdist distutils/packageindex distutils/uploading distutils/examples distutils/extending distutils/commandref distutils/apiref resolving references... writing... done processing documenting.tex... documenting/index documenting/intro documenting/style documenting/rest documenting/markup documenting/fromlatex documenting/sphinx resolving references... writing... done processing extending.tex... extending/index extending/extending extending/newtypes extending/building extending/windows extending/embedding resolving references... writing... done processing install.tex... install/index resolving references... writing... done processing library.tex... library/index library/intro library/functions library/constants library/objects library/stdtypes library/exceptions library/strings library/string library/re library/struct library/difflib library/stringio library/textwrap library/codecs library/unicodedata library/stringprep library/fpformat library/datatypes library/datetime library/calendar library/collections library/heapq library/bisect library/array library/sets library/sched library/mutex library/queue library/weakref library/userdict library/types library/new library/copy library/pprint library/repr library/numeric library/numbers library/math library/cmath library/decimal library/fractions library/random library/itertools library/functools library/operator library/filesys library/os.path library/fileinput library/stat library/statvfs library/filecmp library/tempfile library/glob library/fnmatch library/linecache library/shutil library/dircache library/macpath library/persistence library/pickle library/copy_reg library/shelve library/marshal library/anydbm library/whichdb library/dbm library/gdbm library/dbhash library/bsddb library/dumbdbm library/sqlite3 library/archiving library/zlib library/gzip library/bz2 library/zipfile library/tarfile library/fileformats library/csv library/configparser library/robotparser library/netrc library/xdrlib library/plistlib library/crypto library/hashlib library/hmac library/md5 library/sha library/allos library/os library/io library/time library/optparse library/getopt library/logging library/getpass library/curses library/curses.ascii library/curses.panel library/platform library/errno library/ctypes library/someos library/select library/threading library/thread library/dummy_threading library/dummy_thread library/multiprocessing library/mmap library/readline library/rlcompleter library/ipc library/subprocess library/socket library/ssl library/signal library/popen2 library/asyncore library/asynchat library/netdata library/email library/email.message library/email.parser library/email.generator library/email.mime library/email.header library/email.charset library/email.encoders library/email.errors library/email.util library/email.iterators library/email-examples library/json library/mailcap library/mailbox library/mhlib library/mimetools library/mimetypes library/mimewriter library/mimify library/multifile library/rfc822 library/base64 library/binhex library/binascii library/quopri library/uu library/markup library/htmlparser library/sgmllib library/htmllib library/pyexpat library/xml.dom library/xml.dom.minidom library/xml.dom.pulldom library/xml.sax library/xml.sax.handler library/xml.sax.utils library/xml.sax.reader library/xml.etree.elementtree library/internet library/webbrowser library/cgi library/cgitb library/wsgiref library/urllib library/urllib2 library/httplib library/ftplib library/poplib library/imaplib library/nntplib library/smtplib library/smtpd library/telnetlib library/uuid library/urlparse library/socketserver library/basehttpserver library/simplehttpserver library/cgihttpserver library/cookielib library/cookie library/xmlrpclib library/simplexmlrpcserver library/docxmlrpcserver library/mm library/audioop library/imageop library/aifc library/sunau library/wave library/chunk library/colorsys library/imghdr library/sndhdr library/ossaudiodev library/i18n library/gettext library/locale library/frameworks library/cmd library/shlex library/tk library/tkinter library/tix library/scrolledtext library/turtle library/idle library/othergui library/development library/pydoc library/doctest library/unittest library/2to3 library/test library/debug library/bdb library/pdb library/profile library/hotshot library/timeit library/trace library/python library/sys library/__builtin__ library/future_builtins library/__main__ library/warnings library/contextlib library/abc library/atexit library/traceback library/__future__ library/gc library/inspect library/site library/user library/fpectl library/custominterp library/code library/codeop library/restricted library/rexec library/bastion library/modules library/imp library/imputil library/zipimport library/pkgutil library/modulefinder library/runpy library/language library/parser library/ast library/symtable library/symbol library/token library/keyword library/tokenize library/tabnanny library/pyclbr library/py_compile library/compileall library/dis library/pickletools library/distutils library/compiler library/misc library/formatter library/windows library/msilib library/msvcrt library/_winreg library/winsound library/unix library/posix library/pwd library/spwd library/grp library/crypt library/dl library/termios library/tty library/pty library/fcntl library/pipes library/posixfile library/resource library/nis library/syslog library/commands library/mac library/ic library/macos library/macostools library/easydialogs library/framework library/autogil library/carbon library/colorpicker library/macosa library/gensuitemodule library/aetools library/aepack library/aetypes library/miniaeframe library/sgi library/al library/cd library/fl library/fm library/gl library/imgfile library/jpeg library/sun library/sunaudio library/undoc resolving references... writing... done processing reference.tex... reference/index reference/introduction reference/lexical_analysis reference/datamodel reference/executionmodel reference/expressions reference/simple_stmts reference/compound_stmts reference/toplevel_components reference/grammar resolving references... writing... done processing tutorial.tex... tutorial/index tutorial/appetite tutorial/interpreter tutorial/introduction tutorial/controlflow tutorial/datastructures tutorial/modules tutorial/inputoutput tutorial/errors tutorial/classes tutorial/stdlib tutorial/stdlib2 tutorial/whatnow tutorial/interactive tutorial/floatingpoint resolving references... writing... done processing using.tex... using/index using/cmdline using/unix using/windows using/mac resolving references... writing... done processing whatsnew.tex... whatsnew/2.6 resolving references... writing... done processing howto-doanddont.tex... howto/doanddont resolving references... writing... done processing howto-advocacy.tex... howto/advocacy resolving references... writing... done processing howto-functional.tex... howto/functional resolving references... writing... done processing howto-regex.tex... howto/regex resolving references... writing... done processing howto-sockets.tex... howto/sockets resolving references... writing... done processing howto-urllib2.tex... howto/urllib2 resolving references... writing... done processing howto-webservers.tex... howto/webservers resolving references... writing... done processing howto-curses.tex... howto/curses resolving references... writing... done processing howto-cporting.tex... howto/cporting resolving references... writing... done processing howto-unicode.tex... howto/unicode resolving references... writing... done copying TeX support files... done build succeeded. Build finished; the LaTeX files are in build/latex. Run `make all-pdf' or `make all-ps' in that directory to run these through (pdf)latex. make[1]: Leaving directory `/home/neal/python/r26/Doc' (cd build/latex; make clean && make all-pdf && make FMT=pdf zip bz2) make[1]: Entering directory `/home/neal/python/r26/Doc/build/latex' rm -f *.pdf *.dvi *.ps rm -f *.log *.ind *.aux *.toc *.syn *.idx *.out *.ilg *.pla make[1]: Leaving directory `/home/neal/python/r26/Doc/build/latex' make[1]: Entering directory `/home/neal/python/r26/Doc/build/latex' pdflatex 'c-api.tex' This is pdfTeX, Version 3.14159-1.10b (Web2C 7.4.5) (./c-api.tex{/usr/share/texmf/pdftex/config/pdftex.cfg} LaTeX2e <2001/06/01> Babel and hyphenation patterns for american, french, german, ngerman, n ohyphenation, loaded. (./manual.cls Document Class: manual 2008/09/12 Document class (Sphinx manual) (/usr/share/texmf/tex/latex/misc/fancybox.sty Style option: `fancybox' v1.3 <2000/09/19> (tvz) ) (/usr/share/texmf/tex/latex/base/report.cls Document Class: report 2001/04/21 v1.4e Standard LaTeX document class (/usr/share/texmf/tex/latex/base/size10.clo)) (./sphinx.sty (/usr/share/texmf/tex/latex/base/textcomp.sty (/usr/share/texmf/tex/latex/base/ts1enc.def)) (/usr/share/texmf/tex/latex/fancyvrb/fancyvrb.sty Style option: `fancyvrb' v2.7, with DG/SPQR fixes <2000/03/21> (tvz) (/usr/share/texmf/tex/latex/graphics/keyval.sty)) (/usr/share/texmf/tex/latex/fancyhdr/fancyhdr.sty) (/usr/share/texmf/tex/latex/titlesec/titlesec.sty) (./tabulary.sty (/usr/share/texmf/tex/latex/tools/array.sty)) (/usr/share/texmf/tex/latex/amsmath/amsmath.sty For additional information on amsmath, use the `?' option. (/usr/share/texmf/tex/latex/amsmath/amstext.sty (/usr/share/texmf/tex/latex/amsmath/amsgen.sty)) (/usr/share/texmf/tex/latex/amsmath/amsbsy.sty) (/usr/share/texmf/tex/latex/amsmath/amsopn.sty)) (/usr/share/texmf/tex/latex/graphics/color.sty (/usr/share/texmf/tex/latex/config/color.cfg) (/usr/share/texmf/tex/latex/graphics/pdftex.def)) (/usr/share/texmf/tex/latex/hyperref/hyperref.sty (/usr/share/texmf/tex/latex/hyperref/pd1enc.def) (/usr/share/texmf/tex/latex/config/hyperref.cfg) Implicit mode ON; LaTeX internals redefined (/usr/share/texmf/tex/latex/html/url.sty)) *hyperref using default driver hpdftex* (/usr/share/texmf/tex/latex/hyperref/hpdftex.def (/usr/share/texmf/tex/latex/psnfss/pifont.sty (/usr/share/texmf/tex/latex/psnfss/upzd.fd) (/usr/share/texmf/tex/latex/psnfss/upsy.fd))) (/usr/share/texmf/tex/latex/misc/framed.sty) (/usr/share/texmf/tex/latex/graphics/graphicx.sty (/usr/share/texmf/tex/latex/graphics/graphics.sty (/usr/share/texmf/tex/latex/graphics/trig.sty) (/usr/share/texmf/tex/latex/config/graphics.cfg))) (/usr/share/texmf/pdftex/plain/misc/pdfcolor.tex)) (/usr/share/texmf/tex/latex/base/makeidx.sty)) (/usr/share/texmf/tex/latex/base/inputenc.sty ! LaTeX Error: File `utf8.def' not found. Type X to quit or to proceed, or enter new name. (Default extension: def) Enter file name: ! Emergency stop. l.118 \endinput ^^M No pages of output. Transcript written on c-api.log. make[1]: *** [c-api.pdf] Error 1 make[1]: Leaving directory `/home/neal/python/r26/Doc/build/latex' make: *** [dist] Error 2 From buildbot at python.org Tue Oct 7 08:41:25 2008 From: buildbot at python.org (buildbot at python.org) Date: Tue, 07 Oct 2008 06:41:25 +0000 Subject: [Python-checkins] buildbot failure in sparc Ubuntu 3.0 Message-ID: <20081007064125.40E751E4002@bag.python.org> The Buildbot has detected a new failure of sparc Ubuntu 3.0. Full details are available at: http://www.python.org/dev/buildbot/all/sparc%20Ubuntu%203.0/builds/686 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-ubuntu-sparc Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: benjamin.peterson,skip.montanaro BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_subprocess make: *** [buildbottest] Error 1 sincerely, -The Buildbot From ncoghlan at gmail.com Tue Oct 7 12:27:11 2008 From: ncoghlan at gmail.com (Nick Coghlan) Date: Tue, 07 Oct 2008 20:27:11 +1000 Subject: [Python-checkins] r66822 - python/trunk/Lib/test/test_atexit.py In-Reply-To: <20081007015520.58BB91E4010@bag.python.org> References: <20081007015520.58BB91E4010@bag.python.org> Message-ID: <48EB397F.6030308@gmail.com> skip.montanaro wrote: > + def tearDown(self): > + sys.stdout = sys.__stdout__ > + sys.stderr = sys.__stderr__ > + atexit._exithandlers = self.save_handlers That looks wrong to me (even though it was inherited from the existing test code) - what if the test harness had previously set sys.stdout/err to something else? Saving and restoring the streams seems like a safer option than assuming the test harness hasn't changed them. Cheers, Nick. -- Nick Coghlan | ncoghlan at gmail.com | Brisbane, Australia --------------------------------------------------------------- http://www.boredomandlaziness.org From python-checkins at python.org Tue Oct 7 15:17:54 2008 From: python-checkins at python.org (martin.v.loewis) Date: Tue, 7 Oct 2008 15:17:54 +0200 (CEST) Subject: [Python-checkins] r66831 - svn:log Message-ID: <20081007131754.CC72B1E4002@bag.python.org> Author: martin.v.loewis Revision: 66831 Property Name: svn:log Action: modified Property diff: --- old property value +++ new property value @@ -1 +1,2 @@ Issue #3740: Null-initialize module state. +Reviewed by Benjamin Peterson. From skip at pobox.com Tue Oct 7 15:55:42 2008 From: skip at pobox.com (skip at pobox.com) Date: Tue, 7 Oct 2008 08:55:42 -0500 Subject: [Python-checkins] r66822 - python/trunk/Lib/test/test_atexit.py In-Reply-To: <48EB397F.6030308@gmail.com> References: <20081007015520.58BB91E4010@bag.python.org> <48EB397F.6030308@gmail.com> Message-ID: <18667.27230.334854.329407@montanaro-dyndns-org.local> Nick> skip.montanaro wrote: >> + def tearDown(self): >> + sys.stdout = sys.__stdout__ >> + sys.stderr = sys.__stderr__ >> + atexit._exithandlers = self.save_handlers Nick> That looks wrong to me (even though it was inherited from the Nick> existing test code) - what if the test harness had previously set Nick> sys.stdout/err to something else? Saving and restoring the streams Nick> seems like a safer option than assuming the test harness hasn't Nick> changed them. Thanks. I'll take a look at it. Is there any "best practice" guide for test cases? I suspect Lib/test/README is intended to serve this function, but is mum on this particular topic. Skip From buildbot at python.org Tue Oct 7 16:28:24 2008 From: buildbot at python.org (buildbot at python.org) Date: Tue, 07 Oct 2008 14:28:24 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.0 Message-ID: <20081007142825.01E331E4002@bag.python.org> The Buildbot has detected a new failure of sparc solaris10 gcc 3.0. Full details are available at: http://www.python.org/dev/buildbot/all/sparc%20solaris10%20gcc%203.0/builds/643 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: loewis-sun Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: martin.v.loewis BUILD FAILED: failed test Excerpt from the test logfile: 3 tests failed: test_distutils test_posix test_subprocess ====================================================================== FAIL: test_get_python_inc (distutils.tests.test_sysconfig.SysconfigTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/distutils/tests/test_sysconfig.py", line 43, in test_get_python_inc self.assert_(os.path.isdir(inc_dir), inc_dir) AssertionError: /home2/buildbot/slave/3.0.loewis-sun/build/@test.getcwd/Include ====================================================================== ERROR: test_getcwd_long_pathnames (test.test_posix.PosixTester) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/test/test_posix.py", line 252, in test_getcwd_long_pathnames support.rmtree(base_path) File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/test/support.py", line 98, in rmtree shutil.rmtree(path) File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/shutil.py", line 225, in rmtree onerror(os.rmdir, path, sys.exc_info()) File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/shutil.py", line 223, in rmtree os.rmdir(path) OSError: [Errno 22] Invalid argument: '/home2/buildbot/slave/3.0.loewis-sun/build/@test.getcwd/@test.getcwd' ====================================================================== FAIL: test_executable (test.test_subprocess.ProcessTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/test/test_subprocess.py", line 115, in test_executable self.assertEqual(p.returncode, 47) AssertionError: -6 != 47 sincerely, -The Buildbot From python-checkins at python.org Tue Oct 7 17:03:40 2008 From: python-checkins at python.org (skip.montanaro) Date: Tue, 7 Oct 2008 17:03:40 +0200 (CEST) Subject: [Python-checkins] r66832 - python/trunk/Lib/test/test_atexit.py Message-ID: <20081007150340.905431E400C@bag.python.org> Author: skip.montanaro Date: Tue Oct 7 17:03:40 2008 New Revision: 66832 Log: save/restore stdout/stderr instead of relying on __*__ versions Modified: python/trunk/Lib/test/test_atexit.py Modified: python/trunk/Lib/test/test_atexit.py ============================================================================== --- python/trunk/Lib/test/test_atexit.py (original) +++ python/trunk/Lib/test/test_atexit.py Tue Oct 7 17:03:40 2008 @@ -7,13 +7,15 @@ class TestCase(unittest.TestCase): def setUp(self): s = StringIO.StringIO() + self.save_stdout = sys.stdout + self.save_stderr = sys.stderr sys.stdout = sys.stderr = self.subst_io = s self.save_handlers = atexit._exithandlers atexit._exithandlers = [] def tearDown(self): - sys.stdout = sys.__stdout__ - sys.stderr = sys.__stderr__ + sys.stdout = self.save_stdout + sys.stderr = self.save_stderr atexit._exithandlers = self.save_handlers def test_args(self): From python-checkins at python.org Tue Oct 7 17:04:16 2008 From: python-checkins at python.org (skip.montanaro) Date: Tue, 7 Oct 2008 17:04:16 +0200 (CEST) Subject: [Python-checkins] r66833 - python/branches/release26-maint/Lib/test/test_atexit.py Message-ID: <20081007150416.465E21E4002@bag.python.org> Author: skip.montanaro Date: Tue Oct 7 17:04:16 2008 New Revision: 66833 Log: backport Modified: python/branches/release26-maint/Lib/test/test_atexit.py Modified: python/branches/release26-maint/Lib/test/test_atexit.py ============================================================================== --- python/branches/release26-maint/Lib/test/test_atexit.py (original) +++ python/branches/release26-maint/Lib/test/test_atexit.py Tue Oct 7 17:04:16 2008 @@ -7,13 +7,15 @@ class TestCase(unittest.TestCase): def setUp(self): s = StringIO.StringIO() + self.save_stdout = sys.stdout + self.save_stderr = sys.stderr sys.stdout = sys.stderr = self.subst_io = s self.save_handlers = atexit._exithandlers atexit._exithandlers = [] def tearDown(self): - sys.stdout = sys.__stdout__ - sys.stderr = sys.__stderr__ + sys.stdout = self.save_stdout + sys.stderr = self.save_stderr atexit._exithandlers = self.save_handlers def test_args(self): From buildbot at python.org Tue Oct 7 17:12:16 2008 From: buildbot at python.org (buildbot at python.org) Date: Tue, 07 Oct 2008 15:12:16 +0000 Subject: [Python-checkins] buildbot failure in AMD64 W2k8 trunk Message-ID: <20081007151216.8CBA61E402D@bag.python.org> The Buildbot has detected a new failure of AMD64 W2k8 trunk. Full details are available at: http://www.python.org/dev/buildbot/all/AMD64%20W2k8%20trunk/builds/1009 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: nelson-win64 Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: skip.montanaro BUILD FAILED: failed failed slave lost sincerely, -The Buildbot From buildbot at python.org Tue Oct 7 17:12:17 2008 From: buildbot at python.org (buildbot at python.org) Date: Tue, 07 Oct 2008 15:12:17 +0000 Subject: [Python-checkins] buildbot failure in x86 W2k8 trunk Message-ID: <20081007151217.4BB361E4031@bag.python.org> The Buildbot has detected a new failure of x86 W2k8 trunk. Full details are available at: http://www.python.org/dev/buildbot/all/x86%20W2k8%20trunk/builds/257 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: nelson-windows Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: skip.montanaro BUILD FAILED: failed failed slave lost sincerely, -The Buildbot From skip at pobox.com Tue Oct 7 17:43:35 2008 From: skip at pobox.com (skip at pobox.com) Date: Tue, 7 Oct 2008 10:43:35 -0500 Subject: [Python-checkins] r66822 - python/trunk/Lib/test/test_atexit.py In-Reply-To: <18667.27230.334854.329407@montanaro-dyndns-org.local> References: <20081007015520.58BB91E4010@bag.python.org> <48EB397F.6030308@gmail.com> <18667.27230.334854.329407@montanaro-dyndns-org.local> Message-ID: <18667.33703.116267.867729@montanaro-dyndns-org.local> Nick> That looks wrong to me (even though it was inherited from the Nick> existing test code) - what if the test harness had previously set Nick> sys.stdout/err to something else? Saving and restoring the streams Nick> seems like a safer option than assuming the test harness hasn't Nick> changed them. Checked in as r66832 (trunk) and r66833 (2.6 branch). Skip From python-checkins at python.org Tue Oct 7 18:04:41 2008 From: python-checkins at python.org (georg.brandl) Date: Tue, 7 Oct 2008 18:04:41 +0200 (CEST) Subject: [Python-checkins] r66834 - peps/trunk/pep-3110.txt Message-ID: <20081007160441.8B9981E4002@bag.python.org> Author: georg.brandl Date: Tue Oct 7 18:04:41 2008 New Revision: 66834 Log: Fix w.r.t. exception tuples. Modified: peps/trunk/pep-3110.txt Modified: peps/trunk/pep-3110.txt ============================================================================== --- peps/trunk/pep-3110.txt (original) +++ peps/trunk/pep-3110.txt Tue Oct 7 18:04:41 2008 @@ -83,7 +83,7 @@ The use of ``as`` in place of the comma token means that :: - except AttributeError, os.error: + except (AttributeError, os.error): can be clearly understood as a tuple of exception classes. This new syntax was first proposed by Greg Ewing [#firstproposal]_ and @@ -93,6 +93,14 @@ to ``NAME`` means that only valid identifiers can be used as ``except`` targets. +Note that the grammar above always requires parenthesized tuples as +exception clases. That way, the ambiguous :: + + except A, B: + +which would mean different things in Python 2.x and 3.x -- leading to +hard-to-catch bugs -- cannot legally occur in 3.x code. + Semantic Changes ================ From python-checkins at python.org Tue Oct 7 20:10:47 2008 From: python-checkins at python.org (hirokazu.yamamoto) Date: Tue, 7 Oct 2008 20:10:47 +0200 (CEST) Subject: [Python-checkins] r66835 - python/trunk/Lib/test/test_dbm.py Message-ID: <20081007181047.B85041E4002@bag.python.org> Author: hirokazu.yamamoto Date: Tue Oct 7 20:10:47 2008 New Revision: 66835 Log: more intensive test on dbm. Modified: python/trunk/Lib/test/test_dbm.py Modified: python/trunk/Lib/test/test_dbm.py ============================================================================== --- python/trunk/Lib/test/test_dbm.py (original) +++ python/trunk/Lib/test/test_dbm.py Tue Oct 7 20:10:47 2008 @@ -1,9 +1,6 @@ from test import test_support import unittest -import os -import random import dbm -from dbm import error class DbmTestCase(unittest.TestCase): @@ -18,11 +15,16 @@ def test_keys(self): self.d = dbm.open(self.filename, 'c') - self.assert_(self.d.keys() == []) - self.d['a'] = 'b' - self.d['12345678910'] = '019237410982340912840198242' - self.d.keys() - self.assert_(self.d.has_key('a')) + self.assertEqual(self.d.keys(), []) + a = [('a', 'b'), ('12345678910', '019237410982340912840198242')] + for k, v in a: + self.d[k] = v + self.assertEqual(sorted(self.d.keys()), sorted(k for (k, v) in a)) + for k, v in a: + self.assert_(k in self.d) + self.assertEqual(self.d[k], v) + self.assert_('xxx' not in self.d) + self.assertRaises(KeyError, lambda: self.d['xxx']) self.d.close() def test_modes(self): From buildbot at python.org Tue Oct 7 20:56:31 2008 From: buildbot at python.org (buildbot at python.org) Date: Tue, 07 Oct 2008 18:56:31 +0000 Subject: [Python-checkins] buildbot failure in PPC64 Debian trunk Message-ID: <20081007185631.3F59A1E401C@bag.python.org> The Buildbot has detected a new failure of PPC64 Debian trunk. Full details are available at: http://www.python.org/dev/buildbot/all/PPC64%20Debian%20trunk/builds/1531 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-debian-ppc64 Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: hirokazu.yamamoto BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_dbm ====================================================================== FAIL: test_keys (test.test_dbm.DbmTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/pybot/buildarea64/trunk.klose-debian-ppc64/build/Lib/test/test_dbm.py", line 24, in test_keys self.assert_(k in self.d) AssertionError make: *** [buildbottest] Error 1 sincerely, -The Buildbot From python-checkins at python.org Tue Oct 7 22:32:16 2008 From: python-checkins at python.org (amaury.forgeotdarc) Date: Tue, 7 Oct 2008 22:32:16 +0200 (CEST) Subject: [Python-checkins] r66836 - in python/trunk: Lib/test/test_set.py Misc/NEWS Objects/setobject.c Message-ID: <20081007203216.18D1F1E4002@bag.python.org> Author: amaury.forgeotdarc Date: Tue Oct 7 22:32:10 2008 New Revision: 66836 Log: #4069: aSet.remove(otherSet) would always report the empty frozenset([]) as the missing key. Now it correctly refers to the initial otherset. Reviewed by Raymond. Will backport to 2.6. Modified: python/trunk/Lib/test/test_set.py python/trunk/Misc/NEWS python/trunk/Objects/setobject.c Modified: python/trunk/Lib/test/test_set.py ============================================================================== --- python/trunk/Lib/test/test_set.py (original) +++ python/trunk/Lib/test/test_set.py Tue Oct 7 22:32:10 2008 @@ -382,6 +382,17 @@ else: self.fail() + def test_remove_keyerror_set(self): + key = self.thetype([3, 4]) + try: + self.s.remove(key) + except KeyError as e: + self.assert_(e.args[0] is key, + "KeyError should be {0}, not {1}".format(key, + e.args[0])) + else: + self.fail() + def test_discard(self): self.s.discard('a') self.assert_('a' not in self.s) Modified: python/trunk/Misc/NEWS ============================================================================== --- python/trunk/Misc/NEWS (original) +++ python/trunk/Misc/NEWS Tue Oct 7 22:32:10 2008 @@ -12,6 +12,11 @@ Core and Builtins ----------------- +- Issue #4069: When set.remove(element) is used with a set element, the element + is temporarily replaced with an equivalent frozenset. But the eventual + KeyError would always report the empty frozenset([]) as the missing key. Now + it correctly refers to the initial element. + Library ------- Modified: python/trunk/Objects/setobject.c ============================================================================== --- python/trunk/Objects/setobject.c (original) +++ python/trunk/Objects/setobject.c Tue Oct 7 22:32:10 2008 @@ -1874,7 +1874,7 @@ static PyObject * set_remove(PySetObject *so, PyObject *key) { - PyObject *tmpkey, *result; + PyObject *tmpkey; int rv; rv = set_discard_key(so, key); @@ -1886,11 +1886,14 @@ if (tmpkey == NULL) return NULL; set_swap_bodies((PySetObject *)tmpkey, (PySetObject *)key); - result = set_remove(so, tmpkey); + rv = set_discard_key(so, tmpkey); set_swap_bodies((PySetObject *)tmpkey, (PySetObject *)key); Py_DECREF(tmpkey); - return result; - } else if (rv == DISCARD_NOTFOUND) { + if (rv == -1) + return NULL; + } + + if (rv == DISCARD_NOTFOUND) { set_key_error(key); return NULL; } From python-checkins at python.org Tue Oct 7 22:40:09 2008 From: python-checkins at python.org (amaury.forgeotdarc) Date: Tue, 7 Oct 2008 22:40:09 +0200 (CEST) Subject: [Python-checkins] r66837 - in python/branches/release26-maint: Lib/test/test_set.py Misc/NEWS Objects/setobject.c Message-ID: <20081007204009.CB9D71E4002@bag.python.org> Author: amaury.forgeotdarc Date: Tue Oct 7 22:40:09 2008 New Revision: 66837 Log: #4069: aSet.remove(otherSet) would always report the empty frozenset([]) as the missing key. Now it correctly refers to the initial otherSet. Backport of r66836. Modified: python/branches/release26-maint/Lib/test/test_set.py python/branches/release26-maint/Misc/NEWS python/branches/release26-maint/Objects/setobject.c Modified: python/branches/release26-maint/Lib/test/test_set.py ============================================================================== --- python/branches/release26-maint/Lib/test/test_set.py (original) +++ python/branches/release26-maint/Lib/test/test_set.py Tue Oct 7 22:40:09 2008 @@ -382,6 +382,17 @@ else: self.fail() + def test_remove_keyerror_set(self): + key = self.thetype([3, 4]) + try: + self.s.remove(key) + except KeyError as e: + self.assert_(e.args[0] is key, + "KeyError should be {0}, not {1}".format(key, + e.args[0])) + else: + self.fail() + def test_discard(self): self.s.discard('a') self.assert_('a' not in self.s) Modified: python/branches/release26-maint/Misc/NEWS ============================================================================== --- python/branches/release26-maint/Misc/NEWS (original) +++ python/branches/release26-maint/Misc/NEWS Tue Oct 7 22:40:09 2008 @@ -12,6 +12,11 @@ Core and Builtins ----------------- +- Issue #4069: When set.remove(element) is used with a set element, the element + is temporarily replaced with an equivalent frozenset. But the eventual + KeyError would always report the empty frozenset([]) as the missing key. Now + it correctly refers to the initial element. + - Fixed C99 style comments in several files. Python is now C89 compatible again. Modified: python/branches/release26-maint/Objects/setobject.c ============================================================================== --- python/branches/release26-maint/Objects/setobject.c (original) +++ python/branches/release26-maint/Objects/setobject.c Tue Oct 7 22:40:09 2008 @@ -1874,7 +1874,7 @@ static PyObject * set_remove(PySetObject *so, PyObject *key) { - PyObject *tmpkey, *result; + PyObject *tmpkey; int rv; rv = set_discard_key(so, key); @@ -1886,11 +1886,14 @@ if (tmpkey == NULL) return NULL; set_swap_bodies((PySetObject *)tmpkey, (PySetObject *)key); - result = set_remove(so, tmpkey); + rv = set_discard_key(so, tmpkey); set_swap_bodies((PySetObject *)tmpkey, (PySetObject *)key); Py_DECREF(tmpkey); - return result; - } else if (rv == DISCARD_NOTFOUND) { + if (rv == -1) + return NULL; + } + + if (rv == DISCARD_NOTFOUND) { set_key_error(key); return NULL; } From buildbot at python.org Tue Oct 7 23:45:41 2008 From: buildbot at python.org (buildbot at python.org) Date: Tue, 07 Oct 2008 21:45:41 +0000 Subject: [Python-checkins] buildbot failure in S-390 Debian trunk Message-ID: <20081007214541.D033C1E400C@bag.python.org> The Buildbot has detected a new failure of S-390 Debian trunk. Full details are available at: http://www.python.org/dev/buildbot/all/S-390%20Debian%20trunk/builds/1176 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-debian-s390 Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: amaury.forgeotdarc BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_pickletools make: *** [buildbottest] Error 1 sincerely, -The Buildbot From python-checkins at python.org Wed Oct 8 00:15:19 2008 From: python-checkins at python.org (barry.warsaw) Date: Wed, 8 Oct 2008 00:15:19 +0200 (CEST) Subject: [Python-checkins] r66840 - peps/trunk/pep-0361.txt Message-ID: <20081007221519.DABDD1E401C@bag.python.org> Author: barry.warsaw Date: Wed Oct 8 00:15:19 2008 New Revision: 66840 Log: updated 3.0 schedule Modified: peps/trunk/pep-0361.txt Modified: peps/trunk/pep-0361.txt ============================================================================== --- peps/trunk/pep-0361.txt (original) +++ peps/trunk/pep-0361.txt Wed Oct 8 00:15:19 2008 @@ -61,8 +61,10 @@ Sep 12 2008: Python 2.6rc1 is released Sep 17 2008: Python 2.6rc2 and 3.0rc1 released Oct 01 2008: Python 2.6 final released - ??? ?? 2008: Python 3.0rc2 planned - ??? ?? 2008: Python 3.0final planned + Oct 15 2008: Python 3.0rc2 planned + Nov 05 2008: Python 3.0rc3 planned (if needed) + Nov 19 2008: Python 3.0rc4 planned (if needed) + Dec 03 2008: Python 3.0 final planned See the public `Google calendar`_ From python-checkins at python.org Wed Oct 8 00:48:12 2008 From: python-checkins at python.org (benjamin.peterson) Date: Wed, 8 Oct 2008 00:48:12 +0200 (CEST) Subject: [Python-checkins] r66841 - sandbox/trunk/2to3/lib2to3/tests/test_pytree.py Message-ID: <20081007224812.71FFE1E4002@bag.python.org> Author: benjamin.peterson Date: Wed Oct 8 00:48:12 2008 New Revision: 66841 Log: use assertFalse and assertTrue Modified: sandbox/trunk/2to3/lib2to3/tests/test_pytree.py Modified: sandbox/trunk/2to3/lib2to3/tests/test_pytree.py ============================================================================== --- sandbox/trunk/2to3/lib2to3/tests/test_pytree.py (original) +++ sandbox/trunk/2to3/lib2to3/tests/test_pytree.py Wed Oct 8 00:48:12 2008 @@ -353,29 +353,29 @@ # Build a pattern matching a leaf pl = pytree.LeafPattern(100, "foo", name="pl") r = {} - self.assertEqual(pl.match(root, results=r), False) + self.assertFalse(pl.match(root, results=r)) self.assertEqual(r, {}) - self.assertEqual(pl.match(n1, results=r), False) + self.assertFalse(pl.match(n1, results=r)) self.assertEqual(r, {}) - self.assertEqual(pl.match(n2, results=r), False) + self.assertFalse(pl.match(n2, results=r)) self.assertEqual(r, {}) - self.assertEqual(pl.match(l1, results=r), True) + self.assertTrue(pl.match(l1, results=r)) self.assertEqual(r, {"pl": l1}) r = {} - self.assertEqual(pl.match(l2, results=r), False) + self.assertFalse(pl.match(l2, results=r)) self.assertEqual(r, {}) # Build a pattern matching a node pn = pytree.NodePattern(1000, [pl], name="pn") - self.assertEqual(pn.match(root, results=r), False) + self.assertFalse(pn.match(root, results=r)) self.assertEqual(r, {}) - self.assertEqual(pn.match(n1, results=r), False) + self.assertFalse(pn.match(n1, results=r)) self.assertEqual(r, {}) - self.assertEqual(pn.match(n2, results=r), True) + self.assertTrue(pn.match(n2, results=r)) self.assertEqual(r, {"pn": n2, "pl": l3}) r = {} - self.assertEqual(pn.match(l1, results=r), False) + self.assertFalse(pn.match(l1, results=r)) self.assertEqual(r, {}) - self.assertEqual(pn.match(l2, results=r), False) + self.assertFalse(pn.match(l2, results=r)) self.assertEqual(r, {}) def testWildcardPatterns(self): @@ -391,11 +391,11 @@ pn = pytree.NodePattern(1000, [pl], name="pn") pw = pytree.WildcardPattern([[pn], [pl, pl]], name="pw") r = {} - self.assertEqual(pw.match_seq([root], r), False) + self.assertFalse(pw.match_seq([root], r)) self.assertEqual(r, {}) - self.assertEqual(pw.match_seq([n1], r), False) + self.assertFalse(pw.match_seq([n1], r)) self.assertEqual(r, {}) - self.assertEqual(pw.match_seq([n2], r), True) + self.assertTrue(pw.match_seq([n2], r)) # These are easier to debug self.assertEqual(sorted(r.keys()), ["pl", "pn", "pw"]) self.assertEqual(r["pl"], l1) @@ -404,7 +404,7 @@ # But this is equivalent self.assertEqual(r, {"pl": l1, "pn": n2, "pw": [n2]}) r = {} - self.assertEqual(pw.match_seq([l1, l3], r), True) + self.assertTrue(pw.match_seq([l1, l3], r)) self.assertEqual(r, {"pl": l3, "pw": [l1, l3]}) self.assert_(r["pl"] is l3) r = {} From python-checkins at python.org Wed Oct 8 00:53:58 2008 From: python-checkins at python.org (benjamin.peterson) Date: Wed, 8 Oct 2008 00:53:58 +0200 (CEST) Subject: [Python-checkins] r66842 - sandbox/trunk/2to3/README Message-ID: <20081007225358.2746F1E4002@bag.python.org> Author: benjamin.peterson Date: Wed Oct 8 00:53:57 2008 New Revision: 66842 Log: we support 2.5, too Modified: sandbox/trunk/2to3/README Modified: sandbox/trunk/2to3/README ============================================================================== --- sandbox/trunk/2to3/README (original) +++ sandbox/trunk/2to3/README Wed Oct 8 00:53:57 2008 @@ -16,9 +16,9 @@ but the ``-w`` option can be given to write back converted files, creating ``.bak``-named backup files. -2to3 must be run with Python 2.6. The intended path for migrating to Python -3.x is to first migrate to 2.6 (in order to take advantage of Python 2.6's -runtime compatibility checks). +2to3 must be run with at least Python 2.5. The intended path for migrating to +Python 3.x is to first migrate to 2.6 (in order to take advantage of Python +2.6's runtime compatibility checks). Files From buildbot at python.org Wed Oct 8 01:49:42 2008 From: buildbot at python.org (buildbot at python.org) Date: Tue, 07 Oct 2008 23:49:42 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.0 Message-ID: <20081007234942.267B21E4002@bag.python.org> The Buildbot has detected a new failure of sparc solaris10 gcc 3.0. Full details are available at: http://www.python.org/dev/buildbot/all/sparc%20solaris10%20gcc%203.0/builds/645 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: loewis-sun Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: amaury.forgeotdarc BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_posix ====================================================================== ERROR: test_getcwd_long_pathnames (test.test_posix.PosixTester) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/test/test_posix.py", line 252, in test_getcwd_long_pathnames support.rmtree(base_path) File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/test/support.py", line 98, in rmtree shutil.rmtree(path) File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/shutil.py", line 225, in rmtree onerror(os.rmdir, path, sys.exc_info()) File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/shutil.py", line 223, in rmtree os.rmdir(path) OSError: [Errno 22] Invalid argument: '/home2/buildbot/slave/3.0.loewis-sun/build/@test.getcwd/@test.getcwd' sincerely, -The Buildbot From nnorwitz at gmail.com Wed Oct 8 07:22:27 2008 From: nnorwitz at gmail.com (Neal Norwitz) Date: Wed, 8 Oct 2008 01:22:27 -0400 Subject: [Python-checkins] Python Regression Test Failures doc dist (1) Message-ID: <20081008052227.GA16201@python.psfb.org> rm -rf dist mkdir -p dist # archive the HTML make html make[1]: Entering directory `/home/neal/python/r26/Doc' mkdir -p build/html build/doctrees python tools/sphinx-build.py -b html -d build/doctrees -D latex_paper_size= . build/html Sphinx v0.5, building html loading pickled environment... done building [html]: targets for 0 source files that are out of date updating environment: 0 added, 0 changed, 0 removed no targets are out of date. Build finished. The HTML pages are in build/html. make[1]: Leaving directory `/home/neal/python/r26/Doc' cp -pPR build/html dist/python-docs-html tar -C dist -cf dist/python-docs-html.tar python-docs-html bzip2 -9 -k dist/python-docs-html.tar (cd dist; zip -q -r -9 python-docs-html.zip python-docs-html) rm -r dist/python-docs-html rm dist/python-docs-html.tar # archive the text build make text make[1]: Entering directory `/home/neal/python/r26/Doc' mkdir -p build/text build/doctrees python tools/sphinx-build.py -b text -d build/doctrees -D latex_paper_size= . build/text Sphinx v0.5, building text loading pickled environment... done building [text]: targets for 0 source files that are out of date updating environment: 0 added, 0 changed, 0 removed no targets are out of date. Build finished; the text files are in build/text. make[1]: Leaving directory `/home/neal/python/r26/Doc' cp -pPR build/text dist/python-docs-text tar -C dist -cf dist/python-docs-text.tar python-docs-text bzip2 -9 -k dist/python-docs-text.tar (cd dist; zip -q -r -9 python-docs-text.zip python-docs-text) rm -r dist/python-docs-text rm dist/python-docs-text.tar # archive the A4 latex rm -r build/latex make latex PAPER=a4 make[1]: Entering directory `/home/neal/python/r26/Doc' mkdir -p build/latex build/doctrees python tools/sphinx-build.py -b latex -d build/doctrees -D latex_paper_size=a4 . build/latex Sphinx v0.5, building latex loading pickled environment... done building [latex]: all documents updating environment: 0 added, 0 changed, 0 removed processing c-api.tex... c-api/index c-api/intro c-api/veryhigh c-api/refcounting c-api/exceptions c-api/utilities c-api/sys c-api/import c-api/marshal c-api/arg c-api/conversion c-api/reflection c-api/abstract c-api/object c-api/number c-api/sequence c-api/mapping c-api/iter c-api/objbuffer c-api/concrete c-api/type c-api/none c-api/int c-api/bool c-api/long c-api/float c-api/complex c-api/bytearray c-api/string c-api/unicode c-api/buffer c-api/tuple c-api/list c-api/dict c-api/class c-api/function c-api/method c-api/file c-api/module c-api/iterator c-api/descriptor c-api/slice c-api/weakref c-api/cobject c-api/cell c-api/gen c-api/datetime c-api/set c-api/init c-api/memory c-api/objimpl c-api/allocation c-api/structures c-api/typeobj c-api/gcsupport resolving references... writing... done processing distutils.tex... distutils/index distutils/introduction distutils/setupscript distutils/configfile distutils/sourcedist distutils/builtdist distutils/packageindex distutils/uploading distutils/examples distutils/extending distutils/commandref distutils/apiref resolving references... writing... done processing documenting.tex... documenting/index documenting/intro documenting/style documenting/rest documenting/markup documenting/fromlatex documenting/sphinx resolving references... writing... done processing extending.tex... extending/index extending/extending extending/newtypes extending/building extending/windows extending/embedding resolving references... writing... done processing install.tex... install/index resolving references... writing... done processing library.tex... library/index library/intro library/functions library/constants library/objects library/stdtypes library/exceptions library/strings library/string library/re library/struct library/difflib library/stringio library/textwrap library/codecs library/unicodedata library/stringprep library/fpformat library/datatypes library/datetime library/calendar library/collections library/heapq library/bisect library/array library/sets library/sched library/mutex library/queue library/weakref library/userdict library/types library/new library/copy library/pprint library/repr library/numeric library/numbers library/math library/cmath library/decimal library/fractions library/random library/itertools library/functools library/operator library/filesys library/os.path library/fileinput library/stat library/statvfs library/filecmp library/tempfile library/glob library/fnmatch library/linecache library/shutil library/dircache library/macpath library/persistence library/pickle library/copy_reg library/shelve library/marshal library/anydbm library/whichdb library/dbm library/gdbm library/dbhash library/bsddb library/dumbdbm library/sqlite3 library/archiving library/zlib library/gzip library/bz2 library/zipfile library/tarfile library/fileformats library/csv library/configparser library/robotparser library/netrc library/xdrlib library/plistlib library/crypto library/hashlib library/hmac library/md5 library/sha library/allos library/os library/io library/time library/optparse library/getopt library/logging library/getpass library/curses library/curses.ascii library/curses.panel library/platform library/errno library/ctypes library/someos library/select library/threading library/thread library/dummy_threading library/dummy_thread library/multiprocessing library/mmap library/readline library/rlcompleter library/ipc library/subprocess library/socket library/ssl library/signal library/popen2 library/asyncore library/asynchat library/netdata library/email library/email.message library/email.parser library/email.generator library/email.mime library/email.header library/email.charset library/email.encoders library/email.errors library/email.util library/email.iterators library/email-examples library/json library/mailcap library/mailbox library/mhlib library/mimetools library/mimetypes library/mimewriter library/mimify library/multifile library/rfc822 library/base64 library/binhex library/binascii library/quopri library/uu library/markup library/htmlparser library/sgmllib library/htmllib library/pyexpat library/xml.dom library/xml.dom.minidom library/xml.dom.pulldom library/xml.sax library/xml.sax.handler library/xml.sax.utils library/xml.sax.reader library/xml.etree.elementtree library/internet library/webbrowser library/cgi library/cgitb library/wsgiref library/urllib library/urllib2 library/httplib library/ftplib library/poplib library/imaplib library/nntplib library/smtplib library/smtpd library/telnetlib library/uuid library/urlparse library/socketserver library/basehttpserver library/simplehttpserver library/cgihttpserver library/cookielib library/cookie library/xmlrpclib library/simplexmlrpcserver library/docxmlrpcserver library/mm library/audioop library/imageop library/aifc library/sunau library/wave library/chunk library/colorsys library/imghdr library/sndhdr library/ossaudiodev library/i18n library/gettext library/locale library/frameworks library/cmd library/shlex library/tk library/tkinter library/tix library/scrolledtext library/turtle library/idle library/othergui library/development library/pydoc library/doctest library/unittest library/2to3 library/test library/debug library/bdb library/pdb library/profile library/hotshot library/timeit library/trace library/python library/sys library/__builtin__ library/future_builtins library/__main__ library/warnings library/contextlib library/abc library/atexit library/traceback library/__future__ library/gc library/inspect library/site library/user library/fpectl library/custominterp library/code library/codeop library/restricted library/rexec library/bastion library/modules library/imp library/imputil library/zipimport library/pkgutil library/modulefinder library/runpy library/language library/parser library/ast library/symtable library/symbol library/token library/keyword library/tokenize library/tabnanny library/pyclbr library/py_compile library/compileall library/dis library/pickletools library/distutils library/compiler library/misc library/formatter library/windows library/msilib library/msvcrt library/_winreg library/winsound library/unix library/posix library/pwd library/spwd library/grp library/crypt library/dl library/termios library/tty library/pty library/fcntl library/pipes library/posixfile library/resource library/nis library/syslog library/commands library/mac library/ic library/macos library/macostools library/easydialogs library/framework library/autogil library/carbon library/colorpicker library/macosa library/gensuitemodule library/aetools library/aepack library/aetypes library/miniaeframe library/sgi library/al library/cd library/fl library/fm library/gl library/imgfile library/jpeg library/sun library/sunaudio library/undoc resolving references... writing... done processing reference.tex... reference/index reference/introduction reference/lexical_analysis reference/datamodel reference/executionmodel reference/expressions reference/simple_stmts reference/compound_stmts reference/toplevel_components reference/grammar resolving references... writing... done processing tutorial.tex... tutorial/index tutorial/appetite tutorial/interpreter tutorial/introduction tutorial/controlflow tutorial/datastructures tutorial/modules tutorial/inputoutput tutorial/errors tutorial/classes tutorial/stdlib tutorial/stdlib2 tutorial/whatnow tutorial/interactive tutorial/floatingpoint resolving references... writing... done processing using.tex... using/index using/cmdline using/unix using/windows using/mac resolving references... writing... done processing whatsnew.tex... whatsnew/2.6 resolving references... writing... done processing howto-doanddont.tex... howto/doanddont resolving references... writing... done processing howto-advocacy.tex... howto/advocacy resolving references... writing... done processing howto-functional.tex... howto/functional resolving references... writing... done processing howto-regex.tex... howto/regex resolving references... writing... done processing howto-sockets.tex... howto/sockets resolving references... writing... done processing howto-urllib2.tex... howto/urllib2 resolving references... writing... done processing howto-webservers.tex... howto/webservers resolving references... writing... done processing howto-curses.tex... howto/curses resolving references... writing... done processing howto-cporting.tex... howto/cporting resolving references... writing... done processing howto-unicode.tex... howto/unicode resolving references... writing... done copying TeX support files... done build succeeded. Build finished; the LaTeX files are in build/latex. Run `make all-pdf' or `make all-ps' in that directory to run these through (pdf)latex. make[1]: Leaving directory `/home/neal/python/r26/Doc' (cd build/latex; make clean && make all-pdf && make FMT=pdf zip bz2) make[1]: Entering directory `/home/neal/python/r26/Doc/build/latex' rm -f *.pdf *.dvi *.ps rm -f *.log *.ind *.aux *.toc *.syn *.idx *.out *.ilg *.pla make[1]: Leaving directory `/home/neal/python/r26/Doc/build/latex' make[1]: Entering directory `/home/neal/python/r26/Doc/build/latex' pdflatex 'c-api.tex' This is pdfTeX, Version 3.14159-1.10b (Web2C 7.4.5) (./c-api.tex{/usr/share/texmf/pdftex/config/pdftex.cfg} LaTeX2e <2001/06/01> Babel and hyphenation patterns for american, french, german, ngerman, n ohyphenation, loaded. (./manual.cls Document Class: manual 2008/09/12 Document class (Sphinx manual) (/usr/share/texmf/tex/latex/misc/fancybox.sty Style option: `fancybox' v1.3 <2000/09/19> (tvz) ) (/usr/share/texmf/tex/latex/base/report.cls Document Class: report 2001/04/21 v1.4e Standard LaTeX document class (/usr/share/texmf/tex/latex/base/size10.clo)) (./sphinx.sty (/usr/share/texmf/tex/latex/base/textcomp.sty (/usr/share/texmf/tex/latex/base/ts1enc.def)) (/usr/share/texmf/tex/latex/fancyvrb/fancyvrb.sty Style option: `fancyvrb' v2.7, with DG/SPQR fixes <2000/03/21> (tvz) (/usr/share/texmf/tex/latex/graphics/keyval.sty)) (/usr/share/texmf/tex/latex/fancyhdr/fancyhdr.sty) (/usr/share/texmf/tex/latex/titlesec/titlesec.sty) (./tabulary.sty (/usr/share/texmf/tex/latex/tools/array.sty)) (/usr/share/texmf/tex/latex/amsmath/amsmath.sty For additional information on amsmath, use the `?' option. (/usr/share/texmf/tex/latex/amsmath/amstext.sty (/usr/share/texmf/tex/latex/amsmath/amsgen.sty)) (/usr/share/texmf/tex/latex/amsmath/amsbsy.sty) (/usr/share/texmf/tex/latex/amsmath/amsopn.sty)) (/usr/share/texmf/tex/latex/graphics/color.sty (/usr/share/texmf/tex/latex/config/color.cfg) (/usr/share/texmf/tex/latex/graphics/pdftex.def)) (/usr/share/texmf/tex/latex/hyperref/hyperref.sty (/usr/share/texmf/tex/latex/hyperref/pd1enc.def) (/usr/share/texmf/tex/latex/config/hyperref.cfg) Implicit mode ON; LaTeX internals redefined (/usr/share/texmf/tex/latex/html/url.sty)) *hyperref using default driver hpdftex* (/usr/share/texmf/tex/latex/hyperref/hpdftex.def (/usr/share/texmf/tex/latex/psnfss/pifont.sty (/usr/share/texmf/tex/latex/psnfss/upzd.fd) (/usr/share/texmf/tex/latex/psnfss/upsy.fd))) (/usr/share/texmf/tex/latex/misc/framed.sty) (/usr/share/texmf/tex/latex/graphics/graphicx.sty (/usr/share/texmf/tex/latex/graphics/graphics.sty (/usr/share/texmf/tex/latex/graphics/trig.sty) (/usr/share/texmf/tex/latex/config/graphics.cfg))) (/usr/share/texmf/pdftex/plain/misc/pdfcolor.tex)) (/usr/share/texmf/tex/latex/base/makeidx.sty)) (/usr/share/texmf/tex/latex/base/inputenc.sty ! LaTeX Error: File `utf8.def' not found. Type X to quit or to proceed, or enter new name. (Default extension: def) Enter file name: ! Emergency stop. l.118 \endinput ^^M No pages of output. Transcript written on c-api.log. make[1]: *** [c-api.pdf] Error 1 make[1]: Leaving directory `/home/neal/python/r26/Doc/build/latex' make: *** [dist] Error 2 From python-checkins at python.org Wed Oct 8 10:45:17 2008 From: python-checkins at python.org (gerhard.haering) Date: Wed, 8 Oct 2008 10:45:17 +0200 (CEST) Subject: [Python-checkins] r66843 - in python/branches/release25-maint: Misc/NEWS Modules/_sqlite/connection.c Modules/_sqlite/module.c Message-ID: <20081008084517.602841E4002@bag.python.org> Author: gerhard.haering Date: Wed Oct 8 10:45:16 2008 New Revision: 66843 Log: Issue #4046: Backport of issue #3312's patch: fixes two crashes in the sqlite3 module. Modified: python/branches/release25-maint/Misc/NEWS python/branches/release25-maint/Modules/_sqlite/connection.c python/branches/release25-maint/Modules/_sqlite/module.c Modified: python/branches/release25-maint/Misc/NEWS ============================================================================== --- python/branches/release25-maint/Misc/NEWS (original) +++ python/branches/release25-maint/Misc/NEWS Wed Oct 8 10:45:16 2008 @@ -215,6 +215,9 @@ - Issue #1471: Arguments to fcntl.ioctl are no longer broken on 64-bit OpenBSD and similar platforms due to sign extension. +- Issue #3312: Fix two crashes in sqlite3. + + Tests ----- Modified: python/branches/release25-maint/Modules/_sqlite/connection.c ============================================================================== --- python/branches/release25-maint/Modules/_sqlite/connection.c (original) +++ python/branches/release25-maint/Modules/_sqlite/connection.c Wed Oct 8 10:45:16 2008 @@ -822,6 +822,7 @@ { PyObject* res; PyObject* begin_statement; + char* begin_statement_str; Py_XDECREF(self->isolation_level); @@ -854,12 +855,18 @@ return -1; } - self->begin_statement = PyMem_Malloc(PyString_Size(begin_statement) + 2); + begin_statement_str = PyString_AsString(begin_statement); + if (!begin_statement_str) { + Py_DECREF(begin_statement); + return -1; + } + self->begin_statement = PyMem_Malloc(strlen(begin_statement_str) + 2); if (!self->begin_statement) { + Py_DECREF(begin_statement); return -1; } - strcpy(self->begin_statement, PyString_AsString(begin_statement)); + strcpy(self->begin_statement, begin_statement_str); Py_DECREF(begin_statement); } Modified: python/branches/release25-maint/Modules/_sqlite/module.c ============================================================================== --- python/branches/release25-maint/Modules/_sqlite/module.c (original) +++ python/branches/release25-maint/Modules/_sqlite/module.c Wed Oct 8 10:45:16 2008 @@ -128,12 +128,15 @@ { PyTypeObject* type; PyObject* caster; + int rc; if (!PyArg_ParseTuple(args, "OO", &type, &caster)) { return NULL; } - microprotocols_add(type, (PyObject*)&SQLitePrepareProtocolType, caster); + rc = microprotocols_add(type, (PyObject*)&SQLitePrepareProtocolType, caster); + if (rc == -1) + return NULL; Py_INCREF(Py_None); return Py_None; From buildbot at python.org Wed Oct 8 11:38:00 2008 From: buildbot at python.org (buildbot at python.org) Date: Wed, 08 Oct 2008 09:38:00 +0000 Subject: [Python-checkins] buildbot failure in x86 XP-4 2.5 Message-ID: <20081008093800.3BC3B1E4002@bag.python.org> The Buildbot has detected a new failure of x86 XP-4 2.5. Full details are available at: http://www.python.org/dev/buildbot/all/x86%20XP-4%202.5/builds/252 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: bolen-windows Build Reason: Build Source Stamp: [branch branches/release25-maint] HEAD Blamelist: gerhard.haering BUILD FAILED: failed test Excerpt from the test logfile: sincerely, -The Buildbot From buildbot at python.org Wed Oct 8 11:51:13 2008 From: buildbot at python.org (buildbot at python.org) Date: Wed, 08 Oct 2008 09:51:13 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 2.5 Message-ID: <20081008095113.518771E4002@bag.python.org> The Buildbot has detected a new failure of sparc solaris10 gcc 2.5. Full details are available at: http://www.python.org/dev/buildbot/all/sparc%20solaris10%20gcc%202.5/builds/0 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: loewis-sun Build Reason: Build Source Stamp: [branch branches/release25-maint] HEAD Blamelist: gerhard.haering BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_ioctl ====================================================================== ERROR: test_ioctl_signed_unsigned_code_param (test.test_ioctl.IoctlTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home2/buildbot/slave/2.5.loewis-sun/build/Lib/test/test_ioctl.py", line 56, in test_ioctl_signed_unsigned_code_param saved_winsz = fcntl.ioctl(mfd, termios.TIOCGWINSZ, "\0"*8) IOError: [Errno 22] Invalid argument sincerely, -The Buildbot From buildbot at python.org Wed Oct 8 12:00:13 2008 From: buildbot at python.org (buildbot at python.org) Date: Wed, 08 Oct 2008 10:00:13 +0000 Subject: [Python-checkins] buildbot failure in x86 FreeBSD 2.5 Message-ID: <20081008100013.B03121E4013@bag.python.org> The Buildbot has detected a new failure of x86 FreeBSD 2.5. Full details are available at: http://www.python.org/dev/buildbot/all/x86%20FreeBSD%202.5/builds/225 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: bolen-freebsd Build Reason: Build Source Stamp: [branch branches/release25-maint] HEAD Blamelist: gerhard.haering BUILD FAILED: failed test Excerpt from the test logfile: sincerely, -The Buildbot From python-checkins at python.org Wed Oct 8 12:09:35 2008 From: python-checkins at python.org (thomas.lee) Date: Wed, 8 Oct 2008 12:09:35 +0200 (CEST) Subject: [Python-checkins] r66844 - in python/branches/tlee-ast-optimize: Doc/Makefile Doc/conf.py Doc/contents.rst Doc/library/ftplib.rst Doc/library/functions.rst Doc/library/os.rst Doc/tools/sphinxext/download.html Doc/tools/sphinxext/layout.html Doc/whatsnew/2.2.rst Doc/whatsnew/2.6.rst Doc/whatsnew/2.7.rst Include/patchlevel.h Lib/distutils/__init__.py Lib/idlelib/idlever.py Lib/lib2to3 Lib/lib2to3/fixes/fix_getcwdu.py Lib/lib2to3/fixes/fix_import.py Lib/lib2to3/pytree.py Lib/lib2to3/tests/data/README Lib/lib2to3/tests/data/infinite_recursion.py Lib/lib2to3/tests/test_fixers.py Lib/optparse.py Lib/pydoc_topics.py Lib/test/test_array.py Lib/test/test_atexit.py Lib/test/test_datetime.py Lib/test/test_dbm.py Lib/test/test_docxmlrpc.py Lib/test/test_platform.py Lib/test/test_set.py Lib/test/test_threading.py Mac/BuildScript/build-installer.py Mac/BuildScript/scripts/postflight.patch-profile Makefile.pre.in Misc/NEWS Misc/RPM/python-2.6.spec Misc/build.sh Modules/_codecsmodule.c Modules/_ctypes/libffi/src/x86/ffi.c Modules/_lsprof.c Modules/cjkcodecs/multibytecodec.c Modules/signalmodule.c Modules/tkappinit.c Objects/dictobject.c Objects/floatobject.c Objects/frameobject.c Objects/listobject.c Objects/setobject.c Objects/stringobject.c Objects/tupleobject.c Objects/unicodeobject.c PC/VC6/pythoncore.dsp PC/VC6/readme.txt PC/pyconfig.h PCbuild/pyproject.vsprops Python/_warnings.c README Tools/msi/merge.py Tools/msi/msi.py configure configure.in pyconfig.h.in setup.py Message-ID: <20081008100935.3A8B21E4002@bag.python.org> Author: thomas.lee Date: Wed Oct 8 12:09:31 2008 New Revision: 66844 Log: Merged revisions 66700-66843 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ................ r66700 | brett.cannon | 2008-10-01 03:46:03 +1000 (Wed, 01 Oct 2008) | 5 lines Fix a refleak introduced by r66677. Fix suggested by Amaury Forgeot d'Arc. Closes issue #4003. ................ r66703 | gregory.p.smith | 2008-10-01 06:41:13 +1000 (Wed, 01 Oct 2008) | 6 lines Works around issue3863: freebsd4/5/6 and os2emx are known to have OS bugs when calling fork() from a child thread. This disables that unit test (with a note printed to stderr) on those platforms. A caveat about buggy platforms is added to the os.fork documentation. ................ r66708 | andrew.macintyre | 2008-10-01 13:25:25 +1000 (Wed, 01 Oct 2008) | 9 lines fix for issue 3862: test_array fails FreeBSD 7 amd64 FreeBSD 7's underlying malloc() is behaves differently to earlier versions and seriously overcommits available memory on amd64. This may affect other 64bit platforms in some circumstances, so the scale of the problematic test is wound back. Patch by Mark Dickinson, reviewed by Martin von Loewis. ................ r66710 | martin.v.loewis | 2008-10-01 21:19:50 +1000 (Wed, 01 Oct 2008) | 2 lines Bug #3989: Package the 2to3 script (as 2to3.py) in the Windows installer. ................ r66714 | barry.warsaw | 2008-10-02 07:46:40 +1000 (Thu, 02 Oct 2008) | 2 lines Bumping to 2.6 final. ................ r66715 | barry.warsaw | 2008-10-02 08:05:43 +1000 (Thu, 02 Oct 2008) | 1 line Today is the release date ................ r66721 | barry.warsaw | 2008-10-02 13:33:51 +1000 (Thu, 02 Oct 2008) | 1 line Bump to 2.7a0 ................ r66722 | martin.v.loewis | 2008-10-02 21:44:17 +1000 (Thu, 02 Oct 2008) | 1 line Use CRT 9 policy files. ................ r66739 | christian.heimes | 2008-10-03 04:33:41 +1000 (Fri, 03 Oct 2008) | 1 line Fixed a comment to C89 style as of http://drj11.wordpress.com/2008/10/02/python-and-bragging-about-c89/ ................ r66744 | benjamin.peterson | 2008-10-03 05:00:31 +1000 (Fri, 03 Oct 2008) | 1 line we're in 2.7 now ................ r66745 | georg.brandl | 2008-10-03 05:09:47 +1000 (Fri, 03 Oct 2008) | 2 lines Forward-port r66736. ................ r66748 | christian.heimes | 2008-10-03 05:47:50 +1000 (Fri, 03 Oct 2008) | 1 line Fixed a couple more C99 comments and one occurence of inline. ................ r66752 | martin.v.loewis | 2008-10-03 06:04:47 +1000 (Fri, 03 Oct 2008) | 2 lines Add UUID for 2.7. ................ r66756 | benjamin.peterson | 2008-10-03 06:46:58 +1000 (Fri, 03 Oct 2008) | 1 line update pydoc topics ................ r66763 | neal.norwitz | 2008-10-03 14:13:08 +1000 (Fri, 03 Oct 2008) | 1 line Update the version to 2.7. Hopefully this fixes the test_distutils failure ................ r66764 | martin.v.loewis | 2008-10-03 18:59:41 +1000 (Fri, 03 Oct 2008) | 2 lines Bump version to 2.7. Regenerate. ................ r66765 | martin.v.loewis | 2008-10-03 20:59:55 +1000 (Fri, 03 Oct 2008) | 1 line Update version number to 2.7. ................ r66766 | benjamin.peterson | 2008-10-03 21:52:06 +1000 (Fri, 03 Oct 2008) | 1 line update the mac installer script ................ r66767 | andrew.kuchling | 2008-10-03 22:26:42 +1000 (Fri, 03 Oct 2008) | 1 line Docstring typo. ................ r66768 | hirokazu.yamamoto | 2008-10-04 02:07:28 +1000 (Sat, 04 Oct 2008) | 1 line Follows to python's version change (VC6) ................ r66771 | hirokazu.yamamoto | 2008-10-04 02:18:42 +1000 (Sat, 04 Oct 2008) | 2 lines Fixed following error when DocXMLRPCServer failed. UnboundLocalError: local variable 'serv' referenced before assignment ................ r66772 | andrew.kuchling | 2008-10-04 02:29:19 +1000 (Sat, 04 Oct 2008) | 1 line Mention exception in docstring ................ r66774 | andrew.kuchling | 2008-10-04 02:42:52 +1000 (Sat, 04 Oct 2008) | 1 line Typo fix ................ r66776 | hirokazu.yamamoto | 2008-10-04 03:34:49 +1000 (Sat, 04 Oct 2008) | 2 lines Issue #1706863: Fixed "'NoneType' object has no attribute 'rfind'" error when sqlite libfile not found. ................ r66783 | andrew.kuchling | 2008-10-04 11:02:29 +1000 (Sat, 04 Oct 2008) | 1 line Use correct capitalization of NaN ................ r66784 | andrew.kuchling | 2008-10-04 11:03:42 +1000 (Sat, 04 Oct 2008) | 1 line Docstring change: Specify exception raised ................ r66785 | andrew.kuchling | 2008-10-04 11:04:24 +1000 (Sat, 04 Oct 2008) | 1 line Docstring changes: Specify exceptions raised ................ r66786 | andrew.kuchling | 2008-10-04 11:05:56 +1000 (Sat, 04 Oct 2008) | 3 lines Docstring change for *partition: use same tense as other docstrings. Hyphenate left- and right-justified. Fix 'registerd' typo ................ r66787 | andrew.kuchling | 2008-10-04 13:08:56 +1000 (Sat, 04 Oct 2008) | 1 line two corrections ................ r66790 | andrew.kuchling | 2008-10-05 03:52:01 +1100 (Sun, 05 Oct 2008) | 1 line Set svn:keywords ................ r66791 | andrew.kuchling | 2008-10-05 03:52:31 +1100 (Sun, 05 Oct 2008) | 1 line Add What's New for 2.7 ................ r66792 | benjamin.peterson | 2008-10-05 04:10:14 +1100 (Sun, 05 Oct 2008) | 1 line silence Sphinx warning ................ r66793 | georg.brandl | 2008-10-05 05:26:01 +1100 (Sun, 05 Oct 2008) | 2 lines #4041: don't refer to removed and outdated modules. ................ r66797 | benjamin.peterson | 2008-10-05 07:55:50 +1100 (Sun, 05 Oct 2008) | 19 lines Merged revisions 66707,66775,66782 via svnmerge from svn+ssh://pythondev at svn.python.org/sandbox/trunk/2to3/lib2to3 ........ r66707 | benjamin.peterson | 2008-09-30 18:27:10 -0500 (Tue, 30 Sep 2008) | 1 line fix #4001: fix_imports didn't check for __init__.py before converting to relative imports ........ r66775 | collin.winter | 2008-10-03 12:08:26 -0500 (Fri, 03 Oct 2008) | 4 lines Add an alternative iterative pattern matching system that, while slower, correctly parses files that cause the faster recursive pattern matcher to fail with a recursion error. lib2to3 falls back to the iterative matcher if the recursive one fails. Fixes http://bugs.python.org/issue2532. Thanks to Nick Edds. ........ r66782 | benjamin.peterson | 2008-10-03 17:51:36 -0500 (Fri, 03 Oct 2008) | 1 line add Victor Stinner's fixer for os.getcwdu -> os.getcwd #4023 ........ ................ r66801 | andrew.kuchling | 2008-10-05 08:51:59 +1100 (Sun, 05 Oct 2008) | 1 line Punctuation fix; expand dict.update docstring to be clearer ................ r66803 | benjamin.peterson | 2008-10-05 09:15:31 +1100 (Sun, 05 Oct 2008) | 1 line fix typo ................ r66804 | andrew.kuchling | 2008-10-05 11:11:56 +1100 (Sun, 05 Oct 2008) | 1 line #1415508 from Rocky Bernstein: add docstrings for enable_interspersed_args(), disable_interspersed_args() ................ r66809 | hirokazu.yamamoto | 2008-10-06 12:57:03 +1100 (Mon, 06 Oct 2008) | 1 line Added the test for issue3762. ................ r66810 | hirokazu.yamamoto | 2008-10-06 13:41:59 +1100 (Mon, 06 Oct 2008) | 1 line More strict test. Consider the case sys.executable itself is symlink. ................ r66813 | andrew.kuchling | 2008-10-06 23:07:04 +1100 (Mon, 06 Oct 2008) | 3 lines Per Greg Ward, optparse is no longer being externally maintained. I'll look at the bugs in the Optik bug tracker and copy them to the Python bug tracker if they're still relevant. ................ r66814 | martin.v.loewis | 2008-10-07 02:15:40 +1100 (Tue, 07 Oct 2008) | 3 lines Issue #4014: Don't claim that Python has an Alpha release status, in addition to claiming it is Mature. ................ r66819 | brett.cannon | 2008-10-07 09:44:37 +1100 (Tue, 07 Oct 2008) | 4 lines Add the 'patchcheck' build target to .PHONY. Re-closes issue 3758. Thanks to Ralph Corderoy for the catch. ................ r66822 | skip.montanaro | 2008-10-07 12:55:20 +1100 (Tue, 07 Oct 2008) | 2 lines Simplify individual tests by defining setUp and tearDown methods. ................ r66823 | skip.montanaro | 2008-10-07 13:02:00 +1100 (Tue, 07 Oct 2008) | 2 lines Pay attention to -R entries in LDFLAGS. ................ r66832 | skip.montanaro | 2008-10-08 02:03:40 +1100 (Wed, 08 Oct 2008) | 1 line save/restore stdout/stderr instead of relying on __*__ versions ................ r66835 | hirokazu.yamamoto | 2008-10-08 05:10:47 +1100 (Wed, 08 Oct 2008) | 1 line more intensive test on dbm. ................ r66836 | amaury.forgeotdarc | 2008-10-08 07:32:10 +1100 (Wed, 08 Oct 2008) | 5 lines #4069: aSet.remove(otherSet) would always report the empty frozenset([]) as the missing key. Now it correctly refers to the initial otherset. Reviewed by Raymond. Will backport to 2.6. ................ Added: python/branches/tlee-ast-optimize/Doc/whatsnew/2.7.rst - copied unchanged from r66836, /python/trunk/Doc/whatsnew/2.7.rst python/branches/tlee-ast-optimize/Lib/lib2to3/fixes/fix_getcwdu.py - copied unchanged from r66836, /python/trunk/Lib/lib2to3/fixes/fix_getcwdu.py python/branches/tlee-ast-optimize/Lib/lib2to3/tests/data/README - copied unchanged from r66836, /python/trunk/Lib/lib2to3/tests/data/README python/branches/tlee-ast-optimize/Lib/lib2to3/tests/data/infinite_recursion.py - copied unchanged from r66836, /python/trunk/Lib/lib2to3/tests/data/infinite_recursion.py Modified: python/branches/tlee-ast-optimize/ (props changed) python/branches/tlee-ast-optimize/Doc/Makefile python/branches/tlee-ast-optimize/Doc/conf.py python/branches/tlee-ast-optimize/Doc/contents.rst python/branches/tlee-ast-optimize/Doc/library/ftplib.rst python/branches/tlee-ast-optimize/Doc/library/functions.rst python/branches/tlee-ast-optimize/Doc/library/os.rst python/branches/tlee-ast-optimize/Doc/tools/sphinxext/download.html python/branches/tlee-ast-optimize/Doc/tools/sphinxext/layout.html python/branches/tlee-ast-optimize/Doc/whatsnew/2.2.rst python/branches/tlee-ast-optimize/Doc/whatsnew/2.6.rst (contents, props changed) python/branches/tlee-ast-optimize/Include/patchlevel.h python/branches/tlee-ast-optimize/Lib/distutils/__init__.py python/branches/tlee-ast-optimize/Lib/idlelib/idlever.py python/branches/tlee-ast-optimize/Lib/lib2to3/ (props changed) python/branches/tlee-ast-optimize/Lib/lib2to3/fixes/fix_import.py python/branches/tlee-ast-optimize/Lib/lib2to3/pytree.py python/branches/tlee-ast-optimize/Lib/lib2to3/tests/test_fixers.py python/branches/tlee-ast-optimize/Lib/optparse.py python/branches/tlee-ast-optimize/Lib/pydoc_topics.py python/branches/tlee-ast-optimize/Lib/test/test_array.py python/branches/tlee-ast-optimize/Lib/test/test_atexit.py python/branches/tlee-ast-optimize/Lib/test/test_datetime.py python/branches/tlee-ast-optimize/Lib/test/test_dbm.py python/branches/tlee-ast-optimize/Lib/test/test_docxmlrpc.py python/branches/tlee-ast-optimize/Lib/test/test_platform.py python/branches/tlee-ast-optimize/Lib/test/test_set.py python/branches/tlee-ast-optimize/Lib/test/test_threading.py python/branches/tlee-ast-optimize/Mac/BuildScript/build-installer.py python/branches/tlee-ast-optimize/Mac/BuildScript/scripts/postflight.patch-profile python/branches/tlee-ast-optimize/Makefile.pre.in python/branches/tlee-ast-optimize/Misc/NEWS python/branches/tlee-ast-optimize/Misc/RPM/python-2.6.spec python/branches/tlee-ast-optimize/Misc/build.sh python/branches/tlee-ast-optimize/Modules/_codecsmodule.c python/branches/tlee-ast-optimize/Modules/_ctypes/libffi/src/x86/ffi.c python/branches/tlee-ast-optimize/Modules/_lsprof.c python/branches/tlee-ast-optimize/Modules/cjkcodecs/multibytecodec.c python/branches/tlee-ast-optimize/Modules/signalmodule.c python/branches/tlee-ast-optimize/Modules/tkappinit.c python/branches/tlee-ast-optimize/Objects/dictobject.c python/branches/tlee-ast-optimize/Objects/floatobject.c python/branches/tlee-ast-optimize/Objects/frameobject.c python/branches/tlee-ast-optimize/Objects/listobject.c python/branches/tlee-ast-optimize/Objects/setobject.c python/branches/tlee-ast-optimize/Objects/stringobject.c python/branches/tlee-ast-optimize/Objects/tupleobject.c python/branches/tlee-ast-optimize/Objects/unicodeobject.c python/branches/tlee-ast-optimize/PC/VC6/pythoncore.dsp python/branches/tlee-ast-optimize/PC/VC6/readme.txt python/branches/tlee-ast-optimize/PC/pyconfig.h python/branches/tlee-ast-optimize/PCbuild/pyproject.vsprops python/branches/tlee-ast-optimize/Python/_warnings.c python/branches/tlee-ast-optimize/README python/branches/tlee-ast-optimize/Tools/msi/merge.py python/branches/tlee-ast-optimize/Tools/msi/msi.py python/branches/tlee-ast-optimize/configure python/branches/tlee-ast-optimize/configure.in python/branches/tlee-ast-optimize/pyconfig.h.in python/branches/tlee-ast-optimize/setup.py Modified: python/branches/tlee-ast-optimize/Doc/Makefile ============================================================================== --- python/branches/tlee-ast-optimize/Doc/Makefile (original) +++ python/branches/tlee-ast-optimize/Doc/Makefile Wed Oct 8 12:09:31 2008 @@ -111,7 +111,7 @@ # archive the HTML make html - cp -a build/html dist/python$(DISTVERSION)-docs-html + cp -pPR build/html dist/python$(DISTVERSION)-docs-html tar -C dist -cf dist/python$(DISTVERSION)-docs-html.tar python$(DISTVERSION)-docs-html bzip2 -9 -k dist/python$(DISTVERSION)-docs-html.tar (cd dist; zip -q -r -9 python$(DISTVERSION)-docs-html.zip python$(DISTVERSION)-docs-html) @@ -120,7 +120,7 @@ # archive the text build make text - cp -a build/text dist/python$(DISTVERSION)-docs-text + cp -pPR build/text dist/python$(DISTVERSION)-docs-text tar -C dist -cf dist/python$(DISTVERSION)-docs-text.tar python$(DISTVERSION)-docs-text bzip2 -9 -k dist/python$(DISTVERSION)-docs-text.tar (cd dist; zip -q -r -9 python$(DISTVERSION)-docs-text.zip python$(DISTVERSION)-docs-text) Modified: python/branches/tlee-ast-optimize/Doc/conf.py ============================================================================== --- python/branches/tlee-ast-optimize/Doc/conf.py (original) +++ python/branches/tlee-ast-optimize/Doc/conf.py Wed Oct 8 12:09:31 2008 @@ -47,6 +47,7 @@ 'whatsnew/2.3', 'whatsnew/2.4', 'whatsnew/2.5', + 'whatsnew/2.6', 'maclib/scrap', 'library/xmllib', 'library/xml.etree', Modified: python/branches/tlee-ast-optimize/Doc/contents.rst ============================================================================== --- python/branches/tlee-ast-optimize/Doc/contents.rst (original) +++ python/branches/tlee-ast-optimize/Doc/contents.rst Wed Oct 8 12:09:31 2008 @@ -4,7 +4,7 @@ .. toctree:: - whatsnew/2.6.rst + whatsnew/2.7.rst tutorial/index.rst using/index.rst reference/index.rst Modified: python/branches/tlee-ast-optimize/Doc/library/ftplib.rst ============================================================================== --- python/branches/tlee-ast-optimize/Doc/library/ftplib.rst (original) +++ python/branches/tlee-ast-optimize/Doc/library/ftplib.rst Wed Oct 8 12:09:31 2008 @@ -315,7 +315,7 @@ .. method:: FTP.quit() Send a ``QUIT`` command to the server and close the connection. This is the - "polite" way to close a connection, but it may raise an exception of the server + "polite" way to close a connection, but it may raise an exception if the server responds with an error to the ``QUIT`` command. This implies a call to the :meth:`close` method which renders the :class:`FTP` instance useless for subsequent calls (see below). Modified: python/branches/tlee-ast-optimize/Doc/library/functions.rst ============================================================================== --- python/branches/tlee-ast-optimize/Doc/library/functions.rst (original) +++ python/branches/tlee-ast-optimize/Doc/library/functions.rst Wed Oct 8 12:09:31 2008 @@ -24,10 +24,8 @@ The function is invoked by the :keyword:`import` statement. It mainly exists so that you can replace it with another function that has a compatible interface, in order to change the semantics of the :keyword:`import` statement. - For examples of why and how you would do this, see the standard library modules - :mod:`ihooks` and :mod:`rexec`. See also the built-in module :mod:`imp`, which - defines some useful operations out of which you can build your own - :func:`__import__` function. + See the built-in module :mod:`imp`, which defines some useful operations out + of which you can build your own :func:`__import__` function. For example, the statement ``import spam`` results in the following call: ``__import__('spam', globals(), locals(), [], -1)``; the statement Modified: python/branches/tlee-ast-optimize/Doc/library/os.rst ============================================================================== --- python/branches/tlee-ast-optimize/Doc/library/os.rst (original) +++ python/branches/tlee-ast-optimize/Doc/library/os.rst Wed Oct 8 12:09:31 2008 @@ -1646,6 +1646,10 @@ Fork a child process. Return ``0`` in the child and the child's process id in the parent. If an error occurs :exc:`OSError` is raised. + + Note that some platforms including FreeBSD <= 6.3, Cygwin and OS/2 EMX have + known issues when using fork() from a thread. + Availability: Unix. Modified: python/branches/tlee-ast-optimize/Doc/tools/sphinxext/download.html ============================================================================== --- python/branches/tlee-ast-optimize/Doc/tools/sphinxext/download.html (original) +++ python/branches/tlee-ast-optimize/Doc/tools/sphinxext/download.html Wed Oct 8 12:09:31 2008 @@ -31,8 +31,8 @@
    Download (ca. 4 MB) Plain Text - Download (ca. 2 MB) - Download (ca. 1.5 MB) + Download (ca. 2 MB) + Download (ca. 1.5 MB) Modified: python/branches/tlee-ast-optimize/Doc/tools/sphinxext/layout.html ============================================================================== --- python/branches/tlee-ast-optimize/Doc/tools/sphinxext/layout.html (original) +++ python/branches/tlee-ast-optimize/Doc/tools/sphinxext/layout.html Wed Oct 8 12:09:31 2008 @@ -1,5 +1,4 @@ {% extends "!layout.html" %} {% block rootrellink %} -
  • -{{ super() }} +
  • {{ shorttitle }}{{ reldelim1 }}
  • {% endblock %} Modified: python/branches/tlee-ast-optimize/Doc/whatsnew/2.2.rst ============================================================================== --- python/branches/tlee-ast-optimize/Doc/whatsnew/2.2.rst (original) +++ python/branches/tlee-ast-optimize/Doc/whatsnew/2.2.rst Wed Oct 8 12:09:31 2008 @@ -714,7 +714,7 @@ presented with two integer arguments: it returns an integer result that's truncated down when there would be a fractional part. For example, ``3/2`` is 1, not 1.5, and ``(-1)/2`` is -1, not -0.5. This means that the results of -divison can vary unexpectedly depending on the type of the two operands and +division can vary unexpectedly depending on the type of the two operands and because Python is dynamically typed, it can be difficult to determine the possible types of the operands. Modified: python/branches/tlee-ast-optimize/Doc/whatsnew/2.6.rst ============================================================================== --- python/branches/tlee-ast-optimize/Doc/whatsnew/2.6.rst (original) +++ python/branches/tlee-ast-optimize/Doc/whatsnew/2.6.rst Wed Oct 8 12:09:31 2008 @@ -8,7 +8,7 @@ :Release: |release| :Date: |today| -.. $Id: whatsnew26.tex 55746 2007-06-02 18:33:53Z neal.norwitz $ +.. $Id$ Rules for maintenance: * Anyone can add text to this document. Do not spend very much time @@ -49,9 +49,8 @@ This saves the maintainer some effort going through the SVN logs when researching a change. -This article explains the new features in Python 2.6. The release -schedule is described in :pep:`361`; currently the final release is -scheduled for October 1 2008. +This article explains the new features in Python 2.6, released on October 1 +2008. The release schedule is described in :pep:`361`. The major theme of Python 2.6 is preparing the migration path to Python 3.0, a major redesign of the language. Whenever possible, @@ -2754,7 +2753,7 @@ returns the resulting value. A literal expression is a Python expression containing only strings, numbers, dictionaries, etc. but no statements or function calls. If you need to -evaluate an expression but accept the security risk of using an +evaluate an expression but cannot accept the security risk of using an :func:`eval` call, :func:`literal_eval` will handle it safely:: >>> literal = '("a", "b", {2:4, 3:8, 1:2})' @@ -3040,7 +3039,7 @@ ``numfree``, and a macro ``Py_MAXFREELIST`` is always defined. -* A new Makefile target, "make check", prepares the Python source tree +* A new Makefile target, "make patchcheck", prepares the Python source tree for making a patch: it fixes trailing whitespace in all modified ``.py`` files, checks whether the documentation has been changed, and reports whether the :file:`Misc/ACKS` and :file:`Misc/NEWS` files @@ -3268,6 +3267,6 @@ The author would like to thank the following people for offering suggestions, corrections and assistance with various drafts of this -article: Georg Brandl, Steve Brown, Nick Coghlan, Jim Jewett, Kent -Johnson, Chris Lambacher, Antoine Pitrou. +article: Georg Brandl, Steve Brown, Nick Coghlan, Ralph Corderoy, +Jim Jewett, Kent Johnson, Chris Lambacher, Antoine Pitrou, Brian Warner. Modified: python/branches/tlee-ast-optimize/Include/patchlevel.h ============================================================================== --- python/branches/tlee-ast-optimize/Include/patchlevel.h (original) +++ python/branches/tlee-ast-optimize/Include/patchlevel.h Wed Oct 8 12:09:31 2008 @@ -21,13 +21,13 @@ /* Version parsed out into numeric values */ /*--start constants--*/ #define PY_MAJOR_VERSION 2 -#define PY_MINOR_VERSION 6 +#define PY_MINOR_VERSION 7 #define PY_MICRO_VERSION 0 -#define PY_RELEASE_LEVEL PY_RELEASE_LEVEL_GAMMA -#define PY_RELEASE_SERIAL 2 +#define PY_RELEASE_LEVEL PY_RELEASE_LEVEL_ALPHA +#define PY_RELEASE_SERIAL 0 /* Version as a string */ -#define PY_VERSION "2.6rc2+" +#define PY_VERSION "2.7a0" /*--end constants--*/ /* Subversion Revision number of this file (not of the repository) */ Modified: python/branches/tlee-ast-optimize/Lib/distutils/__init__.py ============================================================================== --- python/branches/tlee-ast-optimize/Lib/distutils/__init__.py (original) +++ python/branches/tlee-ast-optimize/Lib/distutils/__init__.py Wed Oct 8 12:09:31 2008 @@ -22,5 +22,5 @@ # #--start constants-- -__version__ = "2.6rc2" +__version__ = "2.6" #--end constants-- Modified: python/branches/tlee-ast-optimize/Lib/idlelib/idlever.py ============================================================================== --- python/branches/tlee-ast-optimize/Lib/idlelib/idlever.py (original) +++ python/branches/tlee-ast-optimize/Lib/idlelib/idlever.py Wed Oct 8 12:09:31 2008 @@ -1 +1 @@ -IDLE_VERSION = "2.6rc2" +IDLE_VERSION = "2.6" Modified: python/branches/tlee-ast-optimize/Lib/lib2to3/fixes/fix_import.py ============================================================================== --- python/branches/tlee-ast-optimize/Lib/lib2to3/fixes/fix_import.py (original) +++ python/branches/tlee-ast-optimize/Lib/lib2to3/fixes/fix_import.py Wed Oct 8 12:09:31 2008 @@ -54,6 +54,10 @@ imp_name = imp_name.split('.', 1)[0].strip() base_path = dirname(file_path) base_path = join(base_path, imp_name) + # If there is no __init__.py next to the file its not in a package + # so can't be a relative import. + if not exists(join(dirname(base_path), '__init__.py')): + return False for ext in ['.py', pathsep, '.pyc', '.so', '.sl', '.pyd']: if exists(base_path + ext): return True Modified: python/branches/tlee-ast-optimize/Lib/lib2to3/pytree.py ============================================================================== --- python/branches/tlee-ast-optimize/Lib/lib2to3/pytree.py (original) +++ python/branches/tlee-ast-optimize/Lib/lib2to3/pytree.py Wed Oct 8 12:09:31 2008 @@ -655,10 +655,47 @@ elif self.name == "bare_name": yield self._bare_name_matches(nodes) else: - for count, r in self._recursive_matches(nodes, 0): - if self.name: - r[self.name] = nodes[:count] - yield count, r + try: + for count, r in self._recursive_matches(nodes, 0): + if self.name: + r[self.name] = nodes[:count] + yield count, r + except RuntimeError: + # We fall back to the iterative pattern matching scheme if the recursive + # scheme hits the recursion limit. + for count, r in self._iterative_matches(nodes): + if self.name: + r[self.name] = nodes[:count] + yield count, r + + def _iterative_matches(self, nodes): + """Helper to iteratively yield the matches.""" + nodelen = len(nodes) + if 0 >= self.min: + yield 0, {} + + results = [] + # generate matches that use just one alt from self.content + for alt in self.content: + for c, r in generate_matches(alt, nodes): + yield c, r + results.append((c, r)) + + # for each match, iterate down the nodes + while results: + new_results = [] + for c0, r0 in results: + # stop if the entire set of nodes has been matched + if c0 < nodelen and c0 <= self.max: + for alt in self.content: + for c1, r1 in generate_matches(alt, nodes[c0:]): + if c1 > 0: + r = {} + r.update(r0) + r.update(r1) + yield c0 + c1, r + new_results.append((c0 + c1, r)) + results = new_results def _bare_name_matches(self, nodes): """Special optimized matcher for bare_name.""" Modified: python/branches/tlee-ast-optimize/Lib/lib2to3/tests/test_fixers.py ============================================================================== --- python/branches/tlee-ast-optimize/Lib/lib2to3/tests/test_fixers.py (original) +++ python/branches/tlee-ast-optimize/Lib/lib2to3/tests/test_fixers.py Wed Oct 8 12:09:31 2008 @@ -9,10 +9,10 @@ import support # Python imports +import os import unittest from itertools import chain from operator import itemgetter -from os.path import dirname, pathsep # Local imports from .. import pygram @@ -3274,14 +3274,19 @@ # Need to replace fix_import's exists method # so we can check that it's doing the right thing self.files_checked = [] + self.present_files = set() self.always_exists = True def fake_exists(name): self.files_checked.append(name) - return self.always_exists + return self.always_exists or (name in self.present_files) from ..fixes import fix_import fix_import.exists = fake_exists + def tearDown(self): + from lib2to3.fixes import fix_import + fix_import.exists = os.path.exists + def check_both(self, b, a): self.always_exists = True FixerTestCase.check(self, b, a) @@ -3291,10 +3296,12 @@ def test_files_checked(self): def p(path): # Takes a unix path and returns a path with correct separators - return pathsep.join(path.split("/")) + return os.path.pathsep.join(path.split("/")) self.always_exists = False - expected_extensions = ('.py', pathsep, '.pyc', '.so', '.sl', '.pyd') + self.present_files = set(['__init__.py']) + expected_extensions = ('.py', os.path.pathsep, '.pyc', '.so', + '.sl', '.pyd') names_to_test = (p("/spam/eggs.py"), "ni.py", p("../../shrubbery.py")) for name in names_to_test: @@ -3302,11 +3309,32 @@ self.filename = name self.unchanged("import jam") - if dirname(name): name = dirname(name) + '/jam' - else: name = 'jam' + if os.path.dirname(name): + name = os.path.dirname(name) + '/jam' + else: + name = 'jam' expected_checks = set(name + ext for ext in expected_extensions) + expected_checks.add("__init__.py") + + self.assertEqual(set(self.files_checked), expected_checks) - self.failUnlessEqual(set(self.files_checked), expected_checks) + def test_not_in_package(self): + s = "import bar" + self.always_exists = False + self.present_files = set(["bar.py"]) + self.unchanged(s) + + def test_in_package(self): + b = "import bar" + a = "from . import bar" + self.always_exists = False + self.present_files = set(["__init__.py", "bar.py"]) + self.check(b, a) + + def test_comments_and_indent(self): + b = "import bar # Foo" + a = "from . import bar # Foo" + self.check(b, a) def test_from(self): b = "from foo import bar, baz" @@ -3577,6 +3605,67 @@ self.check(b, a) +class Test_getcwdu(FixerTestCase): + + fixer = 'getcwdu' + + def test_basic(self): + b = """os.getcwdu""" + a = """os.getcwd""" + self.check(b, a) + + b = """os.getcwdu()""" + a = """os.getcwd()""" + self.check(b, a) + + b = """meth = os.getcwdu""" + a = """meth = os.getcwd""" + self.check(b, a) + + b = """os.getcwdu(args)""" + a = """os.getcwd(args)""" + self.check(b, a) + + def test_comment(self): + b = """os.getcwdu() # Foo""" + a = """os.getcwd() # Foo""" + self.check(b, a) + + def test_unchanged(self): + s = """os.getcwd()""" + self.unchanged(s) + + s = """getcwdu()""" + self.unchanged(s) + + s = """os.getcwdb()""" + self.unchanged(s) + + def test_indentation(self): + b = """ + if 1: + os.getcwdu() + """ + a = """ + if 1: + os.getcwd() + """ + self.check(b, a) + + def test_multilation(self): + b = """os .getcwdu()""" + a = """os .getcwd()""" + self.check(b, a) + + b = """os. getcwdu""" + a = """os. getcwd""" + self.check(b, a) + + b = """os.getcwdu ( )""" + a = """os.getcwd ( )""" + self.check(b, a) + + if __name__ == "__main__": import __main__ support.run_all_tests(__main__) Modified: python/branches/tlee-ast-optimize/Lib/optparse.py ============================================================================== --- python/branches/tlee-ast-optimize/Lib/optparse.py (original) +++ python/branches/tlee-ast-optimize/Lib/optparse.py Wed Oct 8 12:09:31 2008 @@ -1,21 +1,13 @@ -"""optparse - a powerful, extensible, and easy-to-use option parser. +"""A powerful, extensible, and easy-to-use option parser. By Greg Ward -Originally distributed as Optik; see http://optik.sourceforge.net/ . - -If you have problems with this module, please do not file bugs, -patches, or feature requests with Python; instead, use Optik's -SourceForge project page: - http://sourceforge.net/projects/optik +Originally distributed as Optik. For support, use the optik-users at lists.sourceforge.net mailing list (http://lists.sourceforge.net/lists/listinfo/optik-users). """ -# Python developers: please do not make changes to this file, since -# it is automatically generated from the Optik source code. - __version__ = "1.5.3" __all__ = ['Option', @@ -1274,9 +1266,19 @@ self.usage = usage def enable_interspersed_args(self): + """Set parsing to not stop on the first non-option, allowing + interspersing switches with command arguments. This is the + default behavior. See also disable_interspersed_args() and the + class documentation description of the attribute + allow_interspersed_args.""" self.allow_interspersed_args = True def disable_interspersed_args(self): + """Set parsing to stop on the first non-option. Use this if + you have a command processor which runs another command that + has options of its own and you want to make sure these options + don't get confused. + """ self.allow_interspersed_args = False def set_process_default_values(self, process): Modified: python/branches/tlee-ast-optimize/Lib/pydoc_topics.py ============================================================================== --- python/branches/tlee-ast-optimize/Lib/pydoc_topics.py (original) +++ python/branches/tlee-ast-optimize/Lib/pydoc_topics.py Wed Oct 8 12:09:31 2008 @@ -1,31 +1,31 @@ -# Autogenerated by Sphinx on Sun Jun 1 22:23:15 2008 +# Autogenerated by Sphinx on Thu Oct 2 15:45:36 2008 topics = {'assert': u'\nThe ``assert`` statement\n************************\n\nAssert statements are a convenient way to insert debugging assertions\ninto a program:\n\n assert_stmt ::= "assert" expression ["," expression]\n\nThe simple form, ``assert expression``, is equivalent to\n\n if __debug__:\n if not expression: raise AssertionError\n\nThe extended form, ``assert expression1, expression2``, is equivalent\nto\n\n if __debug__:\n if not expression1: raise AssertionError, expression2\n\nThese equivalences assume that ``__debug__`` and ``AssertionError``\nrefer to the built-in variables with those names. In the current\nimplementation, the built-in variable ``__debug__`` is ``True`` under\nnormal circumstances, ``False`` when optimization is requested\n(command line option -O). The current code generator emits no code\nfor an assert statement when optimization is requested at compile\ntime. Note that it is unnecessary to include the source code for the\nexpression that failed in the error message; it will be displayed as\npart of the stack trace.\n\nAssignments to ``__debug__`` are illegal. The value for the built-in\nvariable is determined when the interpreter starts.\n', - 'assignment': u'\nAssignment statements\n*********************\n\nAssignment statements are used to (re)bind names to values and to\nmodify attributes or items of mutable objects:\n\n assignment_stmt ::= (target_list "=")+ (expression_list | yield_expression)\n target_list ::= target ("," target)* [","]\n target ::= identifier\n | "(" target_list ")"\n | "[" target_list "]"\n | attributeref\n | subscription\n | slicing\n\n(See section *Primaries* for the syntax definitions for the last three\nsymbols.)\n\nAn assignment statement evaluates the expression list (remember that\nthis can be a single expression or a comma-separated list, the latter\nyielding a tuple) and assigns the single resulting object to each of\nthe target lists, from left to right.\n\nAssignment is defined recursively depending on the form of the target\n(list). When a target is part of a mutable object (an attribute\nreference, subscription or slicing), the mutable object must\nultimately perform the assignment and decide about its validity, and\nmay raise an exception if the assignment is unacceptable. The rules\nobserved by various types and the exceptions raised are given with the\ndefinition of the object types (see section *The standard type\nhierarchy*).\n\nAssignment of an object to a target list is recursively defined as\nfollows.\n\n* If the target list is a single target: The object is assigned to\n that target.\n\n* If the target list is a comma-separated list of targets: The object\n must be a sequence with the same number of items as there are\n targets in the target list, and the items are assigned, from left to\n right, to the corresponding targets. (This rule is relaxed as of\n Python 1.5; in earlier versions, the object had to be a tuple.\n Since strings are sequences, an assignment like ``a, b = "xy"`` is\n now legal as long as the string has the right length.)\n\nAssignment of an object to a single target is recursively defined as\nfollows.\n\n* If the target is an identifier (name):\n\n * If the name does not occur in a ``global`` statement in the\n current code block: the name is bound to the object in the current\n local namespace.\n\n * Otherwise: the name is bound to the object in the current global\n namespace.\n\n The name is rebound if it was already bound. This may cause the\n reference count for the object previously bound to the name to reach\n zero, causing the object to be deallocated and its destructor (if it\n has one) to be called.\n\n* If the target is a target list enclosed in parentheses or in square\n brackets: The object must be a sequence with the same number of\n items as there are targets in the target list, and its items are\n assigned, from left to right, to the corresponding targets.\n\n* If the target is an attribute reference: The primary expression in\n the reference is evaluated. It should yield an object with\n assignable attributes; if this is not the case, ``TypeError`` is\n raised. That object is then asked to assign the assigned object to\n the given attribute; if it cannot perform the assignment, it raises\n an exception (usually but not necessarily ``AttributeError``).\n\n* If the target is a subscription: The primary expression in the\n reference is evaluated. It should yield either a mutable sequence\n object (such as a list) or a mapping object (such as a dictionary).\n Next, the subscript expression is evaluated.\n\n If the primary is a mutable sequence object (such as a list), the\n subscript must yield a plain integer. If it is negative, the\n sequence\'s length is added to it. The resulting value must be a\n nonnegative integer less than the sequence\'s length, and the\n sequence is asked to assign the assigned object to its item with\n that index. If the index is out of range, ``IndexError`` is raised\n (assignment to a subscripted sequence cannot add new items to a\n list).\n\n If the primary is a mapping object (such as a dictionary), the\n subscript must have a type compatible with the mapping\'s key type,\n and the mapping is then asked to create a key/datum pair which maps\n the subscript to the assigned object. This can either replace an\n existing key/value pair with the same key value, or insert a new\n key/value pair (if no key with the same value existed).\n\n* If the target is a slicing: The primary expression in the reference\n is evaluated. It should yield a mutable sequence object (such as a\n list). The assigned object should be a sequence object of the same\n type. Next, the lower and upper bound expressions are evaluated,\n insofar they are present; defaults are zero and the sequence\'s\n length. The bounds should evaluate to (small) integers. If either\n bound is negative, the sequence\'s length is added to it. The\n resulting bounds are clipped to lie between zero and the sequence\'s\n length, inclusive. Finally, the sequence object is asked to replace\n the slice with the items of the assigned sequence. The length of\n the slice may be different from the length of the assigned sequence,\n thus changing the length of the target sequence, if the object\n allows it.\n\n(In the current implementation, the syntax for targets is taken to be\nthe same as for expressions, and invalid syntax is rejected during the\ncode generation phase, causing less detailed error messages.)\n\nWARNING: Although the definition of assignment implies that overlaps\nbetween the left-hand side and the right-hand side are \'safe\' (for\nexample ``a, b = b, a`` swaps two variables), overlaps *within* the\ncollection of assigned-to variables are not safe! For instance, the\nfollowing program prints ``[0, 2]``:\n\n x = [0, 1]\n i = 0\n i, x[i] = 1, 2\n print x\n\n\nAugmented assignment statements\n===============================\n\nAugmented assignment is the combination, in a single statement, of a\nbinary operation and an assignment statement:\n\n augmented_assignment_stmt ::= target augop (expression_list | yield_expression)\n augop ::= "+=" | "-=" | "*=" | "/=" | "%=" | "**="\n | ">>=" | "<<=" | "&=" | "^=" | "|="\n\n(See section *Primaries* for the syntax definitions for the last three\nsymbols.)\n\nAn augmented assignment evaluates the target (which, unlike normal\nassignment statements, cannot be an unpacking) and the expression\nlist, performs the binary operation specific to the type of assignment\non the two operands, and assigns the result to the original target.\nThe target is only evaluated once.\n\nAn augmented assignment expression like ``x += 1`` can be rewritten as\n``x = x + 1`` to achieve a similar, but not exactly equal effect. In\nthe augmented version, ``x`` is only evaluated once. Also, when\npossible, the actual operation is performed *in-place*, meaning that\nrather than creating a new object and assigning that to the target,\nthe old object is modified instead.\n\nWith the exception of assigning to tuples and multiple targets in a\nsingle statement, the assignment done by augmented assignment\nstatements is handled the same way as normal assignments. Similarly,\nwith the exception of the possible *in-place* behavior, the binary\noperation performed by augmented assignment is the same as the normal\nbinary operations.\n\nFor targets which are attribute references, the initial value is\nretrieved with a ``getattr()`` and the result is assigned with a\n``setattr()``. Notice that the two methods do not necessarily refer\nto the same variable. When ``getattr()`` refers to a class variable,\n``setattr()`` still writes to an instance variable. For example:\n\n class A:\n x = 3 # class variable\n a = A()\n a.x += 1 # writes a.x as 4 leaving A.x as 3\n', + 'assignment': u'\nAssignment statements\n*********************\n\nAssignment statements are used to (re)bind names to values and to\nmodify attributes or items of mutable objects:\n\n assignment_stmt ::= (target_list "=")+ (expression_list | yield_expression)\n target_list ::= target ("," target)* [","]\n target ::= identifier\n | "(" target_list ")"\n | "[" target_list "]"\n | attributeref\n | subscription\n | slicing\n\n(See section *Primaries* for the syntax definitions for the last three\nsymbols.)\n\nAn assignment statement evaluates the expression list (remember that\nthis can be a single expression or a comma-separated list, the latter\nyielding a tuple) and assigns the single resulting object to each of\nthe target lists, from left to right.\n\nAssignment is defined recursively depending on the form of the target\n(list). When a target is part of a mutable object (an attribute\nreference, subscription or slicing), the mutable object must\nultimately perform the assignment and decide about its validity, and\nmay raise an exception if the assignment is unacceptable. The rules\nobserved by various types and the exceptions raised are given with the\ndefinition of the object types (see section *The standard type\nhierarchy*).\n\nAssignment of an object to a target list is recursively defined as\nfollows.\n\n* If the target list is a single target: The object is assigned to\n that target.\n\n* If the target list is a comma-separated list of targets: The object\n must be a sequence with the same number of items as there are\n targets in the target list, and the items are assigned, from left to\n right, to the corresponding targets. (This rule is relaxed as of\n Python 1.5; in earlier versions, the object had to be a tuple.\n Since strings are sequences, an assignment like ``a, b = "xy"`` is\n now legal as long as the string has the right length.)\n\nAssignment of an object to a single target is recursively defined as\nfollows.\n\n* If the target is an identifier (name):\n\n * If the name does not occur in a ``global`` statement in the\n current code block: the name is bound to the object in the current\n local namespace.\n\n * Otherwise: the name is bound to the object in the current global\n namespace.\n\n The name is rebound if it was already bound. This may cause the\n reference count for the object previously bound to the name to reach\n zero, causing the object to be deallocated and its destructor (if it\n has one) to be called.\n\n* If the target is a target list enclosed in parentheses or in square\n brackets: The object must be a sequence with the same number of\n items as there are targets in the target list, and its items are\n assigned, from left to right, to the corresponding targets.\n\n* If the target is an attribute reference: The primary expression in\n the reference is evaluated. It should yield an object with\n assignable attributes; if this is not the case, ``TypeError`` is\n raised. That object is then asked to assign the assigned object to\n the given attribute; if it cannot perform the assignment, it raises\n an exception (usually but not necessarily ``AttributeError``).\n\n* If the target is a subscription: The primary expression in the\n reference is evaluated. It should yield either a mutable sequence\n object (such as a list) or a mapping object (such as a dictionary).\n Next, the subscript expression is evaluated.\n\n If the primary is a mutable sequence object (such as a list), the\n subscript must yield a plain integer. If it is negative, the\n sequence\'s length is added to it. The resulting value must be a\n nonnegative integer less than the sequence\'s length, and the\n sequence is asked to assign the assigned object to its item with\n that index. If the index is out of range, ``IndexError`` is raised\n (assignment to a subscripted sequence cannot add new items to a\n list).\n\n If the primary is a mapping object (such as a dictionary), the\n subscript must have a type compatible with the mapping\'s key type,\n and the mapping is then asked to create a key/datum pair which maps\n the subscript to the assigned object. This can either replace an\n existing key/value pair with the same key value, or insert a new\n key/value pair (if no key with the same value existed).\n\n* If the target is a slicing: The primary expression in the reference\n is evaluated. It should yield a mutable sequence object (such as a\n list). The assigned object should be a sequence object of the same\n type. Next, the lower and upper bound expressions are evaluated,\n insofar they are present; defaults are zero and the sequence\'s\n length. The bounds should evaluate to (small) integers. If either\n bound is negative, the sequence\'s length is added to it. The\n resulting bounds are clipped to lie between zero and the sequence\'s\n length, inclusive. Finally, the sequence object is asked to replace\n the slice with the items of the assigned sequence. The length of\n the slice may be different from the length of the assigned sequence,\n thus changing the length of the target sequence, if the object\n allows it.\n\n(In the current implementation, the syntax for targets is taken to be\nthe same as for expressions, and invalid syntax is rejected during the\ncode generation phase, causing less detailed error messages.)\n\nWARNING: Although the definition of assignment implies that overlaps\nbetween the left-hand side and the right-hand side are \'safe\' (for\nexample ``a, b = b, a`` swaps two variables), overlaps *within* the\ncollection of assigned-to variables are not safe! For instance, the\nfollowing program prints ``[0, 2]``:\n\n x = [0, 1]\n i = 0\n i, x[i] = 1, 2\n print x\n\n\nAugmented assignment statements\n===============================\n\nAugmented assignment is the combination, in a single statement, of a\nbinary operation and an assignment statement:\n\n augmented_assignment_stmt ::= target augop (expression_list | yield_expression)\n augop ::= "+=" | "-=" | "*=" | "/=" | "//=" | "%=" | "**="\n | ">>=" | "<<=" | "&=" | "^=" | "|="\n\n(See section *Primaries* for the syntax definitions for the last three\nsymbols.)\n\nAn augmented assignment evaluates the target (which, unlike normal\nassignment statements, cannot be an unpacking) and the expression\nlist, performs the binary operation specific to the type of assignment\non the two operands, and assigns the result to the original target.\nThe target is only evaluated once.\n\nAn augmented assignment expression like ``x += 1`` can be rewritten as\n``x = x + 1`` to achieve a similar, but not exactly equal effect. In\nthe augmented version, ``x`` is only evaluated once. Also, when\npossible, the actual operation is performed *in-place*, meaning that\nrather than creating a new object and assigning that to the target,\nthe old object is modified instead.\n\nWith the exception of assigning to tuples and multiple targets in a\nsingle statement, the assignment done by augmented assignment\nstatements is handled the same way as normal assignments. Similarly,\nwith the exception of the possible *in-place* behavior, the binary\noperation performed by augmented assignment is the same as the normal\nbinary operations.\n\nFor targets which are attribute references, the initial value is\nretrieved with a ``getattr()`` and the result is assigned with a\n``setattr()``. Notice that the two methods do not necessarily refer\nto the same variable. When ``getattr()`` refers to a class variable,\n``setattr()`` still writes to an instance variable. For example:\n\n class A:\n x = 3 # class variable\n a = A()\n a.x += 1 # writes a.x as 4 leaving A.x as 3\n', 'atom-identifiers': u'\nIdentifiers (Names)\n*******************\n\nAn identifier occurring as an atom is a name. See section\n*Identifiers and keywords* for lexical definition and section *Naming\nand binding* for documentation of naming and binding.\n\nWhen the name is bound to an object, evaluation of the atom yields\nthat object. When a name is not bound, an attempt to evaluate it\nraises a ``NameError`` exception.\n\n**Private name mangling:** When an identifier that textually occurs in\na class definition begins with two or more underscore characters and\ndoes not end in two or more underscores, it is considered a *private\nname* of that class. Private names are transformed to a longer form\nbefore code is generated for them. The transformation inserts the\nclass name in front of the name, with leading underscores removed, and\na single underscore inserted in front of the class name. For example,\nthe identifier ``__spam`` occurring in a class named ``Ham`` will be\ntransformed to ``_Ham__spam``. This transformation is independent of\nthe syntactical context in which the identifier is used. If the\ntransformed name is extremely long (longer than 255 characters),\nimplementation defined truncation may happen. If the class name\nconsists only of underscores, no transformation is done.\n', 'atom-literals': u"\nLiterals\n********\n\nPython supports string literals and various numeric literals:\n\n literal ::= stringliteral | integer | longinteger\n | floatnumber | imagnumber\n\nEvaluation of a literal yields an object of the given type (string,\ninteger, long integer, floating point number, complex number) with the\ngiven value. The value may be approximated in the case of floating\npoint and imaginary (complex) literals. See section *Literals* for\ndetails.\n\nAll literals correspond to immutable data types, and hence the\nobject's identity is less important than its value. Multiple\nevaluations of literals with the same value (either the same\noccurrence in the program text or a different occurrence) may obtain\nthe same object or a different object with the same value.\n", - 'attribute-access': u'\nCustomizing attribute access\n****************************\n\nThe following methods can be defined to customize the meaning of\nattribute access (use of, assignment to, or deletion of ``x.name``)\nfor class instances.\n\nobject.__getattr__(self, name)\n\n Called when an attribute lookup has not found the attribute in the\n usual places (i.e. it is not an instance attribute nor is it found\n in the class tree for ``self``). ``name`` is the attribute name.\n This method should return the (computed) attribute value or raise\n an ``AttributeError`` exception.\n\n Note that if the attribute is found through the normal mechanism,\n ``__getattr__()`` is not called. (This is an intentional asymmetry\n between ``__getattr__()`` and ``__setattr__()``.) This is done both\n for efficiency reasons and because otherwise ``__setattr__()``\n would have no way to access other attributes of the instance. Note\n that at least for instance variables, you can fake total control by\n not inserting any values in the instance attribute dictionary (but\n instead inserting them in another object). See the\n ``__getattribute__()`` method below for a way to actually get total\n control in new-style classes.\n\nobject.__setattr__(self, name, value)\n\n Called when an attribute assignment is attempted. This is called\n instead of the normal mechanism (i.e. store the value in the\n instance dictionary). *name* is the attribute name, *value* is the\n value to be assigned to it.\n\n If ``__setattr__()`` wants to assign to an instance attribute, it\n should not simply execute ``self.name = value`` --- this would\n cause a recursive call to itself. Instead, it should insert the\n value in the dictionary of instance attributes, e.g.,\n ``self.__dict__[name] = value``. For new-style classes, rather\n than accessing the instance dictionary, it should call the base\n class method with the same name, for example,\n ``object.__setattr__(self, name, value)``.\n\nobject.__delattr__(self, name)\n\n Like ``__setattr__()`` but for attribute deletion instead of\n assignment. This should only be implemented if ``del obj.name`` is\n meaningful for the object.\n\n\nMore attribute access for new-style classes\n===========================================\n\nThe following methods only apply to new-style classes.\n\nobject.__getattribute__(self, name)\n\n Called unconditionally to implement attribute accesses for\n instances of the class. If the class also defines\n ``__getattr__()``, the latter will not be called unless\n ``__getattribute__()`` either calls it explicitly or raises an\n ``AttributeError``. This method should return the (computed)\n attribute value or raise an ``AttributeError`` exception. In order\n to avoid infinite recursion in this method, its implementation\n should always call the base class method with the same name to\n access any attributes it needs, for example,\n ``object.__getattribute__(self, name)``.\n\n\nImplementing Descriptors\n========================\n\nThe following methods only apply when an instance of the class\ncontaining the method (a so-called *descriptor* class) appears in the\nclass dictionary of another new-style class, known as the *owner*\nclass. In the examples below, "the attribute" refers to the attribute\nwhose name is the key of the property in the owner class\'\n``__dict__``. Descriptors can only be implemented as new-style\nclasses themselves.\n\nobject.__get__(self, instance, owner)\n\n Called to get the attribute of the owner class (class attribute\n access) or of an instance of that class (instance attribute\n access). *owner* is always the owner class, while *instance* is the\n instance that the attribute was accessed through, or ``None`` when\n the attribute is accessed through the *owner*. This method should\n return the (computed) attribute value or raise an\n ``AttributeError`` exception.\n\nobject.__set__(self, instance, value)\n\n Called to set the attribute on an instance *instance* of the owner\n class to a new value, *value*.\n\nobject.__delete__(self, instance)\n\n Called to delete the attribute on an instance *instance* of the\n owner class.\n\n\nInvoking Descriptors\n====================\n\nIn general, a descriptor is an object attribute with "binding\nbehavior", one whose attribute access has been overridden by methods\nin the descriptor protocol: ``__get__()``, ``__set__()``, and\n``__delete__()``. If any of those methods are defined for an object,\nit is said to be a descriptor.\n\nThe default behavior for attribute access is to get, set, or delete\nthe attribute from an object\'s dictionary. For instance, ``a.x`` has a\nlookup chain starting with ``a.__dict__[\'x\']``, then\n``type(a).__dict__[\'x\']``, and continuing through the base classes of\n``type(a)`` excluding metaclasses.\n\nHowever, if the looked-up value is an object defining one of the\ndescriptor methods, then Python may override the default behavior and\ninvoke the descriptor method instead. Where this occurs in the\nprecedence chain depends on which descriptor methods were defined and\nhow they were called. Note that descriptors are only invoked for new\nstyle objects or classes (ones that subclass ``object()`` or\n``type()``).\n\nThe starting point for descriptor invocation is a binding, ``a.x``.\nHow the arguments are assembled depends on ``a``:\n\nDirect Call\n The simplest and least common call is when user code directly\n invokes a descriptor method: ``x.__get__(a)``.\n\nInstance Binding\n If binding to a new-style object instance, ``a.x`` is transformed\n into the call: ``type(a).__dict__[\'x\'].__get__(a, type(a))``.\n\nClass Binding\n If binding to a new-style class, ``A.x`` is transformed into the\n call: ``A.__dict__[\'x\'].__get__(None, A)``.\n\nSuper Binding\n If ``a`` is an instance of ``super``, then the binding ``super(B,\n obj).m()`` searches ``obj.__class__.__mro__`` for the base class\n ``A`` immediately preceding ``B`` and then invokes the descriptor\n with the call: ``A.__dict__[\'m\'].__get__(obj, A)``.\n\nFor instance bindings, the precedence of descriptor invocation depends\non the which descriptor methods are defined. Normally, data\ndescriptors define both ``__get__()`` and ``__set__()``, while non-\ndata descriptors have just the ``__get__()`` method. Data descriptors\nalways override a redefinition in an instance dictionary. In\ncontrast, non-data descriptors can be overridden by instances. [3]\n\nPython methods (including ``staticmethod()`` and ``classmethod()``)\nare implemented as non-data descriptors. Accordingly, instances can\nredefine and override methods. This allows individual instances to\nacquire behaviors that differ from other instances of the same class.\n\nThe ``property()`` function is implemented as a data descriptor.\nAccordingly, instances cannot override the behavior of a property.\n\n\n__slots__\n=========\n\nBy default, instances of both old and new-style classes have a\ndictionary for attribute storage. This wastes space for objects\nhaving very few instance variables. The space consumption can become\nacute when creating large numbers of instances.\n\nThe default can be overridden by defining *__slots__* in a new-style\nclass definition. The *__slots__* declaration takes a sequence of\ninstance variables and reserves just enough space in each instance to\nhold a value for each variable. Space is saved because *__dict__* is\nnot created for each instance.\n\n__slots__\n\n This class variable can be assigned a string, iterable, or sequence\n of strings with variable names used by instances. If defined in a\n new-style class, *__slots__* reserves space for the declared\n variables and prevents the automatic creation of *__dict__* and\n *__weakref__* for each instance.\n\n Added in version 2.2.\n\nNotes on using *__slots__*\n\n* Without a *__dict__* variable, instances cannot be assigned new\n variables not listed in the *__slots__* definition. Attempts to\n assign to an unlisted variable name raises ``AttributeError``. If\n dynamic assignment of new variables is desired, then add\n ``\'__dict__\'`` to the sequence of strings in the *__slots__*\n declaration.\n\n Changed in version 2.3: Previously, adding ``\'__dict__\'`` to the\n *__slots__* declaration would not enable the assignment of new\n attributes not specifically listed in the sequence of instance\n variable names.\n\n* Without a *__weakref__* variable for each instance, classes defining\n *__slots__* do not support weak references to its instances. If weak\n reference support is needed, then add ``\'__weakref__\'`` to the\n sequence of strings in the *__slots__* declaration.\n\n Changed in version 2.3: Previously, adding ``\'__weakref__\'`` to the\n *__slots__* declaration would not enable support for weak\n references.\n\n* *__slots__* are implemented at the class level by creating\n descriptors (*Implementing Descriptors*) for each variable name. As\n a result, class attributes cannot be used to set default values for\n instance variables defined by *__slots__*; otherwise, the class\n attribute would overwrite the descriptor assignment.\n\n* If a class defines a slot also defined in a base class, the instance\n variable defined by the base class slot is inaccessible (except by\n retrieving its descriptor directly from the base class). This\n renders the meaning of the program undefined. In the future, a\n check may be added to prevent this.\n\n* The action of a *__slots__* declaration is limited to the class\n where it is defined. As a result, subclasses will have a *__dict__*\n unless they also define *__slots__*.\n\n* *__slots__* do not work for classes derived from "variable-length"\n built-in types such as ``long``, ``str`` and ``tuple``.\n\n* Any non-string iterable may be assigned to *__slots__*. Mappings may\n also be used; however, in the future, special meaning may be\n assigned to the values corresponding to each key.\n\n* *__class__* assignment works only if both classes have the same\n *__slots__*.\n\n Changed in version 2.6: Previously, *__class__* assignment raised an\n error if either new or old class had *__slots__*.\n', + 'attribute-access': u'\nCustomizing attribute access\n****************************\n\nThe following methods can be defined to customize the meaning of\nattribute access (use of, assignment to, or deletion of ``x.name``)\nfor class instances.\n\nobject.__getattr__(self, name)\n\n Called when an attribute lookup has not found the attribute in the\n usual places (i.e. it is not an instance attribute nor is it found\n in the class tree for ``self``). ``name`` is the attribute name.\n This method should return the (computed) attribute value or raise\n an ``AttributeError`` exception.\n\n Note that if the attribute is found through the normal mechanism,\n ``__getattr__()`` is not called. (This is an intentional asymmetry\n between ``__getattr__()`` and ``__setattr__()``.) This is done both\n for efficiency reasons and because otherwise ``__getattr__()``\n would have no way to access other attributes of the instance. Note\n that at least for instance variables, you can fake total control by\n not inserting any values in the instance attribute dictionary (but\n instead inserting them in another object). See the\n ``__getattribute__()`` method below for a way to actually get total\n control in new-style classes.\n\nobject.__setattr__(self, name, value)\n\n Called when an attribute assignment is attempted. This is called\n instead of the normal mechanism (i.e. store the value in the\n instance dictionary). *name* is the attribute name, *value* is the\n value to be assigned to it.\n\n If ``__setattr__()`` wants to assign to an instance attribute, it\n should not simply execute ``self.name = value`` --- this would\n cause a recursive call to itself. Instead, it should insert the\n value in the dictionary of instance attributes, e.g.,\n ``self.__dict__[name] = value``. For new-style classes, rather\n than accessing the instance dictionary, it should call the base\n class method with the same name, for example,\n ``object.__setattr__(self, name, value)``.\n\nobject.__delattr__(self, name)\n\n Like ``__setattr__()`` but for attribute deletion instead of\n assignment. This should only be implemented if ``del obj.name`` is\n meaningful for the object.\n\n\nMore attribute access for new-style classes\n===========================================\n\nThe following methods only apply to new-style classes.\n\nobject.__getattribute__(self, name)\n\n Called unconditionally to implement attribute accesses for\n instances of the class. If the class also defines\n ``__getattr__()``, the latter will not be called unless\n ``__getattribute__()`` either calls it explicitly or raises an\n ``AttributeError``. This method should return the (computed)\n attribute value or raise an ``AttributeError`` exception. In order\n to avoid infinite recursion in this method, its implementation\n should always call the base class method with the same name to\n access any attributes it needs, for example,\n ``object.__getattribute__(self, name)``.\n\n Note: This method may still be bypassed when looking up special methods\n as the result of implicit invocation via language syntax or\n builtin functions. See *Special method lookup for new-style\n classes*.\n\n\nImplementing Descriptors\n========================\n\nThe following methods only apply when an instance of the class\ncontaining the method (a so-called *descriptor* class) appears in the\nclass dictionary of another new-style class, known as the *owner*\nclass. In the examples below, "the attribute" refers to the attribute\nwhose name is the key of the property in the owner class\'\n``__dict__``. Descriptors can only be implemented as new-style\nclasses themselves.\n\nobject.__get__(self, instance, owner)\n\n Called to get the attribute of the owner class (class attribute\n access) or of an instance of that class (instance attribute\n access). *owner* is always the owner class, while *instance* is the\n instance that the attribute was accessed through, or ``None`` when\n the attribute is accessed through the *owner*. This method should\n return the (computed) attribute value or raise an\n ``AttributeError`` exception.\n\nobject.__set__(self, instance, value)\n\n Called to set the attribute on an instance *instance* of the owner\n class to a new value, *value*.\n\nobject.__delete__(self, instance)\n\n Called to delete the attribute on an instance *instance* of the\n owner class.\n\n\nInvoking Descriptors\n====================\n\nIn general, a descriptor is an object attribute with "binding\nbehavior", one whose attribute access has been overridden by methods\nin the descriptor protocol: ``__get__()``, ``__set__()``, and\n``__delete__()``. If any of those methods are defined for an object,\nit is said to be a descriptor.\n\nThe default behavior for attribute access is to get, set, or delete\nthe attribute from an object\'s dictionary. For instance, ``a.x`` has a\nlookup chain starting with ``a.__dict__[\'x\']``, then\n``type(a).__dict__[\'x\']``, and continuing through the base classes of\n``type(a)`` excluding metaclasses.\n\nHowever, if the looked-up value is an object defining one of the\ndescriptor methods, then Python may override the default behavior and\ninvoke the descriptor method instead. Where this occurs in the\nprecedence chain depends on which descriptor methods were defined and\nhow they were called. Note that descriptors are only invoked for new\nstyle objects or classes (ones that subclass ``object()`` or\n``type()``).\n\nThe starting point for descriptor invocation is a binding, ``a.x``.\nHow the arguments are assembled depends on ``a``:\n\nDirect Call\n The simplest and least common call is when user code directly\n invokes a descriptor method: ``x.__get__(a)``.\n\nInstance Binding\n If binding to a new-style object instance, ``a.x`` is transformed\n into the call: ``type(a).__dict__[\'x\'].__get__(a, type(a))``.\n\nClass Binding\n If binding to a new-style class, ``A.x`` is transformed into the\n call: ``A.__dict__[\'x\'].__get__(None, A)``.\n\nSuper Binding\n If ``a`` is an instance of ``super``, then the binding ``super(B,\n obj).m()`` searches ``obj.__class__.__mro__`` for the base class\n ``A`` immediately preceding ``B`` and then invokes the descriptor\n with the call: ``A.__dict__[\'m\'].__get__(obj, A)``.\n\nFor instance bindings, the precedence of descriptor invocation depends\non the which descriptor methods are defined. Normally, data\ndescriptors define both ``__get__()`` and ``__set__()``, while non-\ndata descriptors have just the ``__get__()`` method. Data descriptors\nalways override a redefinition in an instance dictionary. In\ncontrast, non-data descriptors can be overridden by instances. [2]\n\nPython methods (including ``staticmethod()`` and ``classmethod()``)\nare implemented as non-data descriptors. Accordingly, instances can\nredefine and override methods. This allows individual instances to\nacquire behaviors that differ from other instances of the same class.\n\nThe ``property()`` function is implemented as a data descriptor.\nAccordingly, instances cannot override the behavior of a property.\n\n\n__slots__\n=========\n\nBy default, instances of both old and new-style classes have a\ndictionary for attribute storage. This wastes space for objects\nhaving very few instance variables. The space consumption can become\nacute when creating large numbers of instances.\n\nThe default can be overridden by defining *__slots__* in a new-style\nclass definition. The *__slots__* declaration takes a sequence of\ninstance variables and reserves just enough space in each instance to\nhold a value for each variable. Space is saved because *__dict__* is\nnot created for each instance.\n\n__slots__\n\n This class variable can be assigned a string, iterable, or sequence\n of strings with variable names used by instances. If defined in a\n new-style class, *__slots__* reserves space for the declared\n variables and prevents the automatic creation of *__dict__* and\n *__weakref__* for each instance.\n\n New in version 2.2.\n\nNotes on using *__slots__*\n\n* When inheriting from a class without *__slots__*, the *__dict__*\n attribute of that class will always be accessible, so a *__slots__*\n definition in the subclass is meaningless.\n\n* Without a *__dict__* variable, instances cannot be assigned new\n variables not listed in the *__slots__* definition. Attempts to\n assign to an unlisted variable name raises ``AttributeError``. If\n dynamic assignment of new variables is desired, then add\n ``\'__dict__\'`` to the sequence of strings in the *__slots__*\n declaration.\n\n Changed in version 2.3: Previously, adding ``\'__dict__\'`` to the\n *__slots__* declaration would not enable the assignment of new\n attributes not specifically listed in the sequence of instance\n variable names.\n\n* Without a *__weakref__* variable for each instance, classes defining\n *__slots__* do not support weak references to its instances. If weak\n reference support is needed, then add ``\'__weakref__\'`` to the\n sequence of strings in the *__slots__* declaration.\n\n Changed in version 2.3: Previously, adding ``\'__weakref__\'`` to the\n *__slots__* declaration would not enable support for weak\n references.\n\n* *__slots__* are implemented at the class level by creating\n descriptors (*Implementing Descriptors*) for each variable name. As\n a result, class attributes cannot be used to set default values for\n instance variables defined by *__slots__*; otherwise, the class\n attribute would overwrite the descriptor assignment.\n\n* If a class defines a slot also defined in a base class, the instance\n variable defined by the base class slot is inaccessible (except by\n retrieving its descriptor directly from the base class). This\n renders the meaning of the program undefined. In the future, a\n check may be added to prevent this.\n\n* The action of a *__slots__* declaration is limited to the class\n where it is defined. As a result, subclasses will have a *__dict__*\n unless they also define *__slots__*.\n\n* *__slots__* do not work for classes derived from "variable-length"\n built-in types such as ``long``, ``str`` and ``tuple``.\n\n* Any non-string iterable may be assigned to *__slots__*. Mappings may\n also be used; however, in the future, special meaning may be\n assigned to the values corresponding to each key.\n\n* *__class__* assignment works only if both classes have the same\n *__slots__*.\n\n Changed in version 2.6: Previously, *__class__* assignment raised an\n error if either new or old class had *__slots__*.\n', 'attribute-references': u'\nAttribute references\n********************\n\nAn attribute reference is a primary followed by a period and a name:\n\n attributeref ::= primary "." identifier\n\nThe primary must evaluate to an object of a type that supports\nattribute references, e.g., a module, list, or an instance. This\nobject is then asked to produce the attribute whose name is the\nidentifier. If this attribute is not available, the exception\n``AttributeError`` is raised. Otherwise, the type and value of the\nobject produced is determined by the object. Multiple evaluations of\nthe same attribute reference may yield different objects.\n', - 'augassign': u'\nAugmented assignment statements\n*******************************\n\nAugmented assignment is the combination, in a single statement, of a\nbinary operation and an assignment statement:\n\n augmented_assignment_stmt ::= target augop (expression_list | yield_expression)\n augop ::= "+=" | "-=" | "*=" | "/=" | "%=" | "**="\n | ">>=" | "<<=" | "&=" | "^=" | "|="\n\n(See section *Primaries* for the syntax definitions for the last three\nsymbols.)\n\nAn augmented assignment evaluates the target (which, unlike normal\nassignment statements, cannot be an unpacking) and the expression\nlist, performs the binary operation specific to the type of assignment\non the two operands, and assigns the result to the original target.\nThe target is only evaluated once.\n\nAn augmented assignment expression like ``x += 1`` can be rewritten as\n``x = x + 1`` to achieve a similar, but not exactly equal effect. In\nthe augmented version, ``x`` is only evaluated once. Also, when\npossible, the actual operation is performed *in-place*, meaning that\nrather than creating a new object and assigning that to the target,\nthe old object is modified instead.\n\nWith the exception of assigning to tuples and multiple targets in a\nsingle statement, the assignment done by augmented assignment\nstatements is handled the same way as normal assignments. Similarly,\nwith the exception of the possible *in-place* behavior, the binary\noperation performed by augmented assignment is the same as the normal\nbinary operations.\n\nFor targets which are attribute references, the initial value is\nretrieved with a ``getattr()`` and the result is assigned with a\n``setattr()``. Notice that the two methods do not necessarily refer\nto the same variable. When ``getattr()`` refers to a class variable,\n``setattr()`` still writes to an instance variable. For example:\n\n class A:\n x = 3 # class variable\n a = A()\n a.x += 1 # writes a.x as 4 leaving A.x as 3\n', - 'binary': u'\nBinary arithmetic operations\n****************************\n\nThe binary arithmetic operations have the conventional priority\nlevels. Note that some of these operations also apply to certain non-\nnumeric types. Apart from the power operator, there are only two\nlevels, one for multiplicative operators and one for additive\noperators:\n\n m_expr ::= u_expr | m_expr "*" u_expr | m_expr "//" u_expr | m_expr "/" u_expr\n | m_expr "%" u_expr\n a_expr ::= m_expr | a_expr "+" m_expr | a_expr "-" m_expr\n\nThe ``*`` (multiplication) operator yields the product of its\narguments. The arguments must either both be numbers, or one argument\nmust be an integer (plain or long) and the other must be a sequence.\nIn the former case, the numbers are converted to a common type and\nthen multiplied together. In the latter case, sequence repetition is\nperformed; a negative repetition factor yields an empty sequence.\n\nThe ``/`` (division) and ``//`` (floor division) operators yield the\nquotient of their arguments. The numeric arguments are first\nconverted to a common type. Plain or long integer division yields an\ninteger of the same type; the result is that of mathematical division\nwith the \'floor\' function applied to the result. Division by zero\nraises the ``ZeroDivisionError`` exception.\n\nThe ``%`` (modulo) operator yields the remainder from the division of\nthe first argument by the second. The numeric arguments are first\nconverted to a common type. A zero right argument raises the\n``ZeroDivisionError`` exception. The arguments may be floating point\nnumbers, e.g., ``3.14%0.7`` equals ``0.34`` (since ``3.14`` equals\n``4*0.7 + 0.34``.) The modulo operator always yields a result with\nthe same sign as its second operand (or zero); the absolute value of\nthe result is strictly smaller than the absolute value of the second\noperand [2].\n\nThe integer division and modulo operators are connected by the\nfollowing identity: ``x == (x/y)*y + (x%y)``. Integer division and\nmodulo are also connected with the built-in function ``divmod()``:\n``divmod(x, y) == (x/y, x%y)``. These identities don\'t hold for\nfloating point numbers; there similar identities hold approximately\nwhere ``x/y`` is replaced by ``floor(x/y)`` or ``floor(x/y) - 1`` [3].\n\nIn addition to performing the modulo operation on numbers, the ``%``\noperator is also overloaded by string and unicode objects to perform\nstring formatting (also known as interpolation). The syntax for string\nformatting is described in the Python Library Reference, section\n*String Formatting Operations*.\n\nDeprecated in version 2.3: The floor division operator, the modulo\noperator, and the ``divmod()`` function are no longer defined for\ncomplex numbers. Instead, convert to a floating point number using\nthe ``abs()`` function if appropriate.\n\nThe ``+`` (addition) operator yields the sum of its arguments. The\narguments must either both be numbers or both sequences of the same\ntype. In the former case, the numbers are converted to a common type\nand then added together. In the latter case, the sequences are\nconcatenated.\n\nThe ``-`` (subtraction) operator yields the difference of its\narguments. The numeric arguments are first converted to a common\ntype.\n', + 'augassign': u'\nAugmented assignment statements\n*******************************\n\nAugmented assignment is the combination, in a single statement, of a\nbinary operation and an assignment statement:\n\n augmented_assignment_stmt ::= target augop (expression_list | yield_expression)\n augop ::= "+=" | "-=" | "*=" | "/=" | "//=" | "%=" | "**="\n | ">>=" | "<<=" | "&=" | "^=" | "|="\n\n(See section *Primaries* for the syntax definitions for the last three\nsymbols.)\n\nAn augmented assignment evaluates the target (which, unlike normal\nassignment statements, cannot be an unpacking) and the expression\nlist, performs the binary operation specific to the type of assignment\non the two operands, and assigns the result to the original target.\nThe target is only evaluated once.\n\nAn augmented assignment expression like ``x += 1`` can be rewritten as\n``x = x + 1`` to achieve a similar, but not exactly equal effect. In\nthe augmented version, ``x`` is only evaluated once. Also, when\npossible, the actual operation is performed *in-place*, meaning that\nrather than creating a new object and assigning that to the target,\nthe old object is modified instead.\n\nWith the exception of assigning to tuples and multiple targets in a\nsingle statement, the assignment done by augmented assignment\nstatements is handled the same way as normal assignments. Similarly,\nwith the exception of the possible *in-place* behavior, the binary\noperation performed by augmented assignment is the same as the normal\nbinary operations.\n\nFor targets which are attribute references, the initial value is\nretrieved with a ``getattr()`` and the result is assigned with a\n``setattr()``. Notice that the two methods do not necessarily refer\nto the same variable. When ``getattr()`` refers to a class variable,\n``setattr()`` still writes to an instance variable. For example:\n\n class A:\n x = 3 # class variable\n a = A()\n a.x += 1 # writes a.x as 4 leaving A.x as 3\n', + 'binary': u'\nBinary arithmetic operations\n****************************\n\nThe binary arithmetic operations have the conventional priority\nlevels. Note that some of these operations also apply to certain non-\nnumeric types. Apart from the power operator, there are only two\nlevels, one for multiplicative operators and one for additive\noperators:\n\n m_expr ::= u_expr | m_expr "*" u_expr | m_expr "//" u_expr | m_expr "/" u_expr\n | m_expr "%" u_expr\n a_expr ::= m_expr | a_expr "+" m_expr | a_expr "-" m_expr\n\nThe ``*`` (multiplication) operator yields the product of its\narguments. The arguments must either both be numbers, or one argument\nmust be an integer (plain or long) and the other must be a sequence.\nIn the former case, the numbers are converted to a common type and\nthen multiplied together. In the latter case, sequence repetition is\nperformed; a negative repetition factor yields an empty sequence.\n\nThe ``/`` (division) and ``//`` (floor division) operators yield the\nquotient of their arguments. The numeric arguments are first\nconverted to a common type. Plain or long integer division yields an\ninteger of the same type; the result is that of mathematical division\nwith the \'floor\' function applied to the result. Division by zero\nraises the ``ZeroDivisionError`` exception.\n\nThe ``%`` (modulo) operator yields the remainder from the division of\nthe first argument by the second. The numeric arguments are first\nconverted to a common type. A zero right argument raises the\n``ZeroDivisionError`` exception. The arguments may be floating point\nnumbers, e.g., ``3.14%0.7`` equals ``0.34`` (since ``3.14`` equals\n``4*0.7 + 0.34``.) The modulo operator always yields a result with\nthe same sign as its second operand (or zero); the absolute value of\nthe result is strictly smaller than the absolute value of the second\noperand [2].\n\nThe integer division and modulo operators are connected by the\nfollowing identity: ``x == (x/y)*y + (x%y)``. Integer division and\nmodulo are also connected with the built-in function ``divmod()``:\n``divmod(x, y) == (x/y, x%y)``. These identities don\'t hold for\nfloating point numbers; there similar identities hold approximately\nwhere ``x/y`` is replaced by ``floor(x/y)`` or ``floor(x/y) - 1`` [3].\n\nIn addition to performing the modulo operation on numbers, the ``%``\noperator is also overloaded by string and unicode objects to perform\nstring formatting (also known as interpolation). The syntax for string\nformatting is described in the Python Library Reference, section\n*String Formatting Operations*.\n\nDeprecated since version 2.3: The floor division operator, the modulo\noperator, and the ``divmod()`` function are no longer defined for\ncomplex numbers. Instead, convert to a floating point number using\nthe ``abs()`` function if appropriate.\n\nThe ``+`` (addition) operator yields the sum of its arguments. The\narguments must either both be numbers or both sequences of the same\ntype. In the former case, the numbers are converted to a common type\nand then added together. In the latter case, the sequences are\nconcatenated.\n\nThe ``-`` (subtraction) operator yields the difference of its\narguments. The numeric arguments are first converted to a common\ntype.\n', 'bitwise': u'\nBinary bitwise operations\n*************************\n\nEach of the three bitwise operations has a different priority level:\n\n and_expr ::= shift_expr | and_expr "&" shift_expr\n xor_expr ::= and_expr | xor_expr "^" and_expr\n or_expr ::= xor_expr | or_expr "|" xor_expr\n\nThe ``&`` operator yields the bitwise AND of its arguments, which must\nbe plain or long integers. The arguments are converted to a common\ntype.\n\nThe ``^`` operator yields the bitwise XOR (exclusive OR) of its\narguments, which must be plain or long integers. The arguments are\nconverted to a common type.\n\nThe ``|`` operator yields the bitwise (inclusive) OR of its arguments,\nwhich must be plain or long integers. The arguments are converted to\na common type.\n', 'bltin-code-objects': u'\nCode Objects\n************\n\nCode objects are used by the implementation to represent "pseudo-\ncompiled" executable Python code such as a function body. They differ\nfrom function objects because they don\'t contain a reference to their\nglobal execution environment. Code objects are returned by the built-\nin ``compile()`` function and can be extracted from function objects\nthrough their ``func_code`` attribute. See also the ``code`` module.\n\nA code object can be executed or evaluated by passing it (instead of a\nsource string) to the ``exec`` statement or the built-in ``eval()``\nfunction.\n\nSee *The standard type hierarchy* for more information.\n', 'bltin-ellipsis-object': u'\nThe Ellipsis Object\n*******************\n\nThis object is used by extended slice notation (see *Slicings*). It\nsupports no special operations. There is exactly one ellipsis object,\nnamed ``Ellipsis`` (a built-in name).\n\nIt is written as ``Ellipsis``.\n', - 'bltin-file-objects': u'\nFile Objects\n************\n\nFile objects are implemented using C\'s ``stdio`` package and can be\ncreated with the built-in ``open()`` function. File objects are also\nreturned by some other built-in functions and methods, such as\n``os.popen()`` and ``os.fdopen()`` and the ``makefile()`` method of\nsocket objects. Temporary files can be created using the ``tempfile``\nmodule, and high-level file operations such as copying, moving, and\ndeleting files and directories can be achieved with the ``shutil``\nmodule.\n\nWhen a file operation fails for an I/O-related reason, the exception\n``IOError`` is raised. This includes situations where the operation\nis not defined for some reason, like ``seek()`` on a tty device or\nwriting a file opened for reading.\n\nFiles have the following methods:\n\nfile.close()\n\n Close the file. A closed file cannot be read or written any more.\n Any operation which requires that the file be open will raise a\n ``ValueError`` after the file has been closed. Calling ``close()``\n more than once is allowed.\n\n As of Python 2.5, you can avoid having to call this method\n explicitly if you use the ``with`` statement. For example, the\n following code will automatically close *f* when the ``with`` block\n is exited:\n\n from __future__ import with_statement\n\n with open("hello.txt") as f:\n for line in f:\n print line\n\n In older versions of Python, you would have needed to do this to\n get the same effect:\n\n f = open("hello.txt")\n try:\n for line in f:\n print line\n finally:\n f.close()\n\n Note: Not all "file-like" types in Python support use as a context\n manager for the ``with`` statement. If your code is intended to\n work with any file-like object, you can use the function\n ``contextlib.closing()`` instead of using the object directly.\n\nfile.flush()\n\n Flush the internal buffer, like ``stdio``\'s ``fflush``. This may\n be a no-op on some file-like objects.\n\nfile.fileno()\n\n Return the integer "file descriptor" that is used by the underlying\n implementation to request I/O operations from the operating system.\n This can be useful for other, lower level interfaces that use file\n descriptors, such as the ``fcntl`` module or ``os.read()`` and\n friends.\n\n Note: File-like objects which do not have a real file descriptor should\n *not* provide this method!\n\nfile.isatty()\n\n Return ``True`` if the file is connected to a tty(-like) device,\n else ``False``.\n\n Note: If a file-like object is not associated with a real file, this\n method should *not* be implemented.\n\nfile.next()\n\n A file object is its own iterator, for example ``iter(f)`` returns\n *f* (unless *f* is closed). When a file is used as an iterator,\n typically in a ``for`` loop (for example, ``for line in f: print\n line``), the ``next()`` method is called repeatedly. This method\n returns the next input line, or raises ``StopIteration`` when EOF\n is hit when the file is open for reading (behavior is undefined\n when the file is open for writing). In order to make a ``for``\n loop the most efficient way of looping over the lines of a file (a\n very common operation), the ``next()`` method uses a hidden read-\n ahead buffer. As a consequence of using a read-ahead buffer,\n combining ``next()`` with other file methods (like ``readline()``)\n does not work right. However, using ``seek()`` to reposition the\n file to an absolute position will flush the read-ahead buffer.\n\n Added in version 2.3.\n\nfile.read([size])\n\n Read at most *size* bytes from the file (less if the read hits EOF\n before obtaining *size* bytes). If the *size* argument is negative\n or omitted, read all data until EOF is reached. The bytes are\n returned as a string object. An empty string is returned when EOF\n is encountered immediately. (For certain files, like ttys, it\n makes sense to continue reading after an EOF is hit.) Note that\n this method may call the underlying C function ``fread`` more than\n once in an effort to acquire as close to *size* bytes as possible.\n Also note that when in non-blocking mode, less data than what was\n requested may be returned, even if no *size* parameter was given.\n\nfile.readline([size])\n\n Read one entire line from the file. A trailing newline character\n is kept in the string (but may be absent when a file ends with an\n incomplete line). [6] If the *size* argument is present and non-\n negative, it is a maximum byte count (including the trailing\n newline) and an incomplete line may be returned. An empty string is\n returned *only* when EOF is encountered immediately.\n\n Note: Unlike ``stdio``\'s ``fgets``, the returned string contains null\n characters (``\'\\0\'``) if they occurred in the input.\n\nfile.readlines([sizehint])\n\n Read until EOF using ``readline()`` and return a list containing\n the lines thus read. If the optional *sizehint* argument is\n present, instead of reading up to EOF, whole lines totalling\n approximately *sizehint* bytes (possibly after rounding up to an\n internal buffer size) are read. Objects implementing a file-like\n interface may choose to ignore *sizehint* if it cannot be\n implemented, or cannot be implemented efficiently.\n\nfile.xreadlines()\n\n This method returns the same thing as ``iter(f)``.\n\n Added in version 2.1.\n\n Deprecated in version 2.3: Use ``for line in file`` instead.\n\nfile.seek(offset[, whence])\n\n Set the file\'s current position, like ``stdio``\'s ``fseek``. The\n *whence* argument is optional and defaults to ``os.SEEK_SET`` or\n ``0`` (absolute file positioning); other values are ``os.SEEK_CUR``\n or ``1`` (seek relative to the current position) and\n ``os.SEEK_END`` or ``2`` (seek relative to the file\'s end). There\n is no return value.\n\n For example, ``f.seek(2, os.SEEK_CUR)`` advances the position by\n two and ``f.seek(-3, os.SEEK_END)`` sets the position to the third\n to last.\n\n Note that if the file is opened for appending (mode ``\'a\'`` or\n ``\'a+\'``), any ``seek()`` operations will be undone at the next\n write. If the file is only opened for writing in append mode (mode\n ``\'a\'``), this method is essentially a no-op, but it remains useful\n for files opened in append mode with reading enabled (mode\n ``\'a+\'``). If the file is opened in text mode (without ``\'b\'``),\n only offsets returned by ``tell()`` are legal. Use of other\n offsets causes undefined behavior.\n\n Note that not all file objects are seekable.\n\n Changed in version 2.6: Passing float values as offset has been\n deprecated.\n\nfile.tell()\n\n Return the file\'s current position, like ``stdio``\'s ``ftell``.\n\n Note: On Windows, ``tell()`` can return illegal values (after an\n ``fgets``) when reading files with Unix-style line-endings. Use\n binary mode (``\'rb\'``) to circumvent this problem.\n\nfile.truncate([size])\n\n Truncate the file\'s size. If the optional *size* argument is\n present, the file is truncated to (at most) that size. The size\n defaults to the current position. The current file position is not\n changed. Note that if a specified size exceeds the file\'s current\n size, the result is platform-dependent: possibilities include that\n the file may remain unchanged, increase to the specified size as if\n zero-filled, or increase to the specified size with undefined new\n content. Availability: Windows, many Unix variants.\n\nfile.write(str)\n\n Write a string to the file. There is no return value. Due to\n buffering, the string may not actually show up in the file until\n the ``flush()`` or ``close()`` method is called.\n\nfile.writelines(sequence)\n\n Write a sequence of strings to the file. The sequence can be any\n iterable object producing strings, typically a list of strings.\n There is no return value. (The name is intended to match\n ``readlines()``; ``writelines()`` does not add line separators.)\n\nFiles support the iterator protocol. Each iteration returns the same\nresult as ``file.readline()``, and iteration ends when the\n``readline()`` method returns an empty string.\n\nFile objects also offer a number of other interesting attributes.\nThese are not required for file-like objects, but should be\nimplemented if they make sense for the particular object.\n\nfile.closed\n\n bool indicating the current state of the file object. This is a\n read-only attribute; the ``close()`` method changes the value. It\n may not be available on all file-like objects.\n\nfile.encoding\n\n The encoding that this file uses. When Unicode strings are written\n to a file, they will be converted to byte strings using this\n encoding. In addition, when the file is connected to a terminal,\n the attribute gives the encoding that the terminal is likely to use\n (that information might be incorrect if the user has misconfigured\n the terminal). The attribute is read-only and may not be present\n on all file-like objects. It may also be ``None``, in which case\n the file uses the system default encoding for converting Unicode\n strings.\n\n Added in version 2.3.\n\nfile.errors\n\n The Unicode error handler used to along with the encoding.\n\n Added in version 2.6.\n\nfile.mode\n\n The I/O mode for the file. If the file was created using the\n ``open()`` built-in function, this will be the value of the *mode*\n parameter. This is a read-only attribute and may not be present on\n all file-like objects.\n\nfile.name\n\n If the file object was created using ``open()``, the name of the\n file. Otherwise, some string that indicates the source of the file\n object, of the form ``<...>``. This is a read-only attribute and\n may not be present on all file-like objects.\n\nfile.newlines\n\n If Python was built with the *--with-universal-newlines* option to\n **configure** (the default) this read-only attribute exists, and\n for files opened in universal newline read mode it keeps track of\n the types of newlines encountered while reading the file. The\n values it can take are ``\'\\r\'``, ``\'\\n\'``, ``\'\\r\\n\'``, ``None``\n (unknown, no newlines read yet) or a tuple containing all the\n newline types seen, to indicate that multiple newline conventions\n were encountered. For files not opened in universal newline read\n mode the value of this attribute will be ``None``.\n\nfile.softspace\n\n Boolean that indicates whether a space character needs to be\n printed before another value when using the ``print`` statement.\n Classes that are trying to simulate a file object should also have\n a writable ``softspace`` attribute, which should be initialized to\n zero. This will be automatic for most classes implemented in\n Python (care may be needed for objects that override attribute\n access); types implemented in C will have to provide a writable\n ``softspace`` attribute.\n\n Note: This attribute is not used to control the ``print`` statement,\n but to allow the implementation of ``print`` to keep track of its\n internal state.\n', + 'bltin-file-objects': u'\nFile Objects\n************\n\nFile objects are implemented using C\'s ``stdio`` package and can be\ncreated with the built-in ``open()`` function. File objects are also\nreturned by some other built-in functions and methods, such as\n``os.popen()`` and ``os.fdopen()`` and the ``makefile()`` method of\nsocket objects. Temporary files can be created using the ``tempfile``\nmodule, and high-level file operations such as copying, moving, and\ndeleting files and directories can be achieved with the ``shutil``\nmodule.\n\nWhen a file operation fails for an I/O-related reason, the exception\n``IOError`` is raised. This includes situations where the operation\nis not defined for some reason, like ``seek()`` on a tty device or\nwriting a file opened for reading.\n\nFiles have the following methods:\n\nfile.close()\n\n Close the file. A closed file cannot be read or written any more.\n Any operation which requires that the file be open will raise a\n ``ValueError`` after the file has been closed. Calling ``close()``\n more than once is allowed.\n\n As of Python 2.5, you can avoid having to call this method\n explicitly if you use the ``with`` statement. For example, the\n following code will automatically close *f* when the ``with`` block\n is exited:\n\n from __future__ import with_statement # This isn\'t required in Python 2.6\n\n with open("hello.txt") as f:\n for line in f:\n print line\n\n In older versions of Python, you would have needed to do this to\n get the same effect:\n\n f = open("hello.txt")\n try:\n for line in f:\n print line\n finally:\n f.close()\n\n Note: Not all "file-like" types in Python support use as a context\n manager for the ``with`` statement. If your code is intended to\n work with any file-like object, you can use the function\n ``contextlib.closing()`` instead of using the object directly.\n\nfile.flush()\n\n Flush the internal buffer, like ``stdio``\'s ``fflush``. This may\n be a no-op on some file-like objects.\n\nfile.fileno()\n\n Return the integer "file descriptor" that is used by the underlying\n implementation to request I/O operations from the operating system.\n This can be useful for other, lower level interfaces that use file\n descriptors, such as the ``fcntl`` module or ``os.read()`` and\n friends.\n\n Note: File-like objects which do not have a real file descriptor should\n *not* provide this method!\n\nfile.isatty()\n\n Return ``True`` if the file is connected to a tty(-like) device,\n else ``False``.\n\n Note: If a file-like object is not associated with a real file, this\n method should *not* be implemented.\n\nfile.next()\n\n A file object is its own iterator, for example ``iter(f)`` returns\n *f* (unless *f* is closed). When a file is used as an iterator,\n typically in a ``for`` loop (for example, ``for line in f: print\n line``), the ``next()`` method is called repeatedly. This method\n returns the next input line, or raises ``StopIteration`` when EOF\n is hit when the file is open for reading (behavior is undefined\n when the file is open for writing). In order to make a ``for``\n loop the most efficient way of looping over the lines of a file (a\n very common operation), the ``next()`` method uses a hidden read-\n ahead buffer. As a consequence of using a read-ahead buffer,\n combining ``next()`` with other file methods (like ``readline()``)\n does not work right. However, using ``seek()`` to reposition the\n file to an absolute position will flush the read-ahead buffer.\n\n New in version 2.3.\n\nfile.read([size])\n\n Read at most *size* bytes from the file (less if the read hits EOF\n before obtaining *size* bytes). If the *size* argument is negative\n or omitted, read all data until EOF is reached. The bytes are\n returned as a string object. An empty string is returned when EOF\n is encountered immediately. (For certain files, like ttys, it\n makes sense to continue reading after an EOF is hit.) Note that\n this method may call the underlying C function ``fread`` more than\n once in an effort to acquire as close to *size* bytes as possible.\n Also note that when in non-blocking mode, less data than was\n requested may be returned, even if no *size* parameter was given.\n\n Note: This function is simply a wrapper for the underlying ``fread`` C\n function, and will behave the same in corner cases, such as\n whether the EOF value is cached.\n\nfile.readline([size])\n\n Read one entire line from the file. A trailing newline character\n is kept in the string (but may be absent when a file ends with an\n incomplete line). [6] If the *size* argument is present and non-\n negative, it is a maximum byte count (including the trailing\n newline) and an incomplete line may be returned. An empty string is\n returned *only* when EOF is encountered immediately.\n\n Note: Unlike ``stdio``\'s ``fgets``, the returned string contains null\n characters (``\'\\0\'``) if they occurred in the input.\n\nfile.readlines([sizehint])\n\n Read until EOF using ``readline()`` and return a list containing\n the lines thus read. If the optional *sizehint* argument is\n present, instead of reading up to EOF, whole lines totalling\n approximately *sizehint* bytes (possibly after rounding up to an\n internal buffer size) are read. Objects implementing a file-like\n interface may choose to ignore *sizehint* if it cannot be\n implemented, or cannot be implemented efficiently.\n\nfile.xreadlines()\n\n This method returns the same thing as ``iter(f)``.\n\n New in version 2.1.\n\n Deprecated since version 2.3: Use ``for line in file`` instead.\n\nfile.seek(offset[, whence])\n\n Set the file\'s current position, like ``stdio``\'s ``fseek``. The\n *whence* argument is optional and defaults to ``os.SEEK_SET`` or\n ``0`` (absolute file positioning); other values are ``os.SEEK_CUR``\n or ``1`` (seek relative to the current position) and\n ``os.SEEK_END`` or ``2`` (seek relative to the file\'s end). There\n is no return value.\n\n For example, ``f.seek(2, os.SEEK_CUR)`` advances the position by\n two and ``f.seek(-3, os.SEEK_END)`` sets the position to the third\n to last.\n\n Note that if the file is opened for appending (mode ``\'a\'`` or\n ``\'a+\'``), any ``seek()`` operations will be undone at the next\n write. If the file is only opened for writing in append mode (mode\n ``\'a\'``), this method is essentially a no-op, but it remains useful\n for files opened in append mode with reading enabled (mode\n ``\'a+\'``). If the file is opened in text mode (without ``\'b\'``),\n only offsets returned by ``tell()`` are legal. Use of other\n offsets causes undefined behavior.\n\n Note that not all file objects are seekable.\n\n Changed in version 2.6: Passing float values as offset has been\n deprecated.\n\nfile.tell()\n\n Return the file\'s current position, like ``stdio``\'s ``ftell``.\n\n Note: On Windows, ``tell()`` can return illegal values (after an\n ``fgets``) when reading files with Unix-style line-endings. Use\n binary mode (``\'rb\'``) to circumvent this problem.\n\nfile.truncate([size])\n\n Truncate the file\'s size. If the optional *size* argument is\n present, the file is truncated to (at most) that size. The size\n defaults to the current position. The current file position is not\n changed. Note that if a specified size exceeds the file\'s current\n size, the result is platform-dependent: possibilities include that\n the file may remain unchanged, increase to the specified size as if\n zero-filled, or increase to the specified size with undefined new\n content. Availability: Windows, many Unix variants.\n\nfile.write(str)\n\n Write a string to the file. There is no return value. Due to\n buffering, the string may not actually show up in the file until\n the ``flush()`` or ``close()`` method is called.\n\nfile.writelines(sequence)\n\n Write a sequence of strings to the file. The sequence can be any\n iterable object producing strings, typically a list of strings.\n There is no return value. (The name is intended to match\n ``readlines()``; ``writelines()`` does not add line separators.)\n\nFiles support the iterator protocol. Each iteration returns the same\nresult as ``file.readline()``, and iteration ends when the\n``readline()`` method returns an empty string.\n\nFile objects also offer a number of other interesting attributes.\nThese are not required for file-like objects, but should be\nimplemented if they make sense for the particular object.\n\nfile.closed\n\n bool indicating the current state of the file object. This is a\n read-only attribute; the ``close()`` method changes the value. It\n may not be available on all file-like objects.\n\nfile.encoding\n\n The encoding that this file uses. When Unicode strings are written\n to a file, they will be converted to byte strings using this\n encoding. In addition, when the file is connected to a terminal,\n the attribute gives the encoding that the terminal is likely to use\n (that information might be incorrect if the user has misconfigured\n the terminal). The attribute is read-only and may not be present\n on all file-like objects. It may also be ``None``, in which case\n the file uses the system default encoding for converting Unicode\n strings.\n\n New in version 2.3.\n\nfile.errors\n\n The Unicode error handler used along with the encoding.\n\n New in version 2.6.\n\nfile.mode\n\n The I/O mode for the file. If the file was created using the\n ``open()`` built-in function, this will be the value of the *mode*\n parameter. This is a read-only attribute and may not be present on\n all file-like objects.\n\nfile.name\n\n If the file object was created using ``open()``, the name of the\n file. Otherwise, some string that indicates the source of the file\n object, of the form ``<...>``. This is a read-only attribute and\n may not be present on all file-like objects.\n\nfile.newlines\n\n If Python was built with the *--with-universal-newlines* option to\n **configure** (the default) this read-only attribute exists, and\n for files opened in universal newline read mode it keeps track of\n the types of newlines encountered while reading the file. The\n values it can take are ``\'\\r\'``, ``\'\\n\'``, ``\'\\r\\n\'``, ``None``\n (unknown, no newlines read yet) or a tuple containing all the\n newline types seen, to indicate that multiple newline conventions\n were encountered. For files not opened in universal newline read\n mode the value of this attribute will be ``None``.\n\nfile.softspace\n\n Boolean that indicates whether a space character needs to be\n printed before another value when using the ``print`` statement.\n Classes that are trying to simulate a file object should also have\n a writable ``softspace`` attribute, which should be initialized to\n zero. This will be automatic for most classes implemented in\n Python (care may be needed for objects that override attribute\n access); types implemented in C will have to provide a writable\n ``softspace`` attribute.\n\n Note: This attribute is not used to control the ``print`` statement,\n but to allow the implementation of ``print`` to keep track of its\n internal state.\n', 'bltin-null-object': u"\nThe Null Object\n***************\n\nThis object is returned by functions that don't explicitly return a\nvalue. It supports no special operations. There is exactly one null\nobject, named ``None`` (a built-in name).\n\nIt is written as ``None``.\n", 'bltin-type-objects': u"\nType Objects\n************\n\nType objects represent the various object types. An object's type is\naccessed by the built-in function ``type()``. There are no special\noperations on types. The standard module ``types`` defines names for\nall standard built-in types.\n\nTypes are written like this: ````.\n", - 'booleans': u'\nBoolean operations\n******************\n\nBoolean operations have the lowest priority of all Python operations:\n\n expression ::= conditional_expression | lambda_form\n old_expression ::= or_test | old_lambda_form\n conditional_expression ::= or_test ["if" or_test "else" expression]\n or_test ::= and_test | or_test "or" and_test\n and_test ::= not_test | and_test "and" not_test\n not_test ::= comparison | "not" not_test\n\nIn the context of Boolean operations, and also when expressions are\nused by control flow statements, the following values are interpreted\nas false: ``False``, ``None``, numeric zero of all types, and empty\nstrings and containers (including strings, tuples, lists,\ndictionaries, sets and frozensets). All other values are interpreted\nas true.\n\nThe operator ``not`` yields ``True`` if its argument is false,\n``False`` otherwise.\n\nThe expression ``x if C else y`` first evaluates *C* (*not* *x*); if\n*C* is true, *x* is evaluated and its value is returned; otherwise,\n*y* is evaluated and its value is returned.\n\nAdded in version 2.5.\n\nThe expression ``x and y`` first evaluates *x*; if *x* is false, its\nvalue is returned; otherwise, *y* is evaluated and the resulting value\nis returned.\n\nThe expression ``x or y`` first evaluates *x*; if *x* is true, its\nvalue is returned; otherwise, *y* is evaluated and the resulting value\nis returned.\n\n(Note that neither ``and`` nor ``or`` restrict the value and type they\nreturn to ``False`` and ``True``, but rather return the last evaluated\nargument. This is sometimes useful, e.g., if ``s`` is a string that\nshould be replaced by a default value if it is empty, the expression\n``s or \'foo\'`` yields the desired value. Because ``not`` has to\ninvent a value anyway, it does not bother to return a value of the\nsame type as its argument, so e.g., ``not \'foo\'`` yields ``False``,\nnot ``\'\'``.)\n', + 'booleans': u'\nBoolean operations\n******************\n\nBoolean operations have the lowest priority of all Python operations:\n\n expression ::= conditional_expression | lambda_form\n old_expression ::= or_test | old_lambda_form\n conditional_expression ::= or_test ["if" or_test "else" expression]\n or_test ::= and_test | or_test "or" and_test\n and_test ::= not_test | and_test "and" not_test\n not_test ::= comparison | "not" not_test\n\nIn the context of Boolean operations, and also when expressions are\nused by control flow statements, the following values are interpreted\nas false: ``False``, ``None``, numeric zero of all types, and empty\nstrings and containers (including strings, tuples, lists,\ndictionaries, sets and frozensets). All other values are interpreted\nas true. (See the ``__nonzero__()`` special method for a way to\nchange this.)\n\nThe operator ``not`` yields ``True`` if its argument is false,\n``False`` otherwise.\n\nThe expression ``x if C else y`` first evaluates *C* (*not* *x*); if\n*C* is true, *x* is evaluated and its value is returned; otherwise,\n*y* is evaluated and its value is returned.\n\nNew in version 2.5.\n\nThe expression ``x and y`` first evaluates *x*; if *x* is false, its\nvalue is returned; otherwise, *y* is evaluated and the resulting value\nis returned.\n\nThe expression ``x or y`` first evaluates *x*; if *x* is true, its\nvalue is returned; otherwise, *y* is evaluated and the resulting value\nis returned.\n\n(Note that neither ``and`` nor ``or`` restrict the value and type they\nreturn to ``False`` and ``True``, but rather return the last evaluated\nargument. This is sometimes useful, e.g., if ``s`` is a string that\nshould be replaced by a default value if it is empty, the expression\n``s or \'foo\'`` yields the desired value. Because ``not`` has to\ninvent a value anyway, it does not bother to return a value of the\nsame type as its argument, so e.g., ``not \'foo\'`` yields ``False``,\nnot ``\'\'``.)\n', 'break': u'\nThe ``break`` statement\n***********************\n\n break_stmt ::= "break"\n\n``break`` may only occur syntactically nested in a ``for`` or\n``while`` loop, but not nested in a function or class definition\nwithin that loop.\n\nIt terminates the nearest enclosing loop, skipping the optional\n``else`` clause if the loop has one.\n\nIf a ``for`` loop is terminated by ``break``, the loop control target\nkeeps its current value.\n\nWhen ``break`` passes control out of a ``try`` statement with a\n``finally`` clause, that ``finally`` clause is executed before really\nleaving the loop.\n', 'callable-types': u'\nEmulating callable objects\n**************************\n\nobject.__call__(self[, args...])\n\n Called when the instance is "called" as a function; if this method\n is defined, ``x(arg1, arg2, ...)`` is a shorthand for\n ``x.__call__(arg1, arg2, ...)``.\n', - 'calls': u'\nCalls\n*****\n\nA call calls a callable object (e.g., a function) with a possibly\nempty series of arguments:\n\n call ::= primary "(" [argument_list [","]\n | expression genexpr_for] ")"\n argument_list ::= positional_arguments ["," keyword_arguments]\n ["," "*" expression]\n ["," "**" expression]\n | keyword_arguments ["," "*" expression]\n ["," "**" expression]\n | "*" expression ["," "**" expression]\n | "**" expression\n positional_arguments ::= expression ("," expression)*\n keyword_arguments ::= keyword_item ("," keyword_item)*\n keyword_item ::= identifier "=" expression\n\nA trailing comma may be present after the positional and keyword\narguments but does not affect the semantics.\n\nThe primary must evaluate to a callable object (user-defined\nfunctions, built-in functions, methods of built-in objects, class\nobjects, methods of class instances, and certain class instances\nthemselves are callable; extensions may define additional callable\nobject types). All argument expressions are evaluated before the call\nis attempted. Please refer to section *Function definitions* for the\nsyntax of formal parameter lists.\n\nIf keyword arguments are present, they are first converted to\npositional arguments, as follows. First, a list of unfilled slots is\ncreated for the formal parameters. If there are N positional\narguments, they are placed in the first N slots. Next, for each\nkeyword argument, the identifier is used to determine the\ncorresponding slot (if the identifier is the same as the first formal\nparameter name, the first slot is used, and so on). If the slot is\nalready filled, a ``TypeError`` exception is raised. Otherwise, the\nvalue of the argument is placed in the slot, filling it (even if the\nexpression is ``None``, it fills the slot). When all arguments have\nbeen processed, the slots that are still unfilled are filled with the\ncorresponding default value from the function definition. (Default\nvalues are calculated, once, when the function is defined; thus, a\nmutable object such as a list or dictionary used as default value will\nbe shared by all calls that don\'t specify an argument value for the\ncorresponding slot; this should usually be avoided.) If there are any\nunfilled slots for which no default value is specified, a\n``TypeError`` exception is raised. Otherwise, the list of filled\nslots is used as the argument list for the call.\n\nNote: An implementation may provide builtin functions whose positional\n parameters do not have names, even if they are \'named\' for the\n purpose of documentation, and which therefore cannot be supplied by\n keyword. In CPython, this is the case for functions implemented in\n C that use ``PyArg_ParseTuple`` to parse their arguments.\n\nIf there are more positional arguments than there are formal parameter\nslots, a ``TypeError`` exception is raised, unless a formal parameter\nusing the syntax ``*identifier`` is present; in this case, that formal\nparameter receives a tuple containing the excess positional arguments\n(or an empty tuple if there were no excess positional arguments).\n\nIf any keyword argument does not correspond to a formal parameter\nname, a ``TypeError`` exception is raised, unless a formal parameter\nusing the syntax ``**identifier`` is present; in this case, that\nformal parameter receives a dictionary containing the excess keyword\narguments (using the keywords as keys and the argument values as\ncorresponding values), or a (new) empty dictionary if there were no\nexcess keyword arguments.\n\nIf the syntax ``*expression`` appears in the function call,\n``expression`` must evaluate to a sequence. Elements from this\nsequence are treated as if they were additional positional arguments;\nif there are positional arguments *x1*,...,*xN* , and ``expression``\nevaluates to a sequence *y1*,...,*yM*, this is equivalent to a call\nwith M+N positional arguments *x1*,...,*xN*,*y1*,...,*yM*.\n\nA consequence of this is that although the ``*expression`` syntax\nappears *after* any keyword arguments, it is processed *before* the\nkeyword arguments (and the ``**expression`` argument, if any -- see\nbelow). So:\n\n >>> def f(a, b):\n ... print a, b\n ...\n >>> f(b=1, *(2,))\n 2 1\n >>> f(a=1, *(2,))\n Traceback (most recent call last):\n File "", line 1, in ?\n TypeError: f() got multiple values for keyword argument \'a\'\n >>> f(1, *(2,))\n 1 2\n\nIt is unusual for both keyword arguments and the ``*expression``\nsyntax to be used in the same call, so in practice this confusion does\nnot arise.\n\nIf the syntax ``**expression`` appears in the function call,\n``expression`` must evaluate to a mapping, the contents of which are\ntreated as additional keyword arguments. In the case of a keyword\nappearing in both ``expression`` and as an explicit keyword argument,\na ``TypeError`` exception is raised.\n\nFormal parameters using the syntax ``*identifier`` or ``**identifier``\ncannot be used as positional argument slots or as keyword argument\nnames. Formal parameters using the syntax ``(sublist)`` cannot be\nused as keyword argument names; the outermost sublist corresponds to a\nsingle unnamed argument slot, and the argument value is assigned to\nthe sublist using the usual tuple assignment rules after all other\nparameter processing is done.\n\nA call always returns some value, possibly ``None``, unless it raises\nan exception. How this value is computed depends on the type of the\ncallable object.\n\nIf it is---\n\na user-defined function:\n The code block for the function is executed, passing it the\n argument list. The first thing the code block will do is bind the\n formal parameters to the arguments; this is described in section\n *Function definitions*. When the code block executes a ``return``\n statement, this specifies the return value of the function call.\n\na built-in function or method:\n The result is up to the interpreter; see *Built-in Functions* for\n the descriptions of built-in functions and methods.\n\na class object:\n A new instance of that class is returned.\n\na class instance method:\n The corresponding user-defined function is called, with an argument\n list that is one longer than the argument list of the call: the\n instance becomes the first argument.\n\na class instance:\n The class must define a ``__call__()`` method; the effect is then\n the same as if that method was called.\n', - 'class': u'\nClass definitions\n*****************\n\nA class definition defines a class object (see section *The standard\ntype hierarchy*):\n\n classdef ::= "class" classname [inheritance] ":" suite\n inheritance ::= "(" [expression_list] ")"\n classname ::= identifier\n\nA class definition is an executable statement. It first evaluates the\ninheritance list, if present. Each item in the inheritance list\nshould evaluate to a class object or class type which allows\nsubclassing. The class\'s suite is then executed in a new execution\nframe (see section *Naming and binding*), using a newly created local\nnamespace and the original global namespace. (Usually, the suite\ncontains only function definitions.) When the class\'s suite finishes\nexecution, its execution frame is discarded but its local namespace is\nsaved. A class object is then created using the inheritance list for\nthe base classes and the saved local namespace for the attribute\ndictionary. The class name is bound to this class object in the\noriginal local namespace.\n\n**Programmer\'s note:** Variables defined in the class definition are\nclass variables; they are shared by all instances. To create instance\nvariables, they can be set in a method with ``self.name = value``.\nBoth class and instance variables are accessible through the notation\n"``self.name``", and an instance variable hides a class variable with\nthe same name when accessed in this way. Class variables can be used\nas defaults for instance variables, but using mutable values there can\nlead to unexpected results. For *new-style class*es, descriptors can\nbe used to create instance variables with different implementation\ndetails.\n\nClass definitions, like function definitions, may be wrapped by one or\nmore *decorator* expressions. The evaluation rules for the decorator\nexpressions are the same as for functions. The result must be a class\nobject, which is then bound to the class name.\n\n-[ Footnotes ]-\n\n[1] The exception is propagated to the invocation stack only if there\n is no ``finally`` clause that negates the exception.\n\n[2] Currently, control "flows off the end" except in the case of an\n exception or the execution of a ``return``, ``continue``, or\n ``break`` statement.\n', - 'coercion-rules': u"\nCoercion rules\n**************\n\nThis section used to document the rules for coercion. As the language\nhas evolved, the coercion rules have become hard to document\nprecisely; documenting what one version of one particular\nimplementation does is undesirable. Instead, here are some informal\nguidelines regarding coercion. In Python 3.0, coercion will not be\nsupported.\n\n* If the left operand of a % operator is a string or Unicode object,\n no coercion takes place and the string formatting operation is\n invoked instead.\n\n* It is no longer recommended to define a coercion operation. Mixed-\n mode operations on types that don't define coercion pass the\n original arguments to the operation.\n\n* New-style classes (those derived from ``object``) never invoke the\n ``__coerce__()`` method in response to a binary operator; the only\n time ``__coerce__()`` is invoked is when the built-in function\n ``coerce()`` is called.\n\n* For most intents and purposes, an operator that returns\n ``NotImplemented`` is treated the same as one that is not\n implemented at all.\n\n* Below, ``__op__()`` and ``__rop__()`` are used to signify the\n generic method names corresponding to an operator; ``__iop__()`` is\n used for the corresponding in-place operator. For example, for the\n operator '``+``', ``__add__()`` and ``__radd__()`` are used for the\n left and right variant of the binary operator, and ``__iadd__()``\n for the in-place variant.\n\n* For objects *x* and *y*, first ``x.__op__(y)`` is tried. If this is\n not implemented or returns ``NotImplemented``, ``y.__rop__(x)`` is\n tried. If this is also not implemented or returns\n ``NotImplemented``, a ``TypeError`` exception is raised. But see\n the following exception:\n\n* Exception to the previous item: if the left operand is an instance\n of a built-in type or a new-style class, and the right operand is an\n instance of a proper subclass of that type or class and overrides\n the base's ``__rop__()`` method, the right operand's ``__rop__()``\n method is tried *before* the left operand's ``__op__()`` method.\n\n This is done so that a subclass can completely override binary\n operators. Otherwise, the left operand's ``__op__()`` method would\n always accept the right operand: when an instance of a given class\n is expected, an instance of a subclass of that class is always\n acceptable.\n\n* When either operand type defines a coercion, this coercion is called\n before that type's ``__op__()`` or ``__rop__()`` method is called,\n but no sooner. If the coercion returns an object of a different\n type for the operand whose coercion is invoked, part of the process\n is redone using the new object.\n\n* When an in-place operator (like '``+=``') is used, if the left\n operand implements ``__iop__()``, it is invoked without any\n coercion. When the operation falls back to ``__op__()`` and/or\n ``__rop__()``, the normal coercion rules apply.\n\n* In *x*``+``*y*, if *x* is a sequence that implements sequence\n concatenation, sequence concatenation is invoked.\n\n* In *x*``*``*y*, if one operator is a sequence that implements\n sequence repetition, and the other is an integer (``int`` or\n ``long``), sequence repetition is invoked.\n\n* Rich comparisons (implemented by methods ``__eq__()`` and so on)\n never use coercion. Three-way comparison (implemented by\n ``__cmp__()``) does use coercion under the same conditions as other\n binary operations use it.\n\n* In the current implementation, the built-in numeric types ``int``,\n ``long`` and ``float`` do not use coercion; the type ``complex``\n however does use it. The difference can become apparent when\n subclassing these types. Over time, the type ``complex`` may be\n fixed to avoid coercion. All these types implement a\n ``__coerce__()`` method, for use by the built-in ``coerce()``\n function.\n", - 'comparisons': u'\nComparisons\n***********\n\nUnlike C, all comparison operations in Python have the same priority,\nwhich is lower than that of any arithmetic, shifting or bitwise\noperation. Also unlike C, expressions like ``a < b < c`` have the\ninterpretation that is conventional in mathematics:\n\n comparison ::= or_expr ( comp_operator or_expr )*\n comp_operator ::= "<" | ">" | "==" | ">=" | "<=" | "<>" | "!="\n | "is" ["not"] | ["not"] "in"\n\nComparisons yield boolean values: ``True`` or ``False``.\n\nComparisons can be chained arbitrarily, e.g., ``x < y <= z`` is\nequivalent to ``x < y and y <= z``, except that ``y`` is evaluated\nonly once (but in both cases ``z`` is not evaluated at all when ``x <\ny`` is found to be false).\n\nFormally, if *a*, *b*, *c*, ..., *y*, *z* are expressions and *op1*,\n*op2*, ..., *opN* are comparison operators, then ``a op1 b op2 c ... y\nopN z`` is equivalent to ``a op1 b and b op2 c and ... y opN z``,\nexcept that each expression is evaluated at most once.\n\nNote that ``a op1 b op2 c`` doesn\'t imply any kind of comparison\nbetween *a* and *c*, so that, e.g., ``x < y > z`` is perfectly legal\n(though perhaps not pretty).\n\nThe forms ``<>`` and ``!=`` are equivalent; for consistency with C,\n``!=`` is preferred; where ``!=`` is mentioned below ``<>`` is also\naccepted. The ``<>`` spelling is considered obsolescent.\n\nThe operators ``<``, ``>``, ``==``, ``>=``, ``<=``, and ``!=`` compare\nthe values of two objects. The objects need not have the same type.\nIf both are numbers, they are converted to a common type. Otherwise,\nobjects of different types *always* compare unequal, and are ordered\nconsistently but arbitrarily. You can control comparison behavior of\nobjects of non-builtin types by defining a ``__cmp__`` method or rich\ncomparison methods like ``__gt__``, described in section *Special\nmethod names*.\n\n(This unusual definition of comparison was used to simplify the\ndefinition of operations like sorting and the ``in`` and ``not in``\noperators. In the future, the comparison rules for objects of\ndifferent types are likely to change.)\n\nComparison of objects of the same type depends on the type:\n\n* Numbers are compared arithmetically.\n\n* Strings are compared lexicographically using the numeric equivalents\n (the result of the built-in function ``ord()``) of their characters.\n Unicode and 8-bit strings are fully interoperable in this behavior.\n [4]\n\n* Tuples and lists are compared lexicographically using comparison of\n corresponding elements. This means that to compare equal, each\n element must compare equal and the two sequences must be of the same\n type and have the same length.\n\n If not equal, the sequences are ordered the same as their first\n differing elements. For example, ``cmp([1,2,x], [1,2,y])`` returns\n the same as ``cmp(x,y)``. If the corresponding element does not\n exist, the shorter sequence is ordered first (for example, ``[1,2] <\n [1,2,3]``).\n\n* Mappings (dictionaries) compare equal if and only if their sorted\n (key, value) lists compare equal. [5] Outcomes other than equality\n are resolved consistently, but are not otherwise defined. [6]\n\n* Most other objects of builtin types compare unequal unless they are\n the same object; the choice whether one object is considered smaller\n or larger than another one is made arbitrarily but consistently\n within one execution of a program.\n\nThe operators ``in`` and ``not in`` test for collection membership.\n``x in s`` evaluates to true if *x* is a member of the collection *s*,\nand false otherwise. ``x not in s`` returns the negation of ``x in\ns``. The collection membership test has traditionally been bound to\nsequences; an object is a member of a collection if the collection is\na sequence and contains an element equal to that object. However, it\nmake sense for many other object types to support membership tests\nwithout being a sequence. In particular, dictionaries (for keys) and\nsets support membership testing.\n\nFor the list and tuple types, ``x in y`` is true if and only if there\nexists an index *i* such that ``x == y[i]`` is true.\n\nFor the Unicode and string types, ``x in y`` is true if and only if\n*x* is a substring of *y*. An equivalent test is ``y.find(x) != -1``.\nNote, *x* and *y* need not be the same type; consequently, ``u\'ab\' in\n\'abc\'`` will return ``True``. Empty strings are always considered to\nbe a substring of any other string, so ``"" in "abc"`` will return\n``True``.\n\nChanged in version 2.3: Previously, *x* was required to be a string of\nlength ``1``.\n\nFor user-defined classes which define the ``__contains__()`` method,\n``x in y`` is true if and only if ``y.__contains__(x)`` is true.\n\nFor user-defined classes which do not define ``__contains__()`` and do\ndefine ``__getitem__()``, ``x in y`` is true if and only if there is a\nnon-negative integer index *i* such that ``x == y[i]``, and all lower\ninteger indices do not raise ``IndexError`` exception. (If any other\nexception is raised, it is as if ``in`` raised that exception).\n\nThe operator ``not in`` is defined to have the inverse true value of\n``in``.\n\nThe operators ``is`` and ``is not`` test for object identity: ``x is\ny`` is true if and only if *x* and *y* are the same object. ``x is\nnot y`` yields the inverse truth value.\n', - 'compound': u'\nCompound statements\n*******************\n\nCompound statements contain (groups of) other statements; they affect\nor control the execution of those other statements in some way. In\ngeneral, compound statements span multiple lines, although in simple\nincarnations a whole compound statement may be contained in one line.\n\nThe ``if``, ``while`` and ``for`` statements implement traditional\ncontrol flow constructs. ``try`` specifies exception handlers and/or\ncleanup code for a group of statements. Function and class\ndefinitions are also syntactically compound statements.\n\nCompound statements consist of one or more \'clauses.\' A clause\nconsists of a header and a \'suite.\' The clause headers of a\nparticular compound statement are all at the same indentation level.\nEach clause header begins with a uniquely identifying keyword and ends\nwith a colon. A suite is a group of statements controlled by a\nclause. A suite can be one or more semicolon-separated simple\nstatements on the same line as the header, following the header\'s\ncolon, or it can be one or more indented statements on subsequent\nlines. Only the latter form of suite can contain nested compound\nstatements; the following is illegal, mostly because it wouldn\'t be\nclear to which ``if`` clause a following ``else`` clause would belong:\n\n if test1: if test2: print x\n\nAlso note that the semicolon binds tighter than the colon in this\ncontext, so that in the following example, either all or none of the\n``print`` statements are executed:\n\n if x < y < z: print x; print y; print z\n\nSummarizing:\n\n compound_stmt ::= if_stmt\n | while_stmt\n | for_stmt\n | try_stmt\n | with_stmt\n | funcdef\n | classdef\n | decorated\n suite ::= stmt_list NEWLINE | NEWLINE INDENT statement+ DEDENT\n statement ::= stmt_list NEWLINE | compound_stmt\n stmt_list ::= simple_stmt (";" simple_stmt)* [";"]\n\nNote that statements always end in a ``NEWLINE`` possibly followed by\na ``DEDENT``. Also note that optional continuation clauses always\nbegin with a keyword that cannot start a statement, thus there are no\nambiguities (the \'dangling ``else``\' problem is solved in Python by\nrequiring nested ``if`` statements to be indented).\n\nThe formatting of the grammar rules in the following sections places\neach clause on a separate line for clarity.\n\n\nThe ``if`` statement\n====================\n\nThe ``if`` statement is used for conditional execution:\n\n if_stmt ::= "if" expression ":" suite\n ( "elif" expression ":" suite )*\n ["else" ":" suite]\n\nIt selects exactly one of the suites by evaluating the expressions one\nby one until one is found to be true (see section *Boolean operations*\nfor the definition of true and false); then that suite is executed\n(and no other part of the ``if`` statement is executed or evaluated).\nIf all expressions are false, the suite of the ``else`` clause, if\npresent, is executed.\n\n\nThe ``while`` statement\n=======================\n\nThe ``while`` statement is used for repeated execution as long as an\nexpression is true:\n\n while_stmt ::= "while" expression ":" suite\n ["else" ":" suite]\n\nThis repeatedly tests the expression and, if it is true, executes the\nfirst suite; if the expression is false (which may be the first time\nit is tested) the suite of the ``else`` clause, if present, is\nexecuted and the loop terminates.\n\nA ``break`` statement executed in the first suite terminates the loop\nwithout executing the ``else`` clause\'s suite. A ``continue``\nstatement executed in the first suite skips the rest of the suite and\ngoes back to testing the expression.\n\n\nThe ``for`` statement\n=====================\n\nThe ``for`` statement is used to iterate over the elements of a\nsequence (such as a string, tuple or list) or other iterable object:\n\n for_stmt ::= "for" target_list "in" expression_list ":" suite\n ["else" ":" suite]\n\nThe expression list is evaluated once; it should yield an iterable\nobject. An iterator is created for the result of the\n``expression_list``. The suite is then executed once for each item\nprovided by the iterator, in the order of ascending indices. Each\nitem in turn is assigned to the target list using the standard rules\nfor assignments, and then the suite is executed. When the items are\nexhausted (which is immediately when the sequence is empty), the suite\nin the ``else`` clause, if present, is executed, and the loop\nterminates.\n\nA ``break`` statement executed in the first suite terminates the loop\nwithout executing the ``else`` clause\'s suite. A ``continue``\nstatement executed in the first suite skips the rest of the suite and\ncontinues with the next item, or with the ``else`` clause if there was\nno next item.\n\nThe suite may assign to the variable(s) in the target list; this does\nnot affect the next item assigned to it.\n\nThe target list is not deleted when the loop is finished, but if the\nsequence is empty, it will not have been assigned to at all by the\nloop. Hint: the built-in function ``range()`` returns a sequence of\nintegers suitable to emulate the effect of Pascal\'s ``for i := a to b\ndo``; e.g., ``range(3)`` returns the list ``[0, 1, 2]``.\n\nWarning: There is a subtlety when the sequence is being modified by the loop\n (this can only occur for mutable sequences, i.e. lists). An internal\n counter is used to keep track of which item is used next, and this\n is incremented on each iteration. When this counter has reached the\n length of the sequence the loop terminates. This means that if the\n suite deletes the current (or a previous) item from the sequence,\n the next item will be skipped (since it gets the index of the\n current item which has already been treated). Likewise, if the\n suite inserts an item in the sequence before the current item, the\n current item will be treated again the next time through the loop.\n This can lead to nasty bugs that can be avoided by making a\n temporary copy using a slice of the whole sequence, e.g.,\n\n for x in a[:]:\n if x < 0: a.remove(x)\n\n\nThe ``try`` statement\n=====================\n\nThe ``try`` statement specifies exception handlers and/or cleanup code\nfor a group of statements:\n\n try_stmt ::= try1_stmt | try2_stmt\n try1_stmt ::= "try" ":" suite\n ("except" [expression ["," target]] ":" suite)+\n ["else" ":" suite]\n ["finally" ":" suite]\n try2_stmt ::= "try" ":" suite\n "finally" ":" suite\n\nChanged in version 2.5: In previous versions of Python,\n``try``...``except``...``finally`` did not work. ``try``...``except``\nhad to be nested in ``try``...``finally``.\n\nThe ``except`` clause(s) specify one or more exception handlers. When\nno exception occurs in the ``try`` clause, no exception handler is\nexecuted. When an exception occurs in the ``try`` suite, a search for\nan exception handler is started. This search inspects the except\nclauses in turn until one is found that matches the exception. An\nexpression-less except clause, if present, must be last; it matches\nany exception. For an except clause with an expression, that\nexpression is evaluated, and the clause matches the exception if the\nresulting object is "compatible" with the exception. An object is\ncompatible with an exception if it is the class or a base class of the\nexception object, a tuple containing an item compatible with the\nexception, or, in the (deprecated) case of string exceptions, is the\nraised string itself (note that the object identities must match, i.e.\nit must be the same string object, not just a string with the same\nvalue).\n\nIf no except clause matches the exception, the search for an exception\nhandler continues in the surrounding code and on the invocation stack.\n[1]\n\nIf the evaluation of an expression in the header of an except clause\nraises an exception, the original search for a handler is canceled and\na search starts for the new exception in the surrounding code and on\nthe call stack (it is treated as if the entire ``try`` statement\nraised the exception).\n\nWhen a matching except clause is found, the exception is assigned to\nthe target specified in that except clause, if present, and the except\nclause\'s suite is executed. All except clauses must have an\nexecutable block. When the end of this block is reached, execution\ncontinues normally after the entire try statement. (This means that\nif two nested handlers exist for the same exception, and the exception\noccurs in the try clause of the inner handler, the outer handler will\nnot handle the exception.)\n\nBefore an except clause\'s suite is executed, details about the\nexception are assigned to three variables in the ``sys`` module:\n``sys.exc_type`` receives the object identifying the exception;\n``sys.exc_value`` receives the exception\'s parameter;\n``sys.exc_traceback`` receives a traceback object (see section *The\nstandard type hierarchy*) identifying the point in the program where\nthe exception occurred. These details are also available through the\n``sys.exc_info()`` function, which returns a tuple ``(exc_type,\nexc_value, exc_traceback)``. Use of the corresponding variables is\ndeprecated in favor of this function, since their use is unsafe in a\nthreaded program. As of Python 1.5, the variables are restored to\ntheir previous values (before the call) when returning from a function\nthat handled an exception.\n\nThe optional ``else`` clause is executed if and when control flows off\nthe end of the ``try`` clause. [2] Exceptions in the ``else`` clause\nare not handled by the preceding ``except`` clauses.\n\nIf ``finally`` is present, it specifies a \'cleanup\' handler. The\n``try`` clause is executed, including any ``except`` and ``else``\nclauses. If an exception occurs in any of the clauses and is not\nhandled, the exception is temporarily saved. The ``finally`` clause is\nexecuted. If there is a saved exception, it is re-raised at the end\nof the ``finally`` clause. If the ``finally`` clause raises another\nexception or executes a ``return`` or ``break`` statement, the saved\nexception is lost. The exception information is not available to the\nprogram during execution of the ``finally`` clause.\n\nWhen a ``return``, ``break`` or ``continue`` statement is executed in\nthe ``try`` suite of a ``try``...``finally`` statement, the\n``finally`` clause is also executed \'on the way out.\' A ``continue``\nstatement is illegal in the ``finally`` clause. (The reason is a\nproblem with the current implementation --- this restriction may be\nlifted in the future).\n\nAdditional information on exceptions can be found in section\n*Exceptions*, and information on using the ``raise`` statement to\ngenerate exceptions may be found in section *The raise statement*.\n\n\nThe ``with`` statement\n======================\n\nAdded in version 2.5.\n\nThe ``with`` statement is used to wrap the execution of a block with\nmethods defined by a context manager (see section *With Statement\nContext Managers*). This allows common\n``try``...``except``...``finally`` usage patterns to be encapsulated\nfor convenient reuse.\n\n with_stmt ::= "with" expression ["as" target] ":" suite\n\nThe execution of the ``with`` statement proceeds as follows:\n\n1. The context expression is evaluated to obtain a context manager.\n\n2. The context manager\'s ``__enter__()`` method is invoked.\n\n3. If a target was included in the ``with`` statement, the return\n value from ``__enter__()`` is assigned to it.\n\n Note: The ``with`` statement guarantees that if the ``__enter__()``\n method returns without an error, then ``__exit__()`` will always\n be called. Thus, if an error occurs during the assignment to the\n target list, it will be treated the same as an error occurring\n within the suite would be. See step 5 below.\n\n4. The suite is executed.\n\n5. The context manager\'s ``__exit__()`` method is invoked. If an\n exception caused the suite to be exited, its type, value, and\n traceback are passed as arguments to ``__exit__()``. Otherwise,\n three ``None`` arguments are supplied.\n\n If the suite was exited due to an exception, and the return value\n from the ``__exit__()`` method was false, the exception is\n reraised. If the return value was true, the exception is\n suppressed, and execution continues with the statement following\n the ``with`` statement.\n\n If the suite was exited for any reason other than an exception, the\n return value from ``__exit__()`` is ignored, and execution proceeds\n at the normal location for the kind of exit that was taken.\n\nNote: In Python 2.5, the ``with`` statement is only allowed when the\n ``with_statement`` feature has been enabled. It is always enabled\n in Python 2.6.\n\nSee also:\n\n **PEP 0343** - The "with" statement\n The specification, background, and examples for the Python\n ``with`` statement.\n\n\nFunction definitions\n====================\n\nA function definition defines a user-defined function object (see\nsection *The standard type hierarchy*):\n\n decorated ::= decorators (classdef | funcdef)\n decorators ::= decorator+\n decorator ::= "@" dotted_name ["(" [argument_list [","]] ")"] NEWLINE\n funcdef ::= "def" funcname "(" [parameter_list] ")" ":" suite\n dotted_name ::= identifier ("." identifier)*\n parameter_list ::= (defparameter ",")*\n ( "*" identifier [, "**" identifier]\n | "**" identifier\n | defparameter [","] )\n defparameter ::= parameter ["=" expression]\n sublist ::= parameter ("," parameter)* [","]\n parameter ::= identifier | "(" sublist ")"\n funcname ::= identifier\n\nA function definition is an executable statement. Its execution binds\nthe function name in the current local namespace to a function object\n(a wrapper around the executable code for the function). This\nfunction object contains a reference to the current global namespace\nas the global namespace to be used when the function is called.\n\nThe function definition does not execute the function body; this gets\nexecuted only when the function is called.\n\nA function definition may be wrapped by one or more *decorator*\nexpressions. Decorator expressions are evaluated when the function is\ndefined, in the scope that contains the function definition. The\nresult must be a callable, which is invoked with the function object\nas the only argument. The returned value is bound to the function name\ninstead of the function object. Multiple decorators are applied in\nnested fashion. For example, the following code:\n\n @f1(arg)\n @f2\n def func(): pass\n\nis equivalent to:\n\n def func(): pass\n func = f1(arg)(f2(func))\n\nWhen one or more top-level parameters have the form *parameter* ``=``\n*expression*, the function is said to have "default parameter values."\nFor a parameter with a default value, the corresponding argument may\nbe omitted from a call, in which case the parameter\'s default value is\nsubstituted. If a parameter has a default value, all following\nparameters must also have a default value --- this is a syntactic\nrestriction that is not expressed by the grammar.\n\n**Default parameter values are evaluated when the function definition\nis executed.** This means that the expression is evaluated once, when\nthe function is defined, and that that same "pre-computed" value is\nused for each call. This is especially important to understand when a\ndefault parameter is a mutable object, such as a list or a dictionary:\nif the function modifies the object (e.g. by appending an item to a\nlist), the default value is in effect modified. This is generally not\nwhat was intended. A way around this is to use ``None`` as the\ndefault, and explicitly test for it in the body of the function, e.g.:\n\n def whats_on_the_telly(penguin=None):\n if penguin is None:\n penguin = []\n penguin.append("property of the zoo")\n return penguin\n\nFunction call semantics are described in more detail in section\n*Calls*. A function call always assigns values to all parameters\nmentioned in the parameter list, either from position arguments, from\nkeyword arguments, or from default values. If the form\n"``*identifier``" is present, it is initialized to a tuple receiving\nany excess positional parameters, defaulting to the empty tuple. If\nthe form "``**identifier``" is present, it is initialized to a new\ndictionary receiving any excess keyword arguments, defaulting to a new\nempty dictionary.\n\nIt is also possible to create anonymous functions (functions not bound\nto a name), for immediate use in expressions. This uses lambda forms,\ndescribed in section *Expression lists*. Note that the lambda form is\nmerely a shorthand for a simplified function definition; a function\ndefined in a "``def``" statement can be passed around or assigned to\nanother name just like a function defined by a lambda form. The\n"``def``" form is actually more powerful since it allows the execution\nof multiple statements.\n\n**Programmer\'s note:** Functions are first-class objects. A "``def``"\nform executed inside a function definition defines a local function\nthat can be returned or passed around. Free variables used in the\nnested function can access the local variables of the function\ncontaining the def. See section *Naming and binding* for details.\n\n\nClass definitions\n=================\n\nA class definition defines a class object (see section *The standard\ntype hierarchy*):\n\n classdef ::= "class" classname [inheritance] ":" suite\n inheritance ::= "(" [expression_list] ")"\n classname ::= identifier\n\nA class definition is an executable statement. It first evaluates the\ninheritance list, if present. Each item in the inheritance list\nshould evaluate to a class object or class type which allows\nsubclassing. The class\'s suite is then executed in a new execution\nframe (see section *Naming and binding*), using a newly created local\nnamespace and the original global namespace. (Usually, the suite\ncontains only function definitions.) When the class\'s suite finishes\nexecution, its execution frame is discarded but its local namespace is\nsaved. A class object is then created using the inheritance list for\nthe base classes and the saved local namespace for the attribute\ndictionary. The class name is bound to this class object in the\noriginal local namespace.\n\n**Programmer\'s note:** Variables defined in the class definition are\nclass variables; they are shared by all instances. To create instance\nvariables, they can be set in a method with ``self.name = value``.\nBoth class and instance variables are accessible through the notation\n"``self.name``", and an instance variable hides a class variable with\nthe same name when accessed in this way. Class variables can be used\nas defaults for instance variables, but using mutable values there can\nlead to unexpected results. For *new-style class*es, descriptors can\nbe used to create instance variables with different implementation\ndetails.\n\nClass definitions, like function definitions, may be wrapped by one or\nmore *decorator* expressions. The evaluation rules for the decorator\nexpressions are the same as for functions. The result must be a class\nobject, which is then bound to the class name.\n\n-[ Footnotes ]-\n\n[1] The exception is propagated to the invocation stack only if there\n is no ``finally`` clause that negates the exception.\n\n[2] Currently, control "flows off the end" except in the case of an\n exception or the execution of a ``return``, ``continue``, or\n ``break`` statement.\n', - 'context-managers': u'\nWith Statement Context Managers\n*******************************\n\nAdded in version 2.5.\n\nA *context manager* is an object that defines the runtime context to\nbe established when executing a ``with`` statement. The context\nmanager handles the entry into, and the exit from, the desired runtime\ncontext for the execution of the block of code. Context managers are\nnormally invoked using the ``with`` statement (described in section\n*The with statement*), but can also be used by directly invoking their\nmethods.\n\nTypical uses of context managers include saving and restoring various\nkinds of global state, locking and unlocking resources, closing opened\nfiles, etc.\n\nFor more information on context managers, see *Context Manager Types*.\n\nobject.__enter__(self)\n\n Enter the runtime context related to this object. The ``with``\n statement will bind this method\'s return value to the target(s)\n specified in the ``as`` clause of the statement, if any.\n\nobject.__exit__(self, exc_type, exc_value, traceback)\n\n Exit the runtime context related to this object. The parameters\n describe the exception that caused the context to be exited. If the\n context was exited without an exception, all three arguments will\n be ``None``.\n\n If an exception is supplied, and the method wishes to suppress the\n exception (i.e., prevent it from being propagated), it should\n return a true value. Otherwise, the exception will be processed\n normally upon exit from this method.\n\n Note that ``__exit__()`` methods should not reraise the passed-in\n exception; this is the caller\'s responsibility.\n\nSee also:\n\n **PEP 0343** - The "with" statement\n The specification, background, and examples for the Python\n ``with`` statement.\n\n-[ Footnotes ]-\n\n[1] Since Python 2.2, a gradual merging of types and classes has been\n started that makes this and a few other assertions made in this\n manual not 100% accurate and complete: for example, it *is* now\n possible in some cases to change an object\'s type, under certain\n controlled conditions. Until this manual undergoes extensive\n revision, it must now be taken as authoritative only regarding\n "classic classes", that are still the default, for compatibility\n purposes, in Python 2.2 and 2.3. For more information, see\n http://www.python.org/doc/newstyle/.\n\n[2] This, and other statements, are only roughly true for instances of\n new-style classes.\n\n[3] A descriptor can define any combination of ``__get__()``,\n ``__set__()`` and ``__delete__()``. If it does not define\n ``__get__()``, then accessing the attribute even on an instance\n will return the descriptor object itself. If the descriptor\n defines ``__set__()`` and/or ``__delete__()``, it is a data\n descriptor; if it defines neither, it is a non-data descriptor.\n\n[4] For operands of the same type, it is assumed that if the non-\n reflected method (such as ``__add__()``) fails the operation is\n not supported, which is why the reflected method is not called.\n', + 'calls': u'\nCalls\n*****\n\nA call calls a callable object (e.g., a function) with a possibly\nempty series of arguments:\n\n call ::= primary "(" [argument_list [","]\n | expression genexpr_for] ")"\n argument_list ::= positional_arguments ["," keyword_arguments]\n ["," "*" expression] ["," keyword_arguments]\n ["," "**" expression]\n | keyword_arguments ["," "*" expression]\n ["," "**" expression]\n | "*" expression ["," "*" expression] ["," "**" expression]\n | "**" expression\n positional_arguments ::= expression ("," expression)*\n keyword_arguments ::= keyword_item ("," keyword_item)*\n keyword_item ::= identifier "=" expression\n\nA trailing comma may be present after the positional and keyword\narguments but does not affect the semantics.\n\nThe primary must evaluate to a callable object (user-defined\nfunctions, built-in functions, methods of built-in objects, class\nobjects, methods of class instances, and certain class instances\nthemselves are callable; extensions may define additional callable\nobject types). All argument expressions are evaluated before the call\nis attempted. Please refer to section *Function definitions* for the\nsyntax of formal parameter lists.\n\nIf keyword arguments are present, they are first converted to\npositional arguments, as follows. First, a list of unfilled slots is\ncreated for the formal parameters. If there are N positional\narguments, they are placed in the first N slots. Next, for each\nkeyword argument, the identifier is used to determine the\ncorresponding slot (if the identifier is the same as the first formal\nparameter name, the first slot is used, and so on). If the slot is\nalready filled, a ``TypeError`` exception is raised. Otherwise, the\nvalue of the argument is placed in the slot, filling it (even if the\nexpression is ``None``, it fills the slot). When all arguments have\nbeen processed, the slots that are still unfilled are filled with the\ncorresponding default value from the function definition. (Default\nvalues are calculated, once, when the function is defined; thus, a\nmutable object such as a list or dictionary used as default value will\nbe shared by all calls that don\'t specify an argument value for the\ncorresponding slot; this should usually be avoided.) If there are any\nunfilled slots for which no default value is specified, a\n``TypeError`` exception is raised. Otherwise, the list of filled\nslots is used as the argument list for the call.\n\nNote: An implementation may provide builtin functions whose positional\n parameters do not have names, even if they are \'named\' for the\n purpose of documentation, and which therefore cannot be supplied by\n keyword. In CPython, this is the case for functions implemented in\n C that use ``PyArg_ParseTuple`` to parse their arguments.\n\nIf there are more positional arguments than there are formal parameter\nslots, a ``TypeError`` exception is raised, unless a formal parameter\nusing the syntax ``*identifier`` is present; in this case, that formal\nparameter receives a tuple containing the excess positional arguments\n(or an empty tuple if there were no excess positional arguments).\n\nIf any keyword argument does not correspond to a formal parameter\nname, a ``TypeError`` exception is raised, unless a formal parameter\nusing the syntax ``**identifier`` is present; in this case, that\nformal parameter receives a dictionary containing the excess keyword\narguments (using the keywords as keys and the argument values as\ncorresponding values), or a (new) empty dictionary if there were no\nexcess keyword arguments.\n\nIf the syntax ``*expression`` appears in the function call,\n``expression`` must evaluate to a sequence. Elements from this\nsequence are treated as if they were additional positional arguments;\nif there are positional arguments *x1*,..., *xN*, and ``expression``\nevaluates to a sequence *y1*, ..., *yM*, this is equivalent to a call\nwith M+N positional arguments *x1*, ..., *xN*, *y1*, ..., *yM*.\n\nA consequence of this is that although the ``*expression`` syntax may\nappear *after* some keyword arguments, it is processed *before* the\nkeyword arguments (and the ``**expression`` argument, if any -- see\nbelow). So:\n\n >>> def f(a, b):\n ... print a, b\n ...\n >>> f(b=1, *(2,))\n 2 1\n >>> f(a=1, *(2,))\n Traceback (most recent call last):\n File "", line 1, in ?\n TypeError: f() got multiple values for keyword argument \'a\'\n >>> f(1, *(2,))\n 1 2\n\nIt is unusual for both keyword arguments and the ``*expression``\nsyntax to be used in the same call, so in practice this confusion does\nnot arise.\n\nIf the syntax ``**expression`` appears in the function call,\n``expression`` must evaluate to a mapping, the contents of which are\ntreated as additional keyword arguments. In the case of a keyword\nappearing in both ``expression`` and as an explicit keyword argument,\na ``TypeError`` exception is raised.\n\nFormal parameters using the syntax ``*identifier`` or ``**identifier``\ncannot be used as positional argument slots or as keyword argument\nnames. Formal parameters using the syntax ``(sublist)`` cannot be\nused as keyword argument names; the outermost sublist corresponds to a\nsingle unnamed argument slot, and the argument value is assigned to\nthe sublist using the usual tuple assignment rules after all other\nparameter processing is done.\n\nA call always returns some value, possibly ``None``, unless it raises\nan exception. How this value is computed depends on the type of the\ncallable object.\n\nIf it is---\n\na user-defined function:\n The code block for the function is executed, passing it the\n argument list. The first thing the code block will do is bind the\n formal parameters to the arguments; this is described in section\n *Function definitions*. When the code block executes a ``return``\n statement, this specifies the return value of the function call.\n\na built-in function or method:\n The result is up to the interpreter; see *Built-in Functions* for\n the descriptions of built-in functions and methods.\n\na class object:\n A new instance of that class is returned.\n\na class instance method:\n The corresponding user-defined function is called, with an argument\n list that is one longer than the argument list of the call: the\n instance becomes the first argument.\n\na class instance:\n The class must define a ``__call__()`` method; the effect is then\n the same as if that method was called.\n', + 'class': u'\nClass definitions\n*****************\n\nA class definition defines a class object (see section *The standard\ntype hierarchy*):\n\n classdef ::= "class" classname [inheritance] ":" suite\n inheritance ::= "(" [expression_list] ")"\n classname ::= identifier\n\nA class definition is an executable statement. It first evaluates the\ninheritance list, if present. Each item in the inheritance list\nshould evaluate to a class object or class type which allows\nsubclassing. The class\'s suite is then executed in a new execution\nframe (see section *Naming and binding*), using a newly created local\nnamespace and the original global namespace. (Usually, the suite\ncontains only function definitions.) When the class\'s suite finishes\nexecution, its execution frame is discarded but its local namespace is\nsaved. [4] A class object is then created using the inheritance list\nfor the base classes and the saved local namespace for the attribute\ndictionary. The class name is bound to this class object in the\noriginal local namespace.\n\n**Programmer\'s note:** Variables defined in the class definition are\nclass variables; they are shared by all instances. To create instance\nvariables, they can be set in a method with ``self.name = value``.\nBoth class and instance variables are accessible through the notation\n"``self.name``", and an instance variable hides a class variable with\nthe same name when accessed in this way. Class variables can be used\nas defaults for instance variables, but using mutable values there can\nlead to unexpected results. For *new-style class*es, descriptors can\nbe used to create instance variables with different implementation\ndetails.\n\nClass definitions, like function definitions, may be wrapped by one or\nmore *decorator* expressions. The evaluation rules for the decorator\nexpressions are the same as for functions. The result must be a class\nobject, which is then bound to the class name.\n\n-[ Footnotes ]-\n\n[1] The exception is propagated to the invocation stack only if there\n is no ``finally`` clause that negates the exception.\n\n[2] Currently, control "flows off the end" except in the case of an\n exception or the execution of a ``return``, ``continue``, or\n ``break`` statement.\n\n[3] A string literal appearing as the first statement in the function\n body is transformed into the function\'s ``__doc__`` attribute and\n therefore the function\'s *docstring*.\n\n[4] A string literal appearing as the first statement in the class\n body is transformed into the namespace\'s ``__doc__`` item and\n therefore the class\'s *docstring*.\n', + 'coercion-rules': u"\nCoercion rules\n**************\n\nThis section used to document the rules for coercion. As the language\nhas evolved, the coercion rules have become hard to document\nprecisely; documenting what one version of one particular\nimplementation does is undesirable. Instead, here are some informal\nguidelines regarding coercion. In Python 3.0, coercion will not be\nsupported.\n\n* If the left operand of a % operator is a string or Unicode object,\n no coercion takes place and the string formatting operation is\n invoked instead.\n\n* It is no longer recommended to define a coercion operation. Mixed-\n mode operations on types that don't define coercion pass the\n original arguments to the operation.\n\n* New-style classes (those derived from ``object``) never invoke the\n ``__coerce__()`` method in response to a binary operator; the only\n time ``__coerce__()`` is invoked is when the built-in function\n ``coerce()`` is called.\n\n* For most intents and purposes, an operator that returns\n ``NotImplemented`` is treated the same as one that is not\n implemented at all.\n\n* Below, ``__op__()`` and ``__rop__()`` are used to signify the\n generic method names corresponding to an operator; ``__iop__()`` is\n used for the corresponding in-place operator. For example, for the\n operator '``+``', ``__add__()`` and ``__radd__()`` are used for the\n left and right variant of the binary operator, and ``__iadd__()``\n for the in-place variant.\n\n* For objects *x* and *y*, first ``x.__op__(y)`` is tried. If this is\n not implemented or returns ``NotImplemented``, ``y.__rop__(x)`` is\n tried. If this is also not implemented or returns\n ``NotImplemented``, a ``TypeError`` exception is raised. But see\n the following exception:\n\n* Exception to the previous item: if the left operand is an instance\n of a built-in type or a new-style class, and the right operand is an\n instance of a proper subclass of that type or class and overrides\n the base's ``__rop__()`` method, the right operand's ``__rop__()``\n method is tried *before* the left operand's ``__op__()`` method.\n\n This is done so that a subclass can completely override binary\n operators. Otherwise, the left operand's ``__op__()`` method would\n always accept the right operand: when an instance of a given class\n is expected, an instance of a subclass of that class is always\n acceptable.\n\n* When either operand type defines a coercion, this coercion is called\n before that type's ``__op__()`` or ``__rop__()`` method is called,\n but no sooner. If the coercion returns an object of a different\n type for the operand whose coercion is invoked, part of the process\n is redone using the new object.\n\n* When an in-place operator (like '``+=``') is used, if the left\n operand implements ``__iop__()``, it is invoked without any\n coercion. When the operation falls back to ``__op__()`` and/or\n ``__rop__()``, the normal coercion rules apply.\n\n* In ``x + y``, if *x* is a sequence that implements sequence\n concatenation, sequence concatenation is invoked.\n\n* In ``x * y``, if one operator is a sequence that implements sequence\n repetition, and the other is an integer (``int`` or ``long``),\n sequence repetition is invoked.\n\n* Rich comparisons (implemented by methods ``__eq__()`` and so on)\n never use coercion. Three-way comparison (implemented by\n ``__cmp__()``) does use coercion under the same conditions as other\n binary operations use it.\n\n* In the current implementation, the built-in numeric types ``int``,\n ``long`` and ``float`` do not use coercion; the type ``complex``\n however does use it. The difference can become apparent when\n subclassing these types. Over time, the type ``complex`` may be\n fixed to avoid coercion. All these types implement a\n ``__coerce__()`` method, for use by the built-in ``coerce()``\n function.\n", + 'comparisons': u'\nComparisons\n***********\n\nUnlike C, all comparison operations in Python have the same priority,\nwhich is lower than that of any arithmetic, shifting or bitwise\noperation. Also unlike C, expressions like ``a < b < c`` have the\ninterpretation that is conventional in mathematics:\n\n comparison ::= or_expr ( comp_operator or_expr )*\n comp_operator ::= "<" | ">" | "==" | ">=" | "<=" | "<>" | "!="\n | "is" ["not"] | ["not"] "in"\n\nComparisons yield boolean values: ``True`` or ``False``.\n\nComparisons can be chained arbitrarily, e.g., ``x < y <= z`` is\nequivalent to ``x < y and y <= z``, except that ``y`` is evaluated\nonly once (but in both cases ``z`` is not evaluated at all when ``x <\ny`` is found to be false).\n\nFormally, if *a*, *b*, *c*, ..., *y*, *z* are expressions and *op1*,\n*op2*, ..., *opN* are comparison operators, then ``a op1 b op2 c ... y\nopN z`` is equivalent to ``a op1 b and b op2 c and ... y opN z``,\nexcept that each expression is evaluated at most once.\n\nNote that ``a op1 b op2 c`` doesn\'t imply any kind of comparison\nbetween *a* and *c*, so that, e.g., ``x < y > z`` is perfectly legal\n(though perhaps not pretty).\n\nThe forms ``<>`` and ``!=`` are equivalent; for consistency with C,\n``!=`` is preferred; where ``!=`` is mentioned below ``<>`` is also\naccepted. The ``<>`` spelling is considered obsolescent.\n\nThe operators ``<``, ``>``, ``==``, ``>=``, ``<=``, and ``!=`` compare\nthe values of two objects. The objects need not have the same type.\nIf both are numbers, they are converted to a common type. Otherwise,\nobjects of different types *always* compare unequal, and are ordered\nconsistently but arbitrarily. You can control comparison behavior of\nobjects of non-builtin types by defining a ``__cmp__`` method or rich\ncomparison methods like ``__gt__``, described in section *Special\nmethod names*.\n\n(This unusual definition of comparison was used to simplify the\ndefinition of operations like sorting and the ``in`` and ``not in``\noperators. In the future, the comparison rules for objects of\ndifferent types are likely to change.)\n\nComparison of objects of the same type depends on the type:\n\n* Numbers are compared arithmetically.\n\n* Strings are compared lexicographically using the numeric equivalents\n (the result of the built-in function ``ord()``) of their characters.\n Unicode and 8-bit strings are fully interoperable in this behavior.\n [4]\n\n* Tuples and lists are compared lexicographically using comparison of\n corresponding elements. This means that to compare equal, each\n element must compare equal and the two sequences must be of the same\n type and have the same length.\n\n If not equal, the sequences are ordered the same as their first\n differing elements. For example, ``cmp([1,2,x], [1,2,y])`` returns\n the same as ``cmp(x,y)``. If the corresponding element does not\n exist, the shorter sequence is ordered first (for example, ``[1,2] <\n [1,2,3]``).\n\n* Mappings (dictionaries) compare equal if and only if their sorted\n (key, value) lists compare equal. [5] Outcomes other than equality\n are resolved consistently, but are not otherwise defined. [6]\n\n* Most other objects of builtin types compare unequal unless they are\n the same object; the choice whether one object is considered smaller\n or larger than another one is made arbitrarily but consistently\n within one execution of a program.\n\nThe operators ``in`` and ``not in`` test for collection membership.\n``x in s`` evaluates to true if *x* is a member of the collection *s*,\nand false otherwise. ``x not in s`` returns the negation of ``x in\ns``. The collection membership test has traditionally been bound to\nsequences; an object is a member of a collection if the collection is\na sequence and contains an element equal to that object. However, it\nmake sense for many other object types to support membership tests\nwithout being a sequence. In particular, dictionaries (for keys) and\nsets support membership testing.\n\nFor the list and tuple types, ``x in y`` is true if and only if there\nexists an index *i* such that ``x == y[i]`` is true.\n\nFor the Unicode and string types, ``x in y`` is true if and only if\n*x* is a substring of *y*. An equivalent test is ``y.find(x) != -1``.\nNote, *x* and *y* need not be the same type; consequently, ``u\'ab\' in\n\'abc\'`` will return ``True``. Empty strings are always considered to\nbe a substring of any other string, so ``"" in "abc"`` will return\n``True``.\n\nChanged in version 2.3: Previously, *x* was required to be a string of\nlength ``1``.\n\nFor user-defined classes which define the ``__contains__()`` method,\n``x in y`` is true if and only if ``y.__contains__(x)`` is true.\n\nFor user-defined classes which do not define ``__contains__()`` and do\ndefine ``__getitem__()``, ``x in y`` is true if and only if there is a\nnon-negative integer index *i* such that ``x == y[i]``, and all lower\ninteger indices do not raise ``IndexError`` exception. (If any other\nexception is raised, it is as if ``in`` raised that exception).\n\nThe operator ``not in`` is defined to have the inverse true value of\n``in``.\n\nThe operators ``is`` and ``is not`` test for object identity: ``x is\ny`` is true if and only if *x* and *y* are the same object. ``x is\nnot y`` yields the inverse truth value. [7]\n', + 'compound': u'\nCompound statements\n*******************\n\nCompound statements contain (groups of) other statements; they affect\nor control the execution of those other statements in some way. In\ngeneral, compound statements span multiple lines, although in simple\nincarnations a whole compound statement may be contained in one line.\n\nThe ``if``, ``while`` and ``for`` statements implement traditional\ncontrol flow constructs. ``try`` specifies exception handlers and/or\ncleanup code for a group of statements. Function and class\ndefinitions are also syntactically compound statements.\n\nCompound statements consist of one or more \'clauses.\' A clause\nconsists of a header and a \'suite.\' The clause headers of a\nparticular compound statement are all at the same indentation level.\nEach clause header begins with a uniquely identifying keyword and ends\nwith a colon. A suite is a group of statements controlled by a\nclause. A suite can be one or more semicolon-separated simple\nstatements on the same line as the header, following the header\'s\ncolon, or it can be one or more indented statements on subsequent\nlines. Only the latter form of suite can contain nested compound\nstatements; the following is illegal, mostly because it wouldn\'t be\nclear to which ``if`` clause a following ``else`` clause would belong:\n\n if test1: if test2: print x\n\nAlso note that the semicolon binds tighter than the colon in this\ncontext, so that in the following example, either all or none of the\n``print`` statements are executed:\n\n if x < y < z: print x; print y; print z\n\nSummarizing:\n\n compound_stmt ::= if_stmt\n | while_stmt\n | for_stmt\n | try_stmt\n | with_stmt\n | funcdef\n | classdef\n | decorated\n suite ::= stmt_list NEWLINE | NEWLINE INDENT statement+ DEDENT\n statement ::= stmt_list NEWLINE | compound_stmt\n stmt_list ::= simple_stmt (";" simple_stmt)* [";"]\n\nNote that statements always end in a ``NEWLINE`` possibly followed by\na ``DEDENT``. Also note that optional continuation clauses always\nbegin with a keyword that cannot start a statement, thus there are no\nambiguities (the \'dangling ``else``\' problem is solved in Python by\nrequiring nested ``if`` statements to be indented).\n\nThe formatting of the grammar rules in the following sections places\neach clause on a separate line for clarity.\n\n\nThe ``if`` statement\n====================\n\nThe ``if`` statement is used for conditional execution:\n\n if_stmt ::= "if" expression ":" suite\n ( "elif" expression ":" suite )*\n ["else" ":" suite]\n\nIt selects exactly one of the suites by evaluating the expressions one\nby one until one is found to be true (see section *Boolean operations*\nfor the definition of true and false); then that suite is executed\n(and no other part of the ``if`` statement is executed or evaluated).\nIf all expressions are false, the suite of the ``else`` clause, if\npresent, is executed.\n\n\nThe ``while`` statement\n=======================\n\nThe ``while`` statement is used for repeated execution as long as an\nexpression is true:\n\n while_stmt ::= "while" expression ":" suite\n ["else" ":" suite]\n\nThis repeatedly tests the expression and, if it is true, executes the\nfirst suite; if the expression is false (which may be the first time\nit is tested) the suite of the ``else`` clause, if present, is\nexecuted and the loop terminates.\n\nA ``break`` statement executed in the first suite terminates the loop\nwithout executing the ``else`` clause\'s suite. A ``continue``\nstatement executed in the first suite skips the rest of the suite and\ngoes back to testing the expression.\n\n\nThe ``for`` statement\n=====================\n\nThe ``for`` statement is used to iterate over the elements of a\nsequence (such as a string, tuple or list) or other iterable object:\n\n for_stmt ::= "for" target_list "in" expression_list ":" suite\n ["else" ":" suite]\n\nThe expression list is evaluated once; it should yield an iterable\nobject. An iterator is created for the result of the\n``expression_list``. The suite is then executed once for each item\nprovided by the iterator, in the order of ascending indices. Each\nitem in turn is assigned to the target list using the standard rules\nfor assignments, and then the suite is executed. When the items are\nexhausted (which is immediately when the sequence is empty), the suite\nin the ``else`` clause, if present, is executed, and the loop\nterminates.\n\nA ``break`` statement executed in the first suite terminates the loop\nwithout executing the ``else`` clause\'s suite. A ``continue``\nstatement executed in the first suite skips the rest of the suite and\ncontinues with the next item, or with the ``else`` clause if there was\nno next item.\n\nThe suite may assign to the variable(s) in the target list; this does\nnot affect the next item assigned to it.\n\nThe target list is not deleted when the loop is finished, but if the\nsequence is empty, it will not have been assigned to at all by the\nloop. Hint: the built-in function ``range()`` returns a sequence of\nintegers suitable to emulate the effect of Pascal\'s ``for i := a to b\ndo``; e.g., ``range(3)`` returns the list ``[0, 1, 2]``.\n\nWarning: There is a subtlety when the sequence is being modified by the loop\n (this can only occur for mutable sequences, i.e. lists). An internal\n counter is used to keep track of which item is used next, and this\n is incremented on each iteration. When this counter has reached the\n length of the sequence the loop terminates. This means that if the\n suite deletes the current (or a previous) item from the sequence,\n the next item will be skipped (since it gets the index of the\n current item which has already been treated). Likewise, if the\n suite inserts an item in the sequence before the current item, the\n current item will be treated again the next time through the loop.\n This can lead to nasty bugs that can be avoided by making a\n temporary copy using a slice of the whole sequence, e.g.,\n\n for x in a[:]:\n if x < 0: a.remove(x)\n\n\nThe ``try`` statement\n=====================\n\nThe ``try`` statement specifies exception handlers and/or cleanup code\nfor a group of statements:\n\n try_stmt ::= try1_stmt | try2_stmt\n try1_stmt ::= "try" ":" suite\n ("except" [expression ["," target]] ":" suite)+\n ["else" ":" suite]\n ["finally" ":" suite]\n try2_stmt ::= "try" ":" suite\n "finally" ":" suite\n\nChanged in version 2.5: In previous versions of Python,\n``try``...``except``...``finally`` did not work. ``try``...``except``\nhad to be nested in ``try``...``finally``.\n\nThe ``except`` clause(s) specify one or more exception handlers. When\nno exception occurs in the ``try`` clause, no exception handler is\nexecuted. When an exception occurs in the ``try`` suite, a search for\nan exception handler is started. This search inspects the except\nclauses in turn until one is found that matches the exception. An\nexpression-less except clause, if present, must be last; it matches\nany exception. For an except clause with an expression, that\nexpression is evaluated, and the clause matches the exception if the\nresulting object is "compatible" with the exception. An object is\ncompatible with an exception if it is the class or a base class of the\nexception object, a tuple containing an item compatible with the\nexception, or, in the (deprecated) case of string exceptions, is the\nraised string itself (note that the object identities must match, i.e.\nit must be the same string object, not just a string with the same\nvalue).\n\nIf no except clause matches the exception, the search for an exception\nhandler continues in the surrounding code and on the invocation stack.\n[1]\n\nIf the evaluation of an expression in the header of an except clause\nraises an exception, the original search for a handler is canceled and\na search starts for the new exception in the surrounding code and on\nthe call stack (it is treated as if the entire ``try`` statement\nraised the exception).\n\nWhen a matching except clause is found, the exception is assigned to\nthe target specified in that except clause, if present, and the except\nclause\'s suite is executed. All except clauses must have an\nexecutable block. When the end of this block is reached, execution\ncontinues normally after the entire try statement. (This means that\nif two nested handlers exist for the same exception, and the exception\noccurs in the try clause of the inner handler, the outer handler will\nnot handle the exception.)\n\nBefore an except clause\'s suite is executed, details about the\nexception are assigned to three variables in the ``sys`` module:\n``sys.exc_type`` receives the object identifying the exception;\n``sys.exc_value`` receives the exception\'s parameter;\n``sys.exc_traceback`` receives a traceback object (see section *The\nstandard type hierarchy*) identifying the point in the program where\nthe exception occurred. These details are also available through the\n``sys.exc_info()`` function, which returns a tuple ``(exc_type,\nexc_value, exc_traceback)``. Use of the corresponding variables is\ndeprecated in favor of this function, since their use is unsafe in a\nthreaded program. As of Python 1.5, the variables are restored to\ntheir previous values (before the call) when returning from a function\nthat handled an exception.\n\nThe optional ``else`` clause is executed if and when control flows off\nthe end of the ``try`` clause. [2] Exceptions in the ``else`` clause\nare not handled by the preceding ``except`` clauses.\n\nIf ``finally`` is present, it specifies a \'cleanup\' handler. The\n``try`` clause is executed, including any ``except`` and ``else``\nclauses. If an exception occurs in any of the clauses and is not\nhandled, the exception is temporarily saved. The ``finally`` clause is\nexecuted. If there is a saved exception, it is re-raised at the end\nof the ``finally`` clause. If the ``finally`` clause raises another\nexception or executes a ``return`` or ``break`` statement, the saved\nexception is lost. The exception information is not available to the\nprogram during execution of the ``finally`` clause.\n\nWhen a ``return``, ``break`` or ``continue`` statement is executed in\nthe ``try`` suite of a ``try``...``finally`` statement, the\n``finally`` clause is also executed \'on the way out.\' A ``continue``\nstatement is illegal in the ``finally`` clause. (The reason is a\nproblem with the current implementation --- this restriction may be\nlifted in the future).\n\nAdditional information on exceptions can be found in section\n*Exceptions*, and information on using the ``raise`` statement to\ngenerate exceptions may be found in section *The raise statement*.\n\n\nThe ``with`` statement\n======================\n\nNew in version 2.5.\n\nThe ``with`` statement is used to wrap the execution of a block with\nmethods defined by a context manager (see section *With Statement\nContext Managers*). This allows common\n``try``...``except``...``finally`` usage patterns to be encapsulated\nfor convenient reuse.\n\n with_stmt ::= "with" expression ["as" target] ":" suite\n\nThe execution of the ``with`` statement proceeds as follows:\n\n1. The context expression is evaluated to obtain a context manager.\n\n2. The context manager\'s ``__enter__()`` method is invoked.\n\n3. If a target was included in the ``with`` statement, the return\n value from ``__enter__()`` is assigned to it.\n\n Note: The ``with`` statement guarantees that if the ``__enter__()``\n method returns without an error, then ``__exit__()`` will always\n be called. Thus, if an error occurs during the assignment to the\n target list, it will be treated the same as an error occurring\n within the suite would be. See step 5 below.\n\n4. The suite is executed.\n\n5. The context manager\'s ``__exit__()`` method is invoked. If an\n exception caused the suite to be exited, its type, value, and\n traceback are passed as arguments to ``__exit__()``. Otherwise,\n three ``None`` arguments are supplied.\n\n If the suite was exited due to an exception, and the return value\n from the ``__exit__()`` method was false, the exception is\n reraised. If the return value was true, the exception is\n suppressed, and execution continues with the statement following\n the ``with`` statement.\n\n If the suite was exited for any reason other than an exception, the\n return value from ``__exit__()`` is ignored, and execution proceeds\n at the normal location for the kind of exit that was taken.\n\nNote: In Python 2.5, the ``with`` statement is only allowed when the\n ``with_statement`` feature has been enabled. It is always enabled\n in Python 2.6.\n\nSee also:\n\n **PEP 0343** - The "with" statement\n The specification, background, and examples for the Python\n ``with`` statement.\n\n\nFunction definitions\n====================\n\nA function definition defines a user-defined function object (see\nsection *The standard type hierarchy*):\n\n decorated ::= decorators (classdef | funcdef)\n decorators ::= decorator+\n decorator ::= "@" dotted_name ["(" [argument_list [","]] ")"] NEWLINE\n funcdef ::= "def" funcname "(" [parameter_list] ")" ":" suite\n dotted_name ::= identifier ("." identifier)*\n parameter_list ::= (defparameter ",")*\n ( "*" identifier [, "**" identifier]\n | "**" identifier\n | defparameter [","] )\n defparameter ::= parameter ["=" expression]\n sublist ::= parameter ("," parameter)* [","]\n parameter ::= identifier | "(" sublist ")"\n funcname ::= identifier\n\nA function definition is an executable statement. Its execution binds\nthe function name in the current local namespace to a function object\n(a wrapper around the executable code for the function). This\nfunction object contains a reference to the current global namespace\nas the global namespace to be used when the function is called.\n\nThe function definition does not execute the function body; this gets\nexecuted only when the function is called. [3]\n\nA function definition may be wrapped by one or more *decorator*\nexpressions. Decorator expressions are evaluated when the function is\ndefined, in the scope that contains the function definition. The\nresult must be a callable, which is invoked with the function object\nas the only argument. The returned value is bound to the function name\ninstead of the function object. Multiple decorators are applied in\nnested fashion. For example, the following code:\n\n @f1(arg)\n @f2\n def func(): pass\n\nis equivalent to:\n\n def func(): pass\n func = f1(arg)(f2(func))\n\nWhen one or more top-level parameters have the form *parameter* ``=``\n*expression*, the function is said to have "default parameter values."\nFor a parameter with a default value, the corresponding argument may\nbe omitted from a call, in which case the parameter\'s default value is\nsubstituted. If a parameter has a default value, all following\nparameters must also have a default value --- this is a syntactic\nrestriction that is not expressed by the grammar.\n\n**Default parameter values are evaluated when the function definition\nis executed.** This means that the expression is evaluated once, when\nthe function is defined, and that that same "pre-computed" value is\nused for each call. This is especially important to understand when a\ndefault parameter is a mutable object, such as a list or a dictionary:\nif the function modifies the object (e.g. by appending an item to a\nlist), the default value is in effect modified. This is generally not\nwhat was intended. A way around this is to use ``None`` as the\ndefault, and explicitly test for it in the body of the function, e.g.:\n\n def whats_on_the_telly(penguin=None):\n if penguin is None:\n penguin = []\n penguin.append("property of the zoo")\n return penguin\n\nFunction call semantics are described in more detail in section\n*Calls*. A function call always assigns values to all parameters\nmentioned in the parameter list, either from position arguments, from\nkeyword arguments, or from default values. If the form\n"``*identifier``" is present, it is initialized to a tuple receiving\nany excess positional parameters, defaulting to the empty tuple. If\nthe form "``**identifier``" is present, it is initialized to a new\ndictionary receiving any excess keyword arguments, defaulting to a new\nempty dictionary.\n\nIt is also possible to create anonymous functions (functions not bound\nto a name), for immediate use in expressions. This uses lambda forms,\ndescribed in section *Expression lists*. Note that the lambda form is\nmerely a shorthand for a simplified function definition; a function\ndefined in a "``def``" statement can be passed around or assigned to\nanother name just like a function defined by a lambda form. The\n"``def``" form is actually more powerful since it allows the execution\nof multiple statements.\n\n**Programmer\'s note:** Functions are first-class objects. A "``def``"\nform executed inside a function definition defines a local function\nthat can be returned or passed around. Free variables used in the\nnested function can access the local variables of the function\ncontaining the def. See section *Naming and binding* for details.\n\n\nClass definitions\n=================\n\nA class definition defines a class object (see section *The standard\ntype hierarchy*):\n\n classdef ::= "class" classname [inheritance] ":" suite\n inheritance ::= "(" [expression_list] ")"\n classname ::= identifier\n\nA class definition is an executable statement. It first evaluates the\ninheritance list, if present. Each item in the inheritance list\nshould evaluate to a class object or class type which allows\nsubclassing. The class\'s suite is then executed in a new execution\nframe (see section *Naming and binding*), using a newly created local\nnamespace and the original global namespace. (Usually, the suite\ncontains only function definitions.) When the class\'s suite finishes\nexecution, its execution frame is discarded but its local namespace is\nsaved. [4] A class object is then created using the inheritance list\nfor the base classes and the saved local namespace for the attribute\ndictionary. The class name is bound to this class object in the\noriginal local namespace.\n\n**Programmer\'s note:** Variables defined in the class definition are\nclass variables; they are shared by all instances. To create instance\nvariables, they can be set in a method with ``self.name = value``.\nBoth class and instance variables are accessible through the notation\n"``self.name``", and an instance variable hides a class variable with\nthe same name when accessed in this way. Class variables can be used\nas defaults for instance variables, but using mutable values there can\nlead to unexpected results. For *new-style class*es, descriptors can\nbe used to create instance variables with different implementation\ndetails.\n\nClass definitions, like function definitions, may be wrapped by one or\nmore *decorator* expressions. The evaluation rules for the decorator\nexpressions are the same as for functions. The result must be a class\nobject, which is then bound to the class name.\n\n-[ Footnotes ]-\n\n[1] The exception is propagated to the invocation stack only if there\n is no ``finally`` clause that negates the exception.\n\n[2] Currently, control "flows off the end" except in the case of an\n exception or the execution of a ``return``, ``continue``, or\n ``break`` statement.\n\n[3] A string literal appearing as the first statement in the function\n body is transformed into the function\'s ``__doc__`` attribute and\n therefore the function\'s *docstring*.\n\n[4] A string literal appearing as the first statement in the class\n body is transformed into the namespace\'s ``__doc__`` item and\n therefore the class\'s *docstring*.\n', + 'context-managers': u'\nWith Statement Context Managers\n*******************************\n\nNew in version 2.5.\n\nA *context manager* is an object that defines the runtime context to\nbe established when executing a ``with`` statement. The context\nmanager handles the entry into, and the exit from, the desired runtime\ncontext for the execution of the block of code. Context managers are\nnormally invoked using the ``with`` statement (described in section\n*The with statement*), but can also be used by directly invoking their\nmethods.\n\nTypical uses of context managers include saving and restoring various\nkinds of global state, locking and unlocking resources, closing opened\nfiles, etc.\n\nFor more information on context managers, see *Context Manager Types*.\n\nobject.__enter__(self)\n\n Enter the runtime context related to this object. The ``with``\n statement will bind this method\'s return value to the target(s)\n specified in the ``as`` clause of the statement, if any.\n\nobject.__exit__(self, exc_type, exc_value, traceback)\n\n Exit the runtime context related to this object. The parameters\n describe the exception that caused the context to be exited. If the\n context was exited without an exception, all three arguments will\n be ``None``.\n\n If an exception is supplied, and the method wishes to suppress the\n exception (i.e., prevent it from being propagated), it should\n return a true value. Otherwise, the exception will be processed\n normally upon exit from this method.\n\n Note that ``__exit__()`` methods should not reraise the passed-in\n exception; this is the caller\'s responsibility.\n\nSee also:\n\n **PEP 0343** - The "with" statement\n The specification, background, and examples for the Python\n ``with`` statement.\n', 'continue': u'\nThe ``continue`` statement\n**************************\n\n continue_stmt ::= "continue"\n\n``continue`` may only occur syntactically nested in a ``for`` or\n``while`` loop, but not nested in a function or class definition or\n``finally`` clause within that loop. It continues with the next cycle\nof the nearest enclosing loop.\n\nWhen ``continue`` passes control out of a ``try`` statement with a\n``finally`` clause, that ``finally`` clause is executed before really\nstarting the next loop cycle.\n', 'conversions': u'\nArithmetic conversions\n**********************\n\nWhen a description of an arithmetic operator below uses the phrase\n"the numeric arguments are converted to a common type," the arguments\nare coerced using the coercion rules listed at *Coercion rules*. If\nboth arguments are standard numeric types, the following coercions are\napplied:\n\n* If either argument is a complex number, the other is converted to\n complex;\n\n* otherwise, if either argument is a floating point number, the other\n is converted to floating point;\n\n* otherwise, if either argument is a long integer, the other is\n converted to long integer;\n\n* otherwise, both must be plain integers and no conversion is\n necessary.\n\nSome additional rules apply for certain operators (e.g., a string left\nargument to the \'%\' operator). Extensions can define their own\ncoercions.\n', - 'customization': u'\nBasic customization\n*******************\n\nobject.__new__(cls[, ...])\n\n Called to create a new instance of class *cls*. ``__new__()`` is a\n static method (special-cased so you need not declare it as such)\n that takes the class of which an instance was requested as its\n first argument. The remaining arguments are those passed to the\n object constructor expression (the call to the class). The return\n value of ``__new__()`` should be the new object instance (usually\n an instance of *cls*).\n\n Typical implementations create a new instance of the class by\n invoking the superclass\'s ``__new__()`` method using\n ``super(currentclass, cls).__new__(cls[, ...])`` with appropriate\n arguments and then modifying the newly-created instance as\n necessary before returning it.\n\n If ``__new__()`` returns an instance of *cls*, then the new\n instance\'s ``__init__()`` method will be invoked like\n ``__init__(self[, ...])``, where *self* is the new instance and the\n remaining arguments are the same as were passed to ``__new__()``.\n\n If ``__new__()`` does not return an instance of *cls*, then the new\n instance\'s ``__init__()`` method will not be invoked.\n\n ``__new__()`` is intended mainly to allow subclasses of immutable\n types (like int, str, or tuple) to customize instance creation. It\n is also commonly overridden in custom metaclasses in order to\n customize class creation.\n\nobject.__init__(self[, ...])\n\n Called when the instance is created. The arguments are those\n passed to the class constructor expression. If a base class has an\n ``__init__()`` method, the derived class\'s ``__init__()`` method,\n if any, must explicitly call it to ensure proper initialization of\n the base class part of the instance; for example:\n ``BaseClass.__init__(self, [args...])``. As a special constraint\n on constructors, no value may be returned; doing so will cause a\n ``TypeError`` to be raised at runtime.\n\nobject.__del__(self)\n\n Called when the instance is about to be destroyed. This is also\n called a destructor. If a base class has a ``__del__()`` method,\n the derived class\'s ``__del__()`` method, if any, must explicitly\n call it to ensure proper deletion of the base class part of the\n instance. Note that it is possible (though not recommended!) for\n the ``__del__()`` method to postpone destruction of the instance by\n creating a new reference to it. It may then be called at a later\n time when this new reference is deleted. It is not guaranteed that\n ``__del__()`` methods are called for objects that still exist when\n the interpreter exits.\n\n Note: ``del x`` doesn\'t directly call ``x.__del__()`` --- the former\n decrements the reference count for ``x`` by one, and the latter\n is only called when ``x``\'s reference count reaches zero. Some\n common situations that may prevent the reference count of an\n object from going to zero include: circular references between\n objects (e.g., a doubly-linked list or a tree data structure with\n parent and child pointers); a reference to the object on the\n stack frame of a function that caught an exception (the traceback\n stored in ``sys.exc_traceback`` keeps the stack frame alive); or\n a reference to the object on the stack frame that raised an\n unhandled exception in interactive mode (the traceback stored in\n ``sys.last_traceback`` keeps the stack frame alive). The first\n situation can only be remedied by explicitly breaking the cycles;\n the latter two situations can be resolved by storing ``None`` in\n ``sys.exc_traceback`` or ``sys.last_traceback``. Circular\n references which are garbage are detected when the option cycle\n detector is enabled (it\'s on by default), but can only be cleaned\n up if there are no Python-level ``__del__()`` methods involved.\n Refer to the documentation for the ``gc`` module for more\n information about how ``__del__()`` methods are handled by the\n cycle detector, particularly the description of the ``garbage``\n value.\n\n Warning: Due to the precarious circumstances under which ``__del__()``\n methods are invoked, exceptions that occur during their execution\n are ignored, and a warning is printed to ``sys.stderr`` instead.\n Also, when ``__del__()`` is invoked in response to a module being\n deleted (e.g., when execution of the program is done), other\n globals referenced by the ``__del__()`` method may already have\n been deleted. For this reason, ``__del__()`` methods should do\n the absolute minimum needed to maintain external invariants.\n Starting with version 1.5, Python guarantees that globals whose\n name begins with a single underscore are deleted from their\n module before other globals are deleted; if no other references\n to such globals exist, this may help in assuring that imported\n modules are still available at the time when the ``__del__()``\n method is called.\n\nobject.__repr__(self)\n\n Called by the ``repr()`` built-in function and by string\n conversions (reverse quotes) to compute the "official" string\n representation of an object. If at all possible, this should look\n like a valid Python expression that could be used to recreate an\n object with the same value (given an appropriate environment). If\n this is not possible, a string of the form ``<...some useful\n description...>`` should be returned. The return value must be a\n string object. If a class defines ``__repr__()`` but not\n ``__str__()``, then ``__repr__()`` is also used when an "informal"\n string representation of instances of that class is required.\n\n This is typically used for debugging, so it is important that the\n representation is information-rich and unambiguous.\n\nobject.__str__(self)\n\n Called by the ``str()`` built-in function and by the ``print``\n statement to compute the "informal" string representation of an\n object. This differs from ``__repr__()`` in that it does not have\n to be a valid Python expression: a more convenient or concise\n representation may be used instead. The return value must be a\n string object.\n\nobject.__lt__(self, other)\nobject.__le__(self, other)\nobject.__eq__(self, other)\nobject.__ne__(self, other)\nobject.__gt__(self, other)\nobject.__ge__(self, other)\n\n Added in version 2.1.\n\n These are the so-called "rich comparison" methods, and are called\n for comparison operators in preference to ``__cmp__()`` below. The\n correspondence between operator symbols and method names is as\n follows: ``xy`` call ``x.__ne__(y)``, ``x>y`` calls ``x.__gt__(y)``, and\n ``x>=y`` calls ``x.__ge__(y)``.\n\n A rich comparison method may return the singleton\n ``NotImplemented`` if it does not implement the operation for a\n given pair of arguments. By convention, ``False`` and ``True`` are\n returned for a successful comparison. However, these methods can\n return any value, so if the comparison operator is used in a\n Boolean context (e.g., in the condition of an ``if`` statement),\n Python will call ``bool()`` on the value to determine if the result\n is true or false.\n\n There are no implied relationships among the comparison operators.\n The truth of ``x==y`` does not imply that ``x!=y`` is false.\n Accordingly, when defining ``__eq__()``, one should also define\n ``__ne__()`` so that the operators will behave as expected. See\n the paragraph on ``__hash__()`` for some important notes on\n creating *hashable* objects which support custom comparison\n operations and are usable as dictionary keys.\n\n There are no swapped-argument versions of these methods (to be used\n when the left argument does not support the operation but the right\n argument does); rather, ``__lt__()`` and ``__gt__()`` are each\n other\'s reflection, ``__le__()`` and ``__ge__()`` are each other\'s\n reflection, and ``__eq__()`` and ``__ne__()`` are their own\n reflection.\n\n Arguments to rich comparison methods are never coerced.\n\nobject.__cmp__(self, other)\n\n Called by comparison operations if rich comparison (see above) is\n not defined. Should return a negative integer if ``self < other``,\n zero if ``self == other``, a positive integer if ``self > other``.\n If no ``__cmp__()``, ``__eq__()`` or ``__ne__()`` operation is\n defined, class instances are compared by object identity\n ("address"). See also the description of ``__hash__()`` for some\n important notes on creating *hashable* objects which support custom\n comparison operations and are usable as dictionary keys. (Note: the\n restriction that exceptions are not propagated by ``__cmp__()`` has\n been removed since Python 1.5.)\n\nobject.__rcmp__(self, other)\n\n Changed in version 2.1: No longer supported.\n\nobject.__hash__(self)\n\n Called for the key object for dictionary operations, and by the\n built-in function ``hash()``. Should return an integer usable as a\n hash value for dictionary operations. The only required property\n is that objects which compare equal have the same hash value; it is\n advised to somehow mix together (e.g., using exclusive or) the hash\n values for the components of the object that also play a part in\n comparison of objects.\n\n If a class does not define a ``__cmp__()`` or ``__eq__()`` method\n it should not define a ``__hash__()`` operation either; if it\n defines ``__cmp__()`` or ``__eq__()`` but not ``__hash__()``, its\n instances will not be usable as dictionary keys. If a class\n defines mutable objects and implements a ``__cmp__()`` or\n ``__eq__()`` method, it should not implement ``__hash__()``, since\n the dictionary implementation requires that a key\'s hash value is\n immutable (if the object\'s hash value changes, it will be in the\n wrong hash bucket).\n\n User-defined classes have ``__cmp__()`` and ``__hash__()`` methods\n by default; with them, all objects compare unequal and\n ``x.__hash__()`` returns ``id(x)``.\n\n Changed in version 2.5: ``__hash__()`` may now also return a long\n integer object; the 32-bit integer is then derived from the hash of\n that object.\n\nobject.__nonzero__(self)\n\n Called to implement truth value testing, and the built-in operation\n ``bool()``; should return ``False`` or ``True``, or their integer\n equivalents ``0`` or ``1``. When this method is not defined,\n ``__len__()`` is called, if it is defined (see below). If a class\n defines neither ``__len__()`` nor ``__nonzero__()``, all its\n instances are considered true.\n\nobject.__unicode__(self)\n\n Called to implement ``unicode()`` builtin; should return a Unicode\n object. When this method is not defined, string conversion is\n attempted, and the result of string conversion is converted to\n Unicode using the system default encoding.\n', - 'debugger': u'\n``pdb`` --- The Python Debugger\n*******************************\n\nThe module ``pdb`` defines an interactive source code debugger for\nPython programs. It supports setting (conditional) breakpoints and\nsingle stepping at the source line level, inspection of stack frames,\nsource code listing, and evaluation of arbitrary Python code in the\ncontext of any stack frame. It also supports post-mortem debugging\nand can be called under program control.\n\nThe debugger is extensible --- it is actually defined as the class\n``Pdb``. This is currently undocumented but easily understood by\nreading the source. The extension interface uses the modules ``bdb``\n(undocumented) and ``cmd``.\n\nThe debugger\'s prompt is ``(Pdb)``. Typical usage to run a program\nunder control of the debugger is:\n\n >>> import pdb\n >>> import mymodule\n >>> pdb.run(\'mymodule.test()\')\n > (0)?()\n (Pdb) continue\n > (1)?()\n (Pdb) continue\n NameError: \'spam\'\n > (1)?()\n (Pdb)\n\n``pdb.py`` can also be invoked as a script to debug other scripts.\nFor example:\n\n python -m pdb myscript.py\n\nWhen invoked as a script, pdb will automatically enter post-mortem\ndebugging if the program being debugged exits abnormally. After post-\nmortem debugging (or after normal exit of the program), pdb will\nrestart the program. Automatic restarting preserves pdb\'s state (such\nas breakpoints) and in most cases is more useful than quitting the\ndebugger upon program\'s exit.\n\nAdded in version 2.4: Restarting post-mortem behavior added.\n\nTypical usage to inspect a crashed program is:\n\n >>> import pdb\n >>> import mymodule\n >>> mymodule.test()\n Traceback (most recent call last):\n File "", line 1, in ?\n File "./mymodule.py", line 4, in test\n test2()\n File "./mymodule.py", line 3, in test2\n print spam\n NameError: spam\n >>> pdb.pm()\n > ./mymodule.py(3)test2()\n -> print spam\n (Pdb)\n\nThe module defines the following functions; each enters the debugger\nin a slightly different way:\n\npdb.run(statement[, globals[, locals]])\n\n Execute the *statement* (given as a string) under debugger control.\n The debugger prompt appears before any code is executed; you can\n set breakpoints and type ``continue``, or you can step through the\n statement using ``step`` or ``next`` (all these commands are\n explained below). The optional *globals* and *locals* arguments\n specify the environment in which the code is executed; by default\n the dictionary of the module ``__main__`` is used. (See the\n explanation of the ``exec`` statement or the ``eval()`` built-in\n function.)\n\npdb.runeval(expression[, globals[, locals]])\n\n Evaluate the *expression* (given as a string) under debugger\n control. When ``runeval()`` returns, it returns the value of the\n expression. Otherwise this function is similar to ``run()``.\n\npdb.runcall(function[, argument, ...])\n\n Call the *function* (a function or method object, not a string)\n with the given arguments. When ``runcall()`` returns, it returns\n whatever the function call returned. The debugger prompt appears\n as soon as the function is entered.\n\npdb.set_trace()\n\n Enter the debugger at the calling stack frame. This is useful to\n hard-code a breakpoint at a given point in a program, even if the\n code is not otherwise being debugged (e.g. when an assertion\n fails).\n\npdb.post_mortem([traceback])\n\n Enter post-mortem debugging of the given *traceback* object. If no\n *traceback* is given, it uses the one of the exception that is\n currently being handled (an exception must be being handled if the\n default is to be used).\n\npdb.pm()\n\n Enter post-mortem debugging of the traceback found in\n ``sys.last_traceback``.\n', + 'customization': u'\nBasic customization\n*******************\n\nobject.__new__(cls[, ...])\n\n Called to create a new instance of class *cls*. ``__new__()`` is a\n static method (special-cased so you need not declare it as such)\n that takes the class of which an instance was requested as its\n first argument. The remaining arguments are those passed to the\n object constructor expression (the call to the class). The return\n value of ``__new__()`` should be the new object instance (usually\n an instance of *cls*).\n\n Typical implementations create a new instance of the class by\n invoking the superclass\'s ``__new__()`` method using\n ``super(currentclass, cls).__new__(cls[, ...])`` with appropriate\n arguments and then modifying the newly-created instance as\n necessary before returning it.\n\n If ``__new__()`` returns an instance of *cls*, then the new\n instance\'s ``__init__()`` method will be invoked like\n ``__init__(self[, ...])``, where *self* is the new instance and the\n remaining arguments are the same as were passed to ``__new__()``.\n\n If ``__new__()`` does not return an instance of *cls*, then the new\n instance\'s ``__init__()`` method will not be invoked.\n\n ``__new__()`` is intended mainly to allow subclasses of immutable\n types (like int, str, or tuple) to customize instance creation. It\n is also commonly overridden in custom metaclasses in order to\n customize class creation.\n\nobject.__init__(self[, ...])\n\n Called when the instance is created. The arguments are those\n passed to the class constructor expression. If a base class has an\n ``__init__()`` method, the derived class\'s ``__init__()`` method,\n if any, must explicitly call it to ensure proper initialization of\n the base class part of the instance; for example:\n ``BaseClass.__init__(self, [args...])``. As a special constraint\n on constructors, no value may be returned; doing so will cause a\n ``TypeError`` to be raised at runtime.\n\nobject.__del__(self)\n\n Called when the instance is about to be destroyed. This is also\n called a destructor. If a base class has a ``__del__()`` method,\n the derived class\'s ``__del__()`` method, if any, must explicitly\n call it to ensure proper deletion of the base class part of the\n instance. Note that it is possible (though not recommended!) for\n the ``__del__()`` method to postpone destruction of the instance by\n creating a new reference to it. It may then be called at a later\n time when this new reference is deleted. It is not guaranteed that\n ``__del__()`` methods are called for objects that still exist when\n the interpreter exits.\n\n Note: ``del x`` doesn\'t directly call ``x.__del__()`` --- the former\n decrements the reference count for ``x`` by one, and the latter\n is only called when ``x``\'s reference count reaches zero. Some\n common situations that may prevent the reference count of an\n object from going to zero include: circular references between\n objects (e.g., a doubly-linked list or a tree data structure with\n parent and child pointers); a reference to the object on the\n stack frame of a function that caught an exception (the traceback\n stored in ``sys.exc_traceback`` keeps the stack frame alive); or\n a reference to the object on the stack frame that raised an\n unhandled exception in interactive mode (the traceback stored in\n ``sys.last_traceback`` keeps the stack frame alive). The first\n situation can only be remedied by explicitly breaking the cycles;\n the latter two situations can be resolved by storing ``None`` in\n ``sys.exc_traceback`` or ``sys.last_traceback``. Circular\n references which are garbage are detected when the option cycle\n detector is enabled (it\'s on by default), but can only be cleaned\n up if there are no Python-level ``__del__()`` methods involved.\n Refer to the documentation for the ``gc`` module for more\n information about how ``__del__()`` methods are handled by the\n cycle detector, particularly the description of the ``garbage``\n value.\n\n Warning: Due to the precarious circumstances under which ``__del__()``\n methods are invoked, exceptions that occur during their execution\n are ignored, and a warning is printed to ``sys.stderr`` instead.\n Also, when ``__del__()`` is invoked in response to a module being\n deleted (e.g., when execution of the program is done), other\n globals referenced by the ``__del__()`` method may already have\n been deleted. For this reason, ``__del__()`` methods should do\n the absolute minimum needed to maintain external invariants.\n Starting with version 1.5, Python guarantees that globals whose\n name begins with a single underscore are deleted from their\n module before other globals are deleted; if no other references\n to such globals exist, this may help in assuring that imported\n modules are still available at the time when the ``__del__()``\n method is called.\n\nobject.__repr__(self)\n\n Called by the ``repr()`` built-in function and by string\n conversions (reverse quotes) to compute the "official" string\n representation of an object. If at all possible, this should look\n like a valid Python expression that could be used to recreate an\n object with the same value (given an appropriate environment). If\n this is not possible, a string of the form ``<...some useful\n description...>`` should be returned. The return value must be a\n string object. If a class defines ``__repr__()`` but not\n ``__str__()``, then ``__repr__()`` is also used when an "informal"\n string representation of instances of that class is required.\n\n This is typically used for debugging, so it is important that the\n representation is information-rich and unambiguous.\n\nobject.__str__(self)\n\n Called by the ``str()`` built-in function and by the ``print``\n statement to compute the "informal" string representation of an\n object. This differs from ``__repr__()`` in that it does not have\n to be a valid Python expression: a more convenient or concise\n representation may be used instead. The return value must be a\n string object.\n\nobject.__lt__(self, other)\nobject.__le__(self, other)\nobject.__eq__(self, other)\nobject.__ne__(self, other)\nobject.__gt__(self, other)\nobject.__ge__(self, other)\n\n New in version 2.1.\n\n These are the so-called "rich comparison" methods, and are called\n for comparison operators in preference to ``__cmp__()`` below. The\n correspondence between operator symbols and method names is as\n follows: ``xy`` call ``x.__ne__(y)``, ``x>y`` calls ``x.__gt__(y)``, and\n ``x>=y`` calls ``x.__ge__(y)``.\n\n A rich comparison method may return the singleton\n ``NotImplemented`` if it does not implement the operation for a\n given pair of arguments. By convention, ``False`` and ``True`` are\n returned for a successful comparison. However, these methods can\n return any value, so if the comparison operator is used in a\n Boolean context (e.g., in the condition of an ``if`` statement),\n Python will call ``bool()`` on the value to determine if the result\n is true or false.\n\n There are no implied relationships among the comparison operators.\n The truth of ``x==y`` does not imply that ``x!=y`` is false.\n Accordingly, when defining ``__eq__()``, one should also define\n ``__ne__()`` so that the operators will behave as expected. See\n the paragraph on ``__hash__()`` for some important notes on\n creating *hashable* objects which support custom comparison\n operations and are usable as dictionary keys.\n\n There are no swapped-argument versions of these methods (to be used\n when the left argument does not support the operation but the right\n argument does); rather, ``__lt__()`` and ``__gt__()`` are each\n other\'s reflection, ``__le__()`` and ``__ge__()`` are each other\'s\n reflection, and ``__eq__()`` and ``__ne__()`` are their own\n reflection.\n\n Arguments to rich comparison methods are never coerced.\n\nobject.__cmp__(self, other)\n\n Called by comparison operations if rich comparison (see above) is\n not defined. Should return a negative integer if ``self < other``,\n zero if ``self == other``, a positive integer if ``self > other``.\n If no ``__cmp__()``, ``__eq__()`` or ``__ne__()`` operation is\n defined, class instances are compared by object identity\n ("address"). See also the description of ``__hash__()`` for some\n important notes on creating *hashable* objects which support custom\n comparison operations and are usable as dictionary keys. (Note: the\n restriction that exceptions are not propagated by ``__cmp__()`` has\n been removed since Python 1.5.)\n\nobject.__rcmp__(self, other)\n\n Changed in version 2.1: No longer supported.\n\nobject.__hash__(self)\n\n Called for the key object for dictionary operations, and by the\n built-in function ``hash()``. Should return an integer usable as a\n hash value for dictionary operations. The only required property\n is that objects which compare equal have the same hash value; it is\n advised to somehow mix together (e.g., using exclusive or) the hash\n values for the components of the object that also play a part in\n comparison of objects.\n\n If a class does not define a ``__cmp__()`` or ``__eq__()`` method\n it should not define a ``__hash__()`` operation either; if it\n defines ``__cmp__()`` or ``__eq__()`` but not ``__hash__()``, its\n instances will not be usable as dictionary keys. If a class\n defines mutable objects and implements a ``__cmp__()`` or\n ``__eq__()`` method, it should not implement ``__hash__()``, since\n the dictionary implementation requires that a key\'s hash value is\n immutable (if the object\'s hash value changes, it will be in the\n wrong hash bucket).\n\n User-defined classes have ``__cmp__()`` and ``__hash__()`` methods\n by default; with them, all objects compare unequal (except with\n themselves) and ``x.__hash__()`` returns ``id(x)``.\n\n Classes which inherit a ``__hash__()`` method from a parent class\n but change the meaning of ``__cmp__()`` or ``__eq__()`` such that\n the hash value returned is no longer appropriate (e.g. by switching\n to a value-based concept of equality instead of the default\n identity based equality) can explicitly flag themselves as being\n unhashable by setting ``__hash__ = None`` in the class definition.\n Doing so means that not only will instances of the class raise an\n appropriate ``TypeError`` when a program attempts to retrieve their\n hash value, but they will also be correctly identified as\n unhashable when checking ``isinstance(obj, collections.Hashable)``\n (unlike classes which define their own ``__hash__()`` to explicitly\n raise ``TypeError``).\n\n Changed in version 2.5: ``__hash__()`` may now also return a long\n integer object; the 32-bit integer is then derived from the hash of\n that object.\n\n Changed in version 2.6: ``__hash__`` may now be set to ``None`` to\n explicitly flag instances of a class as unhashable.\n\nobject.__nonzero__(self)\n\n Called to implement truth value testing, and the built-in operation\n ``bool()``; should return ``False`` or ``True``, or their integer\n equivalents ``0`` or ``1``. When this method is not defined,\n ``__len__()`` is called, if it is defined (see below). If a class\n defines neither ``__len__()`` nor ``__nonzero__()``, all its\n instances are considered true.\n\nobject.__unicode__(self)\n\n Called to implement ``unicode()`` builtin; should return a Unicode\n object. When this method is not defined, string conversion is\n attempted, and the result of string conversion is converted to\n Unicode using the system default encoding.\n', + 'debugger': u'\n``pdb`` --- The Python Debugger\n*******************************\n\nThe module ``pdb`` defines an interactive source code debugger for\nPython programs. It supports setting (conditional) breakpoints and\nsingle stepping at the source line level, inspection of stack frames,\nsource code listing, and evaluation of arbitrary Python code in the\ncontext of any stack frame. It also supports post-mortem debugging\nand can be called under program control.\n\nThe debugger is extensible --- it is actually defined as the class\n``Pdb``. This is currently undocumented but easily understood by\nreading the source. The extension interface uses the modules ``bdb``\n(undocumented) and ``cmd``.\n\nThe debugger\'s prompt is ``(Pdb)``. Typical usage to run a program\nunder control of the debugger is:\n\n >>> import pdb\n >>> import mymodule\n >>> pdb.run(\'mymodule.test()\')\n > (0)?()\n (Pdb) continue\n > (1)?()\n (Pdb) continue\n NameError: \'spam\'\n > (1)?()\n (Pdb)\n\n``pdb.py`` can also be invoked as a script to debug other scripts.\nFor example:\n\n python -m pdb myscript.py\n\nWhen invoked as a script, pdb will automatically enter post-mortem\ndebugging if the program being debugged exits abnormally. After post-\nmortem debugging (or after normal exit of the program), pdb will\nrestart the program. Automatic restarting preserves pdb\'s state (such\nas breakpoints) and in most cases is more useful than quitting the\ndebugger upon program\'s exit.\n\nNew in version 2.4: Restarting post-mortem behavior added.\n\nTypical usage to inspect a crashed program is:\n\n >>> import pdb\n >>> import mymodule\n >>> mymodule.test()\n Traceback (most recent call last):\n File "", line 1, in ?\n File "./mymodule.py", line 4, in test\n test2()\n File "./mymodule.py", line 3, in test2\n print spam\n NameError: spam\n >>> pdb.pm()\n > ./mymodule.py(3)test2()\n -> print spam\n (Pdb)\n\nThe module defines the following functions; each enters the debugger\nin a slightly different way:\n\npdb.run(statement[, globals[, locals]])\n\n Execute the *statement* (given as a string) under debugger control.\n The debugger prompt appears before any code is executed; you can\n set breakpoints and type ``continue``, or you can step through the\n statement using ``step`` or ``next`` (all these commands are\n explained below). The optional *globals* and *locals* arguments\n specify the environment in which the code is executed; by default\n the dictionary of the module ``__main__`` is used. (See the\n explanation of the ``exec`` statement or the ``eval()`` built-in\n function.)\n\npdb.runeval(expression[, globals[, locals]])\n\n Evaluate the *expression* (given as a string) under debugger\n control. When ``runeval()`` returns, it returns the value of the\n expression. Otherwise this function is similar to ``run()``.\n\npdb.runcall(function[, argument, ...])\n\n Call the *function* (a function or method object, not a string)\n with the given arguments. When ``runcall()`` returns, it returns\n whatever the function call returned. The debugger prompt appears\n as soon as the function is entered.\n\npdb.set_trace()\n\n Enter the debugger at the calling stack frame. This is useful to\n hard-code a breakpoint at a given point in a program, even if the\n code is not otherwise being debugged (e.g. when an assertion\n fails).\n\npdb.post_mortem([traceback])\n\n Enter post-mortem debugging of the given *traceback* object. If no\n *traceback* is given, it uses the one of the exception that is\n currently being handled (an exception must be being handled if the\n default is to be used).\n\npdb.pm()\n\n Enter post-mortem debugging of the traceback found in\n ``sys.last_traceback``.\n', 'del': u'\nThe ``del`` statement\n*********************\n\n del_stmt ::= "del" target_list\n\nDeletion is recursively defined very similar to the way assignment is\ndefined. Rather that spelling it out in full details, here are some\nhints.\n\nDeletion of a target list recursively deletes each target, from left\nto right.\n\nDeletion of a name removes the binding of that name from the local or\nglobal namespace, depending on whether the name occurs in a ``global``\nstatement in the same code block. If the name is unbound, a\n``NameError`` exception will be raised.\n\nIt is illegal to delete a name from the local namespace if it occurs\nas a free variable in a nested block.\n\nDeletion of attribute references, subscriptions and slicings is passed\nto the primary object involved; deletion of a slicing is in general\nequivalent to assignment of an empty slice of the right type (but even\nthis is determined by the sliced object).\n', 'dict': u'\nDictionary displays\n*******************\n\nA dictionary display is a possibly empty series of key/datum pairs\nenclosed in curly braces:\n\n dict_display ::= "{" [key_datum_list] "}"\n key_datum_list ::= key_datum ("," key_datum)* [","]\n key_datum ::= expression ":" expression\n\nA dictionary display yields a new dictionary object.\n\nThe key/datum pairs are evaluated from left to right to define the\nentries of the dictionary: each key object is used as a key into the\ndictionary to store the corresponding datum.\n\nRestrictions on the types of the key values are listed earlier in\nsection *The standard type hierarchy*. (To summarize, the key type\nshould be *hashable*, which excludes all mutable objects.) Clashes\nbetween duplicate keys are not detected; the last datum (textually\nrightmost in the display) stored for a given key value prevails.\n', 'dynamic-features': u'\nInteraction with dynamic features\n*********************************\n\nThere are several cases where Python statements are illegal when used\nin conjunction with nested scopes that contain free variables.\n\nIf a variable is referenced in an enclosing scope, it is illegal to\ndelete the name. An error will be reported at compile time.\n\nIf the wild card form of import --- ``import *`` --- is used in a\nfunction and the function contains or is a nested block with free\nvariables, the compiler will raise a ``SyntaxError``.\n\nIf ``exec`` is used in a function and the function contains or is a\nnested block with free variables, the compiler will raise a\n``SyntaxError`` unless the exec explicitly specifies the local\nnamespace for the ``exec``. (In other words, ``exec obj`` would be\nillegal, but ``exec obj in ns`` would be legal.)\n\nThe ``eval()``, ``execfile()``, and ``input()`` functions and the\n``exec`` statement do not have access to the full environment for\nresolving names. Names may be resolved in the local and global\nnamespaces of the caller. Free variables are not resolved in the\nnearest enclosing namespace, but in the global namespace. [1] The\n``exec`` statement and the ``eval()`` and ``execfile()`` functions\nhave optional arguments to override the global and local namespace.\nIf only one namespace is specified, it is used for both.\n', @@ -36,48 +36,48 @@ 'exprlists': u'\nExpression lists\n****************\n\n expression_list ::= expression ( "," expression )* [","]\n\nAn expression list containing at least one comma yields a tuple. The\nlength of the tuple is the number of expressions in the list. The\nexpressions are evaluated from left to right.\n\nThe trailing comma is required only to create a single tuple (a.k.a. a\n*singleton*); it is optional in all other cases. A single expression\nwithout a trailing comma doesn\'t create a tuple, but rather yields the\nvalue of that expression. (To create an empty tuple, use an empty pair\nof parentheses: ``()``.)\n', 'floating': u'\nFloating point literals\n***********************\n\nFloating point literals are described by the following lexical\ndefinitions:\n\n floatnumber ::= pointfloat | exponentfloat\n pointfloat ::= [intpart] fraction | intpart "."\n exponentfloat ::= (intpart | pointfloat) exponent\n intpart ::= digit+\n fraction ::= "." digit+\n exponent ::= ("e" | "E") ["+" | "-"] digit+\n\nNote that the integer and exponent parts of floating point numbers can\nlook like octal integers, but are interpreted using radix 10. For\nexample, ``077e010`` is legal, and denotes the same number as\n``77e10``. The allowed range of floating point literals is\nimplementation-dependent. Some examples of floating point literals:\n\n 3.14 10. .001 1e100 3.14e-10 0e0\n\nNote that numeric literals do not include a sign; a phrase like ``-1``\nis actually an expression composed of the unary operator ``-`` and the\nliteral ``1``.\n', 'for': u'\nThe ``for`` statement\n*********************\n\nThe ``for`` statement is used to iterate over the elements of a\nsequence (such as a string, tuple or list) or other iterable object:\n\n for_stmt ::= "for" target_list "in" expression_list ":" suite\n ["else" ":" suite]\n\nThe expression list is evaluated once; it should yield an iterable\nobject. An iterator is created for the result of the\n``expression_list``. The suite is then executed once for each item\nprovided by the iterator, in the order of ascending indices. Each\nitem in turn is assigned to the target list using the standard rules\nfor assignments, and then the suite is executed. When the items are\nexhausted (which is immediately when the sequence is empty), the suite\nin the ``else`` clause, if present, is executed, and the loop\nterminates.\n\nA ``break`` statement executed in the first suite terminates the loop\nwithout executing the ``else`` clause\'s suite. A ``continue``\nstatement executed in the first suite skips the rest of the suite and\ncontinues with the next item, or with the ``else`` clause if there was\nno next item.\n\nThe suite may assign to the variable(s) in the target list; this does\nnot affect the next item assigned to it.\n\nThe target list is not deleted when the loop is finished, but if the\nsequence is empty, it will not have been assigned to at all by the\nloop. Hint: the built-in function ``range()`` returns a sequence of\nintegers suitable to emulate the effect of Pascal\'s ``for i := a to b\ndo``; e.g., ``range(3)`` returns the list ``[0, 1, 2]``.\n\nWarning: There is a subtlety when the sequence is being modified by the loop\n (this can only occur for mutable sequences, i.e. lists). An internal\n counter is used to keep track of which item is used next, and this\n is incremented on each iteration. When this counter has reached the\n length of the sequence the loop terminates. This means that if the\n suite deletes the current (or a previous) item from the sequence,\n the next item will be skipped (since it gets the index of the\n current item which has already been treated). Likewise, if the\n suite inserts an item in the sequence before the current item, the\n current item will be treated again the next time through the loop.\n This can lead to nasty bugs that can be avoided by making a\n temporary copy using a slice of the whole sequence, e.g.,\n\n for x in a[:]:\n if x < 0: a.remove(x)\n', - 'formatstrings': u'\nFormat String Syntax\n********************\n\nThe ``str.format()`` method and the ``Formatter`` class share the same\nsyntax for format strings (although in the case of ``Formatter``,\nsubclasses can define their own format string syntax.)\n\nFormat strings contain "replacement fields" surrounded by curly braces\n``{}``. Anything that is not contained in braces is considered literal\ntext, which is copied unchanged to the output. If you need to include\na brace character in the literal text, it can be escaped by doubling:\n``{{`` and ``}}``.\n\nThe grammar for a replacement field is as follows:\n\n replacement_field ::= "{" field_name ["!" conversion] [":" format_spec] "}"\n field_name ::= (identifier | integer) ("." attribute_name | "[" element_index "]")*\n attribute_name ::= identifier\n element_index ::= integer\n conversion ::= "r" | "s"\n format_spec ::= \n\nIn less formal terms, the replacement field starts with a\n*field_name*, which can either be a number (for a positional\nargument), or an identifier (for keyword arguments). Following this\nis an optional *conversion* field, which is preceded by an exclamation\npoint ``\'!\'``, and a *format_spec*, which is preceded by a colon\n``\':\'``.\n\nThe *field_name* itself begins with either a number or a keyword. If\nit\'s a number, it refers to a positional argument, and if it\'s a\nkeyword it refers to a named keyword argument. This can be followed\nby any number of index or attribute expressions. An expression of the\nform ``\'.name\'`` selects the named attribute using ``getattr()``,\nwhile an expression of the form ``\'[index]\'`` does an index lookup\nusing ``__getitem__()``.\n\nSome simple format string examples:\n\n "First, thou shalt count to {0}" # References first positional argument\n "My quest is {name}" # References keyword argument \'name\'\n "Weight in tons {0.weight}" # \'weight\' attribute of first positional arg\n "Units destroyed: {players[0]}" # First element of keyword argument \'players\'.\n\nThe *conversion* field causes a type coercion before formatting.\nNormally, the job of formatting a value is done by the\n``__format__()`` method of the value itself. However, in some cases\nit is desirable to force a type to be formatted as a string,\noverriding its own definition of formatting. By converting the value\nto a string before calling ``__format__()``, the normal formatting\nlogic is bypassed.\n\nTwo conversion flags are currently supported: ``\'!s\'`` which calls\n``str()`` on the value, and ``\'!r\'`` which calls ``repr()``.\n\nSome examples:\n\n "Harold\'s a clever {0!s}" # Calls str() on the argument first\n "Bring out the holy {name!r}" # Calls repr() on the argument first\n\nThe *format_spec* field contains a specification of how the value\nshould be presented, including such details as field width, alignment,\npadding, decimal precision and so on. Each value type can define it\'s\nown "formatting mini-language" or interpretation of the *format_spec*.\n\nMost built-in types support a common formatting mini-language, which\nis described in the next section.\n\nA *format_spec* field can also include nested replacement fields\nwithin it. These nested replacement fields can contain only a field\nname; conversion flags and format specifications are not allowed. The\nreplacement fields within the format_spec are substituted before the\n*format_spec* string is interpreted. This allows the formatting of a\nvalue to be dynamically specified.\n\nFor example, suppose you wanted to have a replacement field whose\nfield width is determined by another variable:\n\n "A man with two {0:{1}}".format("noses", 10)\n\nThis would first evaluate the inner replacement field, making the\nformat string effectively:\n\n "A man with two {0:10}"\n\nThen the outer replacement field would be evaluated, producing:\n\n "noses "\n\nWhich is subsitituted into the string, yielding:\n\n "A man with two noses "\n\n(The extra space is because we specified a field width of 10, and\nbecause left alignment is the default for strings.)\n\n\nFormat Specification Mini-Language\n==================================\n\n"Format specifications" are used within replacement fields contained\nwithin a format string to define how individual values are presented\n(see *Format String Syntax*.) They can also be passed directly to the\nbuiltin ``format()`` function. Each formattable type may define how\nthe format specification is to be interpreted.\n\nMost built-in types implement the following options for format\nspecifications, although some of the formatting options are only\nsupported by the numeric types.\n\nA general convention is that an empty format string (``""``) produces\nthe same result as if you had called ``str()`` on the value.\n\nThe general form of a *standard format specifier* is:\n\n format_spec ::= [[fill]align][sign][0][width][.precision][type]\n fill ::= \n align ::= "<" | ">" | "=" | "^"\n sign ::= "+" | "-" | " "\n width ::= integer\n precision ::= integer\n type ::= "b" | "c" | "d" | "e" | "E" | "f" | "F" | "g" | "G" | "n" | "o" | "x" | "X" | "%"\n\nThe *fill* character can be any character other than \'}\' (which\nsignifies the end of the field). The presence of a fill character is\nsignaled by the *next* character, which must be one of the alignment\noptions. If the second character of *format_spec* is not a valid\nalignment option, then it is assumed that both the fill character and\nthe alignment option are absent.\n\nThe meaning of the various alignment options is as follows:\n\n +-----------+------------------------------------------------------------+\n | Option | Meaning |\n +===========+============================================================+\n | ``\'<\'`` | Forces the field to be left-aligned within the available |\n | | space (This is the default.) |\n +-----------+------------------------------------------------------------+\n | ``\'>\'`` | Forces the field to be right-aligned within the available |\n | | space. |\n +-----------+------------------------------------------------------------+\n | ``\'=\'`` | Forces the padding to be placed after the sign (if any) |\n | | but before the digits. This is used for printing fields |\n | | in the form \'+000000120\'. This alignment option is only |\n | | valid for numeric types. |\n +-----------+------------------------------------------------------------+\n | ``\'^\'`` | Forces the field to be centered within the available |\n | | space. |\n +-----------+------------------------------------------------------------+\n\nNote that unless a minimum field width is defined, the field width\nwill always be the same size as the data to fill it, so that the\nalignment option has no meaning in this case.\n\nThe *sign* option is only valid for number types, and can be one of\nthe following:\n\n +-----------+------------------------------------------------------------+\n | Option | Meaning |\n +===========+============================================================+\n | ``\'+\'`` | indicates that a sign should be used for both positive as |\n | | well as negative numbers. |\n +-----------+------------------------------------------------------------+\n | ``\'-\'`` | indicates that a sign should be used only for negative |\n | | numbers (this is the default behavior). |\n +-----------+------------------------------------------------------------+\n | space | indicates that a leading space should be used on positive |\n | | numbers, and a minus sign on negative numbers. |\n +-----------+------------------------------------------------------------+\n\n*width* is a decimal integer defining the minimum field width. If not\nspecified, then the field width will be determined by the content.\n\nIf the *width* field is preceded by a zero (``\'0\'``) character, this\nenables zero-padding. This is equivalent to an *alignment* type of\n``\'=\'`` and a *fill* character of ``\'0\'``.\n\nThe *precision* is a decimal number indicating how many digits should\nbe displayed after the decimal point for a floating point value. For\nnon-number types the field indicates the maximum field size - in other\nwords, how many characters will be used from the field content. The\n*precision* is ignored for integer values.\n\nFinally, the *type* determines how the data should be presented.\n\nThe available integer presentation types are:\n\n +-----------+------------------------------------------------------------+\n | Type | Meaning |\n +===========+============================================================+\n | ``\'b\'`` | Binary. Outputs the number in base 2. |\n +-----------+------------------------------------------------------------+\n | ``\'c\'`` | Character. Converts the integer to the corresponding |\n | | unicode character before printing. |\n +-----------+------------------------------------------------------------+\n | ``\'d\'`` | Decimal Integer. Outputs the number in base 10. |\n +-----------+------------------------------------------------------------+\n | ``\'o\'`` | Octal format. Outputs the number in base 8. |\n +-----------+------------------------------------------------------------+\n | ``\'x\'`` | Hex format. Outputs the number in base 16, using lower- |\n | | case letters for the digits above 9. |\n +-----------+------------------------------------------------------------+\n | ``\'X\'`` | Hex format. Outputs the number in base 16, using upper- |\n | | case letters for the digits above 9. |\n +-----------+------------------------------------------------------------+\n | ``\'n\'`` | Number. This is the same as ``\'d\'``, except that it uses |\n | | the current locale setting to insert the appropriate |\n | | number separator characters. |\n +-----------+------------------------------------------------------------+\n | None | the same as ``\'d\'`` |\n +-----------+------------------------------------------------------------+\n\nThe available presentation types for floating point and decimal values\nare:\n\n +-----------+------------------------------------------------------------+\n | Type | Meaning |\n +===========+============================================================+\n | ``\'e\'`` | Exponent notation. Prints the number in scientific |\n | | notation using the letter \'e\' to indicate the exponent. |\n +-----------+------------------------------------------------------------+\n | ``\'E\'`` | Exponent notation. Same as ``\'e\'`` except it uses an upper |\n | | case \'E\' as the separator character. |\n +-----------+------------------------------------------------------------+\n | ``\'f\'`` | Fixed point. Displays the number as a fixed-point number. |\n +-----------+------------------------------------------------------------+\n | ``\'F\'`` | Fixed point. Same as ``\'f\'``. |\n +-----------+------------------------------------------------------------+\n | ``\'g\'`` | General format. This prints the number as a fixed-point |\n | | number, unless the number is too large, in which case it |\n | | switches to ``\'e\'`` exponent notation. |\n +-----------+------------------------------------------------------------+\n | ``\'G\'`` | General format. Same as ``\'g\'`` except switches to ``\'E\'`` |\n | | if the number gets to large. |\n +-----------+------------------------------------------------------------+\n | ``\'n\'`` | Number. This is the same as ``\'g\'``, except that it uses |\n | | the current locale setting to insert the appropriate |\n | | number separator characters. |\n +-----------+------------------------------------------------------------+\n | ``\'%\'`` | Percentage. Multiplies the number by 100 and displays in |\n | | fixed (``\'f\'``) format, followed by a percent sign. |\n +-----------+------------------------------------------------------------+\n | None | the same as ``\'g\'`` |\n +-----------+------------------------------------------------------------+\n', - 'function': u'\nFunction definitions\n********************\n\nA function definition defines a user-defined function object (see\nsection *The standard type hierarchy*):\n\n decorated ::= decorators (classdef | funcdef)\n decorators ::= decorator+\n decorator ::= "@" dotted_name ["(" [argument_list [","]] ")"] NEWLINE\n funcdef ::= "def" funcname "(" [parameter_list] ")" ":" suite\n dotted_name ::= identifier ("." identifier)*\n parameter_list ::= (defparameter ",")*\n ( "*" identifier [, "**" identifier]\n | "**" identifier\n | defparameter [","] )\n defparameter ::= parameter ["=" expression]\n sublist ::= parameter ("," parameter)* [","]\n parameter ::= identifier | "(" sublist ")"\n funcname ::= identifier\n\nA function definition is an executable statement. Its execution binds\nthe function name in the current local namespace to a function object\n(a wrapper around the executable code for the function). This\nfunction object contains a reference to the current global namespace\nas the global namespace to be used when the function is called.\n\nThe function definition does not execute the function body; this gets\nexecuted only when the function is called.\n\nA function definition may be wrapped by one or more *decorator*\nexpressions. Decorator expressions are evaluated when the function is\ndefined, in the scope that contains the function definition. The\nresult must be a callable, which is invoked with the function object\nas the only argument. The returned value is bound to the function name\ninstead of the function object. Multiple decorators are applied in\nnested fashion. For example, the following code:\n\n @f1(arg)\n @f2\n def func(): pass\n\nis equivalent to:\n\n def func(): pass\n func = f1(arg)(f2(func))\n\nWhen one or more top-level parameters have the form *parameter* ``=``\n*expression*, the function is said to have "default parameter values."\nFor a parameter with a default value, the corresponding argument may\nbe omitted from a call, in which case the parameter\'s default value is\nsubstituted. If a parameter has a default value, all following\nparameters must also have a default value --- this is a syntactic\nrestriction that is not expressed by the grammar.\n\n**Default parameter values are evaluated when the function definition\nis executed.** This means that the expression is evaluated once, when\nthe function is defined, and that that same "pre-computed" value is\nused for each call. This is especially important to understand when a\ndefault parameter is a mutable object, such as a list or a dictionary:\nif the function modifies the object (e.g. by appending an item to a\nlist), the default value is in effect modified. This is generally not\nwhat was intended. A way around this is to use ``None`` as the\ndefault, and explicitly test for it in the body of the function, e.g.:\n\n def whats_on_the_telly(penguin=None):\n if penguin is None:\n penguin = []\n penguin.append("property of the zoo")\n return penguin\n\nFunction call semantics are described in more detail in section\n*Calls*. A function call always assigns values to all parameters\nmentioned in the parameter list, either from position arguments, from\nkeyword arguments, or from default values. If the form\n"``*identifier``" is present, it is initialized to a tuple receiving\nany excess positional parameters, defaulting to the empty tuple. If\nthe form "``**identifier``" is present, it is initialized to a new\ndictionary receiving any excess keyword arguments, defaulting to a new\nempty dictionary.\n\nIt is also possible to create anonymous functions (functions not bound\nto a name), for immediate use in expressions. This uses lambda forms,\ndescribed in section *Expression lists*. Note that the lambda form is\nmerely a shorthand for a simplified function definition; a function\ndefined in a "``def``" statement can be passed around or assigned to\nanother name just like a function defined by a lambda form. The\n"``def``" form is actually more powerful since it allows the execution\nof multiple statements.\n\n**Programmer\'s note:** Functions are first-class objects. A "``def``"\nform executed inside a function definition defines a local function\nthat can be returned or passed around. Free variables used in the\nnested function can access the local variables of the function\ncontaining the def. See section *Naming and binding* for details.\n', + 'formatstrings': u'\nFormat String Syntax\n********************\n\nThe ``str.format()`` method and the ``Formatter`` class share the same\nsyntax for format strings (although in the case of ``Formatter``,\nsubclasses can define their own format string syntax.)\n\nFormat strings contain "replacement fields" surrounded by curly braces\n``{}``. Anything that is not contained in braces is considered literal\ntext, which is copied unchanged to the output. If you need to include\na brace character in the literal text, it can be escaped by doubling:\n``{{`` and ``}}``.\n\nThe grammar for a replacement field is as follows:\n\n replacement_field ::= "{" field_name ["!" conversion] [":" format_spec] "}"\n field_name ::= (identifier | integer) ("." attribute_name | "[" element_index "]")*\n attribute_name ::= identifier\n element_index ::= integer\n conversion ::= "r" | "s"\n format_spec ::= \n\nIn less formal terms, the replacement field starts with a\n*field_name*, which can either be a number (for a positional\nargument), or an identifier (for keyword arguments). Following this\nis an optional *conversion* field, which is preceded by an exclamation\npoint ``\'!\'``, and a *format_spec*, which is preceded by a colon\n``\':\'``.\n\nThe *field_name* itself begins with either a number or a keyword. If\nit\'s a number, it refers to a positional argument, and if it\'s a\nkeyword it refers to a named keyword argument. This can be followed\nby any number of index or attribute expressions. An expression of the\nform ``\'.name\'`` selects the named attribute using ``getattr()``,\nwhile an expression of the form ``\'[index]\'`` does an index lookup\nusing ``__getitem__()``.\n\nSome simple format string examples:\n\n "First, thou shalt count to {0}" # References first positional argument\n "My quest is {name}" # References keyword argument \'name\'\n "Weight in tons {0.weight}" # \'weight\' attribute of first positional arg\n "Units destroyed: {players[0]}" # First element of keyword argument \'players\'.\n\nThe *conversion* field causes a type coercion before formatting.\nNormally, the job of formatting a value is done by the\n``__format__()`` method of the value itself. However, in some cases\nit is desirable to force a type to be formatted as a string,\noverriding its own definition of formatting. By converting the value\nto a string before calling ``__format__()``, the normal formatting\nlogic is bypassed.\n\nTwo conversion flags are currently supported: ``\'!s\'`` which calls\n``str()`` on the value, and ``\'!r\'`` which calls ``repr()``.\n\nSome examples:\n\n "Harold\'s a clever {0!s}" # Calls str() on the argument first\n "Bring out the holy {name!r}" # Calls repr() on the argument first\n\nThe *format_spec* field contains a specification of how the value\nshould be presented, including such details as field width, alignment,\npadding, decimal precision and so on. Each value type can define it\'s\nown "formatting mini-language" or interpretation of the *format_spec*.\n\nMost built-in types support a common formatting mini-language, which\nis described in the next section.\n\nA *format_spec* field can also include nested replacement fields\nwithin it. These nested replacement fields can contain only a field\nname; conversion flags and format specifications are not allowed. The\nreplacement fields within the format_spec are substituted before the\n*format_spec* string is interpreted. This allows the formatting of a\nvalue to be dynamically specified.\n\nFor example, suppose you wanted to have a replacement field whose\nfield width is determined by another variable:\n\n "A man with two {0:{1}}".format("noses", 10)\n\nThis would first evaluate the inner replacement field, making the\nformat string effectively:\n\n "A man with two {0:10}"\n\nThen the outer replacement field would be evaluated, producing:\n\n "noses "\n\nWhich is substituted into the string, yielding:\n\n "A man with two noses "\n\n(The extra space is because we specified a field width of 10, and\nbecause left alignment is the default for strings.)\n\n\nFormat Specification Mini-Language\n==================================\n\n"Format specifications" are used within replacement fields contained\nwithin a format string to define how individual values are presented\n(see *Format String Syntax*.) They can also be passed directly to the\nbuiltin ``format()`` function. Each formattable type may define how\nthe format specification is to be interpreted.\n\nMost built-in types implement the following options for format\nspecifications, although some of the formatting options are only\nsupported by the numeric types.\n\nA general convention is that an empty format string (``""``) produces\nthe same result as if you had called ``str()`` on the value.\n\nThe general form of a *standard format specifier* is:\n\n format_spec ::= [[fill]align][sign][#][0][width][.precision][type]\n fill ::= \n align ::= "<" | ">" | "=" | "^"\n sign ::= "+" | "-" | " "\n width ::= integer\n precision ::= integer\n type ::= "b" | "c" | "d" | "e" | "E" | "f" | "F" | "g" | "G" | "n" | "o" | "x" | "X" | "%"\n\nThe *fill* character can be any character other than \'}\' (which\nsignifies the end of the field). The presence of a fill character is\nsignaled by the *next* character, which must be one of the alignment\noptions. If the second character of *format_spec* is not a valid\nalignment option, then it is assumed that both the fill character and\nthe alignment option are absent.\n\nThe meaning of the various alignment options is as follows:\n\n +-----------+------------------------------------------------------------+\n | Option | Meaning |\n +===========+============================================================+\n | ``\'<\'`` | Forces the field to be left-aligned within the available |\n | | space (This is the default.) |\n +-----------+------------------------------------------------------------+\n | ``\'>\'`` | Forces the field to be right-aligned within the available |\n | | space. |\n +-----------+------------------------------------------------------------+\n | ``\'=\'`` | Forces the padding to be placed after the sign (if any) |\n | | but before the digits. This is used for printing fields |\n | | in the form \'+000000120\'. This alignment option is only |\n | | valid for numeric types. |\n +-----------+------------------------------------------------------------+\n | ``\'^\'`` | Forces the field to be centered within the available |\n | | space. |\n +-----------+------------------------------------------------------------+\n\nNote that unless a minimum field width is defined, the field width\nwill always be the same size as the data to fill it, so that the\nalignment option has no meaning in this case.\n\nThe *sign* option is only valid for number types, and can be one of\nthe following:\n\n +-----------+------------------------------------------------------------+\n | Option | Meaning |\n +===========+============================================================+\n | ``\'+\'`` | indicates that a sign should be used for both positive as |\n | | well as negative numbers. |\n +-----------+------------------------------------------------------------+\n | ``\'-\'`` | indicates that a sign should be used only for negative |\n | | numbers (this is the default behavior). |\n +-----------+------------------------------------------------------------+\n | space | indicates that a leading space should be used on positive |\n | | numbers, and a minus sign on negative numbers. |\n +-----------+------------------------------------------------------------+\n\nThe ``\'#\'`` option is only valid for integers, and only for binary,\noctal, or hexadecimal output. If present, it specifies that the\noutput will be prefixed by ``\'0b\'``, ``\'0o\'``, or ``\'0x\'``,\nrespectively.\n\n*width* is a decimal integer defining the minimum field width. If not\nspecified, then the field width will be determined by the content.\n\nIf the *width* field is preceded by a zero (``\'0\'``) character, this\nenables zero-padding. This is equivalent to an *alignment* type of\n``\'=\'`` and a *fill* character of ``\'0\'``.\n\nThe *precision* is a decimal number indicating how many digits should\nbe displayed after the decimal point for a floating point value\nformatted with ``\'f\'`` and ``\'F\'``, or before and after the decimal\npoint for a floating point value formatted with ``\'g\'`` or ``\'G\'``.\nFor non-number types the field indicates the maximum field size - in\nother words, how many characters will be used from the field content.\nThe *precision* is ignored for integer values.\n\nFinally, the *type* determines how the data should be presented.\n\nThe available integer presentation types are:\n\n +-----------+------------------------------------------------------------+\n | Type | Meaning |\n +===========+============================================================+\n | ``\'b\'`` | Binary format. Outputs the number in base 2. |\n +-----------+------------------------------------------------------------+\n | ``\'c\'`` | Character. Converts the integer to the corresponding |\n | | unicode character before printing. |\n +-----------+------------------------------------------------------------+\n | ``\'d\'`` | Decimal Integer. Outputs the number in base 10. |\n +-----------+------------------------------------------------------------+\n | ``\'o\'`` | Octal format. Outputs the number in base 8. |\n +-----------+------------------------------------------------------------+\n | ``\'x\'`` | Hex format. Outputs the number in base 16, using lower- |\n | | case letters for the digits above 9. |\n +-----------+------------------------------------------------------------+\n | ``\'X\'`` | Hex format. Outputs the number in base 16, using upper- |\n | | case letters for the digits above 9. |\n +-----------+------------------------------------------------------------+\n | ``\'n\'`` | Number. This is the same as ``\'d\'``, except that it uses |\n | | the current locale setting to insert the appropriate |\n | | number separator characters. |\n +-----------+------------------------------------------------------------+\n | None | The same as ``\'d\'``. |\n +-----------+------------------------------------------------------------+\n\nThe available presentation types for floating point and decimal values\nare:\n\n +-----------+------------------------------------------------------------+\n | Type | Meaning |\n +===========+============================================================+\n | ``\'e\'`` | Exponent notation. Prints the number in scientific |\n | | notation using the letter \'e\' to indicate the exponent. |\n +-----------+------------------------------------------------------------+\n | ``\'E\'`` | Exponent notation. Same as ``\'e\'`` except it uses an upper |\n | | case \'E\' as the separator character. |\n +-----------+------------------------------------------------------------+\n | ``\'f\'`` | Fixed point. Displays the number as a fixed-point number. |\n +-----------+------------------------------------------------------------+\n | ``\'F\'`` | Fixed point. Same as ``\'f\'``. |\n +-----------+------------------------------------------------------------+\n | ``\'g\'`` | General format. This prints the number as a fixed-point |\n | | number, unless the number is too large, in which case it |\n | | switches to ``\'e\'`` exponent notation. Infinity and NaN |\n | | values are formatted as ``inf``, ``-inf`` and ``nan``, |\n | | respectively. |\n +-----------+------------------------------------------------------------+\n | ``\'G\'`` | General format. Same as ``\'g\'`` except switches to ``\'E\'`` |\n | | if the number gets to large. The representations of |\n | | infinity and NaN are uppercased, too. |\n +-----------+------------------------------------------------------------+\n | ``\'n\'`` | Number. This is the same as ``\'g\'``, except that it uses |\n | | the current locale setting to insert the appropriate |\n | | number separator characters. |\n +-----------+------------------------------------------------------------+\n | ``\'%\'`` | Percentage. Multiplies the number by 100 and displays in |\n | | fixed (``\'f\'``) format, followed by a percent sign. |\n +-----------+------------------------------------------------------------+\n | None | The same as ``\'g\'``. |\n +-----------+------------------------------------------------------------+\n', + 'function': u'\nFunction definitions\n********************\n\nA function definition defines a user-defined function object (see\nsection *The standard type hierarchy*):\n\n decorated ::= decorators (classdef | funcdef)\n decorators ::= decorator+\n decorator ::= "@" dotted_name ["(" [argument_list [","]] ")"] NEWLINE\n funcdef ::= "def" funcname "(" [parameter_list] ")" ":" suite\n dotted_name ::= identifier ("." identifier)*\n parameter_list ::= (defparameter ",")*\n ( "*" identifier [, "**" identifier]\n | "**" identifier\n | defparameter [","] )\n defparameter ::= parameter ["=" expression]\n sublist ::= parameter ("," parameter)* [","]\n parameter ::= identifier | "(" sublist ")"\n funcname ::= identifier\n\nA function definition is an executable statement. Its execution binds\nthe function name in the current local namespace to a function object\n(a wrapper around the executable code for the function). This\nfunction object contains a reference to the current global namespace\nas the global namespace to be used when the function is called.\n\nThe function definition does not execute the function body; this gets\nexecuted only when the function is called. [3]\n\nA function definition may be wrapped by one or more *decorator*\nexpressions. Decorator expressions are evaluated when the function is\ndefined, in the scope that contains the function definition. The\nresult must be a callable, which is invoked with the function object\nas the only argument. The returned value is bound to the function name\ninstead of the function object. Multiple decorators are applied in\nnested fashion. For example, the following code:\n\n @f1(arg)\n @f2\n def func(): pass\n\nis equivalent to:\n\n def func(): pass\n func = f1(arg)(f2(func))\n\nWhen one or more top-level parameters have the form *parameter* ``=``\n*expression*, the function is said to have "default parameter values."\nFor a parameter with a default value, the corresponding argument may\nbe omitted from a call, in which case the parameter\'s default value is\nsubstituted. If a parameter has a default value, all following\nparameters must also have a default value --- this is a syntactic\nrestriction that is not expressed by the grammar.\n\n**Default parameter values are evaluated when the function definition\nis executed.** This means that the expression is evaluated once, when\nthe function is defined, and that that same "pre-computed" value is\nused for each call. This is especially important to understand when a\ndefault parameter is a mutable object, such as a list or a dictionary:\nif the function modifies the object (e.g. by appending an item to a\nlist), the default value is in effect modified. This is generally not\nwhat was intended. A way around this is to use ``None`` as the\ndefault, and explicitly test for it in the body of the function, e.g.:\n\n def whats_on_the_telly(penguin=None):\n if penguin is None:\n penguin = []\n penguin.append("property of the zoo")\n return penguin\n\nFunction call semantics are described in more detail in section\n*Calls*. A function call always assigns values to all parameters\nmentioned in the parameter list, either from position arguments, from\nkeyword arguments, or from default values. If the form\n"``*identifier``" is present, it is initialized to a tuple receiving\nany excess positional parameters, defaulting to the empty tuple. If\nthe form "``**identifier``" is present, it is initialized to a new\ndictionary receiving any excess keyword arguments, defaulting to a new\nempty dictionary.\n\nIt is also possible to create anonymous functions (functions not bound\nto a name), for immediate use in expressions. This uses lambda forms,\ndescribed in section *Expression lists*. Note that the lambda form is\nmerely a shorthand for a simplified function definition; a function\ndefined in a "``def``" statement can be passed around or assigned to\nanother name just like a function defined by a lambda form. The\n"``def``" form is actually more powerful since it allows the execution\nof multiple statements.\n\n**Programmer\'s note:** Functions are first-class objects. A "``def``"\nform executed inside a function definition defines a local function\nthat can be returned or passed around. Free variables used in the\nnested function can access the local variables of the function\ncontaining the def. See section *Naming and binding* for details.\n', 'global': u'\nThe ``global`` statement\n************************\n\n global_stmt ::= "global" identifier ("," identifier)*\n\nThe ``global`` statement is a declaration which holds for the entire\ncurrent code block. It means that the listed identifiers are to be\ninterpreted as globals. It would be impossible to assign to a global\nvariable without ``global``, although free variables may refer to\nglobals without being declared global.\n\nNames listed in a ``global`` statement must not be used in the same\ncode block textually preceding that ``global`` statement.\n\nNames listed in a ``global`` statement must not be defined as formal\nparameters or in a ``for`` loop control target, ``class`` definition,\nfunction definition, or ``import`` statement.\n\n(The current implementation does not enforce the latter two\nrestrictions, but programs should not abuse this freedom, as future\nimplementations may enforce them or silently change the meaning of the\nprogram.)\n\n**Programmer\'s note:** the ``global`` is a directive to the parser.\nIt applies only to code parsed at the same time as the ``global``\nstatement. In particular, a ``global`` statement contained in an\n``exec`` statement does not affect the code block *containing* the\n``exec`` statement, and code contained in an ``exec`` statement is\nunaffected by ``global`` statements in the code containing the\n``exec`` statement. The same applies to the ``eval()``,\n``execfile()`` and ``compile()`` functions.\n', 'id-classes': u'\nReserved classes of identifiers\n*******************************\n\nCertain classes of identifiers (besides keywords) have special\nmeanings. These classes are identified by the patterns of leading and\ntrailing underscore characters:\n\n``_*``\n Not imported by ``from module import *``. The special identifier\n ``_`` is used in the interactive interpreter to store the result of\n the last evaluation; it is stored in the ``__builtin__`` module.\n When not in interactive mode, ``_`` has no special meaning and is\n not defined. See section *The import statement*.\n\n Note: The name ``_`` is often used in conjunction with\n internationalization; refer to the documentation for the\n ``gettext`` module for more information on this convention.\n\n``__*__``\n System-defined names. These names are defined by the interpreter\n and its implementation (including the standard library);\n applications should not expect to define additional names using\n this convention. The set of names of this class defined by Python\n may be extended in future versions. See section *Special method\n names*.\n\n``__*``\n Class-private names. Names in this category, when used within the\n context of a class definition, are re-written to use a mangled form\n to help avoid name clashes between "private" attributes of base and\n derived classes. See section *Identifiers (Names)*.\n', 'identifiers': u'\nIdentifiers and keywords\n************************\n\nIdentifiers (also referred to as *names*) are described by the\nfollowing lexical definitions:\n\n identifier ::= (letter|"_") (letter | digit | "_")*\n letter ::= lowercase | uppercase\n lowercase ::= "a"..."z"\n uppercase ::= "A"..."Z"\n digit ::= "0"..."9"\n\nIdentifiers are unlimited in length. Case is significant.\n\n\nKeywords\n========\n\nThe following identifiers are used as reserved words, or *keywords* of\nthe language, and cannot be used as ordinary identifiers. They must\nbe spelled exactly as written here:\n\n and del from not while\n as elif global or with\n assert else if pass yield\n break except import print\n class exec in raise\n continue finally is return\n def for lambda try\n\nChanged in version 2.4: ``None`` became a constant and is now\nrecognized by the compiler as a name for the built-in object ``None``.\nAlthough it is not a keyword, you cannot assign a different object to\nit.\n\nChanged in version 2.5: Both ``as`` and ``with`` are only recognized\nwhen the ``with_statement`` future feature has been enabled. It will\nalways be enabled in Python 2.6. See section *The with statement* for\ndetails. Note that using ``as`` and ``with`` as identifiers will\nalways issue a warning, even when the ``with_statement`` future\ndirective is not in effect.\n\n\nReserved classes of identifiers\n===============================\n\nCertain classes of identifiers (besides keywords) have special\nmeanings. These classes are identified by the patterns of leading and\ntrailing underscore characters:\n\n``_*``\n Not imported by ``from module import *``. The special identifier\n ``_`` is used in the interactive interpreter to store the result of\n the last evaluation; it is stored in the ``__builtin__`` module.\n When not in interactive mode, ``_`` has no special meaning and is\n not defined. See section *The import statement*.\n\n Note: The name ``_`` is often used in conjunction with\n internationalization; refer to the documentation for the\n ``gettext`` module for more information on this convention.\n\n``__*__``\n System-defined names. These names are defined by the interpreter\n and its implementation (including the standard library);\n applications should not expect to define additional names using\n this convention. The set of names of this class defined by Python\n may be extended in future versions. See section *Special method\n names*.\n\n``__*``\n Class-private names. Names in this category, when used within the\n context of a class definition, are re-written to use a mangled form\n to help avoid name clashes between "private" attributes of base and\n derived classes. See section *Identifiers (Names)*.\n', 'if': u'\nThe ``if`` statement\n********************\n\nThe ``if`` statement is used for conditional execution:\n\n if_stmt ::= "if" expression ":" suite\n ( "elif" expression ":" suite )*\n ["else" ":" suite]\n\nIt selects exactly one of the suites by evaluating the expressions one\nby one until one is found to be true (see section *Boolean operations*\nfor the definition of true and false); then that suite is executed\n(and no other part of the ``if`` statement is executed or evaluated).\nIf all expressions are false, the suite of the ``else`` clause, if\npresent, is executed.\n', 'imaginary': u'\nImaginary literals\n******************\n\nImaginary literals are described by the following lexical definitions:\n\n imagnumber ::= (floatnumber | intpart) ("j" | "J")\n\nAn imaginary literal yields a complex number with a real part of 0.0.\nComplex numbers are represented as a pair of floating point numbers\nand have the same restrictions on their range. To create a complex\nnumber with a nonzero real part, add a floating point number to it,\ne.g., ``(3+4j)``. Some examples of imaginary literals:\n\n 3.14j 10.j 10j .001j 1e100j 3.14e-10j\n', - 'import': u'\nThe ``import`` statement\n************************\n\n import_stmt ::= "import" module ["as" name] ( "," module ["as" name] )*\n | "from" relative_module "import" identifier ["as" name]\n ( "," identifier ["as" name] )*\n | "from" relative_module "import" "(" identifier ["as" name]\n ( "," identifier ["as" name] )* [","] ")"\n | "from" module "import" "*"\n module ::= (identifier ".")* identifier\n relative_module ::= "."* module | "."+\n name ::= identifier\n\nImport statements are executed in two steps: (1) find a module, and\ninitialize it if necessary; (2) define a name or names in the local\nnamespace (of the scope where the ``import`` statement occurs). The\nfirst form (without ``from``) repeats these steps for each identifier\nin the list. The form with ``from`` performs step (1) once, and then\nperforms step (2) repeatedly.\n\nIn this context, to "initialize" a built-in or extension module means\nto call an initialization function that the module must provide for\nthe purpose (in the reference implementation, the function\'s name is\nobtained by prepending string "init" to the module\'s name); to\n"initialize" a Python-coded module means to execute the module\'s body.\n\nThe system maintains a table of modules that have been or are being\ninitialized, indexed by module name. This table is accessible as\n``sys.modules``. When a module name is found in this table, step (1)\nis finished. If not, a search for a module definition is started.\nWhen a module is found, it is loaded. Details of the module searching\nand loading process are implementation and platform specific. It\ngenerally involves searching for a "built-in" module with the given\nname and then searching a list of locations given as ``sys.path``.\n\nIf a built-in module is found, its built-in initialization code is\nexecuted and step (1) is finished. If no matching file is found,\n``ImportError`` is raised. If a file is found, it is parsed, yielding\nan executable code block. If a syntax error occurs, ``SyntaxError``\nis raised. Otherwise, an empty module of the given name is created\nand inserted in the module table, and then the code block is executed\nin the context of this module. Exceptions during this execution\nterminate step (1).\n\nWhen step (1) finishes without raising an exception, step (2) can\nbegin.\n\nThe first form of ``import`` statement binds the module name in the\nlocal namespace to the module object, and then goes on to import the\nnext identifier, if any. If the module name is followed by ``as``,\nthe name following ``as`` is used as the local name for the module.\n\nThe ``from`` form does not bind the module name: it goes through the\nlist of identifiers, looks each one of them up in the module found in\nstep (1), and binds the name in the local namespace to the object thus\nfound. As with the first form of ``import``, an alternate local name\ncan be supplied by specifying "``as`` localname". If a name is not\nfound, ``ImportError`` is raised. If the list of identifiers is\nreplaced by a star (``\'*\'``), all public names defined in the module\nare bound in the local namespace of the ``import`` statement..\n\nThe *public names* defined by a module are determined by checking the\nmodule\'s namespace for a variable named ``__all__``; if defined, it\nmust be a sequence of strings which are names defined or imported by\nthat module. The names given in ``__all__`` are all considered public\nand are required to exist. If ``__all__`` is not defined, the set of\npublic names includes all names found in the module\'s namespace which\ndo not begin with an underscore character (``\'_\'``). ``__all__``\nshould contain the entire public API. It is intended to avoid\naccidentally exporting items that are not part of the API (such as\nlibrary modules which were imported and used within the module).\n\nThe ``from`` form with ``*`` may only occur in a module scope. If the\nwild card form of import --- ``import *`` --- is used in a function\nand the function contains or is a nested block with free variables,\nthe compiler will raise a ``SyntaxError``.\n\n**Hierarchical module names:** when the module names contains one or\nmore dots, the module search path is carried out differently. The\nsequence of identifiers up to the last dot is used to find a\n"package"; the final identifier is then searched inside the package.\nA package is generally a subdirectory of a directory on ``sys.path``\nthat has a file ``__init__.py``. [XXX Can\'t be bothered to spell this\nout right now; see the URL\nhttp://www.python.org/doc/essays/packages.html for more details, also\nabout how the module search works from inside a package.]\n\nThe built-in function ``__import__()`` is provided to support\napplications that determine which modules need to be loaded\ndynamically; refer to *Built-in Functions* for additional information.\n\n\nFuture statements\n=================\n\nA *future statement* is a directive to the compiler that a particular\nmodule should be compiled using syntax or semantics that will be\navailable in a specified future release of Python. The future\nstatement is intended to ease migration to future versions of Python\nthat introduce incompatible changes to the language. It allows use of\nthe new features on a per-module basis before the release in which the\nfeature becomes standard.\n\n future_statement ::= "from" "__future__" "import" feature ["as" name]\n ("," feature ["as" name])*\n | "from" "__future__" "import" "(" feature ["as" name]\n ("," feature ["as" name])* [","] ")"\n feature ::= identifier\n name ::= identifier\n\nA future statement must appear near the top of the module. The only\nlines that can appear before a future statement are:\n\n* the module docstring (if any),\n\n* comments,\n\n* blank lines, and\n\n* other future statements.\n\nThe features recognized by Python 2.5 are ``absolute_import``,\n``division``, ``generators``, ``nested_scopes`` and\n``with_statement``. ``generators`` and ``nested_scopes`` are\nredundant in Python version 2.3 and above because they are always\nenabled.\n\nA future statement is recognized and treated specially at compile\ntime: Changes to the semantics of core constructs are often\nimplemented by generating different code. It may even be the case\nthat a new feature introduces new incompatible syntax (such as a new\nreserved word), in which case the compiler may need to parse the\nmodule differently. Such decisions cannot be pushed off until\nruntime.\n\nFor any given release, the compiler knows which feature names have\nbeen defined, and raises a compile-time error if a future statement\ncontains a feature not known to it.\n\nThe direct runtime semantics are the same as for any import statement:\nthere is a standard module ``__future__``, described later, and it\nwill be imported in the usual way at the time the future statement is\nexecuted.\n\nThe interesting runtime semantics depend on the specific feature\nenabled by the future statement.\n\nNote that there is nothing special about the statement:\n\n import __future__ [as name]\n\nThat is not a future statement; it\'s an ordinary import statement with\nno special semantics or syntax restrictions.\n\nCode compiled by an ``exec`` statement or calls to the builtin\nfunctions ``compile()`` and ``execfile()`` that occur in a module\n``M`` containing a future statement will, by default, use the new\nsyntax or semantics associated with the future statement. This can,\nstarting with Python 2.2 be controlled by optional arguments to\n``compile()`` --- see the documentation of that function for details.\n\nA future statement typed at an interactive interpreter prompt will\ntake effect for the rest of the interpreter session. If an\ninterpreter is started with the *-i* option, is passed a script name\nto execute, and the script includes a future statement, it will be in\neffect in the interactive session started after the script is\nexecuted.\n', - 'in': u'\nComparisons\n***********\n\nUnlike C, all comparison operations in Python have the same priority,\nwhich is lower than that of any arithmetic, shifting or bitwise\noperation. Also unlike C, expressions like ``a < b < c`` have the\ninterpretation that is conventional in mathematics:\n\n comparison ::= or_expr ( comp_operator or_expr )*\n comp_operator ::= "<" | ">" | "==" | ">=" | "<=" | "<>" | "!="\n | "is" ["not"] | ["not"] "in"\n\nComparisons yield boolean values: ``True`` or ``False``.\n\nComparisons can be chained arbitrarily, e.g., ``x < y <= z`` is\nequivalent to ``x < y and y <= z``, except that ``y`` is evaluated\nonly once (but in both cases ``z`` is not evaluated at all when ``x <\ny`` is found to be false).\n\nFormally, if *a*, *b*, *c*, ..., *y*, *z* are expressions and *op1*,\n*op2*, ..., *opN* are comparison operators, then ``a op1 b op2 c ... y\nopN z`` is equivalent to ``a op1 b and b op2 c and ... y opN z``,\nexcept that each expression is evaluated at most once.\n\nNote that ``a op1 b op2 c`` doesn\'t imply any kind of comparison\nbetween *a* and *c*, so that, e.g., ``x < y > z`` is perfectly legal\n(though perhaps not pretty).\n\nThe forms ``<>`` and ``!=`` are equivalent; for consistency with C,\n``!=`` is preferred; where ``!=`` is mentioned below ``<>`` is also\naccepted. The ``<>`` spelling is considered obsolescent.\n\nThe operators ``<``, ``>``, ``==``, ``>=``, ``<=``, and ``!=`` compare\nthe values of two objects. The objects need not have the same type.\nIf both are numbers, they are converted to a common type. Otherwise,\nobjects of different types *always* compare unequal, and are ordered\nconsistently but arbitrarily. You can control comparison behavior of\nobjects of non-builtin types by defining a ``__cmp__`` method or rich\ncomparison methods like ``__gt__``, described in section *Special\nmethod names*.\n\n(This unusual definition of comparison was used to simplify the\ndefinition of operations like sorting and the ``in`` and ``not in``\noperators. In the future, the comparison rules for objects of\ndifferent types are likely to change.)\n\nComparison of objects of the same type depends on the type:\n\n* Numbers are compared arithmetically.\n\n* Strings are compared lexicographically using the numeric equivalents\n (the result of the built-in function ``ord()``) of their characters.\n Unicode and 8-bit strings are fully interoperable in this behavior.\n [4]\n\n* Tuples and lists are compared lexicographically using comparison of\n corresponding elements. This means that to compare equal, each\n element must compare equal and the two sequences must be of the same\n type and have the same length.\n\n If not equal, the sequences are ordered the same as their first\n differing elements. For example, ``cmp([1,2,x], [1,2,y])`` returns\n the same as ``cmp(x,y)``. If the corresponding element does not\n exist, the shorter sequence is ordered first (for example, ``[1,2] <\n [1,2,3]``).\n\n* Mappings (dictionaries) compare equal if and only if their sorted\n (key, value) lists compare equal. [5] Outcomes other than equality\n are resolved consistently, but are not otherwise defined. [6]\n\n* Most other objects of builtin types compare unequal unless they are\n the same object; the choice whether one object is considered smaller\n or larger than another one is made arbitrarily but consistently\n within one execution of a program.\n\nThe operators ``in`` and ``not in`` test for collection membership.\n``x in s`` evaluates to true if *x* is a member of the collection *s*,\nand false otherwise. ``x not in s`` returns the negation of ``x in\ns``. The collection membership test has traditionally been bound to\nsequences; an object is a member of a collection if the collection is\na sequence and contains an element equal to that object. However, it\nmake sense for many other object types to support membership tests\nwithout being a sequence. In particular, dictionaries (for keys) and\nsets support membership testing.\n\nFor the list and tuple types, ``x in y`` is true if and only if there\nexists an index *i* such that ``x == y[i]`` is true.\n\nFor the Unicode and string types, ``x in y`` is true if and only if\n*x* is a substring of *y*. An equivalent test is ``y.find(x) != -1``.\nNote, *x* and *y* need not be the same type; consequently, ``u\'ab\' in\n\'abc\'`` will return ``True``. Empty strings are always considered to\nbe a substring of any other string, so ``"" in "abc"`` will return\n``True``.\n\nChanged in version 2.3: Previously, *x* was required to be a string of\nlength ``1``.\n\nFor user-defined classes which define the ``__contains__()`` method,\n``x in y`` is true if and only if ``y.__contains__(x)`` is true.\n\nFor user-defined classes which do not define ``__contains__()`` and do\ndefine ``__getitem__()``, ``x in y`` is true if and only if there is a\nnon-negative integer index *i* such that ``x == y[i]``, and all lower\ninteger indices do not raise ``IndexError`` exception. (If any other\nexception is raised, it is as if ``in`` raised that exception).\n\nThe operator ``not in`` is defined to have the inverse true value of\n``in``.\n\nThe operators ``is`` and ``is not`` test for object identity: ``x is\ny`` is true if and only if *x* and *y* are the same object. ``x is\nnot y`` yields the inverse truth value.\n', + 'import': u'\nThe ``import`` statement\n************************\n\n import_stmt ::= "import" module ["as" name] ( "," module ["as" name] )*\n | "from" relative_module "import" identifier ["as" name]\n ( "," identifier ["as" name] )*\n | "from" relative_module "import" "(" identifier ["as" name]\n ( "," identifier ["as" name] )* [","] ")"\n | "from" module "import" "*"\n module ::= (identifier ".")* identifier\n relative_module ::= "."* module | "."+\n name ::= identifier\n\nImport statements are executed in two steps: (1) find a module, and\ninitialize it if necessary; (2) define a name or names in the local\nnamespace (of the scope where the ``import`` statement occurs). The\nfirst form (without ``from``) repeats these steps for each identifier\nin the list. The form with ``from`` performs step (1) once, and then\nperforms step (2) repeatedly.\n\nIn this context, to "initialize" a built-in or extension module means\nto call an initialization function that the module must provide for\nthe purpose (in the reference implementation, the function\'s name is\nobtained by prepending string "init" to the module\'s name); to\n"initialize" a Python-coded module means to execute the module\'s body.\n\nThe system maintains a table of modules that have been or are being\ninitialized, indexed by module name. This table is accessible as\n``sys.modules``. When a module name is found in this table, step (1)\nis finished. If not, a search for a module definition is started.\nWhen a module is found, it is loaded. Details of the module searching\nand loading process are implementation and platform specific. It\ngenerally involves searching for a "built-in" module with the given\nname and then searching a list of locations given as ``sys.path``.\n\nIf a built-in module is found, its built-in initialization code is\nexecuted and step (1) is finished. If no matching file is found,\n``ImportError`` is raised. If a file is found, it is parsed, yielding\nan executable code block. If a syntax error occurs, ``SyntaxError``\nis raised. Otherwise, an empty module of the given name is created\nand inserted in the module table, and then the code block is executed\nin the context of this module. Exceptions during this execution\nterminate step (1).\n\nWhen step (1) finishes without raising an exception, step (2) can\nbegin.\n\nThe first form of ``import`` statement binds the module name in the\nlocal namespace to the module object, and then goes on to import the\nnext identifier, if any. If the module name is followed by ``as``,\nthe name following ``as`` is used as the local name for the module.\n\nThe ``from`` form does not bind the module name: it goes through the\nlist of identifiers, looks each one of them up in the module found in\nstep (1), and binds the name in the local namespace to the object thus\nfound. As with the first form of ``import``, an alternate local name\ncan be supplied by specifying "``as`` localname". If a name is not\nfound, ``ImportError`` is raised. If the list of identifiers is\nreplaced by a star (``\'*\'``), all public names defined in the module\nare bound in the local namespace of the ``import`` statement..\n\nThe *public names* defined by a module are determined by checking the\nmodule\'s namespace for a variable named ``__all__``; if defined, it\nmust be a sequence of strings which are names defined or imported by\nthat module. The names given in ``__all__`` are all considered public\nand are required to exist. If ``__all__`` is not defined, the set of\npublic names includes all names found in the module\'s namespace which\ndo not begin with an underscore character (``\'_\'``). ``__all__``\nshould contain the entire public API. It is intended to avoid\naccidentally exporting items that are not part of the API (such as\nlibrary modules which were imported and used within the module).\n\nThe ``from`` form with ``*`` may only occur in a module scope. If the\nwild card form of import --- ``import *`` --- is used in a function\nand the function contains or is a nested block with free variables,\nthe compiler will raise a ``SyntaxError``.\n\n**Hierarchical module names:** when the module names contains one or\nmore dots, the module search path is carried out differently. The\nsequence of identifiers up to the last dot is used to find a\n"package"; the final identifier is then searched inside the package.\nA package is generally a subdirectory of a directory on ``sys.path``\nthat has a file ``__init__.py``.\n\nThe built-in function ``__import__()`` is provided to support\napplications that determine which modules need to be loaded\ndynamically; refer to *Built-in Functions* for additional information.\n\n\nFuture statements\n=================\n\nA *future statement* is a directive to the compiler that a particular\nmodule should be compiled using syntax or semantics that will be\navailable in a specified future release of Python. The future\nstatement is intended to ease migration to future versions of Python\nthat introduce incompatible changes to the language. It allows use of\nthe new features on a per-module basis before the release in which the\nfeature becomes standard.\n\n future_statement ::= "from" "__future__" "import" feature ["as" name]\n ("," feature ["as" name])*\n | "from" "__future__" "import" "(" feature ["as" name]\n ("," feature ["as" name])* [","] ")"\n feature ::= identifier\n name ::= identifier\n\nA future statement must appear near the top of the module. The only\nlines that can appear before a future statement are:\n\n* the module docstring (if any),\n\n* comments,\n\n* blank lines, and\n\n* other future statements.\n\nThe features recognized by Python 2.5 are ``absolute_import``,\n``division``, ``generators``, ``nested_scopes`` and\n``with_statement``. ``generators`` and ``nested_scopes`` are\nredundant in Python version 2.3 and above because they are always\nenabled.\n\nA future statement is recognized and treated specially at compile\ntime: Changes to the semantics of core constructs are often\nimplemented by generating different code. It may even be the case\nthat a new feature introduces new incompatible syntax (such as a new\nreserved word), in which case the compiler may need to parse the\nmodule differently. Such decisions cannot be pushed off until\nruntime.\n\nFor any given release, the compiler knows which feature names have\nbeen defined, and raises a compile-time error if a future statement\ncontains a feature not known to it.\n\nThe direct runtime semantics are the same as for any import statement:\nthere is a standard module ``__future__``, described later, and it\nwill be imported in the usual way at the time the future statement is\nexecuted.\n\nThe interesting runtime semantics depend on the specific feature\nenabled by the future statement.\n\nNote that there is nothing special about the statement:\n\n import __future__ [as name]\n\nThat is not a future statement; it\'s an ordinary import statement with\nno special semantics or syntax restrictions.\n\nCode compiled by an ``exec`` statement or calls to the builtin\nfunctions ``compile()`` and ``execfile()`` that occur in a module\n``M`` containing a future statement will, by default, use the new\nsyntax or semantics associated with the future statement. This can,\nstarting with Python 2.2 be controlled by optional arguments to\n``compile()`` --- see the documentation of that function for details.\n\nA future statement typed at an interactive interpreter prompt will\ntake effect for the rest of the interpreter session. If an\ninterpreter is started with the *-i* option, is passed a script name\nto execute, and the script includes a future statement, it will be in\neffect in the interactive session started after the script is\nexecuted.\n', + 'in': u'\nComparisons\n***********\n\nUnlike C, all comparison operations in Python have the same priority,\nwhich is lower than that of any arithmetic, shifting or bitwise\noperation. Also unlike C, expressions like ``a < b < c`` have the\ninterpretation that is conventional in mathematics:\n\n comparison ::= or_expr ( comp_operator or_expr )*\n comp_operator ::= "<" | ">" | "==" | ">=" | "<=" | "<>" | "!="\n | "is" ["not"] | ["not"] "in"\n\nComparisons yield boolean values: ``True`` or ``False``.\n\nComparisons can be chained arbitrarily, e.g., ``x < y <= z`` is\nequivalent to ``x < y and y <= z``, except that ``y`` is evaluated\nonly once (but in both cases ``z`` is not evaluated at all when ``x <\ny`` is found to be false).\n\nFormally, if *a*, *b*, *c*, ..., *y*, *z* are expressions and *op1*,\n*op2*, ..., *opN* are comparison operators, then ``a op1 b op2 c ... y\nopN z`` is equivalent to ``a op1 b and b op2 c and ... y opN z``,\nexcept that each expression is evaluated at most once.\n\nNote that ``a op1 b op2 c`` doesn\'t imply any kind of comparison\nbetween *a* and *c*, so that, e.g., ``x < y > z`` is perfectly legal\n(though perhaps not pretty).\n\nThe forms ``<>`` and ``!=`` are equivalent; for consistency with C,\n``!=`` is preferred; where ``!=`` is mentioned below ``<>`` is also\naccepted. The ``<>`` spelling is considered obsolescent.\n\nThe operators ``<``, ``>``, ``==``, ``>=``, ``<=``, and ``!=`` compare\nthe values of two objects. The objects need not have the same type.\nIf both are numbers, they are converted to a common type. Otherwise,\nobjects of different types *always* compare unequal, and are ordered\nconsistently but arbitrarily. You can control comparison behavior of\nobjects of non-builtin types by defining a ``__cmp__`` method or rich\ncomparison methods like ``__gt__``, described in section *Special\nmethod names*.\n\n(This unusual definition of comparison was used to simplify the\ndefinition of operations like sorting and the ``in`` and ``not in``\noperators. In the future, the comparison rules for objects of\ndifferent types are likely to change.)\n\nComparison of objects of the same type depends on the type:\n\n* Numbers are compared arithmetically.\n\n* Strings are compared lexicographically using the numeric equivalents\n (the result of the built-in function ``ord()``) of their characters.\n Unicode and 8-bit strings are fully interoperable in this behavior.\n [4]\n\n* Tuples and lists are compared lexicographically using comparison of\n corresponding elements. This means that to compare equal, each\n element must compare equal and the two sequences must be of the same\n type and have the same length.\n\n If not equal, the sequences are ordered the same as their first\n differing elements. For example, ``cmp([1,2,x], [1,2,y])`` returns\n the same as ``cmp(x,y)``. If the corresponding element does not\n exist, the shorter sequence is ordered first (for example, ``[1,2] <\n [1,2,3]``).\n\n* Mappings (dictionaries) compare equal if and only if their sorted\n (key, value) lists compare equal. [5] Outcomes other than equality\n are resolved consistently, but are not otherwise defined. [6]\n\n* Most other objects of builtin types compare unequal unless they are\n the same object; the choice whether one object is considered smaller\n or larger than another one is made arbitrarily but consistently\n within one execution of a program.\n\nThe operators ``in`` and ``not in`` test for collection membership.\n``x in s`` evaluates to true if *x* is a member of the collection *s*,\nand false otherwise. ``x not in s`` returns the negation of ``x in\ns``. The collection membership test has traditionally been bound to\nsequences; an object is a member of a collection if the collection is\na sequence and contains an element equal to that object. However, it\nmake sense for many other object types to support membership tests\nwithout being a sequence. In particular, dictionaries (for keys) and\nsets support membership testing.\n\nFor the list and tuple types, ``x in y`` is true if and only if there\nexists an index *i* such that ``x == y[i]`` is true.\n\nFor the Unicode and string types, ``x in y`` is true if and only if\n*x* is a substring of *y*. An equivalent test is ``y.find(x) != -1``.\nNote, *x* and *y* need not be the same type; consequently, ``u\'ab\' in\n\'abc\'`` will return ``True``. Empty strings are always considered to\nbe a substring of any other string, so ``"" in "abc"`` will return\n``True``.\n\nChanged in version 2.3: Previously, *x* was required to be a string of\nlength ``1``.\n\nFor user-defined classes which define the ``__contains__()`` method,\n``x in y`` is true if and only if ``y.__contains__(x)`` is true.\n\nFor user-defined classes which do not define ``__contains__()`` and do\ndefine ``__getitem__()``, ``x in y`` is true if and only if there is a\nnon-negative integer index *i* such that ``x == y[i]``, and all lower\ninteger indices do not raise ``IndexError`` exception. (If any other\nexception is raised, it is as if ``in`` raised that exception).\n\nThe operator ``not in`` is defined to have the inverse true value of\n``in``.\n\nThe operators ``is`` and ``is not`` test for object identity: ``x is\ny`` is true if and only if *x* and *y* are the same object. ``x is\nnot y`` yields the inverse truth value. [7]\n', 'integers': u'\nInteger and long integer literals\n*********************************\n\nInteger and long integer literals are described by the following\nlexical definitions:\n\n longinteger ::= integer ("l" | "L")\n integer ::= decimalinteger | octinteger | hexinteger\n decimalinteger ::= nonzerodigit digit* | "0"\n octinteger ::= "0" octdigit+\n hexinteger ::= "0" ("x" | "X") hexdigit+\n nonzerodigit ::= "1"..."9"\n octdigit ::= "0"..."7"\n hexdigit ::= digit | "a"..."f" | "A"..."F"\n\nAlthough both lower case ``\'l\'`` and upper case ``\'L\'`` are allowed as\nsuffix for long integers, it is strongly recommended to always use\n``\'L\'``, since the letter ``\'l\'`` looks too much like the digit\n``\'1\'``.\n\nPlain integer literals that are above the largest representable plain\ninteger (e.g., 2147483647 when using 32-bit arithmetic) are accepted\nas if they were long integers instead. [1] There is no limit for long\ninteger literals apart from what can be stored in available memory.\n\nSome examples of plain integer literals (first row) and long integer\nliterals (second and third rows):\n\n 7 2147483647 0177\n 3L 79228162514264337593543950336L 0377L 0x100000000L\n 79228162514264337593543950336 0xdeadbeef\n', 'lambda': u'\nExpression lists\n****************\n\n expression_list ::= expression ( "," expression )* [","]\n\nAn expression list containing at least one comma yields a tuple. The\nlength of the tuple is the number of expressions in the list. The\nexpressions are evaluated from left to right.\n\nThe trailing comma is required only to create a single tuple (a.k.a. a\n*singleton*); it is optional in all other cases. A single expression\nwithout a trailing comma doesn\'t create a tuple, but rather yields the\nvalue of that expression. (To create an empty tuple, use an empty pair\nof parentheses: ``()``.)\n', 'lists': u'\nList displays\n*************\n\nA list display is a possibly empty series of expressions enclosed in\nsquare brackets:\n\n list_display ::= "[" [expression_list | list_comprehension] "]"\n list_comprehension ::= expression list_for\n list_for ::= "for" target_list "in" old_expression_list [list_iter]\n old_expression_list ::= old_expression [("," old_expression)+ [","]]\n list_iter ::= list_for | list_if\n list_if ::= "if" old_expression [list_iter]\n\nA list display yields a new list object. Its contents are specified\nby providing either a list of expressions or a list comprehension.\nWhen a comma-separated list of expressions is supplied, its elements\nare evaluated from left to right and placed into the list object in\nthat order. When a list comprehension is supplied, it consists of a\nsingle expression followed by at least one ``for`` clause and zero or\nmore ``for`` or ``if`` clauses. In this case, the elements of the new\nlist are those that would be produced by considering each of the\n``for`` or ``if`` clauses a block, nesting from left to right, and\nevaluating the expression to produce a list element each time the\ninnermost block is reached [1].\n', 'naming': u'\nNaming and binding\n******************\n\n*Names* refer to objects. Names are introduced by name binding\noperations. Each occurrence of a name in the program text refers to\nthe *binding* of that name established in the innermost function block\ncontaining the use.\n\nA *block* is a piece of Python program text that is executed as a\nunit. The following are blocks: a module, a function body, and a class\ndefinition. Each command typed interactively is a block. A script\nfile (a file given as standard input to the interpreter or specified\non the interpreter command line the first argument) is a code block.\nA script command (a command specified on the interpreter command line\nwith the \'**-c**\' option) is a code block. The file read by the\nbuilt-in function ``execfile()`` is a code block. The string argument\npassed to the built-in function ``eval()`` and to the ``exec``\nstatement is a code block. The expression read and evaluated by the\nbuilt-in function ``input()`` is a code block.\n\nA code block is executed in an *execution frame*. A frame contains\nsome administrative information (used for debugging) and determines\nwhere and how execution continues after the code block\'s execution has\ncompleted.\n\nA *scope* defines the visibility of a name within a block. If a local\nvariable is defined in a block, its scope includes that block. If the\ndefinition occurs in a function block, the scope extends to any blocks\ncontained within the defining one, unless a contained block introduces\na different binding for the name. The scope of names defined in a\nclass block is limited to the class block; it does not extend to the\ncode blocks of methods -- this includes generator expressions since\nthey are implemented using a function scope. This means that the\nfollowing will fail:\n\n class A:\n a = 42\n b = list(a + i for i in range(10))\n\nWhen a name is used in a code block, it is resolved using the nearest\nenclosing scope. The set of all such scopes visible to a code block\nis called the block\'s *environment*.\n\nIf a name is bound in a block, it is a local variable of that block.\nIf a name is bound at the module level, it is a global variable. (The\nvariables of the module code block are local and global.) If a\nvariable is used in a code block but not defined there, it is a *free\nvariable*.\n\nWhen a name is not found at all, a ``NameError`` exception is raised.\nIf the name refers to a local variable that has not been bound, a\n``UnboundLocalError`` exception is raised. ``UnboundLocalError`` is a\nsubclass of ``NameError``.\n\nThe following constructs bind names: formal parameters to functions,\n``import`` statements, class and function definitions (these bind the\nclass or function name in the defining block), and targets that are\nidentifiers if occurring in an assignment, ``for`` loop header, or in\nthe second position of an ``except`` clause header. The ``import``\nstatement of the form "``from ...import *``" binds all names defined\nin the imported module, except those beginning with an underscore.\nThis form may only be used at the module level.\n\nA target occurring in a ``del`` statement is also considered bound for\nthis purpose (though the actual semantics are to unbind the name). It\nis illegal to unbind a name that is referenced by an enclosing scope;\nthe compiler will report a ``SyntaxError``.\n\nEach assignment or import statement occurs within a block defined by a\nclass or function definition or at the module level (the top-level\ncode block).\n\nIf a name binding operation occurs anywhere within a code block, all\nuses of the name within the block are treated as references to the\ncurrent block. This can lead to errors when a name is used within a\nblock before it is bound. This rule is subtle. Python lacks\ndeclarations and allows name binding operations to occur anywhere\nwithin a code block. The local variables of a code block can be\ndetermined by scanning the entire text of the block for name binding\noperations.\n\nIf the global statement occurs within a block, all uses of the name\nspecified in the statement refer to the binding of that name in the\ntop-level namespace. Names are resolved in the top-level namespace by\nsearching the global namespace, i.e. the namespace of the module\ncontaining the code block, and the builtin namespace, the namespace of\nthe module ``__builtin__``. The global namespace is searched first.\nIf the name is not found there, the builtin namespace is searched.\nThe global statement must precede all uses of the name.\n\nThe built-in namespace associated with the execution of a code block\nis actually found by looking up the name ``__builtins__`` in its\nglobal namespace; this should be a dictionary or a module (in the\nlatter case the module\'s dictionary is used). By default, when in the\n``__main__`` module, ``__builtins__`` is the built-in module\n``__builtin__`` (note: no \'s\'); when in any other module,\n``__builtins__`` is an alias for the dictionary of the ``__builtin__``\nmodule itself. ``__builtins__`` can be set to a user-created\ndictionary to create a weak form of restricted execution.\n\nNote: Users should not touch ``__builtins__``; it is strictly an\n implementation detail. Users wanting to override values in the\n built-in namespace should ``import`` the ``__builtin__`` (no \'s\')\n module and modify its attributes appropriately.\n\nThe namespace for a module is automatically created the first time a\nmodule is imported. The main module for a script is always called\n``__main__``.\n\nThe global statement has the same scope as a name binding operation in\nthe same block. If the nearest enclosing scope for a free variable\ncontains a global statement, the free variable is treated as a global.\n\nA class definition is an executable statement that may use and define\nnames. These references follow the normal rules for name resolution.\nThe namespace of the class definition becomes the attribute dictionary\nof the class. Names defined at the class scope are not visible in\nmethods.\n\n\nInteraction with dynamic features\n=================================\n\nThere are several cases where Python statements are illegal when used\nin conjunction with nested scopes that contain free variables.\n\nIf a variable is referenced in an enclosing scope, it is illegal to\ndelete the name. An error will be reported at compile time.\n\nIf the wild card form of import --- ``import *`` --- is used in a\nfunction and the function contains or is a nested block with free\nvariables, the compiler will raise a ``SyntaxError``.\n\nIf ``exec`` is used in a function and the function contains or is a\nnested block with free variables, the compiler will raise a\n``SyntaxError`` unless the exec explicitly specifies the local\nnamespace for the ``exec``. (In other words, ``exec obj`` would be\nillegal, but ``exec obj in ns`` would be legal.)\n\nThe ``eval()``, ``execfile()``, and ``input()`` functions and the\n``exec`` statement do not have access to the full environment for\nresolving names. Names may be resolved in the local and global\nnamespaces of the caller. Free variables are not resolved in the\nnearest enclosing namespace, but in the global namespace. [1] The\n``exec`` statement and the ``eval()`` and ``execfile()`` functions\nhave optional arguments to override the global and local namespace.\nIf only one namespace is specified, it is used for both.\n', 'numbers': u"\nNumeric literals\n****************\n\nThere are four types of numeric literals: plain integers, long\nintegers, floating point numbers, and imaginary numbers. There are no\ncomplex literals (complex numbers can be formed by adding a real\nnumber and an imaginary number).\n\nNote that numeric literals do not include a sign; a phrase like ``-1``\nis actually an expression composed of the unary operator '``-``' and\nthe literal ``1``.\n", - 'numeric-types': u'\nEmulating numeric types\n***********************\n\nThe following methods can be defined to emulate numeric objects.\nMethods corresponding to operations that are not supported by the\nparticular kind of number implemented (e.g., bitwise operations for\nnon-integral numbers) should be left undefined.\n\nobject.__add__(self, other)\nobject.__sub__(self, other)\nobject.__mul__(self, other)\nobject.__floordiv__(self, other)\nobject.__mod__(self, other)\nobject.__divmod__(self, other)\nobject.__pow__(self, other[, modulo])\nobject.__lshift__(self, other)\nobject.__rshift__(self, other)\nobject.__and__(self, other)\nobject.__xor__(self, other)\nobject.__or__(self, other)\n\n These methods are called to implement the binary arithmetic\n operations (``+``, ``-``, ``*``, ``//``, ``%``, ``divmod()``,\n ``pow()``, ``**``, ``<<``, ``>>``, ``&``, ``^``, ``|``). For\n instance, to evaluate the expression *x*``+``*y*, where *x* is an\n instance of a class that has an ``__add__()`` method,\n ``x.__add__(y)`` is called. The ``__divmod__()`` method should be\n the equivalent to using ``__floordiv__()`` and ``__mod__()``; it\n should not be related to ``__truediv__()`` (described below). Note\n that ``__pow__()`` should be defined to accept an optional third\n argument if the ternary version of the built-in ``pow()`` function\n is to be supported.\n\n If one of those methods does not support the operation with the\n supplied arguments, it should return ``NotImplemented``.\n\nobject.__div__(self, other)\nobject.__truediv__(self, other)\n\n The division operator (``/``) is implemented by these methods. The\n ``__truediv__()`` method is used when ``__future__.division`` is in\n effect, otherwise ``__div__()`` is used. If only one of these two\n methods is defined, the object will not support division in the\n alternate context; ``TypeError`` will be raised instead.\n\nobject.__radd__(self, other)\nobject.__rsub__(self, other)\nobject.__rmul__(self, other)\nobject.__rdiv__(self, other)\nobject.__rtruediv__(self, other)\nobject.__rfloordiv__(self, other)\nobject.__rmod__(self, other)\nobject.__rdivmod__(self, other)\nobject.__rpow__(self, other)\nobject.__rlshift__(self, other)\nobject.__rrshift__(self, other)\nobject.__rand__(self, other)\nobject.__rxor__(self, other)\nobject.__ror__(self, other)\n\n These methods are called to implement the binary arithmetic\n operations (``+``, ``-``, ``*``, ``/``, ``%``, ``divmod()``,\n ``pow()``, ``**``, ``<<``, ``>>``, ``&``, ``^``, ``|``) with\n reflected (swapped) operands. These functions are only called if\n the left operand does not support the corresponding operation and\n the operands are of different types. [4] For instance, to evaluate\n the expression *x*``-``*y*, where *y* is an instance of a class\n that has an ``__rsub__()`` method, ``y.__rsub__(x)`` is called if\n ``x.__sub__(y)`` returns *NotImplemented*.\n\n Note that ternary ``pow()`` will not try calling ``__rpow__()``\n (the coercion rules would become too complicated).\n\n Note: If the right operand\'s type is a subclass of the left operand\'s\n type and that subclass provides the reflected method for the\n operation, this method will be called before the left operand\'s\n non-reflected method. This behavior allows subclasses to\n override their ancestors\' operations.\n\nobject.__iadd__(self, other)\nobject.__isub__(self, other)\nobject.__imul__(self, other)\nobject.__idiv__(self, other)\nobject.__itruediv__(self, other)\nobject.__ifloordiv__(self, other)\nobject.__imod__(self, other)\nobject.__ipow__(self, other[, modulo])\nobject.__ilshift__(self, other)\nobject.__irshift__(self, other)\nobject.__iand__(self, other)\nobject.__ixor__(self, other)\nobject.__ior__(self, other)\n\n These methods are called to implement the augmented arithmetic\n operations (``+=``, ``-=``, ``*=``, ``/=``, ``//=``, ``%=``,\n ``**=``, ``<<=``, ``>>=``, ``&=``, ``^=``, ``|=``). These methods\n should attempt to do the operation in-place (modifying *self*) and\n return the result (which could be, but does not have to be,\n *self*). If a specific method is not defined, the augmented\n operation falls back to the normal methods. For instance, to\n evaluate the expression *x*``+=``*y*, where *x* is an instance of a\n class that has an ``__iadd__()`` method, ``x.__iadd__(y)`` is\n called. If *x* is an instance of a class that does not define a\n ``__iadd__()`` method, ``x.__add__(y)`` and ``y.__radd__(x)`` are\n considered, as with the evaluation of *x*``+``*y*.\n\nobject.__neg__(self)\nobject.__pos__(self)\nobject.__abs__(self)\nobject.__invert__(self)\n\n Called to implement the unary arithmetic operations (``-``, ``+``,\n ``abs()`` and ``~``).\n\nobject.__complex__(self)\nobject.__int__(self)\nobject.__long__(self)\nobject.__float__(self)\n\n Called to implement the built-in functions ``complex()``,\n ``int()``, ``long()``, and ``float()``. Should return a value of\n the appropriate type.\n\nobject.__oct__(self)\nobject.__hex__(self)\n\n Called to implement the built-in functions ``oct()`` and ``hex()``.\n Should return a string value.\n\nobject.__index__(self)\n\n Called to implement ``operator.index()``. Also called whenever\n Python needs an integer object (such as in slicing). Must return\n an integer (int or long).\n\n Added in version 2.5.\n\nobject.__coerce__(self, other)\n\n Called to implement "mixed-mode" numeric arithmetic. Should either\n return a 2-tuple containing *self* and *other* converted to a\n common numeric type, or ``None`` if conversion is impossible. When\n the common type would be the type of ``other``, it is sufficient to\n return ``None``, since the interpreter will also ask the other\n object to attempt a coercion (but sometimes, if the implementation\n of the other type cannot be changed, it is useful to do the\n conversion to the other type here). A return value of\n ``NotImplemented`` is equivalent to returning ``None``.\n', + 'numeric-types': u'\nEmulating numeric types\n***********************\n\nThe following methods can be defined to emulate numeric objects.\nMethods corresponding to operations that are not supported by the\nparticular kind of number implemented (e.g., bitwise operations for\nnon-integral numbers) should be left undefined.\n\nobject.__add__(self, other)\nobject.__sub__(self, other)\nobject.__mul__(self, other)\nobject.__floordiv__(self, other)\nobject.__mod__(self, other)\nobject.__divmod__(self, other)\nobject.__pow__(self, other[, modulo])\nobject.__lshift__(self, other)\nobject.__rshift__(self, other)\nobject.__and__(self, other)\nobject.__xor__(self, other)\nobject.__or__(self, other)\n\n These methods are called to implement the binary arithmetic\n operations (``+``, ``-``, ``*``, ``//``, ``%``, ``divmod()``,\n ``pow()``, ``**``, ``<<``, ``>>``, ``&``, ``^``, ``|``). For\n instance, to evaluate the expression ``x + y``, where *x* is an\n instance of a class that has an ``__add__()`` method,\n ``x.__add__(y)`` is called. The ``__divmod__()`` method should be\n the equivalent to using ``__floordiv__()`` and ``__mod__()``; it\n should not be related to ``__truediv__()`` (described below). Note\n that ``__pow__()`` should be defined to accept an optional third\n argument if the ternary version of the built-in ``pow()`` function\n is to be supported.\n\n If one of those methods does not support the operation with the\n supplied arguments, it should return ``NotImplemented``.\n\nobject.__div__(self, other)\nobject.__truediv__(self, other)\n\n The division operator (``/``) is implemented by these methods. The\n ``__truediv__()`` method is used when ``__future__.division`` is in\n effect, otherwise ``__div__()`` is used. If only one of these two\n methods is defined, the object will not support division in the\n alternate context; ``TypeError`` will be raised instead.\n\nobject.__radd__(self, other)\nobject.__rsub__(self, other)\nobject.__rmul__(self, other)\nobject.__rdiv__(self, other)\nobject.__rtruediv__(self, other)\nobject.__rfloordiv__(self, other)\nobject.__rmod__(self, other)\nobject.__rdivmod__(self, other)\nobject.__rpow__(self, other)\nobject.__rlshift__(self, other)\nobject.__rrshift__(self, other)\nobject.__rand__(self, other)\nobject.__rxor__(self, other)\nobject.__ror__(self, other)\n\n These methods are called to implement the binary arithmetic\n operations (``+``, ``-``, ``*``, ``/``, ``%``, ``divmod()``,\n ``pow()``, ``**``, ``<<``, ``>>``, ``&``, ``^``, ``|``) with\n reflected (swapped) operands. These functions are only called if\n the left operand does not support the corresponding operation and\n the operands are of different types. [3] For instance, to evaluate\n the expression ``x - y``, where *y* is an instance of a class that\n has an ``__rsub__()`` method, ``y.__rsub__(x)`` is called if\n ``x.__sub__(y)`` returns *NotImplemented*.\n\n Note that ternary ``pow()`` will not try calling ``__rpow__()``\n (the coercion rules would become too complicated).\n\n Note: If the right operand\'s type is a subclass of the left operand\'s\n type and that subclass provides the reflected method for the\n operation, this method will be called before the left operand\'s\n non-reflected method. This behavior allows subclasses to\n override their ancestors\' operations.\n\nobject.__iadd__(self, other)\nobject.__isub__(self, other)\nobject.__imul__(self, other)\nobject.__idiv__(self, other)\nobject.__itruediv__(self, other)\nobject.__ifloordiv__(self, other)\nobject.__imod__(self, other)\nobject.__ipow__(self, other[, modulo])\nobject.__ilshift__(self, other)\nobject.__irshift__(self, other)\nobject.__iand__(self, other)\nobject.__ixor__(self, other)\nobject.__ior__(self, other)\n\n These methods are called to implement the augmented arithmetic\n operations (``+=``, ``-=``, ``*=``, ``/=``, ``//=``, ``%=``,\n ``**=``, ``<<=``, ``>>=``, ``&=``, ``^=``, ``|=``). These methods\n should attempt to do the operation in-place (modifying *self*) and\n return the result (which could be, but does not have to be,\n *self*). If a specific method is not defined, the augmented\n operation falls back to the normal methods. For instance, to\n evaluate the expression ``x += y``, where *x* is an instance of a\n class that has an ``__iadd__()`` method, ``x.__iadd__(y)`` is\n called. If *x* is an instance of a class that does not define a\n ``__iadd__()`` method, ``x.__add__(y)`` and ``y.__radd__(x)`` are\n considered, as with the evaluation of ``x + y``.\n\nobject.__neg__(self)\nobject.__pos__(self)\nobject.__abs__(self)\nobject.__invert__(self)\n\n Called to implement the unary arithmetic operations (``-``, ``+``,\n ``abs()`` and ``~``).\n\nobject.__complex__(self)\nobject.__int__(self)\nobject.__long__(self)\nobject.__float__(self)\n\n Called to implement the built-in functions ``complex()``,\n ``int()``, ``long()``, and ``float()``. Should return a value of\n the appropriate type.\n\nobject.__oct__(self)\nobject.__hex__(self)\n\n Called to implement the built-in functions ``oct()`` and ``hex()``.\n Should return a string value.\n\nobject.__index__(self)\n\n Called to implement ``operator.index()``. Also called whenever\n Python needs an integer object (such as in slicing). Must return\n an integer (int or long).\n\n New in version 2.5.\n\nobject.__coerce__(self, other)\n\n Called to implement "mixed-mode" numeric arithmetic. Should either\n return a 2-tuple containing *self* and *other* converted to a\n common numeric type, or ``None`` if conversion is impossible. When\n the common type would be the type of ``other``, it is sufficient to\n return ``None``, since the interpreter will also ask the other\n object to attempt a coercion (but sometimes, if the implementation\n of the other type cannot be changed, it is useful to do the\n conversion to the other type here). A return value of\n ``NotImplemented`` is equivalent to returning ``None``.\n', 'objects': u'\nObjects, values and types\n*************************\n\n*Objects* are Python\'s abstraction for data. All data in a Python\nprogram is represented by objects or by relations between objects. (In\na sense, and in conformance to Von Neumann\'s model of a "stored\nprogram computer," code is also represented by objects.)\n\nEvery object has an identity, a type and a value. An object\'s\n*identity* never changes once it has been created; you may think of it\nas the object\'s address in memory. The \'``is``\' operator compares the\nidentity of two objects; the ``id()`` function returns an integer\nrepresenting its identity (currently implemented as its address). An\nobject\'s *type* is also unchangeable. [1] An object\'s type determines\nthe operations that the object supports (e.g., "does it have a\nlength?") and also defines the possible values for objects of that\ntype. The ``type()`` function returns an object\'s type (which is an\nobject itself). The *value* of some objects can change. Objects\nwhose value can change are said to be *mutable*; objects whose value\nis unchangeable once they are created are called *immutable*. (The\nvalue of an immutable container object that contains a reference to a\nmutable object can change when the latter\'s value is changed; however\nthe container is still considered immutable, because the collection of\nobjects it contains cannot be changed. So, immutability is not\nstrictly the same as having an unchangeable value, it is more subtle.)\nAn object\'s mutability is determined by its type; for instance,\nnumbers, strings and tuples are immutable, while dictionaries and\nlists are mutable.\n\nObjects are never explicitly destroyed; however, when they become\nunreachable they may be garbage-collected. An implementation is\nallowed to postpone garbage collection or omit it altogether --- it is\na matter of implementation quality how garbage collection is\nimplemented, as long as no objects are collected that are still\nreachable. (Implementation note: the current implementation uses a\nreference-counting scheme with (optional) delayed detection of\ncyclically linked garbage, which collects most objects as soon as they\nbecome unreachable, but is not guaranteed to collect garbage\ncontaining circular references. See the documentation of the ``gc``\nmodule for information on controlling the collection of cyclic\ngarbage.)\n\nNote that the use of the implementation\'s tracing or debugging\nfacilities may keep objects alive that would normally be collectable.\nAlso note that catching an exception with a \'``try``...``except``\'\nstatement may keep objects alive.\n\nSome objects contain references to "external" resources such as open\nfiles or windows. It is understood that these resources are freed\nwhen the object is garbage-collected, but since garbage collection is\nnot guaranteed to happen, such objects also provide an explicit way to\nrelease the external resource, usually a ``close()`` method. Programs\nare strongly recommended to explicitly close such objects. The\n\'``try``...``finally``\' statement provides a convenient way to do\nthis.\n\nSome objects contain references to other objects; these are called\n*containers*. Examples of containers are tuples, lists and\ndictionaries. The references are part of a container\'s value. In\nmost cases, when we talk about the value of a container, we imply the\nvalues, not the identities of the contained objects; however, when we\ntalk about the mutability of a container, only the identities of the\nimmediately contained objects are implied. So, if an immutable\ncontainer (like a tuple) contains a reference to a mutable object, its\nvalue changes if that mutable object is changed.\n\nTypes affect almost all aspects of object behavior. Even the\nimportance of object identity is affected in some sense: for immutable\ntypes, operations that compute new values may actually return a\nreference to any existing object with the same type and value, while\nfor mutable objects this is not allowed. E.g., after ``a = 1; b =\n1``, ``a`` and ``b`` may or may not refer to the same object with the\nvalue one, depending on the implementation, but after ``c = []; d =\n[]``, ``c`` and ``d`` are guaranteed to refer to two different,\nunique, newly created empty lists. (Note that ``c = d = []`` assigns\nthe same object to both ``c`` and ``d``.)\n', - 'operator-summary': u'\nSummary\n*******\n\nThe following table summarizes the operator precedences in Python,\nfrom lowest precedence (least binding) to highest precedence (most\nbinding). Operators in the same box have the same precedence. Unless\nthe syntax is explicitly given, operators are binary. Operators in\nthe same box group left to right (except for comparisons, including\ntests, which all have the same precedence and chain from left to right\n--- see section *Comparisons* --- and exponentiation, which groups\nfrom right to left).\n\n+-------------------------------------------------+---------------------------------------+\n| Operator | Description |\n+=================================================+=======================================+\n| ``lambda`` | Lambda expression |\n+-------------------------------------------------+---------------------------------------+\n| ``or`` | Boolean OR |\n+-------------------------------------------------+---------------------------------------+\n| ``and`` | Boolean AND |\n+-------------------------------------------------+---------------------------------------+\n| ``not`` *x* | Boolean NOT |\n+-------------------------------------------------+---------------------------------------+\n| ``in``, ``not`` ``in`` | Membership tests |\n+-------------------------------------------------+---------------------------------------+\n| ``is``, ``is not`` | Identity tests |\n+-------------------------------------------------+---------------------------------------+\n| ``<``, ``<=``, ``>``, ``>=``, ``<>``, ``!=``, | Comparisons |\n| ``==`` | |\n+-------------------------------------------------+---------------------------------------+\n| ``|`` | Bitwise OR |\n+-------------------------------------------------+---------------------------------------+\n| ``^`` | Bitwise XOR |\n+-------------------------------------------------+---------------------------------------+\n| ``&`` | Bitwise AND |\n+-------------------------------------------------+---------------------------------------+\n| ``<<``, ``>>`` | Shifts |\n+-------------------------------------------------+---------------------------------------+\n| ``+``, ``-`` | Addition and subtraction |\n+-------------------------------------------------+---------------------------------------+\n| ``*``, ``/``, ``%`` | Multiplication, division, remainder |\n+-------------------------------------------------+---------------------------------------+\n| ``+x``, ``-x`` | Positive, negative |\n+-------------------------------------------------+---------------------------------------+\n| ``~x`` | Bitwise not |\n+-------------------------------------------------+---------------------------------------+\n| ``**`` | Exponentiation |\n+-------------------------------------------------+---------------------------------------+\n| ``x.attribute`` | Attribute reference |\n+-------------------------------------------------+---------------------------------------+\n| ``x[index]`` | Subscription |\n+-------------------------------------------------+---------------------------------------+\n| ``x[index:index]`` | Slicing |\n+-------------------------------------------------+---------------------------------------+\n| ``f(arguments...)`` | Function call |\n+-------------------------------------------------+---------------------------------------+\n| ``(expressions...)`` | Binding or tuple display |\n+-------------------------------------------------+---------------------------------------+\n| ``[expressions...]`` | List display |\n+-------------------------------------------------+---------------------------------------+\n| ``{key:datum...}`` | Dictionary display |\n+-------------------------------------------------+---------------------------------------+\n| ```expressions...``` | String conversion |\n+-------------------------------------------------+---------------------------------------+\n\n-[ Footnotes ]-\n\n[1] In Python 2.3 and later releases, a list comprehension "leaks" the\n control variables of each ``for`` it contains into the containing\n scope. However, this behavior is deprecated, and relying on it\n will not work in Python 3.0\n\n[2] While ``abs(x%y) < abs(y)`` is true mathematically, for floats it\n may not be true numerically due to roundoff. For example, and\n assuming a platform on which a Python float is an IEEE 754 double-\n precision number, in order that ``-1e-100 % 1e100`` have the same\n sign as ``1e100``, the computed result is ``-1e-100 + 1e100``,\n which is numerically exactly equal to ``1e100``. Function\n ``fmod()`` in the ``math`` module returns a result whose sign\n matches the sign of the first argument instead, and so returns\n ``-1e-100`` in this case. Which approach is more appropriate\n depends on the application.\n\n[3] If x is very close to an exact integer multiple of y, it\'s\n possible for ``floor(x/y)`` to be one larger than ``(x-x%y)/y``\n due to rounding. In such cases, Python returns the latter result,\n in order to preserve that ``divmod(x,y)[0] * y + x % y`` be very\n close to ``x``.\n\n[4] While comparisons between unicode strings make sense at the byte\n level, they may be counter-intuitive to users. For example, the\n strings ``u"\\u00C7"`` and ``u"\\u0043\\u0327"`` compare differently,\n even though they both represent the same unicode character (LATIN\n CAPTITAL LETTER C WITH CEDILLA). To compare strings in a human\n recognizable way, compare using ``unicodedata.normalize()``.\n\n[5] The implementation computes this efficiently, without constructing\n lists or sorting.\n\n[6] Earlier versions of Python used lexicographic comparison of the\n sorted (key, value) lists, but this was very expensive for the\n common case of comparing for equality. An even earlier version of\n Python compared dictionaries by identity only, but this caused\n surprises because people expected to be able to test a dictionary\n for emptiness by comparing it to ``{}``.\n', + 'operator-summary': u'\nSummary\n*******\n\nThe following table summarizes the operator precedences in Python,\nfrom lowest precedence (least binding) to highest precedence (most\nbinding). Operators in the same box have the same precedence. Unless\nthe syntax is explicitly given, operators are binary. Operators in\nthe same box group left to right (except for comparisons, including\ntests, which all have the same precedence and chain from left to right\n--- see section *Comparisons* --- and exponentiation, which groups\nfrom right to left).\n\n+-------------------------------------------------+---------------------------------------+\n| Operator | Description |\n+=================================================+=======================================+\n| ``lambda`` | Lambda expression |\n+-------------------------------------------------+---------------------------------------+\n| ``or`` | Boolean OR |\n+-------------------------------------------------+---------------------------------------+\n| ``and`` | Boolean AND |\n+-------------------------------------------------+---------------------------------------+\n| ``not`` *x* | Boolean NOT |\n+-------------------------------------------------+---------------------------------------+\n| ``in``, ``not`` ``in`` | Membership tests |\n+-------------------------------------------------+---------------------------------------+\n| ``is``, ``is not`` | Identity tests |\n+-------------------------------------------------+---------------------------------------+\n| ``<``, ``<=``, ``>``, ``>=``, ``<>``, ``!=``, | Comparisons |\n| ``==`` | |\n+-------------------------------------------------+---------------------------------------+\n| ``|`` | Bitwise OR |\n+-------------------------------------------------+---------------------------------------+\n| ``^`` | Bitwise XOR |\n+-------------------------------------------------+---------------------------------------+\n| ``&`` | Bitwise AND |\n+-------------------------------------------------+---------------------------------------+\n| ``<<``, ``>>`` | Shifts |\n+-------------------------------------------------+---------------------------------------+\n| ``+``, ``-`` | Addition and subtraction |\n+-------------------------------------------------+---------------------------------------+\n| ``*``, ``/``, ``%`` | Multiplication, division, remainder |\n+-------------------------------------------------+---------------------------------------+\n| ``+x``, ``-x`` | Positive, negative |\n+-------------------------------------------------+---------------------------------------+\n| ``~x`` | Bitwise not |\n+-------------------------------------------------+---------------------------------------+\n| ``**`` | Exponentiation |\n+-------------------------------------------------+---------------------------------------+\n| ``x[index]`` | Subscription |\n+-------------------------------------------------+---------------------------------------+\n| ``x[index:index]`` | Slicing |\n+-------------------------------------------------+---------------------------------------+\n| ``x(arguments...)`` | Call |\n+-------------------------------------------------+---------------------------------------+\n| ``x.attribute`` | Attribute reference |\n+-------------------------------------------------+---------------------------------------+\n| ``(expressions...)`` | Binding or tuple display |\n+-------------------------------------------------+---------------------------------------+\n| ``[expressions...]`` | List display |\n+-------------------------------------------------+---------------------------------------+\n| ``{key:datum...}`` | Dictionary display |\n+-------------------------------------------------+---------------------------------------+\n| ```expressions...``` | String conversion |\n+-------------------------------------------------+---------------------------------------+\n\n-[ Footnotes ]-\n\n[1] In Python 2.3 and later releases, a list comprehension "leaks" the\n control variables of each ``for`` it contains into the containing\n scope. However, this behavior is deprecated, and relying on it\n will not work in Python 3.0\n\n[2] While ``abs(x%y) < abs(y)`` is true mathematically, for floats it\n may not be true numerically due to roundoff. For example, and\n assuming a platform on which a Python float is an IEEE 754 double-\n precision number, in order that ``-1e-100 % 1e100`` have the same\n sign as ``1e100``, the computed result is ``-1e-100 + 1e100``,\n which is numerically exactly equal to ``1e100``. Function\n ``fmod()`` in the ``math`` module returns a result whose sign\n matches the sign of the first argument instead, and so returns\n ``-1e-100`` in this case. Which approach is more appropriate\n depends on the application.\n\n[3] If x is very close to an exact integer multiple of y, it\'s\n possible for ``floor(x/y)`` to be one larger than ``(x-x%y)/y``\n due to rounding. In such cases, Python returns the latter result,\n in order to preserve that ``divmod(x,y)[0] * y + x % y`` be very\n close to ``x``.\n\n[4] While comparisons between unicode strings make sense at the byte\n level, they may be counter-intuitive to users. For example, the\n strings ``u"\\u00C7"`` and ``u"\\u0043\\u0327"`` compare differently,\n even though they both represent the same unicode character (LATIN\n CAPTITAL LETTER C WITH CEDILLA). To compare strings in a human\n recognizable way, compare using ``unicodedata.normalize()``.\n\n[5] The implementation computes this efficiently, without constructing\n lists or sorting.\n\n[6] Earlier versions of Python used lexicographic comparison of the\n sorted (key, value) lists, but this was very expensive for the\n common case of comparing for equality. An even earlier version of\n Python compared dictionaries by identity only, but this caused\n surprises because people expected to be able to test a dictionary\n for emptiness by comparing it to ``{}``.\n\n[7] Due to automatic garbage-collection, free lists, and the dynamic\n nature of descriptors, you may notice seemingly unusual behaviour\n in certain uses of the ``is`` operator, like those involving\n comparisons between instance methods, or constants. Check their\n documentation for more info.\n', 'pass': u'\nThe ``pass`` statement\n**********************\n\n pass_stmt ::= "pass"\n\n``pass`` is a null operation --- when it is executed, nothing happens.\nIt is useful as a placeholder when a statement is required\nsyntactically, but no code needs to be executed, for example:\n\n def f(arg): pass # a function that does nothing (yet)\n\n class C: pass # a class with no methods (yet)\n', 'power': u'\nThe power operator\n******************\n\nThe power operator binds more tightly than unary operators on its\nleft; it binds less tightly than unary operators on its right. The\nsyntax is:\n\n power ::= primary ["**" u_expr]\n\nThus, in an unparenthesized sequence of power and unary operators, the\noperators are evaluated from right to left (this does not constrain\nthe evaluation order for the operands): ``-1**2`` results in ``-1``.\n\nThe power operator has the same semantics as the built-in ``pow()``\nfunction, when called with two arguments: it yields its left argument\nraised to the power of its right argument. The numeric arguments are\nfirst converted to a common type. The result type is that of the\narguments after coercion.\n\nWith mixed operand types, the coercion rules for binary arithmetic\noperators apply. For int and long int operands, the result has the\nsame type as the operands (after coercion) unless the second argument\nis negative; in that case, all arguments are converted to float and a\nfloat result is delivered. For example, ``10**2`` returns ``100``, but\n``10**-2`` returns ``0.01``. (This last feature was added in Python\n2.2. In Python 2.1 and before, if both arguments were of integer types\nand the second argument was negative, an exception was raised).\n\nRaising ``0.0`` to a negative power results in a\n``ZeroDivisionError``. Raising a negative number to a fractional power\nresults in a ``ValueError``.\n', - 'print': u'\nThe ``print`` statement\n***********************\n\n print_stmt ::= "print" ([expression ("," expression)* [","]\n | ">>" expression [("," expression)+ [","])\n\n``print`` evaluates each expression in turn and writes the resulting\nobject to standard output (see below). If an object is not a string,\nit is first converted to a string using the rules for string\nconversions. The (resulting or original) string is then written. A\nspace is written before each object is (converted and) written, unless\nthe output system believes it is positioned at the beginning of a\nline. This is the case (1) when no characters have yet been written\nto standard output, (2) when the last character written to standard\noutput is ``\'\\n\'``, or (3) when the last write operation on standard\noutput was not a ``print`` statement. (In some cases it may be\nfunctional to write an empty string to standard output for this\nreason.)\n\nNote: Objects which act like file objects but which are not the built-in\n file objects often do not properly emulate this aspect of the file\n object\'s behavior, so it is best not to rely on this.\n\nA ``\'\\n\'`` character is written at the end, unless the ``print``\nstatement ends with a comma. This is the only action if the statement\ncontains just the keyword ``print``.\n\nStandard output is defined as the file object named ``stdout`` in the\nbuilt-in module ``sys``. If no such object exists, or if it does not\nhave a ``write()`` method, a ``RuntimeError`` exception is raised.\n\n``print`` also has an extended form, defined by the second portion of\nthe syntax described above. This form is sometimes referred to as\n"``print`` chevron." In this form, the first expression after the\n``>>`` must evaluate to a "file-like" object, specifically an object\nthat has a ``write()`` method as described above. With this extended\nform, the subsequent expressions are printed to this file object. If\nthe first expression evaluates to ``None``, then ``sys.stdout`` is\nused as the file for output.\n', + 'print': u'\nThe ``print`` statement\n***********************\n\n print_stmt ::= "print" ([expression ("," expression)* [","]]\n | ">>" expression [("," expression)+ [","]])\n\n``print`` evaluates each expression in turn and writes the resulting\nobject to standard output (see below). If an object is not a string,\nit is first converted to a string using the rules for string\nconversions. The (resulting or original) string is then written. A\nspace is written before each object is (converted and) written, unless\nthe output system believes it is positioned at the beginning of a\nline. This is the case (1) when no characters have yet been written\nto standard output, (2) when the last character written to standard\noutput is ``\'\\n\'``, or (3) when the last write operation on standard\noutput was not a ``print`` statement. (In some cases it may be\nfunctional to write an empty string to standard output for this\nreason.)\n\nNote: Objects which act like file objects but which are not the built-in\n file objects often do not properly emulate this aspect of the file\n object\'s behavior, so it is best not to rely on this.\n\nA ``\'\\n\'`` character is written at the end, unless the ``print``\nstatement ends with a comma. This is the only action if the statement\ncontains just the keyword ``print``.\n\nStandard output is defined as the file object named ``stdout`` in the\nbuilt-in module ``sys``. If no such object exists, or if it does not\nhave a ``write()`` method, a ``RuntimeError`` exception is raised.\n\n``print`` also has an extended form, defined by the second portion of\nthe syntax described above. This form is sometimes referred to as\n"``print`` chevron." In this form, the first expression after the\n``>>`` must evaluate to a "file-like" object, specifically an object\nthat has a ``write()`` method as described above. With this extended\nform, the subsequent expressions are printed to this file object. If\nthe first expression evaluates to ``None``, then ``sys.stdout`` is\nused as the file for output.\n', 'raise': u'\nThe ``raise`` statement\n***********************\n\n raise_stmt ::= "raise" [expression ["," expression ["," expression]]]\n\nIf no expressions are present, ``raise`` re-raises the last exception\nthat was active in the current scope. If no exception is active in\nthe current scope, a ``TypeError`` exception is raised indicating that\nthis is an error (if running under IDLE, a ``Queue.Empty`` exception\nis raised instead).\n\nOtherwise, ``raise`` evaluates the expressions to get three objects,\nusing ``None`` as the value of omitted expressions. The first two\nobjects are used to determine the *type* and *value* of the exception.\n\nIf the first object is an instance, the type of the exception is the\nclass of the instance, the instance itself is the value, and the\nsecond object must be ``None``.\n\nIf the first object is a class, it becomes the type of the exception.\nThe second object is used to determine the exception value: If it is\nan instance of the class, the instance becomes the exception value. If\nthe second object is a tuple, it is used as the argument list for the\nclass constructor; if it is ``None``, an empty argument list is used,\nand any other object is treated as a single argument to the\nconstructor. The instance so created by calling the constructor is\nused as the exception value.\n\nIf a third object is present and not ``None``, it must be a traceback\nobject (see section *The standard type hierarchy*), and it is\nsubstituted instead of the current location as the place where the\nexception occurred. If the third object is present and not a\ntraceback object or ``None``, a ``TypeError`` exception is raised.\nThe three-expression form of ``raise`` is useful to re-raise an\nexception transparently in an except clause, but ``raise`` with no\nexpressions should be preferred if the exception to be re-raised was\nthe most recently active exception in the current scope.\n\nAdditional information on exceptions can be found in section\n*Exceptions*, and information about handling exceptions is in section\n*The try statement*.\n', 'return': u'\nThe ``return`` statement\n************************\n\n return_stmt ::= "return" [expression_list]\n\n``return`` may only occur syntactically nested in a function\ndefinition, not within a nested class definition.\n\nIf an expression list is present, it is evaluated, else ``None`` is\nsubstituted.\n\n``return`` leaves the current function call with the expression list\n(or ``None``) as return value.\n\nWhen ``return`` passes control out of a ``try`` statement with a\n``finally`` clause, that ``finally`` clause is executed before really\nleaving the function.\n\nIn a generator function, the ``return`` statement is not allowed to\ninclude an **expression_list**. In that context, a bare ``return``\nindicates that the generator is done and will cause ``StopIteration``\nto be raised.\n', - 'sequence-methods': u'\nAdditional methods for emulation of sequence types\n**************************************************\n\nThe following optional methods can be defined to further emulate\nsequence objects. Immutable sequences methods should at most only\ndefine ``__getslice__()``; mutable sequences might define all three\nmethods.\n\nobject.__getslice__(self, i, j)\n\n Deprecated in version 2.0: Support slice objects as parameters to\n the ``__getitem__()`` method. (However, built-in types in CPython\n currently still implement ``__getslice__()``. Therefore, you have\n to override it in derived classes when implementing slicing.)\n\n Called to implement evaluation of ``self[i:j]``. The returned\n object should be of the same type as *self*. Note that missing *i*\n or *j* in the slice expression are replaced by zero or\n ``sys.maxint``, respectively. If negative indexes are used in the\n slice, the length of the sequence is added to that index. If the\n instance does not implement the ``__len__()`` method, an\n ``AttributeError`` is raised. No guarantee is made that indexes\n adjusted this way are not still negative. Indexes which are\n greater than the length of the sequence are not modified. If no\n ``__getslice__()`` is found, a slice object is created instead, and\n passed to ``__getitem__()`` instead.\n\nobject.__setslice__(self, i, j, sequence)\n\n Called to implement assignment to ``self[i:j]``. Same notes for *i*\n and *j* as for ``__getslice__()``.\n\n This method is deprecated. If no ``__setslice__()`` is found, or\n for extended slicing of the form ``self[i:j:k]``, a slice object is\n created, and passed to ``__setitem__()``, instead of\n ``__setslice__()`` being called.\n\nobject.__delslice__(self, i, j)\n\n Called to implement deletion of ``self[i:j]``. Same notes for *i*\n and *j* as for ``__getslice__()``. This method is deprecated. If no\n ``__delslice__()`` is found, or for extended slicing of the form\n ``self[i:j:k]``, a slice object is created, and passed to\n ``__delitem__()``, instead of ``__delslice__()`` being called.\n\nNotice that these methods are only invoked when a single slice with a\nsingle colon is used, and the slice method is available. For slice\noperations involving extended slice notation, or in absence of the\nslice methods, ``__getitem__()``, ``__setitem__()`` or\n``__delitem__()`` is called with a slice object as argument.\n\nThe following example demonstrate how to make your program or module\ncompatible with earlier versions of Python (assuming that methods\n``__getitem__()``, ``__setitem__()`` and ``__delitem__()`` support\nslice objects as arguments):\n\n class MyClass:\n ...\n def __getitem__(self, index):\n ...\n def __setitem__(self, index, value):\n ...\n def __delitem__(self, index):\n ...\n\n if sys.version_info < (2, 0):\n # They won\'t be defined if version is at least 2.0 final\n\n def __getslice__(self, i, j):\n return self[max(0, i):max(0, j):]\n def __setslice__(self, i, j, seq):\n self[max(0, i):max(0, j):] = seq\n def __delslice__(self, i, j):\n del self[max(0, i):max(0, j):]\n ...\n\nNote the calls to ``max()``; these are necessary because of the\nhandling of negative indices before the ``__*slice__()`` methods are\ncalled. When negative indexes are used, the ``__*item__()`` methods\nreceive them as provided, but the ``__*slice__()`` methods get a\n"cooked" form of the index values. For each negative index value, the\nlength of the sequence is added to the index before calling the method\n(which may still result in a negative index); this is the customary\nhandling of negative indexes by the built-in sequence types, and the\n``__*item__()`` methods are expected to do this as well. However,\nsince they should already be doing that, negative indexes cannot be\npassed in; they must be constrained to the bounds of the sequence\nbefore being passed to the ``__*item__()`` methods. Calling ``max(0,\ni)`` conveniently returns the proper value.\n', - 'sequence-types': u"\nEmulating container types\n*************************\n\nThe following methods can be defined to implement container objects.\nContainers usually are sequences (such as lists or tuples) or mappings\n(like dictionaries), but can represent other containers as well. The\nfirst set of methods is used either to emulate a sequence or to\nemulate a mapping; the difference is that for a sequence, the\nallowable keys should be the integers *k* for which ``0 <= k < N``\nwhere *N* is the length of the sequence, or slice objects, which\ndefine a range of items. (For backwards compatibility, the method\n``__getslice__()`` (see below) can also be defined to handle simple,\nbut not extended slices.) It is also recommended that mappings provide\nthe methods ``keys()``, ``values()``, ``items()``, ``has_key()``,\n``get()``, ``clear()``, ``setdefault()``, ``iterkeys()``,\n``itervalues()``, ``iteritems()``, ``pop()``, ``popitem()``,\n``copy()``, and ``update()`` behaving similar to those for Python's\nstandard dictionary objects. The ``UserDict`` module provides a\n``DictMixin`` class to help create those methods from a base set of\n``__getitem__()``, ``__setitem__()``, ``__delitem__()``, and\n``keys()``. Mutable sequences should provide methods ``append()``,\n``count()``, ``index()``, ``extend()``, ``insert()``, ``pop()``,\n``remove()``, ``reverse()`` and ``sort()``, like Python standard list\nobjects. Finally, sequence types should implement addition (meaning\nconcatenation) and multiplication (meaning repetition) by defining the\nmethods ``__add__()``, ``__radd__()``, ``__iadd__()``, ``__mul__()``,\n``__rmul__()`` and ``__imul__()`` described below; they should not\ndefine ``__coerce__()`` or other numerical operators. It is\nrecommended that both mappings and sequences implement the\n``__contains__()`` method to allow efficient use of the ``in``\noperator; for mappings, ``in`` should be equivalent of ``has_key()``;\nfor sequences, it should search through the values. It is further\nrecommended that both mappings and sequences implement the\n``__iter__()`` method to allow efficient iteration through the\ncontainer; for mappings, ``__iter__()`` should be the same as\n``iterkeys()``; for sequences, it should iterate through the values.\n\nobject.__len__(self)\n\n Called to implement the built-in function ``len()``. Should return\n the length of the object, an integer ``>=`` 0. Also, an object\n that doesn't define a ``__nonzero__()`` method and whose\n ``__len__()`` method returns zero is considered to be false in a\n Boolean context.\n\nobject.__getitem__(self, key)\n\n Called to implement evaluation of ``self[key]``. For sequence\n types, the accepted keys should be integers and slice objects.\n Note that the special interpretation of negative indexes (if the\n class wishes to emulate a sequence type) is up to the\n ``__getitem__()`` method. If *key* is of an inappropriate type,\n ``TypeError`` may be raised; if of a value outside the set of\n indexes for the sequence (after any special interpretation of\n negative values), ``IndexError`` should be raised. For mapping\n types, if *key* is missing (not in the container), ``KeyError``\n should be raised.\n\n Note: ``for`` loops expect that an ``IndexError`` will be raised for\n illegal indexes to allow proper detection of the end of the\n sequence.\n\nobject.__setitem__(self, key, value)\n\n Called to implement assignment to ``self[key]``. Same note as for\n ``__getitem__()``. This should only be implemented for mappings if\n the objects support changes to the values for keys, or if new keys\n can be added, or for sequences if elements can be replaced. The\n same exceptions should be raised for improper *key* values as for\n the ``__getitem__()`` method.\n\nobject.__delitem__(self, key)\n\n Called to implement deletion of ``self[key]``. Same note as for\n ``__getitem__()``. This should only be implemented for mappings if\n the objects support removal of keys, or for sequences if elements\n can be removed from the sequence. The same exceptions should be\n raised for improper *key* values as for the ``__getitem__()``\n method.\n\nobject.__iter__(self)\n\n This method is called when an iterator is required for a container.\n This method should return a new iterator object that can iterate\n over all the objects in the container. For mappings, it should\n iterate over the keys of the container, and should also be made\n available as the method ``iterkeys()``.\n\n Iterator objects also need to implement this method; they are\n required to return themselves. For more information on iterator\n objects, see *Iterator Types*.\n\nobject.__reversed__(self)\n\n Called (if present) by the ``reversed()`` builtin to implement\n reverse iteration. It should return a new iterator object that\n iterates over all the objects in the container in reverse order.\n\n If the ``__reversed__()`` method is not provided, the\n ``reversed()`` builtin will fall back to using the sequence\n protocol (``__len__()`` and ``__getitem__()``). Objects should\n normally only provide ``__reversed__()`` if they do not support the\n sequence protocol and an efficient implementation of reverse\n iteration is possible.\n\n Added in version 2.6.\n\nThe membership test operators (``in`` and ``not in``) are normally\nimplemented as an iteration through a sequence. However, container\nobjects can supply the following special method with a more efficient\nimplementation, which also does not require the object be a sequence.\n\nobject.__contains__(self, item)\n\n Called to implement membership test operators. Should return true\n if *item* is in *self*, false otherwise. For mapping objects, this\n should consider the keys of the mapping rather than the values or\n the key-item pairs.\n", + 'sequence-methods': u'\nAdditional methods for emulation of sequence types\n**************************************************\n\nThe following optional methods can be defined to further emulate\nsequence objects. Immutable sequences methods should at most only\ndefine ``__getslice__()``; mutable sequences might define all three\nmethods.\n\nobject.__getslice__(self, i, j)\n\n Deprecated since version 2.0: Support slice objects as parameters\n to the ``__getitem__()`` method. (However, built-in types in\n CPython currently still implement ``__getslice__()``. Therefore,\n you have to override it in derived classes when implementing\n slicing.)\n\n Called to implement evaluation of ``self[i:j]``. The returned\n object should be of the same type as *self*. Note that missing *i*\n or *j* in the slice expression are replaced by zero or\n ``sys.maxint``, respectively. If negative indexes are used in the\n slice, the length of the sequence is added to that index. If the\n instance does not implement the ``__len__()`` method, an\n ``AttributeError`` is raised. No guarantee is made that indexes\n adjusted this way are not still negative. Indexes which are\n greater than the length of the sequence are not modified. If no\n ``__getslice__()`` is found, a slice object is created instead, and\n passed to ``__getitem__()`` instead.\n\nobject.__setslice__(self, i, j, sequence)\n\n Called to implement assignment to ``self[i:j]``. Same notes for *i*\n and *j* as for ``__getslice__()``.\n\n This method is deprecated. If no ``__setslice__()`` is found, or\n for extended slicing of the form ``self[i:j:k]``, a slice object is\n created, and passed to ``__setitem__()``, instead of\n ``__setslice__()`` being called.\n\nobject.__delslice__(self, i, j)\n\n Called to implement deletion of ``self[i:j]``. Same notes for *i*\n and *j* as for ``__getslice__()``. This method is deprecated. If no\n ``__delslice__()`` is found, or for extended slicing of the form\n ``self[i:j:k]``, a slice object is created, and passed to\n ``__delitem__()``, instead of ``__delslice__()`` being called.\n\nNotice that these methods are only invoked when a single slice with a\nsingle colon is used, and the slice method is available. For slice\noperations involving extended slice notation, or in absence of the\nslice methods, ``__getitem__()``, ``__setitem__()`` or\n``__delitem__()`` is called with a slice object as argument.\n\nThe following example demonstrate how to make your program or module\ncompatible with earlier versions of Python (assuming that methods\n``__getitem__()``, ``__setitem__()`` and ``__delitem__()`` support\nslice objects as arguments):\n\n class MyClass:\n ...\n def __getitem__(self, index):\n ...\n def __setitem__(self, index, value):\n ...\n def __delitem__(self, index):\n ...\n\n if sys.version_info < (2, 0):\n # They won\'t be defined if version is at least 2.0 final\n\n def __getslice__(self, i, j):\n return self[max(0, i):max(0, j):]\n def __setslice__(self, i, j, seq):\n self[max(0, i):max(0, j):] = seq\n def __delslice__(self, i, j):\n del self[max(0, i):max(0, j):]\n ...\n\nNote the calls to ``max()``; these are necessary because of the\nhandling of negative indices before the ``__*slice__()`` methods are\ncalled. When negative indexes are used, the ``__*item__()`` methods\nreceive them as provided, but the ``__*slice__()`` methods get a\n"cooked" form of the index values. For each negative index value, the\nlength of the sequence is added to the index before calling the method\n(which may still result in a negative index); this is the customary\nhandling of negative indexes by the built-in sequence types, and the\n``__*item__()`` methods are expected to do this as well. However,\nsince they should already be doing that, negative indexes cannot be\npassed in; they must be constrained to the bounds of the sequence\nbefore being passed to the ``__*item__()`` methods. Calling ``max(0,\ni)`` conveniently returns the proper value.\n', + 'sequence-types': u"\nEmulating container types\n*************************\n\nThe following methods can be defined to implement container objects.\nContainers usually are sequences (such as lists or tuples) or mappings\n(like dictionaries), but can represent other containers as well. The\nfirst set of methods is used either to emulate a sequence or to\nemulate a mapping; the difference is that for a sequence, the\nallowable keys should be the integers *k* for which ``0 <= k < N``\nwhere *N* is the length of the sequence, or slice objects, which\ndefine a range of items. (For backwards compatibility, the method\n``__getslice__()`` (see below) can also be defined to handle simple,\nbut not extended slices.) It is also recommended that mappings provide\nthe methods ``keys()``, ``values()``, ``items()``, ``has_key()``,\n``get()``, ``clear()``, ``setdefault()``, ``iterkeys()``,\n``itervalues()``, ``iteritems()``, ``pop()``, ``popitem()``,\n``copy()``, and ``update()`` behaving similar to those for Python's\nstandard dictionary objects. The ``UserDict`` module provides a\n``DictMixin`` class to help create those methods from a base set of\n``__getitem__()``, ``__setitem__()``, ``__delitem__()``, and\n``keys()``. Mutable sequences should provide methods ``append()``,\n``count()``, ``index()``, ``extend()``, ``insert()``, ``pop()``,\n``remove()``, ``reverse()`` and ``sort()``, like Python standard list\nobjects. Finally, sequence types should implement addition (meaning\nconcatenation) and multiplication (meaning repetition) by defining the\nmethods ``__add__()``, ``__radd__()``, ``__iadd__()``, ``__mul__()``,\n``__rmul__()`` and ``__imul__()`` described below; they should not\ndefine ``__coerce__()`` or other numerical operators. It is\nrecommended that both mappings and sequences implement the\n``__contains__()`` method to allow efficient use of the ``in``\noperator; for mappings, ``in`` should be equivalent of ``has_key()``;\nfor sequences, it should search through the values. It is further\nrecommended that both mappings and sequences implement the\n``__iter__()`` method to allow efficient iteration through the\ncontainer; for mappings, ``__iter__()`` should be the same as\n``iterkeys()``; for sequences, it should iterate through the values.\n\nobject.__len__(self)\n\n Called to implement the built-in function ``len()``. Should return\n the length of the object, an integer ``>=`` 0. Also, an object\n that doesn't define a ``__nonzero__()`` method and whose\n ``__len__()`` method returns zero is considered to be false in a\n Boolean context.\n\nobject.__getitem__(self, key)\n\n Called to implement evaluation of ``self[key]``. For sequence\n types, the accepted keys should be integers and slice objects.\n Note that the special interpretation of negative indexes (if the\n class wishes to emulate a sequence type) is up to the\n ``__getitem__()`` method. If *key* is of an inappropriate type,\n ``TypeError`` may be raised; if of a value outside the set of\n indexes for the sequence (after any special interpretation of\n negative values), ``IndexError`` should be raised. For mapping\n types, if *key* is missing (not in the container), ``KeyError``\n should be raised.\n\n Note: ``for`` loops expect that an ``IndexError`` will be raised for\n illegal indexes to allow proper detection of the end of the\n sequence.\n\nobject.__setitem__(self, key, value)\n\n Called to implement assignment to ``self[key]``. Same note as for\n ``__getitem__()``. This should only be implemented for mappings if\n the objects support changes to the values for keys, or if new keys\n can be added, or for sequences if elements can be replaced. The\n same exceptions should be raised for improper *key* values as for\n the ``__getitem__()`` method.\n\nobject.__delitem__(self, key)\n\n Called to implement deletion of ``self[key]``. Same note as for\n ``__getitem__()``. This should only be implemented for mappings if\n the objects support removal of keys, or for sequences if elements\n can be removed from the sequence. The same exceptions should be\n raised for improper *key* values as for the ``__getitem__()``\n method.\n\nobject.__iter__(self)\n\n This method is called when an iterator is required for a container.\n This method should return a new iterator object that can iterate\n over all the objects in the container. For mappings, it should\n iterate over the keys of the container, and should also be made\n available as the method ``iterkeys()``.\n\n Iterator objects also need to implement this method; they are\n required to return themselves. For more information on iterator\n objects, see *Iterator Types*.\n\nobject.__reversed__(self)\n\n Called (if present) by the ``reversed()`` builtin to implement\n reverse iteration. It should return a new iterator object that\n iterates over all the objects in the container in reverse order.\n\n If the ``__reversed__()`` method is not provided, the\n ``reversed()`` builtin will fall back to using the sequence\n protocol (``__len__()`` and ``__getitem__()``). Objects should\n normally only provide ``__reversed__()`` if they do not support the\n sequence protocol and an efficient implementation of reverse\n iteration is possible.\n\n New in version 2.6.\n\nThe membership test operators (``in`` and ``not in``) are normally\nimplemented as an iteration through a sequence. However, container\nobjects can supply the following special method with a more efficient\nimplementation, which also does not require the object be a sequence.\n\nobject.__contains__(self, item)\n\n Called to implement membership test operators. Should return true\n if *item* is in *self*, false otherwise. For mapping objects, this\n should consider the keys of the mapping rather than the values or\n the key-item pairs.\n", 'shifting': u'\nShifting operations\n*******************\n\nThe shifting operations have lower priority than the arithmetic\noperations:\n\n shift_expr ::= a_expr | shift_expr ( "<<" | ">>" ) a_expr\n\nThese operators accept plain or long integers as arguments. The\narguments are converted to a common type. They shift the first\nargument to the left or right by the number of bits given by the\nsecond argument.\n\nA right shift by *n* bits is defined as division by ``pow(2, n)``. A\nleft shift by *n* bits is defined as multiplication with ``pow(2,\nn)``. Negative shift counts raise a ``ValueError`` exception.\n', 'slicings': u'\nSlicings\n********\n\nA slicing selects a range of items in a sequence object (e.g., a\nstring, tuple or list). Slicings may be used as expressions or as\ntargets in assignment or ``del`` statements. The syntax for a\nslicing:\n\n slicing ::= simple_slicing | extended_slicing\n simple_slicing ::= primary "[" short_slice "]"\n extended_slicing ::= primary "[" slice_list "]"\n slice_list ::= slice_item ("," slice_item)* [","]\n slice_item ::= expression | proper_slice | ellipsis\n proper_slice ::= short_slice | long_slice\n short_slice ::= [lower_bound] ":" [upper_bound]\n long_slice ::= short_slice ":" [stride]\n lower_bound ::= expression\n upper_bound ::= expression\n stride ::= expression\n ellipsis ::= "..."\n\nThere is ambiguity in the formal syntax here: anything that looks like\nan expression list also looks like a slice list, so any subscription\ncan be interpreted as a slicing. Rather than further complicating the\nsyntax, this is disambiguated by defining that in this case the\ninterpretation as a subscription takes priority over the\ninterpretation as a slicing (this is the case if the slice list\ncontains no proper slice nor ellipses). Similarly, when the slice\nlist has exactly one short slice and no trailing comma, the\ninterpretation as a simple slicing takes priority over that as an\nextended slicing.\n\nThe semantics for a simple slicing are as follows. The primary must\nevaluate to a sequence object. The lower and upper bound expressions,\nif present, must evaluate to plain integers; defaults are zero and the\n``sys.maxint``, respectively. If either bound is negative, the\nsequence\'s length is added to it. The slicing now selects all items\nwith index *k* such that ``i <= k < j`` where *i* and *j* are the\nspecified lower and upper bounds. This may be an empty sequence. It\nis not an error if *i* or *j* lie outside the range of valid indexes\n(such items don\'t exist so they aren\'t selected).\n\nThe semantics for an extended slicing are as follows. The primary\nmust evaluate to a mapping object, and it is indexed with a key that\nis constructed from the slice list, as follows. If the slice list\ncontains at least one comma, the key is a tuple containing the\nconversion of the slice items; otherwise, the conversion of the lone\nslice item is the key. The conversion of a slice item that is an\nexpression is that expression. The conversion of an ellipsis slice\nitem is the built-in ``Ellipsis`` object. The conversion of a proper\nslice is a slice object (see section *The standard type hierarchy*)\nwhose ``start``, ``stop`` and ``step`` attributes are the values of\nthe expressions given as lower bound, upper bound and stride,\nrespectively, substituting ``None`` for missing expressions.\n', - 'specialattrs': u"\nSpecial Attributes\n******************\n\nThe implementation adds a few special read-only attributes to several\nobject types, where they are relevant. Some of these are not reported\nby the ``dir()`` built-in function.\n\nobject.__dict__\n\n A dictionary or other mapping object used to store an object's\n (writable) attributes.\n\nobject.__methods__\n\n Deprecated in version 2.2: Use the built-in function ``dir()`` to\n get a list of an object's attributes. This attribute is no longer\n available.\n\nobject.__members__\n\n Deprecated in version 2.2: Use the built-in function ``dir()`` to\n get a list of an object's attributes. This attribute is no longer\n available.\n\ninstance.__class__\n\n The class to which a class instance belongs.\n\nclass.__bases__\n\n The tuple of base classes of a class object. If there are no base\n classes, this will be an empty tuple.\n\nclass.__name__\n\n The name of the class or type.\n\n-[ Footnotes ]-\n\n[1] Additional information on these special methods may be found in\n the Python Reference Manual (*Basic customization*).\n\n[2] As a consequence, the list ``[1, 2]`` is considered equal to\n ``[1.0, 2.0]``, and similarly for tuples.\n\n[3] They must have since the parser can't tell the type of the\n operands.\n\n[4] To format only a tuple you should therefore provide a singleton\n tuple whose only element is the tuple to be formatted.\n\n[5] These numbers are fairly arbitrary. They are intended to avoid\n printing endless strings of meaningless digits without hampering\n correct use and without having to know the exact precision of\n floating point values on a particular machine.\n\n[6] The advantage of leaving the newline on is that returning an empty\n string is then an unambiguous EOF indication. It is also possible\n (in cases where it might matter, for example, if you want to make\n an exact copy of a file while scanning its lines) to tell whether\n the last line of a file ended in a newline or not (yes this\n happens!).\n", - 'specialnames': u'\nSpecial method names\n********************\n\nA class can implement certain operations that are invoked by special\nsyntax (such as arithmetic operations or subscripting and slicing) by\ndefining methods with special names. This is Python\'s approach to\n*operator overloading*, allowing classes to define their own behavior\nwith respect to language operators. For instance, if a class defines\na method named ``__getitem__()``, and ``x`` is an instance of this\nclass, then ``x[i]`` is equivalent [2] to ``x.__getitem__(i)``.\nExcept where mentioned, attempts to execute an operation raise an\nexception when no appropriate method is defined.\n\nFor new-style classes, special methods are only guaranteed to work if\ndefined in an object\'s class, not in the object\'s instance dictionary.\nThat explains why this won\'t work:\n\n >>> class C:\n ... pass\n ...\n >>> c = C()\n >>> c.__len__ = lambda: 5\n >>> len(c)\n Traceback (most recent call last):\n File "", line 1, in \n TypeError: object of type \'C\' has no len()\n\nWhen implementing a class that emulates any built-in type, it is\nimportant that the emulation only be implemented to the degree that it\nmakes sense for the object being modelled. For example, some\nsequences may work well with retrieval of individual elements, but\nextracting a slice may not make sense. (One example of this is the\n``NodeList`` interface in the W3C\'s Document Object Model.)\n\n\nBasic customization\n===================\n\nobject.__new__(cls[, ...])\n\n Called to create a new instance of class *cls*. ``__new__()`` is a\n static method (special-cased so you need not declare it as such)\n that takes the class of which an instance was requested as its\n first argument. The remaining arguments are those passed to the\n object constructor expression (the call to the class). The return\n value of ``__new__()`` should be the new object instance (usually\n an instance of *cls*).\n\n Typical implementations create a new instance of the class by\n invoking the superclass\'s ``__new__()`` method using\n ``super(currentclass, cls).__new__(cls[, ...])`` with appropriate\n arguments and then modifying the newly-created instance as\n necessary before returning it.\n\n If ``__new__()`` returns an instance of *cls*, then the new\n instance\'s ``__init__()`` method will be invoked like\n ``__init__(self[, ...])``, where *self* is the new instance and the\n remaining arguments are the same as were passed to ``__new__()``.\n\n If ``__new__()`` does not return an instance of *cls*, then the new\n instance\'s ``__init__()`` method will not be invoked.\n\n ``__new__()`` is intended mainly to allow subclasses of immutable\n types (like int, str, or tuple) to customize instance creation. It\n is also commonly overridden in custom metaclasses in order to\n customize class creation.\n\nobject.__init__(self[, ...])\n\n Called when the instance is created. The arguments are those\n passed to the class constructor expression. If a base class has an\n ``__init__()`` method, the derived class\'s ``__init__()`` method,\n if any, must explicitly call it to ensure proper initialization of\n the base class part of the instance; for example:\n ``BaseClass.__init__(self, [args...])``. As a special constraint\n on constructors, no value may be returned; doing so will cause a\n ``TypeError`` to be raised at runtime.\n\nobject.__del__(self)\n\n Called when the instance is about to be destroyed. This is also\n called a destructor. If a base class has a ``__del__()`` method,\n the derived class\'s ``__del__()`` method, if any, must explicitly\n call it to ensure proper deletion of the base class part of the\n instance. Note that it is possible (though not recommended!) for\n the ``__del__()`` method to postpone destruction of the instance by\n creating a new reference to it. It may then be called at a later\n time when this new reference is deleted. It is not guaranteed that\n ``__del__()`` methods are called for objects that still exist when\n the interpreter exits.\n\n Note: ``del x`` doesn\'t directly call ``x.__del__()`` --- the former\n decrements the reference count for ``x`` by one, and the latter\n is only called when ``x``\'s reference count reaches zero. Some\n common situations that may prevent the reference count of an\n object from going to zero include: circular references between\n objects (e.g., a doubly-linked list or a tree data structure with\n parent and child pointers); a reference to the object on the\n stack frame of a function that caught an exception (the traceback\n stored in ``sys.exc_traceback`` keeps the stack frame alive); or\n a reference to the object on the stack frame that raised an\n unhandled exception in interactive mode (the traceback stored in\n ``sys.last_traceback`` keeps the stack frame alive). The first\n situation can only be remedied by explicitly breaking the cycles;\n the latter two situations can be resolved by storing ``None`` in\n ``sys.exc_traceback`` or ``sys.last_traceback``. Circular\n references which are garbage are detected when the option cycle\n detector is enabled (it\'s on by default), but can only be cleaned\n up if there are no Python-level ``__del__()`` methods involved.\n Refer to the documentation for the ``gc`` module for more\n information about how ``__del__()`` methods are handled by the\n cycle detector, particularly the description of the ``garbage``\n value.\n\n Warning: Due to the precarious circumstances under which ``__del__()``\n methods are invoked, exceptions that occur during their execution\n are ignored, and a warning is printed to ``sys.stderr`` instead.\n Also, when ``__del__()`` is invoked in response to a module being\n deleted (e.g., when execution of the program is done), other\n globals referenced by the ``__del__()`` method may already have\n been deleted. For this reason, ``__del__()`` methods should do\n the absolute minimum needed to maintain external invariants.\n Starting with version 1.5, Python guarantees that globals whose\n name begins with a single underscore are deleted from their\n module before other globals are deleted; if no other references\n to such globals exist, this may help in assuring that imported\n modules are still available at the time when the ``__del__()``\n method is called.\n\nobject.__repr__(self)\n\n Called by the ``repr()`` built-in function and by string\n conversions (reverse quotes) to compute the "official" string\n representation of an object. If at all possible, this should look\n like a valid Python expression that could be used to recreate an\n object with the same value (given an appropriate environment). If\n this is not possible, a string of the form ``<...some useful\n description...>`` should be returned. The return value must be a\n string object. If a class defines ``__repr__()`` but not\n ``__str__()``, then ``__repr__()`` is also used when an "informal"\n string representation of instances of that class is required.\n\n This is typically used for debugging, so it is important that the\n representation is information-rich and unambiguous.\n\nobject.__str__(self)\n\n Called by the ``str()`` built-in function and by the ``print``\n statement to compute the "informal" string representation of an\n object. This differs from ``__repr__()`` in that it does not have\n to be a valid Python expression: a more convenient or concise\n representation may be used instead. The return value must be a\n string object.\n\nobject.__lt__(self, other)\nobject.__le__(self, other)\nobject.__eq__(self, other)\nobject.__ne__(self, other)\nobject.__gt__(self, other)\nobject.__ge__(self, other)\n\n Added in version 2.1.\n\n These are the so-called "rich comparison" methods, and are called\n for comparison operators in preference to ``__cmp__()`` below. The\n correspondence between operator symbols and method names is as\n follows: ``xy`` call ``x.__ne__(y)``, ``x>y`` calls ``x.__gt__(y)``, and\n ``x>=y`` calls ``x.__ge__(y)``.\n\n A rich comparison method may return the singleton\n ``NotImplemented`` if it does not implement the operation for a\n given pair of arguments. By convention, ``False`` and ``True`` are\n returned for a successful comparison. However, these methods can\n return any value, so if the comparison operator is used in a\n Boolean context (e.g., in the condition of an ``if`` statement),\n Python will call ``bool()`` on the value to determine if the result\n is true or false.\n\n There are no implied relationships among the comparison operators.\n The truth of ``x==y`` does not imply that ``x!=y`` is false.\n Accordingly, when defining ``__eq__()``, one should also define\n ``__ne__()`` so that the operators will behave as expected. See\n the paragraph on ``__hash__()`` for some important notes on\n creating *hashable* objects which support custom comparison\n operations and are usable as dictionary keys.\n\n There are no swapped-argument versions of these methods (to be used\n when the left argument does not support the operation but the right\n argument does); rather, ``__lt__()`` and ``__gt__()`` are each\n other\'s reflection, ``__le__()`` and ``__ge__()`` are each other\'s\n reflection, and ``__eq__()`` and ``__ne__()`` are their own\n reflection.\n\n Arguments to rich comparison methods are never coerced.\n\nobject.__cmp__(self, other)\n\n Called by comparison operations if rich comparison (see above) is\n not defined. Should return a negative integer if ``self < other``,\n zero if ``self == other``, a positive integer if ``self > other``.\n If no ``__cmp__()``, ``__eq__()`` or ``__ne__()`` operation is\n defined, class instances are compared by object identity\n ("address"). See also the description of ``__hash__()`` for some\n important notes on creating *hashable* objects which support custom\n comparison operations and are usable as dictionary keys. (Note: the\n restriction that exceptions are not propagated by ``__cmp__()`` has\n been removed since Python 1.5.)\n\nobject.__rcmp__(self, other)\n\n Changed in version 2.1: No longer supported.\n\nobject.__hash__(self)\n\n Called for the key object for dictionary operations, and by the\n built-in function ``hash()``. Should return an integer usable as a\n hash value for dictionary operations. The only required property\n is that objects which compare equal have the same hash value; it is\n advised to somehow mix together (e.g., using exclusive or) the hash\n values for the components of the object that also play a part in\n comparison of objects.\n\n If a class does not define a ``__cmp__()`` or ``__eq__()`` method\n it should not define a ``__hash__()`` operation either; if it\n defines ``__cmp__()`` or ``__eq__()`` but not ``__hash__()``, its\n instances will not be usable as dictionary keys. If a class\n defines mutable objects and implements a ``__cmp__()`` or\n ``__eq__()`` method, it should not implement ``__hash__()``, since\n the dictionary implementation requires that a key\'s hash value is\n immutable (if the object\'s hash value changes, it will be in the\n wrong hash bucket).\n\n User-defined classes have ``__cmp__()`` and ``__hash__()`` methods\n by default; with them, all objects compare unequal and\n ``x.__hash__()`` returns ``id(x)``.\n\n Changed in version 2.5: ``__hash__()`` may now also return a long\n integer object; the 32-bit integer is then derived from the hash of\n that object.\n\nobject.__nonzero__(self)\n\n Called to implement truth value testing, and the built-in operation\n ``bool()``; should return ``False`` or ``True``, or their integer\n equivalents ``0`` or ``1``. When this method is not defined,\n ``__len__()`` is called, if it is defined (see below). If a class\n defines neither ``__len__()`` nor ``__nonzero__()``, all its\n instances are considered true.\n\nobject.__unicode__(self)\n\n Called to implement ``unicode()`` builtin; should return a Unicode\n object. When this method is not defined, string conversion is\n attempted, and the result of string conversion is converted to\n Unicode using the system default encoding.\n\n\nCustomizing attribute access\n============================\n\nThe following methods can be defined to customize the meaning of\nattribute access (use of, assignment to, or deletion of ``x.name``)\nfor class instances.\n\nobject.__getattr__(self, name)\n\n Called when an attribute lookup has not found the attribute in the\n usual places (i.e. it is not an instance attribute nor is it found\n in the class tree for ``self``). ``name`` is the attribute name.\n This method should return the (computed) attribute value or raise\n an ``AttributeError`` exception.\n\n Note that if the attribute is found through the normal mechanism,\n ``__getattr__()`` is not called. (This is an intentional asymmetry\n between ``__getattr__()`` and ``__setattr__()``.) This is done both\n for efficiency reasons and because otherwise ``__setattr__()``\n would have no way to access other attributes of the instance. Note\n that at least for instance variables, you can fake total control by\n not inserting any values in the instance attribute dictionary (but\n instead inserting them in another object). See the\n ``__getattribute__()`` method below for a way to actually get total\n control in new-style classes.\n\nobject.__setattr__(self, name, value)\n\n Called when an attribute assignment is attempted. This is called\n instead of the normal mechanism (i.e. store the value in the\n instance dictionary). *name* is the attribute name, *value* is the\n value to be assigned to it.\n\n If ``__setattr__()`` wants to assign to an instance attribute, it\n should not simply execute ``self.name = value`` --- this would\n cause a recursive call to itself. Instead, it should insert the\n value in the dictionary of instance attributes, e.g.,\n ``self.__dict__[name] = value``. For new-style classes, rather\n than accessing the instance dictionary, it should call the base\n class method with the same name, for example,\n ``object.__setattr__(self, name, value)``.\n\nobject.__delattr__(self, name)\n\n Like ``__setattr__()`` but for attribute deletion instead of\n assignment. This should only be implemented if ``del obj.name`` is\n meaningful for the object.\n\n\nMore attribute access for new-style classes\n-------------------------------------------\n\nThe following methods only apply to new-style classes.\n\nobject.__getattribute__(self, name)\n\n Called unconditionally to implement attribute accesses for\n instances of the class. If the class also defines\n ``__getattr__()``, the latter will not be called unless\n ``__getattribute__()`` either calls it explicitly or raises an\n ``AttributeError``. This method should return the (computed)\n attribute value or raise an ``AttributeError`` exception. In order\n to avoid infinite recursion in this method, its implementation\n should always call the base class method with the same name to\n access any attributes it needs, for example,\n ``object.__getattribute__(self, name)``.\n\n\nImplementing Descriptors\n------------------------\n\nThe following methods only apply when an instance of the class\ncontaining the method (a so-called *descriptor* class) appears in the\nclass dictionary of another new-style class, known as the *owner*\nclass. In the examples below, "the attribute" refers to the attribute\nwhose name is the key of the property in the owner class\'\n``__dict__``. Descriptors can only be implemented as new-style\nclasses themselves.\n\nobject.__get__(self, instance, owner)\n\n Called to get the attribute of the owner class (class attribute\n access) or of an instance of that class (instance attribute\n access). *owner* is always the owner class, while *instance* is the\n instance that the attribute was accessed through, or ``None`` when\n the attribute is accessed through the *owner*. This method should\n return the (computed) attribute value or raise an\n ``AttributeError`` exception.\n\nobject.__set__(self, instance, value)\n\n Called to set the attribute on an instance *instance* of the owner\n class to a new value, *value*.\n\nobject.__delete__(self, instance)\n\n Called to delete the attribute on an instance *instance* of the\n owner class.\n\n\nInvoking Descriptors\n--------------------\n\nIn general, a descriptor is an object attribute with "binding\nbehavior", one whose attribute access has been overridden by methods\nin the descriptor protocol: ``__get__()``, ``__set__()``, and\n``__delete__()``. If any of those methods are defined for an object,\nit is said to be a descriptor.\n\nThe default behavior for attribute access is to get, set, or delete\nthe attribute from an object\'s dictionary. For instance, ``a.x`` has a\nlookup chain starting with ``a.__dict__[\'x\']``, then\n``type(a).__dict__[\'x\']``, and continuing through the base classes of\n``type(a)`` excluding metaclasses.\n\nHowever, if the looked-up value is an object defining one of the\ndescriptor methods, then Python may override the default behavior and\ninvoke the descriptor method instead. Where this occurs in the\nprecedence chain depends on which descriptor methods were defined and\nhow they were called. Note that descriptors are only invoked for new\nstyle objects or classes (ones that subclass ``object()`` or\n``type()``).\n\nThe starting point for descriptor invocation is a binding, ``a.x``.\nHow the arguments are assembled depends on ``a``:\n\nDirect Call\n The simplest and least common call is when user code directly\n invokes a descriptor method: ``x.__get__(a)``.\n\nInstance Binding\n If binding to a new-style object instance, ``a.x`` is transformed\n into the call: ``type(a).__dict__[\'x\'].__get__(a, type(a))``.\n\nClass Binding\n If binding to a new-style class, ``A.x`` is transformed into the\n call: ``A.__dict__[\'x\'].__get__(None, A)``.\n\nSuper Binding\n If ``a`` is an instance of ``super``, then the binding ``super(B,\n obj).m()`` searches ``obj.__class__.__mro__`` for the base class\n ``A`` immediately preceding ``B`` and then invokes the descriptor\n with the call: ``A.__dict__[\'m\'].__get__(obj, A)``.\n\nFor instance bindings, the precedence of descriptor invocation depends\non the which descriptor methods are defined. Normally, data\ndescriptors define both ``__get__()`` and ``__set__()``, while non-\ndata descriptors have just the ``__get__()`` method. Data descriptors\nalways override a redefinition in an instance dictionary. In\ncontrast, non-data descriptors can be overridden by instances. [3]\n\nPython methods (including ``staticmethod()`` and ``classmethod()``)\nare implemented as non-data descriptors. Accordingly, instances can\nredefine and override methods. This allows individual instances to\nacquire behaviors that differ from other instances of the same class.\n\nThe ``property()`` function is implemented as a data descriptor.\nAccordingly, instances cannot override the behavior of a property.\n\n\n__slots__\n---------\n\nBy default, instances of both old and new-style classes have a\ndictionary for attribute storage. This wastes space for objects\nhaving very few instance variables. The space consumption can become\nacute when creating large numbers of instances.\n\nThe default can be overridden by defining *__slots__* in a new-style\nclass definition. The *__slots__* declaration takes a sequence of\ninstance variables and reserves just enough space in each instance to\nhold a value for each variable. Space is saved because *__dict__* is\nnot created for each instance.\n\n__slots__\n\n This class variable can be assigned a string, iterable, or sequence\n of strings with variable names used by instances. If defined in a\n new-style class, *__slots__* reserves space for the declared\n variables and prevents the automatic creation of *__dict__* and\n *__weakref__* for each instance.\n\n Added in version 2.2.\n\nNotes on using *__slots__*\n\n* Without a *__dict__* variable, instances cannot be assigned new\n variables not listed in the *__slots__* definition. Attempts to\n assign to an unlisted variable name raises ``AttributeError``. If\n dynamic assignment of new variables is desired, then add\n ``\'__dict__\'`` to the sequence of strings in the *__slots__*\n declaration.\n\n Changed in version 2.3: Previously, adding ``\'__dict__\'`` to the\n *__slots__* declaration would not enable the assignment of new\n attributes not specifically listed in the sequence of instance\n variable names.\n\n* Without a *__weakref__* variable for each instance, classes defining\n *__slots__* do not support weak references to its instances. If weak\n reference support is needed, then add ``\'__weakref__\'`` to the\n sequence of strings in the *__slots__* declaration.\n\n Changed in version 2.3: Previously, adding ``\'__weakref__\'`` to the\n *__slots__* declaration would not enable support for weak\n references.\n\n* *__slots__* are implemented at the class level by creating\n descriptors (*Implementing Descriptors*) for each variable name. As\n a result, class attributes cannot be used to set default values for\n instance variables defined by *__slots__*; otherwise, the class\n attribute would overwrite the descriptor assignment.\n\n* If a class defines a slot also defined in a base class, the instance\n variable defined by the base class slot is inaccessible (except by\n retrieving its descriptor directly from the base class). This\n renders the meaning of the program undefined. In the future, a\n check may be added to prevent this.\n\n* The action of a *__slots__* declaration is limited to the class\n where it is defined. As a result, subclasses will have a *__dict__*\n unless they also define *__slots__*.\n\n* *__slots__* do not work for classes derived from "variable-length"\n built-in types such as ``long``, ``str`` and ``tuple``.\n\n* Any non-string iterable may be assigned to *__slots__*. Mappings may\n also be used; however, in the future, special meaning may be\n assigned to the values corresponding to each key.\n\n* *__class__* assignment works only if both classes have the same\n *__slots__*.\n\n Changed in version 2.6: Previously, *__class__* assignment raised an\n error if either new or old class had *__slots__*.\n\n\nCustomizing class creation\n==========================\n\nBy default, new-style classes are constructed using ``type()``. A\nclass definition is read into a separate namespace and the value of\nclass name is bound to the result of ``type(name, bases, dict)``.\n\nWhen the class definition is read, if *__metaclass__* is defined then\nthe callable assigned to it will be called instead of ``type()``. This\nallows classes or functions to be written which monitor or alter the\nclass creation process:\n\n* Modifying the class dictionary prior to the class being created.\n\n* Returning an instance of another class -- essentially performing the\n role of a factory function.\n\nThese steps will have to be performed in the metaclass\'s ``__new__()``\nmethod -- ``type.__new__()`` can then be called from this method to\ncreate a class with different properties. This example adds a new\nelement to the class dictionary before creating the class:\n\n class metacls(type):\n def __new__(mcs, name, bases, dict):\n dict[\'foo\'] = \'metacls was here\'\n return type.__new__(mcs, name, bases, dict)\n\nYou can of course also override other class methods (or add new\nmethods); for example defining a custom ``__call__()`` method in the\nmetaclass allows custom behavior when the class is called, e.g. not\nalways creating a new instance.\n\n__metaclass__\n\n This variable can be any callable accepting arguments for ``name``,\n ``bases``, and ``dict``. Upon class creation, the callable is used\n instead of the built-in ``type()``.\n\n Added in version 2.2.\n\nThe appropriate metaclass is determined by the following precedence\nrules:\n\n* If ``dict[\'__metaclass__\']`` exists, it is used.\n\n* Otherwise, if there is at least one base class, its metaclass is\n used (this looks for a *__class__* attribute first and if not found,\n uses its type).\n\n* Otherwise, if a global variable named __metaclass__ exists, it is\n used.\n\n* Otherwise, the old-style, classic metaclass (types.ClassType) is\n used.\n\nThe potential uses for metaclasses are boundless. Some ideas that have\nbeen explored including logging, interface checking, automatic\ndelegation, automatic property creation, proxies, frameworks, and\nautomatic resource locking/synchronization.\n\n\nEmulating callable objects\n==========================\n\nobject.__call__(self[, args...])\n\n Called when the instance is "called" as a function; if this method\n is defined, ``x(arg1, arg2, ...)`` is a shorthand for\n ``x.__call__(arg1, arg2, ...)``.\n\n\nEmulating container types\n=========================\n\nThe following methods can be defined to implement container objects.\nContainers usually are sequences (such as lists or tuples) or mappings\n(like dictionaries), but can represent other containers as well. The\nfirst set of methods is used either to emulate a sequence or to\nemulate a mapping; the difference is that for a sequence, the\nallowable keys should be the integers *k* for which ``0 <= k < N``\nwhere *N* is the length of the sequence, or slice objects, which\ndefine a range of items. (For backwards compatibility, the method\n``__getslice__()`` (see below) can also be defined to handle simple,\nbut not extended slices.) It is also recommended that mappings provide\nthe methods ``keys()``, ``values()``, ``items()``, ``has_key()``,\n``get()``, ``clear()``, ``setdefault()``, ``iterkeys()``,\n``itervalues()``, ``iteritems()``, ``pop()``, ``popitem()``,\n``copy()``, and ``update()`` behaving similar to those for Python\'s\nstandard dictionary objects. The ``UserDict`` module provides a\n``DictMixin`` class to help create those methods from a base set of\n``__getitem__()``, ``__setitem__()``, ``__delitem__()``, and\n``keys()``. Mutable sequences should provide methods ``append()``,\n``count()``, ``index()``, ``extend()``, ``insert()``, ``pop()``,\n``remove()``, ``reverse()`` and ``sort()``, like Python standard list\nobjects. Finally, sequence types should implement addition (meaning\nconcatenation) and multiplication (meaning repetition) by defining the\nmethods ``__add__()``, ``__radd__()``, ``__iadd__()``, ``__mul__()``,\n``__rmul__()`` and ``__imul__()`` described below; they should not\ndefine ``__coerce__()`` or other numerical operators. It is\nrecommended that both mappings and sequences implement the\n``__contains__()`` method to allow efficient use of the ``in``\noperator; for mappings, ``in`` should be equivalent of ``has_key()``;\nfor sequences, it should search through the values. It is further\nrecommended that both mappings and sequences implement the\n``__iter__()`` method to allow efficient iteration through the\ncontainer; for mappings, ``__iter__()`` should be the same as\n``iterkeys()``; for sequences, it should iterate through the values.\n\nobject.__len__(self)\n\n Called to implement the built-in function ``len()``. Should return\n the length of the object, an integer ``>=`` 0. Also, an object\n that doesn\'t define a ``__nonzero__()`` method and whose\n ``__len__()`` method returns zero is considered to be false in a\n Boolean context.\n\nobject.__getitem__(self, key)\n\n Called to implement evaluation of ``self[key]``. For sequence\n types, the accepted keys should be integers and slice objects.\n Note that the special interpretation of negative indexes (if the\n class wishes to emulate a sequence type) is up to the\n ``__getitem__()`` method. If *key* is of an inappropriate type,\n ``TypeError`` may be raised; if of a value outside the set of\n indexes for the sequence (after any special interpretation of\n negative values), ``IndexError`` should be raised. For mapping\n types, if *key* is missing (not in the container), ``KeyError``\n should be raised.\n\n Note: ``for`` loops expect that an ``IndexError`` will be raised for\n illegal indexes to allow proper detection of the end of the\n sequence.\n\nobject.__setitem__(self, key, value)\n\n Called to implement assignment to ``self[key]``. Same note as for\n ``__getitem__()``. This should only be implemented for mappings if\n the objects support changes to the values for keys, or if new keys\n can be added, or for sequences if elements can be replaced. The\n same exceptions should be raised for improper *key* values as for\n the ``__getitem__()`` method.\n\nobject.__delitem__(self, key)\n\n Called to implement deletion of ``self[key]``. Same note as for\n ``__getitem__()``. This should only be implemented for mappings if\n the objects support removal of keys, or for sequences if elements\n can be removed from the sequence. The same exceptions should be\n raised for improper *key* values as for the ``__getitem__()``\n method.\n\nobject.__iter__(self)\n\n This method is called when an iterator is required for a container.\n This method should return a new iterator object that can iterate\n over all the objects in the container. For mappings, it should\n iterate over the keys of the container, and should also be made\n available as the method ``iterkeys()``.\n\n Iterator objects also need to implement this method; they are\n required to return themselves. For more information on iterator\n objects, see *Iterator Types*.\n\nobject.__reversed__(self)\n\n Called (if present) by the ``reversed()`` builtin to implement\n reverse iteration. It should return a new iterator object that\n iterates over all the objects in the container in reverse order.\n\n If the ``__reversed__()`` method is not provided, the\n ``reversed()`` builtin will fall back to using the sequence\n protocol (``__len__()`` and ``__getitem__()``). Objects should\n normally only provide ``__reversed__()`` if they do not support the\n sequence protocol and an efficient implementation of reverse\n iteration is possible.\n\n Added in version 2.6.\n\nThe membership test operators (``in`` and ``not in``) are normally\nimplemented as an iteration through a sequence. However, container\nobjects can supply the following special method with a more efficient\nimplementation, which also does not require the object be a sequence.\n\nobject.__contains__(self, item)\n\n Called to implement membership test operators. Should return true\n if *item* is in *self*, false otherwise. For mapping objects, this\n should consider the keys of the mapping rather than the values or\n the key-item pairs.\n\n\nAdditional methods for emulation of sequence types\n==================================================\n\nThe following optional methods can be defined to further emulate\nsequence objects. Immutable sequences methods should at most only\ndefine ``__getslice__()``; mutable sequences might define all three\nmethods.\n\nobject.__getslice__(self, i, j)\n\n Deprecated in version 2.0: Support slice objects as parameters to\n the ``__getitem__()`` method. (However, built-in types in CPython\n currently still implement ``__getslice__()``. Therefore, you have\n to override it in derived classes when implementing slicing.)\n\n Called to implement evaluation of ``self[i:j]``. The returned\n object should be of the same type as *self*. Note that missing *i*\n or *j* in the slice expression are replaced by zero or\n ``sys.maxint``, respectively. If negative indexes are used in the\n slice, the length of the sequence is added to that index. If the\n instance does not implement the ``__len__()`` method, an\n ``AttributeError`` is raised. No guarantee is made that indexes\n adjusted this way are not still negative. Indexes which are\n greater than the length of the sequence are not modified. If no\n ``__getslice__()`` is found, a slice object is created instead, and\n passed to ``__getitem__()`` instead.\n\nobject.__setslice__(self, i, j, sequence)\n\n Called to implement assignment to ``self[i:j]``. Same notes for *i*\n and *j* as for ``__getslice__()``.\n\n This method is deprecated. If no ``__setslice__()`` is found, or\n for extended slicing of the form ``self[i:j:k]``, a slice object is\n created, and passed to ``__setitem__()``, instead of\n ``__setslice__()`` being called.\n\nobject.__delslice__(self, i, j)\n\n Called to implement deletion of ``self[i:j]``. Same notes for *i*\n and *j* as for ``__getslice__()``. This method is deprecated. If no\n ``__delslice__()`` is found, or for extended slicing of the form\n ``self[i:j:k]``, a slice object is created, and passed to\n ``__delitem__()``, instead of ``__delslice__()`` being called.\n\nNotice that these methods are only invoked when a single slice with a\nsingle colon is used, and the slice method is available. For slice\noperations involving extended slice notation, or in absence of the\nslice methods, ``__getitem__()``, ``__setitem__()`` or\n``__delitem__()`` is called with a slice object as argument.\n\nThe following example demonstrate how to make your program or module\ncompatible with earlier versions of Python (assuming that methods\n``__getitem__()``, ``__setitem__()`` and ``__delitem__()`` support\nslice objects as arguments):\n\n class MyClass:\n ...\n def __getitem__(self, index):\n ...\n def __setitem__(self, index, value):\n ...\n def __delitem__(self, index):\n ...\n\n if sys.version_info < (2, 0):\n # They won\'t be defined if version is at least 2.0 final\n\n def __getslice__(self, i, j):\n return self[max(0, i):max(0, j):]\n def __setslice__(self, i, j, seq):\n self[max(0, i):max(0, j):] = seq\n def __delslice__(self, i, j):\n del self[max(0, i):max(0, j):]\n ...\n\nNote the calls to ``max()``; these are necessary because of the\nhandling of negative indices before the ``__*slice__()`` methods are\ncalled. When negative indexes are used, the ``__*item__()`` methods\nreceive them as provided, but the ``__*slice__()`` methods get a\n"cooked" form of the index values. For each negative index value, the\nlength of the sequence is added to the index before calling the method\n(which may still result in a negative index); this is the customary\nhandling of negative indexes by the built-in sequence types, and the\n``__*item__()`` methods are expected to do this as well. However,\nsince they should already be doing that, negative indexes cannot be\npassed in; they must be constrained to the bounds of the sequence\nbefore being passed to the ``__*item__()`` methods. Calling ``max(0,\ni)`` conveniently returns the proper value.\n\n\nEmulating numeric types\n=======================\n\nThe following methods can be defined to emulate numeric objects.\nMethods corresponding to operations that are not supported by the\nparticular kind of number implemented (e.g., bitwise operations for\nnon-integral numbers) should be left undefined.\n\nobject.__add__(self, other)\nobject.__sub__(self, other)\nobject.__mul__(self, other)\nobject.__floordiv__(self, other)\nobject.__mod__(self, other)\nobject.__divmod__(self, other)\nobject.__pow__(self, other[, modulo])\nobject.__lshift__(self, other)\nobject.__rshift__(self, other)\nobject.__and__(self, other)\nobject.__xor__(self, other)\nobject.__or__(self, other)\n\n These methods are called to implement the binary arithmetic\n operations (``+``, ``-``, ``*``, ``//``, ``%``, ``divmod()``,\n ``pow()``, ``**``, ``<<``, ``>>``, ``&``, ``^``, ``|``). For\n instance, to evaluate the expression *x*``+``*y*, where *x* is an\n instance of a class that has an ``__add__()`` method,\n ``x.__add__(y)`` is called. The ``__divmod__()`` method should be\n the equivalent to using ``__floordiv__()`` and ``__mod__()``; it\n should not be related to ``__truediv__()`` (described below). Note\n that ``__pow__()`` should be defined to accept an optional third\n argument if the ternary version of the built-in ``pow()`` function\n is to be supported.\n\n If one of those methods does not support the operation with the\n supplied arguments, it should return ``NotImplemented``.\n\nobject.__div__(self, other)\nobject.__truediv__(self, other)\n\n The division operator (``/``) is implemented by these methods. The\n ``__truediv__()`` method is used when ``__future__.division`` is in\n effect, otherwise ``__div__()`` is used. If only one of these two\n methods is defined, the object will not support division in the\n alternate context; ``TypeError`` will be raised instead.\n\nobject.__radd__(self, other)\nobject.__rsub__(self, other)\nobject.__rmul__(self, other)\nobject.__rdiv__(self, other)\nobject.__rtruediv__(self, other)\nobject.__rfloordiv__(self, other)\nobject.__rmod__(self, other)\nobject.__rdivmod__(self, other)\nobject.__rpow__(self, other)\nobject.__rlshift__(self, other)\nobject.__rrshift__(self, other)\nobject.__rand__(self, other)\nobject.__rxor__(self, other)\nobject.__ror__(self, other)\n\n These methods are called to implement the binary arithmetic\n operations (``+``, ``-``, ``*``, ``/``, ``%``, ``divmod()``,\n ``pow()``, ``**``, ``<<``, ``>>``, ``&``, ``^``, ``|``) with\n reflected (swapped) operands. These functions are only called if\n the left operand does not support the corresponding operation and\n the operands are of different types. [4] For instance, to evaluate\n the expression *x*``-``*y*, where *y* is an instance of a class\n that has an ``__rsub__()`` method, ``y.__rsub__(x)`` is called if\n ``x.__sub__(y)`` returns *NotImplemented*.\n\n Note that ternary ``pow()`` will not try calling ``__rpow__()``\n (the coercion rules would become too complicated).\n\n Note: If the right operand\'s type is a subclass of the left operand\'s\n type and that subclass provides the reflected method for the\n operation, this method will be called before the left operand\'s\n non-reflected method. This behavior allows subclasses to\n override their ancestors\' operations.\n\nobject.__iadd__(self, other)\nobject.__isub__(self, other)\nobject.__imul__(self, other)\nobject.__idiv__(self, other)\nobject.__itruediv__(self, other)\nobject.__ifloordiv__(self, other)\nobject.__imod__(self, other)\nobject.__ipow__(self, other[, modulo])\nobject.__ilshift__(self, other)\nobject.__irshift__(self, other)\nobject.__iand__(self, other)\nobject.__ixor__(self, other)\nobject.__ior__(self, other)\n\n These methods are called to implement the augmented arithmetic\n operations (``+=``, ``-=``, ``*=``, ``/=``, ``//=``, ``%=``,\n ``**=``, ``<<=``, ``>>=``, ``&=``, ``^=``, ``|=``). These methods\n should attempt to do the operation in-place (modifying *self*) and\n return the result (which could be, but does not have to be,\n *self*). If a specific method is not defined, the augmented\n operation falls back to the normal methods. For instance, to\n evaluate the expression *x*``+=``*y*, where *x* is an instance of a\n class that has an ``__iadd__()`` method, ``x.__iadd__(y)`` is\n called. If *x* is an instance of a class that does not define a\n ``__iadd__()`` method, ``x.__add__(y)`` and ``y.__radd__(x)`` are\n considered, as with the evaluation of *x*``+``*y*.\n\nobject.__neg__(self)\nobject.__pos__(self)\nobject.__abs__(self)\nobject.__invert__(self)\n\n Called to implement the unary arithmetic operations (``-``, ``+``,\n ``abs()`` and ``~``).\n\nobject.__complex__(self)\nobject.__int__(self)\nobject.__long__(self)\nobject.__float__(self)\n\n Called to implement the built-in functions ``complex()``,\n ``int()``, ``long()``, and ``float()``. Should return a value of\n the appropriate type.\n\nobject.__oct__(self)\nobject.__hex__(self)\n\n Called to implement the built-in functions ``oct()`` and ``hex()``.\n Should return a string value.\n\nobject.__index__(self)\n\n Called to implement ``operator.index()``. Also called whenever\n Python needs an integer object (such as in slicing). Must return\n an integer (int or long).\n\n Added in version 2.5.\n\nobject.__coerce__(self, other)\n\n Called to implement "mixed-mode" numeric arithmetic. Should either\n return a 2-tuple containing *self* and *other* converted to a\n common numeric type, or ``None`` if conversion is impossible. When\n the common type would be the type of ``other``, it is sufficient to\n return ``None``, since the interpreter will also ask the other\n object to attempt a coercion (but sometimes, if the implementation\n of the other type cannot be changed, it is useful to do the\n conversion to the other type here). A return value of\n ``NotImplemented`` is equivalent to returning ``None``.\n\n\nCoercion rules\n==============\n\nThis section used to document the rules for coercion. As the language\nhas evolved, the coercion rules have become hard to document\nprecisely; documenting what one version of one particular\nimplementation does is undesirable. Instead, here are some informal\nguidelines regarding coercion. In Python 3.0, coercion will not be\nsupported.\n\n* If the left operand of a % operator is a string or Unicode object,\n no coercion takes place and the string formatting operation is\n invoked instead.\n\n* It is no longer recommended to define a coercion operation. Mixed-\n mode operations on types that don\'t define coercion pass the\n original arguments to the operation.\n\n* New-style classes (those derived from ``object``) never invoke the\n ``__coerce__()`` method in response to a binary operator; the only\n time ``__coerce__()`` is invoked is when the built-in function\n ``coerce()`` is called.\n\n* For most intents and purposes, an operator that returns\n ``NotImplemented`` is treated the same as one that is not\n implemented at all.\n\n* Below, ``__op__()`` and ``__rop__()`` are used to signify the\n generic method names corresponding to an operator; ``__iop__()`` is\n used for the corresponding in-place operator. For example, for the\n operator \'``+``\', ``__add__()`` and ``__radd__()`` are used for the\n left and right variant of the binary operator, and ``__iadd__()``\n for the in-place variant.\n\n* For objects *x* and *y*, first ``x.__op__(y)`` is tried. If this is\n not implemented or returns ``NotImplemented``, ``y.__rop__(x)`` is\n tried. If this is also not implemented or returns\n ``NotImplemented``, a ``TypeError`` exception is raised. But see\n the following exception:\n\n* Exception to the previous item: if the left operand is an instance\n of a built-in type or a new-style class, and the right operand is an\n instance of a proper subclass of that type or class and overrides\n the base\'s ``__rop__()`` method, the right operand\'s ``__rop__()``\n method is tried *before* the left operand\'s ``__op__()`` method.\n\n This is done so that a subclass can completely override binary\n operators. Otherwise, the left operand\'s ``__op__()`` method would\n always accept the right operand: when an instance of a given class\n is expected, an instance of a subclass of that class is always\n acceptable.\n\n* When either operand type defines a coercion, this coercion is called\n before that type\'s ``__op__()`` or ``__rop__()`` method is called,\n but no sooner. If the coercion returns an object of a different\n type for the operand whose coercion is invoked, part of the process\n is redone using the new object.\n\n* When an in-place operator (like \'``+=``\') is used, if the left\n operand implements ``__iop__()``, it is invoked without any\n coercion. When the operation falls back to ``__op__()`` and/or\n ``__rop__()``, the normal coercion rules apply.\n\n* In *x*``+``*y*, if *x* is a sequence that implements sequence\n concatenation, sequence concatenation is invoked.\n\n* In *x*``*``*y*, if one operator is a sequence that implements\n sequence repetition, and the other is an integer (``int`` or\n ``long``), sequence repetition is invoked.\n\n* Rich comparisons (implemented by methods ``__eq__()`` and so on)\n never use coercion. Three-way comparison (implemented by\n ``__cmp__()``) does use coercion under the same conditions as other\n binary operations use it.\n\n* In the current implementation, the built-in numeric types ``int``,\n ``long`` and ``float`` do not use coercion; the type ``complex``\n however does use it. The difference can become apparent when\n subclassing these types. Over time, the type ``complex`` may be\n fixed to avoid coercion. All these types implement a\n ``__coerce__()`` method, for use by the built-in ``coerce()``\n function.\n\n\nWith Statement Context Managers\n===============================\n\nAdded in version 2.5.\n\nA *context manager* is an object that defines the runtime context to\nbe established when executing a ``with`` statement. The context\nmanager handles the entry into, and the exit from, the desired runtime\ncontext for the execution of the block of code. Context managers are\nnormally invoked using the ``with`` statement (described in section\n*The with statement*), but can also be used by directly invoking their\nmethods.\n\nTypical uses of context managers include saving and restoring various\nkinds of global state, locking and unlocking resources, closing opened\nfiles, etc.\n\nFor more information on context managers, see *Context Manager Types*.\n\nobject.__enter__(self)\n\n Enter the runtime context related to this object. The ``with``\n statement will bind this method\'s return value to the target(s)\n specified in the ``as`` clause of the statement, if any.\n\nobject.__exit__(self, exc_type, exc_value, traceback)\n\n Exit the runtime context related to this object. The parameters\n describe the exception that caused the context to be exited. If the\n context was exited without an exception, all three arguments will\n be ``None``.\n\n If an exception is supplied, and the method wishes to suppress the\n exception (i.e., prevent it from being propagated), it should\n return a true value. Otherwise, the exception will be processed\n normally upon exit from this method.\n\n Note that ``__exit__()`` methods should not reraise the passed-in\n exception; this is the caller\'s responsibility.\n\nSee also:\n\n **PEP 0343** - The "with" statement\n The specification, background, and examples for the Python\n ``with`` statement.\n\n-[ Footnotes ]-\n\n[1] Since Python 2.2, a gradual merging of types and classes has been\n started that makes this and a few other assertions made in this\n manual not 100% accurate and complete: for example, it *is* now\n possible in some cases to change an object\'s type, under certain\n controlled conditions. Until this manual undergoes extensive\n revision, it must now be taken as authoritative only regarding\n "classic classes", that are still the default, for compatibility\n purposes, in Python 2.2 and 2.3. For more information, see\n http://www.python.org/doc/newstyle/.\n\n[2] This, and other statements, are only roughly true for instances of\n new-style classes.\n\n[3] A descriptor can define any combination of ``__get__()``,\n ``__set__()`` and ``__delete__()``. If it does not define\n ``__get__()``, then accessing the attribute even on an instance\n will return the descriptor object itself. If the descriptor\n defines ``__set__()`` and/or ``__delete__()``, it is a data\n descriptor; if it defines neither, it is a non-data descriptor.\n\n[4] For operands of the same type, it is assumed that if the non-\n reflected method (such as ``__add__()``) fails the operation is\n not supported, which is why the reflected method is not called.\n', + 'specialattrs': u"\nSpecial Attributes\n******************\n\nThe implementation adds a few special read-only attributes to several\nobject types, where they are relevant. Some of these are not reported\nby the ``dir()`` built-in function.\n\nobject.__dict__\n\n A dictionary or other mapping object used to store an object's\n (writable) attributes.\n\nobject.__methods__\n\n Deprecated since version 2.2: Use the built-in function ``dir()``\n to get a list of an object's attributes. This attribute is no\n longer available.\n\nobject.__members__\n\n Deprecated since version 2.2: Use the built-in function ``dir()``\n to get a list of an object's attributes. This attribute is no\n longer available.\n\ninstance.__class__\n\n The class to which a class instance belongs.\n\nclass.__bases__\n\n The tuple of base classes of a class object. If there are no base\n classes, this will be an empty tuple.\n\nclass.__name__\n\n The name of the class or type.\n\n-[ Footnotes ]-\n\n[1] Additional information on these special methods may be found in\n the Python Reference Manual (*Basic customization*).\n\n[2] As a consequence, the list ``[1, 2]`` is considered equal to\n ``[1.0, 2.0]``, and similarly for tuples.\n\n[3] They must have since the parser can't tell the type of the\n operands.\n\n[4] To format only a tuple you should therefore provide a singleton\n tuple whose only element is the tuple to be formatted.\n\n[5] These numbers are fairly arbitrary. They are intended to avoid\n printing endless strings of meaningless digits without hampering\n correct use and without having to know the exact precision of\n floating point values on a particular machine.\n\n[6] The advantage of leaving the newline on is that returning an empty\n string is then an unambiguous EOF indication. It is also possible\n (in cases where it might matter, for example, if you want to make\n an exact copy of a file while scanning its lines) to tell whether\n the last line of a file ended in a newline or not (yes this\n happens!).\n", + 'specialnames': u'\nSpecial method names\n********************\n\nA class can implement certain operations that are invoked by special\nsyntax (such as arithmetic operations or subscripting and slicing) by\ndefining methods with special names. This is Python\'s approach to\n*operator overloading*, allowing classes to define their own behavior\nwith respect to language operators. For instance, if a class defines\na method named ``__getitem__()``, and ``x`` is an instance of this\nclass, then ``x[i]`` is roughly equivalent to ``x.__getitem__(i)`` for\nold-style classes and ``type(x).__getitem__(x, i)`` for new-style\nclasses. Except where mentioned, attempts to execute an operation\nraise an exception when no appropriate method is defined (typically\n``AttributeError`` or ``TypeError``).\n\nWhen implementing a class that emulates any built-in type, it is\nimportant that the emulation only be implemented to the degree that it\nmakes sense for the object being modelled. For example, some\nsequences may work well with retrieval of individual elements, but\nextracting a slice may not make sense. (One example of this is the\n``NodeList`` interface in the W3C\'s Document Object Model.)\n\n\nBasic customization\n===================\n\nobject.__new__(cls[, ...])\n\n Called to create a new instance of class *cls*. ``__new__()`` is a\n static method (special-cased so you need not declare it as such)\n that takes the class of which an instance was requested as its\n first argument. The remaining arguments are those passed to the\n object constructor expression (the call to the class). The return\n value of ``__new__()`` should be the new object instance (usually\n an instance of *cls*).\n\n Typical implementations create a new instance of the class by\n invoking the superclass\'s ``__new__()`` method using\n ``super(currentclass, cls).__new__(cls[, ...])`` with appropriate\n arguments and then modifying the newly-created instance as\n necessary before returning it.\n\n If ``__new__()`` returns an instance of *cls*, then the new\n instance\'s ``__init__()`` method will be invoked like\n ``__init__(self[, ...])``, where *self* is the new instance and the\n remaining arguments are the same as were passed to ``__new__()``.\n\n If ``__new__()`` does not return an instance of *cls*, then the new\n instance\'s ``__init__()`` method will not be invoked.\n\n ``__new__()`` is intended mainly to allow subclasses of immutable\n types (like int, str, or tuple) to customize instance creation. It\n is also commonly overridden in custom metaclasses in order to\n customize class creation.\n\nobject.__init__(self[, ...])\n\n Called when the instance is created. The arguments are those\n passed to the class constructor expression. If a base class has an\n ``__init__()`` method, the derived class\'s ``__init__()`` method,\n if any, must explicitly call it to ensure proper initialization of\n the base class part of the instance; for example:\n ``BaseClass.__init__(self, [args...])``. As a special constraint\n on constructors, no value may be returned; doing so will cause a\n ``TypeError`` to be raised at runtime.\n\nobject.__del__(self)\n\n Called when the instance is about to be destroyed. This is also\n called a destructor. If a base class has a ``__del__()`` method,\n the derived class\'s ``__del__()`` method, if any, must explicitly\n call it to ensure proper deletion of the base class part of the\n instance. Note that it is possible (though not recommended!) for\n the ``__del__()`` method to postpone destruction of the instance by\n creating a new reference to it. It may then be called at a later\n time when this new reference is deleted. It is not guaranteed that\n ``__del__()`` methods are called for objects that still exist when\n the interpreter exits.\n\n Note: ``del x`` doesn\'t directly call ``x.__del__()`` --- the former\n decrements the reference count for ``x`` by one, and the latter\n is only called when ``x``\'s reference count reaches zero. Some\n common situations that may prevent the reference count of an\n object from going to zero include: circular references between\n objects (e.g., a doubly-linked list or a tree data structure with\n parent and child pointers); a reference to the object on the\n stack frame of a function that caught an exception (the traceback\n stored in ``sys.exc_traceback`` keeps the stack frame alive); or\n a reference to the object on the stack frame that raised an\n unhandled exception in interactive mode (the traceback stored in\n ``sys.last_traceback`` keeps the stack frame alive). The first\n situation can only be remedied by explicitly breaking the cycles;\n the latter two situations can be resolved by storing ``None`` in\n ``sys.exc_traceback`` or ``sys.last_traceback``. Circular\n references which are garbage are detected when the option cycle\n detector is enabled (it\'s on by default), but can only be cleaned\n up if there are no Python-level ``__del__()`` methods involved.\n Refer to the documentation for the ``gc`` module for more\n information about how ``__del__()`` methods are handled by the\n cycle detector, particularly the description of the ``garbage``\n value.\n\n Warning: Due to the precarious circumstances under which ``__del__()``\n methods are invoked, exceptions that occur during their execution\n are ignored, and a warning is printed to ``sys.stderr`` instead.\n Also, when ``__del__()`` is invoked in response to a module being\n deleted (e.g., when execution of the program is done), other\n globals referenced by the ``__del__()`` method may already have\n been deleted. For this reason, ``__del__()`` methods should do\n the absolute minimum needed to maintain external invariants.\n Starting with version 1.5, Python guarantees that globals whose\n name begins with a single underscore are deleted from their\n module before other globals are deleted; if no other references\n to such globals exist, this may help in assuring that imported\n modules are still available at the time when the ``__del__()``\n method is called.\n\nobject.__repr__(self)\n\n Called by the ``repr()`` built-in function and by string\n conversions (reverse quotes) to compute the "official" string\n representation of an object. If at all possible, this should look\n like a valid Python expression that could be used to recreate an\n object with the same value (given an appropriate environment). If\n this is not possible, a string of the form ``<...some useful\n description...>`` should be returned. The return value must be a\n string object. If a class defines ``__repr__()`` but not\n ``__str__()``, then ``__repr__()`` is also used when an "informal"\n string representation of instances of that class is required.\n\n This is typically used for debugging, so it is important that the\n representation is information-rich and unambiguous.\n\nobject.__str__(self)\n\n Called by the ``str()`` built-in function and by the ``print``\n statement to compute the "informal" string representation of an\n object. This differs from ``__repr__()`` in that it does not have\n to be a valid Python expression: a more convenient or concise\n representation may be used instead. The return value must be a\n string object.\n\nobject.__lt__(self, other)\nobject.__le__(self, other)\nobject.__eq__(self, other)\nobject.__ne__(self, other)\nobject.__gt__(self, other)\nobject.__ge__(self, other)\n\n New in version 2.1.\n\n These are the so-called "rich comparison" methods, and are called\n for comparison operators in preference to ``__cmp__()`` below. The\n correspondence between operator symbols and method names is as\n follows: ``xy`` call ``x.__ne__(y)``, ``x>y`` calls ``x.__gt__(y)``, and\n ``x>=y`` calls ``x.__ge__(y)``.\n\n A rich comparison method may return the singleton\n ``NotImplemented`` if it does not implement the operation for a\n given pair of arguments. By convention, ``False`` and ``True`` are\n returned for a successful comparison. However, these methods can\n return any value, so if the comparison operator is used in a\n Boolean context (e.g., in the condition of an ``if`` statement),\n Python will call ``bool()`` on the value to determine if the result\n is true or false.\n\n There are no implied relationships among the comparison operators.\n The truth of ``x==y`` does not imply that ``x!=y`` is false.\n Accordingly, when defining ``__eq__()``, one should also define\n ``__ne__()`` so that the operators will behave as expected. See\n the paragraph on ``__hash__()`` for some important notes on\n creating *hashable* objects which support custom comparison\n operations and are usable as dictionary keys.\n\n There are no swapped-argument versions of these methods (to be used\n when the left argument does not support the operation but the right\n argument does); rather, ``__lt__()`` and ``__gt__()`` are each\n other\'s reflection, ``__le__()`` and ``__ge__()`` are each other\'s\n reflection, and ``__eq__()`` and ``__ne__()`` are their own\n reflection.\n\n Arguments to rich comparison methods are never coerced.\n\nobject.__cmp__(self, other)\n\n Called by comparison operations if rich comparison (see above) is\n not defined. Should return a negative integer if ``self < other``,\n zero if ``self == other``, a positive integer if ``self > other``.\n If no ``__cmp__()``, ``__eq__()`` or ``__ne__()`` operation is\n defined, class instances are compared by object identity\n ("address"). See also the description of ``__hash__()`` for some\n important notes on creating *hashable* objects which support custom\n comparison operations and are usable as dictionary keys. (Note: the\n restriction that exceptions are not propagated by ``__cmp__()`` has\n been removed since Python 1.5.)\n\nobject.__rcmp__(self, other)\n\n Changed in version 2.1: No longer supported.\n\nobject.__hash__(self)\n\n Called for the key object for dictionary operations, and by the\n built-in function ``hash()``. Should return an integer usable as a\n hash value for dictionary operations. The only required property\n is that objects which compare equal have the same hash value; it is\n advised to somehow mix together (e.g., using exclusive or) the hash\n values for the components of the object that also play a part in\n comparison of objects.\n\n If a class does not define a ``__cmp__()`` or ``__eq__()`` method\n it should not define a ``__hash__()`` operation either; if it\n defines ``__cmp__()`` or ``__eq__()`` but not ``__hash__()``, its\n instances will not be usable as dictionary keys. If a class\n defines mutable objects and implements a ``__cmp__()`` or\n ``__eq__()`` method, it should not implement ``__hash__()``, since\n the dictionary implementation requires that a key\'s hash value is\n immutable (if the object\'s hash value changes, it will be in the\n wrong hash bucket).\n\n User-defined classes have ``__cmp__()`` and ``__hash__()`` methods\n by default; with them, all objects compare unequal (except with\n themselves) and ``x.__hash__()`` returns ``id(x)``.\n\n Classes which inherit a ``__hash__()`` method from a parent class\n but change the meaning of ``__cmp__()`` or ``__eq__()`` such that\n the hash value returned is no longer appropriate (e.g. by switching\n to a value-based concept of equality instead of the default\n identity based equality) can explicitly flag themselves as being\n unhashable by setting ``__hash__ = None`` in the class definition.\n Doing so means that not only will instances of the class raise an\n appropriate ``TypeError`` when a program attempts to retrieve their\n hash value, but they will also be correctly identified as\n unhashable when checking ``isinstance(obj, collections.Hashable)``\n (unlike classes which define their own ``__hash__()`` to explicitly\n raise ``TypeError``).\n\n Changed in version 2.5: ``__hash__()`` may now also return a long\n integer object; the 32-bit integer is then derived from the hash of\n that object.\n\n Changed in version 2.6: ``__hash__`` may now be set to ``None`` to\n explicitly flag instances of a class as unhashable.\n\nobject.__nonzero__(self)\n\n Called to implement truth value testing, and the built-in operation\n ``bool()``; should return ``False`` or ``True``, or their integer\n equivalents ``0`` or ``1``. When this method is not defined,\n ``__len__()`` is called, if it is defined (see below). If a class\n defines neither ``__len__()`` nor ``__nonzero__()``, all its\n instances are considered true.\n\nobject.__unicode__(self)\n\n Called to implement ``unicode()`` builtin; should return a Unicode\n object. When this method is not defined, string conversion is\n attempted, and the result of string conversion is converted to\n Unicode using the system default encoding.\n\n\nCustomizing attribute access\n============================\n\nThe following methods can be defined to customize the meaning of\nattribute access (use of, assignment to, or deletion of ``x.name``)\nfor class instances.\n\nobject.__getattr__(self, name)\n\n Called when an attribute lookup has not found the attribute in the\n usual places (i.e. it is not an instance attribute nor is it found\n in the class tree for ``self``). ``name`` is the attribute name.\n This method should return the (computed) attribute value or raise\n an ``AttributeError`` exception.\n\n Note that if the attribute is found through the normal mechanism,\n ``__getattr__()`` is not called. (This is an intentional asymmetry\n between ``__getattr__()`` and ``__setattr__()``.) This is done both\n for efficiency reasons and because otherwise ``__getattr__()``\n would have no way to access other attributes of the instance. Note\n that at least for instance variables, you can fake total control by\n not inserting any values in the instance attribute dictionary (but\n instead inserting them in another object). See the\n ``__getattribute__()`` method below for a way to actually get total\n control in new-style classes.\n\nobject.__setattr__(self, name, value)\n\n Called when an attribute assignment is attempted. This is called\n instead of the normal mechanism (i.e. store the value in the\n instance dictionary). *name* is the attribute name, *value* is the\n value to be assigned to it.\n\n If ``__setattr__()`` wants to assign to an instance attribute, it\n should not simply execute ``self.name = value`` --- this would\n cause a recursive call to itself. Instead, it should insert the\n value in the dictionary of instance attributes, e.g.,\n ``self.__dict__[name] = value``. For new-style classes, rather\n than accessing the instance dictionary, it should call the base\n class method with the same name, for example,\n ``object.__setattr__(self, name, value)``.\n\nobject.__delattr__(self, name)\n\n Like ``__setattr__()`` but for attribute deletion instead of\n assignment. This should only be implemented if ``del obj.name`` is\n meaningful for the object.\n\n\nMore attribute access for new-style classes\n-------------------------------------------\n\nThe following methods only apply to new-style classes.\n\nobject.__getattribute__(self, name)\n\n Called unconditionally to implement attribute accesses for\n instances of the class. If the class also defines\n ``__getattr__()``, the latter will not be called unless\n ``__getattribute__()`` either calls it explicitly or raises an\n ``AttributeError``. This method should return the (computed)\n attribute value or raise an ``AttributeError`` exception. In order\n to avoid infinite recursion in this method, its implementation\n should always call the base class method with the same name to\n access any attributes it needs, for example,\n ``object.__getattribute__(self, name)``.\n\n Note: This method may still be bypassed when looking up special methods\n as the result of implicit invocation via language syntax or\n builtin functions. See *Special method lookup for new-style\n classes*.\n\n\nImplementing Descriptors\n------------------------\n\nThe following methods only apply when an instance of the class\ncontaining the method (a so-called *descriptor* class) appears in the\nclass dictionary of another new-style class, known as the *owner*\nclass. In the examples below, "the attribute" refers to the attribute\nwhose name is the key of the property in the owner class\'\n``__dict__``. Descriptors can only be implemented as new-style\nclasses themselves.\n\nobject.__get__(self, instance, owner)\n\n Called to get the attribute of the owner class (class attribute\n access) or of an instance of that class (instance attribute\n access). *owner* is always the owner class, while *instance* is the\n instance that the attribute was accessed through, or ``None`` when\n the attribute is accessed through the *owner*. This method should\n return the (computed) attribute value or raise an\n ``AttributeError`` exception.\n\nobject.__set__(self, instance, value)\n\n Called to set the attribute on an instance *instance* of the owner\n class to a new value, *value*.\n\nobject.__delete__(self, instance)\n\n Called to delete the attribute on an instance *instance* of the\n owner class.\n\n\nInvoking Descriptors\n--------------------\n\nIn general, a descriptor is an object attribute with "binding\nbehavior", one whose attribute access has been overridden by methods\nin the descriptor protocol: ``__get__()``, ``__set__()``, and\n``__delete__()``. If any of those methods are defined for an object,\nit is said to be a descriptor.\n\nThe default behavior for attribute access is to get, set, or delete\nthe attribute from an object\'s dictionary. For instance, ``a.x`` has a\nlookup chain starting with ``a.__dict__[\'x\']``, then\n``type(a).__dict__[\'x\']``, and continuing through the base classes of\n``type(a)`` excluding metaclasses.\n\nHowever, if the looked-up value is an object defining one of the\ndescriptor methods, then Python may override the default behavior and\ninvoke the descriptor method instead. Where this occurs in the\nprecedence chain depends on which descriptor methods were defined and\nhow they were called. Note that descriptors are only invoked for new\nstyle objects or classes (ones that subclass ``object()`` or\n``type()``).\n\nThe starting point for descriptor invocation is a binding, ``a.x``.\nHow the arguments are assembled depends on ``a``:\n\nDirect Call\n The simplest and least common call is when user code directly\n invokes a descriptor method: ``x.__get__(a)``.\n\nInstance Binding\n If binding to a new-style object instance, ``a.x`` is transformed\n into the call: ``type(a).__dict__[\'x\'].__get__(a, type(a))``.\n\nClass Binding\n If binding to a new-style class, ``A.x`` is transformed into the\n call: ``A.__dict__[\'x\'].__get__(None, A)``.\n\nSuper Binding\n If ``a`` is an instance of ``super``, then the binding ``super(B,\n obj).m()`` searches ``obj.__class__.__mro__`` for the base class\n ``A`` immediately preceding ``B`` and then invokes the descriptor\n with the call: ``A.__dict__[\'m\'].__get__(obj, A)``.\n\nFor instance bindings, the precedence of descriptor invocation depends\non the which descriptor methods are defined. Normally, data\ndescriptors define both ``__get__()`` and ``__set__()``, while non-\ndata descriptors have just the ``__get__()`` method. Data descriptors\nalways override a redefinition in an instance dictionary. In\ncontrast, non-data descriptors can be overridden by instances. [2]\n\nPython methods (including ``staticmethod()`` and ``classmethod()``)\nare implemented as non-data descriptors. Accordingly, instances can\nredefine and override methods. This allows individual instances to\nacquire behaviors that differ from other instances of the same class.\n\nThe ``property()`` function is implemented as a data descriptor.\nAccordingly, instances cannot override the behavior of a property.\n\n\n__slots__\n---------\n\nBy default, instances of both old and new-style classes have a\ndictionary for attribute storage. This wastes space for objects\nhaving very few instance variables. The space consumption can become\nacute when creating large numbers of instances.\n\nThe default can be overridden by defining *__slots__* in a new-style\nclass definition. The *__slots__* declaration takes a sequence of\ninstance variables and reserves just enough space in each instance to\nhold a value for each variable. Space is saved because *__dict__* is\nnot created for each instance.\n\n__slots__\n\n This class variable can be assigned a string, iterable, or sequence\n of strings with variable names used by instances. If defined in a\n new-style class, *__slots__* reserves space for the declared\n variables and prevents the automatic creation of *__dict__* and\n *__weakref__* for each instance.\n\n New in version 2.2.\n\nNotes on using *__slots__*\n\n* When inheriting from a class without *__slots__*, the *__dict__*\n attribute of that class will always be accessible, so a *__slots__*\n definition in the subclass is meaningless.\n\n* Without a *__dict__* variable, instances cannot be assigned new\n variables not listed in the *__slots__* definition. Attempts to\n assign to an unlisted variable name raises ``AttributeError``. If\n dynamic assignment of new variables is desired, then add\n ``\'__dict__\'`` to the sequence of strings in the *__slots__*\n declaration.\n\n Changed in version 2.3: Previously, adding ``\'__dict__\'`` to the\n *__slots__* declaration would not enable the assignment of new\n attributes not specifically listed in the sequence of instance\n variable names.\n\n* Without a *__weakref__* variable for each instance, classes defining\n *__slots__* do not support weak references to its instances. If weak\n reference support is needed, then add ``\'__weakref__\'`` to the\n sequence of strings in the *__slots__* declaration.\n\n Changed in version 2.3: Previously, adding ``\'__weakref__\'`` to the\n *__slots__* declaration would not enable support for weak\n references.\n\n* *__slots__* are implemented at the class level by creating\n descriptors (*Implementing Descriptors*) for each variable name. As\n a result, class attributes cannot be used to set default values for\n instance variables defined by *__slots__*; otherwise, the class\n attribute would overwrite the descriptor assignment.\n\n* If a class defines a slot also defined in a base class, the instance\n variable defined by the base class slot is inaccessible (except by\n retrieving its descriptor directly from the base class). This\n renders the meaning of the program undefined. In the future, a\n check may be added to prevent this.\n\n* The action of a *__slots__* declaration is limited to the class\n where it is defined. As a result, subclasses will have a *__dict__*\n unless they also define *__slots__*.\n\n* *__slots__* do not work for classes derived from "variable-length"\n built-in types such as ``long``, ``str`` and ``tuple``.\n\n* Any non-string iterable may be assigned to *__slots__*. Mappings may\n also be used; however, in the future, special meaning may be\n assigned to the values corresponding to each key.\n\n* *__class__* assignment works only if both classes have the same\n *__slots__*.\n\n Changed in version 2.6: Previously, *__class__* assignment raised an\n error if either new or old class had *__slots__*.\n\n\nCustomizing class creation\n==========================\n\nBy default, new-style classes are constructed using ``type()``. A\nclass definition is read into a separate namespace and the value of\nclass name is bound to the result of ``type(name, bases, dict)``.\n\nWhen the class definition is read, if *__metaclass__* is defined then\nthe callable assigned to it will be called instead of ``type()``. This\nallows classes or functions to be written which monitor or alter the\nclass creation process:\n\n* Modifying the class dictionary prior to the class being created.\n\n* Returning an instance of another class -- essentially performing the\n role of a factory function.\n\nThese steps will have to be performed in the metaclass\'s ``__new__()``\nmethod -- ``type.__new__()`` can then be called from this method to\ncreate a class with different properties. This example adds a new\nelement to the class dictionary before creating the class:\n\n class metacls(type):\n def __new__(mcs, name, bases, dict):\n dict[\'foo\'] = \'metacls was here\'\n return type.__new__(mcs, name, bases, dict)\n\nYou can of course also override other class methods (or add new\nmethods); for example defining a custom ``__call__()`` method in the\nmetaclass allows custom behavior when the class is called, e.g. not\nalways creating a new instance.\n\n__metaclass__\n\n This variable can be any callable accepting arguments for ``name``,\n ``bases``, and ``dict``. Upon class creation, the callable is used\n instead of the built-in ``type()``.\n\n New in version 2.2.\n\nThe appropriate metaclass is determined by the following precedence\nrules:\n\n* If ``dict[\'__metaclass__\']`` exists, it is used.\n\n* Otherwise, if there is at least one base class, its metaclass is\n used (this looks for a *__class__* attribute first and if not found,\n uses its type).\n\n* Otherwise, if a global variable named __metaclass__ exists, it is\n used.\n\n* Otherwise, the old-style, classic metaclass (types.ClassType) is\n used.\n\nThe potential uses for metaclasses are boundless. Some ideas that have\nbeen explored including logging, interface checking, automatic\ndelegation, automatic property creation, proxies, frameworks, and\nautomatic resource locking/synchronization.\n\n\nEmulating callable objects\n==========================\n\nobject.__call__(self[, args...])\n\n Called when the instance is "called" as a function; if this method\n is defined, ``x(arg1, arg2, ...)`` is a shorthand for\n ``x.__call__(arg1, arg2, ...)``.\n\n\nEmulating container types\n=========================\n\nThe following methods can be defined to implement container objects.\nContainers usually are sequences (such as lists or tuples) or mappings\n(like dictionaries), but can represent other containers as well. The\nfirst set of methods is used either to emulate a sequence or to\nemulate a mapping; the difference is that for a sequence, the\nallowable keys should be the integers *k* for which ``0 <= k < N``\nwhere *N* is the length of the sequence, or slice objects, which\ndefine a range of items. (For backwards compatibility, the method\n``__getslice__()`` (see below) can also be defined to handle simple,\nbut not extended slices.) It is also recommended that mappings provide\nthe methods ``keys()``, ``values()``, ``items()``, ``has_key()``,\n``get()``, ``clear()``, ``setdefault()``, ``iterkeys()``,\n``itervalues()``, ``iteritems()``, ``pop()``, ``popitem()``,\n``copy()``, and ``update()`` behaving similar to those for Python\'s\nstandard dictionary objects. The ``UserDict`` module provides a\n``DictMixin`` class to help create those methods from a base set of\n``__getitem__()``, ``__setitem__()``, ``__delitem__()``, and\n``keys()``. Mutable sequences should provide methods ``append()``,\n``count()``, ``index()``, ``extend()``, ``insert()``, ``pop()``,\n``remove()``, ``reverse()`` and ``sort()``, like Python standard list\nobjects. Finally, sequence types should implement addition (meaning\nconcatenation) and multiplication (meaning repetition) by defining the\nmethods ``__add__()``, ``__radd__()``, ``__iadd__()``, ``__mul__()``,\n``__rmul__()`` and ``__imul__()`` described below; they should not\ndefine ``__coerce__()`` or other numerical operators. It is\nrecommended that both mappings and sequences implement the\n``__contains__()`` method to allow efficient use of the ``in``\noperator; for mappings, ``in`` should be equivalent of ``has_key()``;\nfor sequences, it should search through the values. It is further\nrecommended that both mappings and sequences implement the\n``__iter__()`` method to allow efficient iteration through the\ncontainer; for mappings, ``__iter__()`` should be the same as\n``iterkeys()``; for sequences, it should iterate through the values.\n\nobject.__len__(self)\n\n Called to implement the built-in function ``len()``. Should return\n the length of the object, an integer ``>=`` 0. Also, an object\n that doesn\'t define a ``__nonzero__()`` method and whose\n ``__len__()`` method returns zero is considered to be false in a\n Boolean context.\n\nobject.__getitem__(self, key)\n\n Called to implement evaluation of ``self[key]``. For sequence\n types, the accepted keys should be integers and slice objects.\n Note that the special interpretation of negative indexes (if the\n class wishes to emulate a sequence type) is up to the\n ``__getitem__()`` method. If *key* is of an inappropriate type,\n ``TypeError`` may be raised; if of a value outside the set of\n indexes for the sequence (after any special interpretation of\n negative values), ``IndexError`` should be raised. For mapping\n types, if *key* is missing (not in the container), ``KeyError``\n should be raised.\n\n Note: ``for`` loops expect that an ``IndexError`` will be raised for\n illegal indexes to allow proper detection of the end of the\n sequence.\n\nobject.__setitem__(self, key, value)\n\n Called to implement assignment to ``self[key]``. Same note as for\n ``__getitem__()``. This should only be implemented for mappings if\n the objects support changes to the values for keys, or if new keys\n can be added, or for sequences if elements can be replaced. The\n same exceptions should be raised for improper *key* values as for\n the ``__getitem__()`` method.\n\nobject.__delitem__(self, key)\n\n Called to implement deletion of ``self[key]``. Same note as for\n ``__getitem__()``. This should only be implemented for mappings if\n the objects support removal of keys, or for sequences if elements\n can be removed from the sequence. The same exceptions should be\n raised for improper *key* values as for the ``__getitem__()``\n method.\n\nobject.__iter__(self)\n\n This method is called when an iterator is required for a container.\n This method should return a new iterator object that can iterate\n over all the objects in the container. For mappings, it should\n iterate over the keys of the container, and should also be made\n available as the method ``iterkeys()``.\n\n Iterator objects also need to implement this method; they are\n required to return themselves. For more information on iterator\n objects, see *Iterator Types*.\n\nobject.__reversed__(self)\n\n Called (if present) by the ``reversed()`` builtin to implement\n reverse iteration. It should return a new iterator object that\n iterates over all the objects in the container in reverse order.\n\n If the ``__reversed__()`` method is not provided, the\n ``reversed()`` builtin will fall back to using the sequence\n protocol (``__len__()`` and ``__getitem__()``). Objects should\n normally only provide ``__reversed__()`` if they do not support the\n sequence protocol and an efficient implementation of reverse\n iteration is possible.\n\n New in version 2.6.\n\nThe membership test operators (``in`` and ``not in``) are normally\nimplemented as an iteration through a sequence. However, container\nobjects can supply the following special method with a more efficient\nimplementation, which also does not require the object be a sequence.\n\nobject.__contains__(self, item)\n\n Called to implement membership test operators. Should return true\n if *item* is in *self*, false otherwise. For mapping objects, this\n should consider the keys of the mapping rather than the values or\n the key-item pairs.\n\n\nAdditional methods for emulation of sequence types\n==================================================\n\nThe following optional methods can be defined to further emulate\nsequence objects. Immutable sequences methods should at most only\ndefine ``__getslice__()``; mutable sequences might define all three\nmethods.\n\nobject.__getslice__(self, i, j)\n\n Deprecated since version 2.0: Support slice objects as parameters\n to the ``__getitem__()`` method. (However, built-in types in\n CPython currently still implement ``__getslice__()``. Therefore,\n you have to override it in derived classes when implementing\n slicing.)\n\n Called to implement evaluation of ``self[i:j]``. The returned\n object should be of the same type as *self*. Note that missing *i*\n or *j* in the slice expression are replaced by zero or\n ``sys.maxint``, respectively. If negative indexes are used in the\n slice, the length of the sequence is added to that index. If the\n instance does not implement the ``__len__()`` method, an\n ``AttributeError`` is raised. No guarantee is made that indexes\n adjusted this way are not still negative. Indexes which are\n greater than the length of the sequence are not modified. If no\n ``__getslice__()`` is found, a slice object is created instead, and\n passed to ``__getitem__()`` instead.\n\nobject.__setslice__(self, i, j, sequence)\n\n Called to implement assignment to ``self[i:j]``. Same notes for *i*\n and *j* as for ``__getslice__()``.\n\n This method is deprecated. If no ``__setslice__()`` is found, or\n for extended slicing of the form ``self[i:j:k]``, a slice object is\n created, and passed to ``__setitem__()``, instead of\n ``__setslice__()`` being called.\n\nobject.__delslice__(self, i, j)\n\n Called to implement deletion of ``self[i:j]``. Same notes for *i*\n and *j* as for ``__getslice__()``. This method is deprecated. If no\n ``__delslice__()`` is found, or for extended slicing of the form\n ``self[i:j:k]``, a slice object is created, and passed to\n ``__delitem__()``, instead of ``__delslice__()`` being called.\n\nNotice that these methods are only invoked when a single slice with a\nsingle colon is used, and the slice method is available. For slice\noperations involving extended slice notation, or in absence of the\nslice methods, ``__getitem__()``, ``__setitem__()`` or\n``__delitem__()`` is called with a slice object as argument.\n\nThe following example demonstrate how to make your program or module\ncompatible with earlier versions of Python (assuming that methods\n``__getitem__()``, ``__setitem__()`` and ``__delitem__()`` support\nslice objects as arguments):\n\n class MyClass:\n ...\n def __getitem__(self, index):\n ...\n def __setitem__(self, index, value):\n ...\n def __delitem__(self, index):\n ...\n\n if sys.version_info < (2, 0):\n # They won\'t be defined if version is at least 2.0 final\n\n def __getslice__(self, i, j):\n return self[max(0, i):max(0, j):]\n def __setslice__(self, i, j, seq):\n self[max(0, i):max(0, j):] = seq\n def __delslice__(self, i, j):\n del self[max(0, i):max(0, j):]\n ...\n\nNote the calls to ``max()``; these are necessary because of the\nhandling of negative indices before the ``__*slice__()`` methods are\ncalled. When negative indexes are used, the ``__*item__()`` methods\nreceive them as provided, but the ``__*slice__()`` methods get a\n"cooked" form of the index values. For each negative index value, the\nlength of the sequence is added to the index before calling the method\n(which may still result in a negative index); this is the customary\nhandling of negative indexes by the built-in sequence types, and the\n``__*item__()`` methods are expected to do this as well. However,\nsince they should already be doing that, negative indexes cannot be\npassed in; they must be constrained to the bounds of the sequence\nbefore being passed to the ``__*item__()`` methods. Calling ``max(0,\ni)`` conveniently returns the proper value.\n\n\nEmulating numeric types\n=======================\n\nThe following methods can be defined to emulate numeric objects.\nMethods corresponding to operations that are not supported by the\nparticular kind of number implemented (e.g., bitwise operations for\nnon-integral numbers) should be left undefined.\n\nobject.__add__(self, other)\nobject.__sub__(self, other)\nobject.__mul__(self, other)\nobject.__floordiv__(self, other)\nobject.__mod__(self, other)\nobject.__divmod__(self, other)\nobject.__pow__(self, other[, modulo])\nobject.__lshift__(self, other)\nobject.__rshift__(self, other)\nobject.__and__(self, other)\nobject.__xor__(self, other)\nobject.__or__(self, other)\n\n These methods are called to implement the binary arithmetic\n operations (``+``, ``-``, ``*``, ``//``, ``%``, ``divmod()``,\n ``pow()``, ``**``, ``<<``, ``>>``, ``&``, ``^``, ``|``). For\n instance, to evaluate the expression ``x + y``, where *x* is an\n instance of a class that has an ``__add__()`` method,\n ``x.__add__(y)`` is called. The ``__divmod__()`` method should be\n the equivalent to using ``__floordiv__()`` and ``__mod__()``; it\n should not be related to ``__truediv__()`` (described below). Note\n that ``__pow__()`` should be defined to accept an optional third\n argument if the ternary version of the built-in ``pow()`` function\n is to be supported.\n\n If one of those methods does not support the operation with the\n supplied arguments, it should return ``NotImplemented``.\n\nobject.__div__(self, other)\nobject.__truediv__(self, other)\n\n The division operator (``/``) is implemented by these methods. The\n ``__truediv__()`` method is used when ``__future__.division`` is in\n effect, otherwise ``__div__()`` is used. If only one of these two\n methods is defined, the object will not support division in the\n alternate context; ``TypeError`` will be raised instead.\n\nobject.__radd__(self, other)\nobject.__rsub__(self, other)\nobject.__rmul__(self, other)\nobject.__rdiv__(self, other)\nobject.__rtruediv__(self, other)\nobject.__rfloordiv__(self, other)\nobject.__rmod__(self, other)\nobject.__rdivmod__(self, other)\nobject.__rpow__(self, other)\nobject.__rlshift__(self, other)\nobject.__rrshift__(self, other)\nobject.__rand__(self, other)\nobject.__rxor__(self, other)\nobject.__ror__(self, other)\n\n These methods are called to implement the binary arithmetic\n operations (``+``, ``-``, ``*``, ``/``, ``%``, ``divmod()``,\n ``pow()``, ``**``, ``<<``, ``>>``, ``&``, ``^``, ``|``) with\n reflected (swapped) operands. These functions are only called if\n the left operand does not support the corresponding operation and\n the operands are of different types. [3] For instance, to evaluate\n the expression ``x - y``, where *y* is an instance of a class that\n has an ``__rsub__()`` method, ``y.__rsub__(x)`` is called if\n ``x.__sub__(y)`` returns *NotImplemented*.\n\n Note that ternary ``pow()`` will not try calling ``__rpow__()``\n (the coercion rules would become too complicated).\n\n Note: If the right operand\'s type is a subclass of the left operand\'s\n type and that subclass provides the reflected method for the\n operation, this method will be called before the left operand\'s\n non-reflected method. This behavior allows subclasses to\n override their ancestors\' operations.\n\nobject.__iadd__(self, other)\nobject.__isub__(self, other)\nobject.__imul__(self, other)\nobject.__idiv__(self, other)\nobject.__itruediv__(self, other)\nobject.__ifloordiv__(self, other)\nobject.__imod__(self, other)\nobject.__ipow__(self, other[, modulo])\nobject.__ilshift__(self, other)\nobject.__irshift__(self, other)\nobject.__iand__(self, other)\nobject.__ixor__(self, other)\nobject.__ior__(self, other)\n\n These methods are called to implement the augmented arithmetic\n operations (``+=``, ``-=``, ``*=``, ``/=``, ``//=``, ``%=``,\n ``**=``, ``<<=``, ``>>=``, ``&=``, ``^=``, ``|=``). These methods\n should attempt to do the operation in-place (modifying *self*) and\n return the result (which could be, but does not have to be,\n *self*). If a specific method is not defined, the augmented\n operation falls back to the normal methods. For instance, to\n evaluate the expression ``x += y``, where *x* is an instance of a\n class that has an ``__iadd__()`` method, ``x.__iadd__(y)`` is\n called. If *x* is an instance of a class that does not define a\n ``__iadd__()`` method, ``x.__add__(y)`` and ``y.__radd__(x)`` are\n considered, as with the evaluation of ``x + y``.\n\nobject.__neg__(self)\nobject.__pos__(self)\nobject.__abs__(self)\nobject.__invert__(self)\n\n Called to implement the unary arithmetic operations (``-``, ``+``,\n ``abs()`` and ``~``).\n\nobject.__complex__(self)\nobject.__int__(self)\nobject.__long__(self)\nobject.__float__(self)\n\n Called to implement the built-in functions ``complex()``,\n ``int()``, ``long()``, and ``float()``. Should return a value of\n the appropriate type.\n\nobject.__oct__(self)\nobject.__hex__(self)\n\n Called to implement the built-in functions ``oct()`` and ``hex()``.\n Should return a string value.\n\nobject.__index__(self)\n\n Called to implement ``operator.index()``. Also called whenever\n Python needs an integer object (such as in slicing). Must return\n an integer (int or long).\n\n New in version 2.5.\n\nobject.__coerce__(self, other)\n\n Called to implement "mixed-mode" numeric arithmetic. Should either\n return a 2-tuple containing *self* and *other* converted to a\n common numeric type, or ``None`` if conversion is impossible. When\n the common type would be the type of ``other``, it is sufficient to\n return ``None``, since the interpreter will also ask the other\n object to attempt a coercion (but sometimes, if the implementation\n of the other type cannot be changed, it is useful to do the\n conversion to the other type here). A return value of\n ``NotImplemented`` is equivalent to returning ``None``.\n\n\nCoercion rules\n==============\n\nThis section used to document the rules for coercion. As the language\nhas evolved, the coercion rules have become hard to document\nprecisely; documenting what one version of one particular\nimplementation does is undesirable. Instead, here are some informal\nguidelines regarding coercion. In Python 3.0, coercion will not be\nsupported.\n\n* If the left operand of a % operator is a string or Unicode object,\n no coercion takes place and the string formatting operation is\n invoked instead.\n\n* It is no longer recommended to define a coercion operation. Mixed-\n mode operations on types that don\'t define coercion pass the\n original arguments to the operation.\n\n* New-style classes (those derived from ``object``) never invoke the\n ``__coerce__()`` method in response to a binary operator; the only\n time ``__coerce__()`` is invoked is when the built-in function\n ``coerce()`` is called.\n\n* For most intents and purposes, an operator that returns\n ``NotImplemented`` is treated the same as one that is not\n implemented at all.\n\n* Below, ``__op__()`` and ``__rop__()`` are used to signify the\n generic method names corresponding to an operator; ``__iop__()`` is\n used for the corresponding in-place operator. For example, for the\n operator \'``+``\', ``__add__()`` and ``__radd__()`` are used for the\n left and right variant of the binary operator, and ``__iadd__()``\n for the in-place variant.\n\n* For objects *x* and *y*, first ``x.__op__(y)`` is tried. If this is\n not implemented or returns ``NotImplemented``, ``y.__rop__(x)`` is\n tried. If this is also not implemented or returns\n ``NotImplemented``, a ``TypeError`` exception is raised. But see\n the following exception:\n\n* Exception to the previous item: if the left operand is an instance\n of a built-in type or a new-style class, and the right operand is an\n instance of a proper subclass of that type or class and overrides\n the base\'s ``__rop__()`` method, the right operand\'s ``__rop__()``\n method is tried *before* the left operand\'s ``__op__()`` method.\n\n This is done so that a subclass can completely override binary\n operators. Otherwise, the left operand\'s ``__op__()`` method would\n always accept the right operand: when an instance of a given class\n is expected, an instance of a subclass of that class is always\n acceptable.\n\n* When either operand type defines a coercion, this coercion is called\n before that type\'s ``__op__()`` or ``__rop__()`` method is called,\n but no sooner. If the coercion returns an object of a different\n type for the operand whose coercion is invoked, part of the process\n is redone using the new object.\n\n* When an in-place operator (like \'``+=``\') is used, if the left\n operand implements ``__iop__()``, it is invoked without any\n coercion. When the operation falls back to ``__op__()`` and/or\n ``__rop__()``, the normal coercion rules apply.\n\n* In ``x + y``, if *x* is a sequence that implements sequence\n concatenation, sequence concatenation is invoked.\n\n* In ``x * y``, if one operator is a sequence that implements sequence\n repetition, and the other is an integer (``int`` or ``long``),\n sequence repetition is invoked.\n\n* Rich comparisons (implemented by methods ``__eq__()`` and so on)\n never use coercion. Three-way comparison (implemented by\n ``__cmp__()``) does use coercion under the same conditions as other\n binary operations use it.\n\n* In the current implementation, the built-in numeric types ``int``,\n ``long`` and ``float`` do not use coercion; the type ``complex``\n however does use it. The difference can become apparent when\n subclassing these types. Over time, the type ``complex`` may be\n fixed to avoid coercion. All these types implement a\n ``__coerce__()`` method, for use by the built-in ``coerce()``\n function.\n\n\nWith Statement Context Managers\n===============================\n\nNew in version 2.5.\n\nA *context manager* is an object that defines the runtime context to\nbe established when executing a ``with`` statement. The context\nmanager handles the entry into, and the exit from, the desired runtime\ncontext for the execution of the block of code. Context managers are\nnormally invoked using the ``with`` statement (described in section\n*The with statement*), but can also be used by directly invoking their\nmethods.\n\nTypical uses of context managers include saving and restoring various\nkinds of global state, locking and unlocking resources, closing opened\nfiles, etc.\n\nFor more information on context managers, see *Context Manager Types*.\n\nobject.__enter__(self)\n\n Enter the runtime context related to this object. The ``with``\n statement will bind this method\'s return value to the target(s)\n specified in the ``as`` clause of the statement, if any.\n\nobject.__exit__(self, exc_type, exc_value, traceback)\n\n Exit the runtime context related to this object. The parameters\n describe the exception that caused the context to be exited. If the\n context was exited without an exception, all three arguments will\n be ``None``.\n\n If an exception is supplied, and the method wishes to suppress the\n exception (i.e., prevent it from being propagated), it should\n return a true value. Otherwise, the exception will be processed\n normally upon exit from this method.\n\n Note that ``__exit__()`` methods should not reraise the passed-in\n exception; this is the caller\'s responsibility.\n\nSee also:\n\n **PEP 0343** - The "with" statement\n The specification, background, and examples for the Python\n ``with`` statement.\n\n\nSpecial method lookup for old-style classes\n===========================================\n\nFor old-style classes, special methods are always looked up in exactly\nthe same way as any other method or attribute. This is the case\nregardless of whether the method is being looked up explicitly as in\n``x.__getitem__(i)`` or implicitly as in ``x[i]``.\n\nThis behaviour means that special methods may exhibit different\nbehaviour for different instances of a single old-style class if the\nappropriate special attributes are set differently:\n\n >>> class C:\n ... pass\n ...\n >>> c1 = C()\n >>> c2 = C()\n >>> c1.__len__ = lambda: 5\n >>> c2.__len__ = lambda: 9\n >>> len(c1)\n 5\n >>> len(c2)\n 9\n\n\nSpecial method lookup for new-style classes\n===========================================\n\nFor new-style classes, implicit invocations of special methods are\nonly guaranteed to work correctly if defined on an object\'s type, not\nin the object\'s instance dictionary. That behaviour is the reason why\nthe following code raises an exception (unlike the equivalent example\nwith old-style classes):\n\n >>> class C(object):\n ... pass\n ...\n >>> c = C()\n >>> c.__len__ = lambda: 5\n >>> len(c)\n Traceback (most recent call last):\n File "", line 1, in \n TypeError: object of type \'C\' has no len()\n\nThe rationale behind this behaviour lies with a number of special\nmethods such as ``__hash__()`` and ``__repr__()`` that are implemented\nby all objects, including type objects. If the implicit lookup of\nthese methods used the conventional lookup process, they would fail\nwhen invoked on the type object itself:\n\n >>> 1 .__hash__() == hash(1)\n True\n >>> int.__hash__() == hash(int)\n Traceback (most recent call last):\n File "", line 1, in \n TypeError: descriptor \'__hash__\' of \'int\' object needs an argument\n\nIncorrectly attempting to invoke an unbound method of a class in this\nway is sometimes referred to as \'metaclass confusion\', and is avoided\nby bypassing the instance when looking up special methods:\n\n >>> type(1).__hash__(1) == hash(1)\n True\n >>> type(int).__hash__(int) == hash(int)\n True\n\nIn addition to bypassing any instance attributes in the interest of\ncorrectness, implicit special method lookup may also bypass the\n``__getattribute__()`` method even of the object\'s metaclass:\n\n >>> class Meta(type):\n ... def __getattribute__(*args):\n ... print "Metaclass getattribute invoked"\n ... return type.__getattribute__(*args)\n ...\n >>> class C(object):\n ... __metaclass__ = Meta\n ... def __len__(self):\n ... return 10\n ... def __getattribute__(*args):\n ... print "Class getattribute invoked"\n ... return object.__getattribute__(*args)\n ...\n >>> c = C()\n >>> c.__len__() # Explicit lookup via instance\n Class getattribute invoked\n 10\n >>> type(c).__len__(c) # Explicit lookup via type\n Metaclass getattribute invoked\n 10\n >>> len(c) # Implicit lookup\n 10\n\nBypassing the ``__getattribute__()`` machinery in this fashion\nprovides significant scope for speed optimisations within the\ninterpreter, at the cost of some flexibility in the handling of\nspecial methods (the special method *must* be set on the class object\nitself in order to be consistently invoked by the interpreter).\n\n-[ Footnotes ]-\n\n[1] It *is* possible in some cases to change an object\'s type, under\n certain controlled conditions. It generally isn\'t a good idea\n though, since it can lead to some very strange behaviour if it is\n handled incorrectly.\n\n[2] A descriptor can define any combination of ``__get__()``,\n ``__set__()`` and ``__delete__()``. If it does not define\n ``__get__()``, then accessing the attribute even on an instance\n will return the descriptor object itself. If the descriptor\n defines ``__set__()`` and/or ``__delete__()``, it is a data\n descriptor; if it defines neither, it is a non-data descriptor.\n\n[3] For operands of the same type, it is assumed that if the non-\n reflected method (such as ``__add__()``) fails the operation is\n not supported, which is why the reflected method is not called.\n', 'string-conversions': u'\nString conversions\n******************\n\nA string conversion is an expression list enclosed in reverse (a.k.a.\nbackward) quotes:\n\n string_conversion ::= "\'" expression_list "\'"\n\nA string conversion evaluates the contained expression list and\nconverts the resulting object into a string according to rules\nspecific to its type.\n\nIf the object is a string, a number, ``None``, or a tuple, list or\ndictionary containing only objects whose type is one of these, the\nresulting string is a valid Python expression which can be passed to\nthe built-in function ``eval()`` to yield an expression with the same\nvalue (or an approximation, if floating point numbers are involved).\n\n(In particular, converting a string adds quotes around it and converts\n"funny" characters to escape sequences that are safe to print.)\n\nRecursive objects (for example, lists or dictionaries that contain a\nreference to themselves, directly or indirectly) use ``...`` to\nindicate a recursive reference, and the result cannot be passed to\n``eval()`` to get an equal value (``SyntaxError`` will be raised\ninstead).\n\nThe built-in function ``repr()`` performs exactly the same conversion\nin its argument as enclosing it in parentheses and reverse quotes\ndoes. The built-in function ``str()`` performs a similar but more\nuser-friendly conversion.\n', - 'string-methods': u'\nString Methods\n**************\n\nBelow are listed the string methods which both 8-bit strings and\nUnicode objects support. Note that none of these methods take keyword\narguments.\n\nIn addition, Python\'s strings support the sequence type methods\ndescribed in the *Sequence Types --- str, unicode, list, tuple,\nbuffer, xrange* section. To output formatted strings use template\nstrings or the ``%`` operator described in the *String Formatting\nOperations* section. Also, see the ``re`` module for string functions\nbased on regular expressions.\n\nstr.capitalize()\n\n Return a copy of the string with only its first character\n capitalized.\n\n For 8-bit strings, this method is locale-dependent.\n\nstr.center(width[, fillchar])\n\n Return centered in a string of length *width*. Padding is done\n using the specified *fillchar* (default is a space).\n\n Changed in version 2.4: Support for the *fillchar* argument.\n\nstr.count(sub[, start[, end]])\n\n Return the number of occurrences of substring *sub* in the range\n [*start*, *end*]. Optional arguments *start* and *end* are\n interpreted as in slice notation.\n\nstr.decode([encoding[, errors]])\n\n Decodes the string using the codec registered for *encoding*.\n *encoding* defaults to the default string encoding. *errors* may\n be given to set a different error handling scheme. The default is\n ``\'strict\'``, meaning that encoding errors raise ``UnicodeError``.\n Other possible values are ``\'ignore\'``, ``\'replace\'`` and any other\n name registered via ``codecs.register_error()``, see section *Codec\n Base Classes*.\n\n Added in version 2.2.\n\n Changed in version 2.3: Support for other error handling schemes\n added.\n\nstr.encode([encoding[, errors]])\n\n Return an encoded version of the string. Default encoding is the\n current default string encoding. *errors* may be given to set a\n different error handling scheme. The default for *errors* is\n ``\'strict\'``, meaning that encoding errors raise a\n ``UnicodeError``. Other possible values are ``\'ignore\'``,\n ``\'replace\'``, ``\'xmlcharrefreplace\'``, ``\'backslashreplace\'`` and\n any other name registered via ``codecs.register_error()``, see\n section *Codec Base Classes*. For a list of possible encodings, see\n section *Standard Encodings*.\n\n Added in version 2.0.\n\n Changed in version 2.3: Support for ``\'xmlcharrefreplace\'`` and\n ``\'backslashreplace\'`` and other error handling schemes added.\n\nstr.endswith(suffix[, start[, end]])\n\n Return ``True`` if the string ends with the specified *suffix*,\n otherwise return ``False``. *suffix* can also be a tuple of\n suffixes to look for. With optional *start*, test beginning at\n that position. With optional *end*, stop comparing at that\n position.\n\n Changed in version 2.5: Accept tuples as *suffix*.\n\nstr.expandtabs([tabsize])\n\n Return a copy of the string where all tab characters are replaced\n by one or more spaces, depending on the current column and the\n given tab size. The column number is reset to zero after each\n newline occurring in the string. If *tabsize* is not given, a tab\n size of ``8`` characters is assumed. This doesn\'t understand other\n non-printing characters or escape sequences.\n\nstr.find(sub[, start[, end]])\n\n Return the lowest index in the string where substring *sub* is\n found, such that *sub* is contained in the range [*start*, *end*].\n Optional arguments *start* and *end* are interpreted as in slice\n notation. Return ``-1`` if *sub* is not found.\n\nstr.format(format_string, *args, **kwargs)\n\n Perform a string formatting operation. The *format_string*\n argument can contain literal text or replacement fields delimited\n by braces ``{}``. Each replacement field contains either the\n numeric index of a positional argument, or the name of a keyword\n argument. Returns a copy of *format_string* where each replacement\n field is replaced with the string value of the corresponding\n argument.\n\n >>> "The sum of 1 + 2 is {0}".format(1+2)\n \'The sum of 1 + 2 is 3\'\n\n See *Format String Syntax* for a description of the various\n formatting options that can be specified in format strings.\n\n This method of string formatting is the new standard in Python 3.0,\n and should be preferred to the ``%`` formatting described in\n *String Formatting Operations* in new code.\n\n Added in version 2.6.\n\nstr.index(sub[, start[, end]])\n\n Like ``find()``, but raise ``ValueError`` when the substring is not\n found.\n\nstr.isalnum()\n\n Return true if all characters in the string are alphanumeric and\n there is at least one character, false otherwise.\n\n For 8-bit strings, this method is locale-dependent.\n\nstr.isalpha()\n\n Return true if all characters in the string are alphabetic and\n there is at least one character, false otherwise.\n\n For 8-bit strings, this method is locale-dependent.\n\nstr.isdigit()\n\n Return true if all characters in the string are digits and there is\n at least one character, false otherwise.\n\n For 8-bit strings, this method is locale-dependent.\n\nstr.islower()\n\n Return true if all cased characters in the string are lowercase and\n there is at least one cased character, false otherwise.\n\n For 8-bit strings, this method is locale-dependent.\n\nstr.isspace()\n\n Return true if there are only whitespace characters in the string\n and there is at least one character, false otherwise.\n\n For 8-bit strings, this method is locale-dependent.\n\nstr.istitle()\n\n Return true if the string is a titlecased string and there is at\n least one character, for example uppercase characters may only\n follow uncased characters and lowercase characters only cased ones.\n Return false otherwise.\n\n For 8-bit strings, this method is locale-dependent.\n\nstr.isupper()\n\n Return true if all cased characters in the string are uppercase and\n there is at least one cased character, false otherwise.\n\n For 8-bit strings, this method is locale-dependent.\n\nstr.join(seq)\n\n Return a string which is the concatenation of the strings in the\n sequence *seq*. The separator between elements is the string\n providing this method.\n\nstr.ljust(width[, fillchar])\n\n Return the string left justified in a string of length *width*.\n Padding is done using the specified *fillchar* (default is a\n space). The original string is returned if *width* is less than\n ``len(s)``.\n\n Changed in version 2.4: Support for the *fillchar* argument.\n\nstr.lower()\n\n Return a copy of the string converted to lowercase.\n\n For 8-bit strings, this method is locale-dependent.\n\nstr.lstrip([chars])\n\n Return a copy of the string with leading characters removed. The\n *chars* argument is a string specifying the set of characters to be\n removed. If omitted or ``None``, the *chars* argument defaults to\n removing whitespace. The *chars* argument is not a prefix; rather,\n all combinations of its values are stripped:\n\n >>> \' spacious \'.lstrip()\n \'spacious \'\n >>> \'www.example.com\'.lstrip(\'cmowz.\')\n \'example.com\'\n\n Changed in version 2.2.2: Support for the *chars* argument.\n\nstr.partition(sep)\n\n Split the string at the first occurrence of *sep*, and return a\n 3-tuple containing the part before the separator, the separator\n itself, and the part after the separator. If the separator is not\n found, return a 3-tuple containing the string itself, followed by\n two empty strings.\n\n Added in version 2.5.\n\nstr.replace(old, new[, count])\n\n Return a copy of the string with all occurrences of substring *old*\n replaced by *new*. If the optional argument *count* is given, only\n the first *count* occurrences are replaced.\n\nstr.rfind(sub[, start[, end]])\n\n Return the highest index in the string where substring *sub* is\n found, such that *sub* is contained within s[start,end]. Optional\n arguments *start* and *end* are interpreted as in slice notation.\n Return ``-1`` on failure.\n\nstr.rindex(sub[, start[, end]])\n\n Like ``rfind()`` but raises ``ValueError`` when the substring *sub*\n is not found.\n\nstr.rjust(width[, fillchar])\n\n Return the string right justified in a string of length *width*.\n Padding is done using the specified *fillchar* (default is a\n space). The original string is returned if *width* is less than\n ``len(s)``.\n\n Changed in version 2.4: Support for the *fillchar* argument.\n\nstr.rpartition(sep)\n\n Split the string at the last occurrence of *sep*, and return a\n 3-tuple containing the part before the separator, the separator\n itself, and the part after the separator. If the separator is not\n found, return a 3-tuple containing two empty strings, followed by\n the string itself.\n\n Added in version 2.5.\n\nstr.rsplit([sep[, maxsplit]])\n\n Return a list of the words in the string, using *sep* as the\n delimiter string. If *maxsplit* is given, at most *maxsplit* splits\n are done, the *rightmost* ones. If *sep* is not specified or\n ``None``, any whitespace string is a separator. Except for\n splitting from the right, ``rsplit()`` behaves like ``split()``\n which is described in detail below.\n\n Added in version 2.4.\n\nstr.rstrip([chars])\n\n Return a copy of the string with trailing characters removed. The\n *chars* argument is a string specifying the set of characters to be\n removed. If omitted or ``None``, the *chars* argument defaults to\n removing whitespace. The *chars* argument is not a suffix; rather,\n all combinations of its values are stripped:\n\n >>> \' spacious \'.rstrip()\n \' spacious\'\n >>> \'mississippi\'.rstrip(\'ipz\')\n \'mississ\'\n\n Changed in version 2.2.2: Support for the *chars* argument.\n\nstr.split([sep[, maxsplit]])\n\n Return a list of the words in the string, using *sep* as the\n delimiter string. If *maxsplit* is given, at most *maxsplit*\n splits are done (thus, the list will have at most ``maxsplit+1``\n elements). If *maxsplit* is not specified, then there is no limit\n on the number of splits (all possible splits are made).\n\n If *sep* is given, consecutive delimiters are not grouped together\n and are deemed to delimit empty strings (for example,\n ``\'1,,2\'.split(\',\')`` returns ``[\'1\', \'\', \'2\']``). The *sep*\n argument may consist of multiple characters (for example,\n ``\'1<>2<>3\'.split(\'<>\')`` returns ``[\'1\', \'2\', \'3\']``). Splitting\n an empty string with a specified separator returns ``[\'\']``.\n\n If *sep* is not specified or is ``None``, a different splitting\n algorithm is applied: runs of consecutive whitespace are regarded\n as a single separator, and the result will contain no empty strings\n at the start or end if the string has leading or trailing\n whitespace. Consequently, splitting an empty string or a string\n consisting of just whitespace with a ``None`` separator returns\n ``[]``.\n\n For example, ``\' 1 2 3 \'.split()`` returns ``[\'1\', \'2\', \'3\']``,\n and ``\' 1 2 3 \'.split(None, 1)`` returns ``[\'1\', \'2 3 \']``.\n\nstr.splitlines([keepends])\n\n Return a list of the lines in the string, breaking at line\n boundaries. Line breaks are not included in the resulting list\n unless *keepends* is given and true.\n\nstr.startswith(prefix[, start[, end]])\n\n Return ``True`` if string starts with the *prefix*, otherwise\n return ``False``. *prefix* can also be a tuple of prefixes to look\n for. With optional *start*, test string beginning at that\n position. With optional *end*, stop comparing string at that\n position.\n\n Changed in version 2.5: Accept tuples as *prefix*.\n\nstr.strip([chars])\n\n Return a copy of the string with the leading and trailing\n characters removed. The *chars* argument is a string specifying the\n set of characters to be removed. If omitted or ``None``, the\n *chars* argument defaults to removing whitespace. The *chars*\n argument is not a prefix or suffix; rather, all combinations of its\n values are stripped:\n\n >>> \' spacious \'.strip()\n \'spacious\'\n >>> \'www.example.com\'.strip(\'cmowz.\')\n \'example\'\n\n Changed in version 2.2.2: Support for the *chars* argument.\n\nstr.swapcase()\n\n Return a copy of the string with uppercase characters converted to\n lowercase and vice versa.\n\n For 8-bit strings, this method is locale-dependent.\n\nstr.title()\n\n Return a titlecased version of the string: words start with\n uppercase characters, all remaining cased characters are lowercase.\n\n For 8-bit strings, this method is locale-dependent.\n\nstr.translate(table[, deletechars])\n\n Return a copy of the string where all characters occurring in the\n optional argument *deletechars* are removed, and the remaining\n characters have been mapped through the given translation table,\n which must be a string of length 256.\n\n You can use the ``maketrans()`` helper function in the ``string``\n module to create a translation table. For string objects, set the\n *table* argument to ``None`` for translations that only delete\n characters:\n\n >>> \'read this short text\'.translate(None, \'aeiou\')\n \'rd ths shrt txt\'\n\n Added in version 2.6: Support for a ``None`` *table* argument.\n\n For Unicode objects, the ``translate()`` method does not accept the\n optional *deletechars* argument. Instead, it returns a copy of the\n *s* where all characters have been mapped through the given\n translation table which must be a mapping of Unicode ordinals to\n Unicode ordinals, Unicode strings or ``None``. Unmapped characters\n are left untouched. Characters mapped to ``None`` are deleted.\n Note, a more flexible approach is to create a custom character\n mapping codec using the ``codecs`` module (see ``encodings.cp1251``\n for an example).\n\nstr.upper()\n\n Return a copy of the string converted to uppercase.\n\n For 8-bit strings, this method is locale-dependent.\n\nstr.zfill(width)\n\n Return the numeric string left filled with zeros in a string of\n length *width*. A sign prefix is handled correctly. The original\n string is returned if *width* is less than ``len(s)``.\n\n Added in version 2.2.2.\n\nThe following methods are present only on unicode objects:\n\nunicode.isnumeric()\n\n Return ``True`` if there are only numeric characters in S,\n ``False`` otherwise. Numeric characters include digit characters,\n and all characters that have the Unicode numeric value property,\n e.g. U+2155, VULGAR FRACTION ONE FIFTH.\n\nunicode.isdecimal()\n\n Return ``True`` if there are only decimal characters in S,\n ``False`` otherwise. Decimal characters include digit characters,\n and all characters that that can be used to form decimal-radix\n numbers, e.g. U+0660, ARABIC-INDIC DIGIT ZERO.\n', - 'strings': u'\nString literals\n***************\n\nString literals are described by the following lexical definitions:\n\n stringliteral ::= [stringprefix](shortstring | longstring)\n stringprefix ::= "r" | "u" | "ur" | "R" | "U" | "UR" | "Ur" | "uR"\n shortstring ::= "\'" shortstringitem* "\'" | \'"\' shortstringitem* \'"\'\n longstring ::= ""\'" longstringitem* ""\'"\n | \'"""\' longstringitem* \'"""\'\n shortstringitem ::= shortstringchar | escapeseq\n longstringitem ::= longstringchar | escapeseq\n shortstringchar ::= \n longstringchar ::= \n escapeseq ::= "\\" \n\nOne syntactic restriction not indicated by these productions is that\nwhitespace is not allowed between the **stringprefix** and the rest of\nthe string literal. The source character set is defined by the\nencoding declaration; it is ASCII if no encoding declaration is given\nin the source file; see section *Encoding declarations*.\n\nIn plain English: String literals can be enclosed in matching single\nquotes (``\'``) or double quotes (``"``). They can also be enclosed in\nmatching groups of three single or double quotes (these are generally\nreferred to as *triple-quoted strings*). The backslash (``\\``)\ncharacter is used to escape characters that otherwise have a special\nmeaning, such as newline, backslash itself, or the quote character.\nString literals may optionally be prefixed with a letter ``\'r\'`` or\n``\'R\'``; such strings are called *raw strings* and use different rules\nfor interpreting backslash escape sequences. A prefix of ``\'u\'`` or\n``\'U\'`` makes the string a Unicode string. Unicode strings use the\nUnicode character set as defined by the Unicode Consortium and ISO\n10646. Some additional escape sequences, described below, are\navailable in Unicode strings. The two prefix characters may be\ncombined; in this case, ``\'u\'`` must appear before ``\'r\'``.\n\nIn triple-quoted strings, unescaped newlines and quotes are allowed\n(and are retained), except that three unescaped quotes in a row\nterminate the string. (A "quote" is the character used to open the\nstring, i.e. either ``\'`` or ``"``.)\n\nUnless an ``\'r\'`` or ``\'R\'`` prefix is present, escape sequences in\nstrings are interpreted according to rules similar to those used by\nStandard C. The recognized escape sequences are:\n\n+-------------------+-----------------------------------+---------+\n| Escape Sequence | Meaning | Notes |\n+===================+===================================+=========+\n| ``\\newline`` | Ignored | |\n+-------------------+-----------------------------------+---------+\n| ``\\\\`` | Backslash (``\\``) | |\n+-------------------+-----------------------------------+---------+\n| ``\\\'`` | Single quote (``\'``) | |\n+-------------------+-----------------------------------+---------+\n| ``\\"`` | Double quote (``"``) | |\n+-------------------+-----------------------------------+---------+\n| ``\\a`` | ASCII Bell (BEL) | |\n+-------------------+-----------------------------------+---------+\n| ``\\b`` | ASCII Backspace (BS) | |\n+-------------------+-----------------------------------+---------+\n| ``\\f`` | ASCII Formfeed (FF) | |\n+-------------------+-----------------------------------+---------+\n| ``\\n`` | ASCII Linefeed (LF) | |\n+-------------------+-----------------------------------+---------+\n| ``\\N{name}`` | Character named *name* in the | |\n| | Unicode database (Unicode only) | |\n+-------------------+-----------------------------------+---------+\n| ``\\r`` | ASCII Carriage Return (CR) | |\n+-------------------+-----------------------------------+---------+\n| ``\\t`` | ASCII Horizontal Tab (TAB) | |\n+-------------------+-----------------------------------+---------+\n| ``\\uxxxx`` | Character with 16-bit hex value | (1) |\n| | *xxxx* (Unicode only) | |\n+-------------------+-----------------------------------+---------+\n| ``\\Uxxxxxxxx`` | Character with 32-bit hex value | (2) |\n| | *xxxxxxxx* (Unicode only) | |\n+-------------------+-----------------------------------+---------+\n| ``\\v`` | ASCII Vertical Tab (VT) | |\n+-------------------+-----------------------------------+---------+\n| ``\\ooo`` | Character with octal value *ooo* | (3,5) |\n+-------------------+-----------------------------------+---------+\n| ``\\xhh`` | Character with hex value *hh* | (4,5) |\n+-------------------+-----------------------------------+---------+\n\nNotes:\n\n1. Individual code units which form parts of a surrogate pair can be\n encoded using this escape sequence.\n\n2. Any Unicode character can be encoded this way, but characters\n outside the Basic Multilingual Plane (BMP) will be encoded using a\n surrogate pair if Python is compiled to use 16-bit code units (the\n default). Individual code units which form parts of a surrogate\n pair can be encoded using this escape sequence.\n\n3. As in Standard C, up to three octal digits are accepted.\n\n4. Unlike in Standard C, exactly two hex digits are required.\n\n5. In a string literal, hexadecimal and octal escapes denote the byte\n with the given value; it is not necessary that the byte encodes a\n character in the source character set. In a Unicode literal, these\n escapes denote a Unicode character with the given value.\n\nUnlike Standard C, all unrecognized escape sequences are left in the\nstring unchanged, i.e., *the backslash is left in the string*. (This\nbehavior is useful when debugging: if an escape sequence is mistyped,\nthe resulting output is more easily recognized as broken.) It is also\nimportant to note that the escape sequences marked as "(Unicode only)"\nin the table above fall into the category of unrecognized escapes for\nnon-Unicode string literals.\n\nWhen an ``\'r\'`` or ``\'R\'`` prefix is present, a character following a\nbackslash is included in the string without change, and *all\nbackslashes are left in the string*. For example, the string literal\n``r"\\n"`` consists of two characters: a backslash and a lowercase\n``\'n\'``. String quotes can be escaped with a backslash, but the\nbackslash remains in the string; for example, ``r"\\""`` is a valid\nstring literal consisting of two characters: a backslash and a double\nquote; ``r"\\"`` is not a valid string literal (even a raw string\ncannot end in an odd number of backslashes). Specifically, *a raw\nstring cannot end in a single backslash* (since the backslash would\nescape the following quote character). Note also that a single\nbackslash followed by a newline is interpreted as those two characters\nas part of the string, *not* as a line continuation.\n\nWhen an ``\'r\'`` or ``\'R\'`` prefix is used in conjunction with a\n``\'u\'`` or ``\'U\'`` prefix, then the ``\\uXXXX`` and ``\\UXXXXXXXX``\nescape sequences are processed while *all other backslashes are left\nin the string*. For example, the string literal ``ur"\\u0062\\n"``\nconsists of three Unicode characters: \'LATIN SMALL LETTER B\', \'REVERSE\nSOLIDUS\', and \'LATIN SMALL LETTER N\'. Backslashes can be escaped with\na preceding backslash; however, both remain in the string. As a\nresult, ``\\uXXXX`` escape sequences are only recognized when there are\nan odd number of backslashes.\n', + 'string-methods': u'\nString Methods\n**************\n\nBelow are listed the string methods which both 8-bit strings and\nUnicode objects support. Note that none of these methods take keyword\narguments.\n\nIn addition, Python\'s strings support the sequence type methods\ndescribed in the *Sequence Types --- str, unicode, list, tuple,\nbuffer, xrange* section. To output formatted strings use template\nstrings or the ``%`` operator described in the *String Formatting\nOperations* section. Also, see the ``re`` module for string functions\nbased on regular expressions.\n\nstr.capitalize()\n\n Return a copy of the string with only its first character\n capitalized.\n\n For 8-bit strings, this method is locale-dependent.\n\nstr.center(width[, fillchar])\n\n Return centered in a string of length *width*. Padding is done\n using the specified *fillchar* (default is a space).\n\n Changed in version 2.4: Support for the *fillchar* argument.\n\nstr.count(sub[, start[, end]])\n\n Return the number of occurrences of substring *sub* in the range\n [*start*, *end*]. Optional arguments *start* and *end* are\n interpreted as in slice notation.\n\nstr.decode([encoding[, errors]])\n\n Decodes the string using the codec registered for *encoding*.\n *encoding* defaults to the default string encoding. *errors* may\n be given to set a different error handling scheme. The default is\n ``\'strict\'``, meaning that encoding errors raise ``UnicodeError``.\n Other possible values are ``\'ignore\'``, ``\'replace\'`` and any other\n name registered via ``codecs.register_error()``, see section *Codec\n Base Classes*.\n\n New in version 2.2.\n\n Changed in version 2.3: Support for other error handling schemes\n added.\n\nstr.encode([encoding[, errors]])\n\n Return an encoded version of the string. Default encoding is the\n current default string encoding. *errors* may be given to set a\n different error handling scheme. The default for *errors* is\n ``\'strict\'``, meaning that encoding errors raise a\n ``UnicodeError``. Other possible values are ``\'ignore\'``,\n ``\'replace\'``, ``\'xmlcharrefreplace\'``, ``\'backslashreplace\'`` and\n any other name registered via ``codecs.register_error()``, see\n section *Codec Base Classes*. For a list of possible encodings, see\n section *Standard Encodings*.\n\n New in version 2.0.\n\n Changed in version 2.3: Support for ``\'xmlcharrefreplace\'`` and\n ``\'backslashreplace\'`` and other error handling schemes added.\n\nstr.endswith(suffix[, start[, end]])\n\n Return ``True`` if the string ends with the specified *suffix*,\n otherwise return ``False``. *suffix* can also be a tuple of\n suffixes to look for. With optional *start*, test beginning at\n that position. With optional *end*, stop comparing at that\n position.\n\n Changed in version 2.5: Accept tuples as *suffix*.\n\nstr.expandtabs([tabsize])\n\n Return a copy of the string where all tab characters are replaced\n by one or more spaces, depending on the current column and the\n given tab size. The column number is reset to zero after each\n newline occurring in the string. If *tabsize* is not given, a tab\n size of ``8`` characters is assumed. This doesn\'t understand other\n non-printing characters or escape sequences.\n\nstr.find(sub[, start[, end]])\n\n Return the lowest index in the string where substring *sub* is\n found, such that *sub* is contained in the range [*start*, *end*].\n Optional arguments *start* and *end* are interpreted as in slice\n notation. Return ``-1`` if *sub* is not found.\n\nstr.format(format_string, *args, **kwargs)\n\n Perform a string formatting operation. The *format_string*\n argument can contain literal text or replacement fields delimited\n by braces ``{}``. Each replacement field contains either the\n numeric index of a positional argument, or the name of a keyword\n argument. Returns a copy of *format_string* where each replacement\n field is replaced with the string value of the corresponding\n argument.\n\n >>> "The sum of 1 + 2 is {0}".format(1+2)\n \'The sum of 1 + 2 is 3\'\n\n See *Format String Syntax* for a description of the various\n formatting options that can be specified in format strings.\n\n This method of string formatting is the new standard in Python 3.0,\n and should be preferred to the ``%`` formatting described in\n *String Formatting Operations* in new code.\n\n New in version 2.6.\n\nstr.index(sub[, start[, end]])\n\n Like ``find()``, but raise ``ValueError`` when the substring is not\n found.\n\nstr.isalnum()\n\n Return true if all characters in the string are alphanumeric and\n there is at least one character, false otherwise.\n\n For 8-bit strings, this method is locale-dependent.\n\nstr.isalpha()\n\n Return true if all characters in the string are alphabetic and\n there is at least one character, false otherwise.\n\n For 8-bit strings, this method is locale-dependent.\n\nstr.isdigit()\n\n Return true if all characters in the string are digits and there is\n at least one character, false otherwise.\n\n For 8-bit strings, this method is locale-dependent.\n\nstr.islower()\n\n Return true if all cased characters in the string are lowercase and\n there is at least one cased character, false otherwise.\n\n For 8-bit strings, this method is locale-dependent.\n\nstr.isspace()\n\n Return true if there are only whitespace characters in the string\n and there is at least one character, false otherwise.\n\n For 8-bit strings, this method is locale-dependent.\n\nstr.istitle()\n\n Return true if the string is a titlecased string and there is at\n least one character, for example uppercase characters may only\n follow uncased characters and lowercase characters only cased ones.\n Return false otherwise.\n\n For 8-bit strings, this method is locale-dependent.\n\nstr.isupper()\n\n Return true if all cased characters in the string are uppercase and\n there is at least one cased character, false otherwise.\n\n For 8-bit strings, this method is locale-dependent.\n\nstr.join(seq)\n\n Return a string which is the concatenation of the strings in the\n sequence *seq*. The separator between elements is the string\n providing this method.\n\nstr.ljust(width[, fillchar])\n\n Return the string left justified in a string of length *width*.\n Padding is done using the specified *fillchar* (default is a\n space). The original string is returned if *width* is less than\n ``len(s)``.\n\n Changed in version 2.4: Support for the *fillchar* argument.\n\nstr.lower()\n\n Return a copy of the string converted to lowercase.\n\n For 8-bit strings, this method is locale-dependent.\n\nstr.lstrip([chars])\n\n Return a copy of the string with leading characters removed. The\n *chars* argument is a string specifying the set of characters to be\n removed. If omitted or ``None``, the *chars* argument defaults to\n removing whitespace. The *chars* argument is not a prefix; rather,\n all combinations of its values are stripped:\n\n >>> \' spacious \'.lstrip()\n \'spacious \'\n >>> \'www.example.com\'.lstrip(\'cmowz.\')\n \'example.com\'\n\n Changed in version 2.2.2: Support for the *chars* argument.\n\nstr.partition(sep)\n\n Split the string at the first occurrence of *sep*, and return a\n 3-tuple containing the part before the separator, the separator\n itself, and the part after the separator. If the separator is not\n found, return a 3-tuple containing the string itself, followed by\n two empty strings.\n\n New in version 2.5.\n\nstr.replace(old, new[, count])\n\n Return a copy of the string with all occurrences of substring *old*\n replaced by *new*. If the optional argument *count* is given, only\n the first *count* occurrences are replaced.\n\nstr.rfind(sub[, start[, end]])\n\n Return the highest index in the string where substring *sub* is\n found, such that *sub* is contained within s[start,end]. Optional\n arguments *start* and *end* are interpreted as in slice notation.\n Return ``-1`` on failure.\n\nstr.rindex(sub[, start[, end]])\n\n Like ``rfind()`` but raises ``ValueError`` when the substring *sub*\n is not found.\n\nstr.rjust(width[, fillchar])\n\n Return the string right justified in a string of length *width*.\n Padding is done using the specified *fillchar* (default is a\n space). The original string is returned if *width* is less than\n ``len(s)``.\n\n Changed in version 2.4: Support for the *fillchar* argument.\n\nstr.rpartition(sep)\n\n Split the string at the last occurrence of *sep*, and return a\n 3-tuple containing the part before the separator, the separator\n itself, and the part after the separator. If the separator is not\n found, return a 3-tuple containing two empty strings, followed by\n the string itself.\n\n New in version 2.5.\n\nstr.rsplit([sep[, maxsplit]])\n\n Return a list of the words in the string, using *sep* as the\n delimiter string. If *maxsplit* is given, at most *maxsplit* splits\n are done, the *rightmost* ones. If *sep* is not specified or\n ``None``, any whitespace string is a separator. Except for\n splitting from the right, ``rsplit()`` behaves like ``split()``\n which is described in detail below.\n\n New in version 2.4.\n\nstr.rstrip([chars])\n\n Return a copy of the string with trailing characters removed. The\n *chars* argument is a string specifying the set of characters to be\n removed. If omitted or ``None``, the *chars* argument defaults to\n removing whitespace. The *chars* argument is not a suffix; rather,\n all combinations of its values are stripped:\n\n >>> \' spacious \'.rstrip()\n \' spacious\'\n >>> \'mississippi\'.rstrip(\'ipz\')\n \'mississ\'\n\n Changed in version 2.2.2: Support for the *chars* argument.\n\nstr.split([sep[, maxsplit]])\n\n Return a list of the words in the string, using *sep* as the\n delimiter string. If *maxsplit* is given, at most *maxsplit*\n splits are done (thus, the list will have at most ``maxsplit+1``\n elements). If *maxsplit* is not specified, then there is no limit\n on the number of splits (all possible splits are made).\n\n If *sep* is given, consecutive delimiters are not grouped together\n and are deemed to delimit empty strings (for example,\n ``\'1,,2\'.split(\',\')`` returns ``[\'1\', \'\', \'2\']``). The *sep*\n argument may consist of multiple characters (for example,\n ``\'1<>2<>3\'.split(\'<>\')`` returns ``[\'1\', \'2\', \'3\']``). Splitting\n an empty string with a specified separator returns ``[\'\']``.\n\n If *sep* is not specified or is ``None``, a different splitting\n algorithm is applied: runs of consecutive whitespace are regarded\n as a single separator, and the result will contain no empty strings\n at the start or end if the string has leading or trailing\n whitespace. Consequently, splitting an empty string or a string\n consisting of just whitespace with a ``None`` separator returns\n ``[]``.\n\n For example, ``\' 1 2 3 \'.split()`` returns ``[\'1\', \'2\', \'3\']``,\n and ``\' 1 2 3 \'.split(None, 1)`` returns ``[\'1\', \'2 3 \']``.\n\nstr.splitlines([keepends])\n\n Return a list of the lines in the string, breaking at line\n boundaries. Line breaks are not included in the resulting list\n unless *keepends* is given and true.\n\nstr.startswith(prefix[, start[, end]])\n\n Return ``True`` if string starts with the *prefix*, otherwise\n return ``False``. *prefix* can also be a tuple of prefixes to look\n for. With optional *start*, test string beginning at that\n position. With optional *end*, stop comparing string at that\n position.\n\n Changed in version 2.5: Accept tuples as *prefix*.\n\nstr.strip([chars])\n\n Return a copy of the string with the leading and trailing\n characters removed. The *chars* argument is a string specifying the\n set of characters to be removed. If omitted or ``None``, the\n *chars* argument defaults to removing whitespace. The *chars*\n argument is not a prefix or suffix; rather, all combinations of its\n values are stripped:\n\n >>> \' spacious \'.strip()\n \'spacious\'\n >>> \'www.example.com\'.strip(\'cmowz.\')\n \'example\'\n\n Changed in version 2.2.2: Support for the *chars* argument.\n\nstr.swapcase()\n\n Return a copy of the string with uppercase characters converted to\n lowercase and vice versa.\n\n For 8-bit strings, this method is locale-dependent.\n\nstr.title()\n\n Return a titlecased version of the string: words start with\n uppercase characters, all remaining cased characters are lowercase.\n\n For 8-bit strings, this method is locale-dependent.\n\nstr.translate(table[, deletechars])\n\n Return a copy of the string where all characters occurring in the\n optional argument *deletechars* are removed, and the remaining\n characters have been mapped through the given translation table,\n which must be a string of length 256.\n\n You can use the ``maketrans()`` helper function in the ``string``\n module to create a translation table. For string objects, set the\n *table* argument to ``None`` for translations that only delete\n characters:\n\n >>> \'read this short text\'.translate(None, \'aeiou\')\n \'rd ths shrt txt\'\n\n New in version 2.6: Support for a ``None`` *table* argument.\n\n For Unicode objects, the ``translate()`` method does not accept the\n optional *deletechars* argument. Instead, it returns a copy of the\n *s* where all characters have been mapped through the given\n translation table which must be a mapping of Unicode ordinals to\n Unicode ordinals, Unicode strings or ``None``. Unmapped characters\n are left untouched. Characters mapped to ``None`` are deleted.\n Note, a more flexible approach is to create a custom character\n mapping codec using the ``codecs`` module (see ``encodings.cp1251``\n for an example).\n\nstr.upper()\n\n Return a copy of the string converted to uppercase.\n\n For 8-bit strings, this method is locale-dependent.\n\nstr.zfill(width)\n\n Return the numeric string left filled with zeros in a string of\n length *width*. A sign prefix is handled correctly. The original\n string is returned if *width* is less than ``len(s)``.\n\n New in version 2.2.2.\n\nThe following methods are present only on unicode objects:\n\nunicode.isnumeric()\n\n Return ``True`` if there are only numeric characters in S,\n ``False`` otherwise. Numeric characters include digit characters,\n and all characters that have the Unicode numeric value property,\n e.g. U+2155, VULGAR FRACTION ONE FIFTH.\n\nunicode.isdecimal()\n\n Return ``True`` if there are only decimal characters in S,\n ``False`` otherwise. Decimal characters include digit characters,\n and all characters that that can be used to form decimal-radix\n numbers, e.g. U+0660, ARABIC-INDIC DIGIT ZERO.\n', + 'strings': u'\nString literals\n***************\n\nString literals are described by the following lexical definitions:\n\n stringliteral ::= [stringprefix](shortstring | longstring)\n stringprefix ::= "r" | "u" | "ur" | "R" | "U" | "UR" | "Ur" | "uR"\n shortstring ::= "\'" shortstringitem* "\'" | \'"\' shortstringitem* \'"\'\n longstring ::= "\'\'\'" longstringitem* "\'\'\'"\n | \'"""\' longstringitem* \'"""\'\n shortstringitem ::= shortstringchar | escapeseq\n longstringitem ::= longstringchar | escapeseq\n shortstringchar ::= \n longstringchar ::= \n escapeseq ::= "\\" \n\nOne syntactic restriction not indicated by these productions is that\nwhitespace is not allowed between the **stringprefix** and the rest of\nthe string literal. The source character set is defined by the\nencoding declaration; it is ASCII if no encoding declaration is given\nin the source file; see section *Encoding declarations*.\n\nIn plain English: String literals can be enclosed in matching single\nquotes (``\'``) or double quotes (``"``). They can also be enclosed in\nmatching groups of three single or double quotes (these are generally\nreferred to as *triple-quoted strings*). The backslash (``\\``)\ncharacter is used to escape characters that otherwise have a special\nmeaning, such as newline, backslash itself, or the quote character.\nString literals may optionally be prefixed with a letter ``\'r\'`` or\n``\'R\'``; such strings are called *raw strings* and use different rules\nfor interpreting backslash escape sequences. A prefix of ``\'u\'`` or\n``\'U\'`` makes the string a Unicode string. Unicode strings use the\nUnicode character set as defined by the Unicode Consortium and ISO\n10646. Some additional escape sequences, described below, are\navailable in Unicode strings. The two prefix characters may be\ncombined; in this case, ``\'u\'`` must appear before ``\'r\'``.\n\nIn triple-quoted strings, unescaped newlines and quotes are allowed\n(and are retained), except that three unescaped quotes in a row\nterminate the string. (A "quote" is the character used to open the\nstring, i.e. either ``\'`` or ``"``.)\n\nUnless an ``\'r\'`` or ``\'R\'`` prefix is present, escape sequences in\nstrings are interpreted according to rules similar to those used by\nStandard C. The recognized escape sequences are:\n\n+-------------------+-----------------------------------+---------+\n| Escape Sequence | Meaning | Notes |\n+===================+===================================+=========+\n| ``\\newline`` | Ignored | |\n+-------------------+-----------------------------------+---------+\n| ``\\\\`` | Backslash (``\\``) | |\n+-------------------+-----------------------------------+---------+\n| ``\\\'`` | Single quote (``\'``) | |\n+-------------------+-----------------------------------+---------+\n| ``\\"`` | Double quote (``"``) | |\n+-------------------+-----------------------------------+---------+\n| ``\\a`` | ASCII Bell (BEL) | |\n+-------------------+-----------------------------------+---------+\n| ``\\b`` | ASCII Backspace (BS) | |\n+-------------------+-----------------------------------+---------+\n| ``\\f`` | ASCII Formfeed (FF) | |\n+-------------------+-----------------------------------+---------+\n| ``\\n`` | ASCII Linefeed (LF) | |\n+-------------------+-----------------------------------+---------+\n| ``\\N{name}`` | Character named *name* in the | |\n| | Unicode database (Unicode only) | |\n+-------------------+-----------------------------------+---------+\n| ``\\r`` | ASCII Carriage Return (CR) | |\n+-------------------+-----------------------------------+---------+\n| ``\\t`` | ASCII Horizontal Tab (TAB) | |\n+-------------------+-----------------------------------+---------+\n| ``\\uxxxx`` | Character with 16-bit hex value | (1) |\n| | *xxxx* (Unicode only) | |\n+-------------------+-----------------------------------+---------+\n| ``\\Uxxxxxxxx`` | Character with 32-bit hex value | (2) |\n| | *xxxxxxxx* (Unicode only) | |\n+-------------------+-----------------------------------+---------+\n| ``\\v`` | ASCII Vertical Tab (VT) | |\n+-------------------+-----------------------------------+---------+\n| ``\\ooo`` | Character with octal value *ooo* | (3,5) |\n+-------------------+-----------------------------------+---------+\n| ``\\xhh`` | Character with hex value *hh* | (4,5) |\n+-------------------+-----------------------------------+---------+\n\nNotes:\n\n1. Individual code units which form parts of a surrogate pair can be\n encoded using this escape sequence.\n\n2. Any Unicode character can be encoded this way, but characters\n outside the Basic Multilingual Plane (BMP) will be encoded using a\n surrogate pair if Python is compiled to use 16-bit code units (the\n default). Individual code units which form parts of a surrogate\n pair can be encoded using this escape sequence.\n\n3. As in Standard C, up to three octal digits are accepted.\n\n4. Unlike in Standard C, exactly two hex digits are required.\n\n5. In a string literal, hexadecimal and octal escapes denote the byte\n with the given value; it is not necessary that the byte encodes a\n character in the source character set. In a Unicode literal, these\n escapes denote a Unicode character with the given value.\n\nUnlike Standard C, all unrecognized escape sequences are left in the\nstring unchanged, i.e., *the backslash is left in the string*. (This\nbehavior is useful when debugging: if an escape sequence is mistyped,\nthe resulting output is more easily recognized as broken.) It is also\nimportant to note that the escape sequences marked as "(Unicode only)"\nin the table above fall into the category of unrecognized escapes for\nnon-Unicode string literals.\n\nWhen an ``\'r\'`` or ``\'R\'`` prefix is present, a character following a\nbackslash is included in the string without change, and *all\nbackslashes are left in the string*. For example, the string literal\n``r"\\n"`` consists of two characters: a backslash and a lowercase\n``\'n\'``. String quotes can be escaped with a backslash, but the\nbackslash remains in the string; for example, ``r"\\""`` is a valid\nstring literal consisting of two characters: a backslash and a double\nquote; ``r"\\"`` is not a valid string literal (even a raw string\ncannot end in an odd number of backslashes). Specifically, *a raw\nstring cannot end in a single backslash* (since the backslash would\nescape the following quote character). Note also that a single\nbackslash followed by a newline is interpreted as those two characters\nas part of the string, *not* as a line continuation.\n\nWhen an ``\'r\'`` or ``\'R\'`` prefix is used in conjunction with a\n``\'u\'`` or ``\'U\'`` prefix, then the ``\\uXXXX`` and ``\\UXXXXXXXX``\nescape sequences are processed while *all other backslashes are left\nin the string*. For example, the string literal ``ur"\\u0062\\n"``\nconsists of three Unicode characters: \'LATIN SMALL LETTER B\', \'REVERSE\nSOLIDUS\', and \'LATIN SMALL LETTER N\'. Backslashes can be escaped with\na preceding backslash; however, both remain in the string. As a\nresult, ``\\uXXXX`` escape sequences are only recognized when there are\nan odd number of backslashes.\n', 'subscriptions': u'\nSubscriptions\n*************\n\nA subscription selects an item of a sequence (string, tuple or list)\nor mapping (dictionary) object:\n\n subscription ::= primary "[" expression_list "]"\n\nThe primary must evaluate to an object of a sequence or mapping type.\n\nIf the primary is a mapping, the expression list must evaluate to an\nobject whose value is one of the keys of the mapping, and the\nsubscription selects the value in the mapping that corresponds to that\nkey. (The expression list is a tuple except if it has exactly one\nitem.)\n\nIf the primary is a sequence, the expression (list) must evaluate to a\nplain integer. If this value is negative, the length of the sequence\nis added to it (so that, e.g., ``x[-1]`` selects the last item of\n``x``.) The resulting value must be a nonnegative integer less than\nthe number of items in the sequence, and the subscription selects the\nitem whose index is that value (counting from zero).\n\nA string\'s items are characters. A character is not a separate data\ntype but a string of exactly one character.\n', 'truth': u"\nTruth Value Testing\n*******************\n\nAny object can be tested for truth value, for use in an ``if`` or\n``while`` condition or as operand of the Boolean operations below. The\nfollowing values are considered false:\n\n* ``None``\n\n* ``False``\n\n* zero of any numeric type, for example, ``0``, ``0L``, ``0.0``,\n ``0j``.\n\n* any empty sequence, for example, ``''``, ``()``, ``[]``.\n\n* any empty mapping, for example, ``{}``.\n\n* instances of user-defined classes, if the class defines a\n ``__nonzero__()`` or ``__len__()`` method, when that method returns\n the integer zero or ``bool`` value ``False``. [1]\n\nAll other values are considered true --- so objects of many types are\nalways true.\n\nOperations and built-in functions that have a Boolean result always\nreturn ``0`` or ``False`` for false and ``1`` or ``True`` for true,\nunless otherwise stated. (Important exception: the Boolean operations\n``or`` and ``and`` always return one of their operands.)\n", 'try': u'\nThe ``try`` statement\n*********************\n\nThe ``try`` statement specifies exception handlers and/or cleanup code\nfor a group of statements:\n\n try_stmt ::= try1_stmt | try2_stmt\n try1_stmt ::= "try" ":" suite\n ("except" [expression ["," target]] ":" suite)+\n ["else" ":" suite]\n ["finally" ":" suite]\n try2_stmt ::= "try" ":" suite\n "finally" ":" suite\n\nChanged in version 2.5: In previous versions of Python,\n``try``...``except``...``finally`` did not work. ``try``...``except``\nhad to be nested in ``try``...``finally``.\n\nThe ``except`` clause(s) specify one or more exception handlers. When\nno exception occurs in the ``try`` clause, no exception handler is\nexecuted. When an exception occurs in the ``try`` suite, a search for\nan exception handler is started. This search inspects the except\nclauses in turn until one is found that matches the exception. An\nexpression-less except clause, if present, must be last; it matches\nany exception. For an except clause with an expression, that\nexpression is evaluated, and the clause matches the exception if the\nresulting object is "compatible" with the exception. An object is\ncompatible with an exception if it is the class or a base class of the\nexception object, a tuple containing an item compatible with the\nexception, or, in the (deprecated) case of string exceptions, is the\nraised string itself (note that the object identities must match, i.e.\nit must be the same string object, not just a string with the same\nvalue).\n\nIf no except clause matches the exception, the search for an exception\nhandler continues in the surrounding code and on the invocation stack.\n[1]\n\nIf the evaluation of an expression in the header of an except clause\nraises an exception, the original search for a handler is canceled and\na search starts for the new exception in the surrounding code and on\nthe call stack (it is treated as if the entire ``try`` statement\nraised the exception).\n\nWhen a matching except clause is found, the exception is assigned to\nthe target specified in that except clause, if present, and the except\nclause\'s suite is executed. All except clauses must have an\nexecutable block. When the end of this block is reached, execution\ncontinues normally after the entire try statement. (This means that\nif two nested handlers exist for the same exception, and the exception\noccurs in the try clause of the inner handler, the outer handler will\nnot handle the exception.)\n\nBefore an except clause\'s suite is executed, details about the\nexception are assigned to three variables in the ``sys`` module:\n``sys.exc_type`` receives the object identifying the exception;\n``sys.exc_value`` receives the exception\'s parameter;\n``sys.exc_traceback`` receives a traceback object (see section *The\nstandard type hierarchy*) identifying the point in the program where\nthe exception occurred. These details are also available through the\n``sys.exc_info()`` function, which returns a tuple ``(exc_type,\nexc_value, exc_traceback)``. Use of the corresponding variables is\ndeprecated in favor of this function, since their use is unsafe in a\nthreaded program. As of Python 1.5, the variables are restored to\ntheir previous values (before the call) when returning from a function\nthat handled an exception.\n\nThe optional ``else`` clause is executed if and when control flows off\nthe end of the ``try`` clause. [2] Exceptions in the ``else`` clause\nare not handled by the preceding ``except`` clauses.\n\nIf ``finally`` is present, it specifies a \'cleanup\' handler. The\n``try`` clause is executed, including any ``except`` and ``else``\nclauses. If an exception occurs in any of the clauses and is not\nhandled, the exception is temporarily saved. The ``finally`` clause is\nexecuted. If there is a saved exception, it is re-raised at the end\nof the ``finally`` clause. If the ``finally`` clause raises another\nexception or executes a ``return`` or ``break`` statement, the saved\nexception is lost. The exception information is not available to the\nprogram during execution of the ``finally`` clause.\n\nWhen a ``return``, ``break`` or ``continue`` statement is executed in\nthe ``try`` suite of a ``try``...``finally`` statement, the\n``finally`` clause is also executed \'on the way out.\' A ``continue``\nstatement is illegal in the ``finally`` clause. (The reason is a\nproblem with the current implementation --- this restriction may be\nlifted in the future).\n\nAdditional information on exceptions can be found in section\n*Exceptions*, and information on using the ``raise`` statement to\ngenerate exceptions may be found in section *The raise statement*.\n', - 'types': u'\nThe standard type hierarchy\n***************************\n\nBelow is a list of the types that are built into Python. Extension\nmodules (written in C, Java, or other languages, depending on the\nimplementation) can define additional types. Future versions of\nPython may add types to the type hierarchy (e.g., rational numbers,\nefficiently stored arrays of integers, etc.).\n\nSome of the type descriptions below contain a paragraph listing\n\'special attributes.\' These are attributes that provide access to the\nimplementation and are not intended for general use. Their definition\nmay change in the future.\n\nNone\n This type has a single value. There is a single object with this\n value. This object is accessed through the built-in name ``None``.\n It is used to signify the absence of a value in many situations,\n e.g., it is returned from functions that don\'t explicitly return\n anything. Its truth value is false.\n\nNotImplemented\n This type has a single value. There is a single object with this\n value. This object is accessed through the built-in name\n ``NotImplemented``. Numeric methods and rich comparison methods may\n return this value if they do not implement the operation for the\n operands provided. (The interpreter will then try the reflected\n operation, or some other fallback, depending on the operator.) Its\n truth value is true.\n\nEllipsis\n This type has a single value. There is a single object with this\n value. This object is accessed through the built-in name\n ``Ellipsis``. It is used to indicate the presence of the ``...``\n syntax in a slice. Its truth value is true.\n\n``numbers.Number``\n These are created by numeric literals and returned as results by\n arithmetic operators and arithmetic built-in functions. Numeric\n objects are immutable; once created their value never changes.\n Python numbers are of course strongly related to mathematical\n numbers, but subject to the limitations of numerical representation\n in computers.\n\n Python distinguishes between integers, floating point numbers, and\n complex numbers:\n\n ``numbers.Integral``\n These represent elements from the mathematical set of integers\n (positive and negative).\n\n There are three types of integers:\n\n Plain integers\n These represent numbers in the range -2147483648 through\n 2147483647. (The range may be larger on machines with a\n larger natural word size, but not smaller.) When the result\n of an operation would fall outside this range, the result is\n normally returned as a long integer (in some cases, the\n exception ``OverflowError`` is raised instead). For the\n purpose of shift and mask operations, integers are assumed to\n have a binary, 2\'s complement notation using 32 or more bits,\n and hiding no bits from the user (i.e., all 4294967296\n different bit patterns correspond to different values).\n\n Long integers\n These represent numbers in an unlimited range, subject to\n available (virtual) memory only. For the purpose of shift\n and mask operations, a binary representation is assumed, and\n negative numbers are represented in a variant of 2\'s\n complement which gives the illusion of an infinite string of\n sign bits extending to the left.\n\n Booleans\n These represent the truth values False and True. The two\n objects representing the values False and True are the only\n Boolean objects. The Boolean type is a subtype of plain\n integers, and Boolean values behave like the values 0 and 1,\n respectively, in almost all contexts, the exception being\n that when converted to a string, the strings ``"False"`` or\n ``"True"`` are returned, respectively.\n\n The rules for integer representation are intended to give the\n most meaningful interpretation of shift and mask operations\n involving negative integers and the least surprises when\n switching between the plain and long integer domains. Any\n operation, if it yields a result in the plain integer domain,\n will yield the same result in the long integer domain or when\n using mixed operands. The switch between domains is transparent\n to the programmer.\n\n ``numbers.Real`` (``float``)\n These represent machine-level double precision floating point\n numbers. You are at the mercy of the underlying machine\n architecture (and C or Java implementation) for the accepted\n range and handling of overflow. Python does not support single-\n precision floating point numbers; the savings in processor and\n memory usage that are usually the reason for using these is\n dwarfed by the overhead of using objects in Python, so there is\n no reason to complicate the language with two kinds of floating\n point numbers.\n\n ``numbers.Complex``\n These represent complex numbers as a pair of machine-level\n double precision floating point numbers. The same caveats apply\n as for floating point numbers. The real and imaginary parts of a\n complex number ``z`` can be retrieved through the read-only\n attributes ``z.real`` and ``z.imag``.\n\nSequences\n These represent finite ordered sets indexed by non-negative\n numbers. The built-in function ``len()`` returns the number of\n items of a sequence. When the length of a sequence is *n*, the\n index set contains the numbers 0, 1, ..., *n*-1. Item *i* of\n sequence *a* is selected by ``a[i]``.\n\n Sequences also support slicing: ``a[i:j]`` selects all items with\n index *k* such that *i* ``<=`` *k* ``<`` *j*. When used as an\n expression, a slice is a sequence of the same type. This implies\n that the index set is renumbered so that it starts at 0.\n\n Some sequences also support "extended slicing" with a third "step"\n parameter: ``a[i:j:k]`` selects all items of *a* with index *x*\n where ``x = i + n*k``, *n* ``>=`` ``0`` and *i* ``<=`` *x* ``<``\n *j*.\n\n Sequences are distinguished according to their mutability:\n\n Immutable sequences\n An object of an immutable sequence type cannot change once it is\n created. (If the object contains references to other objects,\n these other objects may be mutable and may be changed; however,\n the collection of objects directly referenced by an immutable\n object cannot change.)\n\n The following types are immutable sequences:\n\n Strings\n The items of a string are characters. There is no separate\n character type; a character is represented by a string of one\n item. Characters represent (at least) 8-bit bytes. The\n built-in functions ``chr()`` and ``ord()`` convert between\n characters and nonnegative integers representing the byte\n values. Bytes with the values 0-127 usually represent the\n corresponding ASCII values, but the interpretation of values\n is up to the program. The string data type is also used to\n represent arrays of bytes, e.g., to hold data read from a\n file.\n\n (On systems whose native character set is not ASCII, strings\n may use EBCDIC in their internal representation, provided the\n functions ``chr()`` and ``ord()`` implement a mapping between\n ASCII and EBCDIC, and string comparison preserves the ASCII\n order. Or perhaps someone can propose a better rule?)\n\n Unicode\n The items of a Unicode object are Unicode code units. A\n Unicode code unit is represented by a Unicode object of one\n item and can hold either a 16-bit or 32-bit value\n representing a Unicode ordinal (the maximum value for the\n ordinal is given in ``sys.maxunicode``, and depends on how\n Python is configured at compile time). Surrogate pairs may\n be present in the Unicode object, and will be reported as two\n separate items. The built-in functions ``unichr()`` and\n ``ord()`` convert between code units and nonnegative integers\n representing the Unicode ordinals as defined in the Unicode\n Standard 3.0. Conversion from and to other encodings are\n possible through the Unicode method ``encode()`` and the\n built-in function ``unicode()``.\n\n Tuples\n The items of a tuple are arbitrary Python objects. Tuples of\n two or more items are formed by comma-separated lists of\n expressions. A tuple of one item (a \'singleton\') can be\n formed by affixing a comma to an expression (an expression by\n itself does not create a tuple, since parentheses must be\n usable for grouping of expressions). An empty tuple can be\n formed by an empty pair of parentheses.\n\n Mutable sequences\n Mutable sequences can be changed after they are created. The\n subscription and slicing notations can be used as the target of\n assignment and ``del`` (delete) statements.\n\n There is currently a single intrinsic mutable sequence type:\n\n Lists\n The items of a list are arbitrary Python objects. Lists are\n formed by placing a comma-separated list of expressions in\n square brackets. (Note that there are no special cases needed\n to form lists of length 0 or 1.)\n\n The extension module ``array`` provides an additional example of\n a mutable sequence type.\n\nSet types\n These represent unordered, finite sets of unique, immutable\n objects. As such, they cannot be indexed by any subscript. However,\n they can be iterated over, and the built-in function ``len()``\n returns the number of items in a set. Common uses for sets are fast\n membership testing, removing duplicates from a sequence, and\n computing mathematical operations such as intersection, union,\n difference, and symmetric difference.\n\n For set elements, the same immutability rules apply as for\n dictionary keys. Note that numeric types obey the normal rules for\n numeric comparison: if two numbers compare equal (e.g., ``1`` and\n ``1.0``), only one of them can be contained in a set.\n\n There are currently two intrinsic set types:\n\n Sets\n These represent a mutable set. They are created by the built-in\n ``set()`` constructor and can be modified afterwards by several\n methods, such as ``add()``.\n\n Frozen sets\n These represent an immutable set. They are created by the\n built-in ``frozenset()`` constructor. As a frozenset is\n immutable and *hashable*, it can be used again as an element of\n another set, or as a dictionary key.\n\nMappings\n These represent finite sets of objects indexed by arbitrary index\n sets. The subscript notation ``a[k]`` selects the item indexed by\n ``k`` from the mapping ``a``; this can be used in expressions and\n as the target of assignments or ``del`` statements. The built-in\n function ``len()`` returns the number of items in a mapping.\n\n There is currently a single intrinsic mapping type:\n\n Dictionaries\n These represent finite sets of objects indexed by nearly\n arbitrary values. The only types of values not acceptable as\n keys are values containing lists or dictionaries or other\n mutable types that are compared by value rather than by object\n identity, the reason being that the efficient implementation of\n dictionaries requires a key\'s hash value to remain constant.\n Numeric types used for keys obey the normal rules for numeric\n comparison: if two numbers compare equal (e.g., ``1`` and\n ``1.0``) then they can be used interchangeably to index the same\n dictionary entry.\n\n Dictionaries are mutable; they can be created by the ``{...}``\n notation (see section *Dictionary displays*).\n\n The extension modules ``dbm``, ``gdbm``, and ``bsddb`` provide\n additional examples of mapping types.\n\nCallable types\n These are the types to which the function call operation (see\n section *Calls*) can be applied:\n\n User-defined functions\n A user-defined function object is created by a function\n definition (see section *Function definitions*). It should be\n called with an argument list containing the same number of items\n as the function\'s formal parameter list.\n\n Special attributes:\n\n +-------------------------+---------------------------------+-------------+\n | Attribute | Meaning | |\n +=========================+=================================+=============+\n | ``func_doc`` | The function\'s documentation | Writable |\n | | string, or ``None`` if | |\n | | unavailable | |\n +-------------------------+---------------------------------+-------------+\n | ``__doc__`` | Another way of spelling | Writable |\n | | ``func_doc`` | |\n +-------------------------+---------------------------------+-------------+\n | ``func_name`` | The function\'s name | Writable |\n +-------------------------+---------------------------------+-------------+\n | ``__name__`` | Another way of spelling | Writable |\n | | ``func_name`` | |\n +-------------------------+---------------------------------+-------------+\n | ``__module__`` | The name of the module the | Writable |\n | | function was defined in, or | |\n | | ``None`` if unavailable. | |\n +-------------------------+---------------------------------+-------------+\n | ``func_defaults`` | A tuple containing default | Writable |\n | | argument values for those | |\n | | arguments that have defaults, | |\n | | or ``None`` if no arguments | |\n | | have a default value | |\n +-------------------------+---------------------------------+-------------+\n | ``func_code`` | The code object representing | Writable |\n | | the compiled function body. | |\n +-------------------------+---------------------------------+-------------+\n | ``func_globals`` | A reference to the dictionary | Read-only |\n | | that holds the function\'s | |\n | | global variables --- the global | |\n | | namespace of the module in | |\n | | which the function was defined. | |\n +-------------------------+---------------------------------+-------------+\n | ``func_dict`` | The namespace supporting | Writable |\n | | arbitrary function attributes. | |\n +-------------------------+---------------------------------+-------------+\n | ``func_closure`` | ``None`` or a tuple of cells | Read-only |\n | | that contain bindings for the | |\n | | function\'s free variables. | |\n +-------------------------+---------------------------------+-------------+\n\n Most of the attributes labelled "Writable" check the type of the\n assigned value.\n\n Changed in version 2.4: ``func_name`` is now writable.\n\n Function objects also support getting and setting arbitrary\n attributes, which can be used, for example, to attach metadata\n to functions. Regular attribute dot-notation is used to get and\n set such attributes. *Note that the current implementation only\n supports function attributes on user-defined functions. Function\n attributes on built-in functions may be supported in the\n future.*\n\n Additional information about a function\'s definition can be\n retrieved from its code object; see the description of internal\n types below.\n\n User-defined methods\n A user-defined method object combines a class, a class instance\n (or ``None``) and any callable object (normally a user-defined\n function).\n\n Special read-only attributes: ``im_self`` is the class instance\n object, ``im_func`` is the function object; ``im_class`` is the\n class of ``im_self`` for bound methods or the class that asked\n for the method for unbound methods; ``__doc__`` is the method\'s\n documentation (same as ``im_func.__doc__``); ``__name__`` is the\n method name (same as ``im_func.__name__``); ``__module__`` is\n the name of the module the method was defined in, or ``None`` if\n unavailable.\n\n Changed in version 2.2: ``im_self`` used to refer to the class\n that defined the method.\n\n Changed in version 2.6: For 3.0 forward-compatibility,\n ``im_func`` is also available as ``__func__``, and ``im_self``\n as ``__self__``.\n\n Methods also support accessing (but not setting) the arbitrary\n function attributes on the underlying function object.\n\n User-defined method objects may be created when getting an\n attribute of a class (perhaps via an instance of that class), if\n that attribute is a user-defined function object, an unbound\n user-defined method object, or a class method object. When the\n attribute is a user-defined method object, a new method object\n is only created if the class from which it is being retrieved is\n the same as, or a derived class of, the class stored in the\n original method object; otherwise, the original method object is\n used as it is.\n\n When a user-defined method object is created by retrieving a\n user-defined function object from a class, its ``im_self``\n attribute is ``None`` and the method object is said to be\n unbound. When one is created by retrieving a user-defined\n function object from a class via one of its instances, its\n ``im_self`` attribute is the instance, and the method object is\n said to be bound. In either case, the new method\'s ``im_class``\n attribute is the class from which the retrieval takes place, and\n its ``im_func`` attribute is the original function object.\n\n When a user-defined method object is created by retrieving\n another method object from a class or instance, the behaviour is\n the same as for a function object, except that the ``im_func``\n attribute of the new instance is not the original method object\n but its ``im_func`` attribute.\n\n When a user-defined method object is created by retrieving a\n class method object from a class or instance, its ``im_self``\n attribute is the class itself (the same as the ``im_class``\n attribute), and its ``im_func`` attribute is the function object\n underlying the class method.\n\n When an unbound user-defined method object is called, the\n underlying function (``im_func``) is called, with the\n restriction that the first argument must be an instance of the\n proper class (``im_class``) or of a derived class thereof.\n\n When a bound user-defined method object is called, the\n underlying function (``im_func``) is called, inserting the class\n instance (``im_self``) in front of the argument list. For\n instance, when ``C`` is a class which contains a definition for\n a function ``f()``, and ``x`` is an instance of ``C``, calling\n ``x.f(1)`` is equivalent to calling ``C.f(x, 1)``.\n\n When a user-defined method object is derived from a class method\n object, the "class instance" stored in ``im_self`` will actually\n be the class itself, so that calling either ``x.f(1)`` or\n ``C.f(1)`` is equivalent to calling ``f(C,1)`` where ``f`` is\n the underlying function.\n\n Note that the transformation from function object to (unbound or\n bound) method object happens each time the attribute is\n retrieved from the class or instance. In some cases, a fruitful\n optimization is to assign the attribute to a local variable and\n call that local variable. Also notice that this transformation\n only happens for user-defined functions; other callable objects\n (and all non-callable objects) are retrieved without\n transformation. It is also important to note that user-defined\n functions which are attributes of a class instance are not\n converted to bound methods; this *only* happens when the\n function is an attribute of the class.\n\n Generator functions\n A function or method which uses the ``yield`` statement (see\n section *The yield statement*) is called a *generator function*.\n Such a function, when called, always returns an iterator object\n which can be used to execute the body of the function: calling\n the iterator\'s ``next()`` method will cause the function to\n execute until it provides a value using the ``yield`` statement.\n When the function executes a ``return`` statement or falls off\n the end, a ``StopIteration`` exception is raised and the\n iterator will have reached the end of the set of values to be\n returned.\n\n Built-in functions\n A built-in function object is a wrapper around a C function.\n Examples of built-in functions are ``len()`` and ``math.sin()``\n (``math`` is a standard built-in module). The number and type of\n the arguments are determined by the C function. Special read-\n only attributes: ``__doc__`` is the function\'s documentation\n string, or ``None`` if unavailable; ``__name__`` is the\n function\'s name; ``__self__`` is set to ``None`` (but see the\n next item); ``__module__`` is the name of the module the\n function was defined in or ``None`` if unavailable.\n\n Built-in methods\n This is really a different disguise of a built-in function, this\n time containing an object passed to the C function as an\n implicit extra argument. An example of a built-in method is\n ``alist.append()``, assuming *alist* is a list object. In this\n case, the special read-only attribute ``__self__`` is set to the\n object denoted by *list*.\n\n Class Types\n Class types, or "new-style classes," are callable. These\n objects normally act as factories for new instances of\n themselves, but variations are possible for class types that\n override ``__new__()``. The arguments of the call are passed to\n ``__new__()`` and, in the typical case, to ``__init__()`` to\n initialize the new instance.\n\n Classic Classes\n Class objects are described below. When a class object is\n called, a new class instance (also described below) is created\n and returned. This implies a call to the class\'s ``__init__()``\n method if it has one. Any arguments are passed on to the\n ``__init__()`` method. If there is no ``__init__()`` method,\n the class must be called without arguments.\n\n Class instances\n Class instances are described below. Class instances are\n callable only when the class has a ``__call__()`` method;\n ``x(arguments)`` is a shorthand for ``x.__call__(arguments)``.\n\nModules\n Modules are imported by the ``import`` statement (see section *The\n import statement*). A module object has a namespace implemented by\n a dictionary object (this is the dictionary referenced by the\n func_globals attribute of functions defined in the module).\n Attribute references are translated to lookups in this dictionary,\n e.g., ``m.x`` is equivalent to ``m.__dict__["x"]``. A module object\n does not contain the code object used to initialize the module\n (since it isn\'t needed once the initialization is done).\n\n Attribute assignment updates the module\'s namespace dictionary,\n e.g., ``m.x = 1`` is equivalent to ``m.__dict__["x"] = 1``.\n\n Special read-only attribute: ``__dict__`` is the module\'s namespace\n as a dictionary object.\n\n Predefined (writable) attributes: ``__name__`` is the module\'s\n name; ``__doc__`` is the module\'s documentation string, or ``None``\n if unavailable; ``__file__`` is the pathname of the file from which\n the module was loaded, if it was loaded from a file. The\n ``__file__`` attribute is not present for C modules that are\n statically linked into the interpreter; for extension modules\n loaded dynamically from a shared library, it is the pathname of the\n shared library file.\n\nClasses\n Class objects are created by class definitions (see section *Class\n definitions*). A class has a namespace implemented by a dictionary\n object. Class attribute references are translated to lookups in\n this dictionary, e.g., ``C.x`` is translated to\n ``C.__dict__["x"]``. When the attribute name is not found there,\n the attribute search continues in the base classes. The search is\n depth-first, left-to-right in the order of occurrence in the base\n class list.\n\n When a class attribute reference (for class ``C``, say) would yield\n a user-defined function object or an unbound user-defined method\n object whose associated class is either ``C`` or one of its base\n classes, it is transformed into an unbound user-defined method\n object whose ``im_class`` attribute is ``C``. When it would yield a\n class method object, it is transformed into a bound user-defined\n method object whose ``im_class`` and ``im_self`` attributes are\n both ``C``. When it would yield a static method object, it is\n transformed into the object wrapped by the static method object.\n See section *Implementing Descriptors* for another way in which\n attributes retrieved from a class may differ from those actually\n contained in its ``__dict__``.\n\n Class attribute assignments update the class\'s dictionary, never\n the dictionary of a base class.\n\n A class object can be called (see above) to yield a class instance\n (see below).\n\n Special attributes: ``__name__`` is the class name; ``__module__``\n is the module name in which the class was defined; ``__dict__`` is\n the dictionary containing the class\'s namespace; ``__bases__`` is a\n tuple (possibly empty or a singleton) containing the base classes,\n in the order of their occurrence in the base class list;\n ``__doc__`` is the class\'s documentation string, or None if\n undefined.\n\nClass instances\n A class instance is created by calling a class object (see above).\n A class instance has a namespace implemented as a dictionary which\n is the first place in which attribute references are searched.\n When an attribute is not found there, and the instance\'s class has\n an attribute by that name, the search continues with the class\n attributes. If a class attribute is found that is a user-defined\n function object or an unbound user-defined method object whose\n associated class is the class (call it ``C``) of the instance for\n which the attribute reference was initiated or one of its bases, it\n is transformed into a bound user-defined method object whose\n ``im_class`` attribute is ``C`` and whose ``im_self`` attribute is\n the instance. Static method and class method objects are also\n transformed, as if they had been retrieved from class ``C``; see\n above under "Classes". See section *Implementing Descriptors* for\n another way in which attributes of a class retrieved via its\n instances may differ from the objects actually stored in the\n class\'s ``__dict__``. If no class attribute is found, and the\n object\'s class has a ``__getattr__()`` method, that is called to\n satisfy the lookup.\n\n Attribute assignments and deletions update the instance\'s\n dictionary, never a class\'s dictionary. If the class has a\n ``__setattr__()`` or ``__delattr__()`` method, this is called\n instead of updating the instance dictionary directly.\n\n Class instances can pretend to be numbers, sequences, or mappings\n if they have methods with certain special names. See section\n *Special method names*.\n\n Special attributes: ``__dict__`` is the attribute dictionary;\n ``__class__`` is the instance\'s class.\n\nFiles\n A file object represents an open file. File objects are created by\n the ``open()`` built-in function, and also by ``os.popen()``,\n ``os.fdopen()``, and the ``makefile()`` method of socket objects\n (and perhaps by other functions or methods provided by extension\n modules). The objects ``sys.stdin``, ``sys.stdout`` and\n ``sys.stderr`` are initialized to file objects corresponding to the\n interpreter\'s standard input, output and error streams. See *File\n Objects* for complete documentation of file objects.\n\nInternal types\n A few types used internally by the interpreter are exposed to the\n user. Their definitions may change with future versions of the\n interpreter, but they are mentioned here for completeness.\n\n Code objects\n Code objects represent *byte-compiled* executable Python code,\n or *bytecode*. The difference between a code object and a\n function object is that the function object contains an explicit\n reference to the function\'s globals (the module in which it was\n defined), while a code object contains no context; also the\n default argument values are stored in the function object, not\n in the code object (because they represent values calculated at\n run-time). Unlike function objects, code objects are immutable\n and contain no references (directly or indirectly) to mutable\n objects.\n\n Special read-only attributes: ``co_name`` gives the function\n name; ``co_argcount`` is the number of positional arguments\n (including arguments with default values); ``co_nlocals`` is the\n number of local variables used by the function (including\n arguments); ``co_varnames`` is a tuple containing the names of\n the local variables (starting with the argument names);\n ``co_cellvars`` is a tuple containing the names of local\n variables that are referenced by nested functions;\n ``co_freevars`` is a tuple containing the names of free\n variables; ``co_code`` is a string representing the sequence of\n bytecode instructions; ``co_consts`` is a tuple containing the\n literals used by the bytecode; ``co_names`` is a tuple\n containing the names used by the bytecode; ``co_filename`` is\n the filename from which the code was compiled;\n ``co_firstlineno`` is the first line number of the function;\n ``co_lnotab`` is a string encoding the mapping from bytecode\n offsets to line numbers (for details see the source code of the\n interpreter); ``co_stacksize`` is the required stack size\n (including local variables); ``co_flags`` is an integer encoding\n a number of flags for the interpreter.\n\n The following flag bits are defined for ``co_flags``: bit\n ``0x04`` is set if the function uses the ``*arguments`` syntax\n to accept an arbitrary number of positional arguments; bit\n ``0x08`` is set if the function uses the ``**keywords`` syntax\n to accept arbitrary keyword arguments; bit ``0x20`` is set if\n the function is a generator.\n\n Future feature declarations (``from __future__ import\n division``) also use bits in ``co_flags`` to indicate whether a\n code object was compiled with a particular feature enabled: bit\n ``0x2000`` is set if the function was compiled with future\n division enabled; bits ``0x10`` and ``0x1000`` were used in\n earlier versions of Python.\n\n Other bits in ``co_flags`` are reserved for internal use.\n\n If a code object represents a function, the first item in\n ``co_consts`` is the documentation string of the function, or\n ``None`` if undefined.\n\n Frame objects\n Frame objects represent execution frames. They may occur in\n traceback objects (see below).\n\n Special read-only attributes: ``f_back`` is to the previous\n stack frame (towards the caller), or ``None`` if this is the\n bottom stack frame; ``f_code`` is the code object being executed\n in this frame; ``f_locals`` is the dictionary used to look up\n local variables; ``f_globals`` is used for global variables;\n ``f_builtins`` is used for built-in (intrinsic) names;\n ``f_restricted`` is a flag indicating whether the function is\n executing in restricted execution mode; ``f_lasti`` gives the\n precise instruction (this is an index into the bytecode string\n of the code object).\n\n Special writable attributes: ``f_trace``, if not ``None``, is a\n function called at the start of each source code line (this is\n used by the debugger); ``f_exc_type``, ``f_exc_value``,\n ``f_exc_traceback`` represent the last exception raised in the\n parent frame provided another exception was ever raised in the\n current frame (in all other cases they are None); ``f_lineno``\n is the current line number of the frame --- writing to this from\n within a trace function jumps to the given line (only for the\n bottom-most frame). A debugger can implement a Jump command\n (aka Set Next Statement) by writing to f_lineno.\n\n Traceback objects\n Traceback objects represent a stack trace of an exception. A\n traceback object is created when an exception occurs. When the\n search for an exception handler unwinds the execution stack, at\n each unwound level a traceback object is inserted in front of\n the current traceback. When an exception handler is entered,\n the stack trace is made available to the program. (See section\n *The try statement*.) It is accessible as ``sys.exc_traceback``,\n and also as the third item of the tuple returned by\n ``sys.exc_info()``. The latter is the preferred interface,\n since it works correctly when the program is using multiple\n threads. When the program contains no suitable handler, the\n stack trace is written (nicely formatted) to the standard error\n stream; if the interpreter is interactive, it is also made\n available to the user as ``sys.last_traceback``.\n\n Special read-only attributes: ``tb_next`` is the next level in\n the stack trace (towards the frame where the exception\n occurred), or ``None`` if there is no next level; ``tb_frame``\n points to the execution frame of the current level;\n ``tb_lineno`` gives the line number where the exception\n occurred; ``tb_lasti`` indicates the precise instruction. The\n line number and last instruction in the traceback may differ\n from the line number of its frame object if the exception\n occurred in a ``try`` statement with no matching except clause\n or with a finally clause.\n\n Slice objects\n Slice objects are used to represent slices when *extended slice\n syntax* is used. This is a slice using two colons, or multiple\n slices or ellipses separated by commas, e.g., ``a[i:j:step]``,\n ``a[i:j, k:l]``, or ``a[..., i:j]``. They are also created by\n the built-in ``slice()`` function.\n\n Special read-only attributes: ``start`` is the lower bound;\n ``stop`` is the upper bound; ``step`` is the step value; each is\n ``None`` if omitted. These attributes can have any type.\n\n Slice objects support one method:\n\n slice.indices(self, length)\n\n This method takes a single integer argument *length* and\n computes information about the extended slice that the slice\n object would describe if applied to a sequence of *length*\n items. It returns a tuple of three integers; respectively\n these are the *start* and *stop* indices and the *step* or\n stride length of the slice. Missing or out-of-bounds indices\n are handled in a manner consistent with regular slices.\n\n Added in version 2.3.\n\n Static method objects\n Static method objects provide a way of defeating the\n transformation of function objects to method objects described\n above. A static method object is a wrapper around any other\n object, usually a user-defined method object. When a static\n method object is retrieved from a class or a class instance, the\n object actually returned is the wrapped object, which is not\n subject to any further transformation. Static method objects are\n not themselves callable, although the objects they wrap usually\n are. Static method objects are created by the built-in\n ``staticmethod()`` constructor.\n\n Class method objects\n A class method object, like a static method object, is a wrapper\n around another object that alters the way in which that object\n is retrieved from classes and class instances. The behaviour of\n class method objects upon such retrieval is described above,\n under "User-defined methods". Class method objects are created\n by the built-in ``classmethod()`` constructor.\n', + 'types': u'\nThe standard type hierarchy\n***************************\n\nBelow is a list of the types that are built into Python. Extension\nmodules (written in C, Java, or other languages, depending on the\nimplementation) can define additional types. Future versions of\nPython may add types to the type hierarchy (e.g., rational numbers,\nefficiently stored arrays of integers, etc.).\n\nSome of the type descriptions below contain a paragraph listing\n\'special attributes.\' These are attributes that provide access to the\nimplementation and are not intended for general use. Their definition\nmay change in the future.\n\nNone\n This type has a single value. There is a single object with this\n value. This object is accessed through the built-in name ``None``.\n It is used to signify the absence of a value in many situations,\n e.g., it is returned from functions that don\'t explicitly return\n anything. Its truth value is false.\n\nNotImplemented\n This type has a single value. There is a single object with this\n value. This object is accessed through the built-in name\n ``NotImplemented``. Numeric methods and rich comparison methods may\n return this value if they do not implement the operation for the\n operands provided. (The interpreter will then try the reflected\n operation, or some other fallback, depending on the operator.) Its\n truth value is true.\n\nEllipsis\n This type has a single value. There is a single object with this\n value. This object is accessed through the built-in name\n ``Ellipsis``. It is used to indicate the presence of the ``...``\n syntax in a slice. Its truth value is true.\n\n``numbers.Number``\n These are created by numeric literals and returned as results by\n arithmetic operators and arithmetic built-in functions. Numeric\n objects are immutable; once created their value never changes.\n Python numbers are of course strongly related to mathematical\n numbers, but subject to the limitations of numerical representation\n in computers.\n\n Python distinguishes between integers, floating point numbers, and\n complex numbers:\n\n ``numbers.Integral``\n These represent elements from the mathematical set of integers\n (positive and negative).\n\n There are three types of integers:\n\n Plain integers\n These represent numbers in the range -2147483648 through\n 2147483647. (The range may be larger on machines with a\n larger natural word size, but not smaller.) When the result\n of an operation would fall outside this range, the result is\n normally returned as a long integer (in some cases, the\n exception ``OverflowError`` is raised instead). For the\n purpose of shift and mask operations, integers are assumed to\n have a binary, 2\'s complement notation using 32 or more bits,\n and hiding no bits from the user (i.e., all 4294967296\n different bit patterns correspond to different values).\n\n Long integers\n These represent numbers in an unlimited range, subject to\n available (virtual) memory only. For the purpose of shift\n and mask operations, a binary representation is assumed, and\n negative numbers are represented in a variant of 2\'s\n complement which gives the illusion of an infinite string of\n sign bits extending to the left.\n\n Booleans\n These represent the truth values False and True. The two\n objects representing the values False and True are the only\n Boolean objects. The Boolean type is a subtype of plain\n integers, and Boolean values behave like the values 0 and 1,\n respectively, in almost all contexts, the exception being\n that when converted to a string, the strings ``"False"`` or\n ``"True"`` are returned, respectively.\n\n The rules for integer representation are intended to give the\n most meaningful interpretation of shift and mask operations\n involving negative integers and the least surprises when\n switching between the plain and long integer domains. Any\n operation, if it yields a result in the plain integer domain,\n will yield the same result in the long integer domain or when\n using mixed operands. The switch between domains is transparent\n to the programmer.\n\n ``numbers.Real`` (``float``)\n These represent machine-level double precision floating point\n numbers. You are at the mercy of the underlying machine\n architecture (and C or Java implementation) for the accepted\n range and handling of overflow. Python does not support single-\n precision floating point numbers; the savings in processor and\n memory usage that are usually the reason for using these is\n dwarfed by the overhead of using objects in Python, so there is\n no reason to complicate the language with two kinds of floating\n point numbers.\n\n ``numbers.Complex``\n These represent complex numbers as a pair of machine-level\n double precision floating point numbers. The same caveats apply\n as for floating point numbers. The real and imaginary parts of a\n complex number ``z`` can be retrieved through the read-only\n attributes ``z.real`` and ``z.imag``.\n\nSequences\n These represent finite ordered sets indexed by non-negative\n numbers. The built-in function ``len()`` returns the number of\n items of a sequence. When the length of a sequence is *n*, the\n index set contains the numbers 0, 1, ..., *n*-1. Item *i* of\n sequence *a* is selected by ``a[i]``.\n\n Sequences also support slicing: ``a[i:j]`` selects all items with\n index *k* such that *i* ``<=`` *k* ``<`` *j*. When used as an\n expression, a slice is a sequence of the same type. This implies\n that the index set is renumbered so that it starts at 0.\n\n Some sequences also support "extended slicing" with a third "step"\n parameter: ``a[i:j:k]`` selects all items of *a* with index *x*\n where ``x = i + n*k``, *n* ``>=`` ``0`` and *i* ``<=`` *x* ``<``\n *j*.\n\n Sequences are distinguished according to their mutability:\n\n Immutable sequences\n An object of an immutable sequence type cannot change once it is\n created. (If the object contains references to other objects,\n these other objects may be mutable and may be changed; however,\n the collection of objects directly referenced by an immutable\n object cannot change.)\n\n The following types are immutable sequences:\n\n Strings\n The items of a string are characters. There is no separate\n character type; a character is represented by a string of one\n item. Characters represent (at least) 8-bit bytes. The\n built-in functions ``chr()`` and ``ord()`` convert between\n characters and nonnegative integers representing the byte\n values. Bytes with the values 0-127 usually represent the\n corresponding ASCII values, but the interpretation of values\n is up to the program. The string data type is also used to\n represent arrays of bytes, e.g., to hold data read from a\n file.\n\n (On systems whose native character set is not ASCII, strings\n may use EBCDIC in their internal representation, provided the\n functions ``chr()`` and ``ord()`` implement a mapping between\n ASCII and EBCDIC, and string comparison preserves the ASCII\n order. Or perhaps someone can propose a better rule?)\n\n Unicode\n The items of a Unicode object are Unicode code units. A\n Unicode code unit is represented by a Unicode object of one\n item and can hold either a 16-bit or 32-bit value\n representing a Unicode ordinal (the maximum value for the\n ordinal is given in ``sys.maxunicode``, and depends on how\n Python is configured at compile time). Surrogate pairs may\n be present in the Unicode object, and will be reported as two\n separate items. The built-in functions ``unichr()`` and\n ``ord()`` convert between code units and nonnegative integers\n representing the Unicode ordinals as defined in the Unicode\n Standard 3.0. Conversion from and to other encodings are\n possible through the Unicode method ``encode()`` and the\n built-in function ``unicode()``.\n\n Tuples\n The items of a tuple are arbitrary Python objects. Tuples of\n two or more items are formed by comma-separated lists of\n expressions. A tuple of one item (a \'singleton\') can be\n formed by affixing a comma to an expression (an expression by\n itself does not create a tuple, since parentheses must be\n usable for grouping of expressions). An empty tuple can be\n formed by an empty pair of parentheses.\n\n Mutable sequences\n Mutable sequences can be changed after they are created. The\n subscription and slicing notations can be used as the target of\n assignment and ``del`` (delete) statements.\n\n There is currently a single intrinsic mutable sequence type:\n\n Lists\n The items of a list are arbitrary Python objects. Lists are\n formed by placing a comma-separated list of expressions in\n square brackets. (Note that there are no special cases needed\n to form lists of length 0 or 1.)\n\n The extension module ``array`` provides an additional example of\n a mutable sequence type.\n\nSet types\n These represent unordered, finite sets of unique, immutable\n objects. As such, they cannot be indexed by any subscript. However,\n they can be iterated over, and the built-in function ``len()``\n returns the number of items in a set. Common uses for sets are fast\n membership testing, removing duplicates from a sequence, and\n computing mathematical operations such as intersection, union,\n difference, and symmetric difference.\n\n For set elements, the same immutability rules apply as for\n dictionary keys. Note that numeric types obey the normal rules for\n numeric comparison: if two numbers compare equal (e.g., ``1`` and\n ``1.0``), only one of them can be contained in a set.\n\n There are currently two intrinsic set types:\n\n Sets\n These represent a mutable set. They are created by the built-in\n ``set()`` constructor and can be modified afterwards by several\n methods, such as ``add()``.\n\n Frozen sets\n These represent an immutable set. They are created by the\n built-in ``frozenset()`` constructor. As a frozenset is\n immutable and *hashable*, it can be used again as an element of\n another set, or as a dictionary key.\n\nMappings\n These represent finite sets of objects indexed by arbitrary index\n sets. The subscript notation ``a[k]`` selects the item indexed by\n ``k`` from the mapping ``a``; this can be used in expressions and\n as the target of assignments or ``del`` statements. The built-in\n function ``len()`` returns the number of items in a mapping.\n\n There is currently a single intrinsic mapping type:\n\n Dictionaries\n These represent finite sets of objects indexed by nearly\n arbitrary values. The only types of values not acceptable as\n keys are values containing lists or dictionaries or other\n mutable types that are compared by value rather than by object\n identity, the reason being that the efficient implementation of\n dictionaries requires a key\'s hash value to remain constant.\n Numeric types used for keys obey the normal rules for numeric\n comparison: if two numbers compare equal (e.g., ``1`` and\n ``1.0``) then they can be used interchangeably to index the same\n dictionary entry.\n\n Dictionaries are mutable; they can be created by the ``{...}``\n notation (see section *Dictionary displays*).\n\n The extension modules ``dbm``, ``gdbm``, and ``bsddb`` provide\n additional examples of mapping types.\n\nCallable types\n These are the types to which the function call operation (see\n section *Calls*) can be applied:\n\n User-defined functions\n A user-defined function object is created by a function\n definition (see section *Function definitions*). It should be\n called with an argument list containing the same number of items\n as the function\'s formal parameter list.\n\n Special attributes:\n\n +-------------------------+---------------------------------+-------------+\n | Attribute | Meaning | |\n +=========================+=================================+=============+\n | ``func_doc`` | The function\'s documentation | Writable |\n | | string, or ``None`` if | |\n | | unavailable | |\n +-------------------------+---------------------------------+-------------+\n | ``__doc__`` | Another way of spelling | Writable |\n | | ``func_doc`` | |\n +-------------------------+---------------------------------+-------------+\n | ``func_name`` | The function\'s name | Writable |\n +-------------------------+---------------------------------+-------------+\n | ``__name__`` | Another way of spelling | Writable |\n | | ``func_name`` | |\n +-------------------------+---------------------------------+-------------+\n | ``__module__`` | The name of the module the | Writable |\n | | function was defined in, or | |\n | | ``None`` if unavailable. | |\n +-------------------------+---------------------------------+-------------+\n | ``func_defaults`` | A tuple containing default | Writable |\n | | argument values for those | |\n | | arguments that have defaults, | |\n | | or ``None`` if no arguments | |\n | | have a default value | |\n +-------------------------+---------------------------------+-------------+\n | ``func_code`` | The code object representing | Writable |\n | | the compiled function body. | |\n +-------------------------+---------------------------------+-------------+\n | ``func_globals`` | A reference to the dictionary | Read-only |\n | | that holds the function\'s | |\n | | global variables --- the global | |\n | | namespace of the module in | |\n | | which the function was defined. | |\n +-------------------------+---------------------------------+-------------+\n | ``func_dict`` | The namespace supporting | Writable |\n | | arbitrary function attributes. | |\n +-------------------------+---------------------------------+-------------+\n | ``func_closure`` | ``None`` or a tuple of cells | Read-only |\n | | that contain bindings for the | |\n | | function\'s free variables. | |\n +-------------------------+---------------------------------+-------------+\n\n Most of the attributes labelled "Writable" check the type of the\n assigned value.\n\n Changed in version 2.4: ``func_name`` is now writable.\n\n Function objects also support getting and setting arbitrary\n attributes, which can be used, for example, to attach metadata\n to functions. Regular attribute dot-notation is used to get and\n set such attributes. *Note that the current implementation only\n supports function attributes on user-defined functions. Function\n attributes on built-in functions may be supported in the\n future.*\n\n Additional information about a function\'s definition can be\n retrieved from its code object; see the description of internal\n types below.\n\n User-defined methods\n A user-defined method object combines a class, a class instance\n (or ``None``) and any callable object (normally a user-defined\n function).\n\n Special read-only attributes: ``im_self`` is the class instance\n object, ``im_func`` is the function object; ``im_class`` is the\n class of ``im_self`` for bound methods or the class that asked\n for the method for unbound methods; ``__doc__`` is the method\'s\n documentation (same as ``im_func.__doc__``); ``__name__`` is the\n method name (same as ``im_func.__name__``); ``__module__`` is\n the name of the module the method was defined in, or ``None`` if\n unavailable.\n\n Changed in version 2.2: ``im_self`` used to refer to the class\n that defined the method.\n\n Changed in version 2.6: For 3.0 forward-compatibility,\n ``im_func`` is also available as ``__func__``, and ``im_self``\n as ``__self__``.\n\n Methods also support accessing (but not setting) the arbitrary\n function attributes on the underlying function object.\n\n User-defined method objects may be created when getting an\n attribute of a class (perhaps via an instance of that class), if\n that attribute is a user-defined function object, an unbound\n user-defined method object, or a class method object. When the\n attribute is a user-defined method object, a new method object\n is only created if the class from which it is being retrieved is\n the same as, or a derived class of, the class stored in the\n original method object; otherwise, the original method object is\n used as it is.\n\n When a user-defined method object is created by retrieving a\n user-defined function object from a class, its ``im_self``\n attribute is ``None`` and the method object is said to be\n unbound. When one is created by retrieving a user-defined\n function object from a class via one of its instances, its\n ``im_self`` attribute is the instance, and the method object is\n said to be bound. In either case, the new method\'s ``im_class``\n attribute is the class from which the retrieval takes place, and\n its ``im_func`` attribute is the original function object.\n\n When a user-defined method object is created by retrieving\n another method object from a class or instance, the behaviour is\n the same as for a function object, except that the ``im_func``\n attribute of the new instance is not the original method object\n but its ``im_func`` attribute.\n\n When a user-defined method object is created by retrieving a\n class method object from a class or instance, its ``im_self``\n attribute is the class itself (the same as the ``im_class``\n attribute), and its ``im_func`` attribute is the function object\n underlying the class method.\n\n When an unbound user-defined method object is called, the\n underlying function (``im_func``) is called, with the\n restriction that the first argument must be an instance of the\n proper class (``im_class``) or of a derived class thereof.\n\n When a bound user-defined method object is called, the\n underlying function (``im_func``) is called, inserting the class\n instance (``im_self``) in front of the argument list. For\n instance, when ``C`` is a class which contains a definition for\n a function ``f()``, and ``x`` is an instance of ``C``, calling\n ``x.f(1)`` is equivalent to calling ``C.f(x, 1)``.\n\n When a user-defined method object is derived from a class method\n object, the "class instance" stored in ``im_self`` will actually\n be the class itself, so that calling either ``x.f(1)`` or\n ``C.f(1)`` is equivalent to calling ``f(C,1)`` where ``f`` is\n the underlying function.\n\n Note that the transformation from function object to (unbound or\n bound) method object happens each time the attribute is\n retrieved from the class or instance. In some cases, a fruitful\n optimization is to assign the attribute to a local variable and\n call that local variable. Also notice that this transformation\n only happens for user-defined functions; other callable objects\n (and all non-callable objects) are retrieved without\n transformation. It is also important to note that user-defined\n functions which are attributes of a class instance are not\n converted to bound methods; this *only* happens when the\n function is an attribute of the class.\n\n Generator functions\n A function or method which uses the ``yield`` statement (see\n section *The yield statement*) is called a *generator function*.\n Such a function, when called, always returns an iterator object\n which can be used to execute the body of the function: calling\n the iterator\'s ``next()`` method will cause the function to\n execute until it provides a value using the ``yield`` statement.\n When the function executes a ``return`` statement or falls off\n the end, a ``StopIteration`` exception is raised and the\n iterator will have reached the end of the set of values to be\n returned.\n\n Built-in functions\n A built-in function object is a wrapper around a C function.\n Examples of built-in functions are ``len()`` and ``math.sin()``\n (``math`` is a standard built-in module). The number and type of\n the arguments are determined by the C function. Special read-\n only attributes: ``__doc__`` is the function\'s documentation\n string, or ``None`` if unavailable; ``__name__`` is the\n function\'s name; ``__self__`` is set to ``None`` (but see the\n next item); ``__module__`` is the name of the module the\n function was defined in or ``None`` if unavailable.\n\n Built-in methods\n This is really a different disguise of a built-in function, this\n time containing an object passed to the C function as an\n implicit extra argument. An example of a built-in method is\n ``alist.append()``, assuming *alist* is a list object. In this\n case, the special read-only attribute ``__self__`` is set to the\n object denoted by *list*.\n\n Class Types\n Class types, or "new-style classes," are callable. These\n objects normally act as factories for new instances of\n themselves, but variations are possible for class types that\n override ``__new__()``. The arguments of the call are passed to\n ``__new__()`` and, in the typical case, to ``__init__()`` to\n initialize the new instance.\n\n Classic Classes\n Class objects are described below. When a class object is\n called, a new class instance (also described below) is created\n and returned. This implies a call to the class\'s ``__init__()``\n method if it has one. Any arguments are passed on to the\n ``__init__()`` method. If there is no ``__init__()`` method,\n the class must be called without arguments.\n\n Class instances\n Class instances are described below. Class instances are\n callable only when the class has a ``__call__()`` method;\n ``x(arguments)`` is a shorthand for ``x.__call__(arguments)``.\n\nModules\n Modules are imported by the ``import`` statement (see section *The\n import statement*). A module object has a namespace implemented by\n a dictionary object (this is the dictionary referenced by the\n func_globals attribute of functions defined in the module).\n Attribute references are translated to lookups in this dictionary,\n e.g., ``m.x`` is equivalent to ``m.__dict__["x"]``. A module object\n does not contain the code object used to initialize the module\n (since it isn\'t needed once the initialization is done).\n\n Attribute assignment updates the module\'s namespace dictionary,\n e.g., ``m.x = 1`` is equivalent to ``m.__dict__["x"] = 1``.\n\n Special read-only attribute: ``__dict__`` is the module\'s namespace\n as a dictionary object.\n\n Predefined (writable) attributes: ``__name__`` is the module\'s\n name; ``__doc__`` is the module\'s documentation string, or ``None``\n if unavailable; ``__file__`` is the pathname of the file from which\n the module was loaded, if it was loaded from a file. The\n ``__file__`` attribute is not present for C modules that are\n statically linked into the interpreter; for extension modules\n loaded dynamically from a shared library, it is the pathname of the\n shared library file.\n\nClasses\n Both class types (new-style classes) and class objects (old-\n style/classic classes) are typically created by class definitions\n (see section *Class definitions*). A class has a namespace\n implemented by a dictionary object. Class attribute references are\n translated to lookups in this dictionary, e.g., ``C.x`` is\n translated to ``C.__dict__["x"]`` (although for new-style classes\n in particular there are a number of hooks which allow for other\n means of locating attributes). When the attribute name is not found\n there, the attribute search continues in the base classes. For\n old-style classes, the search is depth-first, left-to-right in the\n order of occurrence in the base class list. New-style classes use\n the more complex C3 method resolution order which behaves correctly\n even in the presence of \'diamond\' inheritance structures where\n there are multiple inheritance paths leading back to a common\n ancestor. Additional details on the C3 MRO used by new-style\n classes can be found in the documentation accompanying the 2.3\n release at http://www.python.org/download/releases/2.3/mro/.\n\n When a class attribute reference (for class ``C``, say) would yield\n a user-defined function object or an unbound user-defined method\n object whose associated class is either ``C`` or one of its base\n classes, it is transformed into an unbound user-defined method\n object whose ``im_class`` attribute is ``C``. When it would yield a\n class method object, it is transformed into a bound user-defined\n method object whose ``im_class`` and ``im_self`` attributes are\n both ``C``. When it would yield a static method object, it is\n transformed into the object wrapped by the static method object.\n See section *Implementing Descriptors* for another way in which\n attributes retrieved from a class may differ from those actually\n contained in its ``__dict__`` (note that only new-style classes\n support descriptors).\n\n Class attribute assignments update the class\'s dictionary, never\n the dictionary of a base class.\n\n A class object can be called (see above) to yield a class instance\n (see below).\n\n Special attributes: ``__name__`` is the class name; ``__module__``\n is the module name in which the class was defined; ``__dict__`` is\n the dictionary containing the class\'s namespace; ``__bases__`` is a\n tuple (possibly empty or a singleton) containing the base classes,\n in the order of their occurrence in the base class list;\n ``__doc__`` is the class\'s documentation string, or None if\n undefined.\n\nClass instances\n A class instance is created by calling a class object (see above).\n A class instance has a namespace implemented as a dictionary which\n is the first place in which attribute references are searched.\n When an attribute is not found there, and the instance\'s class has\n an attribute by that name, the search continues with the class\n attributes. If a class attribute is found that is a user-defined\n function object or an unbound user-defined method object whose\n associated class is the class (call it ``C``) of the instance for\n which the attribute reference was initiated or one of its bases, it\n is transformed into a bound user-defined method object whose\n ``im_class`` attribute is ``C`` and whose ``im_self`` attribute is\n the instance. Static method and class method objects are also\n transformed, as if they had been retrieved from class ``C``; see\n above under "Classes". See section *Implementing Descriptors* for\n another way in which attributes of a class retrieved via its\n instances may differ from the objects actually stored in the\n class\'s ``__dict__``. If no class attribute is found, and the\n object\'s class has a ``__getattr__()`` method, that is called to\n satisfy the lookup.\n\n Attribute assignments and deletions update the instance\'s\n dictionary, never a class\'s dictionary. If the class has a\n ``__setattr__()`` or ``__delattr__()`` method, this is called\n instead of updating the instance dictionary directly.\n\n Class instances can pretend to be numbers, sequences, or mappings\n if they have methods with certain special names. See section\n *Special method names*.\n\n Special attributes: ``__dict__`` is the attribute dictionary;\n ``__class__`` is the instance\'s class.\n\nFiles\n A file object represents an open file. File objects are created by\n the ``open()`` built-in function, and also by ``os.popen()``,\n ``os.fdopen()``, and the ``makefile()`` method of socket objects\n (and perhaps by other functions or methods provided by extension\n modules). The objects ``sys.stdin``, ``sys.stdout`` and\n ``sys.stderr`` are initialized to file objects corresponding to the\n interpreter\'s standard input, output and error streams. See *File\n Objects* for complete documentation of file objects.\n\nInternal types\n A few types used internally by the interpreter are exposed to the\n user. Their definitions may change with future versions of the\n interpreter, but they are mentioned here for completeness.\n\n Code objects\n Code objects represent *byte-compiled* executable Python code,\n or *bytecode*. The difference between a code object and a\n function object is that the function object contains an explicit\n reference to the function\'s globals (the module in which it was\n defined), while a code object contains no context; also the\n default argument values are stored in the function object, not\n in the code object (because they represent values calculated at\n run-time). Unlike function objects, code objects are immutable\n and contain no references (directly or indirectly) to mutable\n objects.\n\n Special read-only attributes: ``co_name`` gives the function\n name; ``co_argcount`` is the number of positional arguments\n (including arguments with default values); ``co_nlocals`` is the\n number of local variables used by the function (including\n arguments); ``co_varnames`` is a tuple containing the names of\n the local variables (starting with the argument names);\n ``co_cellvars`` is a tuple containing the names of local\n variables that are referenced by nested functions;\n ``co_freevars`` is a tuple containing the names of free\n variables; ``co_code`` is a string representing the sequence of\n bytecode instructions; ``co_consts`` is a tuple containing the\n literals used by the bytecode; ``co_names`` is a tuple\n containing the names used by the bytecode; ``co_filename`` is\n the filename from which the code was compiled;\n ``co_firstlineno`` is the first line number of the function;\n ``co_lnotab`` is a string encoding the mapping from bytecode\n offsets to line numbers (for details see the source code of the\n interpreter); ``co_stacksize`` is the required stack size\n (including local variables); ``co_flags`` is an integer encoding\n a number of flags for the interpreter.\n\n The following flag bits are defined for ``co_flags``: bit\n ``0x04`` is set if the function uses the ``*arguments`` syntax\n to accept an arbitrary number of positional arguments; bit\n ``0x08`` is set if the function uses the ``**keywords`` syntax\n to accept arbitrary keyword arguments; bit ``0x20`` is set if\n the function is a generator.\n\n Future feature declarations (``from __future__ import\n division``) also use bits in ``co_flags`` to indicate whether a\n code object was compiled with a particular feature enabled: bit\n ``0x2000`` is set if the function was compiled with future\n division enabled; bits ``0x10`` and ``0x1000`` were used in\n earlier versions of Python.\n\n Other bits in ``co_flags`` are reserved for internal use.\n\n If a code object represents a function, the first item in\n ``co_consts`` is the documentation string of the function, or\n ``None`` if undefined.\n\n Frame objects\n Frame objects represent execution frames. They may occur in\n traceback objects (see below).\n\n Special read-only attributes: ``f_back`` is to the previous\n stack frame (towards the caller), or ``None`` if this is the\n bottom stack frame; ``f_code`` is the code object being executed\n in this frame; ``f_locals`` is the dictionary used to look up\n local variables; ``f_globals`` is used for global variables;\n ``f_builtins`` is used for built-in (intrinsic) names;\n ``f_restricted`` is a flag indicating whether the function is\n executing in restricted execution mode; ``f_lasti`` gives the\n precise instruction (this is an index into the bytecode string\n of the code object).\n\n Special writable attributes: ``f_trace``, if not ``None``, is a\n function called at the start of each source code line (this is\n used by the debugger); ``f_exc_type``, ``f_exc_value``,\n ``f_exc_traceback`` represent the last exception raised in the\n parent frame provided another exception was ever raised in the\n current frame (in all other cases they are None); ``f_lineno``\n is the current line number of the frame --- writing to this from\n within a trace function jumps to the given line (only for the\n bottom-most frame). A debugger can implement a Jump command\n (aka Set Next Statement) by writing to f_lineno.\n\n Traceback objects\n Traceback objects represent a stack trace of an exception. A\n traceback object is created when an exception occurs. When the\n search for an exception handler unwinds the execution stack, at\n each unwound level a traceback object is inserted in front of\n the current traceback. When an exception handler is entered,\n the stack trace is made available to the program. (See section\n *The try statement*.) It is accessible as ``sys.exc_traceback``,\n and also as the third item of the tuple returned by\n ``sys.exc_info()``. The latter is the preferred interface,\n since it works correctly when the program is using multiple\n threads. When the program contains no suitable handler, the\n stack trace is written (nicely formatted) to the standard error\n stream; if the interpreter is interactive, it is also made\n available to the user as ``sys.last_traceback``.\n\n Special read-only attributes: ``tb_next`` is the next level in\n the stack trace (towards the frame where the exception\n occurred), or ``None`` if there is no next level; ``tb_frame``\n points to the execution frame of the current level;\n ``tb_lineno`` gives the line number where the exception\n occurred; ``tb_lasti`` indicates the precise instruction. The\n line number and last instruction in the traceback may differ\n from the line number of its frame object if the exception\n occurred in a ``try`` statement with no matching except clause\n or with a finally clause.\n\n Slice objects\n Slice objects are used to represent slices when *extended slice\n syntax* is used. This is a slice using two colons, or multiple\n slices or ellipses separated by commas, e.g., ``a[i:j:step]``,\n ``a[i:j, k:l]``, or ``a[..., i:j]``. They are also created by\n the built-in ``slice()`` function.\n\n Special read-only attributes: ``start`` is the lower bound;\n ``stop`` is the upper bound; ``step`` is the step value; each is\n ``None`` if omitted. These attributes can have any type.\n\n Slice objects support one method:\n\n slice.indices(self, length)\n\n This method takes a single integer argument *length* and\n computes information about the extended slice that the slice\n object would describe if applied to a sequence of *length*\n items. It returns a tuple of three integers; respectively\n these are the *start* and *stop* indices and the *step* or\n stride length of the slice. Missing or out-of-bounds indices\n are handled in a manner consistent with regular slices.\n\n New in version 2.3.\n\n Static method objects\n Static method objects provide a way of defeating the\n transformation of function objects to method objects described\n above. A static method object is a wrapper around any other\n object, usually a user-defined method object. When a static\n method object is retrieved from a class or a class instance, the\n object actually returned is the wrapped object, which is not\n subject to any further transformation. Static method objects are\n not themselves callable, although the objects they wrap usually\n are. Static method objects are created by the built-in\n ``staticmethod()`` constructor.\n\n Class method objects\n A class method object, like a static method object, is a wrapper\n around another object that alters the way in which that object\n is retrieved from classes and class instances. The behaviour of\n class method objects upon such retrieval is described above,\n under "User-defined methods". Class method objects are created\n by the built-in ``classmethod()`` constructor.\n', 'typesfunctions': u'\nFunctions\n*********\n\nFunction objects are created by function definitions. The only\noperation on a function object is to call it: ``func(argument-list)``.\n\nThere are really two flavors of function objects: built-in functions\nand user-defined functions. Both support the same operation (to call\nthe function), but the implementation is different, hence the\ndifferent object types.\n\nSee *Function definitions* for more information.\n', - 'typesmapping': u'\nMapping Types --- ``dict``\n**************************\n\nA *mapping* object maps *hashable* values to arbitrary objects.\nMappings are mutable objects. There is currently only one standard\nmapping type, the *dictionary*. (For other containers see the built\nin ``list``, ``set``, and ``tuple`` classes, and the ``collections``\nmodule.)\n\nA dictionary\'s keys are *almost* arbitrary values. Values that are\nnot *hashable*, that is, values containing lists, dictionaries or\nother mutable types (that are compared by value rather than by object\nidentity) may not be used as keys. Numeric types used for keys obey\nthe normal rules for numeric comparison: if two numbers compare equal\n(such as ``1`` and ``1.0``) then they can be used interchangeably to\nindex the same dictionary entry. (Note however, that since computers\nstore floating-point numbers as approximations it is usually unwise to\nuse them as dictionary keys.)\n\nDictionaries can be created by placing a comma-separated list of\n``key: value`` pairs within braces, for example: ``{\'jack\': 4098,\n\'sjoerd\': 4127}`` or ``{4098: \'jack\', 4127: \'sjoerd\'}``, or by the\n``dict`` constructor.\n\nclass dict([arg])\n\n Return a new dictionary initialized from an optional positional\n argument or from a set of keyword arguments. If no arguments are\n given, return a new empty dictionary. If the positional argument\n *arg* is a mapping object, return a dictionary mapping the same\n keys to the same values as does the mapping object. Otherwise the\n positional argument must be a sequence, a container that supports\n iteration, or an iterator object. The elements of the argument\n must each also be of one of those kinds, and each must in turn\n contain exactly two objects. The first is used as a key in the new\n dictionary, and the second as the key\'s value. If a given key is\n seen more than once, the last value associated with it is retained\n in the new dictionary.\n\n If keyword arguments are given, the keywords themselves with their\n associated values are added as items to the dictionary. If a key is\n specified both in the positional argument and as a keyword\n argument, the value associated with the keyword is retained in the\n dictionary. For example, these all return a dictionary equal to\n ``{"one": 2, "two": 3}``:\n\n * ``dict(one=2, two=3)``\n\n * ``dict({\'one\': 2, \'two\': 3})``\n\n * ``dict(zip((\'one\', \'two\'), (2, 3)))``\n\n * ``dict([[\'two\', 3], [\'one\', 2]])``\n\n The first example only works for keys that are valid Python\n identifiers; the others work with any valid keys.\n\n Added in version 2.2.\n\n Changed in version 2.3: Support for building a dictionary from\n keyword arguments added.\n\n These are the operations that dictionaries support (and therefore,\n custom mapping types should support too):\n\n len(d)\n\n Return the number of items in the dictionary *d*.\n\n d[key]\n\n Return the item of *d* with key *key*. Raises a ``KeyError`` if\n *key* is not in the map.\n\n Added in version 2.5: If a subclass of dict defines a method\n ``__missing__()``, if the key *key* is not present, the\n ``d[key]`` operation calls that method with the key *key* as\n argument. The ``d[key]`` operation then returns or raises\n whatever is returned or raised by the ``__missing__(key)`` call\n if the key is not present. No other operations or methods invoke\n ``__missing__()``. If ``__missing__()`` is not defined,\n ``KeyError`` is raised. ``__missing__()`` must be a method; it\n cannot be an instance variable. For an example, see\n ``collections.defaultdict``.\n\n d[key] = value\n\n Set ``d[key]`` to *value*.\n\n del d[key]\n\n Remove ``d[key]`` from *d*. Raises a ``KeyError`` if *key* is\n not in the map.\n\n key in d\n\n Return ``True`` if *d* has a key *key*, else ``False``.\n\n Added in version 2.2.\n\n key not in d\n\n Equivalent to ``not key in d``.\n\n Added in version 2.2.\n\n clear()\n\n Remove all items from the dictionary.\n\n copy()\n\n Return a shallow copy of the dictionary.\n\n fromkeys(seq[, value])\n\n Create a new dictionary with keys from *seq* and values set to\n *value*.\n\n ``fromkeys()`` is a class method that returns a new dictionary.\n *value* defaults to ``None``.\n\n Added in version 2.3.\n\n get(key[, default])\n\n Return the value for *key* if *key* is in the dictionary, else\n *default*. If *default* is not given, it defaults to ``None``,\n so that this method never raises a ``KeyError``.\n\n has_key(key)\n\n ``dict.has_key(key)`` is equivalent to ``key in d``, but\n deprecated.\n\n items()\n\n Return a copy of the dictionary\'s list of ``(key, value)``\n pairs.\n\n Note: Keys and values are listed in an arbitrary order which is non-\n random, varies across Python implementations, and depends on\n the dictionary\'s history of insertions and deletions. If\n ``items()``, ``keys()``, ``values()``, ``iteritems()``,\n ``iterkeys()``, and ``itervalues()`` are called with no\n intervening modifications to the dictionary, the lists will\n directly correspond. This allows the creation of ``(value,\n key)`` pairs using ``zip()``: ``pairs = zip(d.values(),\n d.keys())``. The same relationship holds for the\n ``iterkeys()`` and ``itervalues()`` methods: ``pairs =\n zip(d.itervalues(), d.iterkeys())`` provides the same value\n for ``pairs``. Another way to create the same list is ``pairs\n = [(v, k) for (k, v) in d.iteritems()]``.\n\n iteritems()\n\n Return an iterator over the dictionary\'s ``(key, value)`` pairs.\n See the note for ``dict.items()``.\n\n Added in version 2.2.\n\n iterkeys()\n\n Return an iterator over the dictionary\'s keys. See the note for\n ``dict.items()``.\n\n Added in version 2.2.\n\n itervalues()\n\n Return an iterator over the dictionary\'s values. See the note\n for ``dict.items()``.\n\n Added in version 2.2.\n\n keys()\n\n Return a copy of the dictionary\'s list of keys. See the note\n for ``dict.items()``.\n\n pop(key[, default])\n\n If *key* is in the dictionary, remove it and return its value,\n else return *default*. If *default* is not given and *key* is\n not in the dictionary, a ``KeyError`` is raised.\n\n Added in version 2.3.\n\n popitem()\n\n Remove and return an arbitrary ``(key, value)`` pair from the\n dictionary.\n\n ``popitem()`` is useful to destructively iterate over a\n dictionary, as often used in set algorithms. If the dictionary\n is empty, calling ``popitem()`` raises a ``KeyError``.\n\n setdefault(key[, default])\n\n If *key* is in the dictionary, return its value. If not, insert\n *key* with a value of *default* and return *default*. *default*\n defaults to ``None``.\n\n update([other])\n\n Update the dictionary with the key/value pairs from *other*,\n overwriting existing keys. Return ``None``.\n\n ``update()`` accepts either another dictionary object or an\n iterable of key/value pairs (as a tuple or other iterable of\n length two). If keyword arguments are specified, the dictionary\n is then is updated with those key/value pairs: ``d.update(red=1,\n blue=2)``.\n\n Changed in version 2.4: Allowed the argument to be an iterable\n of key/value pairs and allowed keyword arguments.\n\n values()\n\n Return a copy of the dictionary\'s list of values. See the note\n for ``dict.items()``.\n', + 'typesmapping': u'\nMapping Types --- ``dict``\n**************************\n\nA *mapping* object maps *hashable* values to arbitrary objects.\nMappings are mutable objects. There is currently only one standard\nmapping type, the *dictionary*. (For other containers see the built\nin ``list``, ``set``, and ``tuple`` classes, and the ``collections``\nmodule.)\n\nA dictionary\'s keys are *almost* arbitrary values. Values that are\nnot *hashable*, that is, values containing lists, dictionaries or\nother mutable types (that are compared by value rather than by object\nidentity) may not be used as keys. Numeric types used for keys obey\nthe normal rules for numeric comparison: if two numbers compare equal\n(such as ``1`` and ``1.0``) then they can be used interchangeably to\nindex the same dictionary entry. (Note however, that since computers\nstore floating-point numbers as approximations it is usually unwise to\nuse them as dictionary keys.)\n\nDictionaries can be created by placing a comma-separated list of\n``key: value`` pairs within braces, for example: ``{\'jack\': 4098,\n\'sjoerd\': 4127}`` or ``{4098: \'jack\', 4127: \'sjoerd\'}``, or by the\n``dict`` constructor.\n\nclass dict([arg])\n\n Return a new dictionary initialized from an optional positional\n argument or from a set of keyword arguments. If no arguments are\n given, return a new empty dictionary. If the positional argument\n *arg* is a mapping object, return a dictionary mapping the same\n keys to the same values as does the mapping object. Otherwise the\n positional argument must be a sequence, a container that supports\n iteration, or an iterator object. The elements of the argument\n must each also be of one of those kinds, and each must in turn\n contain exactly two objects. The first is used as a key in the new\n dictionary, and the second as the key\'s value. If a given key is\n seen more than once, the last value associated with it is retained\n in the new dictionary.\n\n If keyword arguments are given, the keywords themselves with their\n associated values are added as items to the dictionary. If a key is\n specified both in the positional argument and as a keyword\n argument, the value associated with the keyword is retained in the\n dictionary. For example, these all return a dictionary equal to\n ``{"one": 2, "two": 3}``:\n\n * ``dict(one=2, two=3)``\n\n * ``dict({\'one\': 2, \'two\': 3})``\n\n * ``dict(zip((\'one\', \'two\'), (2, 3)))``\n\n * ``dict([[\'two\', 3], [\'one\', 2]])``\n\n The first example only works for keys that are valid Python\n identifiers; the others work with any valid keys.\n\n New in version 2.2.\n\n Changed in version 2.3: Support for building a dictionary from\n keyword arguments added.\n\n These are the operations that dictionaries support (and therefore,\n custom mapping types should support too):\n\n len(d)\n\n Return the number of items in the dictionary *d*.\n\n d[key]\n\n Return the item of *d* with key *key*. Raises a ``KeyError`` if\n *key* is not in the map.\n\n New in version 2.5: If a subclass of dict defines a method\n ``__missing__()``, if the key *key* is not present, the\n ``d[key]`` operation calls that method with the key *key* as\n argument. The ``d[key]`` operation then returns or raises\n whatever is returned or raised by the ``__missing__(key)`` call\n if the key is not present. No other operations or methods invoke\n ``__missing__()``. If ``__missing__()`` is not defined,\n ``KeyError`` is raised. ``__missing__()`` must be a method; it\n cannot be an instance variable. For an example, see\n ``collections.defaultdict``.\n\n d[key] = value\n\n Set ``d[key]`` to *value*.\n\n del d[key]\n\n Remove ``d[key]`` from *d*. Raises a ``KeyError`` if *key* is\n not in the map.\n\n key in d\n\n Return ``True`` if *d* has a key *key*, else ``False``.\n\n New in version 2.2.\n\n key not in d\n\n Equivalent to ``not key in d``.\n\n New in version 2.2.\n\n clear()\n\n Remove all items from the dictionary.\n\n copy()\n\n Return a shallow copy of the dictionary.\n\n fromkeys(seq[, value])\n\n Create a new dictionary with keys from *seq* and values set to\n *value*.\n\n ``fromkeys()`` is a class method that returns a new dictionary.\n *value* defaults to ``None``.\n\n New in version 2.3.\n\n get(key[, default])\n\n Return the value for *key* if *key* is in the dictionary, else\n *default*. If *default* is not given, it defaults to ``None``,\n so that this method never raises a ``KeyError``.\n\n has_key(key)\n\n ``dict.has_key(key)`` is equivalent to ``key in d``, but\n deprecated.\n\n items()\n\n Return a copy of the dictionary\'s list of ``(key, value)``\n pairs.\n\n Note: Keys and values are listed in an arbitrary order which is non-\n random, varies across Python implementations, and depends on\n the dictionary\'s history of insertions and deletions. If\n ``items()``, ``keys()``, ``values()``, ``iteritems()``,\n ``iterkeys()``, and ``itervalues()`` are called with no\n intervening modifications to the dictionary, the lists will\n directly correspond. This allows the creation of ``(value,\n key)`` pairs using ``zip()``: ``pairs = zip(d.values(),\n d.keys())``. The same relationship holds for the\n ``iterkeys()`` and ``itervalues()`` methods: ``pairs =\n zip(d.itervalues(), d.iterkeys())`` provides the same value\n for ``pairs``. Another way to create the same list is ``pairs\n = [(v, k) for (k, v) in d.iteritems()]``.\n\n iteritems()\n\n Return an iterator over the dictionary\'s ``(key, value)`` pairs.\n See the note for ``dict.items()``.\n\n New in version 2.2.\n\n iterkeys()\n\n Return an iterator over the dictionary\'s keys. See the note for\n ``dict.items()``.\n\n New in version 2.2.\n\n itervalues()\n\n Return an iterator over the dictionary\'s values. See the note\n for ``dict.items()``.\n\n New in version 2.2.\n\n keys()\n\n Return a copy of the dictionary\'s list of keys. See the note\n for ``dict.items()``.\n\n pop(key[, default])\n\n If *key* is in the dictionary, remove it and return its value,\n else return *default*. If *default* is not given and *key* is\n not in the dictionary, a ``KeyError`` is raised.\n\n New in version 2.3.\n\n popitem()\n\n Remove and return an arbitrary ``(key, value)`` pair from the\n dictionary.\n\n ``popitem()`` is useful to destructively iterate over a\n dictionary, as often used in set algorithms. If the dictionary\n is empty, calling ``popitem()`` raises a ``KeyError``.\n\n setdefault(key[, default])\n\n If *key* is in the dictionary, return its value. If not, insert\n *key* with a value of *default* and return *default*. *default*\n defaults to ``None``.\n\n update([other])\n\n Update the dictionary with the key/value pairs from *other*,\n overwriting existing keys. Return ``None``.\n\n ``update()`` accepts either another dictionary object or an\n iterable of key/value pairs (as a tuple or other iterable of\n length two). If keyword arguments are specified, the dictionary\n is then is updated with those key/value pairs: ``d.update(red=1,\n blue=2)``.\n\n Changed in version 2.4: Allowed the argument to be an iterable\n of key/value pairs and allowed keyword arguments.\n\n values()\n\n Return a copy of the dictionary\'s list of values. See the note\n for ``dict.items()``.\n', 'typesmethods': u"\nMethods\n*******\n\nMethods are functions that are called using the attribute notation.\nThere are two flavors: built-in methods (such as ``append()`` on\nlists) and class instance methods. Built-in methods are described\nwith the types that support them.\n\nThe implementation adds two special read-only attributes to class\ninstance methods: ``m.im_self`` is the object on which the method\noperates, and ``m.im_func`` is the function implementing the method.\nCalling ``m(arg-1, arg-2, ..., arg-n)`` is completely equivalent to\ncalling ``m.im_func(m.im_self, arg-1, arg-2, ..., arg-n)``.\n\nClass instance methods are either *bound* or *unbound*, referring to\nwhether the method was accessed through an instance or a class,\nrespectively. When a method is unbound, its ``im_self`` attribute\nwill be ``None`` and if called, an explicit ``self`` object must be\npassed as the first argument. In this case, ``self`` must be an\ninstance of the unbound method's class (or a subclass of that class),\notherwise a ``TypeError`` is raised.\n\nLike function objects, methods objects support getting arbitrary\nattributes. However, since method attributes are actually stored on\nthe underlying function object (``meth.im_func``), setting method\nattributes on either bound or unbound methods is disallowed.\nAttempting to set a method attribute results in a ``TypeError`` being\nraised. In order to set a method attribute, you need to explicitly\nset it on the underlying function object:\n\n class C:\n def method(self):\n pass\n\n c = C()\n c.method.im_func.whoami = 'my name is c'\n\nSee *The standard type hierarchy* for more information.\n", 'typesmodules': u"\nModules\n*******\n\nThe only special operation on a module is attribute access:\n``m.name``, where *m* is a module and *name* accesses a name defined\nin *m*'s symbol table. Module attributes can be assigned to. (Note\nthat the ``import`` statement is not, strictly speaking, an operation\non a module object; ``import foo`` does not require a module object\nnamed *foo* to exist, rather it requires an (external) *definition*\nfor a module named *foo* somewhere.)\n\nA special member of every module is ``__dict__``. This is the\ndictionary containing the module's symbol table. Modifying this\ndictionary will actually change the module's symbol table, but direct\nassignment to the ``__dict__`` attribute is not possible (you can\nwrite ``m.__dict__['a'] = 1``, which defines ``m.a`` to be ``1``, but\nyou can't write ``m.__dict__ = {}``). Modifying ``__dict__`` directly\nis not recommended.\n\nModules built into the interpreter are written like this: ````. If loaded from a file, they are written as\n````.\n", - 'typesseq': u'\nSequence Types --- ``str``, ``unicode``, ``list``, ``tuple``, ``buffer``, ``xrange``\n************************************************************************************\n\nThere are six sequence types: strings, Unicode strings, lists, tuples,\nbuffers, and xrange objects. (For other containers see the built in\n``dict``, ``list``, ``set``, and ``tuple`` classes, and the\n``collections`` module.)\n\nString literals are written in single or double quotes: ``\'xyzzy\'``,\n``"frobozz"``. See *String literals* for more about string literals.\nUnicode strings are much like strings, but are specified in the syntax\nusing a preceding ``\'u\'`` character: ``u\'abc\'``, ``u"def"``. In\naddition to the functionality described here, there are also string-\nspecific methods described in the *String Methods* section. Lists are\nconstructed with square brackets, separating items with commas: ``[a,\nb, c]``. Tuples are constructed by the comma operator (not within\nsquare brackets), with or without enclosing parentheses, but an empty\ntuple must have the enclosing parentheses, such as ``a, b, c`` or\n``()``. A single item tuple must have a trailing comma, such as\n``(d,)``.\n\nBuffer objects are not directly supported by Python syntax, but can be\ncreated by calling the builtin function ``buffer()``. They don\'t\nsupport concatenation or repetition.\n\nObjects of type xrange are similar to buffers in that there is no\nspecific syntax to create them, but they are created using the\n``xrange()`` function. They don\'t support slicing, concatenation or\nrepetition, and using ``in``, ``not in``, ``min()`` or ``max()`` on\nthem is inefficient.\n\nMost sequence types support the following operations. The ``in`` and\n``not in`` operations have the same priorities as the comparison\noperations. The ``+`` and ``*`` operations have the same priority as\nthe corresponding numeric operations. [3] Additional methods are\nprovided for *Mutable Sequence Types*.\n\nThis table lists the sequence operations sorted in ascending priority\n(operations in the same box have the same priority). In the table,\n*s* and *t* are sequences of the same type; *n*, *i* and *j* are\nintegers:\n\n+--------------------+----------------------------------+------------+\n| Operation | Result | Notes |\n+====================+==================================+============+\n| ``x in s`` | ``True`` if an item of *s* is | (1) |\n| | equal to *x*, else ``False`` | |\n+--------------------+----------------------------------+------------+\n| ``x not in s`` | ``False`` if an item of *s* is | (1) |\n| | equal to *x*, else ``True`` | |\n+--------------------+----------------------------------+------------+\n| ``s + t`` | the concatenation of *s* and *t* | (6) |\n+--------------------+----------------------------------+------------+\n| ``s * n, n * s`` | *n* shallow copies of *s* | (2) |\n| | concatenated | |\n+--------------------+----------------------------------+------------+\n| ``s[i]`` | *i*\'th item of *s*, origin 0 | (3) |\n+--------------------+----------------------------------+------------+\n| ``s[i:j]`` | slice of *s* from *i* to *j* | (3)(4) |\n+--------------------+----------------------------------+------------+\n| ``s[i:j:k]`` | slice of *s* from *i* to *j* | (3)(5) |\n| | with step *k* | |\n+--------------------+----------------------------------+------------+\n| ``len(s)`` | length of *s* | |\n+--------------------+----------------------------------+------------+\n| ``min(s)`` | smallest item of *s* | |\n+--------------------+----------------------------------+------------+\n| ``max(s)`` | largest item of *s* | |\n+--------------------+----------------------------------+------------+\n\nSequence types also support comparisons. In particular, tuples and\nlists are compared lexicographically by comparing corresponding\nelements. This means that to compare equal, every element must compare\nequal and the two sequences must be of the same type and have the same\nlength. (For full details see *Comparisons* in the language\nreference.)\n\nNotes:\n\n1. When *s* is a string or Unicode string object the ``in`` and ``not\n in`` operations act like a substring test. In Python versions\n before 2.3, *x* had to be a string of length 1. In Python 2.3 and\n beyond, *x* may be a string of any length.\n\n2. Values of *n* less than ``0`` are treated as ``0`` (which yields an\n empty sequence of the same type as *s*). Note also that the copies\n are shallow; nested structures are not copied. This often haunts\n new Python programmers; consider:\n\n >>> lists = [[]] * 3\n >>> lists\n [[], [], []]\n >>> lists[0].append(3)\n >>> lists\n [[3], [3], [3]]\n\n What has happened is that ``[[]]`` is a one-element list containing\n an empty list, so all three elements of ``[[]] * 3`` are (pointers\n to) this single empty list. Modifying any of the elements of\n ``lists`` modifies this single list. You can create a list of\n different lists this way:\n\n >>> lists = [[] for i in range(3)]\n >>> lists[0].append(3)\n >>> lists[1].append(5)\n >>> lists[2].append(7)\n >>> lists\n [[3], [5], [7]]\n\n3. If *i* or *j* is negative, the index is relative to the end of the\n string: ``len(s) + i`` or ``len(s) + j`` is substituted. But note\n that ``-0`` is still ``0``.\n\n4. The slice of *s* from *i* to *j* is defined as the sequence of\n items with index *k* such that ``i <= k < j``. If *i* or *j* is\n greater than ``len(s)``, use ``len(s)``. If *i* is omitted or\n ``None``, use ``0``. If *j* is omitted or ``None``, use\n ``len(s)``. If *i* is greater than or equal to *j*, the slice is\n empty.\n\n5. The slice of *s* from *i* to *j* with step *k* is defined as the\n sequence of items with index ``x = i + n*k`` such that ``0 <= n <\n (j-i)/k``. In other words, the indices are ``i``, ``i+k``,\n ``i+2*k``, ``i+3*k`` and so on, stopping when *j* is reached (but\n never including *j*). If *i* or *j* is greater than ``len(s)``,\n use ``len(s)``. If *i* or *j* are omitted or ``None``, they become\n "end" values (which end depends on the sign of *k*). Note, *k*\n cannot be zero. If *k* is ``None``, it is treated like ``1``.\n\n6. If *s* and *t* are both strings, some Python implementations such\n as CPython can usually perform an in-place optimization for\n assignments of the form ``s=s+t`` or ``s+=t``. When applicable,\n this optimization makes quadratic run-time much less likely. This\n optimization is both version and implementation dependent. For\n performance sensitive code, it is preferable to use the\n ``str.join()`` method which assures consistent linear concatenation\n performance across versions and implementations.\n\n Changed in version 2.4: Formerly, string concatenation never\n occurred in-place.\n\n\nString Methods\n==============\n\nBelow are listed the string methods which both 8-bit strings and\nUnicode objects support. Note that none of these methods take keyword\narguments.\n\nIn addition, Python\'s strings support the sequence type methods\ndescribed in the *Sequence Types --- str, unicode, list, tuple,\nbuffer, xrange* section. To output formatted strings use template\nstrings or the ``%`` operator described in the *String Formatting\nOperations* section. Also, see the ``re`` module for string functions\nbased on regular expressions.\n\nstr.capitalize()\n\n Return a copy of the string with only its first character\n capitalized.\n\n For 8-bit strings, this method is locale-dependent.\n\nstr.center(width[, fillchar])\n\n Return centered in a string of length *width*. Padding is done\n using the specified *fillchar* (default is a space).\n\n Changed in version 2.4: Support for the *fillchar* argument.\n\nstr.count(sub[, start[, end]])\n\n Return the number of occurrences of substring *sub* in the range\n [*start*, *end*]. Optional arguments *start* and *end* are\n interpreted as in slice notation.\n\nstr.decode([encoding[, errors]])\n\n Decodes the string using the codec registered for *encoding*.\n *encoding* defaults to the default string encoding. *errors* may\n be given to set a different error handling scheme. The default is\n ``\'strict\'``, meaning that encoding errors raise ``UnicodeError``.\n Other possible values are ``\'ignore\'``, ``\'replace\'`` and any other\n name registered via ``codecs.register_error()``, see section *Codec\n Base Classes*.\n\n Added in version 2.2.\n\n Changed in version 2.3: Support for other error handling schemes\n added.\n\nstr.encode([encoding[, errors]])\n\n Return an encoded version of the string. Default encoding is the\n current default string encoding. *errors* may be given to set a\n different error handling scheme. The default for *errors* is\n ``\'strict\'``, meaning that encoding errors raise a\n ``UnicodeError``. Other possible values are ``\'ignore\'``,\n ``\'replace\'``, ``\'xmlcharrefreplace\'``, ``\'backslashreplace\'`` and\n any other name registered via ``codecs.register_error()``, see\n section *Codec Base Classes*. For a list of possible encodings, see\n section *Standard Encodings*.\n\n Added in version 2.0.\n\n Changed in version 2.3: Support for ``\'xmlcharrefreplace\'`` and\n ``\'backslashreplace\'`` and other error handling schemes added.\n\nstr.endswith(suffix[, start[, end]])\n\n Return ``True`` if the string ends with the specified *suffix*,\n otherwise return ``False``. *suffix* can also be a tuple of\n suffixes to look for. With optional *start*, test beginning at\n that position. With optional *end*, stop comparing at that\n position.\n\n Changed in version 2.5: Accept tuples as *suffix*.\n\nstr.expandtabs([tabsize])\n\n Return a copy of the string where all tab characters are replaced\n by one or more spaces, depending on the current column and the\n given tab size. The column number is reset to zero after each\n newline occurring in the string. If *tabsize* is not given, a tab\n size of ``8`` characters is assumed. This doesn\'t understand other\n non-printing characters or escape sequences.\n\nstr.find(sub[, start[, end]])\n\n Return the lowest index in the string where substring *sub* is\n found, such that *sub* is contained in the range [*start*, *end*].\n Optional arguments *start* and *end* are interpreted as in slice\n notation. Return ``-1`` if *sub* is not found.\n\nstr.format(format_string, *args, **kwargs)\n\n Perform a string formatting operation. The *format_string*\n argument can contain literal text or replacement fields delimited\n by braces ``{}``. Each replacement field contains either the\n numeric index of a positional argument, or the name of a keyword\n argument. Returns a copy of *format_string* where each replacement\n field is replaced with the string value of the corresponding\n argument.\n\n >>> "The sum of 1 + 2 is {0}".format(1+2)\n \'The sum of 1 + 2 is 3\'\n\n See *Format String Syntax* for a description of the various\n formatting options that can be specified in format strings.\n\n This method of string formatting is the new standard in Python 3.0,\n and should be preferred to the ``%`` formatting described in\n *String Formatting Operations* in new code.\n\n Added in version 2.6.\n\nstr.index(sub[, start[, end]])\n\n Like ``find()``, but raise ``ValueError`` when the substring is not\n found.\n\nstr.isalnum()\n\n Return true if all characters in the string are alphanumeric and\n there is at least one character, false otherwise.\n\n For 8-bit strings, this method is locale-dependent.\n\nstr.isalpha()\n\n Return true if all characters in the string are alphabetic and\n there is at least one character, false otherwise.\n\n For 8-bit strings, this method is locale-dependent.\n\nstr.isdigit()\n\n Return true if all characters in the string are digits and there is\n at least one character, false otherwise.\n\n For 8-bit strings, this method is locale-dependent.\n\nstr.islower()\n\n Return true if all cased characters in the string are lowercase and\n there is at least one cased character, false otherwise.\n\n For 8-bit strings, this method is locale-dependent.\n\nstr.isspace()\n\n Return true if there are only whitespace characters in the string\n and there is at least one character, false otherwise.\n\n For 8-bit strings, this method is locale-dependent.\n\nstr.istitle()\n\n Return true if the string is a titlecased string and there is at\n least one character, for example uppercase characters may only\n follow uncased characters and lowercase characters only cased ones.\n Return false otherwise.\n\n For 8-bit strings, this method is locale-dependent.\n\nstr.isupper()\n\n Return true if all cased characters in the string are uppercase and\n there is at least one cased character, false otherwise.\n\n For 8-bit strings, this method is locale-dependent.\n\nstr.join(seq)\n\n Return a string which is the concatenation of the strings in the\n sequence *seq*. The separator between elements is the string\n providing this method.\n\nstr.ljust(width[, fillchar])\n\n Return the string left justified in a string of length *width*.\n Padding is done using the specified *fillchar* (default is a\n space). The original string is returned if *width* is less than\n ``len(s)``.\n\n Changed in version 2.4: Support for the *fillchar* argument.\n\nstr.lower()\n\n Return a copy of the string converted to lowercase.\n\n For 8-bit strings, this method is locale-dependent.\n\nstr.lstrip([chars])\n\n Return a copy of the string with leading characters removed. The\n *chars* argument is a string specifying the set of characters to be\n removed. If omitted or ``None``, the *chars* argument defaults to\n removing whitespace. The *chars* argument is not a prefix; rather,\n all combinations of its values are stripped:\n\n >>> \' spacious \'.lstrip()\n \'spacious \'\n >>> \'www.example.com\'.lstrip(\'cmowz.\')\n \'example.com\'\n\n Changed in version 2.2.2: Support for the *chars* argument.\n\nstr.partition(sep)\n\n Split the string at the first occurrence of *sep*, and return a\n 3-tuple containing the part before the separator, the separator\n itself, and the part after the separator. If the separator is not\n found, return a 3-tuple containing the string itself, followed by\n two empty strings.\n\n Added in version 2.5.\n\nstr.replace(old, new[, count])\n\n Return a copy of the string with all occurrences of substring *old*\n replaced by *new*. If the optional argument *count* is given, only\n the first *count* occurrences are replaced.\n\nstr.rfind(sub[, start[, end]])\n\n Return the highest index in the string where substring *sub* is\n found, such that *sub* is contained within s[start,end]. Optional\n arguments *start* and *end* are interpreted as in slice notation.\n Return ``-1`` on failure.\n\nstr.rindex(sub[, start[, end]])\n\n Like ``rfind()`` but raises ``ValueError`` when the substring *sub*\n is not found.\n\nstr.rjust(width[, fillchar])\n\n Return the string right justified in a string of length *width*.\n Padding is done using the specified *fillchar* (default is a\n space). The original string is returned if *width* is less than\n ``len(s)``.\n\n Changed in version 2.4: Support for the *fillchar* argument.\n\nstr.rpartition(sep)\n\n Split the string at the last occurrence of *sep*, and return a\n 3-tuple containing the part before the separator, the separator\n itself, and the part after the separator. If the separator is not\n found, return a 3-tuple containing two empty strings, followed by\n the string itself.\n\n Added in version 2.5.\n\nstr.rsplit([sep[, maxsplit]])\n\n Return a list of the words in the string, using *sep* as the\n delimiter string. If *maxsplit* is given, at most *maxsplit* splits\n are done, the *rightmost* ones. If *sep* is not specified or\n ``None``, any whitespace string is a separator. Except for\n splitting from the right, ``rsplit()`` behaves like ``split()``\n which is described in detail below.\n\n Added in version 2.4.\n\nstr.rstrip([chars])\n\n Return a copy of the string with trailing characters removed. The\n *chars* argument is a string specifying the set of characters to be\n removed. If omitted or ``None``, the *chars* argument defaults to\n removing whitespace. The *chars* argument is not a suffix; rather,\n all combinations of its values are stripped:\n\n >>> \' spacious \'.rstrip()\n \' spacious\'\n >>> \'mississippi\'.rstrip(\'ipz\')\n \'mississ\'\n\n Changed in version 2.2.2: Support for the *chars* argument.\n\nstr.split([sep[, maxsplit]])\n\n Return a list of the words in the string, using *sep* as the\n delimiter string. If *maxsplit* is given, at most *maxsplit*\n splits are done (thus, the list will have at most ``maxsplit+1``\n elements). If *maxsplit* is not specified, then there is no limit\n on the number of splits (all possible splits are made).\n\n If *sep* is given, consecutive delimiters are not grouped together\n and are deemed to delimit empty strings (for example,\n ``\'1,,2\'.split(\',\')`` returns ``[\'1\', \'\', \'2\']``). The *sep*\n argument may consist of multiple characters (for example,\n ``\'1<>2<>3\'.split(\'<>\')`` returns ``[\'1\', \'2\', \'3\']``). Splitting\n an empty string with a specified separator returns ``[\'\']``.\n\n If *sep* is not specified or is ``None``, a different splitting\n algorithm is applied: runs of consecutive whitespace are regarded\n as a single separator, and the result will contain no empty strings\n at the start or end if the string has leading or trailing\n whitespace. Consequently, splitting an empty string or a string\n consisting of just whitespace with a ``None`` separator returns\n ``[]``.\n\n For example, ``\' 1 2 3 \'.split()`` returns ``[\'1\', \'2\', \'3\']``,\n and ``\' 1 2 3 \'.split(None, 1)`` returns ``[\'1\', \'2 3 \']``.\n\nstr.splitlines([keepends])\n\n Return a list of the lines in the string, breaking at line\n boundaries. Line breaks are not included in the resulting list\n unless *keepends* is given and true.\n\nstr.startswith(prefix[, start[, end]])\n\n Return ``True`` if string starts with the *prefix*, otherwise\n return ``False``. *prefix* can also be a tuple of prefixes to look\n for. With optional *start*, test string beginning at that\n position. With optional *end*, stop comparing string at that\n position.\n\n Changed in version 2.5: Accept tuples as *prefix*.\n\nstr.strip([chars])\n\n Return a copy of the string with the leading and trailing\n characters removed. The *chars* argument is a string specifying the\n set of characters to be removed. If omitted or ``None``, the\n *chars* argument defaults to removing whitespace. The *chars*\n argument is not a prefix or suffix; rather, all combinations of its\n values are stripped:\n\n >>> \' spacious \'.strip()\n \'spacious\'\n >>> \'www.example.com\'.strip(\'cmowz.\')\n \'example\'\n\n Changed in version 2.2.2: Support for the *chars* argument.\n\nstr.swapcase()\n\n Return a copy of the string with uppercase characters converted to\n lowercase and vice versa.\n\n For 8-bit strings, this method is locale-dependent.\n\nstr.title()\n\n Return a titlecased version of the string: words start with\n uppercase characters, all remaining cased characters are lowercase.\n\n For 8-bit strings, this method is locale-dependent.\n\nstr.translate(table[, deletechars])\n\n Return a copy of the string where all characters occurring in the\n optional argument *deletechars* are removed, and the remaining\n characters have been mapped through the given translation table,\n which must be a string of length 256.\n\n You can use the ``maketrans()`` helper function in the ``string``\n module to create a translation table. For string objects, set the\n *table* argument to ``None`` for translations that only delete\n characters:\n\n >>> \'read this short text\'.translate(None, \'aeiou\')\n \'rd ths shrt txt\'\n\n Added in version 2.6: Support for a ``None`` *table* argument.\n\n For Unicode objects, the ``translate()`` method does not accept the\n optional *deletechars* argument. Instead, it returns a copy of the\n *s* where all characters have been mapped through the given\n translation table which must be a mapping of Unicode ordinals to\n Unicode ordinals, Unicode strings or ``None``. Unmapped characters\n are left untouched. Characters mapped to ``None`` are deleted.\n Note, a more flexible approach is to create a custom character\n mapping codec using the ``codecs`` module (see ``encodings.cp1251``\n for an example).\n\nstr.upper()\n\n Return a copy of the string converted to uppercase.\n\n For 8-bit strings, this method is locale-dependent.\n\nstr.zfill(width)\n\n Return the numeric string left filled with zeros in a string of\n length *width*. A sign prefix is handled correctly. The original\n string is returned if *width* is less than ``len(s)``.\n\n Added in version 2.2.2.\n\nThe following methods are present only on unicode objects:\n\nunicode.isnumeric()\n\n Return ``True`` if there are only numeric characters in S,\n ``False`` otherwise. Numeric characters include digit characters,\n and all characters that have the Unicode numeric value property,\n e.g. U+2155, VULGAR FRACTION ONE FIFTH.\n\nunicode.isdecimal()\n\n Return ``True`` if there are only decimal characters in S,\n ``False`` otherwise. Decimal characters include digit characters,\n and all characters that that can be used to form decimal-radix\n numbers, e.g. U+0660, ARABIC-INDIC DIGIT ZERO.\n\n\nString Formatting Operations\n============================\n\nString and Unicode objects have one unique built-in operation: the\n``%`` operator (modulo). This is also known as the string\n*formatting* or *interpolation* operator. Given ``format % values``\n(where *format* is a string or Unicode object), ``%`` conversion\nspecifications in *format* are replaced with zero or more elements of\n*values*. The effect is similar to the using ``sprintf`` in the C\nlanguage. If *format* is a Unicode object, or if any of the objects\nbeing converted using the ``%s`` conversion are Unicode objects, the\nresult will also be a Unicode object.\n\nIf *format* requires a single argument, *values* may be a single non-\ntuple object. [4] Otherwise, *values* must be a tuple with exactly\nthe number of items specified by the format string, or a single\nmapping object (for example, a dictionary).\n\nA conversion specifier contains two or more characters and has the\nfollowing components, which must occur in this order:\n\n1. The ``\'%\'`` character, which marks the start of the specifier.\n\n2. Mapping key (optional), consisting of a parenthesised sequence of\n characters (for example, ``(somename)``).\n\n3. Conversion flags (optional), which affect the result of some\n conversion types.\n\n4. Minimum field width (optional). If specified as an ``\'*\'``\n (asterisk), the actual width is read from the next element of the\n tuple in *values*, and the object to convert comes after the\n minimum field width and optional precision.\n\n5. Precision (optional), given as a ``\'.\'`` (dot) followed by the\n precision. If specified as ``\'*\'`` (an asterisk), the actual width\n is read from the next element of the tuple in *values*, and the\n value to convert comes after the precision.\n\n6. Length modifier (optional).\n\n7. Conversion type.\n\nWhen the right argument is a dictionary (or other mapping type), then\nthe formats in the string *must* include a parenthesised mapping key\ninto that dictionary inserted immediately after the ``\'%\'`` character.\nThe mapping key selects the value to be formatted from the mapping.\nFor example:\n\n>>> print \'%(language)s has %(#)03d quote types.\' % \\\n... {\'language\': "Python", "#": 2}\nPython has 002 quote types.\n\nIn this case no ``*`` specifiers may occur in a format (since they\nrequire a sequential parameter list).\n\nThe conversion flag characters are:\n\n+-----------+-----------------------------------------------------------------------+\n| Flag | Meaning |\n+===========+=======================================================================+\n| ``\'#\'`` | The value conversion will use the "alternate form" (where defined |\n| | below). |\n+-----------+-----------------------------------------------------------------------+\n| ``\'0\'`` | The conversion will be zero padded for numeric values. |\n+-----------+-----------------------------------------------------------------------+\n| ``\'-\'`` | The converted value is left adjusted (overrides the ``\'0\'`` |\n| | conversion if both are given). |\n+-----------+-----------------------------------------------------------------------+\n| ``\' \'`` | (a space) A blank should be left before a positive number (or empty |\n| | string) produced by a signed conversion. |\n+-----------+-----------------------------------------------------------------------+\n| ``\'+\'`` | A sign character (``\'+\'`` or ``\'-\'``) will precede the conversion |\n| | (overrides a "space" flag). |\n+-----------+-----------------------------------------------------------------------+\n\nA length modifier (``h``, ``l``, or ``L``) may be present, but is\nignored as it is not necessary for Python -- so e.g. ``%ld`` is\nidentical to ``%d``.\n\nThe conversion types are:\n\n+--------------+-------------------------------------------------------+---------+\n| Conversion | Meaning | Notes |\n+==============+=======================================================+=========+\n| ``\'d\'`` | Signed integer decimal. | |\n+--------------+-------------------------------------------------------+---------+\n| ``\'i\'`` | Signed integer decimal. | |\n+--------------+-------------------------------------------------------+---------+\n| ``\'o\'`` | Signed octal value. | (1) |\n+--------------+-------------------------------------------------------+---------+\n| ``\'u\'`` | Obselete type -- it is identical to ``\'d\'``. | (7) |\n+--------------+-------------------------------------------------------+---------+\n| ``\'x\'`` | Signed hexadecimal (lowercase). | (2) |\n+--------------+-------------------------------------------------------+---------+\n| ``\'X\'`` | Signed hexadecimal (uppercase). | (2) |\n+--------------+-------------------------------------------------------+---------+\n| ``\'e\'`` | Floating point exponential format (lowercase). | (3) |\n+--------------+-------------------------------------------------------+---------+\n| ``\'E\'`` | Floating point exponential format (uppercase). | (3) |\n+--------------+-------------------------------------------------------+---------+\n| ``\'f\'`` | Floating point decimal format. | (3) |\n+--------------+-------------------------------------------------------+---------+\n| ``\'F\'`` | Floating point decimal format. | (3) |\n+--------------+-------------------------------------------------------+---------+\n| ``\'g\'`` | Floating point format. Uses lowercase exponential | (4) |\n| | format if exponent is less than -4 or not less than | |\n| | precision, decimal format otherwise. | |\n+--------------+-------------------------------------------------------+---------+\n| ``\'G\'`` | Floating point format. Uses uppercase exponential | (4) |\n| | format if exponent is less than -4 or not less than | |\n| | precision, decimal format otherwise. | |\n+--------------+-------------------------------------------------------+---------+\n| ``\'c\'`` | Single character (accepts integer or single character | |\n| | string). | |\n+--------------+-------------------------------------------------------+---------+\n| ``\'r\'`` | String (converts any python object using ``repr()``). | (5) |\n+--------------+-------------------------------------------------------+---------+\n| ``\'s\'`` | String (converts any python object using ``str()``). | (6) |\n+--------------+-------------------------------------------------------+---------+\n| ``\'%\'`` | No argument is converted, results in a ``\'%\'`` | |\n| | character in the result. | |\n+--------------+-------------------------------------------------------+---------+\n\nNotes:\n\n1. The alternate form causes a leading zero (``\'0\'``) to be inserted\n between left-hand padding and the formatting of the number if the\n leading character of the result is not already a zero.\n\n2. The alternate form causes a leading ``\'0x\'`` or ``\'0X\'`` (depending\n on whether the ``\'x\'`` or ``\'X\'`` format was used) to be inserted\n between left-hand padding and the formatting of the number if the\n leading character of the result is not already a zero.\n\n3. The alternate form causes the result to always contain a decimal\n point, even if no digits follow it.\n\n The precision determines the number of digits after the decimal\n point and defaults to 6.\n\n4. The alternate form causes the result to always contain a decimal\n point, and trailing zeroes are not removed as they would otherwise\n be.\n\n The precision determines the number of significant digits before\n and after the decimal point and defaults to 6.\n\n5. The ``%r`` conversion was added in Python 2.0.\n\n The precision determines the maximal number of characters used.\n\n6. If the object or format provided is a ``unicode`` string, the\n resulting string will also be ``unicode``.\n\n The precision determines the maximal number of characters used.\n\n7. See **PEP 237**.\n\nSince Python strings have an explicit length, ``%s`` conversions do\nnot assume that ``\'\\0\'`` is the end of the string.\n\nFor safety reasons, floating point precisions are clipped to 50;\n``%f`` conversions for numbers whose absolute value is over 1e25 are\nreplaced by ``%g`` conversions. [5] All other errors raise\nexceptions.\n\nAdditional string operations are defined in standard modules\n``string`` and ``re``.\n\n\nXRange Type\n===========\n\nThe ``xrange`` type is an immutable sequence which is commonly used\nfor looping. The advantage of the ``xrange`` type is that an\n``xrange`` object will always take the same amount of memory, no\nmatter the size of the range it represents. There are no consistent\nperformance advantages.\n\nXRange objects have very little behavior: they only support indexing,\niteration, and the ``len()`` function.\n\n\nMutable Sequence Types\n======================\n\nList objects support additional operations that allow in-place\nmodification of the object. Other mutable sequence types (when added\nto the language) should also support these operations. Strings and\ntuples are immutable sequence types: such objects cannot be modified\nonce created. The following operations are defined on mutable sequence\ntypes (where *x* is an arbitrary object):\n\n+--------------------------------+----------------------------------+-----------------------+\n| Operation | Result | Notes |\n+================================+==================================+=======================+\n| ``s[i] = x`` | item *i* of *s* is replaced by | |\n| | *x* | |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s[i:j] = t`` | slice of *s* from *i* to *j* is | |\n| | replaced by the contents of the | |\n| | iterable *t* | |\n+--------------------------------+----------------------------------+-----------------------+\n| ``del s[i:j]`` | same as ``s[i:j] = []`` | |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s[i:j:k] = t`` | the elements of ``s[i:j:k]`` are | (1) |\n| | replaced by those of *t* | |\n+--------------------------------+----------------------------------+-----------------------+\n| ``del s[i:j:k]`` | removes the elements of | |\n| | ``s[i:j:k]`` from the list | |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s.append(x)`` | same as ``s[len(s):len(s)] = | (2) |\n| | [x]`` | |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s.extend(x)`` | same as ``s[len(s):len(s)] = x`` | (3) |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s.count(x)`` | return number of *i*\'s for which | |\n| | ``s[i] == x`` | |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s.index(x[, i[, j]])`` | return smallest *k* such that | (4) |\n| | ``s[k] == x`` and ``i <= k < j`` | |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s.insert(i, x)`` | same as ``s[i:i] = [x]`` | (5) |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s.pop([i])`` | same as ``x = s[i]; del s[i]; | (6) |\n| | return x`` | |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s.remove(x)`` | same as ``del s[s.index(x)]`` | (4) |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s.reverse()`` | reverses the items of *s* in | (7) |\n| | place | |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s.sort([cmp[, key[, | sort the items of *s* in place | (7)(8)(9)(10) |\n| reverse]]])`` | | |\n+--------------------------------+----------------------------------+-----------------------+\n\nNotes:\n\n1. *t* must have the same length as the slice it is replacing.\n\n2. The C implementation of Python has historically accepted multiple\n parameters and implicitly joined them into a tuple; this no longer\n works in Python 2.0. Use of this misfeature has been deprecated\n since Python 1.4.\n\n3. *x* can be any iterable object.\n\n4. Raises ``ValueError`` when *x* is not found in *s*. When a negative\n index is passed as the second or third parameter to the ``index()``\n method, the list length is added, as for slice indices. If it is\n still negative, it is truncated to zero, as for slice indices.\n\n Changed in version 2.3: Previously, ``index()`` didn\'t have\n arguments for specifying start and stop positions.\n\n5. When a negative index is passed as the first parameter to the\n ``insert()`` method, the list length is added, as for slice\n indices. If it is still negative, it is truncated to zero, as for\n slice indices.\n\n Changed in version 2.3: Previously, all negative indices were\n truncated to zero.\n\n6. The ``pop()`` method is only supported by the list and array types.\n The optional argument *i* defaults to ``-1``, so that by default\n the last item is removed and returned.\n\n7. The ``sort()`` and ``reverse()`` methods modify the list in place\n for economy of space when sorting or reversing a large list. To\n remind you that they operate by side effect, they don\'t return the\n sorted or reversed list.\n\n8. The ``sort()`` method takes optional arguments for controlling the\n comparisons.\n\n *cmp* specifies a custom comparison function of two arguments (list\n items) which should return a negative, zero or positive number\n depending on whether the first argument is considered smaller than,\n equal to, or larger than the second argument: ``cmp=lambda x,y:\n cmp(x.lower(), y.lower())``. The default value is ``None``.\n\n *key* specifies a function of one argument that is used to extract\n a comparison key from each list element: ``key=str.lower``. The\n default value is ``None``.\n\n *reverse* is a boolean value. If set to ``True``, then the list\n elements are sorted as if each comparison were reversed.\n\n In general, the *key* and *reverse* conversion processes are much\n faster than specifying an equivalent *cmp* function. This is\n because *cmp* is called multiple times for each list element while\n *key* and *reverse* touch each element only once.\n\n Changed in version 2.3: Support for ``None`` as an equivalent to\n omitting *cmp* was added.\n\n Changed in version 2.4: Support for *key* and *reverse* was added.\n\n9. Starting with Python 2.3, the ``sort()`` method is guaranteed to be\n stable. A sort is stable if it guarantees not to change the\n relative order of elements that compare equal --- this is helpful\n for sorting in multiple passes (for example, sort by department,\n then by salary grade).\n\n10. While a list is being sorted, the effect of attempting to mutate,\n or even inspect, the list is undefined. The C implementation of\n Python 2.3 and newer makes the list appear empty for the duration,\n and raises ``ValueError`` if it can detect that the list has been\n mutated during a sort.\n', + 'typesseq': u'\nSequence Types --- ``str``, ``unicode``, ``list``, ``tuple``, ``buffer``, ``xrange``\n************************************************************************************\n\nThere are six sequence types: strings, Unicode strings, lists, tuples,\nbuffers, and xrange objects. (For other containers see the built in\n``dict``, ``list``, ``set``, and ``tuple`` classes, and the\n``collections`` module.)\n\nString literals are written in single or double quotes: ``\'xyzzy\'``,\n``"frobozz"``. See *String literals* for more about string literals.\nUnicode strings are much like strings, but are specified in the syntax\nusing a preceding ``\'u\'`` character: ``u\'abc\'``, ``u"def"``. In\naddition to the functionality described here, there are also string-\nspecific methods described in the *String Methods* section. Lists are\nconstructed with square brackets, separating items with commas: ``[a,\nb, c]``. Tuples are constructed by the comma operator (not within\nsquare brackets), with or without enclosing parentheses, but an empty\ntuple must have the enclosing parentheses, such as ``a, b, c`` or\n``()``. A single item tuple must have a trailing comma, such as\n``(d,)``.\n\nBuffer objects are not directly supported by Python syntax, but can be\ncreated by calling the builtin function ``buffer()``. They don\'t\nsupport concatenation or repetition.\n\nObjects of type xrange are similar to buffers in that there is no\nspecific syntax to create them, but they are created using the\n``xrange()`` function. They don\'t support slicing, concatenation or\nrepetition, and using ``in``, ``not in``, ``min()`` or ``max()`` on\nthem is inefficient.\n\nMost sequence types support the following operations. The ``in`` and\n``not in`` operations have the same priorities as the comparison\noperations. The ``+`` and ``*`` operations have the same priority as\nthe corresponding numeric operations. [3] Additional methods are\nprovided for *Mutable Sequence Types*.\n\nThis table lists the sequence operations sorted in ascending priority\n(operations in the same box have the same priority). In the table,\n*s* and *t* are sequences of the same type; *n*, *i* and *j* are\nintegers:\n\n+--------------------+----------------------------------+------------+\n| Operation | Result | Notes |\n+====================+==================================+============+\n| ``x in s`` | ``True`` if an item of *s* is | (1) |\n| | equal to *x*, else ``False`` | |\n+--------------------+----------------------------------+------------+\n| ``x not in s`` | ``False`` if an item of *s* is | (1) |\n| | equal to *x*, else ``True`` | |\n+--------------------+----------------------------------+------------+\n| ``s + t`` | the concatenation of *s* and *t* | (6) |\n+--------------------+----------------------------------+------------+\n| ``s * n, n * s`` | *n* shallow copies of *s* | (2) |\n| | concatenated | |\n+--------------------+----------------------------------+------------+\n| ``s[i]`` | *i*\'th item of *s*, origin 0 | (3) |\n+--------------------+----------------------------------+------------+\n| ``s[i:j]`` | slice of *s* from *i* to *j* | (3)(4) |\n+--------------------+----------------------------------+------------+\n| ``s[i:j:k]`` | slice of *s* from *i* to *j* | (3)(5) |\n| | with step *k* | |\n+--------------------+----------------------------------+------------+\n| ``len(s)`` | length of *s* | |\n+--------------------+----------------------------------+------------+\n| ``min(s)`` | smallest item of *s* | |\n+--------------------+----------------------------------+------------+\n| ``max(s)`` | largest item of *s* | |\n+--------------------+----------------------------------+------------+\n\nSequence types also support comparisons. In particular, tuples and\nlists are compared lexicographically by comparing corresponding\nelements. This means that to compare equal, every element must compare\nequal and the two sequences must be of the same type and have the same\nlength. (For full details see *Comparisons* in the language\nreference.)\n\nNotes:\n\n1. When *s* is a string or Unicode string object the ``in`` and ``not\n in`` operations act like a substring test. In Python versions\n before 2.3, *x* had to be a string of length 1. In Python 2.3 and\n beyond, *x* may be a string of any length.\n\n2. Values of *n* less than ``0`` are treated as ``0`` (which yields an\n empty sequence of the same type as *s*). Note also that the copies\n are shallow; nested structures are not copied. This often haunts\n new Python programmers; consider:\n\n >>> lists = [[]] * 3\n >>> lists\n [[], [], []]\n >>> lists[0].append(3)\n >>> lists\n [[3], [3], [3]]\n\n What has happened is that ``[[]]`` is a one-element list containing\n an empty list, so all three elements of ``[[]] * 3`` are (pointers\n to) this single empty list. Modifying any of the elements of\n ``lists`` modifies this single list. You can create a list of\n different lists this way:\n\n >>> lists = [[] for i in range(3)]\n >>> lists[0].append(3)\n >>> lists[1].append(5)\n >>> lists[2].append(7)\n >>> lists\n [[3], [5], [7]]\n\n3. If *i* or *j* is negative, the index is relative to the end of the\n string: ``len(s) + i`` or ``len(s) + j`` is substituted. But note\n that ``-0`` is still ``0``.\n\n4. The slice of *s* from *i* to *j* is defined as the sequence of\n items with index *k* such that ``i <= k < j``. If *i* or *j* is\n greater than ``len(s)``, use ``len(s)``. If *i* is omitted or\n ``None``, use ``0``. If *j* is omitted or ``None``, use\n ``len(s)``. If *i* is greater than or equal to *j*, the slice is\n empty.\n\n5. The slice of *s* from *i* to *j* with step *k* is defined as the\n sequence of items with index ``x = i + n*k`` such that ``0 <= n <\n (j-i)/k``. In other words, the indices are ``i``, ``i+k``,\n ``i+2*k``, ``i+3*k`` and so on, stopping when *j* is reached (but\n never including *j*). If *i* or *j* is greater than ``len(s)``,\n use ``len(s)``. If *i* or *j* are omitted or ``None``, they become\n "end" values (which end depends on the sign of *k*). Note, *k*\n cannot be zero. If *k* is ``None``, it is treated like ``1``.\n\n6. If *s* and *t* are both strings, some Python implementations such\n as CPython can usually perform an in-place optimization for\n assignments of the form ``s=s+t`` or ``s+=t``. When applicable,\n this optimization makes quadratic run-time much less likely. This\n optimization is both version and implementation dependent. For\n performance sensitive code, it is preferable to use the\n ``str.join()`` method which assures consistent linear concatenation\n performance across versions and implementations.\n\n Changed in version 2.4: Formerly, string concatenation never\n occurred in-place.\n\n\nString Methods\n==============\n\nBelow are listed the string methods which both 8-bit strings and\nUnicode objects support. Note that none of these methods take keyword\narguments.\n\nIn addition, Python\'s strings support the sequence type methods\ndescribed in the *Sequence Types --- str, unicode, list, tuple,\nbuffer, xrange* section. To output formatted strings use template\nstrings or the ``%`` operator described in the *String Formatting\nOperations* section. Also, see the ``re`` module for string functions\nbased on regular expressions.\n\nstr.capitalize()\n\n Return a copy of the string with only its first character\n capitalized.\n\n For 8-bit strings, this method is locale-dependent.\n\nstr.center(width[, fillchar])\n\n Return centered in a string of length *width*. Padding is done\n using the specified *fillchar* (default is a space).\n\n Changed in version 2.4: Support for the *fillchar* argument.\n\nstr.count(sub[, start[, end]])\n\n Return the number of occurrences of substring *sub* in the range\n [*start*, *end*]. Optional arguments *start* and *end* are\n interpreted as in slice notation.\n\nstr.decode([encoding[, errors]])\n\n Decodes the string using the codec registered for *encoding*.\n *encoding* defaults to the default string encoding. *errors* may\n be given to set a different error handling scheme. The default is\n ``\'strict\'``, meaning that encoding errors raise ``UnicodeError``.\n Other possible values are ``\'ignore\'``, ``\'replace\'`` and any other\n name registered via ``codecs.register_error()``, see section *Codec\n Base Classes*.\n\n New in version 2.2.\n\n Changed in version 2.3: Support for other error handling schemes\n added.\n\nstr.encode([encoding[, errors]])\n\n Return an encoded version of the string. Default encoding is the\n current default string encoding. *errors* may be given to set a\n different error handling scheme. The default for *errors* is\n ``\'strict\'``, meaning that encoding errors raise a\n ``UnicodeError``. Other possible values are ``\'ignore\'``,\n ``\'replace\'``, ``\'xmlcharrefreplace\'``, ``\'backslashreplace\'`` and\n any other name registered via ``codecs.register_error()``, see\n section *Codec Base Classes*. For a list of possible encodings, see\n section *Standard Encodings*.\n\n New in version 2.0.\n\n Changed in version 2.3: Support for ``\'xmlcharrefreplace\'`` and\n ``\'backslashreplace\'`` and other error handling schemes added.\n\nstr.endswith(suffix[, start[, end]])\n\n Return ``True`` if the string ends with the specified *suffix*,\n otherwise return ``False``. *suffix* can also be a tuple of\n suffixes to look for. With optional *start*, test beginning at\n that position. With optional *end*, stop comparing at that\n position.\n\n Changed in version 2.5: Accept tuples as *suffix*.\n\nstr.expandtabs([tabsize])\n\n Return a copy of the string where all tab characters are replaced\n by one or more spaces, depending on the current column and the\n given tab size. The column number is reset to zero after each\n newline occurring in the string. If *tabsize* is not given, a tab\n size of ``8`` characters is assumed. This doesn\'t understand other\n non-printing characters or escape sequences.\n\nstr.find(sub[, start[, end]])\n\n Return the lowest index in the string where substring *sub* is\n found, such that *sub* is contained in the range [*start*, *end*].\n Optional arguments *start* and *end* are interpreted as in slice\n notation. Return ``-1`` if *sub* is not found.\n\nstr.format(format_string, *args, **kwargs)\n\n Perform a string formatting operation. The *format_string*\n argument can contain literal text or replacement fields delimited\n by braces ``{}``. Each replacement field contains either the\n numeric index of a positional argument, or the name of a keyword\n argument. Returns a copy of *format_string* where each replacement\n field is replaced with the string value of the corresponding\n argument.\n\n >>> "The sum of 1 + 2 is {0}".format(1+2)\n \'The sum of 1 + 2 is 3\'\n\n See *Format String Syntax* for a description of the various\n formatting options that can be specified in format strings.\n\n This method of string formatting is the new standard in Python 3.0,\n and should be preferred to the ``%`` formatting described in\n *String Formatting Operations* in new code.\n\n New in version 2.6.\n\nstr.index(sub[, start[, end]])\n\n Like ``find()``, but raise ``ValueError`` when the substring is not\n found.\n\nstr.isalnum()\n\n Return true if all characters in the string are alphanumeric and\n there is at least one character, false otherwise.\n\n For 8-bit strings, this method is locale-dependent.\n\nstr.isalpha()\n\n Return true if all characters in the string are alphabetic and\n there is at least one character, false otherwise.\n\n For 8-bit strings, this method is locale-dependent.\n\nstr.isdigit()\n\n Return true if all characters in the string are digits and there is\n at least one character, false otherwise.\n\n For 8-bit strings, this method is locale-dependent.\n\nstr.islower()\n\n Return true if all cased characters in the string are lowercase and\n there is at least one cased character, false otherwise.\n\n For 8-bit strings, this method is locale-dependent.\n\nstr.isspace()\n\n Return true if there are only whitespace characters in the string\n and there is at least one character, false otherwise.\n\n For 8-bit strings, this method is locale-dependent.\n\nstr.istitle()\n\n Return true if the string is a titlecased string and there is at\n least one character, for example uppercase characters may only\n follow uncased characters and lowercase characters only cased ones.\n Return false otherwise.\n\n For 8-bit strings, this method is locale-dependent.\n\nstr.isupper()\n\n Return true if all cased characters in the string are uppercase and\n there is at least one cased character, false otherwise.\n\n For 8-bit strings, this method is locale-dependent.\n\nstr.join(seq)\n\n Return a string which is the concatenation of the strings in the\n sequence *seq*. The separator between elements is the string\n providing this method.\n\nstr.ljust(width[, fillchar])\n\n Return the string left justified in a string of length *width*.\n Padding is done using the specified *fillchar* (default is a\n space). The original string is returned if *width* is less than\n ``len(s)``.\n\n Changed in version 2.4: Support for the *fillchar* argument.\n\nstr.lower()\n\n Return a copy of the string converted to lowercase.\n\n For 8-bit strings, this method is locale-dependent.\n\nstr.lstrip([chars])\n\n Return a copy of the string with leading characters removed. The\n *chars* argument is a string specifying the set of characters to be\n removed. If omitted or ``None``, the *chars* argument defaults to\n removing whitespace. The *chars* argument is not a prefix; rather,\n all combinations of its values are stripped:\n\n >>> \' spacious \'.lstrip()\n \'spacious \'\n >>> \'www.example.com\'.lstrip(\'cmowz.\')\n \'example.com\'\n\n Changed in version 2.2.2: Support for the *chars* argument.\n\nstr.partition(sep)\n\n Split the string at the first occurrence of *sep*, and return a\n 3-tuple containing the part before the separator, the separator\n itself, and the part after the separator. If the separator is not\n found, return a 3-tuple containing the string itself, followed by\n two empty strings.\n\n New in version 2.5.\n\nstr.replace(old, new[, count])\n\n Return a copy of the string with all occurrences of substring *old*\n replaced by *new*. If the optional argument *count* is given, only\n the first *count* occurrences are replaced.\n\nstr.rfind(sub[, start[, end]])\n\n Return the highest index in the string where substring *sub* is\n found, such that *sub* is contained within s[start,end]. Optional\n arguments *start* and *end* are interpreted as in slice notation.\n Return ``-1`` on failure.\n\nstr.rindex(sub[, start[, end]])\n\n Like ``rfind()`` but raises ``ValueError`` when the substring *sub*\n is not found.\n\nstr.rjust(width[, fillchar])\n\n Return the string right justified in a string of length *width*.\n Padding is done using the specified *fillchar* (default is a\n space). The original string is returned if *width* is less than\n ``len(s)``.\n\n Changed in version 2.4: Support for the *fillchar* argument.\n\nstr.rpartition(sep)\n\n Split the string at the last occurrence of *sep*, and return a\n 3-tuple containing the part before the separator, the separator\n itself, and the part after the separator. If the separator is not\n found, return a 3-tuple containing two empty strings, followed by\n the string itself.\n\n New in version 2.5.\n\nstr.rsplit([sep[, maxsplit]])\n\n Return a list of the words in the string, using *sep* as the\n delimiter string. If *maxsplit* is given, at most *maxsplit* splits\n are done, the *rightmost* ones. If *sep* is not specified or\n ``None``, any whitespace string is a separator. Except for\n splitting from the right, ``rsplit()`` behaves like ``split()``\n which is described in detail below.\n\n New in version 2.4.\n\nstr.rstrip([chars])\n\n Return a copy of the string with trailing characters removed. The\n *chars* argument is a string specifying the set of characters to be\n removed. If omitted or ``None``, the *chars* argument defaults to\n removing whitespace. The *chars* argument is not a suffix; rather,\n all combinations of its values are stripped:\n\n >>> \' spacious \'.rstrip()\n \' spacious\'\n >>> \'mississippi\'.rstrip(\'ipz\')\n \'mississ\'\n\n Changed in version 2.2.2: Support for the *chars* argument.\n\nstr.split([sep[, maxsplit]])\n\n Return a list of the words in the string, using *sep* as the\n delimiter string. If *maxsplit* is given, at most *maxsplit*\n splits are done (thus, the list will have at most ``maxsplit+1``\n elements). If *maxsplit* is not specified, then there is no limit\n on the number of splits (all possible splits are made).\n\n If *sep* is given, consecutive delimiters are not grouped together\n and are deemed to delimit empty strings (for example,\n ``\'1,,2\'.split(\',\')`` returns ``[\'1\', \'\', \'2\']``). The *sep*\n argument may consist of multiple characters (for example,\n ``\'1<>2<>3\'.split(\'<>\')`` returns ``[\'1\', \'2\', \'3\']``). Splitting\n an empty string with a specified separator returns ``[\'\']``.\n\n If *sep* is not specified or is ``None``, a different splitting\n algorithm is applied: runs of consecutive whitespace are regarded\n as a single separator, and the result will contain no empty strings\n at the start or end if the string has leading or trailing\n whitespace. Consequently, splitting an empty string or a string\n consisting of just whitespace with a ``None`` separator returns\n ``[]``.\n\n For example, ``\' 1 2 3 \'.split()`` returns ``[\'1\', \'2\', \'3\']``,\n and ``\' 1 2 3 \'.split(None, 1)`` returns ``[\'1\', \'2 3 \']``.\n\nstr.splitlines([keepends])\n\n Return a list of the lines in the string, breaking at line\n boundaries. Line breaks are not included in the resulting list\n unless *keepends* is given and true.\n\nstr.startswith(prefix[, start[, end]])\n\n Return ``True`` if string starts with the *prefix*, otherwise\n return ``False``. *prefix* can also be a tuple of prefixes to look\n for. With optional *start*, test string beginning at that\n position. With optional *end*, stop comparing string at that\n position.\n\n Changed in version 2.5: Accept tuples as *prefix*.\n\nstr.strip([chars])\n\n Return a copy of the string with the leading and trailing\n characters removed. The *chars* argument is a string specifying the\n set of characters to be removed. If omitted or ``None``, the\n *chars* argument defaults to removing whitespace. The *chars*\n argument is not a prefix or suffix; rather, all combinations of its\n values are stripped:\n\n >>> \' spacious \'.strip()\n \'spacious\'\n >>> \'www.example.com\'.strip(\'cmowz.\')\n \'example\'\n\n Changed in version 2.2.2: Support for the *chars* argument.\n\nstr.swapcase()\n\n Return a copy of the string with uppercase characters converted to\n lowercase and vice versa.\n\n For 8-bit strings, this method is locale-dependent.\n\nstr.title()\n\n Return a titlecased version of the string: words start with\n uppercase characters, all remaining cased characters are lowercase.\n\n For 8-bit strings, this method is locale-dependent.\n\nstr.translate(table[, deletechars])\n\n Return a copy of the string where all characters occurring in the\n optional argument *deletechars* are removed, and the remaining\n characters have been mapped through the given translation table,\n which must be a string of length 256.\n\n You can use the ``maketrans()`` helper function in the ``string``\n module to create a translation table. For string objects, set the\n *table* argument to ``None`` for translations that only delete\n characters:\n\n >>> \'read this short text\'.translate(None, \'aeiou\')\n \'rd ths shrt txt\'\n\n New in version 2.6: Support for a ``None`` *table* argument.\n\n For Unicode objects, the ``translate()`` method does not accept the\n optional *deletechars* argument. Instead, it returns a copy of the\n *s* where all characters have been mapped through the given\n translation table which must be a mapping of Unicode ordinals to\n Unicode ordinals, Unicode strings or ``None``. Unmapped characters\n are left untouched. Characters mapped to ``None`` are deleted.\n Note, a more flexible approach is to create a custom character\n mapping codec using the ``codecs`` module (see ``encodings.cp1251``\n for an example).\n\nstr.upper()\n\n Return a copy of the string converted to uppercase.\n\n For 8-bit strings, this method is locale-dependent.\n\nstr.zfill(width)\n\n Return the numeric string left filled with zeros in a string of\n length *width*. A sign prefix is handled correctly. The original\n string is returned if *width* is less than ``len(s)``.\n\n New in version 2.2.2.\n\nThe following methods are present only on unicode objects:\n\nunicode.isnumeric()\n\n Return ``True`` if there are only numeric characters in S,\n ``False`` otherwise. Numeric characters include digit characters,\n and all characters that have the Unicode numeric value property,\n e.g. U+2155, VULGAR FRACTION ONE FIFTH.\n\nunicode.isdecimal()\n\n Return ``True`` if there are only decimal characters in S,\n ``False`` otherwise. Decimal characters include digit characters,\n and all characters that that can be used to form decimal-radix\n numbers, e.g. U+0660, ARABIC-INDIC DIGIT ZERO.\n\n\nString Formatting Operations\n============================\n\nString and Unicode objects have one unique built-in operation: the\n``%`` operator (modulo). This is also known as the string\n*formatting* or *interpolation* operator. Given ``format % values``\n(where *format* is a string or Unicode object), ``%`` conversion\nspecifications in *format* are replaced with zero or more elements of\n*values*. The effect is similar to the using ``sprintf`` in the C\nlanguage. If *format* is a Unicode object, or if any of the objects\nbeing converted using the ``%s`` conversion are Unicode objects, the\nresult will also be a Unicode object.\n\nIf *format* requires a single argument, *values* may be a single non-\ntuple object. [4] Otherwise, *values* must be a tuple with exactly\nthe number of items specified by the format string, or a single\nmapping object (for example, a dictionary).\n\nA conversion specifier contains two or more characters and has the\nfollowing components, which must occur in this order:\n\n1. The ``\'%\'`` character, which marks the start of the specifier.\n\n2. Mapping key (optional), consisting of a parenthesised sequence of\n characters (for example, ``(somename)``).\n\n3. Conversion flags (optional), which affect the result of some\n conversion types.\n\n4. Minimum field width (optional). If specified as an ``\'*\'``\n (asterisk), the actual width is read from the next element of the\n tuple in *values*, and the object to convert comes after the\n minimum field width and optional precision.\n\n5. Precision (optional), given as a ``\'.\'`` (dot) followed by the\n precision. If specified as ``\'*\'`` (an asterisk), the actual width\n is read from the next element of the tuple in *values*, and the\n value to convert comes after the precision.\n\n6. Length modifier (optional).\n\n7. Conversion type.\n\nWhen the right argument is a dictionary (or other mapping type), then\nthe formats in the string *must* include a parenthesised mapping key\ninto that dictionary inserted immediately after the ``\'%\'`` character.\nThe mapping key selects the value to be formatted from the mapping.\nFor example:\n\n>>> print \'%(language)s has %(#)03d quote types.\' % \\\n... {\'language\': "Python", "#": 2}\nPython has 002 quote types.\n\nIn this case no ``*`` specifiers may occur in a format (since they\nrequire a sequential parameter list).\n\nThe conversion flag characters are:\n\n+-----------+-----------------------------------------------------------------------+\n| Flag | Meaning |\n+===========+=======================================================================+\n| ``\'#\'`` | The value conversion will use the "alternate form" (where defined |\n| | below). |\n+-----------+-----------------------------------------------------------------------+\n| ``\'0\'`` | The conversion will be zero padded for numeric values. |\n+-----------+-----------------------------------------------------------------------+\n| ``\'-\'`` | The converted value is left adjusted (overrides the ``\'0\'`` |\n| | conversion if both are given). |\n+-----------+-----------------------------------------------------------------------+\n| ``\' \'`` | (a space) A blank should be left before a positive number (or empty |\n| | string) produced by a signed conversion. |\n+-----------+-----------------------------------------------------------------------+\n| ``\'+\'`` | A sign character (``\'+\'`` or ``\'-\'``) will precede the conversion |\n| | (overrides a "space" flag). |\n+-----------+-----------------------------------------------------------------------+\n\nA length modifier (``h``, ``l``, or ``L``) may be present, but is\nignored as it is not necessary for Python -- so e.g. ``%ld`` is\nidentical to ``%d``.\n\nThe conversion types are:\n\n+--------------+-------------------------------------------------------+---------+\n| Conversion | Meaning | Notes |\n+==============+=======================================================+=========+\n| ``\'d\'`` | Signed integer decimal. | |\n+--------------+-------------------------------------------------------+---------+\n| ``\'i\'`` | Signed integer decimal. | |\n+--------------+-------------------------------------------------------+---------+\n| ``\'o\'`` | Signed octal value. | (1) |\n+--------------+-------------------------------------------------------+---------+\n| ``\'u\'`` | Obselete type -- it is identical to ``\'d\'``. | (7) |\n+--------------+-------------------------------------------------------+---------+\n| ``\'x\'`` | Signed hexadecimal (lowercase). | (2) |\n+--------------+-------------------------------------------------------+---------+\n| ``\'X\'`` | Signed hexadecimal (uppercase). | (2) |\n+--------------+-------------------------------------------------------+---------+\n| ``\'e\'`` | Floating point exponential format (lowercase). | (3) |\n+--------------+-------------------------------------------------------+---------+\n| ``\'E\'`` | Floating point exponential format (uppercase). | (3) |\n+--------------+-------------------------------------------------------+---------+\n| ``\'f\'`` | Floating point decimal format. | (3) |\n+--------------+-------------------------------------------------------+---------+\n| ``\'F\'`` | Floating point decimal format. | (3) |\n+--------------+-------------------------------------------------------+---------+\n| ``\'g\'`` | Floating point format. Uses lowercase exponential | (4) |\n| | format if exponent is less than -4 or not less than | |\n| | precision, decimal format otherwise. | |\n+--------------+-------------------------------------------------------+---------+\n| ``\'G\'`` | Floating point format. Uses uppercase exponential | (4) |\n| | format if exponent is less than -4 or not less than | |\n| | precision, decimal format otherwise. | |\n+--------------+-------------------------------------------------------+---------+\n| ``\'c\'`` | Single character (accepts integer or single character | |\n| | string). | |\n+--------------+-------------------------------------------------------+---------+\n| ``\'r\'`` | String (converts any python object using ``repr()``). | (5) |\n+--------------+-------------------------------------------------------+---------+\n| ``\'s\'`` | String (converts any python object using ``str()``). | (6) |\n+--------------+-------------------------------------------------------+---------+\n| ``\'%\'`` | No argument is converted, results in a ``\'%\'`` | |\n| | character in the result. | |\n+--------------+-------------------------------------------------------+---------+\n\nNotes:\n\n1. The alternate form causes a leading zero (``\'0\'``) to be inserted\n between left-hand padding and the formatting of the number if the\n leading character of the result is not already a zero.\n\n2. The alternate form causes a leading ``\'0x\'`` or ``\'0X\'`` (depending\n on whether the ``\'x\'`` or ``\'X\'`` format was used) to be inserted\n between left-hand padding and the formatting of the number if the\n leading character of the result is not already a zero.\n\n3. The alternate form causes the result to always contain a decimal\n point, even if no digits follow it.\n\n The precision determines the number of digits after the decimal\n point and defaults to 6.\n\n4. The alternate form causes the result to always contain a decimal\n point, and trailing zeroes are not removed as they would otherwise\n be.\n\n The precision determines the number of significant digits before\n and after the decimal point and defaults to 6.\n\n5. The ``%r`` conversion was added in Python 2.0.\n\n The precision determines the maximal number of characters used.\n\n6. If the object or format provided is a ``unicode`` string, the\n resulting string will also be ``unicode``.\n\n The precision determines the maximal number of characters used.\n\n7. See **PEP 237**.\n\nSince Python strings have an explicit length, ``%s`` conversions do\nnot assume that ``\'\\0\'`` is the end of the string.\n\nFor safety reasons, floating point precisions are clipped to 50;\n``%f`` conversions for numbers whose absolute value is over 1e25 are\nreplaced by ``%g`` conversions. [5] All other errors raise\nexceptions.\n\nAdditional string operations are defined in standard modules\n``string`` and ``re``.\n\n\nXRange Type\n===========\n\nThe ``xrange`` type is an immutable sequence which is commonly used\nfor looping. The advantage of the ``xrange`` type is that an\n``xrange`` object will always take the same amount of memory, no\nmatter the size of the range it represents. There are no consistent\nperformance advantages.\n\nXRange objects have very little behavior: they only support indexing,\niteration, and the ``len()`` function.\n\n\nMutable Sequence Types\n======================\n\nList objects support additional operations that allow in-place\nmodification of the object. Other mutable sequence types (when added\nto the language) should also support these operations. Strings and\ntuples are immutable sequence types: such objects cannot be modified\nonce created. The following operations are defined on mutable sequence\ntypes (where *x* is an arbitrary object):\n\n+--------------------------------+----------------------------------+-----------------------+\n| Operation | Result | Notes |\n+================================+==================================+=======================+\n| ``s[i] = x`` | item *i* of *s* is replaced by | |\n| | *x* | |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s[i:j] = t`` | slice of *s* from *i* to *j* is | |\n| | replaced by the contents of the | |\n| | iterable *t* | |\n+--------------------------------+----------------------------------+-----------------------+\n| ``del s[i:j]`` | same as ``s[i:j] = []`` | |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s[i:j:k] = t`` | the elements of ``s[i:j:k]`` are | (1) |\n| | replaced by those of *t* | |\n+--------------------------------+----------------------------------+-----------------------+\n| ``del s[i:j:k]`` | removes the elements of | |\n| | ``s[i:j:k]`` from the list | |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s.append(x)`` | same as ``s[len(s):len(s)] = | (2) |\n| | [x]`` | |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s.extend(x)`` | same as ``s[len(s):len(s)] = x`` | (3) |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s.count(x)`` | return number of *i*\'s for which | |\n| | ``s[i] == x`` | |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s.index(x[, i[, j]])`` | return smallest *k* such that | (4) |\n| | ``s[k] == x`` and ``i <= k < j`` | |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s.insert(i, x)`` | same as ``s[i:i] = [x]`` | (5) |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s.pop([i])`` | same as ``x = s[i]; del s[i]; | (6) |\n| | return x`` | |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s.remove(x)`` | same as ``del s[s.index(x)]`` | (4) |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s.reverse()`` | reverses the items of *s* in | (7) |\n| | place | |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s.sort([cmp[, key[, | sort the items of *s* in place | (7)(8)(9)(10) |\n| reverse]]])`` | | |\n+--------------------------------+----------------------------------+-----------------------+\n\nNotes:\n\n1. *t* must have the same length as the slice it is replacing.\n\n2. The C implementation of Python has historically accepted multiple\n parameters and implicitly joined them into a tuple; this no longer\n works in Python 2.0. Use of this misfeature has been deprecated\n since Python 1.4.\n\n3. *x* can be any iterable object.\n\n4. Raises ``ValueError`` when *x* is not found in *s*. When a negative\n index is passed as the second or third parameter to the ``index()``\n method, the list length is added, as for slice indices. If it is\n still negative, it is truncated to zero, as for slice indices.\n\n Changed in version 2.3: Previously, ``index()`` didn\'t have\n arguments for specifying start and stop positions.\n\n5. When a negative index is passed as the first parameter to the\n ``insert()`` method, the list length is added, as for slice\n indices. If it is still negative, it is truncated to zero, as for\n slice indices.\n\n Changed in version 2.3: Previously, all negative indices were\n truncated to zero.\n\n6. The ``pop()`` method is only supported by the list and array types.\n The optional argument *i* defaults to ``-1``, so that by default\n the last item is removed and returned.\n\n7. The ``sort()`` and ``reverse()`` methods modify the list in place\n for economy of space when sorting or reversing a large list. To\n remind you that they operate by side effect, they don\'t return the\n sorted or reversed list.\n\n8. The ``sort()`` method takes optional arguments for controlling the\n comparisons.\n\n *cmp* specifies a custom comparison function of two arguments (list\n items) which should return a negative, zero or positive number\n depending on whether the first argument is considered smaller than,\n equal to, or larger than the second argument: ``cmp=lambda x,y:\n cmp(x.lower(), y.lower())``. The default value is ``None``.\n\n *key* specifies a function of one argument that is used to extract\n a comparison key from each list element: ``key=str.lower``. The\n default value is ``None``.\n\n *reverse* is a boolean value. If set to ``True``, then the list\n elements are sorted as if each comparison were reversed.\n\n In general, the *key* and *reverse* conversion processes are much\n faster than specifying an equivalent *cmp* function. This is\n because *cmp* is called multiple times for each list element while\n *key* and *reverse* touch each element only once.\n\n Changed in version 2.3: Support for ``None`` as an equivalent to\n omitting *cmp* was added.\n\n Changed in version 2.4: Support for *key* and *reverse* was added.\n\n9. Starting with Python 2.3, the ``sort()`` method is guaranteed to be\n stable. A sort is stable if it guarantees not to change the\n relative order of elements that compare equal --- this is helpful\n for sorting in multiple passes (for example, sort by department,\n then by salary grade).\n\n10. While a list is being sorted, the effect of attempting to mutate,\n or even inspect, the list is undefined. The C implementation of\n Python 2.3 and newer makes the list appear empty for the duration,\n and raises ``ValueError`` if it can detect that the list has been\n mutated during a sort.\n', 'typesseq-mutable': u"\nMutable Sequence Types\n**********************\n\nList objects support additional operations that allow in-place\nmodification of the object. Other mutable sequence types (when added\nto the language) should also support these operations. Strings and\ntuples are immutable sequence types: such objects cannot be modified\nonce created. The following operations are defined on mutable sequence\ntypes (where *x* is an arbitrary object):\n\n+--------------------------------+----------------------------------+-----------------------+\n| Operation | Result | Notes |\n+================================+==================================+=======================+\n| ``s[i] = x`` | item *i* of *s* is replaced by | |\n| | *x* | |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s[i:j] = t`` | slice of *s* from *i* to *j* is | |\n| | replaced by the contents of the | |\n| | iterable *t* | |\n+--------------------------------+----------------------------------+-----------------------+\n| ``del s[i:j]`` | same as ``s[i:j] = []`` | |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s[i:j:k] = t`` | the elements of ``s[i:j:k]`` are | (1) |\n| | replaced by those of *t* | |\n+--------------------------------+----------------------------------+-----------------------+\n| ``del s[i:j:k]`` | removes the elements of | |\n| | ``s[i:j:k]`` from the list | |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s.append(x)`` | same as ``s[len(s):len(s)] = | (2) |\n| | [x]`` | |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s.extend(x)`` | same as ``s[len(s):len(s)] = x`` | (3) |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s.count(x)`` | return number of *i*'s for which | |\n| | ``s[i] == x`` | |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s.index(x[, i[, j]])`` | return smallest *k* such that | (4) |\n| | ``s[k] == x`` and ``i <= k < j`` | |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s.insert(i, x)`` | same as ``s[i:i] = [x]`` | (5) |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s.pop([i])`` | same as ``x = s[i]; del s[i]; | (6) |\n| | return x`` | |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s.remove(x)`` | same as ``del s[s.index(x)]`` | (4) |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s.reverse()`` | reverses the items of *s* in | (7) |\n| | place | |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s.sort([cmp[, key[, | sort the items of *s* in place | (7)(8)(9)(10) |\n| reverse]]])`` | | |\n+--------------------------------+----------------------------------+-----------------------+\n\nNotes:\n\n1. *t* must have the same length as the slice it is replacing.\n\n2. The C implementation of Python has historically accepted multiple\n parameters and implicitly joined them into a tuple; this no longer\n works in Python 2.0. Use of this misfeature has been deprecated\n since Python 1.4.\n\n3. *x* can be any iterable object.\n\n4. Raises ``ValueError`` when *x* is not found in *s*. When a negative\n index is passed as the second or third parameter to the ``index()``\n method, the list length is added, as for slice indices. If it is\n still negative, it is truncated to zero, as for slice indices.\n\n Changed in version 2.3: Previously, ``index()`` didn't have\n arguments for specifying start and stop positions.\n\n5. When a negative index is passed as the first parameter to the\n ``insert()`` method, the list length is added, as for slice\n indices. If it is still negative, it is truncated to zero, as for\n slice indices.\n\n Changed in version 2.3: Previously, all negative indices were\n truncated to zero.\n\n6. The ``pop()`` method is only supported by the list and array types.\n The optional argument *i* defaults to ``-1``, so that by default\n the last item is removed and returned.\n\n7. The ``sort()`` and ``reverse()`` methods modify the list in place\n for economy of space when sorting or reversing a large list. To\n remind you that they operate by side effect, they don't return the\n sorted or reversed list.\n\n8. The ``sort()`` method takes optional arguments for controlling the\n comparisons.\n\n *cmp* specifies a custom comparison function of two arguments (list\n items) which should return a negative, zero or positive number\n depending on whether the first argument is considered smaller than,\n equal to, or larger than the second argument: ``cmp=lambda x,y:\n cmp(x.lower(), y.lower())``. The default value is ``None``.\n\n *key* specifies a function of one argument that is used to extract\n a comparison key from each list element: ``key=str.lower``. The\n default value is ``None``.\n\n *reverse* is a boolean value. If set to ``True``, then the list\n elements are sorted as if each comparison were reversed.\n\n In general, the *key* and *reverse* conversion processes are much\n faster than specifying an equivalent *cmp* function. This is\n because *cmp* is called multiple times for each list element while\n *key* and *reverse* touch each element only once.\n\n Changed in version 2.3: Support for ``None`` as an equivalent to\n omitting *cmp* was added.\n\n Changed in version 2.4: Support for *key* and *reverse* was added.\n\n9. Starting with Python 2.3, the ``sort()`` method is guaranteed to be\n stable. A sort is stable if it guarantees not to change the\n relative order of elements that compare equal --- this is helpful\n for sorting in multiple passes (for example, sort by department,\n then by salary grade).\n\n10. While a list is being sorted, the effect of attempting to mutate,\n or even inspect, the list is undefined. The C implementation of\n Python 2.3 and newer makes the list appear empty for the duration,\n and raises ``ValueError`` if it can detect that the list has been\n mutated during a sort.\n", 'unary': u'\nUnary arithmetic operations\n***************************\n\nAll unary arithmetic (and bitwise) operations have the same priority:\n\n u_expr ::= power | "-" u_expr | "+" u_expr | "~" u_expr\n\nThe unary ``-`` (minus) operator yields the negation of its numeric\nargument.\n\nThe unary ``+`` (plus) operator yields its numeric argument unchanged.\n\nThe unary ``~`` (invert) operator yields the bitwise inversion of its\nplain or long integer argument. The bitwise inversion of ``x`` is\ndefined as ``-(x+1)``. It only applies to integral numbers.\n\nIn all three cases, if the argument does not have the proper type, a\n``TypeError`` exception is raised.\n', 'while': u'\nThe ``while`` statement\n***********************\n\nThe ``while`` statement is used for repeated execution as long as an\nexpression is true:\n\n while_stmt ::= "while" expression ":" suite\n ["else" ":" suite]\n\nThis repeatedly tests the expression and, if it is true, executes the\nfirst suite; if the expression is false (which may be the first time\nit is tested) the suite of the ``else`` clause, if present, is\nexecuted and the loop terminates.\n\nA ``break`` statement executed in the first suite terminates the loop\nwithout executing the ``else`` clause\'s suite. A ``continue``\nstatement executed in the first suite skips the rest of the suite and\ngoes back to testing the expression.\n', - 'with': u'\nThe ``with`` statement\n**********************\n\nAdded in version 2.5.\n\nThe ``with`` statement is used to wrap the execution of a block with\nmethods defined by a context manager (see section *With Statement\nContext Managers*). This allows common\n``try``...``except``...``finally`` usage patterns to be encapsulated\nfor convenient reuse.\n\n with_stmt ::= "with" expression ["as" target] ":" suite\n\nThe execution of the ``with`` statement proceeds as follows:\n\n1. The context expression is evaluated to obtain a context manager.\n\n2. The context manager\'s ``__enter__()`` method is invoked.\n\n3. If a target was included in the ``with`` statement, the return\n value from ``__enter__()`` is assigned to it.\n\n Note: The ``with`` statement guarantees that if the ``__enter__()``\n method returns without an error, then ``__exit__()`` will always\n be called. Thus, if an error occurs during the assignment to the\n target list, it will be treated the same as an error occurring\n within the suite would be. See step 5 below.\n\n4. The suite is executed.\n\n5. The context manager\'s ``__exit__()`` method is invoked. If an\n exception caused the suite to be exited, its type, value, and\n traceback are passed as arguments to ``__exit__()``. Otherwise,\n three ``None`` arguments are supplied.\n\n If the suite was exited due to an exception, and the return value\n from the ``__exit__()`` method was false, the exception is\n reraised. If the return value was true, the exception is\n suppressed, and execution continues with the statement following\n the ``with`` statement.\n\n If the suite was exited for any reason other than an exception, the\n return value from ``__exit__()`` is ignored, and execution proceeds\n at the normal location for the kind of exit that was taken.\n\nNote: In Python 2.5, the ``with`` statement is only allowed when the\n ``with_statement`` feature has been enabled. It is always enabled\n in Python 2.6.\n\nSee also:\n\n **PEP 0343** - The "with" statement\n The specification, background, and examples for the Python\n ``with`` statement.\n', + 'with': u'\nThe ``with`` statement\n**********************\n\nNew in version 2.5.\n\nThe ``with`` statement is used to wrap the execution of a block with\nmethods defined by a context manager (see section *With Statement\nContext Managers*). This allows common\n``try``...``except``...``finally`` usage patterns to be encapsulated\nfor convenient reuse.\n\n with_stmt ::= "with" expression ["as" target] ":" suite\n\nThe execution of the ``with`` statement proceeds as follows:\n\n1. The context expression is evaluated to obtain a context manager.\n\n2. The context manager\'s ``__enter__()`` method is invoked.\n\n3. If a target was included in the ``with`` statement, the return\n value from ``__enter__()`` is assigned to it.\n\n Note: The ``with`` statement guarantees that if the ``__enter__()``\n method returns without an error, then ``__exit__()`` will always\n be called. Thus, if an error occurs during the assignment to the\n target list, it will be treated the same as an error occurring\n within the suite would be. See step 5 below.\n\n4. The suite is executed.\n\n5. The context manager\'s ``__exit__()`` method is invoked. If an\n exception caused the suite to be exited, its type, value, and\n traceback are passed as arguments to ``__exit__()``. Otherwise,\n three ``None`` arguments are supplied.\n\n If the suite was exited due to an exception, and the return value\n from the ``__exit__()`` method was false, the exception is\n reraised. If the return value was true, the exception is\n suppressed, and execution continues with the statement following\n the ``with`` statement.\n\n If the suite was exited for any reason other than an exception, the\n return value from ``__exit__()`` is ignored, and execution proceeds\n at the normal location for the kind of exit that was taken.\n\nNote: In Python 2.5, the ``with`` statement is only allowed when the\n ``with_statement`` feature has been enabled. It is always enabled\n in Python 2.6.\n\nSee also:\n\n **PEP 0343** - The "with" statement\n The specification, background, and examples for the Python\n ``with`` statement.\n', 'yield': u'\nThe ``yield`` statement\n***********************\n\n yield_stmt ::= yield_expression\n\nThe ``yield`` statement is only used when defining a generator\nfunction, and is only used in the body of the generator function.\nUsing a ``yield`` statement in a function definition is sufficient to\ncause that definition to create a generator function instead of a\nnormal function.\n\nWhen a generator function is called, it returns an iterator known as a\ngenerator iterator, or more commonly, a generator. The body of the\ngenerator function is executed by calling the generator\'s ``next()``\nmethod repeatedly until it raises an exception.\n\nWhen a ``yield`` statement is executed, the state of the generator is\nfrozen and the value of **expression_list** is returned to\n``next()``\'s caller. By "frozen" we mean that all local state is\nretained, including the current bindings of local variables, the\ninstruction pointer, and the internal evaluation stack: enough\ninformation is saved so that the next time ``next()`` is invoked, the\nfunction can proceed exactly as if the ``yield`` statement were just\nanother external call.\n\nAs of Python version 2.5, the ``yield`` statement is now allowed in\nthe ``try`` clause of a ``try`` ... ``finally`` construct. If the\ngenerator is not resumed before it is finalized (by reaching a zero\nreference count or by being garbage collected), the generator-\niterator\'s ``close()`` method will be called, allowing any pending\n``finally`` clauses to execute.\n\nNote: In Python 2.2, the ``yield`` statement was only allowed when the\n ``generators`` feature has been enabled. This ``__future__`` import\n statement was used to enable the feature:\n\n from __future__ import generators\n\nSee also:\n\n **PEP 0255** - Simple Generators\n The proposal for adding generators and the ``yield`` statement\n to Python.\n\n **PEP 0342** - Coroutines via Enhanced Generators\n The proposal that, among other generator enhancements, proposed\n allowing ``yield`` to appear inside a ``try`` ... ``finally``\n block.\n'} Modified: python/branches/tlee-ast-optimize/Lib/test/test_array.py ============================================================================== --- python/branches/tlee-ast-optimize/Lib/test/test_array.py (original) +++ python/branches/tlee-ast-optimize/Lib/test/test_array.py Wed Oct 8 12:09:31 2008 @@ -1011,20 +1011,21 @@ minitemsize = 8 def test_alloc_overflow(self): + from sys import maxsize a = array.array('d', [-1]*65536) try: - a *= 65536 + a *= maxsize//65536 + 1 except MemoryError: pass else: - self.fail("a *= 2**16 didn't raise MemoryError") + self.fail("Array of size > maxsize created - MemoryError expected") b = array.array('d', [ 2.71828183, 3.14159265, -1]) try: - b * 1431655766 + b * (maxsize//3 + 1) except MemoryError: pass else: - self.fail("a * 1431655766 didn't raise MemoryError") + self.fail("Array of size > maxsize created - MemoryError expected") tests.append(DoubleTest) Modified: python/branches/tlee-ast-optimize/Lib/test/test_atexit.py ============================================================================== --- python/branches/tlee-ast-optimize/Lib/test/test_atexit.py (original) +++ python/branches/tlee-ast-optimize/Lib/test/test_atexit.py Wed Oct 8 12:09:31 2008 @@ -5,86 +5,54 @@ from test import test_support class TestCase(unittest.TestCase): - def test_args(self): - # be sure args are handled properly + def setUp(self): s = StringIO.StringIO() - sys.stdout = sys.stderr = s - save_handlers = atexit._exithandlers + self.save_stdout = sys.stdout + self.save_stderr = sys.stderr + sys.stdout = sys.stderr = self.subst_io = s + self.save_handlers = atexit._exithandlers atexit._exithandlers = [] - try: - atexit.register(self.h1) - atexit.register(self.h4) - atexit.register(self.h4, 4, kw="abc") - atexit._run_exitfuncs() - finally: - sys.stdout = sys.__stdout__ - sys.stderr = sys.__stderr__ - atexit._exithandlers = save_handlers - self.assertEqual(s.getvalue(), "h4 (4,) {'kw': 'abc'}\nh4 () {}\nh1\n") + + def tearDown(self): + sys.stdout = self.save_stdout + sys.stderr = self.save_stderr + atexit._exithandlers = self.save_handlers + + def test_args(self): + atexit.register(self.h1) + atexit.register(self.h4) + atexit.register(self.h4, 4, kw="abc") + atexit._run_exitfuncs() + self.assertEqual(self.subst_io.getvalue(), + "h4 (4,) {'kw': 'abc'}\nh4 () {}\nh1\n") def test_badargs(self): - s = StringIO.StringIO() - sys.stdout = sys.stderr = s - save_handlers = atexit._exithandlers - atexit._exithandlers = [] - try: - atexit.register(lambda: 1, 0, 0, (x for x in (1,2)), 0, 0) - self.assertRaises(TypeError, atexit._run_exitfuncs) - finally: - sys.stdout = sys.__stdout__ - sys.stderr = sys.__stderr__ - atexit._exithandlers = save_handlers + atexit.register(lambda: 1, 0, 0, (x for x in (1,2)), 0, 0) + self.assertRaises(TypeError, atexit._run_exitfuncs) def test_order(self): - # be sure handlers are executed in reverse order - s = StringIO.StringIO() - sys.stdout = sys.stderr = s - save_handlers = atexit._exithandlers - atexit._exithandlers = [] - try: - atexit.register(self.h1) - atexit.register(self.h2) - atexit.register(self.h3) - atexit._run_exitfuncs() - finally: - sys.stdout = sys.__stdout__ - sys.stderr = sys.__stderr__ - atexit._exithandlers = save_handlers - self.assertEqual(s.getvalue(), "h3\nh2\nh1\n") + atexit.register(self.h1) + atexit.register(self.h2) + atexit.register(self.h3) + atexit._run_exitfuncs() + self.assertEqual(self.subst_io.getvalue(), "h3\nh2\nh1\n") def test_sys_override(self): # be sure a preset sys.exitfunc is handled properly - save_handlers = atexit._exithandlers - atexit._exithandlers = [] exfunc = sys.exitfunc sys.exitfunc = self.h1 reload(atexit) - s = StringIO.StringIO() - sys.stdout = sys.stderr = s try: atexit.register(self.h2) atexit._run_exitfuncs() finally: - sys.stdout = sys.__stdout__ - sys.stderr = sys.__stderr__ - atexit._exithandlers = save_handlers sys.exitfunc = exfunc - self.assertEqual(s.getvalue(), "h2\nh1\n") + self.assertEqual(self.subst_io.getvalue(), "h2\nh1\n") def test_raise(self): - # be sure raises are handled properly - s = StringIO.StringIO() - sys.stdout = sys.stderr = s - save_handlers = atexit._exithandlers - atexit._exithandlers = [] - try: - atexit.register(self.raise1) - atexit.register(self.raise2) - self.assertRaises(TypeError, atexit._run_exitfuncs) - finally: - sys.stdout = sys.__stdout__ - sys.stderr = sys.__stderr__ - atexit._exithandlers = save_handlers + atexit.register(self.raise1) + atexit.register(self.raise2) + self.assertRaises(TypeError, atexit._run_exitfuncs) ### helpers def h1(self): Modified: python/branches/tlee-ast-optimize/Lib/test/test_datetime.py ============================================================================== --- python/branches/tlee-ast-optimize/Lib/test/test_datetime.py (original) +++ python/branches/tlee-ast-optimize/Lib/test/test_datetime.py Wed Oct 8 12:09:31 2008 @@ -253,7 +253,7 @@ self.assertRaises(TypeError, lambda: a // x) self.assertRaises(TypeError, lambda: x // a) - # Divison of int by timedelta doesn't make sense. + # Division of int by timedelta doesn't make sense. # Division by zero doesn't make sense. for zero in 0, 0L: self.assertRaises(TypeError, lambda: zero // a) Modified: python/branches/tlee-ast-optimize/Lib/test/test_dbm.py ============================================================================== --- python/branches/tlee-ast-optimize/Lib/test/test_dbm.py (original) +++ python/branches/tlee-ast-optimize/Lib/test/test_dbm.py Wed Oct 8 12:09:31 2008 @@ -1,9 +1,6 @@ from test import test_support import unittest -import os -import random import dbm -from dbm import error class DbmTestCase(unittest.TestCase): @@ -18,11 +15,16 @@ def test_keys(self): self.d = dbm.open(self.filename, 'c') - self.assert_(self.d.keys() == []) - self.d['a'] = 'b' - self.d['12345678910'] = '019237410982340912840198242' - self.d.keys() - self.assert_(self.d.has_key('a')) + self.assertEqual(self.d.keys(), []) + a = [('a', 'b'), ('12345678910', '019237410982340912840198242')] + for k, v in a: + self.d[k] = v + self.assertEqual(sorted(self.d.keys()), sorted(k for (k, v) in a)) + for k, v in a: + self.assert_(k in self.d) + self.assertEqual(self.d[k], v) + self.assert_('xxx' not in self.d) + self.assertRaises(KeyError, lambda: self.d['xxx']) self.d.close() def test_modes(self): Modified: python/branches/tlee-ast-optimize/Lib/test/test_docxmlrpc.py ============================================================================== --- python/branches/tlee-ast-optimize/Lib/test/test_docxmlrpc.py (original) +++ python/branches/tlee-ast-optimize/Lib/test/test_docxmlrpc.py Wed Oct 8 12:09:31 2008 @@ -9,9 +9,9 @@ PORT = None def server(evt, numrequests): - try: - serv = DocXMLRPCServer(("localhost", 0), logRequests=False) + serv = DocXMLRPCServer(("localhost", 0), logRequests=False) + try: global PORT PORT = serv.socket.getsockname()[1] Modified: python/branches/tlee-ast-optimize/Lib/test/test_platform.py ============================================================================== --- python/branches/tlee-ast-optimize/Lib/test/test_platform.py (original) +++ python/branches/tlee-ast-optimize/Lib/test/test_platform.py Wed Oct 8 12:09:31 2008 @@ -2,6 +2,7 @@ import os import unittest import platform +import subprocess from test import test_support @@ -9,6 +10,21 @@ def test_architecture(self): res = platform.architecture() + if hasattr(os, "symlink"): + def test_architecture_via_symlink(self): # issue3762 + def get(python): + cmd = [python, '-c', + 'import platform; print platform.architecture()'] + p = subprocess.Popen(cmd, stdout=subprocess.PIPE) + return p.communicate() + real = os.path.realpath(sys.executable) + link = os.path.abspath(test_support.TESTFN) + os.symlink(real, link) + try: + self.assertEqual(get(real), get(link)) + finally: + os.remove(link) + def test_machine(self): res = platform.machine() Modified: python/branches/tlee-ast-optimize/Lib/test/test_set.py ============================================================================== --- python/branches/tlee-ast-optimize/Lib/test/test_set.py (original) +++ python/branches/tlee-ast-optimize/Lib/test/test_set.py Wed Oct 8 12:09:31 2008 @@ -382,6 +382,17 @@ else: self.fail() + def test_remove_keyerror_set(self): + key = self.thetype([3, 4]) + try: + self.s.remove(key) + except KeyError as e: + self.assert_(e.args[0] is key, + "KeyError should be {0}, not {1}".format(key, + e.args[0])) + else: + self.fail() + def test_discard(self): self.s.discard('a') self.assert_('a' not in self.s) Modified: python/branches/tlee-ast-optimize/Lib/test/test_threading.py ============================================================================== --- python/branches/tlee-ast-optimize/Lib/test/test_threading.py (original) +++ python/branches/tlee-ast-optimize/Lib/test/test_threading.py Wed Oct 8 12:09:31 2008 @@ -380,6 +380,12 @@ import os if not hasattr(os, 'fork'): return + # Skip platforms with known problems forking from a worker thread. + # See http://bugs.python.org/issue3863. + if sys.platform in ('freebsd4', 'freebsd5', 'freebsd6', 'os2emx'): + print >>sys.stderr, ('Skipping test_3_join_in_forked_from_thread' + ' due to known OS bugs on'), sys.platform + return script = """if 1: main_thread = threading.current_thread() def worker(): Modified: python/branches/tlee-ast-optimize/Mac/BuildScript/build-installer.py ============================================================================== --- python/branches/tlee-ast-optimize/Mac/BuildScript/build-installer.py (original) +++ python/branches/tlee-ast-optimize/Mac/BuildScript/build-installer.py Wed Oct 8 12:09:31 2008 @@ -129,8 +129,8 @@ ), dict( - name="SQLite 3.3.5", - url="http://www.sqlite.org/sqlite-3.3.5.tar.gz", + name="SQLite 3.6.3", + url="http://www.sqlite.org/sqlite-3.6.3.tar.gz", checksum='93f742986e8bc2dfa34792e16df017a6feccf3a2', configure_pre=[ '--enable-threadsafe', @@ -170,8 +170,8 @@ ), ), dict( - name="Sleepycat DB 4.4", - url="http://downloads.sleepycat.com/db-4.4.20.tar.gz", + name="Sleepycat DB 4.7.25", + url="http://download.oracle.com/berkeley-db/db-4.7.25.tar.gz", #name="Sleepycat DB 4.3.29", #url="http://downloads.sleepycat.com/db-4.3.29.tar.gz", buildDir="build_unix", @@ -585,21 +585,23 @@ version = getVersion() docdir = os.path.join(rootDir, 'pydocs') + novername = 'python-docs-html.tar.bz2' name = 'html-%s.tar.bz2'%(getFullVersion(),) sourceArchive = os.path.join(DEPSRC, name) if os.path.exists(sourceArchive): print "Using local copy of %s"%(name,) else: - print "Downloading %s"%(name,) + print "Downloading %s"%(novername,) downloadURL('http://www.python.org/ftp/python/doc/%s/%s'%( - getFullVersion(), name), sourceArchive) + getFullVersion(), novername), sourceArchive) print "Archive for %s stored as %s"%(name, sourceArchive) extractArchive(os.path.dirname(docdir), sourceArchive) + os.rename( os.path.join( - os.path.dirname(docdir), 'Python-Docs-%s'%(getFullVersion(),)), + os.path.dirname(docdir), 'python-docs-html'), docdir) @@ -1028,11 +1030,11 @@ buildPython() buildPythonDocs() fn = os.path.join(WORKDIR, "_root", "Applications", - "MacPython %s"%(getVersion(),), "Update Shell Profile.command") + "Python %s"%(getVersion(),), "Update Shell Profile.command") patchFile("scripts/postflight.patch-profile", fn) os.chmod(fn, 0755) - folder = os.path.join(WORKDIR, "_root", "Applications", "MacPython %s"%( + folder = os.path.join(WORKDIR, "_root", "Applications", "Python %s"%( getVersion(),)) os.chmod(folder, 0755) setIcon(folder, "../Icons/Python Folder.icns") Modified: python/branches/tlee-ast-optimize/Mac/BuildScript/scripts/postflight.patch-profile ============================================================================== --- python/branches/tlee-ast-optimize/Mac/BuildScript/scripts/postflight.patch-profile (original) +++ python/branches/tlee-ast-optimize/Mac/BuildScript/scripts/postflight.patch-profile Wed Oct 8 12:09:31 2008 @@ -5,7 +5,7 @@ echo "These changes will be effective only in shell windows that you open" echo "after running this script." -PYVER=2.5 +PYVER=2.7 PYTHON_ROOT="/Library/Frameworks/Python.framework/Versions/Current" if [ `id -ur` = 0 ]; then Modified: python/branches/tlee-ast-optimize/Makefile.pre.in ============================================================================== --- python/branches/tlee-ast-optimize/Makefile.pre.in (original) +++ python/branches/tlee-ast-optimize/Makefile.pre.in Wed Oct 8 12:09:31 2008 @@ -1205,6 +1205,6 @@ .PHONY: frameworkinstall frameworkinstallframework frameworkinstallstructure .PHONY: frameworkinstallmaclib frameworkinstallapps frameworkinstallunixtools .PHONY: frameworkaltinstallunixtools recheck autoconf clean clobber distclean -.PHONY: smelly funny +.PHONY: smelly funny patchcheck # IF YOU PUT ANYTHING HERE IT WILL GO AWAY Modified: python/branches/tlee-ast-optimize/Misc/NEWS ============================================================================== --- python/branches/tlee-ast-optimize/Misc/NEWS (original) +++ python/branches/tlee-ast-optimize/Misc/NEWS Wed Oct 8 12:09:31 2008 @@ -4,10 +4,35 @@ (editors: check NEWS.help for information about editing NEWS using ReST.) +What's New in Python 2.7 alpha 1 +================================ + +*Release date: XX-XXX-20XX* + +Core and Builtins +----------------- + +- Issue #4069: When set.remove(element) is used with a set element, the element + is temporarily replaced with an equivalent frozenset. But the eventual + KeyError would always report the empty frozenset([]) as the missing key. Now + it correctly refers to the initial element. + +Library +------- + +- Issue #4014: Don't claim that Python has an Alpha release status, in addition + to claiming it is Mature. + +Build +----- + +- Issue #3758: Add ``patchcheck`` build target to .PHONY. + + What's New in Python 2.6 final ============================== -*Release date: XX-XXX-2008* +*Release date: 01-Oct-2008* Core and Builtins ----------------- @@ -37,9 +62,15 @@ - Issue #3879: A regression in urllib.getproxies_enviroment was fixed. +- Issue #3863: Disabled a unit test of fork being called from a thread + when running on platforms known to exhibit OS bugs when attempting that. + Build ----- +- Bug #3989: Package the 2to3 script (as 2to3.py) in the Windows + installer. + - Bug #3887: Package x64 version of CRT for AMD64 Windows binaries. Modified: python/branches/tlee-ast-optimize/Misc/RPM/python-2.6.spec ============================================================================== --- python/branches/tlee-ast-optimize/Misc/RPM/python-2.6.spec (original) +++ python/branches/tlee-ast-optimize/Misc/RPM/python-2.6.spec Wed Oct 8 12:09:31 2008 @@ -34,7 +34,7 @@ %define name python #--start constants-- -%define version 2.6rc2 +%define version 2.6 %define libver 2.6 #--end constants-- %define release 1pydotorg Modified: python/branches/tlee-ast-optimize/Misc/build.sh ============================================================================== --- python/branches/tlee-ast-optimize/Misc/build.sh (original) +++ python/branches/tlee-ast-optimize/Misc/build.sh Wed Oct 8 12:09:31 2008 @@ -59,7 +59,7 @@ PYTHON=$INSTALL_DIR/bin/python # Python options and regression test program that should always be run. -REGRTEST_ARGS="-E -tt $INSTALL_DIR/lib/python2.6/test/regrtest.py" +REGRTEST_ARGS="-E -tt $INSTALL_DIR/lib/python2.7/test/regrtest.py" REFLOG="build/reflog.txt.out" # These tests are not stable and falsely report leaks sometimes. Modified: python/branches/tlee-ast-optimize/Modules/_codecsmodule.c ============================================================================== --- python/branches/tlee-ast-optimize/Modules/_codecsmodule.c (original) +++ python/branches/tlee-ast-optimize/Modules/_codecsmodule.c Wed Oct 8 12:09:31 2008 @@ -115,7 +115,7 @@ to the default encoding. errors may be given to set a different error\n\ handling scheme. Default is 'strict' meaning that encoding errors raise\n\ a ValueError. Other possible values are 'ignore' and 'replace'\n\ -as well as any other name registerd with codecs.register_error that is\n\ +as well as any other name registered with codecs.register_error that is\n\ able to handle ValueErrors."); static PyObject * Modified: python/branches/tlee-ast-optimize/Modules/_ctypes/libffi/src/x86/ffi.c ============================================================================== --- python/branches/tlee-ast-optimize/Modules/_ctypes/libffi/src/x86/ffi.c (original) +++ python/branches/tlee-ast-optimize/Modules/_ctypes/libffi/src/x86/ffi.c Wed Oct 8 12:09:31 2008 @@ -388,10 +388,10 @@ return FFI_BAD_ABI; } - // we currently don't support certain kinds of arguments for raw + /* we currently don't support certain kinds of arguments for raw // closures. This should be implemented by a separate assembly language // routine, since it would require argument processing, something we - // don't do now for performance. + // don't do now for performance. */ for (i = cif->nargs-1; i >= 0; i--) { Modified: python/branches/tlee-ast-optimize/Modules/_lsprof.c ============================================================================== --- python/branches/tlee-ast-optimize/Modules/_lsprof.c (original) +++ python/branches/tlee-ast-optimize/Modules/_lsprof.c Wed Oct 8 12:09:31 2008 @@ -150,16 +150,7 @@ } Py_DECREF(o); if (PyErr_Occurred()) { - PyObject *context = (PyObject *)pObj; - /* May have been called by profiler_dealloc(). */ - if (Py_REFCNT(context) < 1) { - context = PyString_FromString("profiler calling an " - "external timer"); - if (context == NULL) { - return 0; - } - } - PyErr_WriteUnraisable(context); + PyErr_WriteUnraisable(pObj->externalTimer); return 0; } return result; Modified: python/branches/tlee-ast-optimize/Modules/cjkcodecs/multibytecodec.c ============================================================================== --- python/branches/tlee-ast-optimize/Modules/cjkcodecs/multibytecodec.c (original) +++ python/branches/tlee-ast-optimize/Modules/cjkcodecs/multibytecodec.c Wed Oct 8 12:09:31 2008 @@ -36,7 +36,7 @@ Decodes `string' using I, an MultibyteCodec instance. errors may be given\n\ to set a different error handling scheme. Default is 'strict' meaning\n\ that encoding errors raise a UnicodeDecodeError. Other possible values\n\ -are 'ignore' and 'replace' as well as any other name registerd with\n\ +are 'ignore' and 'replace' as well as any other name registered with\n\ codecs.register_error that is able to handle UnicodeDecodeErrors."); static char *codeckwarglist[] = {"input", "errors", NULL}; Modified: python/branches/tlee-ast-optimize/Modules/signalmodule.c ============================================================================== --- python/branches/tlee-ast-optimize/Modules/signalmodule.c (original) +++ python/branches/tlee-ast-optimize/Modules/signalmodule.c Wed Oct 8 12:09:31 2008 @@ -107,7 +107,7 @@ tv->tv_usec = fmod(d, 1.0) * 1000000.0; } -static inline double +Py_LOCAL_INLINE(double) double_from_timeval(struct timeval *tv) { return tv->tv_sec + (double)(tv->tv_usec / 1000000.0); Modified: python/branches/tlee-ast-optimize/Modules/tkappinit.c ============================================================================== --- python/branches/tlee-ast-optimize/Modules/tkappinit.c (original) +++ python/branches/tlee-ast-optimize/Modules/tkappinit.c Wed Oct 8 12:09:31 2008 @@ -71,7 +71,7 @@ #endif #ifdef WITH_XXX - // Initialize modules that don't require Tk + /* Initialize modules that don't require Tk */ #endif _tkinter_skip_tk_init = Tcl_GetVar(interp, "_tkinter_skip_tk_init", TCL_GLOBAL_ONLY); Modified: python/branches/tlee-ast-optimize/Objects/dictobject.c ============================================================================== --- python/branches/tlee-ast-optimize/Objects/dictobject.c (original) +++ python/branches/tlee-ast-optimize/Objects/dictobject.c Wed Oct 8 12:09:31 2008 @@ -2065,12 +2065,12 @@ "D.setdefault(k[,d]) -> D.get(k,d), also set D[k]=d if k not in D"); PyDoc_STRVAR(pop__doc__, -"D.pop(k[,d]) -> v, remove specified key and return the corresponding value\n\ +"D.pop(k[,d]) -> v, remove specified key and return the corresponding value.\n\ If key is not found, d is returned if given, otherwise KeyError is raised"); PyDoc_STRVAR(popitem__doc__, "D.popitem() -> (k, v), remove and return some (key, value) pair as a\n\ -2-tuple; but raise KeyError if D is empty"); +2-tuple; but raise KeyError if D is empty."); PyDoc_STRVAR(keys__doc__, "D.keys() -> list of D's keys"); @@ -2082,8 +2082,10 @@ "D.values() -> list of D's values"); PyDoc_STRVAR(update__doc__, -"D.update(E, **F) -> None. Update D from E and F: for k in E: D[k] = E[k]\n\ -(if E has keys else: for (k, v) in E: D[k] = v) then: for k in F: D[k] = F[k]"); +"D.update(E, **F) -> None. Update D from dict/iterable E and F.\n" +"If E has a .keys() method, does: for k in E: D[k] = E[k]\n\ +If E lacks .keys() method, does: for (k, v) in E: D[k] = v\n\ +In either case, this is followed by: for k in F: D[k] = F[k]"); PyDoc_STRVAR(fromkeys__doc__, "dict.fromkeys(S[,v]) -> New dict with keys from S and values equal to v.\n\ Modified: python/branches/tlee-ast-optimize/Objects/floatobject.c ============================================================================== --- python/branches/tlee-ast-optimize/Objects/floatobject.c (original) +++ python/branches/tlee-ast-optimize/Objects/floatobject.c Wed Oct 8 12:09:31 2008 @@ -1548,7 +1548,7 @@ #ifdef Py_NAN if (Py_IS_NAN(self)) { PyErr_SetString(PyExc_ValueError, - "Cannot pass nan to float.as_integer_ratio."); + "Cannot pass NaN to float.as_integer_ratio."); return NULL; } #endif @@ -1607,7 +1607,7 @@ "\n" "Returns a pair of integers, whose ratio is exactly equal to the original\n" "float and with a positive denominator.\n" -"Raises OverflowError on infinities and a ValueError on nans.\n" +"Raises OverflowError on infinities and a ValueError on NaNs.\n" "\n" ">>> (10.0).as_integer_ratio()\n" "(10, 1)\n" Modified: python/branches/tlee-ast-optimize/Objects/frameobject.c ============================================================================== --- python/branches/tlee-ast-optimize/Objects/frameobject.c (original) +++ python/branches/tlee-ast-optimize/Objects/frameobject.c Wed Oct 8 12:09:31 2008 @@ -518,7 +518,7 @@ nfrees = PyTuple_GET_SIZE(f->f_code->co_freevars); extras = f->f_code->co_stacksize + f->f_code->co_nlocals + ncells + nfrees; - // subtract one as it is already included in PyFrameObject + /* subtract one as it is already included in PyFrameObject */ res = sizeof(PyFrameObject) + (extras-1) * sizeof(PyObject *); return PyInt_FromSsize_t(res); Modified: python/branches/tlee-ast-optimize/Objects/listobject.c ============================================================================== --- python/branches/tlee-ast-optimize/Objects/listobject.c (original) +++ python/branches/tlee-ast-optimize/Objects/listobject.c Wed Oct 8 12:09:31 2008 @@ -2459,11 +2459,14 @@ PyDoc_STRVAR(insert_doc, "L.insert(index, object) -- insert object before index"); PyDoc_STRVAR(pop_doc, -"L.pop([index]) -> item -- remove and return item at index (default last)"); +"L.pop([index]) -> item -- remove and return item at index (default last).\n" +"Raises IndexError if list is empty or index is out of range."); PyDoc_STRVAR(remove_doc, -"L.remove(value) -- remove first occurrence of value"); +"L.remove(value) -- remove first occurrence of value.\n" +"Raises ValueError if the value is not present."); PyDoc_STRVAR(index_doc, -"L.index(value, [start, [stop]]) -> integer -- return first index of value"); +"L.index(value, [start, [stop]]) -> integer -- return first index of value.\n" +"Raises ValueError if the value is not present."); PyDoc_STRVAR(count_doc, "L.count(value) -> integer -- return number of occurrences of value"); PyDoc_STRVAR(reverse_doc, Modified: python/branches/tlee-ast-optimize/Objects/setobject.c ============================================================================== --- python/branches/tlee-ast-optimize/Objects/setobject.c (original) +++ python/branches/tlee-ast-optimize/Objects/setobject.c Wed Oct 8 12:09:31 2008 @@ -754,7 +754,8 @@ return key; } -PyDoc_STRVAR(pop_doc, "Remove and return an arbitrary set element."); +PyDoc_STRVAR(pop_doc, "Remove and return an arbitrary set element.\n\ +Raises KeyError if the set is empty."); static int set_traverse(PySetObject *so, visitproc visit, void *arg) @@ -1873,7 +1874,7 @@ static PyObject * set_remove(PySetObject *so, PyObject *key) { - PyObject *tmpkey, *result; + PyObject *tmpkey; int rv; rv = set_discard_key(so, key); @@ -1885,11 +1886,14 @@ if (tmpkey == NULL) return NULL; set_swap_bodies((PySetObject *)tmpkey, (PySetObject *)key); - result = set_remove(so, tmpkey); + rv = set_discard_key(so, tmpkey); set_swap_bodies((PySetObject *)tmpkey, (PySetObject *)key); Py_DECREF(tmpkey); - return result; - } else if (rv == DISCARD_NOTFOUND) { + if (rv == -1) + return NULL; + } + + if (rv == DISCARD_NOTFOUND) { set_key_error(key); return NULL; } Modified: python/branches/tlee-ast-optimize/Objects/stringobject.c ============================================================================== --- python/branches/tlee-ast-optimize/Objects/stringobject.c (original) +++ python/branches/tlee-ast-optimize/Objects/stringobject.c Wed Oct 8 12:09:31 2008 @@ -1591,9 +1591,9 @@ PyDoc_STRVAR(partition__doc__, "S.partition(sep) -> (head, sep, tail)\n\ \n\ -Searches for the separator sep in S, and returns the part before it,\n\ +Search for the separator sep in S, and return the part before it,\n\ the separator itself, and the part after it. If the separator is not\n\ -found, returns S and two empty strings."); +found, return S and two empty strings."); static PyObject * string_partition(PyStringObject *self, PyObject *sep_obj) @@ -1622,9 +1622,9 @@ PyDoc_STRVAR(rpartition__doc__, "S.rpartition(sep) -> (tail, sep, head)\n\ \n\ -Searches for the separator sep in S, starting at the end of S, and returns\n\ +Search for the separator sep in S, starting at the end of S, and return\n\ the part before it, the separator itself, and the part after it. If the\n\ -separator is not found, returns two empty strings and S."); +separator is not found, return two empty strings and S."); static PyObject * string_rpartition(PyStringObject *self, PyObject *sep_obj) @@ -3357,7 +3357,7 @@ to the default encoding. errors may be given to set a different error\n\ handling scheme. Default is 'strict' meaning that encoding errors raise\n\ a UnicodeDecodeError. Other possible values are 'ignore' and 'replace'\n\ -as well as any other name registerd with codecs.register_error that is\n\ +as well as any other name registered with codecs.register_error that is\n\ able to handle UnicodeDecodeErrors."); static PyObject * @@ -3506,7 +3506,7 @@ PyDoc_STRVAR(ljust__doc__, "S.ljust(width[, fillchar]) -> string\n" "\n" -"Return S left justified in a string of length width. Padding is\n" +"Return S left-justified in a string of length width. Padding is\n" "done using the specified fill character (default is a space)."); static PyObject * @@ -3530,7 +3530,7 @@ PyDoc_STRVAR(rjust__doc__, "S.rjust(width[, fillchar]) -> string\n" "\n" -"Return S right justified in a string of length width. Padding is\n" +"Return S right-justified in a string of length width. Padding is\n" "done using the specified fill character (default is a space)"); static PyObject * Modified: python/branches/tlee-ast-optimize/Objects/tupleobject.c ============================================================================== --- python/branches/tlee-ast-optimize/Objects/tupleobject.c (original) +++ python/branches/tlee-ast-optimize/Objects/tupleobject.c Wed Oct 8 12:09:31 2008 @@ -719,7 +719,9 @@ } PyDoc_STRVAR(index_doc, -"T.index(value, [start, [stop]]) -> integer -- return first index of value"); +"T.index(value, [start, [stop]]) -> integer -- return first index of value.\n" +"Raises ValueError if the value is not present." +); PyDoc_STRVAR(count_doc, "T.count(value) -> integer -- return number of occurrences of value"); PyDoc_STRVAR(sizeof_doc, Modified: python/branches/tlee-ast-optimize/Objects/unicodeobject.c ============================================================================== --- python/branches/tlee-ast-optimize/Objects/unicodeobject.c (original) +++ python/branches/tlee-ast-optimize/Objects/unicodeobject.c Wed Oct 8 12:09:31 2008 @@ -115,19 +115,19 @@ /* Fast detection of the most frequent whitespace characters */ const unsigned char _Py_ascii_whitespace[] = { 0, 0, 0, 0, 0, 0, 0, 0, -// case 0x0009: /* HORIZONTAL TABULATION */ -// case 0x000A: /* LINE FEED */ -// case 0x000B: /* VERTICAL TABULATION */ -// case 0x000C: /* FORM FEED */ -// case 0x000D: /* CARRIAGE RETURN */ +/* case 0x0009: * HORIZONTAL TABULATION */ +/* case 0x000A: * LINE FEED */ +/* case 0x000B: * VERTICAL TABULATION */ +/* case 0x000C: * FORM FEED */ +/* case 0x000D: * CARRIAGE RETURN */ 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -// case 0x001C: /* FILE SEPARATOR */ -// case 0x001D: /* GROUP SEPARATOR */ -// case 0x001E: /* RECORD SEPARATOR */ -// case 0x001F: /* UNIT SEPARATOR */ +/* case 0x001C: * FILE SEPARATOR */ +/* case 0x001D: * GROUP SEPARATOR */ +/* case 0x001E: * RECORD SEPARATOR */ +/* case 0x001F: * UNIT SEPARATOR */ 0, 0, 0, 0, 1, 1, 1, 1, -// case 0x0020: /* SPACE */ +/* case 0x0020: * SPACE */ 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, @@ -146,13 +146,13 @@ /* Same for linebreaks */ static unsigned char ascii_linebreak[] = { 0, 0, 0, 0, 0, 0, 0, 0, -// 0x000A, /* LINE FEED */ -// 0x000D, /* CARRIAGE RETURN */ +/* 0x000A, * LINE FEED */ +/* 0x000D, * CARRIAGE RETURN */ 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -// 0x001C, /* FILE SEPARATOR */ -// 0x001D, /* GROUP SEPARATOR */ -// 0x001E, /* RECORD SEPARATOR */ +/* 0x001C, * FILE SEPARATOR */ +/* 0x001D, * GROUP SEPARATOR */ +/* 0x001E, * RECORD SEPARATOR */ 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, @@ -7070,7 +7070,7 @@ PyDoc_STRVAR(ljust__doc__, "S.ljust(width[, fillchar]) -> int\n\ \n\ -Return S left justified in a Unicode string of length width. Padding is\n\ +Return S left-justified in a Unicode string of length width. Padding is\n\ done using the specified fill character (default is a space)."); static PyObject * @@ -7456,7 +7456,7 @@ PyDoc_STRVAR(rjust__doc__, "S.rjust(width[, fillchar]) -> unicode\n\ \n\ -Return S right justified in a Unicode string of length width. Padding is\n\ +Return S right-justified in a Unicode string of length width. Padding is\n\ done using the specified fill character (default is a space)."); static PyObject * @@ -7606,9 +7606,9 @@ PyDoc_STRVAR(partition__doc__, "S.partition(sep) -> (head, sep, tail)\n\ \n\ -Searches for the separator sep in S, and returns the part before it,\n\ +Search for the separator sep in S, and return the part before it,\n\ the separator itself, and the part after it. If the separator is not\n\ -found, returns S and two empty strings."); +found, return S and two empty strings."); static PyObject* unicode_partition(PyUnicodeObject *self, PyObject *separator) @@ -7619,9 +7619,9 @@ PyDoc_STRVAR(rpartition__doc__, "S.rpartition(sep) -> (tail, sep, head)\n\ \n\ -Searches for the separator sep in S, starting at the end of S, and returns\n\ +Search for the separator sep in S, starting at the end of S, and return\n\ the part before it, the separator itself, and the part after it. If the\n\ -separator is not found, returns two empty strings and S."); +separator is not found, return two empty strings and S."); static PyObject* unicode_rpartition(PyUnicodeObject *self, PyObject *separator) Modified: python/branches/tlee-ast-optimize/PC/VC6/pythoncore.dsp ============================================================================== --- python/branches/tlee-ast-optimize/PC/VC6/pythoncore.dsp (original) +++ python/branches/tlee-ast-optimize/PC/VC6/pythoncore.dsp Wed Oct 8 12:09:31 2008 @@ -54,7 +54,7 @@ # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /machine:I386 -# ADD LINK32 largeint.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /base:"0x1e000000" /subsystem:windows /dll /debug /machine:I386 /nodefaultlib:"libc" /out:"./python26.dll" +# ADD LINK32 largeint.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /base:"0x1e000000" /subsystem:windows /dll /debug /machine:I386 /nodefaultlib:"libc" /out:"./python27.dll" # SUBTRACT LINK32 /pdb:none !ELSEIF "$(CFG)" == "pythoncore - Win32 Debug" @@ -82,7 +82,7 @@ # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /debug /machine:I386 /pdbtype:sept -# ADD LINK32 largeint.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /base:"0x1e000000" /subsystem:windows /dll /debug /machine:I386 /nodefaultlib:"libc" /out:"./python26_d.dll" /pdbtype:sept +# ADD LINK32 largeint.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /base:"0x1e000000" /subsystem:windows /dll /debug /machine:I386 /nodefaultlib:"libc" /out:"./python27_d.dll" /pdbtype:sept # SUBTRACT LINK32 /pdb:none !ENDIF Modified: python/branches/tlee-ast-optimize/PC/VC6/readme.txt ============================================================================== --- python/branches/tlee-ast-optimize/PC/VC6/readme.txt (original) +++ python/branches/tlee-ast-optimize/PC/VC6/readme.txt Wed Oct 8 12:09:31 2008 @@ -11,7 +11,7 @@ The proper order to build subprojects: 1) pythoncore (this builds the main Python DLL and library files, - python26.{dll, lib} in Release mode) + python27.{dll, lib} in Release mode) 2) python (this builds the main Python executable, python.exe in Release mode) @@ -22,7 +22,7 @@ to the subsystems they implement; see SUBPROJECTS below) When using the Debug setting, the output files have a _d added to -their name: python26_d.dll, python_d.exe, pyexpat_d.pyd, and so on. +their name: python27_d.dll, python_d.exe, pyexpat_d.pyd, and so on. SUBPROJECTS ----------- Modified: python/branches/tlee-ast-optimize/PC/pyconfig.h ============================================================================== --- python/branches/tlee-ast-optimize/PC/pyconfig.h (original) +++ python/branches/tlee-ast-optimize/PC/pyconfig.h Wed Oct 8 12:09:31 2008 @@ -323,9 +323,9 @@ their Makefile (other compilers are generally taken care of by distutils.) */ # ifdef _DEBUG -# pragma comment(lib,"python26_d.lib") +# pragma comment(lib,"python27_d.lib") # else -# pragma comment(lib,"python26.lib") +# pragma comment(lib,"python27.lib") # endif /* _DEBUG */ # endif /* _MSC_VER */ # endif /* Py_BUILD_CORE */ Modified: python/branches/tlee-ast-optimize/PCbuild/pyproject.vsprops ============================================================================== --- python/branches/tlee-ast-optimize/PCbuild/pyproject.vsprops (original) +++ python/branches/tlee-ast-optimize/PCbuild/pyproject.vsprops Wed Oct 8 12:09:31 2008 @@ -38,7 +38,7 @@ /> . # @@ -575,8 +575,8 @@ # Identity of this package. PACKAGE_NAME='python' PACKAGE_TARNAME='python' -PACKAGE_VERSION='2.6' -PACKAGE_STRING='python 2.6' +PACKAGE_VERSION='2.7' +PACKAGE_STRING='python 2.7' PACKAGE_BUGREPORT='http://www.python.org/python-bugs' ac_unique_file="Include/object.h" @@ -1247,7 +1247,7 @@ # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures python 2.6 to adapt to many kinds of systems. +\`configure' configures python 2.7 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1308,7 +1308,7 @@ if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of python 2.6:";; + short | recursive ) echo "Configuration of python 2.7:";; esac cat <<\_ACEOF @@ -1433,7 +1433,7 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -python configure 2.6 +python configure 2.7 generated by GNU Autoconf 2.61 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, @@ -1447,7 +1447,7 @@ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by python $as_me 2.6, which was +It was created by python $as_me 2.7, which was generated by GNU Autoconf 2.61. Invocation command line was $ $0 $@ @@ -1816,7 +1816,7 @@ mv confdefs.h.new confdefs.h -VERSION=2.6 +VERSION=2.7 SOVERSION=1.0 @@ -24998,7 +24998,7 @@ # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by python $as_me 2.6, which was +This file was extended by python $as_me 2.7, which was generated by GNU Autoconf 2.61. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -25047,7 +25047,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ -python config.status 2.6 +python config.status 2.7 configured by $0, generated by GNU Autoconf 2.61, with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" Modified: python/branches/tlee-ast-optimize/configure.in ============================================================================== --- python/branches/tlee-ast-optimize/configure.in (original) +++ python/branches/tlee-ast-optimize/configure.in Wed Oct 8 12:09:31 2008 @@ -4,7 +4,7 @@ dnl NOTE: autoconf 2.64 doesn't seem to work (use 2.63). # Set VERSION so we only need to edit in one place (i.e., here) -m4_define(PYTHON_VERSION, 2.6) +m4_define(PYTHON_VERSION, 2.7) AC_REVISION($Revision$) AC_PREREQ(2.61) Modified: python/branches/tlee-ast-optimize/pyconfig.h.in ============================================================================== --- python/branches/tlee-ast-optimize/pyconfig.h.in (original) +++ python/branches/tlee-ast-optimize/pyconfig.h.in Wed Oct 8 12:09:31 2008 @@ -360,7 +360,7 @@ /* Define to 1 if you have the header file. */ #undef HAVE_LIBINTL_H -/* Define to 1 if you have the `readline' library (-lreadline). */ +/* Define if you have the readline library (-lreadline). */ #undef HAVE_LIBREADLINE /* Define to 1 if you have the `resolv' library (-lresolv). */ Modified: python/branches/tlee-ast-optimize/setup.py ============================================================================== --- python/branches/tlee-ast-optimize/setup.py (original) +++ python/branches/tlee-ast-optimize/setup.py Wed Oct 8 12:09:31 2008 @@ -320,12 +320,13 @@ # the environment variable is not set even though the value were passed # into configure and stored in the Makefile (issue found on OS X 10.3). for env_var, arg_name, dir_list in ( + ('LDFLAGS', '-R', self.compiler.runtime_library_dirs), ('LDFLAGS', '-L', self.compiler.library_dirs), ('CPPFLAGS', '-I', self.compiler.include_dirs)): env_val = sysconfig.get_config_var(env_var) if env_val: # To prevent optparse from raising an exception about any - # options in env_val that is doesn't know about we strip out + # options in env_val that it doesn't know about we strip out # all double dashes and any dashes followed by a character # that is not for the option we are dealing with. # @@ -934,7 +935,8 @@ ] sqlite_libfile = self.compiler.find_library_file( sqlite_dirs_to_check + lib_dirs, 'sqlite3') - sqlite_libdir = [os.path.abspath(os.path.dirname(sqlite_libfile))] + if sqlite_libfile: + sqlite_libdir = [os.path.abspath(os.path.dirname(sqlite_libfile))] if sqlite_incdir and sqlite_libdir: sqlite_srcs = ['_sqlite/cache.c', @@ -1836,7 +1838,6 @@ """ CLASSIFIERS = """ -Development Status :: 3 - Alpha Development Status :: 6 - Mature License :: OSI Approved :: Python Software Foundation License Natural Language :: English From python-checkins at python.org Wed Oct 8 13:24:37 2008 From: python-checkins at python.org (georg.brandl) Date: Wed, 8 Oct 2008 13:24:37 +0200 (CEST) Subject: [Python-checkins] r66845 - doctools/trunk/EXAMPLES Message-ID: <20081008112437.97DA41E4002@bag.python.org> Author: georg.brandl Date: Wed Oct 8 13:24:37 2008 New Revision: 66845 Log: Add new projects/URLs. Modified: doctools/trunk/EXAMPLES Modified: doctools/trunk/EXAMPLES ============================================================================== --- doctools/trunk/EXAMPLES (original) +++ doctools/trunk/EXAMPLES Wed Oct 8 13:24:37 2008 @@ -11,7 +11,10 @@ * NumPy: http://mentat.za.net/numpy/refguide/ * Pylons: http://bel-epa.com/pylonsdocs/ * Django: http://docs.djangoproject.com/ +* Grok: http://grok.zope.org/doc/current/ +* TurboGears: http://turbogears.org/2.0/docs/ * Jinja: http://jinja.pocoo.org/2/documentation/ +* Cython: http://docs.cython.org/ * F2py: http://www.f2py.org/html/ * zc.async: http://packages.python.org/zc.async/1.5.0/ * Paver: http://www.blueskyonmars.com/projects/paver/ @@ -27,6 +30,4 @@ * SymPy: http://docs.sympy.org/ * GeoDjango: http://geodjango.org/docs/ * Mixin.com: http://dev.mixin.com/ -* Grok (upcoming) * Matplotlib (upcoming) -* TurboGears (upcoming) From python-checkins at python.org Wed Oct 8 13:26:49 2008 From: python-checkins at python.org (georg.brandl) Date: Wed, 8 Oct 2008 13:26:49 +0200 (CEST) Subject: [Python-checkins] r66846 - in doctools/branches/0.4.x: CHANGES EXAMPLES sphinx/ext/autodoc.py Message-ID: <20081008112649.02B821E4002@bag.python.org> Author: georg.brandl Date: Wed Oct 8 13:26:48 2008 New Revision: 66846 Log: Fix an autodoc UnboundLocalError. Modified: doctools/branches/0.4.x/CHANGES doctools/branches/0.4.x/EXAMPLES doctools/branches/0.4.x/sphinx/ext/autodoc.py Modified: doctools/branches/0.4.x/CHANGES ============================================================================== --- doctools/branches/0.4.x/CHANGES (original) +++ doctools/branches/0.4.x/CHANGES Wed Oct 8 13:26:48 2008 @@ -1,6 +1,8 @@ Release 0.4.3 (in development) ============================== +* Fix a bug in autodoc with directly given autodoc members. + * Fix a bug in autodoc that would import a module twice, once as "module", once as "module.". Modified: doctools/branches/0.4.x/EXAMPLES ============================================================================== --- doctools/branches/0.4.x/EXAMPLES (original) +++ doctools/branches/0.4.x/EXAMPLES Wed Oct 8 13:26:48 2008 @@ -3,14 +3,20 @@ This is an (incomplete) list of projects that use Sphinx or are experimenting with using it for their documentation. If you like -to be included, please mail to sphinx-dev at googlegroups.com. +to be included, please mail to `the Google group +`_. * Sphinx: http://sphinx.pocoo.org/ * Python: http://docs.python.org/dev/ * NumPy: http://mentat.za.net/numpy/refguide/ * Pylons: http://bel-epa.com/pylonsdocs/ +* Django: http://docs.djangoproject.com/ +* Grok: http://grok.zope.org/doc/current/ +* TurboGears: http://turbogears.org/2.0/docs/ * Jinja: http://jinja.pocoo.org/2/documentation/ +* Cython: http://docs.cython.org/ * F2py: http://www.f2py.org/html/ +* zc.async: http://packages.python.org/zc.async/1.5.0/ * Paver: http://www.blueskyonmars.com/projects/paver/ * Satchmo: http://www.satchmoproject.com/docs/svn/ * PyEphem: http://rhodesmill.org/pyephem/ @@ -18,10 +24,10 @@ * Calibre: http://calibre.kovidgoyal.net/user_manual/ * PyUblas: http://tiker.net/doc/pyublas/ * Py on Windows: http://timgolden.me.uk/python-on-windows/ +* mpmath: http://mpmath.googlecode.com/svn/trunk/doc/build/index.html * Zope 3: e.g. http://docs.carduner.net/z3c-tutorial/ * Glashammer: http://glashammer.welterde.de/ * SymPy: http://docs.sympy.org/ -* Grok (upcoming) -* Django (upcoming) +* GeoDjango: http://geodjango.org/docs/ +* Mixin.com: http://dev.mixin.com/ * Matplotlib (upcoming) -* TurboGears (upcoming) Modified: doctools/branches/0.4.x/sphinx/ext/autodoc.py ============================================================================== --- doctools/branches/0.4.x/sphinx/ext/autodoc.py (original) +++ doctools/branches/0.4.x/sphinx/ext/autodoc.py Wed Oct 8 13:26:48 2008 @@ -307,6 +307,7 @@ if path: mod_cls = path else: + mod_cls = None # if documenting a class-level object without path, there must be a # current class, either from a parent auto directive ... if hasattr(env, 'autodoc_current_class'): From python-checkins at python.org Wed Oct 8 13:28:03 2008 From: python-checkins at python.org (georg.brandl) Date: Wed, 8 Oct 2008 13:28:03 +0200 (CEST) Subject: [Python-checkins] r66847 - in doctools/branches/0.4.x: CHANGES sphinx/__init__.py Message-ID: <20081008112803.E09E71E4002@bag.python.org> Author: georg.brandl Date: Wed Oct 8 13:28:03 2008 New Revision: 66847 Log: Release 0.4.3. Modified: doctools/branches/0.4.x/CHANGES doctools/branches/0.4.x/sphinx/__init__.py Modified: doctools/branches/0.4.x/CHANGES ============================================================================== --- doctools/branches/0.4.x/CHANGES (original) +++ doctools/branches/0.4.x/CHANGES Wed Oct 8 13:28:03 2008 @@ -1,5 +1,5 @@ -Release 0.4.3 (in development) -============================== +Release 0.4.3 (Oct 8, 2008) +=========================== * Fix a bug in autodoc with directly given autodoc members. Modified: doctools/branches/0.4.x/sphinx/__init__.py ============================================================================== --- doctools/branches/0.4.x/sphinx/__init__.py (original) +++ doctools/branches/0.4.x/sphinx/__init__.py Wed Oct 8 13:28:03 2008 @@ -21,7 +21,7 @@ __revision__ = '$Revision$' __version__ = '0.4.3' -__released__ = '0.4.2' +__released__ = '0.4.3' def usage(argv, msg=None): From python-checkins at python.org Wed Oct 8 13:31:13 2008 From: python-checkins at python.org (georg.brandl) Date: Wed, 8 Oct 2008 13:31:13 +0200 (CEST) Subject: [Python-checkins] r66848 - doctools/tags/0.4.3 Message-ID: <20081008113113.D35C21E4002@bag.python.org> Author: georg.brandl Date: Wed Oct 8 13:31:13 2008 New Revision: 66848 Log: Tag 0.4.3. Added: doctools/tags/0.4.3/ - copied from r66847, /doctools/branches/0.4.x/ From python-checkins at python.org Wed Oct 8 14:16:12 2008 From: python-checkins at python.org (andrew.kuchling) Date: Wed, 8 Oct 2008 14:16:12 +0200 (CEST) Subject: [Python-checkins] r66849 - in sandbox/trunk/py2.5.3: 1 2 3 4 5 6 7 Message-ID: <20081008121612.2BE401E4002@bag.python.org> Author: andrew.kuchling Date: Wed Oct 8 14:16:10 2008 New Revision: 66849 Log: Create directory for examination of Python 2.5.3 commit plans Added: sandbox/trunk/py2.5.3/ sandbox/trunk/py2.5.3/1 sandbox/trunk/py2.5.3/2 sandbox/trunk/py2.5.3/3 sandbox/trunk/py2.5.3/4 sandbox/trunk/py2.5.3/5 sandbox/trunk/py2.5.3/6 sandbox/trunk/py2.5.3/7 Added: sandbox/trunk/py2.5.3/1 ============================================================================== --- (empty file) +++ sandbox/trunk/py2.5.3/1 Wed Oct 8 14:16:10 2008 @@ -0,0 +1,1008 @@ +----------------------------------- +[http://svn.python.org/view?rev=61001&view=rev r61001] | christian.heimes | 2008-02-23 12:42:31 -0500 (Sat, 23 Feb 2008) | 1 line +Changed paths: + M /python/trunk/Misc/NEWS + M /python/trunk/Modules/syslogmodule.c + +Patch #1957: syslogmodule: Release GIL when calling syslog(3) +----------------------------------- +[http://svn.python.org/view?rev=61002&view=rev r61002] | christian.heimes | 2008-02-23 12:52:07 -0500 (Sat, 23 Feb 2008) | 2 lines +Changed paths: + M /python/trunk/Misc/NEWS + M /python/trunk/Python/Python-ast.c + M /python/trunk/Python/import.c + +Issue #2051 and patch from Alexander Belopolsky: +Permission for pyc and pyo files are inherited from the py file. +----------------------------------- +[http://svn.python.org/view?rev=61006&view=rev r61006] | andrew.kuchling | 2008-02-23 14:02:33 -0500 (Sat, 23 Feb 2008) | 1 line +Changed paths: + M /python/trunk/Lib/imaplib.py + +#1389051: IMAP module tries to read entire message in one chunk. Patch by Fredrik Lundh. +----------------------------------- +[http://svn.python.org/view?rev=61008&view=rev r61008] | andrew.kuchling | 2008-02-23 14:28:58 -0500 (Sat, 23 Feb 2008) | 1 line +Changed paths: + M /python/trunk/Lib/socket.py + +#1389051, #1092502: fix excessively large allocations when using read() on a socket +----------------------------------- +[http://svn.python.org/view?rev=61011&view=rev r61011] | jeffrey.yasskin | 2008-02-23 14:40:54 -0500 (Sat, 23 Feb 2008) | 13 lines +Changed paths: + M /python/trunk/Lib/test/test_threading.py + M /python/trunk/Lib/threading.py + +Prevent classes like: + class RunSelfFunction(object): + def __init__(self): + self.thread = threading.Thread(target=self._run) + self.thread.start() + def _run(self): + pass +from creating a permanent cycle between the object and the thread by having the +Thread delete its references to the object when it completes. + +As an example of the effect of this bug, paramiko.Transport inherits from +Thread to avoid it. + +----------------------------------- +[http://svn.python.org/view?rev=61013&view=rev r61013] | jeffrey.yasskin | 2008-02-23 15:40:35 -0500 (Sat, 23 Feb 2008) | 3 lines +Changed paths: + M /python/trunk/Lib/test/test_threading.py + M /python/trunk/Lib/threading.py + +Followup to [http://svn.python.org/view?rev=61011&view=rev r61011]: Also avoid the reference cycle when the Thread's target +raises an exception. + +----------------------------------- +[http://svn.python.org/view?rev=61019&view=rev r61019] | georg.brandl | 2008-02-23 17:09:24 -0500 (Sat, 23 Feb 2008) | 2 lines +Changed paths: + M /python/trunk/Lib/popen2.py + +Use os.closerange() in popen2. + +----------------------------------- +[http://svn.python.org/view?rev=61033&view=rev r61033] | christian.heimes | 2008-02-23 18:59:45 -0500 (Sat, 23 Feb 2008) | 1 line +Changed paths: + M /python/trunk/Python/import.c + +MS Windows doesn't have mode_t but stat.st_mode is defined as unsigned short. +----------------------------------- +[http://svn.python.org/view?rev=61034&view=rev r61034] | georg.brandl | 2008-02-23 19:03:22 -0500 (Sat, 23 Feb 2008) | 4 lines +Changed paths: + M /python/trunk/Lib/httplib.py + M /python/trunk/Lib/test/test_httplib.py + M /python/trunk/Misc/NEWS + +#900744: If an invalid chunked-encoding header is sent by a server, +httplib will now raise IncompleteRead and close the connection instead +of raising ValueError. + +----------------------------------- +[http://svn.python.org/view?rev=61035&view=rev r61035] | georg.brandl | 2008-02-23 19:14:24 -0500 (Sat, 23 Feb 2008) | 2 lines +Changed paths: + M /python/trunk/Lib/httplib.py + M /python/trunk/Lib/test/test_httplib.py + M /python/trunk/Misc/NEWS + +#1627: httplib now ignores negative Content-Length headers. + +----------------------------------- +[http://svn.python.org/view?rev=61041&view=rev r61041] | facundo.batista | 2008-02-23 22:17:21 -0500 (Sat, 23 Feb 2008) | 4 lines +Changed paths: + M /python/trunk/Lib/test/string_tests.py + M /python/trunk/Lib/test/test_format.py + M /python/trunk/Objects/stringobject.c + M /python/trunk/Objects/unicodeobject.c + + +Issue 1742669. Now %d accepts very big float numbers. +Thanks Gabriel Genellina. + +----------------------------------- +[http://svn.python.org/view?rev=61046&view=rev r61046] | neal.norwitz | 2008-02-24 02:21:56 -0500 (Sun, 24 Feb 2008) | 5 lines +Changed paths: + M /python/trunk/Modules/_ctypes/_ctypes_test.c + +Get ctypes working on the Alpha (Tru64). The problem was that there +were two module_methods and the one used depended on the order the +modules were loaded. By making the test module_methods static, +it is not exported and the correct version is picked up. + +----------------------------------- +[http://svn.python.org/view?rev=61049&view=rev r61049] | christian.heimes | 2008-02-24 07:26:16 -0500 (Sun, 24 Feb 2008) | 1 line +Changed paths: + M /python/trunk/Objects/dictobject.c + M /python/trunk/Objects/listobject.c + +Use PY_FORMAT_SIZE_T instead of z for string formatting. Thanks Neal. +----------------------------------- +[http://svn.python.org/view?rev=61051&view=rev r61051] | mark.dickinson | 2008-02-24 13:12:36 -0500 (Sun, 24 Feb 2008) | 2 lines +Changed paths: + M /python/trunk/Lib/decimal.py + +Remove duplicate 'import re' in decimal.py + +----------------------------------- +[http://svn.python.org/view?rev=61052&view=rev r61052] | neal.norwitz | 2008-02-24 13:47:03 -0500 (Sun, 24 Feb 2008) | 11 lines +Changed paths: + M /python/trunk/Lib/bsddb/test/test_associate.py + M /python/trunk/Lib/bsddb/test/test_basics.py + M /python/trunk/Lib/bsddb/test/test_compare.py + M /python/trunk/Lib/bsddb/test/test_cursor_pget_bug.py + M /python/trunk/Lib/bsddb/test/test_dbobj.py + M /python/trunk/Lib/bsddb/test/test_dbshelve.py + M /python/trunk/Lib/bsddb/test/test_dbtables.py + M /python/trunk/Lib/bsddb/test/test_env_close.py + M /python/trunk/Lib/bsddb/test/test_join.py + M /python/trunk/Lib/bsddb/test/test_lock.py + M /python/trunk/Lib/bsddb/test/test_misc.py + M /python/trunk/Lib/bsddb/test/test_pickle.py + M /python/trunk/Lib/bsddb/test/test_recno.py + M /python/trunk/Lib/bsddb/test/test_sequence.py + M /python/trunk/Lib/bsddb/test/test_thread.py + M /python/trunk/Lib/test/test_bsddb3.py + M /python/trunk/Lib/test/test_support.py + +Create a db_home directory with a unique name so multiple users can +run the test simultaneously. The simplest thing I found that worked +on both Windows and Unix was to use the PID. It's unique so should be +sufficient. This should prevent many of the spurious failures of +the automated tests since they run as different users. + +Also cleanup the directory consistenly in the tearDown methods. + +It would be nice if someone ensured that the directories are always +created with a consistent name. + +----------------------------------- +[http://svn.python.org/view?rev=61058&view=rev r61058] | neal.norwitz | 2008-02-24 20:45:37 -0500 (Sun, 24 Feb 2008) | 1 line +Changed paths: + M /python/trunk/Python/compile.c + M /python/trunk/Python/peephole.c + +Fix indentation +----------------------------------- +[http://svn.python.org/view?rev=61064&view=rev r61064] | andrew.kuchling | 2008-02-25 11:29:58 -0500 (Mon, 25 Feb 2008) | 1 line +Changed paths: + M /python/trunk/Lib/curses/__init__.py + +Use file descriptor for real stdout +----------------------------------- +[http://svn.python.org/view?rev=61065&view=rev r61065] | christian.heimes | 2008-02-25 12:32:07 -0500 (Mon, 25 Feb 2008) | 1 line +Changed paths: + M /python/trunk/Include/longintrepr.h + +Thomas Herve explained to me that PyCrypto depends on the constants. I'm adding the aliases because C code for Python 2.x should compile under 2.6 as well. The aliases aren't available in Python 3.x though. +----------------------------------- +[http://svn.python.org/view?rev=61072&view=rev r61072] | facundo.batista | 2008-02-25 17:33:55 -0500 (Mon, 25 Feb 2008) | 4 lines +Changed paths: + M /python/trunk/Modules/dbmmodule.c + M /python/trunk/Modules/gdbmmodule.c + + +Issue 2168. gdbm and dbm needs to be iterable; this fixes a +failure in the shelve module. Thanks Thomas Herve. + +----------------------------------- +[http://svn.python.org/view?rev=61073&view=rev r61073] | raymond.hettinger | 2008-02-25 17:42:32 -0500 (Mon, 25 Feb 2008) | 1 line +Changed paths: + M /python/trunk/Lib/test/test_itertools.py + M /python/trunk/Modules/itertoolsmodule.c + +Make sure the itertools filter functions give the same performance for func=bool as func=None. +----------------------------------- +[http://svn.python.org/view?rev=61074&view=rev r61074] | raymond.hettinger | 2008-02-25 18:17:41 -0500 (Mon, 25 Feb 2008) | 1 line +Changed paths: + M /python/trunk/Lib/shelve.py + +Revert part of [http://svn.python.org/view?rev=60927&view=rev r60927] which made invalid assumptions about the API offered by db modules. +----------------------------------- +[http://svn.python.org/view?rev=61075&view=rev r61075] | facundo.batista | 2008-02-25 18:46:02 -0500 (Mon, 25 Feb 2008) | 3 lines +Changed paths: + M /python/trunk/Modules/itertoolsmodule.c + + +Coerced PyBool_Type to be able to compare it. + +----------------------------------- +[http://svn.python.org/view?rev=61078&view=rev r61078] | neal.norwitz | 2008-02-26 00:12:50 -0500 (Tue, 26 Feb 2008) | 1 line +Changed paths: + M /python/trunk/Modules/dbmmodule.c + +Whitespace normalization +----------------------------------- +[http://svn.python.org/view?rev=61079&view=rev r61079] | neal.norwitz | 2008-02-26 00:23:51 -0500 (Tue, 26 Feb 2008) | 1 line +Changed paths: + M /python/trunk/Python/getargs.c + +Whitespace normalization +----------------------------------- +[http://svn.python.org/view?rev=61086&view=rev r61086] | christian.heimes | 2008-02-26 12:23:51 -0500 (Tue, 26 Feb 2008) | 3 lines +Changed paths: + M /python/trunk/Lib/test/test_getargs2.py + M /python/trunk/Modules/_testcapimodule.c + M /python/trunk/Python/getargs.c + +Patch #1691070 from Roger Upole: Speed up PyArg_ParseTupleAndKeywords() and improve error msg +My tests don't show the promised speed up of 10%. The code is as fast as the old code for simple cases and slightly faster for complex cases with several of args and kwargs. But the patch simplifies the code, too. + +----------------------------------- +[http://svn.python.org/view?rev=61089&view=rev r61089] | raymond.hettinger | 2008-02-26 20:08:04 -0500 (Tue, 26 Feb 2008) | 1 line +Changed paths: + M /python/trunk/Modules/itertoolsmodule.c + +One too many decrefs. +----------------------------------- +[http://svn.python.org/view?rev=61100&view=rev r61100] | jeffrey.yasskin | 2008-02-28 01:09:19 -0500 (Thu, 28 Feb 2008) | 21 lines +Changed paths: + M /python/trunk/Lib/threading.py + +Thread.start() used sleep(0.000001) to make sure it didn't return before the +new thread had started. At least on my MacBook Pro, that wound up sleeping for +a full 10ms (probably 1 jiffy). By using an Event instead, we can be absolutely +certain that the thread has started, and return more quickly (217us). + +Before: +$ ./python.exe -m timeit -s 'from threading import Thread' 't = Thread(); t.start(); t.join()' +100 loops, best of 3: 10.3 msec per loop +$ ./python.exe -m timeit -s 'from threading import Thread; t = Thread()' 't.isAlive()' +1000000 loops, best of 3: 0.47 usec per loop + +After: +$ ./python.exe -m timeit -s 'from threading import Thread' 't = Thread(); t.start(); t.join()' +1000 loops, best of 3: 217 usec per loop +$ ./python.exe -m timeit -s 'from threading import Thread; t = Thread()' 't.isAlive()' +1000000 loops, best of 3: 0.86 usec per loop + +To be fair, the 10ms isn't CPU time, and other threads including the spawned +one get to run during it. There are also some slightly more complicated ways to +get back the .4us in isAlive() if we want. + +----------------------------------- +[http://svn.python.org/view?rev=61102&view=rev r61102] | christian.heimes | 2008-02-28 06:18:49 -0500 (Thu, 28 Feb 2008) | 1 line +Changed paths: + M /python/trunk/Modules/itertoolsmodule.c + +The empty tuple is usually a singleton with a much higher refcnt than 1 +----------------------------------- +[http://svn.python.org/view?rev=61105&view=rev r61105] | andrew.kuchling | 2008-02-28 09:03:03 -0500 (Thu, 28 Feb 2008) | 1 line +Changed paths: + M /python/trunk/Lib/SimpleHTTPServer.py + +#2169: make generated HTML more valid +----------------------------------- +[http://svn.python.org/view?rev=61106&view=rev r61106] | jeffrey.yasskin | 2008-02-28 13:03:15 -0500 (Thu, 28 Feb 2008) | 4 lines +Changed paths: + M /python/trunk/Lib/SocketServer.py + M /python/trunk/Lib/test/test_socketserver.py + +Prevent SocketServer.ForkingMixIn from waiting on child processes that it +didn't create, in most cases. When there are max_children handlers running, it +will still wait for any child process, not just handler processes. + +----------------------------------- +[http://svn.python.org/view?rev=61108&view=rev r61108] | martin.v.loewis | 2008-02-28 14:44:22 -0500 (Thu, 28 Feb 2008) | 1 line +Changed paths: + M /python/trunk/Tools/msi/uuids.py + +Add 2.6aN uuids. +----------------------------------- +[http://svn.python.org/view?rev=61109&view=rev r61109] | martin.v.loewis | 2008-02-28 14:57:34 -0500 (Thu, 28 Feb 2008) | 1 line +Changed paths: + M /python/trunk/Tools/msi/msi.py + +Bundle msvcr90.dll as a "private assembly". +----------------------------------- +[http://svn.python.org/view?rev=61116&view=rev r61116] | martin.v.loewis | 2008-02-28 17:20:50 -0500 (Thu, 28 Feb 2008) | 1 line +Changed paths: + M /python/trunk/Tools/msi/msi.py + +Locate VS installation dir from environment, so that it works with the express edition. +----------------------------------- +[http://svn.python.org/view?rev=61118&view=rev r61118] | raymond.hettinger | 2008-02-28 17:30:42 -0500 (Thu, 28 Feb 2008) | 1 line +Changed paths: + M /python/trunk/Lib/test/test_itertools.py + M /python/trunk/Modules/itertoolsmodule.c + +Have itertools.chain() consume its inputs lazily instead of building a tuple of iterators at the outset. +----------------------------------- +[http://svn.python.org/view?rev=61124&view=rev r61124] | raymond.hettinger | 2008-02-28 21:21:48 -0500 (Thu, 28 Feb 2008) | 1 line +Changed paths: + M /python/trunk/Lib/test/test_itertools.py + M /python/trunk/Modules/itertoolsmodule.c + +Handle the repeat keyword argument for itertools.product(). +----------------------------------- +[http://svn.python.org/view?rev=61125&view=rev r61125] | mark.dickinson | 2008-02-28 22:29:17 -0500 (Thu, 28 Feb 2008) | 2 lines +Changed paths: + M /python/trunk/Lib/decimal.py + +Fix docstring typo. + +----------------------------------- +[http://svn.python.org/view?rev=61128&view=rev r61128] | martin.v.loewis | 2008-02-29 11:59:21 -0500 (Fri, 29 Feb 2008) | 1 line +Changed paths: + A /python/trunk/PCbuild/_hashlib.vcproj (from /python/trunk/PCbuild/_ssl.vcproj:61106) + M /python/trunk/PCbuild/_ssl.vcproj + M /python/trunk/PCbuild/pcbuild.sln + +Make _hashlib a separate project. +----------------------------------- +[http://svn.python.org/view?rev=61136&view=rev r61136] | martin.v.loewis | 2008-02-29 13:54:45 -0500 (Fri, 29 Feb 2008) | 1 line +Changed paths: + M /python/trunk/PCbuild/build_ssl.py + M /python/trunk/PCbuild/readme.txt + M /python/trunk/PCbuild/x64.vsprops + +Port build_ssl.py to 2.4; support HOST_PYTHON variable +----------------------------------- +[http://svn.python.org/view?rev=61138&view=rev r61138] | martin.v.loewis | 2008-02-29 15:26:53 -0500 (Fri, 29 Feb 2008) | 1 line +Changed paths: + M /python/trunk/PCbuild/pcbuild.sln + +Make _hashlib depend on pythoncore. +----------------------------------- +[http://svn.python.org/view?rev=61139&view=rev r61139] | martin.v.loewis | 2008-02-29 15:54:44 -0500 (Fri, 29 Feb 2008) | 1 line +Changed paths: + M /python/trunk/Tools/msi/msi.py + +Package Tcl from tcltk64 on AMD64. +----------------------------------- +[http://svn.python.org/view?rev=61141&view=rev r61141] | gerhard.haering | 2008-02-29 17:08:41 -0500 (Fri, 29 Feb 2008) | 2 lines +Changed paths: + M /python/trunk/Lib/sqlite3/test/dbapi.py + M /python/trunk/Lib/sqlite3/test/hooks.py + A /python/trunk/Lib/sqlite3/test/py25tests.py + M /python/trunk/Lib/sqlite3/test/regression.py + M /python/trunk/Lib/sqlite3/test/transactions.py + M /python/trunk/Lib/sqlite3/test/types.py + M /python/trunk/Lib/test/test_sqlite.py + M /python/trunk/Modules/_sqlite/connection.c + M /python/trunk/Modules/_sqlite/connection.h + M /python/trunk/Modules/_sqlite/cursor.c + M /python/trunk/Modules/_sqlite/cursor.h + M /python/trunk/Modules/_sqlite/microprotocols.h + M /python/trunk/Modules/_sqlite/module.c + M /python/trunk/Modules/_sqlite/module.h + M /python/trunk/Modules/_sqlite/statement.c + M /python/trunk/Modules/_sqlite/util.c + M /python/trunk/Modules/_sqlite/util.h + +Updated to pysqlite 2.4.1. Documentation additions will come later. + +----------------------------------- +[http://svn.python.org/view?rev=61144&view=rev r61144] | barry.warsaw | 2008-02-29 21:26:42 -0500 (Fri, 29 Feb 2008) | 1 line +Changed paths: + M /python/trunk/Lib/idlelib/idlever.py + +bump idle version number +----------------------------------- +[http://svn.python.org/view?rev=61172&view=rev r61172] | raymond.hettinger | 2008-03-02 06:57:16 -0500 (Sun, 02 Mar 2008) | 1 line +Changed paths: + M /python/trunk/Modules/itertoolsmodule.c + +Simplify code for itertools.product(). +----------------------------------- +[http://svn.python.org/view?rev=61173&view=rev r61173] | raymond.hettinger | 2008-03-02 07:02:19 -0500 (Sun, 02 Mar 2008) | 1 line +Changed paths: + M /python/trunk/Modules/itertoolsmodule.c + +Handle 0-tuples which can be singletons. +----------------------------------- +[http://svn.python.org/view?rev=61174&view=rev r61174] | gerhard.haering | 2008-03-02 08:08:03 -0500 (Sun, 02 Mar 2008) | 3 lines +Changed paths: + M /python/trunk/Lib/sqlite3/test/regression.py + +Made sqlite3 module's regression tests work with SQLite versions that don't +support "create table if not exists", yet. + +----------------------------------- +[http://svn.python.org/view?rev=61183&view=rev r61183] | gregory.p.smith | 2008-03-02 15:00:53 -0500 (Sun, 02 Mar 2008) | 4 lines +Changed paths: + M /python/trunk/Lib/bsddb/test/test_associate.py + M /python/trunk/Lib/bsddb/test/test_basics.py + M /python/trunk/Lib/bsddb/test/test_compare.py + M /python/trunk/Lib/bsddb/test/test_cursor_pget_bug.py + M /python/trunk/Lib/bsddb/test/test_dbobj.py + M /python/trunk/Lib/bsddb/test/test_dbshelve.py + M /python/trunk/Lib/bsddb/test/test_dbtables.py + M /python/trunk/Lib/bsddb/test/test_env_close.py + M /python/trunk/Lib/bsddb/test/test_join.py + M /python/trunk/Lib/bsddb/test/test_lock.py + M /python/trunk/Lib/bsddb/test/test_misc.py + M /python/trunk/Lib/bsddb/test/test_pickle.py + M /python/trunk/Lib/bsddb/test/test_recno.py + M /python/trunk/Lib/bsddb/test/test_sequence.py + M /python/trunk/Lib/bsddb/test/test_thread.py + +Modify import of test_support so that the code can also be used with a +stand alone distribution of bsddb that includes its own small copy of +test_support for the needed functionality on older pythons. + +----------------------------------- +[http://svn.python.org/view?rev=61189&view=rev r61189] | brett.cannon | 2008-03-02 19:38:58 -0500 (Sun, 02 Mar 2008) | 5 lines +Changed paths: + M /python/trunk/Lib/test/test_logging.py + M /python/trunk/Misc/ACKS + M /python/trunk/Misc/NEWS + +Refactor test_logging to use unittest. This should finally solve the flakiness +issues. + +Thanks to Antoine Pitrou for the patch. + +----------------------------------- +[http://svn.python.org/view?rev=61190&view=rev r61190] | jeffrey.yasskin | 2008-03-02 20:27:03 -0500 (Sun, 02 Mar 2008) | 3 lines +Changed paths: + M /python/trunk/Python/ceval.c + +compile.c always emits END_FINALLY after WITH_CLEANUP, so predict that in +ceval.c. This is worth about a .03-.04us speedup on a simple with block. + +----------------------------------- +[http://svn.python.org/view?rev=61199&view=rev r61199] | neal.norwitz | 2008-03-02 23:37:45 -0500 (Sun, 02 Mar 2008) | 1 line +Changed paths: + M /python/trunk/Modules/_sqlite/connection.c + +Only DECREF if ret != NULL +----------------------------------- +[http://svn.python.org/view?rev=61217&view=rev r61217] | andrew.kuchling | 2008-03-03 19:40:32 -0500 (Mon, 03 Mar 2008) | 1 line +Changed paths: + M /python/trunk/Misc/NEWS + +Typo fix +----------------------------------- +[http://svn.python.org/view?rev=61220&view=rev r61220] | andrew.kuchling | 2008-03-03 20:48:26 -0500 (Mon, 03 Mar 2008) | 1 line +Changed paths: + M /python/trunk/Misc/NEWS + +Typo fix +----------------------------------- +[http://svn.python.org/view?rev=61224&view=rev r61224] | raymond.hettinger | 2008-03-03 23:17:08 -0500 (Mon, 03 Mar 2008) | 1 line +Changed paths: + M /python/trunk/Doc/library/itertools.rst + M /python/trunk/Lib/test/test_itertools.py + M /python/trunk/Modules/itertoolsmodule.c + +Beef-up docs and tests for itertools. Fix-up end-case for product(). +----------------------------------- +[http://svn.python.org/view?rev=61233&view=rev r61233] | neal.norwitz | 2008-03-04 11:22:46 -0500 (Tue, 04 Mar 2008) | 3 lines +Changed paths: + M /python/trunk/Lib/bsddb/test/test_basics.py + +Close the file before trying to remove the directory so it works on Windows. +As reported by Trent Nelson on python-dev. + +----------------------------------- +[http://svn.python.org/view?rev=61235&view=rev r61235] | thomas.heller | 2008-03-04 15:21:42 -0500 (Tue, 04 Mar 2008) | 1 line +Changed paths: + M /python/trunk/Modules/_ctypes/libffi/fficonfig.py.in + +Try to fix the build for PY_LINUX. +----------------------------------- +[http://svn.python.org/view?rev=61236&view=rev r61236] | fred.drake | 2008-03-04 16:14:04 -0500 (Tue, 04 Mar 2008) | 2 lines +Changed paths: + M /python/trunk/Lib/compileall.py + +fix typo + +----------------------------------- +[http://svn.python.org/view?rev=61237&view=rev r61237] | raymond.hettinger | 2008-03-04 17:29:44 -0500 (Tue, 04 Mar 2008) | 1 line +Changed paths: + M /python/trunk/Modules/itertoolsmodule.c + +Fix refleak in chain(). +----------------------------------- +[http://svn.python.org/view?rev=61240&view=rev r61240] | amaury.forgeotdarc | 2008-03-04 20:50:33 -0500 (Tue, 04 Mar 2008) | 13 lines +Changed paths: + M /python/trunk/Lib/test/test_grammar.py + M /python/trunk/Misc/NEWS + M /python/trunk/Python/ast.c + +Issue#2238: some syntax errors from *args or **kwargs expressions +would give bogus error messages, because of untested exceptions:: + + >>> f(**g(1=2)) + XXX undetected error + Traceback (most recent call last): + File "", line 1, in + TypeError: 'int' object is not iterable + +instead of the expected SyntaxError: keyword can't be an expression + +Will backport. + +----------------------------------- +[http://svn.python.org/view?rev=61241&view=rev r61241] | neal.norwitz | 2008-03-05 00:10:48 -0500 (Wed, 05 Mar 2008) | 3 lines +Changed paths: + M /python/trunk/Lib/bsddb/test/test_dbshelve.py + M /python/trunk/Lib/bsddb/test/test_thread.py + +Remove the files/dirs after closing the DB so the tests work on Windows. +Patch from Trent Nelson. Also simplified removing a file by using test_support. + +----------------------------------- +[http://svn.python.org/view?rev=61243&view=rev r61243] | neal.norwitz | 2008-03-05 00:20:44 -0500 (Wed, 05 Mar 2008) | 3 lines +Changed paths: + M /python/trunk/Lib/sqlite3/test/transactions.py + +Catch OSError when trying to remove a file in case removal fails. This +should prevent a failure in tearDown masking any real test failure. + +----------------------------------- +[http://svn.python.org/view?rev=61246&view=rev r61246] | neal.norwitz | 2008-03-05 00:50:20 -0500 (Wed, 05 Mar 2008) | 1 line +Changed paths: + M /python/trunk/Misc/build.sh + +Use -u urlfetch to run more tests +----------------------------------- +[http://svn.python.org/view?rev=61247&view=rev r61247] | neal.norwitz | 2008-03-05 00:51:20 -0500 (Wed, 05 Mar 2008) | 1 line +Changed paths: + M /python/trunk/Misc/build.sh + +test_smtplib sometimes reports leaks too, suppress it +----------------------------------- +[http://svn.python.org/view?rev=61252&view=rev r61252] | thomas.heller | 2008-03-05 09:53:39 -0500 (Wed, 05 Mar 2008) | 2 lines +Changed paths: + M /python/trunk/Misc/NEWS + +News entry for yesterdays commit. + +----------------------------------- +[http://svn.python.org/view?rev=61254&view=rev r61254] | skip.montanaro | 2008-03-05 11:41:09 -0500 (Wed, 05 Mar 2008) | 4 lines +Changed paths: + M /python/trunk/README + +Elaborate on the role of the altinstall target when installing multiple +versions. + + +----------------------------------- +[http://svn.python.org/view?rev=61257&view=rev r61257] | raymond.hettinger | 2008-03-05 16:04:32 -0500 (Wed, 05 Mar 2008) | 1 line +Changed paths: + M /python/trunk/Modules/itertoolsmodule.c + +Small code cleanup. +----------------------------------- +[http://svn.python.org/view?rev=61263&view=rev r61263] | georg.brandl | 2008-03-06 01:47:18 -0500 (Thu, 06 Mar 2008) | 2 lines +Changed paths: + M /python/trunk/Doc/distutils/sourcedist.rst + M /python/trunk/Lib/distutils/command/sdist.py + +#1725737: ignore other VC directories other than CVS and SVN's too. + +----------------------------------- +[http://svn.python.org/view?rev=61264&view=rev r61264] | martin.v.loewis | 2008-03-06 01:55:22 -0500 (Thu, 06 Mar 2008) | 4 lines +Changed paths: + M /python/trunk/Lib/test/test_os.py + M /python/trunk/Misc/NEWS + +Patch #2232: os.tmpfile might fail on Windows if the user has no +permission to create files in the root directory. +Will backport to 2.5. + +----------------------------------- +[http://svn.python.org/view?rev=61273&view=rev r61273] | georg.brandl | 2008-03-06 02:41:16 -0500 (Thu, 06 Mar 2008) | 2 lines +Changed paths: + M /python/trunk/Doc/library/py_compile.rst + M /python/trunk/Lib/py_compile.py + M /python/trunk/Misc/NEWS + +#2225: return nonzero status code from py_compile if not all files could be compiled. + +----------------------------------- +[http://svn.python.org/view?rev=61274&view=rev r61274] | georg.brandl | 2008-03-06 02:43:02 -0500 (Thu, 06 Mar 2008) | 2 lines +Changed paths: + M /python/trunk/Lib/rlcompleter.py + +#2220: handle matching failure more gracefully. + +----------------------------------- +[http://svn.python.org/view?rev=61275&view=rev r61275] | georg.brandl | 2008-03-06 02:45:52 -0500 (Thu, 06 Mar 2008) | 2 lines +Changed paths: + M /python/trunk/Misc/NEWS + +Bug #2220: handle rlcompleter attribute match failure more gracefully. + +----------------------------------- +[http://svn.python.org/view?rev=61278&view=rev r61278] | martin.v.loewis | 2008-03-06 08:49:47 -0500 (Thu, 06 Mar 2008) | 1 line +Changed paths: + M /python/trunk/PCbuild/_bsddb.vcproj + M /python/trunk/PCbuild/readme.txt + +Rely on x64 platform configuration when building _bsddb on AMD64. +----------------------------------- +[http://svn.python.org/view?rev=61286&view=rev r61286] | raymond.hettinger | 2008-03-06 17:51:36 -0500 (Thu, 06 Mar 2008) | 1 line +Changed paths: + M /python/trunk/Lib/test/test_itertools.py + M /python/trunk/Modules/itertoolsmodule.c + +Issue 2246: itertools grouper object did not participate in GC (should be backported). +----------------------------------- +[http://svn.python.org/view?rev=61288&view=rev r61288] | raymond.hettinger | 2008-03-06 20:33:20 -0500 (Thu, 06 Mar 2008) | 1 line +Changed paths: + M /python/trunk/Doc/library/itertools.rst + M /python/trunk/Lib/test/test_itertools.py + +Tweak recipes and tests +----------------------------------- +[http://svn.python.org/view?rev=61289&view=rev r61289] | jeffrey.yasskin | 2008-03-07 01:22:15 -0500 (Fri, 07 Mar 2008) | 5 lines +Changed paths: + M /python/trunk/Doc/library/socketserver.rst + M /python/trunk/Lib/SocketServer.py + M /python/trunk/Lib/test/test_socketserver.py + M /python/trunk/Misc/NEWS + +Progress on issue #1193577 by adding a polling .shutdown() method to +SocketServers. The core of the patch was written by Pedro Werneck, but any bugs +are mine. I've also rearranged the code for timeouts in order to avoid +interfering with the shutdown poll. + +----------------------------------- +[http://svn.python.org/view?rev=61290&view=rev r61290] | nick.coghlan | 2008-03-07 09:13:28 -0500 (Fri, 07 Mar 2008) | 1 line +Changed paths: + M /python/trunk/Doc/library/dis.rst + M /python/trunk/Lib/compiler/pycodegen.py + M /python/trunk/Misc/NEWS + M /python/trunk/Python/ceval.c + M /python/trunk/Python/compile.c + M /python/trunk/Python/import.c + +Speed up with statements by storing the __exit__ method on the stack instead of in a temp variable (bumps the magic number for pyc files) +----------------------------------- +[http://svn.python.org/view?rev=61304&view=rev r61304] | marc-andre.lemburg | 2008-03-08 05:01:43 -0500 (Sat, 08 Mar 2008) | 3 lines +Changed paths: + M /python/trunk/Lib/platform.py + +Add new name for Mandrake: Mandriva. + + +----------------------------------- +[http://svn.python.org/view?rev=61312&view=rev r61312] | facundo.batista | 2008-03-08 11:50:27 -0500 (Sat, 08 Mar 2008) | 5 lines +Changed paths: + M /python/trunk/Doc/library/pdb.rst + M /python/trunk/Lib/pdb.py + M /python/trunk/Misc/NEWS + + +Issue 1106316. post_mortem()'s parameter, traceback, is now +optional: it defaults to the traceback of the exception that is currently +being handled. + +----------------------------------- +[http://svn.python.org/view?rev=61313&view=rev r61313] | jeffrey.yasskin | 2008-03-08 13:26:54 -0500 (Sat, 08 Mar 2008) | 2 lines +Changed paths: + M /python/trunk/Tools/pybench/Setup.py + A /python/trunk/Tools/pybench/With.py + +Add tests for with and finally performance to pybench. + +----------------------------------- +[http://svn.python.org/view?rev=61314&view=rev r61314] | jeffrey.yasskin | 2008-03-08 15:08:21 -0500 (Sat, 08 Mar 2008) | 2 lines +Changed paths: + M /python/trunk/Tools/pybench/pybench.py + +Fix pybench for pythons < 2.6, tested back to 2.3. + +----------------------------------- +[http://svn.python.org/view?rev=61317&view=rev r61317] | jeffrey.yasskin | 2008-03-08 16:35:15 -0500 (Sat, 08 Mar 2008) | 3 lines +Changed paths: + M /python/trunk/Tools/pybench/pybench.py + +Well that was dumb. platform.python_implementation returns a function, not a +string. + +----------------------------------- +[http://svn.python.org/view?rev=61344&view=rev r61344] | raymond.hettinger | 2008-03-10 20:19:07 -0400 (Mon, 10 Mar 2008) | 1 line +Changed paths: + M /python/trunk/Doc/library/itertools.rst + M /python/trunk/Lib/test/test_itertools.py + +Add recipe to docs. +----------------------------------- +[http://svn.python.org/view?rev=61350&view=rev r61350] | guido.van.rossum | 2008-03-11 17:18:06 -0400 (Tue, 11 Mar 2008) | 3 lines +Changed paths: + M /python/trunk/Objects/stringobject.c + M /python/trunk/Objects/unicodeobject.c + +Fix the overflows in expandtabs(). "This time for sure!" +(Exploit at request.) + +----------------------------------- +[http://svn.python.org/view?rev=61368&view=rev r61368] | raymond.hettinger | 2008-03-13 12:43:59 -0400 (Thu, 13 Mar 2008) | 1 line +Changed paths: + M /python/trunk/Modules/itertoolsmodule.c + +Consistent tense. +----------------------------------- +[http://svn.python.org/view?rev=61370&view=rev r61370] | raymond.hettinger | 2008-03-13 15:33:34 -0400 (Thu, 13 Mar 2008) | 1 line +Changed paths: + M /python/trunk/Lib/heapq.py + +Simplify the nlargest() code using heappushpop(). +----------------------------------- +[http://svn.python.org/view?rev=61371&view=rev r61371] | brett.cannon | 2008-03-13 16:27:00 -0400 (Thu, 13 Mar 2008) | 4 lines +Changed paths: + D /python/trunk/Lib/test/output/test_thread + M /python/trunk/Lib/test/test_thread.py + M /python/trunk/Misc/NEWS + +Move test_thread over to unittest. Commits GHOP 237. + +Thanks Benjamin Peterson for the patch. + +----------------------------------- +[http://svn.python.org/view?rev=61372&view=rev r61372] | brett.cannon | 2008-03-13 16:33:10 -0400 (Thu, 13 Mar 2008) | 4 lines +Changed paths: + D /python/trunk/Lib/test/output/test_tokenize + M /python/trunk/Lib/test/test_tokenize.py + M /python/trunk/Misc/ACKS + M /python/trunk/Misc/NEWS + +Move test_tokenize to doctest. + +Done as GHOP 238 by Josip Dzolonga. + +----------------------------------- +[http://svn.python.org/view?rev=61373&view=rev r61373] | brett.cannon | 2008-03-13 16:47:41 -0400 (Thu, 13 Mar 2008) | 4 lines +Changed paths: + M /python/trunk/Lib/test/test_crypt.py + M /python/trunk/Lib/test/test_select.py + M /python/trunk/Misc/ACKS + M /python/trunk/Misc/NEWS + +Convert test_contains, test_crypt, and test_select to unittest. + +Patch from GHOP 294 by David Marek. + +----------------------------------- +[http://svn.python.org/view?rev=61374&view=rev r61374] | brett.cannon | 2008-03-13 17:02:16 -0400 (Thu, 13 Mar 2008) | 4 lines +Changed paths: + M /python/trunk/Lib/test/test_gdbm.py + M /python/trunk/Misc/ACKS + M /python/trunk/Misc/NEWS + +Move test_gdbm to use unittest. + +Closes issue #1960. Thanks Giampaolo Rodola. + +----------------------------------- +[http://svn.python.org/view?rev=61375&view=rev r61375] | brett.cannon | 2008-03-13 17:09:28 -0400 (Thu, 13 Mar 2008) | 4 lines +Changed paths: + M /python/trunk/Lib/test/test_fcntl.py + M /python/trunk/Misc/NEWS + +Convert test_fcntl to unittest. + +Closes issue #2055. Thanks Giampaolo Rodola. + +----------------------------------- +[http://svn.python.org/view?rev=61376&view=rev r61376] | raymond.hettinger | 2008-03-14 01:03:44 -0400 (Fri, 14 Mar 2008) | 1 line +Changed paths: + M /python/trunk/Modules/_heapqmodule.c + +Leave heapreplace() unchanged. +----------------------------------- +[http://svn.python.org/view?rev=61378&view=rev r61378] | martin.v.loewis | 2008-03-14 09:56:09 -0400 (Fri, 14 Mar 2008) | 2 lines +Changed paths: + M /python/trunk/Misc/NEWS + M /python/trunk/PCbuild/rt.bat + +Patch #2284: add -x64 option to rt.bat. + +----------------------------------- +[http://svn.python.org/view?rev=61383&view=rev r61383] | mark.dickinson | 2008-03-14 10:23:37 -0400 (Fri, 14 Mar 2008) | 9 lines +Changed paths: + M /python/trunk/Lib/test/test_struct.py + M /python/trunk/Misc/NEWS + M /python/trunk/Objects/floatobject.c + +Issue 705836: Fix struct.pack(">f", 1e40) to behave consistently +across platforms: it should now raise OverflowError on all +platforms. (Previously it raised OverflowError only on +non IEEE 754 platforms.) + +Also fix the (already existing) test for this behaviour +so that it actually raises TestFailed instead of just +referencing it. + +----------------------------------- +[http://svn.python.org/view?rev=61387&view=rev r61387] | thomas.heller | 2008-03-14 17:06:21 -0400 (Fri, 14 Mar 2008) | 1 line +Changed paths: + M /python/trunk/Modules/_ctypes/_ctypes.c + +Remove unneeded initializer. +----------------------------------- +[http://svn.python.org/view?rev=61402&view=rev r61402] | skip.montanaro | 2008-03-15 12:04:45 -0400 (Sat, 15 Mar 2008) | 1 line +Changed paths: + M /python/trunk/Doc/library/datetime.rst + M /python/trunk/Lib/_strptime.py + M /python/trunk/Lib/test/test_datetime.py + M /python/trunk/Lib/test/test_strptime.py + M /python/trunk/Modules/datetimemodule.c + M /python/trunk/Modules/timemodule.c + +add %f format to datetime - issue 1158 +----------------------------------- +[http://svn.python.org/view?rev=61403&view=rev r61403] | skip.montanaro | 2008-03-15 12:07:11 -0400 (Sat, 15 Mar 2008) | 2 lines +Changed paths: + M /python/trunk/Misc/NEWS + +. + +----------------------------------- +[http://svn.python.org/view?rev=61406&view=rev r61406] | neal.norwitz | 2008-03-15 18:03:18 -0400 (Sat, 15 Mar 2008) | 9 lines +Changed paths: + M /python/trunk/Misc/NEWS + M /python/trunk/Python/compile.c + +Add a warning for code like: + assert (0, 'message') + +An empty tuple does not create a warning. While questionable usage: + assert (), 'message' + +should not display a warning. Tested manually. +The warning message could be improved. Feel free to update it. + +----------------------------------- +[http://svn.python.org/view?rev=61407&view=rev r61407] | neal.norwitz | 2008-03-15 18:36:01 -0400 (Sat, 15 Mar 2008) | 1 line +Changed paths: + M /python/trunk/Python/symtable.c + +Handle memory allocation failure. Found by Adam Olsen +----------------------------------- +[http://svn.python.org/view?rev=61435&view=rev r61435] | eric.smith | 2008-03-17 08:14:29 -0400 (Mon, 17 Mar 2008) | 2 lines +Changed paths: + M /python/trunk/Python/pystrtod.c + +Reformated lines > 79 chars. +Deleted unused macro ISXDIGIT. +----------------------------------- +[http://svn.python.org/view?rev=61444&view=rev r61444] | travis.oliphant | 2008-03-17 13:36:12 -0400 (Mon, 17 Mar 2008) | 1 line +Changed paths: + M /python/trunk/Include/abstract.h + M /python/trunk/Include/object.h + M /python/trunk/Include/pyerrors.h + +Add necessary headers to back-port new buffer protocol to Python 2.6 +----------------------------------- +[http://svn.python.org/view?rev=61449&view=rev r61449] | gregory.p.smith | 2008-03-17 14:48:05 -0400 (Mon, 17 Mar 2008) | 8 lines +Changed paths: + M /python/trunk/Doc/library/zlib.rst + M /python/trunk/Lib/test/test_zlib.py + M /python/trunk/Misc/NEWS + M /python/trunk/Modules/zlibmodule.c + +Force zlib.crc32 and zlib.adler32 to return a signed integer on all platforms +regardless of the native sizeof(long) used in the integer object. + +This somewhat odd behavior of returning a signed is maintained in 2.x for +compatibility reasons of always returning an integer rather than a long object. + +Fixes Issue1202 for Python 2.6 + +----------------------------------- +[http://svn.python.org/view?rev=61450&view=rev r61450] | neal.norwitz | 2008-03-17 15:02:45 -0400 (Mon, 17 Mar 2008) | 3 lines +Changed paths: + M /python/trunk/Modules/datetimemodule.c + +Use a buffer large enough to ensure we don't overrun, even if the value +is outside the range we expect. + +----------------------------------- +[http://svn.python.org/view?rev=61458&view=rev r61458] | neal.norwitz | 2008-03-17 16:22:43 -0400 (Mon, 17 Mar 2008) | 5 lines +Changed paths: + M /python/trunk/Misc/NEWS + M /python/trunk/Objects/unicodeobject.c + +Issue 2321: reduce memory usage (increase the memory that is returned +to the system) by using pymalloc for the data of unicode objects. + +Will backport. + +----------------------------------- +[http://svn.python.org/view?rev=61468&view=rev r61468] | gregory.p.smith | 2008-03-17 20:20:01 -0400 (Mon, 17 Mar 2008) | 3 lines +Changed paths: + M /python/trunk/Objects/fileobject.c + +Fix the IOError message text when opening a file with an invalid filename. +Error reported by Ilan Schnell. + +----------------------------------- +[http://svn.python.org/view?rev=61471&view=rev r61471] | brett.cannon | 2008-03-17 21:00:07 -0400 (Mon, 17 Mar 2008) | 2 lines +Changed paths: + M /python/trunk/Lib/test/test_getargs.py + M /python/trunk/Lib/test/test_pep247.py + M /python/trunk/Lib/test/test_strftime.py + M /python/trunk/Misc/NEWS + +Convert test_strftime, test_getargs, and test_pep247 to use unittest. + +----------------------------------- +[http://svn.python.org/view?rev=61472&view=rev r61472] | jeffrey.yasskin | 2008-03-17 21:09:59 -0400 (Mon, 17 Mar 2008) | 2 lines +Changed paths: + M /python/trunk/Objects/intobject.c + M /python/trunk/Objects/longobject.c + +Fix build on platforms that don't have intptr_t. Patch by Joseph Armbruster. + +----------------------------------- +[http://svn.python.org/view?rev=61473&view=rev r61473] | brett.cannon | 2008-03-17 21:50:25 -0400 (Mon, 17 Mar 2008) | 2 lines +Changed paths: + M /python/trunk/Lib/test/test_dbm.py + M /python/trunk/Lib/test/test_dummy_threading.py + M /python/trunk/Misc/NEWS + +Convert test_dummy_threading and test_dbm to unittest. + +----------------------------------- +[http://svn.python.org/view?rev=61474&view=rev r61474] | brett.cannon | 2008-03-17 21:58:56 -0400 (Mon, 17 Mar 2008) | 2 lines +Changed paths: + D /python/trunk/Lib/test/output/test_extcall + M /python/trunk/Lib/test/test_extcall.py + M /python/trunk/Misc/NEWS + +Move test_extcall to doctest. + +----------------------------------- +[http://svn.python.org/view?rev=61480&view=rev r61480] | brett.cannon | 2008-03-17 23:46:22 -0400 (Mon, 17 Mar 2008) | 2 lines +Changed paths: + M /python/trunk/Lib/test/test_errno.py + M /python/trunk/Misc/NEWS + +test_errno was a no-op test; now it actually tests things and uses unittest. + +----------------------------------- +[http://svn.python.org/view?rev=61483&view=rev r61483] | brett.cannon | 2008-03-18 00:09:00 -0400 (Tue, 18 Mar 2008) | 3 lines +Changed paths: + M /python/trunk/Misc/NEWS + D /python/trunk/Python/memmove.c + D /python/trunk/Python/strerror.c + M /python/trunk/configure + M /python/trunk/configure.in + M /python/trunk/pyconfig.h.in + +Remove our implementation of memmove() and strerror(); both are in the C89 +standard library. + +----------------------------------- +[http://svn.python.org/view?rev=61484&view=rev r61484] | brett.cannon | 2008-03-18 00:16:06 -0400 (Tue, 18 Mar 2008) | 2 lines +Changed paths: + D /python/trunk/Lib/test/output + M /python/trunk/Lib/test/regrtest.py + M /python/trunk/Misc/NEWS + +The output directory for tests that compare against stdout is now gone! + +----------------------------------- +[http://svn.python.org/view?rev=61509&view=rev r61509] | trent.nelson | 2008-03-18 03:02:12 -0400 (Tue, 18 Mar 2008) | 1 line +Changed paths: + M /python/trunk/PCbuild/python.vcproj + +Issue 2286: bump up the stack size of the 64-bit debug python_d.exe to 2100000. The default value of 200000 causes a stack overflow at 1965 iterations of r_object() in marshal.c, 35 iterations before the 2000 limit enforced by MAX_MARSHAL_STACK_DEPTH. +----------------------------------- +[http://svn.python.org/view?rev=61520&view=rev r61520] | thomas.heller | 2008-03-18 11:03:17 -0400 (Tue, 18 Mar 2008) | 5 lines +Changed paths: + M /python/trunk/Modules/_ctypes/ctypes.h + +Include on Solaris, see issue #1506. + +It would probably be better to have a configure test for that, but +this is outside of my configure expertise. + +----------------------------------- +[http://svn.python.org/view?rev=61523&view=rev r61523] | brett.cannon | 2008-03-18 11:35:58 -0400 (Tue, 18 Mar 2008) | 5 lines +Changed paths: + M /python/trunk/Modules/_fileio.c + M /python/trunk/Modules/main.c + M /python/trunk/Modules/posixmodule.c + M /python/trunk/Modules/socketmodule.c + M /python/trunk/Objects/fileobject.c + +Remove all traces of HAVE_STRERROR. + +The removal of strerror.c led to the function check being removed from +configure.in. + Added: sandbox/trunk/py2.5.3/2 ============================================================================== --- (empty file) +++ sandbox/trunk/py2.5.3/2 Wed Oct 8 14:16:10 2008 @@ -0,0 +1,2005 @@ +----------------------------------- +[http://svn.python.org/view?rev=61526&view=rev r61526] | brett.cannon | 2008-03-18 12:47:51 -0400 (Tue, 18 Mar 2008) | 3 lines +Changed paths: + M /python/trunk/Modules/dbmmodule.c + +Cast the arguments to PyString_AsStringAndSize() to silence compiler warnings +on OS X. + +----------------------------------- +[http://svn.python.org/view?rev=61527&view=rev r61527] | sean.reifschneider | 2008-03-18 13:24:12 -0400 (Tue, 18 Mar 2008) | 3 lines +Changed paths: + M /python/trunk/Lib/shutil.py + M /python/trunk/Lib/test/test_shutil.py + M /python/trunk/Misc/NEWS + +Issue 1577: shutil.move() where destination is a directory was doing a +copy, now it is doing a os.rename() if it's on the same file-system. + +----------------------------------- +[http://svn.python.org/view?rev=61528&view=rev r61528] | brett.cannon | 2008-03-18 13:25:13 -0400 (Tue, 18 Mar 2008) | 12 lines +Changed paths: + M /python/trunk/Makefile.pre.in + M /python/trunk/Tools/scripts + A /python/trunk/Tools/scripts/patchcheck.py + M /python/trunk/Tools/scripts/reindent.py + +Add Tools/scripts/patchcheck.py. Invoked from ``make check``, the script does +some verification: + +- Runs reindent.py on all .py files. +- Checks if any changes in Doc exist. +- Whether Misc/ACKS was changed. +- Whether Misc/NEWS was changed. + +The hope is that ``make check`` can become a command anybody can run to get +reminders about what all the requisite steps needed to create a proper +patch/checkin. + +----------------------------------- +[http://svn.python.org/view?rev=61538&view=rev r61538] | steven.bethard | 2008-03-18 15:03:50 -0400 (Tue, 18 Mar 2008) | 1 line +Changed paths: + M /python/trunk/Objects/cellobject.c + +cell_compare needs to return -2 instead of NULL. +----------------------------------- +[http://svn.python.org/view?rev=61540&view=rev r61540] | gregory.p.smith | 2008-03-18 15:05:32 -0400 (Tue, 18 Mar 2008) | 8 lines +Changed paths: + M /python/trunk/Lib/test/test_posix.py + M /python/trunk/Modules/posixmodule.c + +Fix chown on 64-bit linux. It needed to take a long (64-bit on 64bit linux) as +uid and gid input to accept values >=2**31 as valid while still accepting +negative numbers to pass -1 to chown for "no change". + +Fixes issue1747858. + +This should be backported to release25-maint. + +----------------------------------- +[http://svn.python.org/view?rev=61560&view=rev r61560] | gregory.p.smith | 2008-03-18 16:40:01 -0400 (Tue, 18 Mar 2008) | 2 lines +Changed paths: + M /python/trunk/Misc/NEWS + +news entry for the chown fix + +----------------------------------- +[http://svn.python.org/view?rev=61564&view=rev r61564] | david.wolever | 2008-03-18 17:20:25 -0400 (Tue, 18 Mar 2008) | 1 line +Changed paths: + M /python/trunk/Python/bltinmodule.c + +Added a warning when -3 is enabled and None is passed to filter as the first argument. +----------------------------------- +[http://svn.python.org/view?rev=61571&view=rev r61571] | gregory.p.smith | 2008-03-18 18:27:41 -0400 (Tue, 18 Mar 2008) | 4 lines +Changed paths: + M /python/trunk/Lib/test/test_zlib.py + M /python/trunk/Modules/binascii.c + +Add a test to make sure zlib.crc32 and binascii.crc32 return the same thing. +Fix a buglet in binascii.crc32, the second optional argument could previously +have a signedness mismatch with the C variable its going into. + +----------------------------------- +[http://svn.python.org/view?rev=61575&view=rev r61575] | raymond.hettinger | 2008-03-18 19:22:29 -0400 (Tue, 18 Mar 2008) | 1 line +Changed paths: + M /python/trunk/Objects/abstract.c + +Speed-up isinstance() for one easy case. +----------------------------------- +[http://svn.python.org/view?rev=61576&view=rev r61576] | raymond.hettinger | 2008-03-18 19:33:08 -0400 (Tue, 18 Mar 2008) | 1 line +Changed paths: + M /python/trunk/Objects/listobject.c + +Issue: 2354: Add 3K warning for the cmp argument to list.sort() and sorted(). +----------------------------------- +[http://svn.python.org/view?rev=61581&view=rev r61581] | gregory.p.smith | 2008-03-18 21:38:35 -0400 (Tue, 18 Mar 2008) | 3 lines +Changed paths: + M /python/trunk/Doc/library/hashlib.rst + M /python/trunk/Lib/hashlib.py + +Mention that crc32 and adler32 are available in a different module (zlib). +Some people look for them in hashlib. + +----------------------------------- +[http://svn.python.org/view?rev=61582&view=rev r61582] | gregory.p.smith | 2008-03-18 21:46:10 -0400 (Tue, 18 Mar 2008) | 3 lines +Changed paths: + M /python/trunk/Lib/zipfile.py + +Use zlib's crc32 routine instead of binascii when available. zlib's is faster +when compiled properly optimized and about the same speed otherwise. + +----------------------------------- +[http://svn.python.org/view?rev=61586&view=rev r61586] | david.wolever | 2008-03-18 22:26:57 -0400 (Tue, 18 Mar 2008) | 1 line +Changed paths: + M /python/trunk/Misc/ACKS + +Added my name to ACKS +----------------------------------- +[http://svn.python.org/view?rev=61591&view=rev r61591] | gregory.p.smith | 2008-03-18 23:14:41 -0400 (Tue, 18 Mar 2008) | 5 lines +Changed paths: + M /python/trunk/Lib/zipfile.py + +Fix the struct module DeprecationWarnings that zipfile was triggering by +removing all use of signed struct values. + +test_zipfile and test_zipfile64 pass. no more warnings. + +----------------------------------- +[http://svn.python.org/view?rev=61593&view=rev r61593] | raymond.hettinger | 2008-03-18 23:56:59 -0400 (Tue, 18 Mar 2008) | 1 line +Changed paths: + M /python/trunk/Objects/abstract.c + +Fix compiler warning. +----------------------------------- +[http://svn.python.org/view?rev=61595&view=rev r61595] | martin.v.loewis | 2008-03-19 00:39:13 -0400 (Wed, 19 Mar 2008) | 2 lines +Changed paths: + A /python/trunk/Lib/test/relimport.py + M /python/trunk/Lib/test/test_import.py + M /python/trunk/Misc/NEWS + M /python/trunk/Python/ast.c + +Issue #2400: Allow relative imports to "import *". + +----------------------------------- +[http://svn.python.org/view?rev=61606&view=rev r61606] | trent.nelson | 2008-03-19 02:28:24 -0400 (Wed, 19 Mar 2008) | 1 line +Changed paths: + M /python/trunk/Lib/distutils/sysconfig.py + +Issue2290: Support x64 Windows builds that live in pcbuild/amd64. Without it, sysutils._python_build() returns the wrong directory, which causes the test_get_config_h_filename method in Lib/distutils/tests/test_sysconfig.py to fail. +----------------------------------- +[http://svn.python.org/view?rev=61614&view=rev r61614] | trent.nelson | 2008-03-19 03:56:39 -0400 (Wed, 19 Mar 2008) | 1 line +Changed paths: + M /python/trunk/PCbuild/_bsddb44.vcproj + +Remove extraneous apostrophe and semi-colon from AdditionalIncludeDirectories. +----------------------------------- +[http://svn.python.org/view?rev=61627&view=rev r61627] | brett.cannon | 2008-03-19 12:50:13 -0400 (Wed, 19 Mar 2008) | 5 lines +Changed paths: + M /python/trunk/Lib/test/test_nis.py + M /python/trunk/Misc/NEWS + +test_nis would fail if test.test_support.verbose was true but NIS was not set +up on the machine. + +Closes issue2411. Thanks Michael Bishop. + +----------------------------------- +[http://svn.python.org/view?rev=61646&view=rev r61646] | gregory.p.smith | 2008-03-19 18:23:51 -0400 (Wed, 19 Mar 2008) | 2 lines +Changed paths: + M /python/trunk/Lib/gzip.py + +Improve the error message when the CRCs don't match. + +----------------------------------- +[http://svn.python.org/view?rev=61649&view=rev r61649] | raymond.hettinger | 2008-03-19 18:47:48 -0400 (Wed, 19 Mar 2008) | 1 line +Changed paths: + M /python/trunk/Objects/abstract.c + +Remove unnecessary traceback save/restore pair. +----------------------------------- +[http://svn.python.org/view?rev=61651&view=rev r61651] | brett.cannon | 2008-03-19 19:01:17 -0400 (Wed, 19 Mar 2008) | 5 lines +Changed paths: + M /python/trunk/Lib/bsddb/test/test_1413192.py + M /python/trunk/Lib/test/test_hmac.py + M /python/trunk/Lib/test/test_unicode_file.py + +Make sure that the warnings filter is not reset or changed beyond the current +running test file. + +Closes issue2407. Thanks Jerry Seutter. + +----------------------------------- +[http://svn.python.org/view?rev=61652&view=rev r61652] | gregory.p.smith | 2008-03-19 19:03:25 -0400 (Wed, 19 Mar 2008) | 10 lines +Changed paths: + M /python/trunk/Doc/library/fcntl.rst + M /python/trunk/Lib/test/test_fcntl.py + M /python/trunk/Modules/fcntlmodule.c + +Prevent ioctl op codes from being sign extended from int to unsigned long +when used on platforms that actually define ioctl as taking an unsigned long. +(the BSDs and OS X / Darwin) + +Adds a unittest for fcntl.ioctl that tests what happens with both positive and +negative numbers. + +This was done because of issue1471 but I'm not able to reproduce -that- problem +in the first place on Linux 32bit or 64bit or OS X 10.4 & 10.5 32bit or 64 bit. + +----------------------------------- +[http://svn.python.org/view?rev=61656&view=rev r61656] | sean.reifschneider | 2008-03-19 20:46:50 -0400 (Wed, 19 Mar 2008) | 2 lines +Changed paths: + M /python/trunk/Lib/smtplib.py + +Issue #2143: Fix embedded readline() hang on SSL socket EOF. + +----------------------------------- +[http://svn.python.org/view?rev=61667&view=rev r61667] | georg.brandl | 2008-03-20 03:25:55 -0400 (Thu, 20 Mar 2008) | 2 lines +Changed paths: + M /python/trunk/Lib/stat.py + +#2383: remove obsolete XXX comment in stat.py. + +----------------------------------- +[http://svn.python.org/view?rev=61674&view=rev r61674] | marc-andre.lemburg | 2008-03-20 13:31:36 -0400 (Thu, 20 Mar 2008) | 7 lines +Changed paths: + M /python/trunk/Lib/platform.py + +If Mark Hammonds win32 tools are not available, try to use the _winreg module +and sys.getwindowsversion() to get at the Windows version info. + +For the machine and processor uname() values, use the environment variables +for these on Windows XP and later. + + +----------------------------------- +[http://svn.python.org/view?rev=61711&view=rev r61711] | georg.brandl | 2008-03-21 15:54:00 -0400 (Fri, 21 Mar 2008) | 2 lines +Changed paths: + M /python/trunk/Lib/test/test_urllib2.py + M /python/trunk/Lib/urllib2.py + M /python/trunk/Misc/NEWS + +#2136: allow single quotes in realm spec. + +----------------------------------- +[http://svn.python.org/view?rev=61712&view=rev r61712] | georg.brandl | 2008-03-21 16:01:51 -0400 (Fri, 21 Mar 2008) | 3 lines +Changed paths: + M /python/trunk/Lib/csv.py + M /python/trunk/Lib/test/test_csv.py + M /python/trunk/Misc/NEWS + +Issue #2432: give DictReader the dialect and line_num attributes +advertised in the docs. + +----------------------------------- +[http://svn.python.org/view?rev=61773&view=rev r61773] | raymond.hettinger | 2008-03-22 20:55:46 -0400 (Sat, 22 Mar 2008) | 1 line +Changed paths: + M /python/trunk/Doc/library/itertools.rst + M /python/trunk/Lib/test/test_itertools.py + +Simplify demo code. +----------------------------------- +[http://svn.python.org/view?rev=61779&view=rev r61779] | neal.norwitz | 2008-03-23 01:08:37 -0400 (Sun, 23 Mar 2008) | 6 lines +Changed paths: + M /python/trunk/Modules/zlibmodule.c + +Fix test_tarfile failures on Alpha (Tru64). The problem was caused in [http://svn.python.org/view?rev=61449&view=rev r61449] +which made the return value signed. On the Alpha that also lost data +since sizeof(int) != sizeof(long) and apparently adler32/crc32 return +64 bits of data. This change keeps the signedness and continues to store the +data in a long rather than an int as was the case before [http://svn.python.org/view?rev=61449&view=rev r61449]. + +----------------------------------- +[http://svn.python.org/view?rev=61783&view=rev r61783] | neal.norwitz | 2008-03-23 02:19:57 -0400 (Sun, 23 Mar 2008) | 4 lines +Changed paths: + M /python/trunk/Objects/unicodeobject.c + M /python/trunk/Python/pystrcmp.c + +Remove compiler warnings (on Alpha at least) about using chars as +array subscripts. Using chars are dangerous b/c they are signed +on some platforms and unsigned on others. + +----------------------------------- +[http://svn.python.org/view?rev=61793&view=rev r61793] | amaury.forgeotdarc | 2008-03-23 05:55:29 -0400 (Sun, 23 Mar 2008) | 4 lines +Changed paths: + M /python/trunk/Lib/test/test_unicode.py + M /python/trunk/Misc/NEWS + M /python/trunk/Objects/unicodeobject.c + +#1477: ur'\U0010FFFF' raised in narrow unicode builds. +Corrected the raw-unicode-escape codec to use UTF-16 surrogates in +this case, just like the unicode-escape codec. + +----------------------------------- +[http://svn.python.org/view?rev=61796&view=rev r61796] | raymond.hettinger | 2008-03-23 09:32:32 -0400 (Sun, 23 Mar 2008) | 1 line +Changed paths: + M /python/trunk/Doc/library/random.rst + M /python/trunk/Lib/random.py + M /python/trunk/Lib/test/test_random.py + M /python/trunk/Misc/NEWS + +Issue 1681432: Add triangular distribution the random module. +----------------------------------- +[http://svn.python.org/view?rev=61807&view=rev r61807] | raymond.hettinger | 2008-03-23 15:37:53 -0400 (Sun, 23 Mar 2008) | 4 lines +Changed paths: + M /python/trunk/Doc/library/random.rst + M /python/trunk/Lib/random.py + +Adopt Nick's suggestion for useful default arguments. +Clean-up floating point issues by adding true division and float constants. + + +----------------------------------- +[http://svn.python.org/view?rev=61810&view=rev r61810] | gregory.p.smith | 2008-03-23 16:31:23 -0400 (Sun, 23 Mar 2008) | 10 lines +Changed paths: + M /python/trunk/Modules/zlibmodule.c + +Revert [http://svn.python.org/view?rev=61779&view=rev r61779] - It undid correct code and caused test_zlib to fail on all +platforms with a 64-bit long. + +The Alpha/Tru64 test problem is a problem in either tarfile or test_tarfile, +not zlib. + +crc32 and adler32 return 32-bit values. by using a long thats larger than +32-bits in these functions they were prevented from wrapping around to their +signed 32-bit value that we want them to return in python 2.x. + +----------------------------------- +[http://svn.python.org/view?rev=61813&view=rev r61813] | gregory.p.smith | 2008-03-23 17:04:43 -0400 (Sun, 23 Mar 2008) | 6 lines +Changed paths: + M /python/trunk/Lib/gzip.py + +Fix gzip to deal with CRC's being signed values in Python 2.x properly and to +read 32bit values as unsigned to start with rather than applying signedness +fixups allover the place afterwards. + +This hopefully fixes the test_tarfile failure on the alpha/tru64 buildbot. + +----------------------------------- +[http://svn.python.org/view?rev=61820&view=rev r61820] | gregory.p.smith | 2008-03-23 18:14:38 -0400 (Sun, 23 Mar 2008) | 2 lines +Changed paths: + M /python/trunk/Modules/zlibmodule.c + +replace calls to get the initial values with the raw constants. + +----------------------------------- +[http://svn.python.org/view?rev=61821&view=rev r61821] | gregory.p.smith | 2008-03-23 19:43:02 -0400 (Sun, 23 Mar 2008) | 2 lines +Changed paths: + M /python/trunk/Lib/gzip.py + +A bugfix for [http://svn.python.org/view?rev=61813&view=rev r61813], it would fail if the data size was >=2**32. + +----------------------------------- +[http://svn.python.org/view?rev=61822&view=rev r61822] | gregory.p.smith | 2008-03-23 19:45:12 -0400 (Sun, 23 Mar 2008) | 2 lines +Changed paths: + M /python/trunk/Lib/gzip.py + +prevent a warning from the struct module when data size >= 2**32. + +----------------------------------- +[http://svn.python.org/view?rev=61823&view=rev r61823] | gregory.p.smith | 2008-03-23 20:08:01 -0400 (Sun, 23 Mar 2008) | 4 lines +Changed paths: + M /python/trunk/Modules/binascii.c + M /python/trunk/setup.py + +Have the binascii module use zlib's optimized crc32() function when available +to reduce our code size (1k data table and tiny bit of code). It falls back +to its own without zlib. + +----------------------------------- +[http://svn.python.org/view?rev=61841&view=rev r61841] | raymond.hettinger | 2008-03-24 04:17:39 -0400 (Mon, 24 Mar 2008) | 1 line +Changed paths: + M /python/trunk/Lib/copy.py + M /python/trunk/Misc/NEWS + +Issue 2460: Make Ellipsis objects copyable. +----------------------------------- +[http://svn.python.org/view?rev=61847&view=rev r61847] | martin.v.loewis | 2008-03-24 09:31:16 -0400 (Mon, 24 Mar 2008) | 2 lines +Changed paths: + M /python/trunk/Doc/library/signal.rst + M /python/trunk/Lib/test/test_signal.py + M /python/trunk/Misc/ACKS + M /python/trunk/Misc/NEWS + M /python/trunk/Modules/signalmodule.c + M /python/trunk/configure + M /python/trunk/configure.in + M /python/trunk/pyconfig.h.in + +Patch #2240: Implement signal.setitimer and signal.getitimer. + +----------------------------------- +[http://svn.python.org/view?rev=61849&view=rev r61849] | martin.v.loewis | 2008-03-24 09:54:23 -0400 (Mon, 24 Mar 2008) | 2 lines +Changed paths: + M /python/trunk/Modules/signalmodule.c + +Conditionalize sys/time.h inclusion. + +----------------------------------- +[http://svn.python.org/view?rev=61851&view=rev r61851] | christian.heimes | 2008-03-24 15:57:42 -0400 (Mon, 24 Mar 2008) | 1 line +Changed paths: + M /python/trunk/Python/sysmodule.c + +Added quick hack for bzr +----------------------------------- +[http://svn.python.org/view?rev=61852&view=rev r61852] | christian.heimes | 2008-03-24 15:58:17 -0400 (Mon, 24 Mar 2008) | 1 line +Changed paths: + M /python/trunk/Python/sysmodule.c + +Added quick hack for bzr +----------------------------------- +[http://svn.python.org/view?rev=61853&view=rev r61853] | amaury.forgeotdarc | 2008-03-24 17:04:10 -0400 (Mon, 24 Mar 2008) | 4 lines +Changed paths: + M /python/trunk/Objects/unicodeobject.c + +Issue2469: Correct a typo I introduced at [http://svn.python.org/view?rev=61793&view=rev r61793]: compilation error with UCS4 builds. + +All buildbots compile with UCS2... + +----------------------------------- +[http://svn.python.org/view?rev=61864&view=rev r61864] | neal.norwitz | 2008-03-25 00:18:18 -0400 (Tue, 25 Mar 2008) | 2 lines +Changed paths: + M /python/trunk/Objects/unicodeobject.c + M /python/trunk/PC/_winreg.c + M /python/trunk/PC/w9xpopen.c + M /python/trunk/Python/peephole.c + +Try to fix a bunch of compiler warnings on Win64. + +----------------------------------- +[http://svn.python.org/view?rev=61867&view=rev r61867] | gregory.p.smith | 2008-03-25 02:12:45 -0400 (Tue, 25 Mar 2008) | 3 lines +Changed paths: + M /python/trunk/Lib/tarfile.py + M /python/trunk/Lib/test/test_zlib.py + +A stab in the dark attempt to fix the alpha/tru64 buildbot problem and add more +test coverage of valid inputs to zlib.crc32. + +----------------------------------- +[http://svn.python.org/view?rev=61874&view=rev r61874] | gregory.p.smith | 2008-03-25 03:31:28 -0400 (Tue, 25 Mar 2008) | 2 lines +Changed paths: + M /python/trunk/Modules/binascii.c + M /python/trunk/Modules/zlibmodule.c + +Use a 32-bit unsigned int here, a long is not needed. + +----------------------------------- +[http://svn.python.org/view?rev=61875&view=rev r61875] | gregory.p.smith | 2008-03-25 03:46:07 -0400 (Tue, 25 Mar 2008) | 7 lines +Changed paths: + M /python/trunk/Modules/binascii.c + +On platforms without zlib, make this do the right thing and return the python +2.x signed value. Also, don't waste space on a table full of unsigned longs +when all it needs are unsigned ints (incase anyone builds this without zlib on +a 64-bit unix for some strange reason). + +tested by forcing it to compile this version on both 32-bit and 64-bit linux. + +----------------------------------- +[http://svn.python.org/view?rev=61880&view=rev r61880] | georg.brandl | 2008-03-25 04:31:32 -0400 (Tue, 25 Mar 2008) | 2 lines +Changed paths: + M /python/trunk/Objects/cellobject.c + M /python/trunk/Objects/dictobject.c + +Fix tabs. + +----------------------------------- +[http://svn.python.org/view?rev=61889&view=rev r61889] | georg.brandl | 2008-03-25 07:59:51 -0400 (Tue, 25 Mar 2008) | 2 lines +Changed paths: + M /python/trunk/Objects/bufferobject.c + +Move declarations to block start. + +----------------------------------- +[http://svn.python.org/view?rev=61892&view=rev r61892] | mark.dickinson | 2008-03-25 10:33:23 -0400 (Tue, 25 Mar 2008) | 3 lines +Changed paths: + M /python/trunk/Lib/decimal.py + M /python/trunk/Lib/test/test_decimal.py + M /python/trunk/Misc/NEWS + +Issue #2478: Decimal(sqrt(0)) failed when the decimal context +was not explicitly supplied. + +----------------------------------- +[http://svn.python.org/view?rev=61904&view=rev r61904] | mark.dickinson | 2008-03-25 14:47:59 -0400 (Tue, 25 Mar 2008) | 4 lines +Changed paths: + M /python/trunk/Lib/decimal.py + M /python/trunk/Lib/test/test_decimal.py + M /python/trunk/Misc/NEWS + +Issue #2482: Make sure that the coefficient of a Decimal +instance is always stored as a str instance, even +when that Decimal has been created from a unicode string. + +----------------------------------- +[http://svn.python.org/view?rev=61915&view=rev r61915] | thomas.heller | 2008-03-25 17:18:39 -0400 (Tue, 25 Mar 2008) | 1 line +Changed paths: + M /python/trunk/Modules/_ctypes/_ctypes.c + +Make _ctypes.c PY_SSIZE_T_CLEAN. +----------------------------------- +[http://svn.python.org/view?rev=61918&view=rev r61918] | andrew.kuchling | 2008-03-25 20:16:50 -0400 (Tue, 25 Mar 2008) | 1 line +Changed paths: + M /python/trunk/Modules/selectmodule.c + +Minor docstring typos +----------------------------------- +[http://svn.python.org/view?rev=61931&view=rev r61931] | benjamin.peterson | 2008-03-26 07:57:47 -0400 (Wed, 26 Mar 2008) | 2 lines +Changed paths: + M /python/trunk/Lib/pdb.py + +Added help options to PDB + +----------------------------------- +[http://svn.python.org/view?rev=61940&view=rev r61940] | christian.heimes | 2008-03-26 08:53:58 -0400 (Wed, 26 Mar 2008) | 1 line +Changed paths: + M /python/trunk/Misc/NEWS + +Updated Misc/NEWS +----------------------------------- +[http://svn.python.org/view?rev=61943&view=rev r61943] | georg.brandl | 2008-03-26 08:57:47 -0400 (Wed, 26 Mar 2008) | 2 lines +Changed paths: + M /python/trunk/Modules/selectmodule.c + +Fix and simplify error handling, silencing a compiler warning. + +----------------------------------- +[http://svn.python.org/view?rev=61954&view=rev r61954] | christian.heimes | 2008-03-26 18:20:26 -0400 (Wed, 26 Mar 2008) | 1 line +Changed paths: + M /python/trunk/Parser/parsetok.c + +Surround p_flags access with #ifdef PY_PARSER_REQUIRES_FUTURE_KEYWORD +----------------------------------- +[http://svn.python.org/view?rev=61956&view=rev r61956] | christian.heimes | 2008-03-26 18:51:58 -0400 (Wed, 26 Mar 2008) | 1 line +Changed paths: + M /python/trunk/Python/import.c + M /python/trunk/Python/pythonrun.c + +Initialize PyCompilerFlags cf_flags with 0 +----------------------------------- +[http://svn.python.org/view?rev=61958&view=rev r61958] | amaury.forgeotdarc | 2008-03-26 19:07:43 -0400 (Wed, 26 Mar 2008) | 2 lines +Changed paths: + M /python/trunk/Python/pythonrun.c + +C89 compliance: Microsoft compilers want variable declarations at the top + +----------------------------------- +[http://svn.python.org/view?rev=61964&view=rev r61964] | benjamin.peterson | 2008-03-26 20:25:33 -0400 (Wed, 26 Mar 2008) | 2 lines +Changed paths: + M /python/trunk/Misc/ACKS + +add commas for introductory clauses + +----------------------------------- +[http://svn.python.org/view?rev=61965&view=rev r61965] | christian.heimes | 2008-03-26 21:36:21 -0400 (Wed, 26 Mar 2008) | 1 line +Changed paths: + M /python/trunk/PC/config.c + M /python/trunk/PC/pyconfig.h + M /python/trunk/PCbuild/pythoncore.vcproj + +Hopefully added _fileio module to the Windows build system +----------------------------------- +[http://svn.python.org/view?rev=61966&view=rev r61966] | christian.heimes | 2008-03-26 21:38:47 -0400 (Wed, 26 Mar 2008) | 1 line +Changed paths: + M /python/trunk/PC/pyconfig.h + +Revert commit accident +----------------------------------- +[http://svn.python.org/view?rev=61969&view=rev r61969] | neal.norwitz | 2008-03-27 00:40:50 -0400 (Thu, 27 Mar 2008) | 3 lines +Changed paths: + M /python/trunk/Include/bytes_methods.h + M /python/trunk/Objects/longobject.c + M /python/trunk/Objects/unicodeobject.c + M /python/trunk/Python/mystrtoul.c + +Fix warnings about using char as an array subscript. This is not portable +since char is signed on some platforms and unsigned on others. + +----------------------------------- +[http://svn.python.org/view?rev=61970&view=rev r61970] | neal.norwitz | 2008-03-27 01:02:57 -0400 (Thu, 27 Mar 2008) | 1 line +Changed paths: + M /python/trunk/Lib/compiler/future.py + +Fix test_compiler after adding unicode_literals +----------------------------------- +[http://svn.python.org/view?rev=61971&view=rev r61971] | neal.norwitz | 2008-03-27 01:03:11 -0400 (Thu, 27 Mar 2008) | 1 line +Changed paths: + M /python/trunk/Modules/_ssl.c + +Fix compiler warnings +----------------------------------- +[http://svn.python.org/view?rev=61972&view=rev r61972] | neal.norwitz | 2008-03-27 02:52:01 -0400 (Thu, 27 Mar 2008) | 1 line +Changed paths: + M /python/trunk/Objects/floatobject.c + M /python/trunk/Objects/intobject.c + +Pluralss only need one s, not 2 (intss -> ints) +----------------------------------- +[http://svn.python.org/view?rev=61973&view=rev r61973] | christian.heimes | 2008-03-27 05:02:33 -0400 (Thu, 27 Mar 2008) | 1 line +Changed paths: + M /python/trunk/Python/import.c + +Quick 'n dirty hack: Increase the magic by 2 to force a rebuild of pyc/pyo files on the build bots +----------------------------------- +[http://svn.python.org/view?rev=61975&view=rev r61975] | christian.heimes | 2008-03-27 06:35:52 -0400 (Thu, 27 Mar 2008) | 1 line +Changed paths: + M /python/trunk/Python/import.c + +Build bots are working again - removing the hack +----------------------------------- +[http://svn.python.org/view?rev=61977&view=rev r61977] | georg.brandl | 2008-03-27 09:27:31 -0400 (Thu, 27 Mar 2008) | 2 lines +Changed paths: + M /python/trunk/Doc/library/smtplib.rst + M /python/trunk/Lib/smtplib.py + M /python/trunk/Misc/NEWS + +#2248: return result of QUIT from quit(). + +----------------------------------- +[http://svn.python.org/view?rev=61979&view=rev r61979] | amaury.forgeotdarc | 2008-03-27 19:23:54 -0400 (Thu, 27 Mar 2008) | 5 lines +Changed paths: + M /python/trunk/Lib/test/test_tokenize.py + M /python/trunk/Lib/tokenize.py + M /python/trunk/Misc/NEWS + +Issue2495: tokenize.untokenize did not insert space between two consecutive string literals: +"" "" => """", which is invalid code. + +Will backport + +----------------------------------- +[http://svn.python.org/view?rev=61984&view=rev r61984] | jeffrey.yasskin | 2008-03-28 00:11:18 -0400 (Fri, 28 Mar 2008) | 6 lines +Changed paths: + M /python/trunk/Lib/test/test_threading.py + M /python/trunk/Lib/threading.py + +Kill a race in test_threading in which the exception info in a thread finishing +up after it was joined had a traceback pointing to that thread's (deleted) +target attribute, while the test was trying to check that the target was +destroyed. Big thanks to Antoine Pitrou for diagnosing the race and pointing +out sys.exc_clear() to kill the exception early. This fixes issue 2496. + +----------------------------------- +[http://svn.python.org/view?rev=61987&view=rev r61987] | neal.norwitz | 2008-03-28 00:58:51 -0400 (Fri, 28 Mar 2008) | 5 lines +Changed paths: + M /python/trunk/Include/Python.h + M /python/trunk/Include/bytes_methods.h + M /python/trunk/Objects/longobject.c + M /python/trunk/Objects/unicodeobject.c + M /python/trunk/Parser/tokenizer.c + M /python/trunk/Python/mystrtoul.c + +Revert [http://svn.python.org/view?rev=61969&view=rev r61969] which added casts to Py_CHARMASK to avoid compiler warnings. +Rather than sprinkle casts throughout the code, change Py_CHARMASK to +always cast it's result to an unsigned char. This should ensure we +do the right thing when accessing an array with the result. + +----------------------------------- +[http://svn.python.org/view?rev=61992&view=rev r61992] | neal.norwitz | 2008-03-28 01:34:59 -0400 (Fri, 28 Mar 2008) | 2 lines +Changed paths: + M /python/trunk/Objects/complexobject.c + M /python/trunk/Objects/floatobject.c + M /python/trunk/configure + M /python/trunk/configure.in + M /python/trunk/pyconfig.h.in + +Fix compiler warning about finite() missing on Solaris. + +----------------------------------- +[http://svn.python.org/view?rev=62000&view=rev r62000] | gregory.p.smith | 2008-03-28 04:32:09 -0400 (Fri, 28 Mar 2008) | 4 lines +Changed paths: + M /python/trunk/Doc/library/sqlite3.rst + M /python/trunk/Lib/test/test_sqlite.py + M /python/trunk/Misc/ACKS + M /python/trunk/Misc/NEWS + M /python/trunk/Modules/_sqlite/connection.c + +Accept patch issue2426 by Paul Kippes (kippesp). + +Adds sqlite3.Connection.iterdump to allow dumping of databases. + +----------------------------------- +[http://svn.python.org/view?rev=62004&view=rev r62004] | georg.brandl | 2008-03-28 08:11:56 -0400 (Fri, 28 Mar 2008) | 4 lines +Changed paths: + M /python/trunk/Doc/library/_ast.rst + M /python/trunk/Doc/library/compiler.rst + M /python/trunk/Doc/library/functions.rst + M /python/trunk/Doc/library/language.rst + M /python/trunk/Include/Python-ast.h + M /python/trunk/Lib/test/test_compile.py + M /python/trunk/Misc/NEWS + M /python/trunk/Parser/asdl_c.py + M /python/trunk/Python/Python-ast.c + M /python/trunk/Python/bltinmodule.c + M /python/trunk/Python/compile.c + +Patch #1810 by Thomas Lee, reviewed by myself: +allow compiling Python AST objects into code objects +in compile(). + +----------------------------------- +[http://svn.python.org/view?rev=62011&view=rev r62011] | gerhard.haering | 2008-03-28 16:08:36 -0400 (Fri, 28 Mar 2008) | 2 lines +Changed paths: + M /python/trunk/Lib/sqlite3/test/factory.py + M /python/trunk/Lib/sqlite3/test/userfunctions.py + M /python/trunk/Modules/_sqlite/cache.c + M /python/trunk/Modules/_sqlite/cache.h + M /python/trunk/Modules/_sqlite/cursor.c + M /python/trunk/Modules/_sqlite/prepare_protocol.h + M /python/trunk/Modules/_sqlite/row.h + M /python/trunk/Modules/_sqlite/statement.c + M /python/trunk/Modules/_sqlite/statement.h + M /python/trunk/Modules/_sqlite/util.h + +Update sqlite3 module to match current version of pysqlite. + +----------------------------------- +[http://svn.python.org/view?rev=62013&view=rev r62013] | amaury.forgeotdarc | 2008-03-28 16:17:51 -0400 (Fri, 28 Mar 2008) | 2 lines +Changed paths: + M /python/trunk/Python/Python-ast.c + +Silence a compilation warning + +----------------------------------- +[http://svn.python.org/view?rev=62014&view=rev r62014] | georg.brandl | 2008-03-28 16:22:56 -0400 (Fri, 28 Mar 2008) | 2 lines +Changed paths: + M /python/trunk/Parser/asdl_c.py + +Silence compiler warning at the source. + +----------------------------------- +[http://svn.python.org/view?rev=62015&view=rev r62015] | amaury.forgeotdarc | 2008-03-28 16:30:50 -0400 (Fri, 28 Mar 2008) | 5 lines +Changed paths: + M /python/trunk/Misc/NEWS + M /python/trunk/Python/compile.c + +Fix a reference leak found by Georg, when compiling a class nested in another class. +Now "regrtest.py -R:: test_compile" is satisfied. + +Will backport. + +----------------------------------- +[http://svn.python.org/view?rev=62018&view=rev r62018] | benjamin.peterson | 2008-03-28 16:56:00 -0400 (Fri, 28 Mar 2008) | 2 lines +Changed paths: + M /python/trunk/Lib/bdb.py + +#2498 modernized try, except, finally statements in bdb + +----------------------------------- +[http://svn.python.org/view?rev=62020&view=rev r62020] | amaury.forgeotdarc | 2008-03-28 18:43:38 -0400 (Fri, 28 Mar 2008) | 5 lines +Changed paths: + M /python/trunk/PC/pyconfig.h + +One #ifdef too much, and I broke all windows buildbots: +in pyconfig.h, NTDDI_WIN2KSP4 is not *yet* defined, but will be at some point on some modules. + +Let this line even for older SDKs, they don't use it anyway. + +----------------------------------- +[http://svn.python.org/view?rev=62021&view=rev r62021] | benjamin.peterson | 2008-03-28 19:11:01 -0400 (Fri, 28 Mar 2008) | 2 lines +Changed paths: + M /python/trunk/Include/object.h + +NIL => NULL + +----------------------------------- +[http://svn.python.org/view?rev=62023&view=rev r62023] | amaury.forgeotdarc | 2008-03-28 20:44:58 -0400 (Fri, 28 Mar 2008) | 5 lines +Changed paths: + M /python/trunk/Lib/threading.py + +Try to understand why most buildbots suddenly turned to red. +Undo the only change that might have unexpected effects. + +To be followed. + +----------------------------------- +[http://svn.python.org/view?rev=62025&view=rev r62025] | amaury.forgeotdarc | 2008-03-28 20:49:07 -0400 (Fri, 28 Mar 2008) | 2 lines +Changed paths: + M /python/trunk/Lib/threading.py + +At least let the module compile + +----------------------------------- +[http://svn.python.org/view?rev=62028&view=rev r62028] | amaury.forgeotdarc | 2008-03-28 21:41:08 -0400 (Fri, 28 Mar 2008) | 2 lines +Changed paths: + M /python/trunk/Lib/threading.py + +Revert my experiment. I found one reason of failures in test_logging. + +----------------------------------- +[http://svn.python.org/view?rev=62030&view=rev r62030] | georg.brandl | 2008-03-28 21:50:06 -0400 (Fri, 28 Mar 2008) | 2 lines +Changed paths: + M /python/trunk/Misc/NEWS + M /python/trunk/Modules/main.c + +Backport #1442: report exception when startup file cannot be run. + +----------------------------------- +[http://svn.python.org/view?rev=62039&view=rev r62039] | georg.brandl | 2008-03-29 09:24:23 -0400 (Sat, 29 Mar 2008) | 3 lines +Changed paths: + M /python/trunk/Include/Python-ast.h + M /python/trunk/Lib/test/test_compile.py + M /python/trunk/Parser/asdl_c.py + M /python/trunk/Python/Python-ast.c + M /python/trunk/Python/bltinmodule.c + +Properly check for consistency with the third argument of +compile() when compiling an AST node. + +----------------------------------- +[http://svn.python.org/view?rev=62043&view=rev r62043] | benjamin.peterson | 2008-03-29 11:24:25 -0400 (Sat, 29 Mar 2008) | 3 lines +Changed paths: + M /python/trunk/Demo/classes/Dbm.py + M /python/trunk/Demo/curses/ncurses.py + M /python/trunk/Demo/rpc/mountclient.py + M /python/trunk/Demo/rpc/nfsclient.py + M /python/trunk/Demo/rpc/rpc.py + M /python/trunk/Demo/tkinter/guido/paint.py + M /python/trunk/Lib/bsddb/dbshelve.py + M /python/trunk/Lib/bsddb/test/test_basics.py + M /python/trunk/Lib/bsddb/test/test_dbtables.py + M /python/trunk/Lib/idlelib/AutoComplete.py + M /python/trunk/Lib/idlelib/PyShell.py + M /python/trunk/Lib/lib-tk/Tkinter.py + M /python/trunk/Lib/lib-tk/turtle.py + M /python/trunk/Lib/plat-mac/EasyDialogs.py + M /python/trunk/Lib/plat-mac/FrameWork.py + M /python/trunk/Lib/plat-mac/MiniAEFrame.py + M /python/trunk/Lib/plat-mac/PixMapWrapper.py + M /python/trunk/Lib/plat-mac/aepack.py + M /python/trunk/Lib/plat-mac/buildtools.py + M /python/trunk/Lib/plat-mac/findertools.py + M /python/trunk/Lib/plat-mac/gensuitemodule.py + M /python/trunk/Lib/plat-mac/ic.py + M /python/trunk/Lib/plat-mac/lib-scriptpackages/CodeWarrior/CodeWarrior_suite.py + M /python/trunk/Lib/plat-mac/lib-scriptpackages/CodeWarrior/Metrowerks_Shell_Suite.py + M /python/trunk/Lib/plat-mac/lib-scriptpackages/CodeWarrior/Standard_Suite.py + M /python/trunk/Lib/plat-mac/lib-scriptpackages/Explorer/Required_Suite.py + M /python/trunk/Lib/plat-mac/lib-scriptpackages/Explorer/Web_Browser_Suite.py + M /python/trunk/Lib/plat-mac/lib-scriptpackages/Finder/Finder_Basics.py + M /python/trunk/Lib/plat-mac/lib-scriptpackages/Finder/Legacy_suite.py + M /python/trunk/Lib/plat-mac/lib-scriptpackages/Finder/Standard_Suite.py + M /python/trunk/Lib/plat-mac/lib-scriptpackages/Netscape/Mozilla_suite.py + M /python/trunk/Lib/plat-mac/lib-scriptpackages/Netscape/PowerPlant.py + M /python/trunk/Lib/plat-mac/lib-scriptpackages/Netscape/Required_suite.py + M /python/trunk/Lib/plat-mac/lib-scriptpackages/Netscape/WorldWideWeb_suite.py + M /python/trunk/Lib/plat-mac/lib-scriptpackages/StdSuites/AppleScript_Suite.py + M /python/trunk/Lib/plat-mac/lib-scriptpackages/StdSuites/Standard_Suite.py + M /python/trunk/Lib/plat-mac/lib-scriptpackages/SystemEvents/Standard_Suite.py + M /python/trunk/Lib/plat-mac/lib-scriptpackages/Terminal/Standard_Suite.py + M /python/trunk/Lib/plat-mac/lib-scriptpackages/_builtinSuites/builtin_Suite.py + M /python/trunk/Lib/plat-mac/macostools.py + M /python/trunk/Lib/plat-mac/videoreader.py + M /python/trunk/Lib/plat-os2emx/grp.py + M /python/trunk/Lib/plat-os2emx/pwd.py + M /python/trunk/Lib/test/test_ast.py + M /python/trunk/Lib/test/test_mailbox.py + M /python/trunk/Lib/test/test_pyclbr.py + M /python/trunk/Lib/test/test_ssl.py + M /python/trunk/Lib/xml/sax/expatreader.py + M /python/trunk/Mac/BuildScript/build-installer.py + M /python/trunk/Mac/Demo/applescript/Disk_Copy/Utility_Events.py + M /python/trunk/Mac/Tools/Doc/HelpIndexingTool/Standard_Suite.py + M /python/trunk/Mac/Tools/Doc/setup.py + M /python/trunk/Mac/scripts/buildpkg.py + M /python/trunk/Tools/bgen/bgen/bgenGenerator.py + +#2503 make singletons compared with "is" not == or != +Thanks to Wummel for the patch + +----------------------------------- +[http://svn.python.org/view?rev=62047&view=rev r62047] | georg.brandl | 2008-03-30 02:40:17 -0400 (Sun, 30 Mar 2008) | 2 lines +Changed paths: + M /python/trunk/Include/Python-ast.h + M /python/trunk/Parser/Python.asdl + M /python/trunk/Python/Python-ast.c + M /python/trunk/Python/ast.c + M /python/trunk/Python/compile.c + M /python/trunk/Python/symtable.c + +Patch #2511: Give the "excepthandler" AST item proper attributes by making it a Sum. + +----------------------------------- +[http://svn.python.org/view?rev=62049&view=rev r62049] | georg.brandl | 2008-03-30 03:01:47 -0400 (Sun, 30 Mar 2008) | 2 lines +Changed paths: + M /python/trunk/Doc/library/_ast.rst + M /python/trunk/Parser/asdl_c.py + M /python/trunk/Python/Python-ast.c + +#2505: allow easier creation of AST nodes. + +----------------------------------- +[http://svn.python.org/view?rev=62051&view=rev r62051] | georg.brandl | 2008-03-30 15:00:49 -0400 (Sun, 30 Mar 2008) | 2 lines +Changed paths: + M /python/trunk/Lib/test/test_ast.py + M /python/trunk/Parser/asdl_c.py + M /python/trunk/Python/Python-ast.c + +Make _fields attr for no fields consistent with _attributes attr. + +----------------------------------- +[http://svn.python.org/view?rev=62053&view=rev r62053] | georg.brandl | 2008-03-30 15:41:39 -0400 (Sun, 30 Mar 2008) | 2 lines +Changed paths: + M /python/trunk/README + +The other download formats will be available for 2.6 too. + +----------------------------------- +[http://svn.python.org/view?rev=62054&view=rev r62054] | georg.brandl | 2008-03-30 15:43:27 -0400 (Sun, 30 Mar 2008) | 2 lines +Changed paths: + M /python/trunk/Parser/asdl_c.py + M /python/trunk/Python/Python-ast.c + +Fix error message -- "expects either 0 or 0 arguments" + +----------------------------------- +[http://svn.python.org/view?rev=62059&view=rev r62059] | georg.brandl | 2008-03-30 16:20:39 -0400 (Sun, 30 Mar 2008) | 2 lines +Changed paths: + M /python/trunk/Lib/test/test_ast.py + M /python/trunk/Parser/asdl_c.py + M /python/trunk/Python/Python-ast.c + +Make AST nodes pickleable. + +----------------------------------- +[http://svn.python.org/view?rev=62067&view=rev r62067] | jeffrey.yasskin | 2008-03-30 20:35:53 -0400 (Sun, 30 Mar 2008) | 2 lines +Changed paths: + M /python/trunk/Lib/threading.py + +Block the sys.exc_clear -3 warning from threading.py. + +----------------------------------- +[http://svn.python.org/view?rev=62097&view=rev r62097] | guido.van.rossum | 2008-04-01 19:57:36 -0400 (Tue, 01 Apr 2008) | 3 lines +Changed paths: + M /python/trunk/Modules/timing.h + +Remove the advertising clause from the BSD license in timing.h. +I have the email trail to prove that George Neville-Neil approved this. + +----------------------------------- +[http://svn.python.org/view?rev=62105&view=rev r62105] | trent.nelson | 2008-04-02 11:01:00 -0400 (Wed, 02 Apr 2008) | 1 line +Changed paths: + M /python/trunk/PCbuild/readme.txt + +Update information pertaining to building external components, as well as notes on x64 builds. This file now accurately describes the build process as is; however, there's still a lot of room for improvement, especially with regards to how we build Tcl/Tk, Tix, and OpenSSL. Watch this space for further improvements. +----------------------------------- +[http://svn.python.org/view?rev=62110&view=rev r62110] | vinay.sajip | 2008-04-02 17:09:27 -0400 (Wed, 02 Apr 2008) | 1 line +Changed paths: + M /python/trunk/Lib/logging/handlers.py + +Fix: #2315, #2316, #2317: TimedRotatingFileHandler - changed logic to better handle daylight savings time, deletion of old log files, and fixed a bug in calculating rollover when no logging occurs for a longer interval than the rollover period. +----------------------------------- +[http://svn.python.org/view?rev=62111&view=rev r62111] | vinay.sajip | 2008-04-02 17:10:23 -0400 (Wed, 02 Apr 2008) | 1 line +Changed paths: + M /python/trunk/Misc/NEWS + +Added updates with respect to recent changes to TimedRotatingFileHandler. +----------------------------------- +[http://svn.python.org/view?rev=62114&view=rev r62114] | benjamin.peterson | 2008-04-02 17:20:35 -0400 (Wed, 02 Apr 2008) | 2 lines +Changed paths: + M /python/trunk/README + +Suggested proposed changes to Python be considered on some mailing lists first + +----------------------------------- +[http://svn.python.org/view?rev=62131&view=rev r62131] | trent.nelson | 2008-04-03 14:48:53 -0400 (Thu, 03 Apr 2008) | 1 line +Changed paths: + M /python/trunk/PCbuild/kill_python.vcproj + +Add the correct OutputFile values for debug builds. Fixes [http://svn.python.org/view?rev=62129&view=rev r62129]'s commit. +----------------------------------- +[http://svn.python.org/view?rev=62133&view=rev r62133] | trent.nelson | 2008-04-03 16:00:08 -0400 (Thu, 03 Apr 2008) | 1 line +Changed paths: + M /python/trunk/PCbuild/kill_python.c + +Make kill_python a little more forgiving if it can't obtain a snapshot of module information for a given python[_d].exe process. Failing here was too pessimistic; the python[_d].exe process may be owned by another user, which is the case in some buildbot environments. +----------------------------------- +[http://svn.python.org/view?rev=62136&view=rev r62136] | amaury.forgeotdarc | 2008-04-03 19:07:55 -0400 (Thu, 03 Apr 2008) | 9 lines +Changed paths: + M /python/trunk/Lib/test/test_threading.py + M /python/trunk/Lib/threading.py + M /python/trunk/Misc/NEWS + +#1733757: the interpreter would hang on shutdown, if the function set by sys.settrace +calls threading.currentThread. + +The correction somewhat improves the code, but it was close. +Many thanks to the "with" construct, which turns python code into C calls. + +I wonder if it is not better to sys.settrace(None) just after +running the __main__ module and before finalization. + +----------------------------------- +[http://svn.python.org/view?rev=62138&view=rev r62138] | barry.warsaw | 2008-04-03 21:34:41 -0400 (Thu, 03 Apr 2008) | 1 line +Changed paths: + M /python/trunk/Misc/NEWS + +post release updates +----------------------------------- +[http://svn.python.org/view?rev=62142&view=rev r62142] | fred.drake | 2008-04-04 01:41:30 -0400 (Fri, 04 Apr 2008) | 4 lines +Changed paths: + M /python/trunk/Lib/distutils/core.py + A /python/trunk/Lib/distutils/tests/test_core.py + M /python/trunk/Misc/NEWS + +- Issue #2385: distutils.core.run_script() makes __file__ available, so the + controlled environment will more closely mirror the typical script + environment. This supports setup.py scripts that refer to data files. + +----------------------------------- +[http://svn.python.org/view?rev=62143&view=rev r62143] | thomas.heller | 2008-04-04 04:35:44 -0400 (Fri, 04 Apr 2008) | 1 line +Changed paths: + M /python/trunk/Lib/ctypes/test/test_prototypes.py + M /python/trunk/Modules/_ctypes/_ctypes.c + M /python/trunk/Modules/_ctypes/ctypes.h + +Issue #2543: Make ctypes compatible (again) with Python 2.3, 2.4, and 2.5. +----------------------------------- +[http://svn.python.org/view?rev=62145&view=rev r62145] | thomas.heller | 2008-04-04 06:07:55 -0400 (Fri, 04 Apr 2008) | 3 lines +Changed paths: + M /python/trunk/Misc/NEWS + M /python/trunk/configure + M /python/trunk/configure.in + +Issue #2544: On HP-UX systems, use 'gcc -shared' for linking when gcc +is used as compiler. + +----------------------------------- +[http://svn.python.org/view?rev=62147&view=rev r62147] | fred.drake | 2008-04-04 07:31:14 -0400 (Fri, 04 Apr 2008) | 6 lines +Changed paths: + M /python/trunk/Lib/distutils/core.py + M /python/trunk/Lib/distutils/tests/test_core.py + +my previous change did what I said it should not: it changed the current +directory to the directory in which the setup.py script lived (which made +__file__ wrong) + +fixed, with test that the script is run in the current directory of the caller + +----------------------------------- +[http://svn.python.org/view?rev=62148&view=rev r62148] | fred.drake | 2008-04-04 07:38:51 -0400 (Fri, 04 Apr 2008) | 2 lines +Changed paths: + M /python/trunk/Lib/distutils/tests/test_core.py + +stupid, stupid, stupid! + +----------------------------------- +[http://svn.python.org/view?rev=62161&view=rev r62161] | neal.norwitz | 2008-04-05 00:26:31 -0400 (Sat, 05 Apr 2008) | 9 lines +Changed paths: + M /python/trunk/Lib/sqlite3/test/transactions.py + +Prevent test_sqlite from hanging on older versions of sqlite. +The problem is that when trying to do the second insert, sqlite seems to sleep +for a very long time. Here is the output from strace: + + read(6, "SQLite format 3\0\4\0\1\1\0@ \0\0\0\1\0\0\0\0"..., 1024) = 1024 + nanosleep({4294, 966296000}, + +I don't know which version this was fixed in, but 3.2.1 definitely fails. + +----------------------------------- +[http://svn.python.org/view?rev=62167&view=rev r62167] | martin.v.loewis | 2008-04-05 11:45:25 -0400 (Sat, 05 Apr 2008) | 1 line +Changed paths: + M /python/trunk/Tools/msi/schema.py + +Extend sizes of various fields, to support the CRT90 merge module. +----------------------------------- +[http://svn.python.org/view?rev=62168&view=rev r62168] | martin.v.loewis | 2008-04-05 11:48:36 -0400 (Sat, 05 Apr 2008) | 1 line +Changed paths: + M /python/trunk/Tools/msi/msi.py + +Add two features to distinguish between private and SxS CRT. +----------------------------------- +[http://svn.python.org/view?rev=62177&view=rev r62177] | skip.montanaro | 2008-04-05 15:47:47 -0400 (Sat, 05 Apr 2008) | 2 lines +Changed paths: + M /python/trunk/Modules/timemodule.c + +Declare inittimezone static. + +----------------------------------- +[http://svn.python.org/view?rev=62179&view=rev r62179] | thomas.wouters | 2008-04-05 19:39:15 -0400 (Sat, 05 Apr 2008) | 10 lines +Changed paths: + M /python/trunk/Lib/distutils/tests/test_sysconfig.py + M /python/trunk/setup.py + + +Fix test_distutils to not fail when running 'make test' from a Python build +directory that is not the source directory (ie, one created using +'/path/to/source/configure'.) Leaves this test very slightly degraded in +that particular case, compared to the build-in-sourcedir case, but that case +isn't a particularly strong test either: neither test the actual path that +will be used after installing. There isn't a particularly good way to test +this, and a poor test beats a failing test. + + +----------------------------------- +[http://svn.python.org/view?rev=62180&view=rev r62180] | mark.hammond | 2008-04-05 21:42:06 -0400 (Sat, 05 Apr 2008) | 4 lines +Changed paths: + M /python/trunk/PC/_winreg.c + +From issue 1753245 - better _winreg support for x64. +Adds _winreg.DisableReflectionKey, EnableReflectionKey, QueryReflectionKey, +KEY_WOW64_64KEY and KEY_WOW64_32KEY. + +----------------------------------- +[http://svn.python.org/view?rev=62187&view=rev r62187] | skip.montanaro | 2008-04-06 13:05:57 -0400 (Sun, 06 Apr 2008) | 1 line +Changed paths: + M /python/trunk/Modules/timemodule.c + +type +----------------------------------- +[http://svn.python.org/view?rev=62195&view=rev r62195] | gregory.p.smith | 2008-04-06 19:11:17 -0400 (Sun, 06 Apr 2008) | 10 lines +Changed paths: + M /python/trunk/Doc/c-api/file.rst + M /python/trunk/Include/fileobject.h + M /python/trunk/Lib/test/test_file.py + M /python/trunk/Misc/NEWS + M /python/trunk/Objects/fileobject.c + +Make file objects as thread safe as the underlying libc FILE* implementation. +close() will now raise an IOError if any operations on the file object +are currently in progress in other threads. + +Most code was written by Antoine Pitrou (pitrou). Additional testing, +documentation and test suite cleanup done by me (gregory.p.smith). + +Fixes issue 815646 and 595601 (as well as many other bugs and +references to this problem dating back to the dawn of Python). + +----------------------------------- +[http://svn.python.org/view?rev=62197&view=rev r62197] | mark.hammond | 2008-04-06 21:53:39 -0400 (Sun, 06 Apr 2008) | 2 lines +Changed paths: + M /python/trunk/Doc/distutils/builtdist.rst + M /python/trunk/Lib/distutils/command/bdist.py + M /python/trunk/Lib/distutils/command/bdist_msi.py + M /python/trunk/Lib/distutils/command/bdist_wininst.py + M /python/trunk/Lib/distutils/command/build.py + M /python/trunk/Lib/distutils/command/build_ext.py + M /python/trunk/Lib/distutils/command/install.py + A /python/trunk/Lib/distutils/command/wininst-9.0-amd64.exe + M /python/trunk/Lib/distutils/msvc9compiler.py + M /python/trunk/Lib/distutils/msvccompiler.py + M /python/trunk/Lib/distutils/util.py + M /python/trunk/Misc/NEWS + M /python/trunk/PC/example_nt/readme.txt + A /python/trunk/PC/example_nt/setup.py + M /python/trunk/PCbuild/bdist_wininst.vcproj + M /python/trunk/PCbuild/pcbuild.sln + +Issue #2513: enable 64bit cross compilation on windows. + +----------------------------------- +[http://svn.python.org/view?rev=62204&view=rev r62204] | gregory.p.smith | 2008-04-07 02:33:21 -0400 (Mon, 07 Apr 2008) | 4 lines +Changed paths: + M /python/trunk/Modules/bz2module.c + M /python/trunk/Modules/cPickle.c + +Use the new PyFile_IncUseCount & PyFile_DecUseCount calls appropriatly +within the standard library. These modules use PyFile_AsFile and later +release the GIL while operating on the previously returned FILE*. + +----------------------------------- +[http://svn.python.org/view?rev=62207&view=rev r62207] | martin.v.loewis | 2008-04-07 10:53:34 -0400 (Mon, 07 Apr 2008) | 1 line +Changed paths: + M /python/trunk/Tools/msi/merge.py + +Delete ALLUSERS property merged from CRT merge module, so that per-user installations become possible again. +----------------------------------- +[http://svn.python.org/view?rev=62208&view=rev r62208] | martin.v.loewis | 2008-04-07 10:54:16 -0400 (Mon, 07 Apr 2008) | 1 line +Changed paths: + M /python/trunk/Tools/msi/msi.py + +Make private_crt feature object a global variable. +----------------------------------- +[http://svn.python.org/view?rev=62209&view=rev r62209] | martin.v.loewis | 2008-04-07 10:55:53 -0400 (Mon, 07 Apr 2008) | 1 line +Changed paths: + M /python/trunk/Tools/msi/msi.py + +Drop support for 7.1 CRT. +----------------------------------- +[http://svn.python.org/view?rev=62210&view=rev r62210] | martin.v.loewis | 2008-04-07 12:34:04 -0400 (Mon, 07 Apr 2008) | 2 lines +Changed paths: + M /python/trunk/Tools/msi/msi.py + +Make the "private CRT" case work, by editing the +manifest in DLLs to refer to the root copy of the CRT. +----------------------------------- +[http://svn.python.org/view?rev=62221&view=rev r62221] | andrew.kuchling | 2008-04-07 21:33:10 -0400 (Mon, 07 Apr 2008) | 1 line +Changed paths: + M /python/trunk/PC/_winreg.c + +Typographical fix: 32bit -> 32-bit, 64bit -> 64-bit +----------------------------------- +[http://svn.python.org/view?rev=62223&view=rev r62223] | martin.v.loewis | 2008-04-08 12:48:35 -0400 (Tue, 08 Apr 2008) | 1 line +Changed paths: + M /python/trunk/Tools/msi/msi.py + +Suppress compilation of py3_ files upon installation. +----------------------------------- +[http://svn.python.org/view?rev=62229&view=rev r62229] | amaury.forgeotdarc | 2008-04-08 17:27:42 -0400 (Tue, 08 Apr 2008) | 7 lines +Changed paths: + M /python/trunk/Lib/sre_compile.py + M /python/trunk/Lib/test/test_capi.py + +Issue2564: Prevent a hang in "import test.autotest", which runs the entire test +suite as a side-effect of importing the module. + +- in test_capi, a thread tried to import other modules +- re.compile() imported sre_parse again on every call. + + +----------------------------------- +[http://svn.python.org/view?rev=62230&view=rev r62230] | amaury.forgeotdarc | 2008-04-08 17:51:57 -0400 (Tue, 08 Apr 2008) | 2 lines +Changed paths: + M /python/trunk/Lib/inspect.py + +Prevent an error when inspect.isabstract() is called with something else than a new-style class. + +----------------------------------- +[http://svn.python.org/view?rev=62231&view=rev r62231] | amaury.forgeotdarc | 2008-04-08 18:07:05 -0400 (Tue, 08 Apr 2008) | 8 lines +Changed paths: + M /python/trunk/Doc/library/types.rst + M /python/trunk/Lib/types.py + M /python/trunk/Makefile.pre.in + D /python/trunk/Modules/_typesmodule.c + M /python/trunk/Modules/config.c.in + M /python/trunk/PC/VC6/pythoncore.dsp + M /python/trunk/PC/VS7.1/pythoncore.vcproj + M /python/trunk/PC/VS8.0/pythoncore.vcproj + M /python/trunk/PC/config.c + M /python/trunk/PCbuild/pythoncore.vcproj + +Issue 2408: remove the _types module +It was only used as a helper in types.py to access types (GetSetDescriptorType and MemberDescriptorType), +when they can easily be obtained with python code. +These expressions even work with Jython. + +I don't know what the future of the types module is; (cf. discussion in http://bugs.python.org/issue1605 ) +at least this change makes it simpler. + +----------------------------------- +[http://svn.python.org/view?rev=62234&view=rev r62234] | trent.nelson | 2008-04-08 19:47:30 -0400 (Tue, 08 Apr 2008) | 37 lines +Changed paths: + M /python/trunk/Lib/test/test_asynchat.py + M /python/trunk/Lib/test/test_asyncore.py + M /python/trunk/Lib/test/test_ftplib.py + M /python/trunk/Lib/test/test_httplib.py + M /python/trunk/Lib/test/test_poplib.py + M /python/trunk/Lib/test/test_smtplib.py + M /python/trunk/Lib/test/test_socket.py + M /python/trunk/Lib/test/test_socket_ssl.py + M /python/trunk/Lib/test/test_socketserver.py + M /python/trunk/Lib/test/test_ssl.py + M /python/trunk/Lib/test/test_support.py + M /python/trunk/Lib/test/test_telnetlib.py + M /python/trunk/Misc/NEWS + +- Issue #2550: The approach used by client/server code for obtaining ports + to listen on in network-oriented tests has been refined in an effort to + facilitate running multiple instances of the entire regression test suite + in parallel without issue. test_support.bind_port() has been fixed such + that it will always return a unique port -- which wasn't always the case + with the previous implementation, especially if socket options had been + set that affected address reuse (i.e. SO_REUSEADDR, SO_REUSEPORT). The + new implementation of bind_port() will actually raise an exception if it + is passed an AF_INET/SOCK_STREAM socket with either the SO_REUSEADDR or + SO_REUSEPORT socket option set. Furthermore, if available, bind_port() + will set the SO_EXCLUSIVEADDRUSE option on the socket it's been passed. + This currently only applies to Windows. This option prevents any other + sockets from binding to the host/port we've bound to, thus removing the + possibility of the 'non-deterministic' behaviour, as Microsoft puts it, + that occurs when a second SOCK_STREAM socket binds and accepts to a + host/port that's already been bound by another socket. The optional + preferred port parameter to bind_port() has been removed. Under no + circumstances should tests be hard coding ports! + + test_support.find_unused_port() has also been introduced, which will pass + a temporary socket object to bind_port() in order to obtain an unused port. + The temporary socket object is then closed and deleted, and the port is + returned. This method should only be used for obtaining an unused port + in order to pass to an external program (i.e. the -accept [port] argument + to openssl's s_server mode) or as a parameter to a server-oriented class + that doesn't give you direct access to the underlying socket used. + + Finally, test_support.HOST has been introduced, which should be used for + the host argument of any relevant socket calls (i.e. bind and connect). + + The following tests were updated to following the new conventions: + test_socket, test_smtplib, test_asyncore, test_ssl, test_httplib, + test_poplib, test_ftplib, test_telnetlib, test_socketserver, + test_asynchat and test_socket_ssl. + + It is now possible for multiple instances of the regression test suite to + run in parallel without issue. +----------------------------------- +[http://svn.python.org/view?rev=62235&view=rev r62235] | gregory.p.smith | 2008-04-08 20:25:17 -0400 (Tue, 08 Apr 2008) | 3 lines +Changed paths: + M /python/trunk/Lib/test/test_zlib.py + M /python/trunk/Modules/zlibmodule.c + +Fix zlib crash from zlib.decompressobj().flush(val) when val was not positive. +It tried to allocate negative or zero memory. That fails. + +----------------------------------- +[http://svn.python.org/view?rev=62246&view=rev r62246] | georg.brandl | 2008-04-09 13:57:38 -0400 (Wed, 09 Apr 2008) | 2 lines +Changed paths: + M /python/trunk/Lib/urllib2.py + +#2585: initialize code attribute of HTTPError. + +----------------------------------- +[http://svn.python.org/view?rev=62249&view=rev r62249] | gregory.p.smith | 2008-04-09 14:18:43 -0400 (Wed, 09 Apr 2008) | 2 lines +Changed paths: + M /python/trunk/Misc/NEWS + +Add a note about the zlib.decompressobj().flush() fix. + +----------------------------------- +[http://svn.python.org/view?rev=62255&view=rev r62255] | martin.v.loewis | 2008-04-09 14:56:20 -0400 (Wed, 09 Apr 2008) | 2 lines +Changed paths: + M /python/trunk/Tools/msi/msi.py + +Package wininst*.exe from distutils/command. + +----------------------------------- +[http://svn.python.org/view?rev=62289&view=rev r62289] | thomas.heller | 2008-04-11 09:05:38 -0400 (Fri, 11 Apr 2008) | 3 lines +Changed paths: + M /python/trunk/Modules/_ctypes/ctypes.h + +Move backwards compatibility macro to the correct place; +PyIndex_Check() was introduced in Python 2.5. + +----------------------------------- +[http://svn.python.org/view?rev=62290&view=rev r62290] | thomas.heller | 2008-04-11 10:20:26 -0400 (Fri, 11 Apr 2008) | 2 lines +Changed paths: + M /python/trunk/Modules/_ctypes/_ctypes.c + +Performance improvements. + +----------------------------------- +[http://svn.python.org/view?rev=62293&view=rev r62293] | christian.heimes | 2008-04-12 09:03:03 -0400 (Sat, 12 Apr 2008) | 2 lines +Changed paths: + M /python/trunk/Misc/NEWS + M /python/trunk/Modules/main.c + M /python/trunk/Python/getopt.c + +Applied patch #2617 from Frank Wierzbicki wit some extras from me +-J and -X are now reserved for Jython and non-standard arguments (e.g. IronPython). I've added some extra comments to make sure the reservation don't get missed in the future. +----------------------------------- +[http://svn.python.org/view?rev=62298&view=rev r62298] | gregory.p.smith | 2008-04-12 16:37:48 -0400 (Sat, 12 Apr 2008) | 2 lines +Changed paths: + M /python/trunk/Modules/bz2module.c + +fix compiler warnings + +----------------------------------- +[http://svn.python.org/view?rev=62302&view=rev r62302] | gregory.p.smith | 2008-04-12 18:24:04 -0400 (Sat, 12 Apr 2008) | 3 lines +Changed paths: + M /python/trunk/Lib/ftplib.py + +socket.error inherits from IOError, it no longer needs listing in +the all_errors tuple. + +----------------------------------- +[http://svn.python.org/view?rev=62304&view=rev r62304] | gregory.p.smith | 2008-04-12 20:03:25 -0400 (Sat, 12 Apr 2008) | 3 lines +Changed paths: + M /python/trunk/Makefile.pre.in + +Adds a profile-opt target for easy compilation of a python binary using +gcc's profile guided optimization. + +----------------------------------- +[http://svn.python.org/view?rev=62305&view=rev r62305] | brett.cannon | 2008-04-12 20:18:44 -0400 (Sat, 12 Apr 2008) | 3 lines +Changed paths: + M /python/trunk/Python/sysmodule.c + +Fix a bug in PySys_HasWarnOption() where it was not properly checking the +length of the list storing the warning options. + +----------------------------------- +[http://svn.python.org/view?rev=62306&view=rev r62306] | brett.cannon | 2008-04-12 20:25:15 -0400 (Sat, 12 Apr 2008) | 2 lines +Changed paths: + M /python/trunk/PC/config.c + +Fix an accidental bug of an non-existent init function. + +----------------------------------- +[http://svn.python.org/view?rev=62320&view=rev r62320] | christian.heimes | 2008-04-13 05:33:24 -0400 (Sun, 13 Apr 2008) | 1 line +Changed paths: + M /python/trunk/Python/_warnings.c + +Use PyString_InternFromString instead of PyString_FromString for static vars +----------------------------------- +[http://svn.python.org/view?rev=62321&view=rev r62321] | christian.heimes | 2008-04-13 05:37:05 -0400 (Sun, 13 Apr 2008) | 1 line +Changed paths: + M /python/trunk/PCbuild/pythoncore.vcproj + +Added new files to the pcbuild files +----------------------------------- +[http://svn.python.org/view?rev=62329&view=rev r62329] | benjamin.peterson | 2008-04-13 16:35:56 -0400 (Sun, 13 Apr 2008) | 2 lines +Changed paths: + M /python/trunk/Include/graminit.h + M /python/trunk/Parser/printgrammar.c + M /python/trunk/Python/graminit.c + +#2627 Let it be known what pgen generates + +----------------------------------- +[http://svn.python.org/view?rev=62331&view=rev r62331] | georg.brandl | 2008-04-13 16:50:29 -0400 (Sun, 13 Apr 2008) | 2 lines +Changed paths: + M /python/trunk/Modules/main.c + M /python/trunk/Python/getopt.c + +Improve -X error message. + +----------------------------------- +[http://svn.python.org/view?rev=62338&view=rev r62338] | thomas.heller | 2008-04-14 12:10:07 -0400 (Mon, 14 Apr 2008) | 3 lines +Changed paths: + M /python/trunk/Lib/ctypes/__init__.py + M /python/trunk/Misc/NEWS + M /python/trunk/Modules/_ctypes/_ctypes.c + M /python/trunk/Modules/_ctypes/callproc.c + M /python/trunk/Modules/_ctypes/ctypes.h + +Issue #2616: Implement ctypes.pointer() and ctypes.POINTER() in C for +better performance. + +----------------------------------- +[http://svn.python.org/view?rev=62340&view=rev r62340] | amaury.forgeotdarc | 2008-04-14 15:55:40 -0400 (Mon, 14 Apr 2008) | 2 lines +Changed paths: + M /python/trunk/PC/VC6/pythoncore.dsp + M /python/trunk/PC/VS7.1/pythoncore.vcproj + M /python/trunk/PC/VS8.0/pythoncore.vcproj + M /python/trunk/PCbuild/pythoncore.vcproj + +Update project files for all Windows supported compilers + +----------------------------------- +[http://svn.python.org/view?rev=62341&view=rev r62341] | amaury.forgeotdarc | 2008-04-14 16:07:48 -0400 (Mon, 14 Apr 2008) | 6 lines +Changed paths: + M /python/trunk/Python/_warnings.c + +Correct a refleak found by "regrtest.py -R:: test_structmembers" + +Some other minor updates in _warnings.c: +- make a function static +- rename a shadowing local variable + +----------------------------------- +[http://svn.python.org/view?rev=62348&view=rev r62348] | neal.norwitz | 2008-04-14 23:46:21 -0400 (Mon, 14 Apr 2008) | 1 line +Changed paths: + M /python/trunk/Objects/abstract.c + M /python/trunk/Objects/descrobject.c + +Prevent namespace pollution, add static for internal functions +----------------------------------- +[http://svn.python.org/view?rev=62350&view=rev r62350] | nick.coghlan | 2008-04-15 06:25:31 -0400 (Tue, 15 Apr 2008) | 1 line +Changed paths: + M /python/trunk/Doc/library/pkgutil.rst + M /python/trunk/Lib/pkgutil.py + M /python/trunk/Misc/NEWS + +Issue 2439: add pkgutils.get_data() as a convenience wrapper for the PEP 302 get_data() API (contributed by Paul Moore) +----------------------------------- +[http://svn.python.org/view?rev=62355&view=rev r62355] | mark.dickinson | 2008-04-15 16:51:18 -0400 (Tue, 15 Apr 2008) | 3 lines +Changed paths: + M /python/trunk/Objects/longobject.c + +Fix for possible signed overflow: the behaviour of -LONG_MIN is +undefined in ANSI C. + +----------------------------------- +[http://svn.python.org/view?rev=62378&view=rev r62378] | skip.montanaro | 2008-04-18 16:35:46 -0400 (Fri, 18 Apr 2008) | 1 line +Changed paths: + M /python/trunk/Lib/test/test_xmlrpc.py + M /python/trunk/Lib/xmlrpclib.py + M /python/trunk/Misc/NEWS + +resolve issue 2014 +----------------------------------- +[http://svn.python.org/view?rev=62379&view=rev r62379] | benjamin.peterson | 2008-04-18 16:45:33 -0400 (Fri, 18 Apr 2008) | 2 lines +Changed paths: + M /python/trunk/Python/sysmodule.c + +Fix indentation in sysmodule.c + +----------------------------------- +[http://svn.python.org/view?rev=62380&view=rev r62380] | christian.heimes | 2008-04-18 19:13:07 -0400 (Fri, 18 Apr 2008) | 3 lines +Changed paths: + M /python/trunk/Doc/library/cmath.rst + M /python/trunk/Doc/library/math.rst + M /python/trunk/Include/Python.h + M /python/trunk/Include/complexobject.h + M /python/trunk/Include/floatobject.h + A /python/trunk/Include/pymath.h (from /python/branches/trunk-math/Include/pymath.h:62242) + M /python/trunk/Include/pyport.h + A /python/trunk/Lib/test/cmath_testcases.txt (from /python/branches/trunk-math/Lib/test/cmath_testcases.txt:62242) + A /python/trunk/Lib/test/ieee754.txt (from /python/branches/trunk-math/Lib/test/ieee754.txt:62242) + M /python/trunk/Lib/test/test_cmath.py + M /python/trunk/Lib/test/test_float.py + M /python/trunk/Lib/test/test_math.py + M /python/trunk/Makefile.pre.in + M /python/trunk/Misc/NEWS + M /python/trunk/Modules/cmathmodule.c + M /python/trunk/Modules/mathmodule.c + M /python/trunk/Objects/complexobject.c + D /python/trunk/Objects/doubledigits.c + M /python/trunk/Objects/floatobject.c + M /python/trunk/Objects/intobject.c + M /python/trunk/Objects/longobject.c + M /python/trunk/PC/pyconfig.h + D /python/trunk/Python/hypot.c + A /python/trunk/Python/pymath.c (from /python/branches/trunk-math/Python/pymath.c:62242) + M /python/trunk/configure + +I finally got the time to update and merge Mark's and my trunk-math branch. The patch is collaborated work of Mark Dickinson and me. It was mostly done a few months ago. The patch fixes a lot of loose ends and edge cases related to operations with NaN, INF, very small values and complex math. + +The patch also adds acosh, asinh, atanh, log1p and copysign to all platforms. Finally it fixes differences between platforms like different results or exceptions for edge cases. Have fun :) +----------------------------------- +[http://svn.python.org/view?rev=62382&view=rev r62382] | christian.heimes | 2008-04-18 19:40:40 -0400 (Fri, 18 Apr 2008) | 2 lines +Changed paths: + M /python/trunk/PC/VC6/pythoncore.dsp + M /python/trunk/PC/VS7.1/pythoncore.vcproj + M /python/trunk/PC/VS8.0/pythoncore.vcproj + M /python/trunk/PCbuild/pythoncore.vcproj + +Added new files to Windows project files +More Windows related fixes are coming soon +----------------------------------- +[http://svn.python.org/view?rev=62383&view=rev r62383] | christian.heimes | 2008-04-18 19:49:11 -0400 (Fri, 18 Apr 2008) | 1 line +Changed paths: + M /python/trunk/Include/floatobject.h + +Stupid me. Py_RETURN_NAN should actually return something ... +----------------------------------- +[http://svn.python.org/view?rev=62386&view=rev r62386] | christian.heimes | 2008-04-18 22:23:57 -0400 (Fri, 18 Apr 2008) | 2 lines +Changed paths: + M /python/trunk/Doc/library/subprocess.rst + M /python/trunk/Lib/subprocess.py + M /python/trunk/Lib/test/test_subprocess.py + M /python/trunk/Misc/NEWS + +Added kill, terminate and send_signal to subprocess.Popen +The bits and pieces for the Windows side were already in place. The POSIX side is trivial (as usual) and uses os.kill(). +----------------------------------- +[http://svn.python.org/view?rev=62396&view=rev r62396] | mark.dickinson | 2008-04-19 14:51:48 -0400 (Sat, 19 Apr 2008) | 5 lines +Changed paths: + M /python/trunk/Lib/test/test_math.py + M /python/trunk/Modules/mathmodule.c + +Additional tests for math.pow, and extra special-case +handling code in math.pow, in the hope of making all +tests pass on the alpha Tru64 buildbot. + + +----------------------------------- +[http://svn.python.org/view?rev=62400&view=rev r62400] | mark.dickinson | 2008-04-19 15:41:52 -0400 (Sat, 19 Apr 2008) | 3 lines +Changed paths: + M /python/trunk/Modules/mathmodule.c + +Additional special-case handling for math.pow. +Windows/VS2008 doesn't like (-1)**(+-inf). + +----------------------------------- +[http://svn.python.org/view?rev=62413&view=rev r62413] | mark.dickinson | 2008-04-19 21:39:24 -0400 (Sat, 19 Apr 2008) | 3 lines +Changed paths: + M /python/trunk/Modules/mathmodule.c + +FreeBSD doesn't follow C99 for modf(inf); so add explicit +special-value handling to math.modf code. + +----------------------------------- +[http://svn.python.org/view?rev=62414&view=rev r62414] | mark.dickinson | 2008-04-20 00:13:13 -0400 (Sun, 20 Apr 2008) | 5 lines +Changed paths: + M /python/trunk/Lib/test/test_math.py + M /python/trunk/Modules/mathmodule.c + +Yet more explicit special case handling to make +math.pow behave on alpha Tru64. All IEEE 754 +special values are now handled directly; only +the finite**finite case is handled by libm. + +----------------------------------- +[http://svn.python.org/view?rev=62418&view=rev r62418] | mark.dickinson | 2008-04-20 12:13:17 -0400 (Sun, 20 Apr 2008) | 7 lines +Changed paths: + M /python/trunk/Modules/cmathmodule.c + +Issue 2662: Initialize special value tables dynamically (i.e. when +cmath module is loaded) instead of statically. This fixes compile-time +problems on platforms where HUGE_VAL is an extern variable rather than +a constant. + +Thanks Hirokazu Yamamoto for the patch. + +----------------------------------- +[http://svn.python.org/view?rev=62420&view=rev r62420] | mark.dickinson | 2008-04-20 14:30:05 -0400 (Sun, 20 Apr 2008) | 3 lines +Changed paths: + M /python/trunk/Modules/cmathmodule.c + +Even more fixes for alpha Tru64, this time for +the phase and polar methods. + +----------------------------------- +[http://svn.python.org/view?rev=62424&view=rev r62424] | mark.dickinson | 2008-04-20 17:39:04 -0400 (Sun, 20 Apr 2008) | 4 lines +Changed paths: + M /python/trunk/Modules/mathmodule.c + +math.atan2 is misbehaving on Windows; this patch +should fix the problem in the same way that +the cmath.phase problems were fixed. + +----------------------------------- +[http://svn.python.org/view?rev=62426&view=rev r62426] | mark.dickinson | 2008-04-20 21:55:50 -0400 (Sun, 20 Apr 2008) | 2 lines +Changed paths: + M /python/trunk/Modules/mathmodule.c + +Silence 'r may be used uninitialized' compiler warning. + +----------------------------------- +[http://svn.python.org/view?rev=62434&view=rev r62434] | thomas.heller | 2008-04-21 09:46:55 -0400 (Mon, 21 Apr 2008) | 1 line +Changed paths: + M /python/trunk/Tools/pybench/systimes.py + +Fix typo. +----------------------------------- +[http://svn.python.org/view?rev=62441&view=rev r62441] | gregory.p.smith | 2008-04-21 13:46:40 -0400 (Mon, 21 Apr 2008) | 2 lines +Changed paths: + M /python/trunk/Tools/pybench/pybench.py + +explicitly flush after the ... since there wasn't a newline + +----------------------------------- +[http://svn.python.org/view?rev=62446&view=rev r62446] | gregory.p.smith | 2008-04-21 17:31:08 -0400 (Mon, 21 Apr 2008) | 3 lines +Changed paths: + M /python/trunk/Lib/getpass.py + M /python/trunk/Misc/NEWS + +If sys.stdin is not a tty, fall back to default_getpass after printing +a warning instead of failing with a termios.error. + +----------------------------------- +[http://svn.python.org/view?rev=62447&view=rev r62447] | mark.dickinson | 2008-04-21 18:32:24 -0400 (Mon, 21 Apr 2008) | 8 lines +Changed paths: + M /python/trunk/configure + M /python/trunk/configure.in + M /python/trunk/pyconfig.h.in + +test_math and test_cmath are failing on the FreeBSD 6.2 trunk buildbot, +apparently because tanh(-0.) loses the sign of zero on that platform. +If true, this is a bug in FreeBSD. + +Added a configure test to verify this. I still need to figure out +how best to deal with this failure. + + +----------------------------------- +[http://svn.python.org/view?rev=62448&view=rev r62448] | amaury.forgeotdarc | 2008-04-21 18:35:30 -0400 (Mon, 21 Apr 2008) | 7 lines +Changed paths: + M /python/trunk/Lib/idlelib/NEWS.txt + M /python/trunk/Lib/idlelib/configHandler.py + +Issue 2665: On Windows, sys.stderr does not contain a valid file when running without a console. +It seems to work, but will fail at the first flush. + +This causes IDLE to crash when too many warnings are printed. + +Will backport. + +----------------------------------- +[http://svn.python.org/view?rev=62451&view=rev r62451] | mark.dickinson | 2008-04-21 20:54:27 -0400 (Mon, 21 Apr 2008) | 3 lines +Changed paths: + M /python/trunk/configure + M /python/trunk/configure.in + +Make configure test for tanh(-0.) == -0. committed in [http://svn.python.org/view?rev=62447&view=rev r62447] actually +work. (The test wasn't properly linked with libm. Sigh.) + +----------------------------------- +[http://svn.python.org/view?rev=62454&view=rev r62454] | gregory.p.smith | 2008-04-22 04:08:41 -0400 (Tue, 22 Apr 2008) | 8 lines +Changed paths: + M /python/trunk/Doc/library/getpass.rst + M /python/trunk/Lib/getpass.py + +Major improvements: +* Default to using /dev/tty for the password prompt and input before + falling back to sys.stdin and sys.stderr. +* Use sys.stderr instead of sys.stdout. +* print the 'password may be echoed' warning to stream used to display + the prompt rather than always sys.stderr. +* warn() with GetPassWarning when input may be echoed. + +----------------------------------- +[http://svn.python.org/view?rev=62455&view=rev r62455] | gregory.p.smith | 2008-04-22 04:11:33 -0400 (Tue, 22 Apr 2008) | 2 lines +Changed paths: + M /python/trunk/Misc/NEWS + +update the getpass entry + +----------------------------------- +[http://svn.python.org/view?rev=62463&view=rev r62463] | amaury.forgeotdarc | 2008-04-22 17:14:41 -0400 (Tue, 22 Apr 2008) | 5 lines +Changed paths: + M /python/trunk/Lib/test/test_urllib2.py + M /python/trunk/Lib/urllib2.py + M /python/trunk/Misc/NEWS + +Issue #2670: urllib2.build_opener() failed when two handlers +derive the same default base class. + +Will backport. + +----------------------------------- +[http://svn.python.org/view?rev=62476&view=rev r62476] | martin.v.loewis | 2008-04-24 09:16:36 -0400 (Thu, 24 Apr 2008) | 3 lines +Changed paths: + M /python/trunk/Include/object.h + +Remove Py_Refcnt, Py_Type, Py_Size, as they were added only +for backwards compatibility, yet 2.5 did not have them at all. + +----------------------------------- +[http://svn.python.org/view?rev=62477&view=rev r62477] | martin.v.loewis | 2008-04-24 09:17:24 -0400 (Thu, 24 Apr 2008) | 2 lines +Changed paths: + M /python/trunk/Modules/_bsddb.c + +Fix typo. + +----------------------------------- +[http://svn.python.org/view?rev=62480&view=rev r62480] | amaury.forgeotdarc | 2008-04-24 14:07:05 -0400 (Thu, 24 Apr 2008) | 4 lines +Changed paths: + M /python/trunk/Lib/test/test_compile.py + M /python/trunk/Misc/NEWS + M /python/trunk/Parser/tokenizer.c + +Issue2681: the literal 0o8 was wrongly accepted, and evaluated as float(0.0). +This happened only when 8 is the first digit. +Credits go to Lukas Meuser. + +----------------------------------- +[http://svn.python.org/view?rev=62481&view=rev r62481] | thomas.heller | 2008-04-24 14:14:19 -0400 (Thu, 24 Apr 2008) | 3 lines +Changed paths: + M /python/trunk/Misc/NEWS + M /python/trunk/Modules/_ctypes/_ctypes.c + M /python/trunk/Modules/_ctypes/callbacks.c + M /python/trunk/Modules/_ctypes/ctypes.h + +Remove cyclic reference in CFuncPtr instances; see issue #2682. + +Backport candidate for the release25-maint branch. +----------------------------------- +[http://svn.python.org/view?rev=62492&view=rev r62492] | neal.norwitz | 2008-04-24 23:40:17 -0400 (Thu, 24 Apr 2008) | 1 line +Changed paths: + M /python/trunk/Misc/NEWS + +Fix typo (now -> no) +----------------------------------- +[http://svn.python.org/view?rev=62498&view=rev r62498] | thomas.heller | 2008-04-25 11:44:16 -0400 (Fri, 25 Apr 2008) | 1 line +Changed paths: + M /python/trunk/Doc/library/ctypes.rst + A /python/trunk/Lib/ctypes/test/test_frombuffer.py + M /python/trunk/Misc/NEWS + M /python/trunk/Modules/_ctypes/_ctypes.c + +Add from_buffer and from_buffer_copy class methods to ctypes types. +----------------------------------- +[http://svn.python.org/view?rev=62499&view=rev r62499] | mark.dickinson | 2008-04-25 12:11:04 -0400 (Fri, 25 Apr 2008) | 7 lines +Changed paths: + M /python/trunk/Misc/NEWS + M /python/trunk/configure + M /python/trunk/configure.in + +Issue #1496032. Add -mieee to BASECFLAGS on alpha, when gcc is +the compiler. This should(?) help to fix failures in test_math +and test_cmath on Linux/alpha. + +Also add configure message reporting the result of uname -m, as +a debugging aid. + +----------------------------------- +[http://svn.python.org/view?rev=62500&view=rev r62500] | mark.dickinson | 2008-04-25 12:59:09 -0400 (Fri, 25 Apr 2008) | 3 lines +Changed paths: + M /python/trunk/Lib/test/test_textwrap.py + M /python/trunk/Lib/textwrap.py + M /python/trunk/Misc/NEWS + +Issue 2635: fix bug in the fix_sentence_endings option to textwrap.fill. + + +----------------------------------- +[http://svn.python.org/view?rev=62514&view=rev r62514] | georg.brandl | 2008-04-26 14:32:17 -0400 (Sat, 26 Apr 2008) | 2 lines +Changed paths: + M /python/trunk/Modules/_ctypes/callbacks.c + +Add missing return type to dealloc. + +----------------------------------- +[http://svn.python.org/view?rev=62516&view=rev r62516] | alexandre.vassalotti | 2008-04-26 20:52:24 -0400 (Sat, 26 Apr 2008) | 2 lines +Changed paths: + M /python/trunk/Lib/weakref.py + +Fixed URL of PEP 205 in weakref's module docstring. + +----------------------------------- +[http://svn.python.org/view?rev=62546&view=rev r62546] | kurt.kaiser | 2008-04-27 17:07:41 -0400 (Sun, 27 Apr 2008) | 7 lines +Changed paths: + M /python/trunk/Lib/idlelib/EditorWindow.py + M /python/trunk/Lib/idlelib/NEWS.txt + M /python/trunk/Lib/idlelib/PyShell.py + +Home / Control-A toggles between left margin and end of leading white +space. Patch 1196903 Jeff Shute. + +M idlelib/PyShell.py +M idlelib/EditorWindow.py +M idlelib/NEWS.txt + +----------------------------------- +[http://svn.python.org/view?rev=62548&view=rev r62548] | kurt.kaiser | 2008-04-27 17:38:05 -0400 (Sun, 27 Apr 2008) | 2 lines +Changed paths: + M /python/trunk/Lib/idlelib/AutoCompleteWindow.py + M /python/trunk/Lib/idlelib/NEWS.txt + +Improved AutoCompleteWindow logic. Patch 2062 Tal Einat. + +----------------------------------- +[http://svn.python.org/view?rev=62549&view=rev r62549] | kurt.kaiser | 2008-04-27 17:52:19 -0400 (Sun, 27 Apr 2008) | 4 lines +Changed paths: + M /python/trunk/Lib/idlelib/AutoComplete.py + M /python/trunk/Lib/idlelib/NEWS.txt + +Autocompletion of filenames now support alternate separators, e.g. the +'/' char on Windows. Patch 2061 Tal Einat. + + +----------------------------------- +[http://svn.python.org/view?rev=62550&view=rev r62550] | skip.montanaro | 2008-04-27 18:49:56 -0400 (Sun, 27 Apr 2008) | 6 lines +Changed paths: + M /python/trunk/Lib/tempfile.py + +A few small changes: +* The only exception we should catch when trying to import cStringIO is an + ImportError. +* Delete the function signatures embedded in the mk*temp docstrings. +* The tempdir global variable was initialized twice. + +----------------------------------- +[http://svn.python.org/view?rev=62553&view=rev r62553] | skip.montanaro | 2008-04-27 22:57:23 -0400 (Sun, 27 Apr 2008) | 7 lines +Changed paths: + M /python/trunk/Lib/pyclbr.py + +Minor cleanups: +* Avoid creating unused local variables where we can. Where we can't prefix + the unused variables with '_'. +* Avoid shadowing builtins where it won't change the external interface of a + function. +* Use None as default path arg to readmodule and readmodule_ex. + +----------------------------------- +[http://svn.python.org/view?rev=62555&view=rev r62555] | brett.cannon | 2008-04-27 23:23:50 -0400 (Sun, 27 Apr 2008) | 5 lines +Changed paths: + M /python/trunk/Lib/test/test_traceback.py + M /python/trunk/Modules/_testcapimodule.c + M /python/trunk/Python/traceback.c + +Fix a bug introduced by the warnings rewrite where tracebacks were being +improperly indented. + +Closes issue #2699. + +----------------------------------- +[http://svn.python.org/view?rev=62557&view=rev r62557] | skip.montanaro | 2008-04-27 23:27:53 -0400 (Sun, 27 Apr 2008) | 6 lines +Changed paths: + M /python/trunk/Lib/robotparser.py + +Get rid of _test(), _main(), _debug() and _check(). Tests are no longer +needed (better set available in Lib/test/test_robotparser.py). Clean up a +few PEP 8 nits (compound statements on a single line, whitespace around +operators). + + +----------------------------------- +[http://svn.python.org/view?rev=62558&view=rev r62558] | brett.cannon | 2008-04-28 00:50:06 -0400 (Mon, 28 Apr 2008) | 3 lines +Changed paths: + M /python/trunk/Lib/test/test_traceback.py + M /python/trunk/Modules/_testcapimodule.c + +Rename the test_traceback_print() function to traceback_print() to prevent +test_capi from automatically calling the function. + +----------------------------------- +[http://svn.python.org/view?rev=62595&view=rev r62595] | andrew.kuchling | 2008-04-30 12:19:55 -0400 (Wed, 30 Apr 2008) | 1 line +Changed paths: + M /python/trunk/Misc/NEWS + +Typo fix +----------------------------------- +[http://svn.python.org/view?rev=62605&view=rev r62605] | georg.brandl | 2008-04-30 17:08:42 -0400 (Wed, 30 Apr 2008) | 2 lines +Changed paths: + M /python/trunk/Lib/contextlib.py + +#1748: use functools.wraps instead of rolling own metadata update. + +----------------------------------- +[http://svn.python.org/view?rev=62626&view=rev r62626] | brett.cannon | 2008-05-01 22:25:09 -0400 (Thu, 01 May 2008) | 6 lines +Changed paths: + M /python/trunk/Misc/NEWS + M /python/trunk/Python/_warnings.c + +Fix a backwards-compatibility mistake where a new optional argument for +warnings.showwarning() was being used. This broke pre-existing replacements for +the function since they didn't support the extra argument. + +Closes issue 2705. + +----------------------------------- +[http://svn.python.org/view?rev=62627&view=rev r62627] | gregory.p.smith | 2008-05-02 03:26:52 -0400 (Fri, 02 May 2008) | 20 lines +Changed paths: + M /python/trunk/Lib/socket.py + +This should fix issue2632. A long description of the two competing +problems is in the bug report (one old, one recently introduced trying +to fix the old one). In short: + +buffer data during socket._fileobject.read() and readlines() within a +cStringIO object instead of a [] of str()s returned from the recv() +call. + +This prevents excessive memory use due to the size parameter being +passed to recv() being grossly larger than the actual size of the data +returned *and* prevents excessive cpu usage due to looping in python +calling recv() with a very tiny size value if min() is used as the +previous memory-use bug "fix" did. + +It also documents what the socket._fileobject._rbufsize member is +actually used for. + +This is a candidate for back porting to 2.5. + + +----------------------------------- +[http://svn.python.org/view?rev=62636&view=rev r62636] | mark.hammond | 2008-05-02 08:48:15 -0400 (Fri, 02 May 2008) | 2 lines +Changed paths: + M /python/trunk/Doc/distutils/builtdist.rst + M /python/trunk/Lib/distutils/command/bdist_wininst.py + M /python/trunk/Lib/distutils/command/wininst-6.0.exe + M /python/trunk/Lib/distutils/command/wininst-7.1.exe + M /python/trunk/Lib/distutils/command/wininst-9.0-amd64.exe + M /python/trunk/Lib/distutils/command/wininst-9.0.exe + M /python/trunk/Lib/distutils/msvc9compiler.py + M /python/trunk/Misc/NEWS + M /python/trunk/PC/bdist_wininst/install.c + M /python/trunk/PC/bdist_wininst/wininst-7.1.vcproj + M /python/trunk/PC/bdist_wininst/wininst.dsp + +#2581: Vista UAC/elevation support for bdist_wininst + +----------------------------------- +[http://svn.python.org/view?rev=62638&view=rev r62638] | facundo.batista | 2008-05-02 13:39:00 -0400 (Fri, 02 May 2008) | 3 lines +Changed paths: + M /python/trunk/Lib/decimal.py + M /python/trunk/Lib/test/test_decimal.py + + +Fixed some test structures. Thanks Mark Dickinson. + +----------------------------------- +[http://svn.python.org/view?rev=62644&view=rev r62644] | ronald.oussoren | 2008-05-02 15:45:11 -0400 (Fri, 02 May 2008) | 7 lines +Changed paths: + M /python/trunk/Mac/BuildScript/build-installer.py + M /python/trunk/Mac/BuildScript/resources/ReadMe.txt + M /python/trunk/Mac/IDLE/Makefile.in + M /python/trunk/Mac/Makefile.in + D /python/trunk/Mac/Resources/app/Info.plist + A /python/trunk/Mac/Resources/app/Info.plist.in (from /python/trunk/Mac/Resources/app/Info.plist:62636) + D /python/trunk/Mac/Resources/app/Resources/English.lproj/InfoPlist.strings + D /python/trunk/Mac/Resources/framework/English.lproj + D /python/trunk/Mac/Resources/framework/Info.plist + A /python/trunk/Mac/Resources/framework/Info.plist.in (from /python/trunk/Mac/Resources/framework/Info.plist:62636) + D /python/trunk/Mac/Resources/framework/version.plist + M /python/trunk/Makefile.pre.in + M /python/trunk/Misc/NEWS + M /python/trunk/configure + M /python/trunk/configure.in + +Fix for issue #2573: Can't change the framework name on OS X builds + +This introduces a new configure option: --with-framework-name=NAME +(defaulting to 'Python'). This allows you to install several copies +of the Python framework with different names (such as a normal build +and a debug build). + +----------------------------------- +[http://svn.python.org/view?rev=62645&view=rev r62645] | ronald.oussoren | 2008-05-02 15:58:56 -0400 (Fri, 02 May 2008) | 2 lines +Changed paths: + M /python/trunk/Mac/PythonLauncher/Makefile.in + +Finish fix for issue2573, previous patch was incomplete. + +----------------------------------- +[http://svn.python.org/view?rev=62648&view=rev r62648] | ronald.oussoren | 2008-05-02 17:42:35 -0400 (Fri, 02 May 2008) | 4 lines +Changed paths: + M /python/trunk/Lib/plat-mac/Carbon/AppleEvents.py + M /python/trunk/Lib/plat-mac/terminalcommand.py + M /python/trunk/Mac/PythonLauncher/MyDocument.m + M /python/trunk/Mac/PythonLauncher/doscript.m + +Fix for #1905: PythonLauncher not working correctly on OSX 10.5/Leopard + +This fixes both Python Launchar and the terminalcommand module. + Added: sandbox/trunk/py2.5.3/3 ============================================================================== --- (empty file) +++ sandbox/trunk/py2.5.3/3 Wed Oct 8 14:16:10 2008 @@ -0,0 +1,1003 @@ +----------------------------------- +[http://svn.python.org/view?rev=62651&view=rev r62651] | ronald.oussoren | 2008-05-02 17:54:56 -0400 (Fri, 02 May 2008) | 2 lines +Changed paths: + M /python/trunk/Lib/plat-mac/macerrors.py + +Fix for issue #2520 (cannot import macerrors) + +----------------------------------- +[http://svn.python.org/view?rev=62653&view=rev r62653] | brett.cannon | 2008-05-02 21:02:41 -0400 (Fri, 02 May 2008) | 2 lines +Changed paths: + M /python/trunk/Python/_warnings.c + +Fix some indentation errors. + +----------------------------------- +[http://svn.python.org/view?rev=62656&view=rev r62656] | brett.cannon | 2008-05-02 23:19:39 -0400 (Fri, 02 May 2008) | 6 lines +Changed paths: + M /python/trunk/Lib/test/test_warnings.py + M /python/trunk/Python/_warnings.c + +Fix the C implementation of 'warnings' to infer the filename of the module that +raised an exception properly when __file__ is not set, __name__ == '__main__', +and sys.argv[0] is a false value. + +Closes issue2743. + +----------------------------------- +[http://svn.python.org/view?rev=62663&view=rev r62663] | benjamin.peterson | 2008-05-03 11:56:42 -0400 (Sat, 03 May 2008) | 2 lines +Changed paths: + M /python/trunk/Python/ast.c + +The compiling struct is now passed around to all AST helpers (see issue 2720) + +----------------------------------- +[http://svn.python.org/view?rev=62666&view=rev r62666] | mark.dickinson | 2008-05-03 14:23:14 -0400 (Sat, 03 May 2008) | 3 lines +Changed paths: + M /python/trunk/Doc/library/decimal.rst + M /python/trunk/Lib/decimal.py + +Backport Raymond's changes in [http://svn.python.org/view?rev=60508&view=rev r60508] to Python 2.6. +'Context flags get set, not incremented' + +----------------------------------- +[http://svn.python.org/view?rev=62684&view=rev r62684] | mark.dickinson | 2008-05-03 22:05:06 -0400 (Sat, 03 May 2008) | 9 lines +Changed paths: + M /python/trunk/Lib/decimal.py + +Some very minor changes to decimal.py in Python 2.6, aimed +at reducing the size of the diff between the 2.x decimal.py +and 3.x decimal.py and thereby making future merges easier: + +- replace one instnace of an old-style raise statement +- define __div__ in terms of __truediv__ instead of the + other way around +- make wording match on an exception message + +----------------------------------- +[http://svn.python.org/view?rev=62686&view=rev r62686] | mark.dickinson | 2008-05-03 22:25:46 -0400 (Sat, 03 May 2008) | 4 lines +Changed paths: + M /python/trunk/Lib/decimal.py + +Make sure that Context traps and flags dictionaries have values 0 and 1 +(as documented) rather than True and False. + + +----------------------------------- +[http://svn.python.org/view?rev=62700&view=rev r62700] | gerhard.haering | 2008-05-04 08:59:57 -0400 (Sun, 04 May 2008) | 3 lines +Changed paths: + M /python/trunk/Modules/_sqlite/statement.c + +SQLite requires 64-bit integers in order to build. So the whole HAVE_LONG_LONG +#ifdefing was useless. + +----------------------------------- +[http://svn.python.org/view?rev=62701&view=rev r62701] | gerhard.haering | 2008-05-04 09:15:12 -0400 (Sun, 04 May 2008) | 3 lines +Changed paths: + M /python/trunk/Lib/sqlite3/test/factory.py + M /python/trunk/Modules/_sqlite/row.c + +Applied sqliterow-richcmp.diff patch from Thomas Heller in Issue2152. The +sqlite3.Row type is now correctly hashable. + +----------------------------------- +[http://svn.python.org/view?rev=62713&view=rev r62713] | georg.brandl | 2008-05-04 17:40:44 -0400 (Sun, 04 May 2008) | 2 lines +Changed paths: + M /python/trunk/Lib/urllib2.py + +#2695: Do case-insensitive check for algorithms. + +----------------------------------- +[http://svn.python.org/view?rev=62720&view=rev r62720] | brett.cannon | 2008-05-05 01:32:07 -0400 (Mon, 05 May 2008) | 3 lines +Changed paths: + M /python/trunk/Doc/library/warnings.rst + M /python/trunk/Lib/test/test_warnings.py + M /python/trunk/Lib/warnings.py + M /python/trunk/Misc/NEWS + M /python/trunk/Python/_warnings.c + +Add a DeprecationWarning for when warnings.showwarning() is set to a function +that lacks support for the new 'line' argument. + +----------------------------------- +[http://svn.python.org/view?rev=62724&view=rev r62724] | martin.v.loewis | 2008-05-05 13:16:58 -0400 (Mon, 05 May 2008) | 2 lines +Changed paths: + M /python/trunk/Lib/test/regrtest.py + M /python/trunk/Lib/test/test_zipfile.py + M /python/trunk/Lib/zipfile.py + M /python/trunk/Misc/NEWS + +Issue #1734346: Support Unicode file names for zipfiles. + +----------------------------------- +[http://svn.python.org/view?rev=62744&view=rev r62744] | gregory.p.smith | 2008-05-05 17:53:45 -0400 (Mon, 05 May 2008) | 13 lines +Changed paths: + M /python/trunk/Lib/socket.py + M /python/trunk/Lib/test/test_socket.py + +Fix a bug introduced in [http://svn.python.org/view?rev=62627&view=rev r62627]. see issue2760 and issue2632. + +An assertion in readline() would fail as data was already in the +internal buffer even though the socket was in unbuffered read mode. +That case is now handled. More importantly, read() has been fixed to +not over-recv() and leave newly recv()d data in the _fileobject buffer. + +The max() vs min() issue in read() is now gone. Neither was correct. +On bounded reads, always ask recv() for the exact amount of data we +still need. + +Candidate for backporting to release25-maint along with [http://svn.python.org/view?rev=62627&view=rev r62627]. + +----------------------------------- +[http://svn.python.org/view?rev=62749&view=rev r62749] | brett.cannon | 2008-05-06 00:37:31 -0400 (Tue, 06 May 2008) | 3 lines +Changed paths: + M /python/trunk/Lib/test/test_warnings.py + M /python/trunk/Python/_warnings.c + +Fix a bug in the handling of the stacklevel argument in warnings.warn() where +the stack was being unwound by two levels instead of one each time. + +----------------------------------- +[http://svn.python.org/view?rev=62756&view=rev r62756] | gregory.p.smith | 2008-05-06 03:05:18 -0400 (Tue, 06 May 2008) | 2 lines +Changed paths: + M /python/trunk/Lib/os.py + +fix issue2707 - os.walk docstring example correctness typo. + +----------------------------------- +[http://svn.python.org/view?rev=62785&view=rev r62785] | benjamin.peterson | 2008-05-06 18:18:11 -0400 (Tue, 06 May 2008) | 2 lines +Changed paths: + M /python/trunk/Lib/test/test_warnings.py + M /python/trunk/Python/_warnings.c + +Fix logic error in Python/_warnings.c and add a test to verify + +----------------------------------- +[http://svn.python.org/view?rev=62787&view=rev r62787] | benjamin.peterson | 2008-05-06 18:31:52 -0400 (Tue, 06 May 2008) | 2 lines +Changed paths: + M /python/trunk/Lib/warnings.py + +Make the Python implementation of warnings compatible with the C implementation regarding non-callable showwarning + +----------------------------------- +[http://svn.python.org/view?rev=62805&view=rev r62805] | christian.heimes | 2008-05-06 19:59:53 -0400 (Tue, 06 May 2008) | 1 line +Changed paths: + M /python/trunk/PCbuild/pcbuild.sln + +Re-added getbuildinfo.c solution item +----------------------------------- +[http://svn.python.org/view?rev=62842&view=rev r62842] | benjamin.peterson | 2008-05-07 19:11:54 -0400 (Wed, 07 May 2008) | 2 lines +Changed paths: + M /python/trunk/Lib/warnings.py + +Practice EAFP, and revert 62787 + +----------------------------------- +[http://svn.python.org/view?rev=62848&view=rev r62848] | raymond.hettinger | 2008-05-08 00:35:20 -0400 (Thu, 08 May 2008) | 1 line +Changed paths: + M /python/trunk/Objects/setobject.c + +Frozensets do not benefit from autoconversion. +----------------------------------- +[http://svn.python.org/view?rev=62849&view=rev r62849] | raymond.hettinger | 2008-05-08 00:36:12 -0400 (Thu, 08 May 2008) | 1 line +Changed paths: + M /python/trunk/Lib/fractions.py + +The __all__ variable forgot to expose the gcd() function. +----------------------------------- +[http://svn.python.org/view?rev=62854&view=rev r62854] | ronald.oussoren | 2008-05-08 06:34:39 -0400 (Thu, 08 May 2008) | 3 lines +Changed paths: + M /python/trunk/Lib/platform.py + +Fix for issue 1770190: platform.mac_ver() now returns the right +version on OSX 10.4.10 + +----------------------------------- +[http://svn.python.org/view?rev=62894&view=rev r62894] | brett.cannon | 2008-05-08 16:23:06 -0400 (Thu, 08 May 2008) | 4 lines +Changed paths: + M /python/trunk/Lib/test/test_sys.py + M /python/trunk/Python/sysmodule.c + +Fix sys.flags to properly expose bytes_warning. + +Closes issue #2790. + +----------------------------------- +[http://svn.python.org/view?rev=62895&view=rev r62895] | brett.cannon | 2008-05-08 16:23:54 -0400 (Thu, 08 May 2008) | 2 lines +Changed paths: + M /python/trunk/Misc/NEWS + +Add a missing entry on the fix for issue #2790. + +----------------------------------- +[http://svn.python.org/view?rev=62904&view=rev r62904] | benjamin.peterson | 2008-05-08 18:09:54 -0400 (Thu, 08 May 2008) | 2 lines +Changed paths: + M /python/trunk/Lib/distutils/archive_util.py + M /python/trunk/Lib/test/test_repr.py + +Replace instances of os.path.walk with os.walk + +----------------------------------- +[http://svn.python.org/view?rev=62934&view=rev r62934] | christian.heimes | 2008-05-09 08:19:09 -0400 (Fri, 09 May 2008) | 1 line +Changed paths: + M /python/trunk/Lib/distutils/command/build_ext.py + M /python/trunk/Lib/site.py + +Add --user option to build_ext +----------------------------------- +[http://svn.python.org/view?rev=62946&view=rev r62946] | martin.v.loewis | 2008-05-09 13:11:07 -0400 (Fri, 09 May 2008) | 1 line +Changed paths: + M /python/trunk/Tools/msi/uuids.py + +Add 2.6b1 and 2.6b2 UUIDs. +----------------------------------- +[http://svn.python.org/view?rev=62948&view=rev r62948] | mark.dickinson | 2008-05-09 13:54:23 -0400 (Fri, 09 May 2008) | 3 lines +Changed paths: + M /python/trunk/Lib/test/test_math.py + M /python/trunk/Misc/NEWS + M /python/trunk/Modules/mathmodule.c + +Issue #2487. math.ldexp(x, n) raised OverflowError when n was large and +negative; fix to return an (appropriately signed) zero instead. + +----------------------------------- +[http://svn.python.org/view?rev=62954&view=rev r62954] | martin.v.loewis | 2008-05-09 16:11:37 -0400 (Fri, 09 May 2008) | 1 line +Changed paths: + M /python/trunk/Tools/msi/msisupport.c + M /python/trunk/Tools/msi/msisupport.mak + +Port to VS 2008. Drop W9x support. +----------------------------------- +[http://svn.python.org/view?rev=62974&view=rev r62974] | brett.cannon | 2008-05-09 22:53:46 -0400 (Fri, 09 May 2008) | 2 lines +Changed paths: + M /python/trunk/Misc/NEWS + +Add an entry on the deprecation of Bastion and rexec. + +----------------------------------- +[http://svn.python.org/view?rev=62994&view=rev r62994] | andrew.kuchling | 2008-05-10 13:36:24 -0400 (Sat, 10 May 2008) | 1 line +Changed paths: + M /python/trunk/Lib/site.py + +Docstring typo +----------------------------------- +[http://svn.python.org/view?rev=63002&view=rev r63002] | brett.cannon | 2008-05-10 16:52:01 -0400 (Sat, 10 May 2008) | 2 lines +Changed paths: + M /python/trunk/Doc/distutils/packageindex.rst + M /python/trunk/Doc/distutils/uploading.rst + M /python/trunk/Lib/distutils/command/register.py + M /python/trunk/Lib/distutils/command/upload.py + M /python/trunk/Lib/distutils/core.py + M /python/trunk/Lib/distutils/dist.py + M /python/trunk/Lib/distutils/tests/test_dist.py + M /python/trunk/Misc/ACKS + M /python/trunk/Misc/NEWS + +Revert [http://svn.python.org/view?rev=62998&view=rev r62998] as it broke the build (seems distutils.config is missing). + +----------------------------------- +[http://svn.python.org/view?rev=63008&view=rev r63008] | brett.cannon | 2008-05-10 17:22:43 -0400 (Sat, 10 May 2008) | 2 lines +Changed paths: + M /python/trunk/Misc/NEWS + +Add an entry for the deprecation of the dl module. + +----------------------------------- +[http://svn.python.org/view?rev=63050&view=rev r63050] | georg.brandl | 2008-05-11 05:11:40 -0400 (Sun, 11 May 2008) | 2 lines +Changed paths: + M /python/trunk/Objects/stringobject.c + M /python/trunk/Objects/unicodeobject.c + +#2809: elaborate str.split docstring a bit. + +----------------------------------- +[http://svn.python.org/view?rev=63053&view=rev r63053] | georg.brandl | 2008-05-11 06:42:28 -0400 (Sun, 11 May 2008) | 2 lines +Changed paths: + M /python/trunk/Doc/library/textwrap.rst + M /python/trunk/Lib/test/test_textwrap.py + M /python/trunk/Lib/textwrap.py + M /python/trunk/Misc/NEWS + +#2659: add ``break_on_hyphens`` to TextWrapper. + +----------------------------------- +[http://svn.python.org/view?rev=63059&view=rev r63059] | andrew.kuchling | 2008-05-11 09:33:56 -0400 (Sun, 11 May 2008) | 2 lines +Changed paths: + M /python/trunk/Lib/test/test_marshal.py + M /python/trunk/Python/marshal.c + +#1792: Improve performance of marshal.dumps() on large objects by increasing +the size of the buffer more quickly. +----------------------------------- +[http://svn.python.org/view?rev=63062&view=rev r63062] | georg.brandl | 2008-05-11 10:17:13 -0400 (Sun, 11 May 2008) | 2 lines +Changed paths: + M /python/trunk/Doc/library/pdb.rst + M /python/trunk/Lib/pdb.doc + M /python/trunk/Misc/NEWS + +Add some sentence endings. + +----------------------------------- +[http://svn.python.org/view?rev=63067&view=rev r63067] | georg.brandl | 2008-05-11 11:05:13 -0400 (Sun, 11 May 2008) | 2 lines +Changed paths: + M /python/trunk/Doc/library/zipimport.rst + M /python/trunk/Lib/test/test_zipimport.py + M /python/trunk/Modules/zipimport.c + +#1326: document and test zipimporter.archive and zipimporter.prefix. + +----------------------------------- +[http://svn.python.org/view?rev=63068&view=rev r63068] | georg.brandl | 2008-05-11 11:07:39 -0400 (Sun, 11 May 2008) | 2 lines +Changed paths: + M /python/trunk/Lib/test/test_eof.py + M /python/trunk/Python/pythonrun.c + +#2816: clarify error messages for EOF while scanning strings. + +----------------------------------- +[http://svn.python.org/view?rev=63069&view=rev r63069] | georg.brandl | 2008-05-11 11:17:41 -0400 (Sun, 11 May 2008) | 3 lines +Changed paths: + M /python/trunk/Lib/unittest.py + +#2787: Flush stdout after writing test name, helpful when running +hanging or long-running tests. Patch by Adam Olsen. + +----------------------------------- +[http://svn.python.org/view?rev=63070&view=rev r63070] | georg.brandl | 2008-05-11 11:20:16 -0400 (Sun, 11 May 2008) | 3 lines +Changed paths: + M /python/trunk/Lib/sched.py + +#2803: fix wrong invocation of heappush in seldom-reached code. +Thanks to Matt Harden. + +----------------------------------- +[http://svn.python.org/view?rev=63076&view=rev r63076] | andrew.kuchling | 2008-05-11 15:15:52 -0400 (Sun, 11 May 2008) | 1 line +Changed paths: + M /python/trunk/Lib/distutils/tests/test_dist.py + +Add message to test assertion +----------------------------------- +[http://svn.python.org/view?rev=63083&view=rev r63083] | andrew.kuchling | 2008-05-11 16:08:33 -0400 (Sun, 11 May 2008) | 1 line +Changed paths: + M /python/trunk/Lib/distutils/tests/test_dist.py + +Try setting HOME env.var to fix test on Win32 +----------------------------------- +[http://svn.python.org/view?rev=63092&view=rev r63092] | georg.brandl | 2008-05-11 16:53:55 -0400 (Sun, 11 May 2008) | 2 lines +Changed paths: + M /python/trunk/Objects/stringobject.c + M /python/trunk/Objects/unicodeobject.c + +#2809 followup: even better split docstring. + +----------------------------------- +[http://svn.python.org/view?rev=63094&view=rev r63094] | georg.brandl | 2008-05-11 17:03:42 -0400 (Sun, 11 May 2008) | 4 lines +Changed paths: + M /python/trunk/Doc/library/rlcompleter.rst + M /python/trunk/Lib/rlcompleter.py + M /python/trunk/Misc/NEWS + +- #2250: Exceptions raised during evaluation of names in rlcompleter's + ``Completer.complete()`` method are now caught and ignored. + + +----------------------------------- +[http://svn.python.org/view?rev=63097&view=rev r63097] | georg.brandl | 2008-05-11 17:34:10 -0400 (Sun, 11 May 2008) | 2 lines +Changed paths: + M /python/trunk/Lib/lib-tk/Tkinter.py + +#2535: remove duplicated method. + +----------------------------------- +[http://svn.python.org/view?rev=63108&view=rev r63108] | brett.cannon | 2008-05-11 19:39:04 -0400 (Sun, 11 May 2008) | 2 lines +Changed paths: + M /python/trunk/Makefile.pre.in + M /python/trunk/Misc/NEWS + M /python/trunk/Modules/Setup.dist + +Put Lib/lib-old back on to sys.path for module renames. + +----------------------------------- +[http://svn.python.org/view?rev=63119&view=rev r63119] | benjamin.peterson | 2008-05-11 20:41:23 -0400 (Sun, 11 May 2008) | 2 lines +Changed paths: + M /python/trunk/Lib/test/test_builtin.py + M /python/trunk/Misc/NEWS + M /python/trunk/Python/bltinmodule.c + +#2196 hasattr now allows SystemExit and KeyboardInterrupt to propagate + +----------------------------------- +[http://svn.python.org/view?rev=63122&view=rev r63122] | benjamin.peterson | 2008-05-11 20:46:49 -0400 (Sun, 11 May 2008) | 2 lines +Changed paths: + M /python/trunk/Makefile.pre.in + +make message slightly more informative, so there's no chance of misunderstanding it + +----------------------------------- +[http://svn.python.org/view?rev=63132&view=rev r63132] | alexandre.vassalotti | 2008-05-11 22:11:22 -0400 (Sun, 11 May 2008) | 4 lines +Changed paths: + M /python/trunk/Doc/library/basehttpserver.rst + M /python/trunk/Doc/library/logging.rst + M /python/trunk/Doc/library/simplexmlrpcserver.rst + M /python/trunk/Doc/library/socket.rst + M /python/trunk/Doc/library/socketserver.rst + M /python/trunk/Lib/BaseHTTPServer.py + M /python/trunk/Lib/SimpleXMLRPCServer.py + M /python/trunk/Lib/idlelib/rpc.py + M /python/trunk/Lib/logging/config.py + M /python/trunk/Lib/test/test___all__.py + M /python/trunk/Lib/test/test_logging.py + M /python/trunk/Lib/test/test_socketserver.py + M /python/trunk/Lib/test/test_wsgiref.py + M /python/trunk/Misc/cheatsheet + +Updated all import statements to use the new socketserver module name. +Renamed socketserver module in its own documentation. +Renamed documentation references. + +----------------------------------- +[http://svn.python.org/view?rev=63158&view=rev r63158] | ronald.oussoren | 2008-05-12 07:24:33 -0400 (Mon, 12 May 2008) | 5 lines +Changed paths: + M /python/trunk/Lib/os.py + M /python/trunk/Lib/tempfile.py + +Remove references to platform 'mac' + +The 'mac' platform (that is, os.name == 'mac') was used for the MacOS 9 port, +which is no longer supported (as of Python 2.4 IIRC). + +----------------------------------- +[http://svn.python.org/view?rev=63159&view=rev r63159] | ronald.oussoren | 2008-05-12 07:31:05 -0400 (Mon, 12 May 2008) | 8 lines +Changed paths: + M /python/trunk/Lib/urllib.py + +MacOSX: remove dependency on Carbon package for urllib + +This patch removes the dependency on the Carbon package from urllib. +The mac-specific code for getting proxy configuration is now writting in +Python using ctypes and uses the SystemConfiguration framework instead of +InternetConfig. Also provides a mac-specific implementation of proxy_bypass. + + +----------------------------------- +[http://svn.python.org/view?rev=63164&view=rev r63164] | georg.brandl | 2008-05-12 12:26:52 -0400 (Mon, 12 May 2008) | 2 lines +Changed paths: + M /python/trunk/Doc/library/pprint.rst + M /python/trunk/Lib/pprint.py + M /python/trunk/Lib/test/test_pprint.py + M /python/trunk/Misc/NEWS + +#1713041: fix pprint's handling of maximum depth. + +----------------------------------- +[http://svn.python.org/view?rev=63173&view=rev r63173] | georg.brandl | 2008-05-12 13:01:58 -0400 (Mon, 12 May 2008) | 2 lines +Changed paths: + M /python/trunk/Lib/doctest.py + +#2766: remove code without effect. + +----------------------------------- +[http://svn.python.org/view?rev=63174&view=rev r63174] | georg.brandl | 2008-05-12 13:04:10 -0400 (Mon, 12 May 2008) | 3 lines +Changed paths: + M /python/trunk/Lib/doctest.py + +#2767: don't clear globs in run() call, since they could be needed in tearDown, +which clears them at the end. + +----------------------------------- +[http://svn.python.org/view?rev=63186&view=rev r63186] | amaury.forgeotdarc | 2008-05-12 17:30:24 -0400 (Mon, 12 May 2008) | 2 lines +Changed paths: + M /python/trunk/Misc/NEWS + M /python/trunk/PC/winsound.c + +Sync code with documentation, and remove Win95 support in winsound module. + +----------------------------------- +[http://svn.python.org/view?rev=63207&view=rev r63207] | jesus.cea | 2008-05-13 14:45:46 -0400 (Tue, 13 May 2008) | 1 line +Changed paths: + M /python/trunk/Misc/NEWS + M /python/trunk/Modules/_bsddb.c + M /python/trunk/Modules/bsddb.h + +bsddb module updated to version 4.6.4 +----------------------------------- +[http://svn.python.org/view?rev=63209&view=rev r63209] | marc-andre.lemburg | 2008-05-13 15:10:45 -0400 (Tue, 13 May 2008) | 3 lines +Changed paths: + M /python/trunk/Makefile.pre.in + +Remove leftovers from reverted setuptools checkin (they were added in r45525). + + +----------------------------------- +[http://svn.python.org/view?rev=63210&view=rev r63210] | jesus.cea | 2008-05-13 16:57:59 -0400 (Tue, 13 May 2008) | 1 line +Changed paths: + M /python/trunk/Lib/bsddb/__init__.py + M /python/trunk/Lib/bsddb/dbshelve.py + D /python/trunk/Lib/bsddb/test/test_1413192.py + M /python/trunk/Lib/bsddb/test/test_all.py + M /python/trunk/Lib/bsddb/test/test_associate.py + M /python/trunk/Lib/bsddb/test/test_basics.py + M /python/trunk/Lib/bsddb/test/test_compare.py + M /python/trunk/Lib/bsddb/test/test_compat.py + M /python/trunk/Lib/bsddb/test/test_cursor_pget_bug.py + M /python/trunk/Lib/bsddb/test/test_dbobj.py + M /python/trunk/Lib/bsddb/test/test_dbshelve.py + M /python/trunk/Lib/bsddb/test/test_dbtables.py + A /python/trunk/Lib/bsddb/test/test_distributed_transactions.py + A /python/trunk/Lib/bsddb/test/test_early_close.py + D /python/trunk/Lib/bsddb/test/test_env_close.py + M /python/trunk/Lib/bsddb/test/test_get_none.py + M /python/trunk/Lib/bsddb/test/test_join.py + M /python/trunk/Lib/bsddb/test/test_lock.py + M /python/trunk/Lib/bsddb/test/test_misc.py + M /python/trunk/Lib/bsddb/test/test_pickle.py + M /python/trunk/Lib/bsddb/test/test_queue.py + M /python/trunk/Lib/bsddb/test/test_recno.py + A /python/trunk/Lib/bsddb/test/test_replication.py + M /python/trunk/Lib/bsddb/test/test_sequence.py + M /python/trunk/Lib/bsddb/test/test_thread.py + +Testsuite for bsddb module, version 4.6.4 +----------------------------------- +[http://svn.python.org/view?rev=63211&view=rev r63211] | georg.brandl | 2008-05-13 17:32:03 -0400 (Tue, 13 May 2008) | 2 lines +Changed paths: + M /python/trunk/Python/_warnings.c + +Fix a refleak in the _warnings module. + +----------------------------------- +[http://svn.python.org/view?rev=63255&view=rev r63255] | alexandre.vassalotti | 2008-05-14 20:33:57 -0400 (Wed, 14 May 2008) | 6 lines +Changed paths: + M /python/trunk/Lib/distutils/command/upload.py + M /python/trunk/Lib/distutils/config.py + M /python/trunk/Lib/distutils/dist.py + +Revert distutils changes done in [http://svn.python.org/view?rev=63248&view=rev r63248]. + +As explained by Marc-Andre Lemburg, distutils needs to stay +backward-compatible. Therefore, it should use the old ConfigParser +module name. + +----------------------------------- +[http://svn.python.org/view?rev=63313&view=rev r63313] | gregory.p.smith | 2008-05-15 00:56:18 -0400 (Thu, 15 May 2008) | 5 lines +Changed paths: + M /python/trunk/Lib/bsddb/test/test_lock.py + +disable the crashing test. I will also file a bug. This crash does +not appear to be a new bug, its just that the test coverage went up +recently exposing it. (I verified that by testing this test code on +an older Modules/_bsddb.c) + +----------------------------------- +[http://svn.python.org/view?rev=63320&view=rev r63320] | georg.brandl | 2008-05-15 11:08:32 -0400 (Thu, 15 May 2008) | 2 lines +Changed paths: + M /python/trunk/Lib/test/test_generators.py + M /python/trunk/Lib/test/test_genexps.py + M /python/trunk/Misc/NEWS + M /python/trunk/Objects/genobject.c + +#2863: add gen.__name__ and add this name to generator repr(). + +----------------------------------- +[http://svn.python.org/view?rev=63324&view=rev r63324] | andrew.kuchling | 2008-05-15 16:07:39 -0400 (Thu, 15 May 2008) | 1 line +Changed paths: + M /python/trunk/Lib/distutils/config.py + +Import class from distutils.cmd, not .core, to avoid circular import +----------------------------------- +[http://svn.python.org/view?rev=63364&view=rev r63364] | georg.brandl | 2008-05-16 05:34:48 -0400 (Fri, 16 May 2008) | 2 lines +Changed paths: + M /python/trunk/Lib/test/test_generators.py + M /python/trunk/Lib/test/test_genexps.py + M /python/trunk/Objects/genobject.c + +Make generator repr consistent with function and code object repr. + +----------------------------------- +[http://svn.python.org/view?rev=63366&view=rev r63366] | christian.heimes | 2008-05-16 06:23:31 -0400 (Fri, 16 May 2008) | 1 line +Changed paths: + M /python/trunk/Misc/NEWS + M /python/trunk/Modules/cmathmodule.c + +Fixed #2870: cmathmodule.c compile error +----------------------------------- +[http://svn.python.org/view?rev=63367&view=rev r63367] | christian.heimes | 2008-05-16 07:28:56 -0400 (Fri, 16 May 2008) | 1 line +Changed paths: + M /python/trunk/Modules/cmathmodule.c + +Following Amaury's advice +----------------------------------- +[http://svn.python.org/view?rev=63370&view=rev r63370] | georg.brandl | 2008-05-16 09:24:29 -0400 (Fri, 16 May 2008) | 2 lines +Changed paths: + M /python/trunk/Lib/test/test_enumerate.py + M /python/trunk/Objects/enumobject.c + +Don't allow keyword arguments to reversed(). + +----------------------------------- +[http://svn.python.org/view?rev=63396&view=rev r63396] | thomas.heller | 2008-05-16 16:19:07 -0400 (Fri, 16 May 2008) | 4 lines +Changed paths: + M /python/trunk/Lib/ctypes/test/test_loading.py + +Very simple test for ctypes.util.find_library on Windows. + + + +----------------------------------- +[http://svn.python.org/view?rev=63402&view=rev r63402] | raymond.hettinger | 2008-05-17 00:13:36 -0400 (Sat, 17 May 2008) | 1 line +Changed paths: + M /python/trunk/Lib/poplib.py + +Fix-up docstring +----------------------------------- +[http://svn.python.org/view?rev=63403&view=rev r63403] | gregory.p.smith | 2008-05-17 02:12:02 -0400 (Sat, 17 May 2008) | 4 lines +Changed paths: + M /python/trunk/Lib/bsddb/test/test_lock.py + M /python/trunk/Misc/NEWS + M /python/trunk/Modules/_bsddb.c + +issue2858: Fix potential memory corruption when bsddb.db.DBEnv.lock_get +and other bsddb.db object constructors raised an exception. +Debugging & patch by Neal Norowitz. + +----------------------------------- +[http://svn.python.org/view?rev=63408&view=rev r63408] | georg.brandl | 2008-05-17 11:07:03 -0400 (Sat, 17 May 2008) | 2 lines +Changed paths: + M /python/trunk/Lib/tkinter/filedialog.py + M /python/trunk/Lib/tkinter/simpledialog.py + +Tkinter rename: merge tkSimpleDialog and tkFileDialog into simpledialog and filedialog. + +----------------------------------- +[http://svn.python.org/view?rev=63409&view=rev r63409] | georg.brandl | 2008-05-17 11:21:58 -0400 (Sat, 17 May 2008) | 2 lines +Changed paths: + M /python/trunk/Lib/lib-tk/tkFileDialog.py + M /python/trunk/Lib/lib-tk/tkSimpleDialog.py + +Tkinter: make stub modules. + +----------------------------------- +[http://svn.python.org/view?rev=63410&view=rev r63410] | georg.brandl | 2008-05-17 11:30:35 -0400 (Sat, 17 May 2008) | 2 lines +Changed paths: + M /python/trunk/Lib/tkinter/simpledialog.py + +Move imports to file top. + +----------------------------------- +[http://svn.python.org/view?rev=63412&view=rev r63412] | georg.brandl | 2008-05-17 13:57:01 -0400 (Sat, 17 May 2008) | 2 lines +Changed paths: + M /python/trunk/Lib/tkinter/__init__.py + M /python/trunk/Misc/NEWS + +#961805: fix Edit.text_modified(). + +----------------------------------- +[http://svn.python.org/view?rev=63413&view=rev r63413] | georg.brandl | 2008-05-17 14:14:43 -0400 (Sat, 17 May 2008) | 2 lines +Changed paths: + M /python/trunk/Misc/NEWS + +Rewrap consistently to 70 chars, and standardize the way of referring to issues. + +----------------------------------- +[http://svn.python.org/view?rev=63414&view=rev r63414] | georg.brandl | 2008-05-17 14:15:24 -0400 (Sat, 17 May 2008) | 2 lines +Changed paths: + M /python/trunk/Lib/tkinter/simpledialog.py + +Really move the imports to the top this time. :) + +----------------------------------- +[http://svn.python.org/view?rev=63415&view=rev r63415] | georg.brandl | 2008-05-17 14:17:45 -0400 (Sat, 17 May 2008) | 3 lines +Changed paths: + M /python/trunk/Lib/tkinter/__init__.py + +Don't export a name "tkinter" from the "tkinter" package. +Else people doing "from tkinter import *" will get a nasty surprise. + +----------------------------------- +[http://svn.python.org/view?rev=63421&view=rev r63421] | georg.brandl | 2008-05-17 15:06:20 -0400 (Sat, 17 May 2008) | 2 lines +Changed paths: + M /python/trunk/Makefile.pre.in + +Add "tkinter" to the list of directories to install. + +----------------------------------- +[http://svn.python.org/view?rev=63422&view=rev r63422] | georg.brandl | 2008-05-17 15:14:23 -0400 (Sat, 17 May 2008) | 2 lines +Changed paths: + M /python/trunk/Misc/RPM/python-2.6.spec + M /python/trunk/PC/VS7.1/python.iss + M /python/trunk/PC/VS7.1/python20.wse + M /python/trunk/Tools/msi/msi.py + +Add new tkinter dir to various locations where lib-tk shows up. + +----------------------------------- +[http://svn.python.org/view?rev=63432&view=rev r63432] | fred.drake | 2008-05-17 17:14:05 -0400 (Sat, 17 May 2008) | 3 lines +Changed paths: + M /python/trunk/Doc/library/htmllib.rst + M /python/trunk/Doc/library/htmlparser.rst + M /python/trunk/Lib/html/parser.py + M /python/trunk/Lib/htmllib.py + M /python/trunk/Lib/test/test_codeccallbacks.py + M /python/trunk/Lib/test/test_multibytecodec_support.py + M /python/trunk/Lib/test/test_sundry.py + +update references and documentation for modules in the new html package +(http://bugs.python.org/issue2882) + +----------------------------------- +[http://svn.python.org/view?rev=63446&view=rev r63446] | georg.brandl | 2008-05-18 05:12:20 -0400 (Sun, 18 May 2008) | 2 lines +Changed paths: + M /python/trunk/Lib/BaseHTTPServer.py + A /python/trunk/Lib/test/test_httpservers.py + +GHOP #134, #171, #137: unit tests for the three HTTPServer modules. + +----------------------------------- +[http://svn.python.org/view?rev=63449&view=rev r63449] | georg.brandl | 2008-05-18 07:46:51 -0400 (Sun, 18 May 2008) | 2 lines +Changed paths: + M /python/trunk/Makefile.pre.in + M /python/trunk/README + +GHOP #217: add support for compiling Python with coverage checking enabled. + +----------------------------------- +[http://svn.python.org/view?rev=63452&view=rev r63452] | georg.brandl | 2008-05-18 09:34:06 -0400 (Sun, 18 May 2008) | 2 lines +Changed paths: + M /python/trunk/Misc/ACKS + +Add GHOP students. + +----------------------------------- +[http://svn.python.org/view?rev=63457&view=rev r63457] | ronald.oussoren | 2008-05-18 16:09:54 -0400 (Sun, 18 May 2008) | 9 lines +Changed paths: + M /python/trunk/Lib/urllib.py + +MacOSX: ctypes annotation in implementation of getproxies_macosx_sysconf + +getproxies_macosx_sysconf uses ctypes to call SystemConfiguration APIs. This +checkin adds ctypes annotation to specify the right argument types for the +API's that are used. + +This is needed to be able to use urllib on a 64-bit system, without +annotations you'd get a hard crash. + +----------------------------------- +[http://svn.python.org/view?rev=63458&view=rev r63458] | ronald.oussoren | 2008-05-18 16:47:13 -0400 (Sun, 18 May 2008) | 2 lines +Changed paths: + M /python/trunk/Mac/Modules/gestaltmodule.c + +Make gestaltmodule.c 64-bit safe. + +----------------------------------- +[http://svn.python.org/view?rev=63460&view=rev r63460] | ronald.oussoren | 2008-05-18 16:54:47 -0400 (Sun, 18 May 2008) | 6 lines +Changed paths: + M /python/trunk/Lib/platform.py + M /python/trunk/Lib/test/test_platform.py + +- Add unittests for platform.mac_ver (or rather, ensure that the unittest for + that function actually tests something on OSX). + +- Add documentation to platform.mac_ver that explains why the middle element + of the return value will not contain useful information. + +----------------------------------- +[http://svn.python.org/view?rev=63469&view=rev r63469] | jesus.cea | 2008-05-19 11:55:11 -0400 (Mon, 19 May 2008) | 1 line +Changed paths: + M /python/trunk/Lib/bsddb/test/test_sequence.py + +bsddb: Beware with sequence wrapping +----------------------------------- +[http://svn.python.org/view?rev=63470&view=rev r63470] | georg.brandl | 2008-05-19 12:47:25 -0400 (Mon, 19 May 2008) | 2 lines +Changed paths: + M /python/trunk/Misc/build.sh + +test_httpservers has unpredictable refcount behavior. + +----------------------------------- +[http://svn.python.org/view?rev=63480&view=rev r63480] | neal.norwitz | 2008-05-20 01:21:57 -0400 (Tue, 20 May 2008) | 1 line +Changed paths: + M /python/trunk/Makefile.pre.in + +Add html package so it gets installed and more tests work (from installed copy) +----------------------------------- +[http://svn.python.org/view?rev=63491&view=rev r63491] | georg.brandl | 2008-05-20 03:23:59 -0400 (Tue, 20 May 2008) | 2 lines +Changed paths: + M /python/trunk/Lib/lib-tk/Tkinter.py + +Remove debugging line. + +----------------------------------- +[http://svn.python.org/view?rev=63494&view=rev r63494] | georg.brandl | 2008-05-20 03:52:27 -0400 (Tue, 20 May 2008) | 2 lines +Changed paths: + M /python/trunk/Makefile.pre.in + +Remove directories that no longer exist. + +----------------------------------- +[http://svn.python.org/view?rev=63498&view=rev r63498] | martin.v.loewis | 2008-05-20 04:11:19 -0400 (Tue, 20 May 2008) | 2 lines +Changed paths: + M /python/trunk/Doc/library/sys.rst + M /python/trunk/Misc/NEWS + M /python/trunk/Python/sysmodule.c + +Patch #2488: Add sys.maxsize. + +----------------------------------- +[http://svn.python.org/view?rev=63499&view=rev r63499] | georg.brandl | 2008-05-20 04:25:48 -0400 (Tue, 20 May 2008) | 3 lines +Changed paths: + M /python/trunk/Doc/library/zipfile.rst + M /python/trunk/Lib/test/test_zipfile.py + M /python/trunk/Lib/zipfile.py + M /python/trunk/Misc/NEWS + +Patch #1775025: allow opening zipfile members via ZipInfo instances. +Patch by Graham Horler. + +----------------------------------- +[http://svn.python.org/view?rev=63500&view=rev r63500] | georg.brandl | 2008-05-20 04:40:43 -0400 (Tue, 20 May 2008) | 2 lines +Changed paths: + M /python/trunk/Lib/test/test_weakref.py + M /python/trunk/Misc/NEWS + M /python/trunk/Objects/weakrefobject.c + +#2592: delegate nb_index and the floor/truediv slots in weakref.proxy. + +----------------------------------- +[http://svn.python.org/view?rev=63501&view=rev r63501] | georg.brandl | 2008-05-20 04:48:34 -0400 (Tue, 20 May 2008) | 2 lines +Changed paths: + M /python/trunk/Lib/lib-tk/Tkinter.py + +#615772: raise a more explicit error from Tkinter.Misc.__contains__. + +----------------------------------- +[http://svn.python.org/view?rev=63507&view=rev r63507] | vinay.sajip | 2008-05-20 11:34:36 -0400 (Tue, 20 May 2008) | 1 line +Changed paths: + M /python/trunk/Lib/logging/handlers.py + +Fixed: #2914 (RFE for UTC support in TimedRotatingFileHandler) and #2929 (wrong filename used to delete old log files). +----------------------------------- +[http://svn.python.org/view?rev=63508&view=rev r63508] | vinay.sajip | 2008-05-20 11:37:22 -0400 (Tue, 20 May 2008) | 1 line +Changed paths: + M /python/trunk/Misc/NEWS + +Updated with fixes for #2914 and #2929. +----------------------------------- +[http://svn.python.org/view?rev=63511&view=rev r63511] | thomas.heller | 2008-05-20 15:53:47 -0400 (Tue, 20 May 2008) | 6 lines +Changed paths: + M /python/trunk/Modules/_ctypes/libffi/fficonfig.py.in + M /python/trunk/setup.py + +On HPUX, -fPIC must be used for linking. _ctypes now builds on HP-UX +IA64 and PA machines. + +The ctypes unittests work fine on the IA64, but dump core in +test_qsort on the PA. + +----------------------------------- +[http://svn.python.org/view?rev=63522&view=rev r63522] | thomas.heller | 2008-05-21 14:47:02 -0400 (Wed, 21 May 2008) | 2 lines +Changed paths: + M /python/trunk/Lib/ctypes/test/__init__.py + +The -x flag allows to exclude tests. + +----------------------------------- +[http://svn.python.org/view?rev=63523&view=rev r63523] | thomas.heller | 2008-05-21 15:47:44 -0400 (Wed, 21 May 2008) | 2 lines +Changed paths: + M /python/trunk/Lib/ctypes/test/__init__.py + M /python/trunk/Lib/ctypes/test/runtests.py + +Oops, get_tests may be called with 3 arguments. + +----------------------------------- +[http://svn.python.org/view?rev=63537&view=rev r63537] | jesus.cea | 2008-05-22 11:27:38 -0400 (Thu, 22 May 2008) | 1 line +Changed paths: + M /python/trunk/Lib/bsddb/db.py + M /python/trunk/Lib/bsddb/dbtables.py + M /python/trunk/Lib/bsddb/test/test_sequence.py + M /python/trunk/Misc/NEWS + M /python/trunk/Modules/_bsddb.c + M /python/trunk/Modules/bsddb.h + +bsddb module updated to version 4.7.0 +----------------------------------- +[http://svn.python.org/view?rev=63542&view=rev r63542] | mark.dickinson | 2008-05-22 21:35:30 -0400 (Thu, 22 May 2008) | 5 lines +Changed paths: + M /python/trunk/Misc/NEWS + M /python/trunk/Modules/mathmodule.c + +Issue #2819: Add math.sum, a function that sums a sequence of floats +efficiently but with no intermediate loss of precision. Based on +Raymond Hettinger's ASPN recipe. Thanks Jean Brouwers for the patch. + + +----------------------------------- +[http://svn.python.org/view?rev=63545&view=rev r63545] | mark.dickinson | 2008-05-23 00:22:50 -0400 (Fri, 23 May 2008) | 6 lines +Changed paths: + M /python/trunk/configure + M /python/trunk/configure.in + +Temporary checkin to get configure to report more +information about the processor on the Debian/alpha +buildbot. (I'm still trying to track down the cause +of the test_math failures for this machine.) This +checkin will be reverted within the next 48 hours. + +----------------------------------- +[http://svn.python.org/view?rev=63546&view=rev r63546] | raymond.hettinger | 2008-05-23 00:32:43 -0400 (Fri, 23 May 2008) | 1 line +Changed paths: + M /python/trunk/Modules/mathmodule.c + +Tweak the comments and formatting. +----------------------------------- +[http://svn.python.org/view?rev=63562&view=rev r63562] | martin.v.loewis | 2008-05-23 11:06:50 -0400 (Fri, 23 May 2008) | 2 lines +Changed paths: + M /python/trunk/Include/pyport.h + M /python/trunk/Misc/NEWS + M /python/trunk/Modules/_ctypes/libffi/configure + M /python/trunk/Modules/_ctypes/libffi/configure.ac + M /python/trunk/Modules/_ctypes/malloc_closure.c + M /python/trunk/configure + M /python/trunk/configure.in + M /python/trunk/pyconfig.h.in + M /python/trunk/setup.py + +Patch #1722225: Support QNX 6. + +----------------------------------- +[http://svn.python.org/view?rev=63563&view=rev r63563] | martin.v.loewis | 2008-05-23 11:18:28 -0400 (Fri, 23 May 2008) | 3 lines +Changed paths: + M /python/trunk/Lib/test/test_minidom.py + M /python/trunk/Lib/xml/dom/minidom.py + M /python/trunk/Misc/NEWS + +Issue #1390: Raise ValueError in toxml when an invalid comment would +otherwise be produced. + +----------------------------------- +[http://svn.python.org/view?rev=63568&view=rev r63568] | mark.dickinson | 2008-05-23 14:04:06 -0400 (Fri, 23 May 2008) | 2 lines +Changed paths: + M /python/trunk/configure + M /python/trunk/configure.in + +Revert temporary checkin in revision 63545. + +----------------------------------- +[http://svn.python.org/view?rev=63570&view=rev r63570] | trent.nelson | 2008-05-23 16:33:14 -0400 (Fri, 23 May 2008) | 1 line +Changed paths: + M /python/trunk/PCbuild/pyproject.vsprops + +Introduce a user macro named $(externalsDir), which should point to the root directory of where all the external sources should live. Developers can change this value if their external sources live elsewhere. The default of '..\..' matches the current status quo. +----------------------------------- +[http://svn.python.org/view?rev=63575&view=rev r63575] | martin.v.loewis | 2008-05-24 05:00:04 -0400 (Sat, 24 May 2008) | 3 lines +Changed paths: + M /python/trunk/Lib/distutils/config.py + +Use announce instead of print, to suppress output in +the testsuite. + +----------------------------------- +[http://svn.python.org/view?rev=63588&view=rev r63588] | guilherme.polo | 2008-05-24 14:24:49 -0400 (Sat, 24 May 2008) | 1 line +Changed paths: + M /python/trunk/Lib/lib-tk/tkMessageBox.py + +Fixed an import that remained from the lib-tk -> tkinter -> lib-tk renaming +----------------------------------- +[http://svn.python.org/view?rev=63598&view=rev r63598] | gregory.p.smith | 2008-05-24 23:13:41 -0400 (Sat, 24 May 2008) | 2 lines +Changed paths: + M /python/trunk/Lib/bsddb/test/test_replication.py + +Use test_support to get network ports to bind to. + +----------------------------------- +[http://svn.python.org/view?rev=63601&view=rev r63601] | gregory.p.smith | 2008-05-25 03:14:09 -0400 (Sun, 25 May 2008) | 7 lines +Changed paths: + M /python/trunk/Lib/bsddb/test/test_all.py + M /python/trunk/Lib/test/test_bsddb3.py + +* Give the test_bsddb3 tests a unique temporary directory to run their + stuff in and clean it up afterwards regardless of the result. +* Get rid of duplicate list of test modules to run, they're maintained + within test_all now. +* Print the BerkeleyDB version to stderr when running test_bsddb3 to + help buildbot problem diagnosis. + Added: sandbox/trunk/py2.5.3/4 ============================================================================== --- (empty file) +++ sandbox/trunk/py2.5.3/4 Wed Oct 8 14:16:10 2008 @@ -0,0 +1,1009 @@ +----------------------------------- +[http://svn.python.org/view?rev=63604&view=rev r63604] | gregory.p.smith | 2008-05-25 03:20:34 -0400 (Sun, 25 May 2008) | 3 lines +Changed paths: + M /python/trunk/setup.py + +print out information about which BerkeleyDB library was found by +setup.py to use to build the bsddb module. + +----------------------------------- +[http://svn.python.org/view?rev=63614&view=rev r63614] | georg.brandl | 2008-05-25 04:07:37 -0400 (Sun, 25 May 2008) | 2 lines +Changed paths: + M /python/trunk/Lib/gzip.py + M /python/trunk/Lib/test/test_gzip.py + M /python/trunk/Misc/NEWS + +#2959: allow multiple close() calls for GzipFile. + +----------------------------------- +[http://svn.python.org/view?rev=63617&view=rev r63617] | gregory.p.smith | 2008-05-25 04:28:29 -0400 (Sun, 25 May 2008) | 6 lines +Changed paths: + M /python/trunk/Lib/bsddb/__init__.py + M /python/trunk/Lib/test/test_bsddb.py + +Fix issue2669: bsddb simple/legacy interface iteration silently fails +when database changes size during iteration. + +It now behaves like a dictionary, the next attempt to get a value from +the iterator after the database has changed size will raise a RuntimeError. + +----------------------------------- +[http://svn.python.org/view?rev=63618&view=rev r63618] | gregory.p.smith | 2008-05-25 04:32:04 -0400 (Sun, 25 May 2008) | 2 lines +Changed paths: + M /python/trunk/Misc/NEWS + +note about [http://svn.python.org/view?rev=63617&view=rev r63617] + +----------------------------------- +[http://svn.python.org/view?rev=63625&view=rev r63625] | martin.v.loewis | 2008-05-25 07:56:23 -0400 (Sun, 25 May 2008) | 1 line +Changed paths: + M /python/trunk/Tools/msi/msi.py + +Include all licenses of the packages that we include. +----------------------------------- +[http://svn.python.org/view?rev=63638&view=rev r63638] | martin.v.loewis | 2008-05-25 12:37:34 -0400 (Sun, 25 May 2008) | 1 line +Changed paths: + M /python/trunk/Tools/msi/msi.py + M /python/trunk/Tools/msi/msilib.py + +Create grammar pickle files on installation; remove them on uninstallation. +----------------------------------- +[http://svn.python.org/view?rev=63670&view=rev r63670] | thomas.heller | 2008-05-26 07:42:40 -0400 (Mon, 26 May 2008) | 4 lines +Changed paths: + M /python/trunk/Lib/distutils/tests/test_build_ext.py + +On Windows, we must build a debug version iff running a debug build of +Python + + +----------------------------------- +[http://svn.python.org/view?rev=63678&view=rev r63678] | benjamin.peterson | 2008-05-26 09:01:25 -0400 (Mon, 26 May 2008) | 2 lines +Changed paths: + M /python/trunk/configure.in + +put a big note on configure.in asking people to run autoconf + +----------------------------------- +[http://svn.python.org/view?rev=63679&view=rev r63679] | christian.heimes | 2008-05-26 09:15:11 -0400 (Mon, 26 May 2008) | 1 line +Changed paths: + M /python/trunk/Misc/NEWS + +Updated NEWS +----------------------------------- +[http://svn.python.org/view?rev=63685&view=rev r63685] | christian.heimes | 2008-05-26 09:51:41 -0400 (Mon, 26 May 2008) | 2 lines +Changed paths: + M /python/trunk/PC/VC6/pythoncore.dsp + M /python/trunk/PC/VS7.1/pythoncore.vcproj + M /python/trunk/PC/VS8.0/_bsddb.vcproj + A /python/trunk/PC/VS8.0/_bsddb44.vcproj + M /python/trunk/PC/VS8.0/_elementtree.vcproj + A /python/trunk/PC/VS8.0/_hashlib.vcproj + M /python/trunk/PC/VS8.0/_sqlite3.vcproj + M /python/trunk/PC/VS8.0/_ssl.vcproj + M /python/trunk/PC/VS8.0/_tkinter.vcproj + M /python/trunk/PC/VS8.0/bdist_wininst.vcproj + M /python/trunk/PC/VS8.0/debug.vsprops + A /python/trunk/PC/VS8.0/kill_python.vcproj + M /python/trunk/PC/VS8.0/make_versioninfo.vcproj + M /python/trunk/PC/VS8.0/pcbuild.sln + M /python/trunk/PC/VS8.0/pyd.vsprops + M /python/trunk/PC/VS8.0/pyd_d.vsprops + M /python/trunk/PC/VS8.0/pyproject.vsprops + M /python/trunk/PC/VS8.0/python.vcproj + M /python/trunk/PC/VS8.0/pythoncore.vcproj + M /python/trunk/PC/VS8.0/release.vsprops + A /python/trunk/PC/VS8.0/sqlite3.vcproj + M /python/trunk/PC/VS8.0/x64.vsprops + +Used vs9to8.py to port all VS9.0 changes to 8.0 +Updated VS7.1 and VC6 project files +----------------------------------- +[http://svn.python.org/view?rev=63690&view=rev r63690] | benjamin.peterson | 2008-05-26 10:51:54 -0400 (Mon, 26 May 2008) | 2 lines +Changed paths: + M /python/trunk/configure.in + +fix typo (thank Georg) + +----------------------------------- +[http://svn.python.org/view?rev=63714&view=rev r63714] | gregory.p.smith | 2008-05-26 15:03:35 -0400 (Mon, 26 May 2008) | 2 lines +Changed paths: + M /python/trunk/Modules/_bsddb.c + +Define macros so that this still compiles on Python prior to [http://svn.python.org/view?rev=63675&view=rev r63675]. + +----------------------------------- +[http://svn.python.org/view?rev=63718&view=rev r63718] | gregory.p.smith | 2008-05-26 15:29:14 -0400 (Mon, 26 May 2008) | 3 lines +Changed paths: + M /python/trunk/setup.py + +Allow BerlekeyDB up through 4.7. I doubt any of our unixy buildbots even have +that installed yet but the module code supports it. + +----------------------------------- +[http://svn.python.org/view?rev=63724&view=rev r63724] | gregory.p.smith | 2008-05-26 16:22:14 -0400 (Mon, 26 May 2008) | 6 lines +Changed paths: + M /python/trunk/Lib/subprocess.py + M /python/trunk/Lib/test/test_subprocess.py + +Fixes issue2791: subprocess.Popen.communicate leaked a file descripton until +the last reference to the Popen instance was dropped. Adding explicit +close() calls fixes it. + +Candidate for backport to release25-maint. + +----------------------------------- +[http://svn.python.org/view?rev=63725&view=rev r63725] | benjamin.peterson | 2008-05-26 16:41:45 -0400 (Mon, 26 May 2008) | 2 lines +Changed paths: + M /python/trunk/Doc/library/commands.rst + M /python/trunk/Lib/commands.py + +take Brett's advice on a few warnings + +----------------------------------- +[http://svn.python.org/view?rev=63728&view=rev r63728] | gregory.p.smith | 2008-05-26 17:16:34 -0400 (Mon, 26 May 2008) | 4 lines +Changed paths: + M /python/trunk/Python/mysnprintf.c + +Fix issue2589: there was a potential integer overflow leading to +memory corruption on esoteric platforms and incorrect behavior on +normal platforms. + +----------------------------------- +[http://svn.python.org/view?rev=63734&view=rev r63734] | gregory.p.smith | 2008-05-26 18:07:28 -0400 (Mon, 26 May 2008) | 3 lines +Changed paths: + M /python/trunk/Python/mysnprintf.c + +Fix issue2588: Do not execute str[size-1] = '\0' when a 0 size is +passed in. (The assert won't prevent this in non-debug builds). + +----------------------------------- +[http://svn.python.org/view?rev=63736&view=rev r63736] | benjamin.peterson | 2008-05-26 21:18:39 -0400 (Mon, 26 May 2008) | 2 lines +Changed paths: + M /python/trunk/Lib/sre_parse.py + M /python/trunk/Lib/test/test_support.py + +remove some __getslice__ + +----------------------------------- +[http://svn.python.org/view?rev=63742&view=rev r63742] | gregory.p.smith | 2008-05-27 04:40:09 -0400 (Tue, 27 May 2008) | 3 lines +Changed paths: + M /python/trunk/setup.py + +Disable the use of BerkeleyDB 4.6 on platforms that appear to have +issues with it. + +----------------------------------- +[http://svn.python.org/view?rev=63744&view=rev r63744] | lars.gustaebel | 2008-05-27 08:39:23 -0400 (Tue, 27 May 2008) | 3 lines +Changed paths: + M /python/trunk/Lib/tarfile.py + M /python/trunk/Lib/test/test_tarfile.py + M /python/trunk/Misc/NEWS + +Do not close external file objects passed to tarfile.open(mode='w:bz2') +when the TarFile is closed. + +----------------------------------- +[http://svn.python.org/view?rev=63745&view=rev r63745] | jesus.cea | 2008-05-27 09:26:02 -0400 (Tue, 27 May 2008) | 1 line +Changed paths: + M /python/trunk/Lib/bsddb/test/test_all.py + M /python/trunk/Lib/test/test_bsddb3.py + +Better integration between Python testing and bsddb3 +----------------------------------- +[http://svn.python.org/view?rev=63755&view=rev r63755] | mark.hammond | 2008-05-27 21:54:55 -0400 (Tue, 27 May 2008) | 2 lines +Changed paths: + M /python/trunk/Lib/distutils/command/bdist_wininst.py + +bdist_wininst now works correctly when both --skip-build and --plat-name are specified. + +----------------------------------- +[http://svn.python.org/view?rev=63757&view=rev r63757] | georg.brandl | 2008-05-28 07:21:39 -0400 (Wed, 28 May 2008) | 2 lines +Changed paths: + M /python/trunk/Doc/c-api/type.rst + M /python/trunk/Include/object.h + M /python/trunk/Misc/NEWS + M /python/trunk/Objects/typeobject.c + +#2989: add PyType_Modified(). + +----------------------------------- +[http://svn.python.org/view?rev=63760&view=rev r63760] | georg.brandl | 2008-05-28 11:41:36 -0400 (Wed, 28 May 2008) | 2 lines +Changed paths: + M /python/trunk/Objects/typeobject.c + +#2990: prevent inconsistent state while updating method cache. + +----------------------------------- +[http://svn.python.org/view?rev=63776&view=rev r63776] | georg.brandl | 2008-05-29 03:18:49 -0400 (Thu, 29 May 2008) | 2 lines +Changed paths: + M /python/trunk/Lib/lib-tk/Tkinter.py + +#2906: accept lists for options, and some cosmetic fixes in Tkinter. + +----------------------------------- +[http://svn.python.org/view?rev=63782&view=rev r63782] | georg.brandl | 2008-05-29 03:45:26 -0400 (Thu, 29 May 2008) | 2 lines +Changed paths: + M /python/trunk/Lib/xmlrpclib.py + M /python/trunk/Misc/NEWS + +#2985: allow i8 in XMLRPC responses. + +----------------------------------- +[http://svn.python.org/view?rev=63784&view=rev r63784] | raymond.hettinger | 2008-05-29 04:38:23 -0400 (Thu, 29 May 2008) | 1 line +Changed paths: + M /python/trunk/Modules/mathmodule.c + +Fix two typos. +----------------------------------- +[http://svn.python.org/view?rev=63787&view=rev r63787] | georg.brandl | 2008-05-29 10:35:39 -0400 (Thu, 29 May 2008) | 2 lines +Changed paths: + M /python/trunk/Objects/typeobject.c + +Revert #2990 patch; it's not necessary as Armin showed. + +----------------------------------- +[http://svn.python.org/view?rev=63788&view=rev r63788] | facundo.batista | 2008-05-29 12:39:26 -0400 (Thu, 29 May 2008) | 6 lines +Changed paths: + M /python/trunk/Doc/library/ftplib.rst + M /python/trunk/Doc/library/httplib.rst + M /python/trunk/Doc/library/poplib.rst + M /python/trunk/Doc/library/smtplib.rst + M /python/trunk/Doc/library/socket.rst + M /python/trunk/Doc/library/telnetlib.rst + M /python/trunk/Doc/library/urllib2.rst + M /python/trunk/Lib/ftplib.py + M /python/trunk/Lib/httplib.py + M /python/trunk/Lib/poplib.py + M /python/trunk/Lib/smtplib.py + M /python/trunk/Lib/socket.py + M /python/trunk/Lib/telnetlib.py + M /python/trunk/Lib/test/test_ftplib.py + M /python/trunk/Lib/test/test_httplib.py + M /python/trunk/Lib/test/test_poplib.py + M /python/trunk/Lib/test/test_smtplib.py + M /python/trunk/Lib/test/test_socket.py + M /python/trunk/Lib/test/test_telnetlib.py + M /python/trunk/Lib/test/test_urllib.py + M /python/trunk/Lib/test/test_urllib2.py + M /python/trunk/Lib/test/test_urllib2net.py + M /python/trunk/Lib/urllib.py + M /python/trunk/Lib/urllib2.py + + +Fixed the semantic of timeout for socket.create_connection and +all the upper level libraries that use it, including urllib2. +Added and fixed some tests, and changed docs correspondingly. +Thanks to John J Lee for the patch and the pusing, :) + +----------------------------------- +[http://svn.python.org/view?rev=63791&view=rev r63791] | thomas.heller | 2008-05-29 15:18:12 -0400 (Thu, 29 May 2008) | 1 line +Changed paths: + M /python/trunk/Modules/_ctypes/_ctypes.c + +Fix compiler warning. +----------------------------------- +[http://svn.python.org/view?rev=63792&view=rev r63792] | thomas.heller | 2008-05-29 15:42:34 -0400 (Thu, 29 May 2008) | 1 line +Changed paths: + M /python/trunk/Lib/ctypes/test/test_pointers.py + M /python/trunk/Misc/NEWS + M /python/trunk/Modules/_ctypes/_ctypes.c + +ctypes NULL function pointers have a boolean False value now. +----------------------------------- +[http://svn.python.org/view?rev=63799&view=rev r63799] | brett.cannon | 2008-05-29 17:23:33 -0400 (Thu, 29 May 2008) | 1 line +Changed paths: + M /python/trunk/setup.py + +Turn off debugging output for building bsddb. +----------------------------------- +[http://svn.python.org/view?rev=63805&view=rev r63805] | raymond.hettinger | 2008-05-30 02:37:27 -0400 (Fri, 30 May 2008) | 1 line +Changed paths: + M /python/trunk/Python/bltinmodule.c + +Issue 2784: fix leaks in exception exit. +----------------------------------- +[http://svn.python.org/view?rev=63806&view=rev r63806] | raymond.hettinger | 2008-05-30 02:49:47 -0400 (Fri, 30 May 2008) | 1 line +Changed paths: + M /python/trunk/Objects/setobject.c + +Issue 2855: Fix obscure crasher by slowing down the entire module. Mimics what was done to dictionaries in r59223. +----------------------------------- +[http://svn.python.org/view?rev=63807&view=rev r63807] | raymond.hettinger | 2008-05-30 03:16:53 -0400 (Fri, 30 May 2008) | 1 line +Changed paths: + M /python/trunk/Lib/collections.py + +Issue 2903: Add __name__ in globals for namedtuple namespace. +----------------------------------- +[http://svn.python.org/view?rev=63808&view=rev r63808] | georg.brandl | 2008-05-30 03:54:16 -0400 (Fri, 30 May 2008) | 2 lines +Changed paths: + M /python/trunk/Objects/unicodeobject.c + +#2999: fix name of third parameter in unicode.replace()'s docstring. + +----------------------------------- +[http://svn.python.org/view?rev=63817&view=rev r63817] | raymond.hettinger | 2008-05-30 14:20:50 -0400 (Fri, 30 May 2008) | 8 lines +Changed paths: + M /python/trunk/Modules/mathmodule.c + +* Mark intermedidate computes values (hi, lo, yr) as volatile. +* Expand comments. +* Swap variable names in the sum_exact code so that x and y + are consistently chosen as the larger and smaller magnitude + values respectively. + + + +----------------------------------- +[http://svn.python.org/view?rev=63824&view=rev r63824] | marc-andre.lemburg | 2008-05-30 16:52:18 -0400 (Fri, 30 May 2008) | 5 lines +Changed paths: + M /python/trunk/Lib/locale.py + M /python/trunk/Misc/NEWS + +Update the locale module alias table. + +Closes #3011. + + +----------------------------------- +[http://svn.python.org/view?rev=63827&view=rev r63827] | raymond.hettinger | 2008-05-30 23:24:31 -0400 (Fri, 30 May 2008) | 1 line +Changed paths: + M /python/trunk/Lib/heapq.py + M /python/trunk/Misc/NEWS + M /python/trunk/Modules/_heapqmodule.c + +Implement heapq in terms of less-than (to match list.sort()). +----------------------------------- +[http://svn.python.org/view?rev=63828&view=rev r63828] | mark.hammond | 2008-05-31 01:11:07 -0400 (Sat, 31 May 2008) | 2 lines +Changed paths: + M /python/trunk/Lib/distutils/command/wininst-6.0.exe + M /python/trunk/Lib/distutils/command/wininst-7.1.exe + M /python/trunk/Lib/distutils/command/wininst-9.0-amd64.exe + M /python/trunk/Lib/distutils/command/wininst-9.0.exe + M /python/trunk/PC/bdist_wininst/install.c + +Fix bdist_wininst --user-access-control for win2k + +----------------------------------- +[http://svn.python.org/view?rev=63839&view=rev r63839] | gerhard.haering | 2008-05-31 17:33:27 -0400 (Sat, 31 May 2008) | 2 lines +Changed paths: + M /python/trunk/Lib/sqlite3/test/dbapi.py + M /python/trunk/Modules/_sqlite/cursor.c + M /python/trunk/Modules/_sqlite/cursor.h + +Fixed rowcount for SELECT statements. They're -1 now (again), for better DB-API 2.0 compliance. + +----------------------------------- +[http://svn.python.org/view?rev=63846&view=rev r63846] | martin.v.loewis | 2008-06-01 03:20:46 -0400 (Sun, 01 Jun 2008) | 2 lines +Changed paths: + M /python/trunk/Doc/c-api/file.rst + M /python/trunk/Doc/library/stdtypes.rst + M /python/trunk/Doc/using/cmdline.rst + M /python/trunk/Include/fileobject.h + M /python/trunk/Lib/test/test_sys.py + M /python/trunk/Misc/NEWS + M /python/trunk/Modules/main.c + M /python/trunk/Objects/fileobject.c + M /python/trunk/Python/pythonrun.c + M /python/trunk/Python/sysmodule.c + +New environment variable PYTHONIOENCODING. + +----------------------------------- +[http://svn.python.org/view?rev=63848&view=rev r63848] | martin.v.loewis | 2008-06-01 04:06:17 -0400 (Sun, 01 Jun 2008) | 2 lines +Changed paths: + M /python/trunk/Python/pythonrun.c + +Move sys_stream and sys_isatty out of the have-langinfo block. + +----------------------------------- +[http://svn.python.org/view?rev=63849&view=rev r63849] | martin.v.loewis | 2008-06-01 04:19:02 -0400 (Sun, 01 Jun 2008) | 2 lines +Changed paths: + M /python/trunk/Python/pythonrun.c + +Typo: encoding -> codeset. + +----------------------------------- +[http://svn.python.org/view?rev=63863&view=rev r63863] | benjamin.peterson | 2008-06-01 15:01:25 -0400 (Sun, 01 Jun 2008) | 2 lines +Changed paths: + M /python/trunk/Tools/README + M /python/trunk/Tools/bgen/README + +add a warning about bgen being removed + +----------------------------------- +[http://svn.python.org/view?rev=63865&view=rev r63865] | georg.brandl | 2008-06-01 15:24:36 -0400 (Sun, 01 Jun 2008) | 2 lines +Changed paths: + M /python/trunk/Tools/README + +Spaces vs. tabs. + +----------------------------------- +[http://svn.python.org/view?rev=63887&view=rev r63887] | gregory.p.smith | 2008-06-02 00:05:52 -0400 (Mon, 02 Jun 2008) | 4 lines +Changed paths: + M /python/trunk/Lib/test/test_datetime.py + M /python/trunk/Misc/NEWS + M /python/trunk/Modules/datetimemodule.c + +Fix issue 2782: be less strict about the format string type in strftime. +Accept unicode and anything else ParseTuple "s#" can deal with. This +matches the time.strftime behavior. + +----------------------------------- +[http://svn.python.org/view?rev=63888&view=rev r63888] | martin.v.loewis | 2008-06-02 04:40:06 -0400 (Mon, 02 Jun 2008) | 2 lines +Changed paths: + M /python/trunk/Doc/library/msilib.rst + M /python/trunk/Misc/NEWS + M /python/trunk/PC/_msi.c + +Patch #2125: Add GetInteger and GetString methods for +msilib.Record objects. +----------------------------------- +[http://svn.python.org/view?rev=63897&view=rev r63897] | thomas.heller | 2008-06-02 14:41:30 -0400 (Mon, 02 Jun 2008) | 1 line +Changed paths: + M /python/trunk/Modules/_ctypes/libffi/fficonfig.py.in + M /python/trunk/setup.py + +Fix misspelled sys.platform name and misspelled filename. +----------------------------------- +[http://svn.python.org/view?rev=63898&view=rev r63898] | thomas.heller | 2008-06-02 16:07:46 -0400 (Mon, 02 Jun 2008) | 1 line +Changed paths: + M /python/trunk/Lib/ctypes/test/__init__.py + +Fix the -x flag so that is does work. +----------------------------------- +[http://svn.python.org/view?rev=63899&view=rev r63899] | walter.doerwald | 2008-06-02 16:36:03 -0400 (Mon, 02 Jun 2008) | 3 lines +Changed paths: + M /python/trunk/Lib/test/test_unicodedata.py + M /python/trunk/Modules/unicodedata.c + +Change all functions that expect one unicode character to accept a pair of +surrogates in narrow builds. Fixes issue #1706460. + +----------------------------------- +[http://svn.python.org/view?rev=63914&view=rev r63914] | georg.brandl | 2008-06-03 06:23:15 -0400 (Tue, 03 Jun 2008) | 2 lines +Changed paths: + M /python/trunk/Lib/lib-tk/Tkinter.py + +Fix Tkinter sequence passing. #2906. + +----------------------------------- +[http://svn.python.org/view?rev=63929&view=rev r63929] | martin.v.loewis | 2008-06-04 02:29:55 -0400 (Wed, 04 Jun 2008) | 2 lines +Changed paths: + A /python/trunk/Demo/turtle + A /python/trunk/Demo/turtle/about_turtle.txt + A /python/trunk/Demo/turtle/about_turtledemo.txt + A /python/trunk/Demo/turtle/demohelp.txt + A /python/trunk/Demo/turtle/tdemo_I_dontlike_tiltdemo.py + A /python/trunk/Demo/turtle/tdemo_bytedesign.py + A /python/trunk/Demo/turtle/tdemo_chaos.py + A /python/trunk/Demo/turtle/tdemo_clock.py + A /python/trunk/Demo/turtle/tdemo_colormixer.py + A /python/trunk/Demo/turtle/tdemo_fractalcurves.py + A /python/trunk/Demo/turtle/tdemo_lindenmayer_indian.py + A /python/trunk/Demo/turtle/tdemo_minimal_hanoi.py + A /python/trunk/Demo/turtle/tdemo_paint.py + A /python/trunk/Demo/turtle/tdemo_peace.py + A /python/trunk/Demo/turtle/tdemo_penrose.py + A /python/trunk/Demo/turtle/tdemo_planet_and_moon.py + A /python/trunk/Demo/turtle/tdemo_tree.py + A /python/trunk/Demo/turtle/tdemo_wikipedia.py + A /python/trunk/Demo/turtle/tdemo_yinyang.py + A /python/trunk/Demo/turtle/turtle.cfg + A /python/trunk/Demo/turtle/turtleDemo.py + A /python/trunk/Demo/turtle/turtledemo_two_canvases.py + M /python/trunk/Doc/library/turtle.rst + M /python/trunk/Lib/lib-tk/turtle.py + M /python/trunk/Misc/ACKS + +Patch #1513695: New turtle module, with demos. + +----------------------------------- +[http://svn.python.org/view?rev=63942&view=rev r63942] | thomas.heller | 2008-06-04 14:59:03 -0400 (Wed, 04 Jun 2008) | 42 lines +Changed paths: + M /python/trunk/Lib/ctypes/__init__.py + A /python/trunk/Lib/ctypes/test/test_errno.py + M /python/trunk/Misc/NEWS + M /python/trunk/Modules/_ctypes/_ctypes.c + M /python/trunk/Modules/_ctypes/callbacks.c + M /python/trunk/Modules/_ctypes/callproc.c + M /python/trunk/Modules/_ctypes/ctypes.h + +Issue #1798: Add ctypes calling convention that allows safe access to +errno (and LastError, on Windows). + +ctypes maintains a module-global, but thread-local, variable that +contains an error number; called 'ctypes_errno' for this discussion. +This variable is a private copy of the systems 'errno' value; the copy +is swapped with the 'errno' variable on several occasions. + +Foreign functions created with CDLL(..., use_errno=True), when called, +swap the values just before the actual function call, and swapped +again immediately afterwards. The 'use_errno' parameter defaults to +False, in this case 'ctypes_errno' is not touched. + +The values are also swapped immeditately before and after ctypes +callback functions are called, if the callbacks are constructed using +the new optional use_errno parameter set to True: CFUNCTYPE(..., use_errno=TRUE) +or WINFUNCTYPE(..., use_errno=True). + +Two new ctypes functions are provided to access the 'ctypes_errno' +value from Python: + +- ctypes.set_errno(value) sets ctypes_errno to 'value', the previous + ctypes_errno value is returned. + +- ctypes.get_errno() returns the current ctypes_errno value. + +----------------------------------- +[http://svn.python.org/view?rev=63943&view=rev r63943] | thomas.heller | 2008-06-04 15:19:00 -0400 (Wed, 04 Jun 2008) | 1 line +Changed paths: + M /python/trunk/Modules/_ctypes/callproc.c + +Fix ctypes.set_errno for gcc. +----------------------------------- +[http://svn.python.org/view?rev=63945&view=rev r63945] | thomas.heller | 2008-06-04 16:22:05 -0400 (Wed, 04 Jun 2008) | 7 lines +Changed paths: + M /python/trunk/Lib/ctypes/__init__.py + D /python/trunk/Lib/ctypes/test/test_errno.py + M /python/trunk/Misc/NEWS + M /python/trunk/Modules/_ctypes/_ctypes.c + M /python/trunk/Modules/_ctypes/callbacks.c + M /python/trunk/Modules/_ctypes/callproc.c + M /python/trunk/Modules/_ctypes/ctypes.h + +Revert revisions 63943 and 63942 (Issue #1798: Add ctypes calling +convention that allows safe access to errno) + +This code does not yet work on OS X (__thread storage specifier not +available), so i needs a configure check plus a more portable +solution. + +----------------------------------- +[http://svn.python.org/view?rev=63948&view=rev r63948] | alexandre.vassalotti | 2008-06-04 16:41:44 -0400 (Wed, 04 Jun 2008) | 2 lines +Changed paths: + M /python/trunk/Lib/test/test_complex.py + M /python/trunk/Objects/complexobject.c + +Fixed complex.__getnewargs__() to not emit another complex object. + +----------------------------------- +[http://svn.python.org/view?rev=63955&view=rev r63955] | ronald.oussoren | 2008-06-05 08:58:24 -0400 (Thu, 05 Jun 2008) | 20 lines +Changed paths: + M /python/trunk/Doc/library/macos.rst + M /python/trunk/Include/Python.h + A /python/trunk/Include/pymacconfig.h + M /python/trunk/Include/pymactoolbox.h + M /python/trunk/Lib/distutils/sysconfig.py + M /python/trunk/Lib/distutils/unixccompiler.py + M /python/trunk/Lib/distutils/util.py + A /python/trunk/Lib/test/test_macos.py + M /python/trunk/Mac/IDLE/Makefile.in + M /python/trunk/Mac/IDLE/idlemain.py + M /python/trunk/Mac/Makefile.in + M /python/trunk/Mac/Modules/ColorPickermodule.c + M /python/trunk/Mac/Modules/MacOS.c + M /python/trunk/Mac/Modules/Nav.c + M /python/trunk/Mac/Modules/OSATerminology.c + M /python/trunk/Mac/Modules/ae/_AEmodule.c + M /python/trunk/Mac/Modules/app/_Appmodule.c + M /python/trunk/Mac/Modules/carbonevt/_CarbonEvtmodule.c + M /python/trunk/Mac/Modules/cg/_CGmodule.c + M /python/trunk/Mac/Modules/cm/_Cmmodule.c + M /python/trunk/Mac/Modules/ctl/_Ctlmodule.c + M /python/trunk/Mac/Modules/dlg/_Dlgmodule.c + M /python/trunk/Mac/Modules/drag/_Dragmodule.c + M /python/trunk/Mac/Modules/evt/_Evtmodule.c + M /python/trunk/Mac/Modules/file/_Filemodule.c + M /python/trunk/Mac/Modules/file/filesupport.py + M /python/trunk/Mac/Modules/fm/_Fmmodule.c + M /python/trunk/Mac/Modules/folder/_Foldermodule.c + M /python/trunk/Mac/Modules/help/_Helpmodule.c + M /python/trunk/Mac/Modules/ibcarbon/_IBCarbon.c + M /python/trunk/Mac/Modules/icn/_Icnmodule.c + M /python/trunk/Mac/Modules/launch/_Launchmodule.c + M /python/trunk/Mac/Modules/list/_Listmodule.c + M /python/trunk/Mac/Modules/menu/_Menumodule.c + M /python/trunk/Mac/Modules/mlte/_Mltemodule.c + M /python/trunk/Mac/Modules/qd/_Qdmodule.c + M /python/trunk/Mac/Modules/qdoffs/_Qdoffsmodule.c + M /python/trunk/Mac/Modules/qt/_Qtmodule.c + M /python/trunk/Mac/Modules/res/_Resmodule.c + M /python/trunk/Mac/Modules/scrap/_Scrapmodule.c + M /python/trunk/Mac/Modules/snd/_Sndmodule.c + M /python/trunk/Mac/Modules/te/_TEmodule.c + M /python/trunk/Mac/Modules/win/_Winmodule.c + M /python/trunk/Makefile.pre.in + M /python/trunk/Misc/NEWS + M /python/trunk/Modules/_ctypes/cfield.c + M /python/trunk/Modules/_ctypes/libffi_osx/x86/x86-darwin.S + M /python/trunk/Python/mactoolboxglue.c + M /python/trunk/configure + M /python/trunk/configure.in + M /python/trunk/pyconfig.h.in + M /python/trunk/setup.py + +MacOS X: Enable 4-way universal builds + +This patch adds a new configure argument on OSX: + --with-universal-archs=[32-bit|64-bit|all] + +When used with the --enable-universalsdk option this controls which +CPU architectures are includes in the framework. The default is 32-bit, +meaning i386 and ppc. The most useful alternative is 'all', which includes +all 4 CPU architectures supported by MacOS X (i386, ppc, x86_64 and ppc64). + +This includes limited support for the Carbon bindings in 64-bit mode as well, +limited because (a) I haven't done extensive testing and (b) a large portion +of the Carbon API's aren't available in 64-bit mode anyway. + +I've also duplicated a feature of Apple's build of python: setting the +environment variable 'ARCHFLAGS' controls the '-arch' flags used for building +extensions using distutils. + + + +----------------------------------- +[http://svn.python.org/view?rev=63961&view=rev r63961] | thomas.heller | 2008-06-05 13:29:38 -0400 (Thu, 05 Jun 2008) | 1 line +Changed paths: + M /python/trunk/Include/Python.h + +Fix preprocessor statement. +----------------------------------- +[http://svn.python.org/view?rev=63965&view=rev r63965] | benjamin.peterson | 2008-06-05 18:39:34 -0400 (Thu, 05 Jun 2008) | 2 lines +Changed paths: + M /python/trunk/Lib/tokenize.py + +use the more idomatic while True + +----------------------------------- +[http://svn.python.org/view?rev=63967&view=rev r63967] | benjamin.peterson | 2008-06-05 19:02:33 -0400 (Thu, 05 Jun 2008) | 2 lines +Changed paths: + M /python/trunk/Lib/tokenize.py + +revert 63965 for preformance reasons + +----------------------------------- +[http://svn.python.org/view?rev=63975&view=rev r63975] | neal.norwitz | 2008-06-06 00:47:01 -0400 (Fri, 06 Jun 2008) | 3 lines +Changed paths: + M /python/trunk/configure + M /python/trunk/configure.in + +Aldo Cortesi confirmed this is still needed for OpenBSD 4.2 and 4.3. +(I didn't regen configure, since I don't have a working autoconf.) + +----------------------------------- +[http://svn.python.org/view?rev=63977&view=rev r63977] | thomas.heller | 2008-06-06 04:33:46 -0400 (Fri, 06 Jun 2008) | 31 lines +Changed paths: + M /python/trunk/Lib/ctypes/__init__.py + A /python/trunk/Lib/ctypes/test/test_errno.py + M /python/trunk/Misc/NEWS + M /python/trunk/Modules/_ctypes/_ctypes.c + M /python/trunk/Modules/_ctypes/callbacks.c + M /python/trunk/Modules/_ctypes/callproc.c + M /python/trunk/Modules/_ctypes/ctypes.h + +Issue #1798: Add ctypes calling convention that allows safe access of errno. + +ctypes maintains thread-local storage that has space for two error +numbers: private copies of the system 'errno' value and, on Windows, +the system error code accessed by the GetLastError() and +SetLastError() api functions. + +Foreign functions created with CDLL(..., use_errno=True), when called, +swap the system 'errno' value with the private copy just before the +actual function call, and swapped again immediately afterwards. The +'use_errno' parameter defaults to False, in this case 'ctypes_errno' +is not touched. + +On Windows, foreign functions created with CDLL(..., +use_last_error=True) or WinDLL(..., use_last_error=True) swap the +system LastError value with the ctypes private copy. + +The values are also swapped immeditately before and after ctypes +callback functions are called, if the callbacks are constructed using +the new optional use_errno parameter set to True: CFUNCTYPE(..., +use_errno=TRUE) or WINFUNCTYPE(..., use_errno=True). + +New ctypes functions are provided to access the ctypes private copies +from Python: + +- ctypes.set_errno(value) and ctypes.set_last_error(value) store + 'value' in the private copy and returns the previous value. + +- ctypes.get_errno() and ctypes.get_last_error() returns the current + ctypes private copies value. + +----------------------------------- +[http://svn.python.org/view?rev=63988&view=rev r63988] | thomas.heller | 2008-06-06 14:37:55 -0400 (Fri, 06 Jun 2008) | 3 lines +Changed paths: + M /python/trunk/Modules/_ctypes/callproc.c + +Performance improvement: Use PyDict_Get/SetItem instead of +PyDict_Get/SetItemString. + +----------------------------------- +[http://svn.python.org/view?rev=63997&view=rev r63997] | ronald.oussoren | 2008-06-06 17:31:33 -0400 (Fri, 06 Jun 2008) | 2 lines +Changed paths: + M /python/trunk/Mac/Modules/MacOS.c + M /python/trunk/Mac/Modules/ae/_AEmodule.c + M /python/trunk/Mac/Modules/file/_Filemodule.c + M /python/trunk/configure + M /python/trunk/configure.in + M /python/trunk/pyconfig.h.in + +Fix build issue on OSX 10.4 + +----------------------------------- +[http://svn.python.org/view?rev=63998&view=rev r63998] | raymond.hettinger | 2008-06-06 17:47:51 -0400 (Fri, 06 Jun 2008) | 1 line +Changed paths: + M /python/trunk/Modules/_heapqmodule.c + +Issue 3501: Make heapq support both __le__ and __lt__. +----------------------------------- +[http://svn.python.org/view?rev=64002&view=rev r64002] | travis.oliphant | 2008-06-06 18:33:21 -0400 (Fri, 06 Jun 2008) | 1 line +Changed paths: + M /python/trunk/configure.in + +Add long double check support to configure test. +----------------------------------- +[http://svn.python.org/view?rev=64003&view=rev r64003] | travis.oliphant | 2008-06-06 18:39:47 -0400 (Fri, 06 Jun 2008) | 1 line +Changed paths: + M /python/trunk/Include/object.h + M /python/trunk/Modules/_ctypes/_ctypes.c + M /python/trunk/Objects/abstract.c + +Remove locking part of new buffer protocol. +----------------------------------- +[http://svn.python.org/view?rev=64014&view=rev r64014] | georg.brandl | 2008-06-07 11:59:10 -0400 (Sat, 07 Jun 2008) | 3 lines +Changed paths: + D /python/trunk/Doc/library/_ast.rst + M /python/trunk/Doc/library/inspect.rst + M /python/trunk/Doc/library/language.rst + M /python/trunk/Lib/inspect.py + M /python/trunk/Lib/test/test_ast.py + M /python/trunk/Lib/test/test_inspect.py + M /python/trunk/Misc/NEWS + +Factor out docstring dedenting from inspect.getdoc() into inspect.cleandoc() +to ease standalone use of the algorithm. + +----------------------------------- +[http://svn.python.org/view?rev=64015&view=rev r64015] | georg.brandl | 2008-06-07 12:04:01 -0400 (Sat, 07 Jun 2008) | 2 lines +Changed paths: + A /python/trunk/Doc/library/_ast.rst + M /python/trunk/Doc/library/language.rst + M /python/trunk/Lib/test/test_ast.py + +Revert unwanted changes. + +----------------------------------- +[http://svn.python.org/view?rev=64016&view=rev r64016] | georg.brandl | 2008-06-07 12:16:12 -0400 (Sat, 07 Jun 2008) | 2 lines +Changed paths: + M /python/trunk/Lib/UserDict.py + +Register IterableUserDict as a MutableMapping. + +----------------------------------- +[http://svn.python.org/view?rev=64047&view=rev r64047] | raymond.hettinger | 2008-06-08 21:28:30 -0400 (Sun, 08 Jun 2008) | 1 line +Changed paths: + M /python/trunk/Doc/library/collections.rst + M /python/trunk/Lib/collections.py + M /python/trunk/Lib/test/test_collections.py + +Issue3065: Fixed pickling of named tuples. Added tests. +----------------------------------- +[http://svn.python.org/view?rev=64050&view=rev r64050] | raymond.hettinger | 2008-06-09 02:54:45 -0400 (Mon, 09 Jun 2008) | 1 line +Changed paths: + M /python/trunk/Doc/library/math.rst + M /python/trunk/Lib/test/test_math.py + M /python/trunk/Misc/NEWS + M /python/trunk/Modules/mathmodule.c + +Issue #2138: Add math.factorial(). +----------------------------------- +[http://svn.python.org/view?rev=64051&view=rev r64051] | raymond.hettinger | 2008-06-09 04:33:37 -0400 (Mon, 09 Jun 2008) | 1 line +Changed paths: + M /python/trunk/Doc/library/stdtypes.rst + M /python/trunk/Lib/test/test_set.py + M /python/trunk/Misc/NEWS + M /python/trunk/Objects/setobject.c + +Let set.union() and set.update() accept multiple inputs. +----------------------------------- +[http://svn.python.org/view?rev=64052&view=rev r64052] | raymond.hettinger | 2008-06-09 05:29:17 -0400 (Mon, 09 Jun 2008) | 1 line +Changed paths: + M /python/trunk/Modules/mathmodule.c + +Address double-rounding scenarios by setting all variables to long doubles. +----------------------------------- +[http://svn.python.org/view?rev=64054&view=rev r64054] | raymond.hettinger | 2008-06-09 07:24:47 -0400 (Mon, 09 Jun 2008) | 1 line +Changed paths: + M /python/trunk/Modules/mathmodule.c + +Unhappy buildbots. Revert 64052. Long doubles have unexpected effects on some builds. +----------------------------------- +[http://svn.python.org/view?rev=64055&view=rev r64055] | raymond.hettinger | 2008-06-09 09:07:27 -0400 (Mon, 09 Jun 2008) | 1 line +Changed paths: + M /python/trunk/Doc/library/stdtypes.rst + M /python/trunk/Lib/test/test_set.py + M /python/trunk/Misc/NEWS + M /python/trunk/Objects/setobject.c + +Let set.intersection() and set.intersection_update() take multiple input arguments. +----------------------------------- +[http://svn.python.org/view?rev=64057&view=rev r64057] | alexandre.vassalotti | 2008-06-09 23:34:53 -0400 (Mon, 09 Jun 2008) | 2 lines +Changed paths: + M /python/trunk/Lib/test/test_xrange.py + M /python/trunk/Objects/rangeobject.c + +Issue 2582: Fix pickling of xrange objects. + +----------------------------------- +[http://svn.python.org/view?rev=64058&view=rev r64058] | alexandre.vassalotti | 2008-06-10 00:01:23 -0400 (Tue, 10 Jun 2008) | 3 lines +Changed paths: + M /python/trunk/Lib/test/test_xrange.py + M /python/trunk/Objects/rangeobject.c + +Added better pickling support to xrange objects. +Cleaned up the unit test. + +----------------------------------- +[http://svn.python.org/view?rev=64062&view=rev r64062] | josiah.carlson | 2008-06-10 01:00:08 -0400 (Tue, 10 Jun 2008) | 5 lines +Changed paths: + M /python/trunk/Doc/library/asynchat.rst + M /python/trunk/Doc/library/asyncore.rst + M /python/trunk/Lib/asynchat.py + M /python/trunk/Lib/asyncore.py + M /python/trunk/Lib/test/test_asyncore.py + +Applying updated patch from Issue 1736190, which addresses partial +issues in: 909005 and 17361001, as well as completely as possible issues +539444, 760475, 777588, 889153, 953599, 1025525, 1063924, and 658749. +This patch also includes doc and test updates as necessary. + +----------------------------------- +[http://svn.python.org/view?rev=64065&view=rev r64065] | raymond.hettinger | 2008-06-10 03:57:15 -0400 (Tue, 10 Jun 2008) | 1 line +Changed paths: + M /python/trunk/Misc/ACKS + +Add Arnaud for his efforts on multi-arg set operations. +----------------------------------- +[http://svn.python.org/view?rev=64066&view=rev r64066] | robert.schuppenies | 2008-06-10 06:10:31 -0400 (Tue, 10 Jun 2008) | 2 lines +Changed paths: + M /python/trunk/Lib/test/test_sys.py + M /python/trunk/Objects/unicodeobject.c + +Issue 3048: Fixed sys.getsizeof for unicode objects. + +----------------------------------- +[http://svn.python.org/view?rev=64067&view=rev r64067] | georg.brandl | 2008-06-10 08:46:39 -0400 (Tue, 10 Jun 2008) | 2 lines +Changed paths: + M /python/trunk/Modules/itertoolsmodule.c + +#2536: fix itertools.permutations and itertools.combinations docstrings. + +----------------------------------- +[http://svn.python.org/view?rev=64080&view=rev r64080] | josiah.carlson | 2008-06-10 11:58:19 -0400 (Tue, 10 Jun 2008) | 3 lines +Changed paths: + M /python/trunk/Lib/asyncore.py + M /python/trunk/Lib/test/test_asyncore.py + +Fixed test to reflect new filedispatcher semantics, as well as two +NameErrors pointed out by Giampaolo. + +----------------------------------- +[http://svn.python.org/view?rev=64101&view=rev r64101] | raymond.hettinger | 2008-06-10 20:44:47 -0400 (Tue, 10 Jun 2008) | 3 lines +Changed paths: + M /python/trunk/Lib/test/test_set.py + M /python/trunk/Objects/setobject.c + +Handle the case with zero arguments. + + +----------------------------------- +[http://svn.python.org/view?rev=64115&view=rev r64115] | raymond.hettinger | 2008-06-11 06:30:54 -0400 (Wed, 11 Jun 2008) | 1 line +Changed paths: + M /python/trunk/Doc/library/stdtypes.rst + M /python/trunk/Lib/test/test_set.py + M /python/trunk/Misc/NEWS + M /python/trunk/Objects/setobject.c + +Multi-arg form for set.difference() and set.difference_update(). +----------------------------------- +[http://svn.python.org/view?rev=64116&view=rev r64116] | raymond.hettinger | 2008-06-11 08:06:49 -0400 (Wed, 11 Jun 2008) | 1 line +Changed paths: + M /python/trunk/Modules/_heapqmodule.c + +Issue 3051: Let heapq work with either __lt__ or __le__. +----------------------------------- +[http://svn.python.org/view?rev=64118&view=rev r64118] | raymond.hettinger | 2008-06-11 08:39:09 -0400 (Wed, 11 Jun 2008) | 1 line +Changed paths: + M /python/trunk/Modules/_heapqmodule.c + +Optimize previous checkin for heapq. +----------------------------------- +[http://svn.python.org/view?rev=64128&view=rev r64128] | benjamin.peterson | 2008-06-11 13:50:00 -0400 (Wed, 11 Jun 2008) | 2 lines +Changed paths: + M /python/trunk/Doc/library/threading.rst + M /python/trunk/Lib/threading.py + M /python/trunk/Misc/NEWS + +add aliases to threading module + +----------------------------------- +[http://svn.python.org/view?rev=64132&view=rev r64132] | gregory.p.smith | 2008-06-11 14:00:52 -0400 (Wed, 11 Jun 2008) | 3 lines +Changed paths: + M /python/trunk/Include/Python.h + +Correct an incorrect comment about our #include of stddef.h. +(see Doug Evans' comment on python-dev 2008-06-10) + +----------------------------------- +[http://svn.python.org/view?rev=64133&view=rev r64133] | benjamin.peterson | 2008-06-11 14:02:31 -0400 (Wed, 11 Jun 2008) | 2 lines +Changed paths: + M /python/trunk/Lib/threading.py + +add old names back into __all__ + +----------------------------------- +[http://svn.python.org/view?rev=64150&view=rev r64150] | georg.brandl | 2008-06-11 16:28:06 -0400 (Wed, 11 Jun 2008) | 2 lines +Changed paths: + M /python/trunk/Misc/NEWS + +Can we agree to put dots at entry ends? Thanks. + +----------------------------------- +[http://svn.python.org/view?rev=64185&view=rev r64185] | martin.v.loewis | 2008-06-12 14:38:47 -0400 (Thu, 12 Jun 2008) | 1 line +Changed paths: + M /python/trunk/PCbuild/build_tkinter.py + +Switch to Tcl/Tk 8.5.2. +----------------------------------- +[http://svn.python.org/view?rev=64191&view=rev r64191] | martin.v.loewis | 2008-06-12 15:00:14 -0400 (Thu, 12 Jun 2008) | 1 line +Changed paths: + M /python/trunk/PCbuild/build_tkinter.py + +Revert bogus disabling of Tcl and Tk. +----------------------------------- +[http://svn.python.org/view?rev=64195&view=rev r64195] | martin.v.loewis | 2008-06-12 16:06:18 -0400 (Thu, 12 Jun 2008) | 1 line +Changed paths: + M /python/trunk/Tools/msi/msilib.py + +Support file names which include '+' (for Tk 8.5). +----------------------------------- +[http://svn.python.org/view?rev=64196&view=rev r64196] | martin.v.loewis | 2008-06-12 16:07:53 -0400 (Thu, 12 Jun 2008) | 1 line +Changed paths: + M /python/trunk/Tools/msi/msi.py + +Fix Tcl/Tk license file in tcl8*/tk8*, include Tix license. +----------------------------------- +[http://svn.python.org/view?rev=64197&view=rev r64197] | amaury.forgeotdarc | 2008-06-12 16:27:42 -0400 (Thu, 12 Jun 2008) | 3 lines +Changed paths: + M /python/trunk/PCbuild/pcbuild.sln + +It seems that my VS2008 Express does not include a project in the build configuration, +if its UUID has lowercase letters. + +----------------------------------- +[http://svn.python.org/view?rev=64202&view=rev r64202] | amaury.forgeotdarc | 2008-06-12 17:58:20 -0400 (Thu, 12 Jun 2008) | 5 lines +Changed paths: + M /python/trunk/PC/VS8.0/_bsddb.vcproj + M /python/trunk/PC/VS8.0/_bsddb44.vcproj + M /python/trunk/PC/VS8.0/_elementtree.vcproj + M /python/trunk/PC/VS8.0/_sqlite3.vcproj + A /python/trunk/PC/VS8.0/kill_python.c (from /python/trunk/PCbuild/kill_python.c:64196) + M /python/trunk/PC/VS8.0/make_versioninfo.vcproj + M /python/trunk/PC/VS8.0/pcbuild.sln + M /python/trunk/PC/VS8.0/pyproject.vsprops + M /python/trunk/PC/VS8.0/python.vcproj + M /python/trunk/PC/VS8.0/sqlite3.vcproj + M /python/trunk/PCbuild/_elementtree.vcproj + M /python/trunk/PCbuild/make_versioninfo.vcproj + M /python/trunk/PCbuild/python.vcproj + M /python/trunk/PCbuild/vs9to8.py + +Update VS8.0 build files, using the script vs9to8.py. + +Also remove references to odbc libraries, which are not shipped with vs2003 express. +(and certainly not useful) + Added: sandbox/trunk/py2.5.3/5 ============================================================================== --- (empty file) +++ sandbox/trunk/py2.5.3/5 Wed Oct 8 14:16:10 2008 @@ -0,0 +1,1004 @@ +----------------------------------- +[http://svn.python.org/view?rev=64214&view=rev r64214] | amaury.forgeotdarc | 2008-06-12 20:42:22 -0400 (Thu, 12 Jun 2008) | 6 lines +Changed paths: + M /python/trunk/Include/pythonrun.h + M /python/trunk/Modules/errnomodule.c + M /python/trunk/Modules/socketmodule.c + M /python/trunk/Modules/socketmodule.h + M /python/trunk/PC/VC6/_socket.dsp + M /python/trunk/PC/VC6/pythoncore.dsp + M /python/trunk/PC/msvcrtmodule.c + M /python/trunk/PC/pyconfig.h + +Restore support for Microsoft VC6 compiler. +Some functions in the msvcrt module are skipped, +and socket.ioctl is enabled only when using a more recent Platform SDK. + +(and yes, there are still companies that use a 10-years old compiler) + +----------------------------------- +[http://svn.python.org/view?rev=64219&view=rev r64219] | neal.norwitz | 2008-06-13 02:00:46 -0400 (Fri, 13 Jun 2008) | 1 line +Changed paths: + M /python/trunk/Modules/_ctypes/callproc.c + +Check for memory alloc failure +----------------------------------- +[http://svn.python.org/view?rev=64220&view=rev r64220] | neal.norwitz | 2008-06-13 02:02:26 -0400 (Fri, 13 Jun 2008) | 3 lines +Changed paths: + M /python/trunk/Modules/arraymodule.c + +Fix some memory dealloc problems when exceptions occur. +It caused: "Fatal Python error: UNREF invalid object" in the DoubleTest. + +----------------------------------- +[http://svn.python.org/view?rev=64226&view=rev r64226] | martin.v.loewis | 2008-06-13 03:47:47 -0400 (Fri, 13 Jun 2008) | 2 lines +Changed paths: + M /python/trunk/Modules/_collectionsmodule.c + M /python/trunk/Modules/_localemodule.c + M /python/trunk/Modules/_tkinter.c + M /python/trunk/Modules/arraymodule.c + M /python/trunk/Modules/unicodedata_db.h + M /python/trunk/Tools/unicode/makeunicodedata.py + +Make more symbols static. + +----------------------------------- +[http://svn.python.org/view?rev=64230&view=rev r64230] | robert.schuppenies | 2008-06-13 09:29:37 -0400 (Fri, 13 Jun 2008) | 2 lines +Changed paths: + M /python/trunk/Lib/test/test_sys.py + M /python/trunk/Objects/tupleobject.c + +Fixed: sys.getsizeof does not take the actual length of the tuples into account. + +----------------------------------- +[http://svn.python.org/view?rev=64233&view=rev r64233] | benjamin.peterson | 2008-06-13 11:11:50 -0400 (Fri, 13 Jun 2008) | 2 lines +Changed paths: + M /python/trunk/Lib/platform.py + M /python/trunk/Misc/ACKS + M /python/trunk/Misc/NEWS + +platform.uname now tries to fill empty values even when os.uname is present + +----------------------------------- +[http://svn.python.org/view?rev=64244&view=rev r64244] | martin.v.loewis | 2008-06-13 14:19:49 -0400 (Fri, 13 Jun 2008) | 1 line +Changed paths: + M /python/trunk/PCbuild/sqlite3.vcproj + +Update AMD64 build for amalgamated sqlite. +----------------------------------- +[http://svn.python.org/view?rev=64246&view=rev r64246] | martin.v.loewis | 2008-06-13 14:58:47 -0400 (Fri, 13 Jun 2008) | 2 lines +Changed paths: + M /python/trunk/Tools/msi/msi.py + +Pickup sqlite3.dll from binary directory. +Commit more often. +----------------------------------- +[http://svn.python.org/view?rev=64260&view=rev r64260] | martin.v.loewis | 2008-06-13 20:41:41 -0400 (Fri, 13 Jun 2008) | 2 lines +Changed paths: + M /python/trunk/Lib/email/test/data/msg_26.txt + +Revert eol-style to CRLF. + +----------------------------------- +[http://svn.python.org/view?rev=64262&view=rev r64262] | martin.v.loewis | 2008-06-13 21:50:46 -0400 (Fri, 13 Jun 2008) | 2 lines +Changed paths: + M /python/trunk/Tools/scripts/svneol.py + +Support subversion repositories of version 8. + +----------------------------------- +[http://svn.python.org/view?rev=64265&view=rev r64265] | martin.v.loewis | 2008-06-14 02:24:44 -0400 (Sat, 14 Jun 2008) | 2 lines +Changed paths: + M /python/trunk/Tools/scripts/svneol.py + +Conservatively restrict support to format 8 repositories. + +----------------------------------- +[http://svn.python.org/view?rev=64269&view=rev r64269] | amaury.forgeotdarc | 2008-06-14 04:36:07 -0400 (Sat, 14 Jun 2008) | 3 lines +Changed paths: + M /python/trunk/Modules/socketmodule.h + +on windows, [http://svn.python.org/view?rev=64214&view=rev r64214] broke compilation with some recent SDKs, +because IPPROTO_IPV6 may be an enumeration member... + +----------------------------------- +[http://svn.python.org/view?rev=64278&view=rev r64278] | martin.v.loewis | 2008-06-14 10:24:47 -0400 (Sat, 14 Jun 2008) | 2 lines +Changed paths: + M /python/trunk/Tools/msi/msilib.py + +Disable UAC by default. + +----------------------------------- +[http://svn.python.org/view?rev=64303&view=rev r64303] | raymond.hettinger | 2008-06-15 21:42:40 -0400 (Sun, 15 Jun 2008) | 1 line +Changed paths: + M /python/trunk/Misc/NEWS + M /python/trunk/Python/marshal.c + +Issue 3116: fix quadratic behavior in marshal.dumps(). +----------------------------------- +[http://svn.python.org/view?rev=64338&view=rev r64338] | vinay.sajip | 2008-06-17 07:02:14 -0400 (Tue, 17 Jun 2008) | 1 line +Changed paths: + M /python/trunk/Lib/logging/__init__.py + +Bug #3126: StreamHandler and FileHandler check before calling "flush" and "close" that the stream object has these, using hasattr (thanks to bobf for the patch). +----------------------------------- +[http://svn.python.org/view?rev=64339&view=rev r64339] | vinay.sajip | 2008-06-17 07:04:02 -0400 (Tue, 17 Jun 2008) | 1 line +Changed paths: + M /python/trunk/Misc/NEWS + +Updated with fix for #3126. +----------------------------------- +[http://svn.python.org/view?rev=64349&view=rev r64349] | mark.dickinson | 2008-06-17 17:16:55 -0400 (Tue, 17 Jun 2008) | 4 lines +Changed paths: + M /python/trunk/Modules/mathmodule.c + +Issue 3118: make test_math pass on Ubuntu/ia64. exp(-745.0) was raising +OverflowError incorrectly on this platform, presumably as a result of +the libm setting errno = ERANGE for this call. + +----------------------------------- +[http://svn.python.org/view?rev=64365&view=rev r64365] | raymond.hettinger | 2008-06-17 20:56:57 -0400 (Tue, 17 Jun 2008) | 1 line +Changed paths: + M /python/trunk/Modules/mathmodule.c + +Fix double decref. +----------------------------------- +[http://svn.python.org/view?rev=64406&view=rev r64406] | andrew.kuchling | 2008-06-19 10:02:30 -0400 (Thu, 19 Jun 2008) | 1 line +Changed paths: + M /python/trunk/Modules/_cursesmodule.c + +Only include update_lines_cols() function when it's actually going to be used +----------------------------------- +[http://svn.python.org/view?rev=64416&view=rev r64416] | vinay.sajip | 2008-06-19 18:40:17 -0400 (Thu, 19 Jun 2008) | 2 lines +Changed paths: + M /python/trunk/Lib/logging/config.py + +Bug #3136: fileConfig()'s disabling of old loggers is now conditional via an optional disable_existing_loggers parameter, but the default value is such that the old behaviour is preserved. +Thanks to Leandro Lucarella for the patch. +----------------------------------- +[http://svn.python.org/view?rev=64417&view=rev r64417] | vinay.sajip | 2008-06-19 18:41:08 -0400 (Thu, 19 Jun 2008) | 1 line +Changed paths: + M /python/trunk/Misc/NEWS + +Updated with fix for #3136. +----------------------------------- +[http://svn.python.org/view?rev=64421&view=rev r64421] | andrew.kuchling | 2008-06-19 22:11:42 -0400 (Thu, 19 Jun 2008) | 1 line +Changed paths: + M /python/trunk/Modules/mathmodule.c + +Fix comment typos +----------------------------------- +[http://svn.python.org/view?rev=64424&view=rev r64424] | raymond.hettinger | 2008-06-20 00:18:15 -0400 (Fri, 20 Jun 2008) | 1 line +Changed paths: + M /python/trunk/Include/object.h + M /python/trunk/Lib/test/test_sys.py + M /python/trunk/Misc/NEWS + M /python/trunk/Objects/intobject.c + M /python/trunk/Objects/longobject.c + M /python/trunk/Objects/typeobject.c + M /python/trunk/Python/bltinmodule.c + +Make bin() implementation parallel oct() and hex() so that int/long subclasses can override or so that other classes can support. +----------------------------------- +[http://svn.python.org/view?rev=64426&view=rev r64426] | mark.dickinson | 2008-06-20 10:53:43 -0400 (Fri, 20 Jun 2008) | 4 lines +Changed paths: + M /python/trunk/Lib/test/test_slice.py + M /python/trunk/Misc/NEWS + M /python/trunk/Objects/sliceobject.c + +Issue #3004: Minor fix to slice.indices(). slice(-10).indices(9) now +returns (0, 0, 1) instead of (0, -1, 1), and slice(None, 10, -1).indices(10) +returns (9, 9, -1) instead of (9, 10, -1). + +----------------------------------- +[http://svn.python.org/view?rev=64428&view=rev r64428] | mark.dickinson | 2008-06-20 11:26:19 -0400 (Fri, 20 Jun 2008) | 2 lines +Changed paths: + M /python/trunk/Modules/mathmodule.c + +Fix another typo in math_sum comment + +----------------------------------- +[http://svn.python.org/view?rev=64438&view=rev r64438] | raymond.hettinger | 2008-06-21 02:39:53 -0400 (Sat, 21 Jun 2008) | 1 line +Changed paths: + M /python/trunk/Lib/test/test_builtin.py + M /python/trunk/Misc/NEWS + M /python/trunk/Objects/floatobject.c + +Issue 3008: hex/oct/bin can show floats exactly. +----------------------------------- +[http://svn.python.org/view?rev=64439&view=rev r64439] | hyeshik.chang | 2008-06-21 07:15:30 -0400 (Sat, 21 Jun 2008) | 2 lines +Changed paths: + M /python/trunk/Objects/floatobject.c + +Fix build on FreeBSD gcc. + +----------------------------------- +[http://svn.python.org/view?rev=64441&view=rev r64441] | andrew.kuchling | 2008-06-21 09:47:20 -0400 (Sat, 21 Jun 2008) | 1 line +Changed paths: + M /python/trunk/Lib/fractions.py + M /python/trunk/Lib/test/test_fractions.py + +Use repr() for bad input strings; this makes the empty string or binary characters more visible +----------------------------------- +[http://svn.python.org/view?rev=64447&view=rev r64447] | facundo.batista | 2008-06-21 14:58:04 -0400 (Sat, 21 Jun 2008) | 6 lines +Changed paths: + M /python/trunk/Doc/library/cgi.rst + M /python/trunk/Lib/cgi.py + M /python/trunk/Lib/test/test_cgi.py + M /python/trunk/Misc/NEWS + + +Now a from submitted via POST that also has a query string +will contain both FieldStorage and MiniFieldStorage items. + +Fixes #1817. + +----------------------------------- +[http://svn.python.org/view?rev=64452&view=rev r64452] | facundo.batista | 2008-06-22 09:36:20 -0400 (Sun, 22 Jun 2008) | 5 lines +Changed paths: + M /python/trunk/Lib/test/test_posix.py + M /python/trunk/Misc/NEWS + M /python/trunk/Modules/posixmodule.c + + +Issue #2722. Now the char buffer to support the path string has +not fixed length, it mallocs memory if needed. As a result, we +don't have a maximum for the getcwd() method. + +----------------------------------- +[http://svn.python.org/view?rev=64453&view=rev r64453] | andrew.kuchling | 2008-06-22 09:39:11 -0400 (Sun, 22 Jun 2008) | 1 line +Changed paths: + M /python/trunk/Misc/NEWS + +Wording fix +----------------------------------- +[http://svn.python.org/view?rev=64455&view=rev r64455] | facundo.batista | 2008-06-22 11:27:10 -0400 (Sun, 22 Jun 2008) | 4 lines +Changed paths: + M /python/trunk/Modules/cPickle.c + + +Issue 3164. Small fix to don't repeat a comparation +without necessity. + +----------------------------------- +[http://svn.python.org/view?rev=64464&view=rev r64464] | georg.brandl | 2008-06-22 14:31:54 -0400 (Sun, 22 Jun 2008) | 2 lines +Changed paths: + M /python/trunk/Modules/_sqlite/module.c + +Expand docstrings of sqlite3 functions. + +----------------------------------- +[http://svn.python.org/view?rev=64471&view=rev r64471] | facundo.batista | 2008-06-22 19:19:14 -0400 (Sun, 22 Jun 2008) | 5 lines +Changed paths: + M /python/trunk/Lib/test/test_cpickle.py + M /python/trunk/Modules/cPickle.c + + +Fixing the problem stated in issue 2702 with the patch submitted +in the issue 3165. Now cPickle does not fails with uncontrolled +behaviour when pickling into a very deep nested structure. + +----------------------------------- +[http://svn.python.org/view?rev=64489&view=rev r64489] | thomas.heller | 2008-06-23 10:49:56 -0400 (Mon, 23 Jun 2008) | 2 lines +Changed paths: + M /python/trunk/Modules/cPickle.c + +Fix compilation on Windows. + +----------------------------------- +[http://svn.python.org/view?rev=64490&view=rev r64490] | thomas.heller | 2008-06-23 15:51:41 -0400 (Mon, 23 Jun 2008) | 1 line +Changed paths: + M /python/trunk/PCbuild/_ctypes.vcproj + +Include debug info when assembling win64.asm in a debug build. +----------------------------------- +[http://svn.python.org/view?rev=64516&view=rev r64516] | raymond.hettinger | 2008-06-24 18:46:07 -0400 (Tue, 24 Jun 2008) | 1 line +Changed paths: + M /python/trunk/Include/object.h + M /python/trunk/Lib/test/test_builtin.py + M /python/trunk/Lib/test/test_sys.py + M /python/trunk/Misc/NEWS + M /python/trunk/Objects/floatobject.c + M /python/trunk/Objects/intobject.c + M /python/trunk/Objects/longobject.c + M /python/trunk/Objects/typeobject.c + M /python/trunk/Python/bltinmodule.c + +Revert 64424, 64438, and 64439. +----------------------------------- +[http://svn.python.org/view?rev=64526&view=rev r64526] | mark.dickinson | 2008-06-25 11:29:32 -0400 (Wed, 25 Jun 2008) | 2 lines +Changed paths: + M /python/trunk/Mac/Makefile.in + +issue #3199: Fix typo in Mac/Makefile.in + +----------------------------------- +[http://svn.python.org/view?rev=64527&view=rev r64527] | facundo.batista | 2008-06-25 15:24:53 -0400 (Wed, 25 Jun 2008) | 9 lines +Changed paths: + M /python/trunk/Lib/test/test_cpickle.py + M /python/trunk/Modules/cPickle.c + + +Reverting the patch from #3165, as it broke other +behaviours. I left the original test commented out (note +that that test came from #2702, which seems to have a +problem in FreeBSD and Windows, but not in Linux). + +I included a new test, to watch over the now-broken +behaviour, I took it from #3179. + +----------------------------------- +[http://svn.python.org/view?rev=64533&view=rev r64533] | robert.schuppenies | 2008-06-26 11:20:35 -0400 (Thu, 26 Jun 2008) | 3 lines +Changed paths: + M /python/trunk/Lib/test/test_sys.py + M /python/trunk/Objects/dictobject.c + +Corrected inconsistencies in sizeof tests and addressed issue pointed +out by Jean Brouwers. + +----------------------------------- +[http://svn.python.org/view?rev=64549&view=rev r64549] | brett.cannon | 2008-06-26 20:31:13 -0400 (Thu, 26 Jun 2008) | 7 lines +Changed paths: + M /python/trunk/Lib/test/test_warnings.py + M /python/trunk/Lib/warnings.py + M /python/trunk/Misc/NEWS + M /python/trunk/Python/_warnings.c + +warnings.warn_explicit() did not have the proper TypeErrors in place to prevent +bus errors or SystemError being raised. As a side effect of fixing this, a bad +DECREF that could be triggered when 'message' and 'category' were both None was +fixed. + +Closes issue 3211. Thanks JP Calderone for the bug report. + +----------------------------------- +[http://svn.python.org/view?rev=64557&view=rev r64557] | mark.dickinson | 2008-06-27 06:11:52 -0400 (Fri, 27 Jun 2008) | 3 lines +Changed paths: + M /python/trunk/Lib/fractions.py + M /python/trunk/Lib/test/test_fractions.py + +Remove trailing 'L's from numerator and denominator in the +repr() of a Fraction instance. + +----------------------------------- +[http://svn.python.org/view?rev=64558&view=rev r64558] | mark.dickinson | 2008-06-27 07:03:21 -0400 (Fri, 27 Jun 2008) | 2 lines +Changed paths: + M /python/trunk/Misc/ACKS + +Add Jean Brouwers for his work on math.sum + +----------------------------------- +[http://svn.python.org/view?rev=64567&view=rev r64567] | mark.dickinson | 2008-06-27 18:20:14 -0400 (Fri, 27 Jun 2008) | 3 lines +Changed paths: + M /python/trunk/configure + M /python/trunk/configure.in + M /python/trunk/pyconfig.h.in + +Fix typo in configure.in, and propagate configure.in changes from [http://svn.python.org/view?rev=64002&view=rev r64002] +to configure and pyconfig.h.in. + +----------------------------------- +[http://svn.python.org/view?rev=64577&view=rev r64577] | raymond.hettinger | 2008-06-28 18:16:53 -0400 (Sat, 28 Jun 2008) | 1 line +Changed paths: + M /python/trunk/Objects/dictobject.c + +Issue 3230: Do not the set specific size macro. +----------------------------------- +[http://svn.python.org/view?rev=64592&view=rev r64592] | vinay.sajip | 2008-06-29 17:25:28 -0400 (Sun, 29 Jun 2008) | 2 lines +Changed paths: + M /python/trunk/Lib/logging/config.py + +Removed out-of-date comment in _install_handlers and +used issubclass in place of equality comparison of classes. +----------------------------------- +[http://svn.python.org/view?rev=64593&view=rev r64593] | vinay.sajip | 2008-06-29 17:27:15 -0400 (Sun, 29 Jun 2008) | 1 line +Changed paths: + M /python/trunk/Misc/NEWS + +Updated to reflect change in logging.config to remove out-of-date comment in _install_handlers and the use of issubclass in place of equality comparison of classes. +----------------------------------- +[http://svn.python.org/view?rev=64595&view=rev r64595] | facundo.batista | 2008-06-29 21:10:55 -0400 (Sun, 29 Jun 2008) | 3 lines +Changed paths: + M /python/trunk/Lib/test/test_cpickle.py + M /python/trunk/Modules/cPickle.c + + +Fix #2702, with a correct accounting of recursion. + +----------------------------------- +[http://svn.python.org/view?rev=64597&view=rev r64597] | martin.v.loewis | 2008-06-30 02:57:39 -0400 (Mon, 30 Jun 2008) | 1 line +Changed paths: + M /python/trunk/Misc/NEWS + M /python/trunk/PCbuild/sqlite3.vcproj + +Issue #3215: Build sqlite3 as sqlite3.dll, not sqlite3.pyd +----------------------------------- +[http://svn.python.org/view?rev=64622&view=rev r64622] | benjamin.peterson | 2008-07-01 15:34:52 -0400 (Tue, 01 Jul 2008) | 1 line +Changed paths: + M /python/trunk/Lib/test/test_syntax.py + M /python/trunk/Misc/NEWS + M /python/trunk/Python/ast.c + +#3219 repeated keyword arguments aren't allowed in function calls anymore +----------------------------------- +[http://svn.python.org/view?rev=64633&view=rev r64633] | amaury.forgeotdarc | 2008-07-01 16:38:04 -0400 (Tue, 01 Jul 2008) | 5 lines +Changed paths: + M /python/trunk/Lib/test/test_file.py + M /python/trunk/Misc/NEWS + M /python/trunk/Python/ceval.c + +#3242: fix a crash in "print", if sys.stdout is set to a custom object, +whose write() method installs another sys.stdout. + +Will backport. + +----------------------------------- +[http://svn.python.org/view?rev=64640&view=rev r64640] | georg.brandl | 2008-07-01 16:56:03 -0400 (Tue, 01 Jul 2008) | 2 lines +Changed paths: + M /python/trunk/Python/ceval.c + +Add a comment about incref'ing w. + +----------------------------------- +[http://svn.python.org/view?rev=64656&view=rev r64656] | nick.coghlan | 2008-07-02 09:09:19 -0400 (Wed, 02 Jul 2008) | 1 line +Changed paths: + M /python/trunk/Lib/pydoc.py + M /python/trunk/Lib/test/test_pydoc.py + M /python/trunk/Misc/NEWS + +Issue 3190: pydoc now hides module __package__ attributes +----------------------------------- +[http://svn.python.org/view?rev=64664&view=rev r64664] | facundo.batista | 2008-07-02 12:52:55 -0400 (Wed, 02 Jul 2008) | 4 lines +Changed paths: + M /python/trunk/Doc/library/rlcompleter.rst + M /python/trunk/Lib/rlcompleter.py + M /python/trunk/Misc/NEWS + + +Issue #449227: Now with the rlcompleter module, callable objects are +added a '(' when completed. + +----------------------------------- +[http://svn.python.org/view?rev=64688&view=rev r64688] | martin.v.loewis | 2008-07-03 08:51:14 -0400 (Thu, 03 Jul 2008) | 9 lines +Changed paths: + M /python/trunk/Doc/library/zipfile.rst + M /python/trunk/Lib/test/test_zipfile.py + M /python/trunk/Lib/test/test_zipfile64.py + M /python/trunk/Lib/zipfile.py + M /python/trunk/Misc/NEWS + +Patch #1622: Correct interpretation of various ZIP header fields. + +Also fixes +- Issue #1526: Allow more than 64k files to be added to Zip64 file. + +- Issue #1746: Correct handling of zipfile archive comments (previously + archives with comments over 4k were flagged as invalid). Allow writing + Zip files with archives by setting the 'comment' attribute of a ZipFile. + +----------------------------------- +[http://svn.python.org/view?rev=64719&view=rev r64719] | raymond.hettinger | 2008-07-04 22:11:55 -0400 (Fri, 04 Jul 2008) | 1 line +Changed paths: + M /python/trunk/Python/ceval.c + +Update comment on prediction macros. +----------------------------------- +[http://svn.python.org/view?rev=64721&view=rev r64721] | georg.brandl | 2008-07-05 06:07:18 -0400 (Sat, 05 Jul 2008) | 2 lines +Changed paths: + M /python/trunk/Python/pythonrun.c + +Fix tabs. + +----------------------------------- +[http://svn.python.org/view?rev=64729&view=rev r64729] | mark.dickinson | 2008-07-05 07:33:52 -0400 (Sat, 05 Jul 2008) | 5 lines +Changed paths: + M /python/trunk/Lib/test/test_float.py + M /python/trunk/Objects/floatobject.c + +Issue 3188: accept float('infinity') as well as float('inf'). This +makes the float constructor behave in the same way as specified +by various other language standards, including C99, IEEE 754r, +and the IBM Decimal standard. + +----------------------------------- +[http://svn.python.org/view?rev=64735&view=rev r64735] | mark.dickinson | 2008-07-05 11:25:48 -0400 (Sat, 05 Jul 2008) | 3 lines +Changed paths: + M /python/trunk/Modules/cmathmodule.c + +Minor rewrite of cmath_log to work around a Sun compiler bug. See issue +#3168. + +----------------------------------- +[http://svn.python.org/view?rev=64745&view=rev r64745] | facundo.batista | 2008-07-05 15:19:50 -0400 (Sat, 05 Jul 2008) | 3 lines +Changed paths: + M /python/trunk/Modules/timemodule.c + + +Issue 3289. Removed two lines that ended doing nothing. + +----------------------------------- +[http://svn.python.org/view?rev=64746&view=rev r64746] | facundo.batista | 2008-07-05 16:39:59 -0400 (Sat, 05 Jul 2008) | 4 lines +Changed paths: + M /python/trunk/Lib/curses/textpad.py + + +Issue #3239. Differentiate the ascii call from the curses one and +the builtin one. + +----------------------------------- +[http://svn.python.org/view?rev=64753&view=rev r64753] | gregory.p.smith | 2008-07-05 23:35:58 -0400 (Sat, 05 Jul 2008) | 4 lines +Changed paths: + M /python/trunk/Doc/c-api/float.rst + M /python/trunk/Doc/c-api/int.rst + M /python/trunk/Doc/library/gc.rst + M /python/trunk/Doc/library/sys.rst + M /python/trunk/Include/floatobject.h + M /python/trunk/Include/intobject.h + M /python/trunk/Misc/NEWS + M /python/trunk/Modules/gcmodule.c + M /python/trunk/Objects/floatobject.c + M /python/trunk/Objects/intobject.c + M /python/trunk/Python/sysmodule.c + +- Issue #2862: Make int and float freelist management consistent with other + freelists. Changes their CompactFreeList apis into ClearFreeList apis and + calls them via gc.collect(). + +----------------------------------- +[http://svn.python.org/view?rev=64756&view=rev r64756] | gregory.p.smith | 2008-07-06 03:16:40 -0400 (Sun, 06 Jul 2008) | 3 lines +Changed paths: + M /python/trunk/Lib/subprocess.py + M /python/trunk/Misc/NEWS + +- Issue #2113: Fix error in subprocess.Popen if the select system call is + interrupted by a signal. + +----------------------------------- +[http://svn.python.org/view?rev=64758&view=rev r64758] | gregory.p.smith | 2008-07-06 13:06:29 -0400 (Sun, 06 Jul 2008) | 2 lines +Changed paths: + M /python/trunk/Modules/_fileio.c + +fix issue3304 - remove an incorrect PyMem_Free in fileio_init + +----------------------------------- +[http://svn.python.org/view?rev=64767&view=rev r64767] | gregory.p.smith | 2008-07-07 00:31:58 -0400 (Mon, 07 Jul 2008) | 4 lines +Changed paths: + M /python/trunk/Lib/test/test_bz2.py + M /python/trunk/Misc/NEWS + M /python/trunk/Modules/bz2module.c + +- Issue #3309: Fix bz2.BZFile itererator to release its internal lock + properly when raising an exception due to the bz2file being closed. + Prevents a deadlock. + +----------------------------------- +[http://svn.python.org/view?rev=64768&view=rev r64768] | josiah.carlson | 2008-07-07 00:51:46 -0400 (Mon, 07 Jul 2008) | 2 lines +Changed paths: + M /python/trunk/Lib/asynchat.py + M /python/trunk/Lib/asyncore.py + M /python/trunk/Lib/test/test_asyncore.py + +Fixed bugs 760475, 953599, and 1519. + +----------------------------------- +[http://svn.python.org/view?rev=64769&view=rev r64769] | gregory.p.smith | 2008-07-07 00:54:31 -0400 (Mon, 07 Jul 2008) | 2 lines +Changed paths: + M /python/trunk/Modules/Setup.dist + +Add commented out #_sha256 and #_sha512 lines per issue 3183. + +----------------------------------- +[http://svn.python.org/view?rev=64771&view=rev r64771] | gregory.p.smith | 2008-07-07 01:09:12 -0400 (Mon, 07 Jul 2008) | 4 lines +Changed paths: + M /python/trunk/Lib/httplib.py + M /python/trunk/Misc/NEWS + +- Issue #3094: httplib.HTTPSConnection Host: headers no longer include the + redundant ":443" port number designation when the connection is using the + default https port (443). + +----------------------------------- +[http://svn.python.org/view?rev=64772&view=rev r64772] | skip.montanaro | 2008-07-07 07:16:14 -0400 (Mon, 07 Jul 2008) | 2 lines +Changed paths: + M /python/trunk/Objects/abstract.c + +Correct grammar. + +----------------------------------- +[http://svn.python.org/view?rev=64775&view=rev r64775] | facundo.batista | 2008-07-07 13:02:59 -0400 (Mon, 07 Jul 2008) | 3 lines +Changed paths: + M /python/trunk/Lib/test/test_audioop.py + M /python/trunk/Modules/audioop.c + + +Issue 3306. Better control for a lenght in findmax() function. + +----------------------------------- +[http://svn.python.org/view?rev=64791&view=rev r64791] | nick.coghlan | 2008-07-08 10:08:04 -0400 (Tue, 08 Jul 2008) | 1 line +Changed paths: + M /python/trunk/Lib/test/test_exceptions.py + M /python/trunk/Objects/exceptions.c + M /python/trunk/Objects/object.c + +Issue 2517: Allow unicode messages in Exceptions again by correctly bypassing the instance dictionary when looking up __unicode__ on new-style classes +----------------------------------- +[http://svn.python.org/view?rev=64793&view=rev r64793] | nick.coghlan | 2008-07-08 10:21:42 -0400 (Tue, 08 Jul 2008) | 1 line +Changed paths: + M /python/trunk/Misc/ACKS + M /python/trunk/Misc/NEWS + +Add missing NEWS and ACK entries for [http://svn.python.org/view?rev=64791&view=rev r64791] +----------------------------------- +[http://svn.python.org/view?rev=64835&view=rev r64835] | raymond.hettinger | 2008-07-10 05:31:08 -0400 (Thu, 10 Jul 2008) | 1 line +Changed paths: + M /python/trunk/Lib/fractions.py + M /python/trunk/Lib/test/test_fractions.py + +Issue 3287: Raise correct exception for float inputs. +----------------------------------- +[http://svn.python.org/view?rev=64836&view=rev r64836] | raymond.hettinger | 2008-07-10 06:28:41 -0400 (Thu, 10 Jul 2008) | 1 line +Changed paths: + M /python/trunk/Lib/fractions.py + +Use operator.index() instead of n.__index__(). +----------------------------------- +[http://svn.python.org/view?rev=64842&view=rev r64842] | robert.schuppenies | 2008-07-10 09:43:26 -0400 (Thu, 10 Jul 2008) | 2 lines +Changed paths: + M /python/trunk/Lib/test/test_sys.py + M /python/trunk/Python/sysmodule.c + +Fixed Issue3122 and extended sys.getsizeof tests for built-in types. + +----------------------------------- +[http://svn.python.org/view?rev=64845&view=rev r64845] | raymond.hettinger | 2008-07-10 10:03:19 -0400 (Thu, 10 Jul 2008) | 1 line +Changed paths: + M /python/trunk/Lib/bisect.py + M /python/trunk/Lib/test/test_bisect.py + M /python/trunk/Misc/NEWS + M /python/trunk/Modules/_bisectmodule.c + +Issue 3301: Bisect functions behaved badly when lo was negative. +----------------------------------- +[http://svn.python.org/view?rev=64846&view=rev r64846] | raymond.hettinger | 2008-07-10 10:34:57 -0400 (Thu, 10 Jul 2008) | 1 line +Changed paths: + M /python/trunk/Lib/fractions.py + M /python/trunk/Lib/test/test_fractions.py + M /python/trunk/Misc/NEWS + +Issue 3285: Fractions from_float() and from_decimal() accept Integral arguments. +----------------------------------- +[http://svn.python.org/view?rev=64849&view=rev r64849] | andrew.kuchling | 2008-07-10 10:43:31 -0400 (Thu, 10 Jul 2008) | 1 line +Changed paths: + M /python/trunk/Misc/NEWS + +Wording changes +----------------------------------- +[http://svn.python.org/view?rev=64854&view=rev r64854] | raymond.hettinger | 2008-07-10 11:37:08 -0400 (Thu, 10 Jul 2008) | 1 line +Changed paths: + M /python/trunk/Lib/optparse.py + +Clear the -3 warnings in optparse.py +----------------------------------- +[http://svn.python.org/view?rev=64855&view=rev r64855] | raymond.hettinger | 2008-07-10 12:06:41 -0400 (Thu, 10 Jul 2008) | 1 line +Changed paths: + M /python/trunk/Lib/unittest.py + +Suppress -3 warnings in unittest.py +----------------------------------- +[http://svn.python.org/view?rev=64856&view=rev r64856] | robert.schuppenies | 2008-07-10 13:13:55 -0400 (Thu, 10 Jul 2008) | 3 lines +Changed paths: + M /python/trunk/Doc/library/sys.rst + M /python/trunk/Lib/test/test_sys.py + M /python/trunk/Modules/_testcapimodule.c + M /python/trunk/Python/sysmodule.c + +Added garbage collector overhead and optional default return value to +sys.getsizeof. + +----------------------------------- +[http://svn.python.org/view?rev=64858&view=rev r64858] | brett.cannon | 2008-07-10 20:10:49 -0400 (Thu, 10 Jul 2008) | 2 lines +Changed paths: + M /python/trunk/Misc/NEWS + +Removal an invalid entry as the fixer for urllib is under active development. + +----------------------------------- +[http://svn.python.org/view?rev=64866&view=rev r64866] | brett.cannon | 2008-07-10 20:50:01 -0400 (Thu, 10 Jul 2008) | 1 line +Changed paths: + M /python/trunk/Misc/NEWS + +Fix a minor typo in the last entry made. +----------------------------------- +[http://svn.python.org/view?rev=64880&view=rev r64880] | amaury.forgeotdarc | 2008-07-11 17:28:25 -0400 (Fri, 11 Jul 2008) | 5 lines +Changed paths: + M /python/trunk/Lib/zipfile.py + +#3317 in zipfile module, restore the previous names of global variables: +some applications relied on them. + +Also remove duplicated lines. + +----------------------------------- +[http://svn.python.org/view?rev=64881&view=rev r64881] | amaury.forgeotdarc | 2008-07-11 17:45:06 -0400 (Fri, 11 Jul 2008) | 3 lines +Changed paths: + M /python/trunk/Include/traceback.h + M /python/trunk/Lib/test/test_traceback.py + M /python/trunk/Python/_warnings.c + M /python/trunk/Python/traceback.c + +#3342: In tracebacks, printed source lines were not indented since [http://svn.python.org/view?rev=62555&view=rev r62555]. +#3343: Py_DisplaySourceLine should be a private function. Rename it to _Py_DisplaySourceLine. + +----------------------------------- +[http://svn.python.org/view?rev=64882&view=rev r64882] | josiah.carlson | 2008-07-11 18:17:14 -0400 (Fri, 11 Jul 2008) | 2 lines +Changed paths: + M /python/trunk/Lib/asyncore.py + +Fix for the AttributeError in test_asynchat. + +----------------------------------- +[http://svn.python.org/view?rev=64888&view=rev r64888] | matthias.klose | 2008-07-12 03:51:48 -0400 (Sat, 12 Jul 2008) | 2 lines +Changed paths: + M /python/trunk/Tools/faqwiz/move-faqwiz.sh + +- Fix bashisms in Tools/faqwiz/move-faqwiz.sh + +----------------------------------- +[http://svn.python.org/view?rev=64901&view=rev r64901] | benjamin.peterson | 2008-07-12 19:41:19 -0400 (Sat, 12 Jul 2008) | 1 line +Changed paths: + M /python/trunk/Lib/robotparser.py + M /python/trunk/Misc/ACKS + +#1778443 robotparser fixes from Aristotelis Mikropoulos +----------------------------------- +[http://svn.python.org/view?rev=64903&view=rev r64903] | brett.cannon | 2008-07-12 21:15:07 -0400 (Sat, 12 Jul 2008) | 6 lines +Changed paths: + M /python/trunk/Lib/dummy_thread.py + M /python/trunk/Lib/test/test_dummy_thread.py + M /python/trunk/Misc/NEWS + +dummy_thread.acquire() would return None if no waitflag argument was given. It +should have returned True. + +Fixes issue #3339. Thanks, Henk Punt for the report and Andrii v. Mishkovskiyi +for attempting a patch. + +----------------------------------- +[http://svn.python.org/view?rev=64915&view=rev r64915] | nick.coghlan | 2008-07-13 10:52:36 -0400 (Sun, 13 Jul 2008) | 1 line +Changed paths: + M /python/trunk/Lib/test/test_import.py + M /python/trunk/Misc/NEWS + M /python/trunk/Python/import.c + +Fix issue 3221 by emitting a RuntimeWarning instead of raising SystemError when the parent module can't be found during an absolute import (likely due to non-PEP 361 aware code which sets a module level __package__ attribute) +----------------------------------- +[http://svn.python.org/view?rev=64927&view=rev r64927] | alexandre.vassalotti | 2008-07-13 16:42:44 -0400 (Sun, 13 Jul 2008) | 3 lines +Changed paths: + M /python/trunk/Include/object.h + +Issue #3274: Use a less common identifier for the temporary variable +in Py_CLEAR(). + +----------------------------------- +[http://svn.python.org/view?rev=64930&view=rev r64930] | alexandre.vassalotti | 2008-07-13 17:47:59 -0400 (Sun, 13 Jul 2008) | 3 lines +Changed paths: + M /python/trunk/Modules/_sqlite/connection.c + M /python/trunk/Modules/_sqlite/cursor.c + +Issue #3153: sqlite leaks on error. +Changed statements of the form Py_DECREF(obj), obj = 0 to Py_CLEAR(obj). + +----------------------------------- +[http://svn.python.org/view?rev=64944&view=rev r64944] | gregory.p.smith | 2008-07-14 02:06:48 -0400 (Mon, 14 Jul 2008) | 7 lines +Changed paths: + M /python/trunk/Modules/posixmodule.c + +Fix posix.fork1() / os.fork1() to only call PyOS_AfterFork() in the child +process rather than both parent and child. + +Does anyone actually use fork1()? It appears to be a Solaris thing +but if Python is built with pthreads on Solaris, fork1() and fork() +should be the same. + +----------------------------------- +[http://svn.python.org/view?rev=64962&view=rev r64962] | nick.coghlan | 2008-07-15 10:27:37 -0400 (Tue, 15 Jul 2008) | 1 line +Changed paths: + M /python/trunk/Include/object.h + M /python/trunk/Lib/UserString.py + M /python/trunk/Lib/decimal.py + M /python/trunk/Lib/sets.py + M /python/trunk/Lib/test/seq_tests.py + M /python/trunk/Lib/test/test_descr.py + M /python/trunk/Lib/test/test_hash.py + M /python/trunk/Lib/test/test_richcmp.py + M /python/trunk/Modules/_collectionsmodule.c + M /python/trunk/Objects/dictobject.c + M /python/trunk/Objects/listobject.c + M /python/trunk/Objects/object.c + M /python/trunk/Objects/setobject.c + M /python/trunk/Objects/typeobject.c + +Issue 2235: __hash__ is once again inherited by default, but inheritance can be blocked explicitly so that collections.Hashable remains meaningful +----------------------------------- +[http://svn.python.org/view?rev=64966&view=rev r64966] | nick.coghlan | 2008-07-15 11:40:22 -0400 (Tue, 15 Jul 2008) | 1 line +Changed paths: + M /python/trunk/Misc/NEWS + +Add missing NEWS entry for [http://svn.python.org/view?rev=64962&view=rev r64962] +----------------------------------- +[http://svn.python.org/view?rev=64968&view=rev r64968] | thomas.heller | 2008-07-15 13:03:08 -0400 (Tue, 15 Jul 2008) | 4 lines +Changed paths: + M /python/trunk/Lib/ctypes/test/test_pep3118.py + M /python/trunk/Modules/_ctypes/_ctypes.c + +Issue #3258: Fix an assertion error (in debug build) and a crash (in +release build) when the format string of a pointer to an incomplete +structure is created. + +----------------------------------- +[http://svn.python.org/view?rev=64971&view=rev r64971] | thomas.heller | 2008-07-15 13:19:50 -0400 (Tue, 15 Jul 2008) | 2 lines +Changed paths: + M /python/trunk/Misc/NEWS + +NEWS entry for #issue 3258. + +----------------------------------- +[http://svn.python.org/view?rev=64976&view=rev r64976] | thomas.heller | 2008-07-15 15:39:38 -0400 (Tue, 15 Jul 2008) | 3 lines +Changed paths: + M /python/trunk/Misc/NEWS + M /python/trunk/Modules/_ctypes/callproc.c + M /python/trunk/Modules/dlmodule.c + +Issue #3313: Contrary to the man page, a failed dlopen() call does not +always set a dlerror() message. + +----------------------------------- +[http://svn.python.org/view?rev=64977&view=rev r64977] | thomas.heller | 2008-07-15 15:44:25 -0400 (Tue, 15 Jul 2008) | 2 lines +Changed paths: + M /python/trunk/Misc/ACKS + +Add Victor Stinner, he provided the patch for issue #3313. + +----------------------------------- +[http://svn.python.org/view?rev=64979&view=rev r64979] | thomas.heller | 2008-07-15 16:18:46 -0400 (Tue, 15 Jul 2008) | 1 line +Changed paths: + M /python/trunk/Lib/ctypes/test/test_pep3118.py + +Fix test on 64-bit platforms. +----------------------------------- +[http://svn.python.org/view?rev=64983&view=rev r64983] | georg.brandl | 2008-07-15 20:00:04 -0400 (Tue, 15 Jul 2008) | 2 lines +Changed paths: + M /python/trunk/Misc/ACKS + +Keep sorted. + +----------------------------------- +[http://svn.python.org/view?rev=65005&view=rev r65005] | mark.dickinson | 2008-07-16 05:40:03 -0400 (Wed, 16 Jul 2008) | 2 lines +Changed paths: + M /python/trunk/Lib/test/test_compile.py + M /python/trunk/Misc/NEWS + M /python/trunk/Python/ast.c + +Issue #3360: Fix incorrect parsing of "020000000000.0". + +----------------------------------- +[http://svn.python.org/view?rev=65012&view=rev r65012] | jesse.noller | 2008-07-16 09:24:06 -0400 (Wed, 16 Jul 2008) | 2 lines +Changed paths: + M /python/trunk/Lib/distutils/unixccompiler.py + +Apply patch for issue 3090: ARCHFLAGS parsing incorrect + +----------------------------------- +[http://svn.python.org/view?rev=65032&view=rev r65032] | jesse.noller | 2008-07-16 16:03:47 -0400 (Wed, 16 Jul 2008) | 2 lines +Changed paths: + M /python/trunk/Lib/test/test_threading.py + M /python/trunk/Lib/threading.py + M /python/trunk/Python/ceval.c + +Apply patch for 874900: threading module can deadlock after fork + +----------------------------------- +[http://svn.python.org/view?rev=65033&view=rev r65033] | benjamin.peterson | 2008-07-16 16:17:04 -0400 (Wed, 16 Jul 2008) | 1 line +Changed paths: + M /python/trunk/configure + M /python/trunk/configure.in + +fix framework install on Mac 10.4 +----------------------------------- +[http://svn.python.org/view?rev=65035&view=rev r65035] | georg.brandl | 2008-07-16 17:19:28 -0400 (Wed, 16 Jul 2008) | 2 lines +Changed paths: + M /python/trunk/Lib/pydoc.py + +#3045: fix pydoc behavior for TEMP path with spaces. + +----------------------------------- +[http://svn.python.org/view?rev=65037&view=rev r65037] | georg.brandl | 2008-07-16 17:31:41 -0400 (Wed, 16 Jul 2008) | 2 lines +Changed paths: + M /python/trunk/Misc/NEWS + M /python/trunk/Modules/posixmodule.c + +#1608818: errno can get set by every call to readdir(). + +----------------------------------- +[http://svn.python.org/view?rev=65038&view=rev r65038] | georg.brandl | 2008-07-16 18:04:20 -0400 (Wed, 16 Jul 2008) | 2 lines +Changed paths: + M /python/trunk/Lib/test/test_multibytecodec.py + M /python/trunk/Modules/cjkcodecs/multibytecodec.c + +#3305: self->stream can be NULL. + +----------------------------------- +[http://svn.python.org/view?rev=65039&view=rev r65039] | georg.brandl | 2008-07-16 18:09:17 -0400 (Wed, 16 Jul 2008) | 2 lines +Changed paths: + M /python/trunk/Lib/CGIHTTPServer.py + +#3345: fix docstring. + +----------------------------------- +[http://svn.python.org/view?rev=65040&view=rev r65040] | georg.brandl | 2008-07-16 18:33:18 -0400 (Wed, 16 Jul 2008) | 2 lines +Changed paths: + M /python/trunk/Lib/sqlite3/test/regression.py + M /python/trunk/Misc/NEWS + M /python/trunk/Modules/_sqlite/connection.c + M /python/trunk/Modules/_sqlite/module.c + +#3312: fix two sqlite3 crashes. + +----------------------------------- +[http://svn.python.org/view?rev=65057&view=rev r65057] | gregory.p.smith | 2008-07-16 23:13:05 -0400 (Wed, 16 Jul 2008) | 2 lines +Changed paths: + M /python/trunk/Misc/NEWS + +news note for [http://svn.python.org/view?rev=63052&view=rev r63052] + +----------------------------------- +[http://svn.python.org/view?rev=65061&view=rev r65061] | benjamin.peterson | 2008-07-17 11:59:24 -0400 (Thu, 17 Jul 2008) | 1 line +Changed paths: + M /python/trunk/configure + M /python/trunk/configure.in + +#3381 fix framework builds on 10.4 +----------------------------------- +[http://svn.python.org/view?rev=65091&view=rev r65091] | ronald.oussoren | 2008-07-18 01:48:03 -0400 (Fri, 18 Jul 2008) | 2 lines +Changed paths: + M /python/trunk/Mac/IDLE/Makefile.in + +Last bit of a fix for issue3381 (addon for my patch in [http://svn.python.org/view?rev=65061&view=rev r65061]) + +----------------------------------- +[http://svn.python.org/view?rev=65092&view=rev r65092] | vinay.sajip | 2008-07-18 04:59:06 -0400 (Fri, 18 Jul 2008) | 1 line +Changed paths: + M /python/trunk/Lib/logging/config.py + +Issue #3389: Allow resolving dotted names for handlers in logging configuration files. Thanks to Philip Jenvey for the patch. +----------------------------------- +[http://svn.python.org/view?rev=65095&view=rev r65095] | vinay.sajip | 2008-07-18 05:01:10 -0400 (Fri, 18 Jul 2008) | 1 line +Changed paths: + M /python/trunk/Misc/NEWS + +Issue #3389: Allow resolving dotted names for handlers in logging configuration files. Thanks to Philip Jenvey for the patch. +----------------------------------- +[http://svn.python.org/view?rev=65109&view=rev r65109] | georg.brandl | 2008-07-18 15:06:13 -0400 (Fri, 18 Jul 2008) | 2 lines +Changed paths: + M /python/trunk/Demo/tkinter/guido/rmt.py + M /python/trunk/Lib/string.py + M /python/trunk/Lib/stringold.py + M /python/trunk/Lib/test/test_grp.py + M /python/trunk/Lib/test/test_pwd.py + +Replace all map(None, a) with list(a). + +----------------------------------- +[http://svn.python.org/view?rev=65111&view=rev r65111] | georg.brandl | 2008-07-18 15:30:10 -0400 (Fri, 18 Jul 2008) | 2 lines +Changed paths: + M /python/trunk/Lib/unittest.py + +#3390: replace a remaining has_key(). + +----------------------------------- +[http://svn.python.org/view?rev=65125&view=rev r65125] | eric.smith | 2008-07-18 20:24:05 -0400 (Fri, 18 Jul 2008) | 1 line +Changed paths: + M /python/trunk/Lib/test/test_types.py + M /python/trunk/Python/pystrtod.c + +Fix issue 3411: default float format spec fails on negative numbers. Added: sandbox/trunk/py2.5.3/6 ============================================================================== --- (empty file) +++ sandbox/trunk/py2.5.3/6 Wed Oct 8 14:16:10 2008 @@ -0,0 +1,1004 @@ +----------------------------------- +[http://svn.python.org/view?rev=65128&view=rev r65128] | raymond.hettinger | 2008-07-18 20:43:00 -0400 (Fri, 18 Jul 2008) | 1 line +Changed paths: + M /python/trunk/Doc/library/itertools.rst + M /python/trunk/Lib/test/test_itertools.py + +Add recipe to the itertools docs. +----------------------------------- +[http://svn.python.org/view?rev=65131&view=rev r65131] | georg.brandl | 2008-07-19 06:08:55 -0400 (Sat, 19 Jul 2008) | 2 lines +Changed paths: + M /python/trunk/Python/pythonrun.c + +#3378: in case of no memory, don't leak even more memory. :) + +----------------------------------- +[http://svn.python.org/view?rev=65133&view=rev r65133] | georg.brandl | 2008-07-19 08:39:10 -0400 (Sat, 19 Jul 2008) | 3 lines +Changed paths: + M /python/trunk/Misc/NEWS + M /python/trunk/Modules/_localemodule.c + +#3302: fix segfaults when passing None for arguments that can't +be NULL for the C functions. + +----------------------------------- +[http://svn.python.org/view?rev=65134&view=rev r65134] | georg.brandl | 2008-07-19 08:46:12 -0400 (Sat, 19 Jul 2008) | 2 lines +Changed paths: + M /python/trunk/Lib/test/test_locale.py + M /python/trunk/Misc/NEWS + M /python/trunk/Modules/_localemodule.c + +#3303: fix crash with invalid Py_DECREF in strcoll(). + +----------------------------------- +[http://svn.python.org/view?rev=65149&view=rev r65149] | raymond.hettinger | 2008-07-19 19:21:57 -0400 (Sat, 19 Jul 2008) | 1 line +Changed paths: + M /python/trunk/Doc/library/itertools.rst + M /python/trunk/Lib/test/test_itertools.py + +Fix compress() recipe in docs to use itertools. +----------------------------------- +[http://svn.python.org/view?rev=65150&view=rev r65150] | raymond.hettinger | 2008-07-19 19:58:47 -0400 (Sat, 19 Jul 2008) | 1 line +Changed paths: + M /python/trunk/Doc/library/itertools.rst + M /python/trunk/Lib/test/test_itertools.py + +Clean-up itertools docs and recipes. +----------------------------------- +[http://svn.python.org/view?rev=65151&view=rev r65151] | gregory.p.smith | 2008-07-19 20:22:08 -0400 (Sat, 19 Jul 2008) | 9 lines +Changed paths: + M /python/trunk/Misc/NEWS + M /python/trunk/PC/_subprocess.c + +fix issue3120 - don't truncate handles on 64-bit Windows. + +This is still messy, realistically PC/_subprocess.c should never cast pointers +to python numbers and back at all. + +I don't have a 64-bit windows build environment because microsoft apparently +thinks that should cost money. Time to watch the buildbots. It builds and +passes tests on 32-bit windows. + +----------------------------------- +[http://svn.python.org/view?rev=65152&view=rev r65152] | georg.brandl | 2008-07-20 03:29:58 -0400 (Sun, 20 Jul 2008) | 2 lines +Changed paths: + M /python/trunk/Lib/asyncore.py + +Remove exception indexing in asyncore. + +----------------------------------- +[http://svn.python.org/view?rev=65168&view=rev r65168] | facundo.batista | 2008-07-21 10:28:17 -0400 (Mon, 21 Jul 2008) | 5 lines +Changed paths: + M /python/trunk/Lib/rlcompleter.py + + +Issue 3396. Fixed the autocompletion of 'int.', and worked +a little that part of the code, fixing a detail and enhancing +a bit others. + +----------------------------------- +[http://svn.python.org/view?rev=65174&view=rev r65174] | amaury.forgeotdarc | 2008-07-21 17:06:46 -0400 (Mon, 21 Jul 2008) | 3 lines +Changed paths: + M /python/trunk/Modules/posixmodule.c + +On Windows, silence a Purify warning and initialize the memory passed to CryptGenRandom. +Since python doesn't provide any particular random data, it seems more reasonable anyway. + +----------------------------------- +[http://svn.python.org/view?rev=65176&view=rev r65176] | amaury.forgeotdarc | 2008-07-21 17:36:24 -0400 (Mon, 21 Jul 2008) | 4 lines +Changed paths: + M /python/trunk/Misc/NEWS + +Increment version number in NEWS file, and move items that were added after 2.6b2. + +(I thought there was a script to automate this kind of updates) + +----------------------------------- +[http://svn.python.org/view?rev=65177&view=rev r65177] | amaury.forgeotdarc | 2008-07-21 18:00:38 -0400 (Mon, 21 Jul 2008) | 5 lines +Changed paths: + M /python/trunk/Lib/test/test_scope.py + M /python/trunk/Misc/NEWS + M /python/trunk/Objects/frameobject.c + +Issue2378: pdb would delete free variables when stepping into a class statement. + +The problem was introduced by r53954, the correction is to restore the symmetry between +PyFrame_FastToLocals and PyFrame_LocalsToFast + +----------------------------------- +[http://svn.python.org/view?rev=65182&view=rev r65182] | gregory.p.smith | 2008-07-22 00:46:32 -0400 (Tue, 22 Jul 2008) | 7 lines +Changed paths: + M /python/trunk/Doc/c-api/memory.rst + M /python/trunk/Include/pymem.h + M /python/trunk/Misc/NEWS + M /python/trunk/Modules/almodule.c + M /python/trunk/Modules/arraymodule.c + M /python/trunk/Modules/selectmodule.c + M /python/trunk/Objects/obmalloc.c + +Issue #2620: Overflow checking when allocating or reallocating memory +was not always being done properly in some python types and extension +modules. PyMem_MALLOC, PyMem_REALLOC, PyMem_NEW and PyMem_RESIZE have +all been updated to perform better checks and places in the code that +would previously leak memory on the error path when such an allocation +failed have been fixed. + +----------------------------------- +[http://svn.python.org/view?rev=65183&view=rev r65183] | ronald.oussoren | 2008-07-22 03:06:00 -0400 (Tue, 22 Jul 2008) | 2 lines +Changed paths: + M /python/trunk/configure + M /python/trunk/configure.in + +Fix buglet in fix for issue3381 + +----------------------------------- +[http://svn.python.org/view?rev=65184&view=rev r65184] | ronald.oussoren | 2008-07-22 03:06:33 -0400 (Tue, 22 Jul 2008) | 2 lines +Changed paths: + M /python/trunk/Mac/Makefile.in + +Fix build issue on OSX 10.4, somehow this wasn't committed before. + +----------------------------------- +[http://svn.python.org/view?rev=65194&view=rev r65194] | benjamin.peterson | 2008-07-23 09:25:06 -0400 (Wed, 23 Jul 2008) | 1 line +Changed paths: + M /python/trunk/Lib/imghdr.py + +use isinstance +----------------------------------- +[http://svn.python.org/view?rev=65209&view=rev r65209] | raymond.hettinger | 2008-07-23 20:08:18 -0400 (Wed, 23 Jul 2008) | 1 line +Changed paths: + M /python/trunk/Modules/_collectionsmodule.c + +Finish-up the partial conversion from int to Py_ssize_t for deque indices and length. +----------------------------------- +[http://svn.python.org/view?rev=65210&view=rev r65210] | raymond.hettinger | 2008-07-23 20:53:49 -0400 (Wed, 23 Jul 2008) | 1 line +Changed paths: + M /python/trunk/Modules/_collectionsmodule.c + +Parse to the correct datatype. +----------------------------------- +[http://svn.python.org/view?rev=65214&view=rev r65214] | raymond.hettinger | 2008-07-24 01:38:48 -0400 (Thu, 24 Jul 2008) | 1 line +Changed paths: + M /python/trunk/Modules/_bisectmodule.c + +Finish conversion from int to Py_ssize_t. +----------------------------------- +[http://svn.python.org/view?rev=65215&view=rev r65215] | raymond.hettinger | 2008-07-24 03:04:55 -0400 (Thu, 24 Jul 2008) | 1 line +Changed paths: + M /python/trunk/Objects/enumobject.c + +Convert from long to Py_ssize_t. +----------------------------------- +[http://svn.python.org/view?rev=65217&view=rev r65217] | thomas.heller | 2008-07-24 07:16:45 -0400 (Thu, 24 Jul 2008) | 1 line +Changed paths: + M /python/trunk/Modules/_ctypes/_ctypes.c + M /python/trunk/Modules/_ctypes/ctypes.h + +Make ctypes compatible with Python 2.3, 2.4, and 2.5 again. +----------------------------------- +[http://svn.python.org/view?rev=65227&view=rev r65227] | antoine.pitrou | 2008-07-25 13:45:59 -0400 (Fri, 25 Jul 2008) | 3 lines +Changed paths: + M /python/trunk/Lib/test/test_unicode.py + M /python/trunk/Objects/unicodeobject.c + +#2242: utf7 decoding crashes on bogus input on some Windows/MSVC versions + + +----------------------------------- +[http://svn.python.org/view?rev=65233&view=rev r65233] | raymond.hettinger | 2008-07-25 14:43:33 -0400 (Fri, 25 Jul 2008) | 1 line +Changed paths: + M /python/trunk/Lib/shelve.py + M /python/trunk/Lib/test/test_shelve.py + M /python/trunk/Misc/NEWS + +Issue 1592: Better error reporting for operations on closed shelves. +----------------------------------- +[http://svn.python.org/view?rev=65235&view=rev r65235] | antoine.pitrou | 2008-07-25 15:42:26 -0400 (Fri, 25 Jul 2008) | 3 lines +Changed paths: + M /python/trunk/Lib/test/test_zipfile.py + M /python/trunk/Lib/zipfile.py + M /python/trunk/Misc/NEWS + +#3394: zipfile.writestr doesn't set external attributes, so files are extracted mode 000 on Unix + + +----------------------------------- +[http://svn.python.org/view?rev=65237&view=rev r65237] | antoine.pitrou | 2008-07-25 16:40:19 -0400 (Fri, 25 Jul 2008) | 3 lines +Changed paths: + M /python/trunk/Lib/locale.py + M /python/trunk/Lib/test/test_locale.py + +convert test_locale to unittest, and add a mechanism to override localconv() results for further testing (#1864, #1222) + + +----------------------------------- +[http://svn.python.org/view?rev=65240&view=rev r65240] | antoine.pitrou | 2008-07-25 18:02:07 -0400 (Fri, 25 Jul 2008) | 3 lines +Changed paths: + M /python/trunk/Tools/pybench/Calls.py + +add a pybench test for complex function calls (part of #1819) + + +----------------------------------- +[http://svn.python.org/view?rev=65255&view=rev r65255] | skip.montanaro | 2008-07-26 20:49:02 -0400 (Sat, 26 Jul 2008) | 3 lines +Changed paths: + M /python/trunk/Lib/robotparser.py + M /python/trunk/Lib/test/test_robotparser.py + +Close issue 3437 - missing state change when Allow lines are processed. +Adds test cases which use Allow: as well. + +----------------------------------- +[http://svn.python.org/view?rev=65256&view=rev r65256] | skip.montanaro | 2008-07-26 20:50:41 -0400 (Sat, 26 Jul 2008) | 2 lines +Changed paths: + M /python/trunk/Misc/NEWS + +note robotparser bug fix. + +----------------------------------- +[http://svn.python.org/view?rev=65257&view=rev r65257] | mark.dickinson | 2008-07-27 02:39:07 -0400 (Sun, 27 Jul 2008) | 3 lines +Changed paths: + M /python/trunk/Lib/test/decimaltestdata/abs.decTest + M /python/trunk/Lib/test/decimaltestdata/add.decTest + M /python/trunk/Lib/test/decimaltestdata/and.decTest + M /python/trunk/Lib/test/decimaltestdata/base.decTest + M /python/trunk/Lib/test/decimaltestdata/clamp.decTest + M /python/trunk/Lib/test/decimaltestdata/class.decTest + M /python/trunk/Lib/test/decimaltestdata/compare.decTest + M /python/trunk/Lib/test/decimaltestdata/comparetotal.decTest + M /python/trunk/Lib/test/decimaltestdata/comparetotmag.decTest + M /python/trunk/Lib/test/decimaltestdata/copy.decTest + M /python/trunk/Lib/test/decimaltestdata/copyabs.decTest + M /python/trunk/Lib/test/decimaltestdata/copynegate.decTest + M /python/trunk/Lib/test/decimaltestdata/copysign.decTest + M /python/trunk/Lib/test/decimaltestdata/ddAbs.decTest + M /python/trunk/Lib/test/decimaltestdata/ddAdd.decTest + M /python/trunk/Lib/test/decimaltestdata/ddAnd.decTest + M /python/trunk/Lib/test/decimaltestdata/ddBase.decTest + M /python/trunk/Lib/test/decimaltestdata/ddCanonical.decTest + M /python/trunk/Lib/test/decimaltestdata/ddClass.decTest + M /python/trunk/Lib/test/decimaltestdata/ddCompare.decTest + M /python/trunk/Lib/test/decimaltestdata/ddCompareSig.decTest + M /python/trunk/Lib/test/decimaltestdata/ddCompareTotal.decTest + M /python/trunk/Lib/test/decimaltestdata/ddCompareTotalMag.decTest + M /python/trunk/Lib/test/decimaltestdata/ddCopy.decTest + M /python/trunk/Lib/test/decimaltestdata/ddCopyAbs.decTest + M /python/trunk/Lib/test/decimaltestdata/ddCopyNegate.decTest + M /python/trunk/Lib/test/decimaltestdata/ddCopySign.decTest + M /python/trunk/Lib/test/decimaltestdata/ddDivide.decTest + M /python/trunk/Lib/test/decimaltestdata/ddDivideInt.decTest + M /python/trunk/Lib/test/decimaltestdata/ddEncode.decTest + M /python/trunk/Lib/test/decimaltestdata/ddFMA.decTest + M /python/trunk/Lib/test/decimaltestdata/ddInvert.decTest + M /python/trunk/Lib/test/decimaltestdata/ddLogB.decTest + M /python/trunk/Lib/test/decimaltestdata/ddMax.decTest + M /python/trunk/Lib/test/decimaltestdata/ddMaxMag.decTest + M /python/trunk/Lib/test/decimaltestdata/ddMin.decTest + M /python/trunk/Lib/test/decimaltestdata/ddMinMag.decTest + M /python/trunk/Lib/test/decimaltestdata/ddMinus.decTest + M /python/trunk/Lib/test/decimaltestdata/ddMultiply.decTest + M /python/trunk/Lib/test/decimaltestdata/ddNextMinus.decTest + M /python/trunk/Lib/test/decimaltestdata/ddNextPlus.decTest + M /python/trunk/Lib/test/decimaltestdata/ddNextToward.decTest + M /python/trunk/Lib/test/decimaltestdata/ddOr.decTest + M /python/trunk/Lib/test/decimaltestdata/ddPlus.decTest + M /python/trunk/Lib/test/decimaltestdata/ddQuantize.decTest + M /python/trunk/Lib/test/decimaltestdata/ddReduce.decTest + M /python/trunk/Lib/test/decimaltestdata/ddRemainder.decTest + M /python/trunk/Lib/test/decimaltestdata/ddRemainderNear.decTest + M /python/trunk/Lib/test/decimaltestdata/ddRotate.decTest + M /python/trunk/Lib/test/decimaltestdata/ddSameQuantum.decTest + M /python/trunk/Lib/test/decimaltestdata/ddScaleB.decTest + M /python/trunk/Lib/test/decimaltestdata/ddShift.decTest + M /python/trunk/Lib/test/decimaltestdata/ddSubtract.decTest + M /python/trunk/Lib/test/decimaltestdata/ddToIntegral.decTest + M /python/trunk/Lib/test/decimaltestdata/ddXor.decTest + M /python/trunk/Lib/test/decimaltestdata/decDouble.decTest + M /python/trunk/Lib/test/decimaltestdata/decQuad.decTest + M /python/trunk/Lib/test/decimaltestdata/decSingle.decTest + M /python/trunk/Lib/test/decimaltestdata/divide.decTest + M /python/trunk/Lib/test/decimaltestdata/divideint.decTest + M /python/trunk/Lib/test/decimaltestdata/dqAbs.decTest + M /python/trunk/Lib/test/decimaltestdata/dqAdd.decTest + M /python/trunk/Lib/test/decimaltestdata/dqAnd.decTest + M /python/trunk/Lib/test/decimaltestdata/dqBase.decTest + M /python/trunk/Lib/test/decimaltestdata/dqCanonical.decTest + M /python/trunk/Lib/test/decimaltestdata/dqClass.decTest + M /python/trunk/Lib/test/decimaltestdata/dqCompare.decTest + M /python/trunk/Lib/test/decimaltestdata/dqCompareSig.decTest + M /python/trunk/Lib/test/decimaltestdata/dqCompareTotal.decTest + M /python/trunk/Lib/test/decimaltestdata/dqCompareTotalMag.decTest + M /python/trunk/Lib/test/decimaltestdata/dqCopy.decTest + M /python/trunk/Lib/test/decimaltestdata/dqCopyAbs.decTest + M /python/trunk/Lib/test/decimaltestdata/dqCopyNegate.decTest + M /python/trunk/Lib/test/decimaltestdata/dqCopySign.decTest + M /python/trunk/Lib/test/decimaltestdata/dqDivide.decTest + M /python/trunk/Lib/test/decimaltestdata/dqDivideInt.decTest + M /python/trunk/Lib/test/decimaltestdata/dqEncode.decTest + M /python/trunk/Lib/test/decimaltestdata/dqFMA.decTest + M /python/trunk/Lib/test/decimaltestdata/dqInvert.decTest + M /python/trunk/Lib/test/decimaltestdata/dqLogB.decTest + M /python/trunk/Lib/test/decimaltestdata/dqMax.decTest + M /python/trunk/Lib/test/decimaltestdata/dqMaxMag.decTest + M /python/trunk/Lib/test/decimaltestdata/dqMin.decTest + M /python/trunk/Lib/test/decimaltestdata/dqMinMag.decTest + M /python/trunk/Lib/test/decimaltestdata/dqMinus.decTest + M /python/trunk/Lib/test/decimaltestdata/dqMultiply.decTest + M /python/trunk/Lib/test/decimaltestdata/dqNextMinus.decTest + M /python/trunk/Lib/test/decimaltestdata/dqNextPlus.decTest + M /python/trunk/Lib/test/decimaltestdata/dqNextToward.decTest + M /python/trunk/Lib/test/decimaltestdata/dqOr.decTest + M /python/trunk/Lib/test/decimaltestdata/dqPlus.decTest + M /python/trunk/Lib/test/decimaltestdata/dqQuantize.decTest + M /python/trunk/Lib/test/decimaltestdata/dqReduce.decTest + M /python/trunk/Lib/test/decimaltestdata/dqRemainder.decTest + M /python/trunk/Lib/test/decimaltestdata/dqRemainderNear.decTest + M /python/trunk/Lib/test/decimaltestdata/dqRotate.decTest + M /python/trunk/Lib/test/decimaltestdata/dqSameQuantum.decTest + M /python/trunk/Lib/test/decimaltestdata/dqScaleB.decTest + M /python/trunk/Lib/test/decimaltestdata/dqShift.decTest + M /python/trunk/Lib/test/decimaltestdata/dqSubtract.decTest + M /python/trunk/Lib/test/decimaltestdata/dqToIntegral.decTest + M /python/trunk/Lib/test/decimaltestdata/dqXor.decTest + M /python/trunk/Lib/test/decimaltestdata/dsBase.decTest + M /python/trunk/Lib/test/decimaltestdata/dsEncode.decTest + M /python/trunk/Lib/test/decimaltestdata/exp.decTest + M /python/trunk/Lib/test/decimaltestdata/fma.decTest + M /python/trunk/Lib/test/decimaltestdata/inexact.decTest + M /python/trunk/Lib/test/decimaltestdata/invert.decTest + M /python/trunk/Lib/test/decimaltestdata/ln.decTest + M /python/trunk/Lib/test/decimaltestdata/log10.decTest + M /python/trunk/Lib/test/decimaltestdata/logb.decTest + M /python/trunk/Lib/test/decimaltestdata/max.decTest + M /python/trunk/Lib/test/decimaltestdata/maxmag.decTest + M /python/trunk/Lib/test/decimaltestdata/min.decTest + M /python/trunk/Lib/test/decimaltestdata/minmag.decTest + M /python/trunk/Lib/test/decimaltestdata/minus.decTest + M /python/trunk/Lib/test/decimaltestdata/multiply.decTest + M /python/trunk/Lib/test/decimaltestdata/nextminus.decTest + M /python/trunk/Lib/test/decimaltestdata/nextplus.decTest + M /python/trunk/Lib/test/decimaltestdata/nexttoward.decTest + M /python/trunk/Lib/test/decimaltestdata/or.decTest + M /python/trunk/Lib/test/decimaltestdata/plus.decTest + M /python/trunk/Lib/test/decimaltestdata/power.decTest + M /python/trunk/Lib/test/decimaltestdata/powersqrt.decTest + M /python/trunk/Lib/test/decimaltestdata/quantize.decTest + M /python/trunk/Lib/test/decimaltestdata/randomBound32.decTest + M /python/trunk/Lib/test/decimaltestdata/randoms.decTest + M /python/trunk/Lib/test/decimaltestdata/reduce.decTest + M /python/trunk/Lib/test/decimaltestdata/remainder.decTest + M /python/trunk/Lib/test/decimaltestdata/remainderNear.decTest + M /python/trunk/Lib/test/decimaltestdata/rescale.decTest + M /python/trunk/Lib/test/decimaltestdata/rotate.decTest + M /python/trunk/Lib/test/decimaltestdata/rounding.decTest + M /python/trunk/Lib/test/decimaltestdata/samequantum.decTest + M /python/trunk/Lib/test/decimaltestdata/scaleb.decTest + M /python/trunk/Lib/test/decimaltestdata/shift.decTest + M /python/trunk/Lib/test/decimaltestdata/squareroot.decTest + M /python/trunk/Lib/test/decimaltestdata/subtract.decTest + M /python/trunk/Lib/test/decimaltestdata/testall.decTest + M /python/trunk/Lib/test/decimaltestdata/tointegral.decTest + M /python/trunk/Lib/test/decimaltestdata/tointegralx.decTest + M /python/trunk/Lib/test/decimaltestdata/xor.decTest + M /python/trunk/Misc/NEWS + +Issue #3449: Update decimal module to use most recent specification +(v. 1.68) and tests (v. 2.58) from IBM. + +----------------------------------- +[http://svn.python.org/view?rev=65284&view=rev r65284] | jesus.cea | 2008-07-29 09:38:50 -0400 (Tue, 29 Jul 2008) | 1 line +Changed paths: + M /python/trunk/Lib/bsddb/test/test_misc.py + M /python/trunk/Lib/bsddb/test/test_replication.py + +Refinements in the bsddb testsuite +----------------------------------- +[http://svn.python.org/view?rev=65289&view=rev r65289] | jesus.cea | 2008-07-29 12:16:23 -0400 (Tue, 29 Jul 2008) | 5 lines +Changed paths: + M /python/trunk/Lib/bsddb/test/test_replication.py + +Be less strict with replication timeouts (the machine +can be a bit loaded), and be sure to yield the CPU +when waiting. + + +----------------------------------- +[http://svn.python.org/view?rev=65296&view=rev r65296] | raymond.hettinger | 2008-07-30 03:27:30 -0400 (Wed, 30 Jul 2008) | 1 line +Changed paths: + M /python/trunk/Doc/library/itertools.rst + M /python/trunk/Lib/test/test_itertools.py + +Neaten-up the itertools recipes. +----------------------------------- +[http://svn.python.org/view?rev=65299&view=rev r65299] | mark.dickinson | 2008-07-30 08:01:41 -0400 (Wed, 30 Jul 2008) | 5 lines +Changed paths: + M /python/trunk/Modules/mathmodule.c + +Fix special-value handling for math.sum. +Also minor cleanups to the code: fix tabbing, remove +trailing whitespace, and reformat to fit into 80 +columns. + +----------------------------------- +[http://svn.python.org/view?rev=65307&view=rev r65307] | benjamin.peterson | 2008-07-30 09:46:53 -0400 (Wed, 30 Jul 2008) | 1 line +Changed paths: + M /python/trunk/Doc/library/random.rst + M /python/trunk/Lib/random.py + +getrandombits is actually getrandbits +----------------------------------- +[http://svn.python.org/view?rev=65309&view=rev r65309] | mark.dickinson | 2008-07-30 12:25:16 -0400 (Wed, 30 Jul 2008) | 3 lines +Changed paths: + M /python/trunk/Modules/mathmodule.c + +Replace math.sum with math.fsum in a couple of comments +that were missed by [http://svn.python.org/view?rev=65308&view=rev r65308] + +----------------------------------- +[http://svn.python.org/view?rev=65310&view=rev r65310] | benjamin.peterson | 2008-07-30 13:45:10 -0400 (Wed, 30 Jul 2008) | 1 line +Changed paths: + M /python/trunk/Objects/exceptions.c + +backport [http://svn.python.org/view?rev=64751&view=rev r64751] +----------------------------------- +[http://svn.python.org/view?rev=65320&view=rev r65320] | amaury.forgeotdarc | 2008-07-30 20:42:16 -0400 (Wed, 30 Jul 2008) | 3 lines +Changed paths: + M /python/trunk/Lib/test/test_exceptions.py + M /python/trunk/Misc/NEWS + M /python/trunk/Python/errors.c + +#2542: now that issubclass() may call arbitrary code, +make sure that PyErr_ExceptionMatches returns 0 when an exception occurs there. + +----------------------------------- +[http://svn.python.org/view?rev=65321&view=rev r65321] | raymond.hettinger | 2008-07-30 21:19:50 -0400 (Wed, 30 Jul 2008) | 4 lines +Changed paths: + M /python/trunk/Doc/library/itertools.rst + M /python/trunk/Lib/test/test_itertools.py + +Alter recipe to show how to call izip_longest() with +both a keyword argument and star arguments. + + +----------------------------------- +[http://svn.python.org/view?rev=65328&view=rev r65328] | benjamin.peterson | 2008-07-31 11:15:45 -0400 (Thu, 31 Jul 2008) | 1 line +Changed paths: + M /python/trunk/Lib/lib-tk/Tkinter.py + +remove usage of MacOS from Tkinter +----------------------------------- +[http://svn.python.org/view?rev=65335&view=rev r65335] | neal.norwitz | 2008-07-31 13:17:14 -0400 (Thu, 31 Jul 2008) | 1 line +Changed paths: + M /python/trunk/Lib/test/seq_tests.py + M /python/trunk/Lib/test/test_bigmem.py + M /python/trunk/Lib/test/test_strop.py + M /python/trunk/Lib/test/test_support.py + M /python/trunk/Misc/NEWS + M /python/trunk/Modules/gcmodule.c + M /python/trunk/Modules/mmapmodule.c + M /python/trunk/Modules/stropmodule.c + M /python/trunk/Objects/bufferobject.c + M /python/trunk/Objects/longobject.c + M /python/trunk/Objects/stringobject.c + M /python/trunk/Objects/tupleobject.c + M /python/trunk/Objects/unicodeobject.c + +Security patches from Apple: prevent int overflow when allocating memory +----------------------------------- +[http://svn.python.org/view?rev=65339&view=rev r65339] | amaury.forgeotdarc | 2008-07-31 17:28:03 -0400 (Thu, 31 Jul 2008) | 5 lines +Changed paths: + M /python/trunk/Lib/test/test_builtin.py + M /python/trunk/Misc/NEWS + M /python/trunk/Python/bltinmodule.c + +#3479: unichr(2**32) used to return u'\x00'. +The argument was fetched in a long, but PyUnicode_FromOrdinal takes an int. + +(why doesn't gcc issue a truncation warning in this case?) + +----------------------------------- +[http://svn.python.org/view?rev=65342&view=rev r65342] | amaury.forgeotdarc | 2008-07-31 19:39:05 -0400 (Thu, 31 Jul 2008) | 8 lines +Changed paths: + M /python/trunk/Lib/test/test_unicode.py + M /python/trunk/Objects/unicodeobject.c + +Correct a crash when two successive unicode allocations fail with a MemoryError: +the freelist contained half-initialized objects with freed pointers. + +The comment +/* XXX UNREF/NEWREF interface should be more symmetrical */ +was copied from tupleobject.c, and appears in some other places. +I sign the petition. + +----------------------------------- +[http://svn.python.org/view?rev=65346&view=rev r65346] | brett.cannon | 2008-07-31 21:21:50 -0400 (Thu, 31 Jul 2008) | 1 line +Changed paths: + M /python/trunk/Lib/traceback.py + +Fix a DeprecationWarning about __getitem__() and exceptions in the 'traceback' module. +----------------------------------- +[http://svn.python.org/view?rev=65353&view=rev r65353] | brett.cannon | 2008-07-31 21:40:24 -0400 (Thu, 31 Jul 2008) | 4 lines +Changed paths: + M /python/trunk/Lib/inspect.py + +Silence (Syntax|Deprecation)Warning for 'inspect'. Had to remove tuple +unpacking in a parameter list and set some constants by hand that were pulled +from the 'compiler' package. + +----------------------------------- +[http://svn.python.org/view?rev=65368&view=rev r65368] | martin.v.loewis | 2008-08-01 10:10:26 -0400 (Fri, 01 Aug 2008) | 3 lines +Changed paths: + M /python/trunk/Makefile.pre.in + M /python/trunk/Misc/NEWS + +Generate the PatternGrammar pickle during "make install". +Fixes part of #3131. + +----------------------------------- +[http://svn.python.org/view?rev=65399&view=rev r65399] | martin.v.loewis | 2008-08-02 03:20:25 -0400 (Sat, 02 Aug 2008) | 3 lines +Changed paths: + M /python/trunk/Lib/lib-tk/Tkinter.py + M /python/trunk/Misc/NEWS + +Issue #799428: Fix Tkinter.Misc._nametowidget to unwrap +Tcl command objects. + +----------------------------------- +[http://svn.python.org/view?rev=65422&view=rev r65422] | antoine.pitrou | 2008-08-02 17:58:05 -0400 (Sat, 02 Aug 2008) | 1 line +Changed paths: + M /python/trunk/Lib/test/test_str.py + M /python/trunk/Objects/stringobject.c + +Preemptively backport the relevant parts of [http://svn.python.org/view?rev=65420&view=rev r65420] +----------------------------------- +[http://svn.python.org/view?rev=65438&view=rev r65438] | brett.cannon | 2008-08-03 18:34:25 -0400 (Sun, 03 Aug 2008) | 3 lines +Changed paths: + M /python/trunk/Lib/cookielib.py + +Remove a use of list.sort(cmp=) to silence a -3 DeprecationWarning in +cookielib. + +----------------------------------- +[http://svn.python.org/view?rev=65440&view=rev r65440] | brett.cannon | 2008-08-03 18:38:19 -0400 (Sun, 03 Aug 2008) | 2 lines +Changed paths: + M /python/trunk/Lib/profile.py + +Remove a dict.has_key() usage in profile to silence a -3 DeprecationWarning. + +----------------------------------- +[http://svn.python.org/view?rev=65444&view=rev r65444] | brett.cannon | 2008-08-03 18:57:23 -0400 (Sun, 03 Aug 2008) | 3 lines +Changed paths: + M /python/trunk/Lib/SimpleXMLRPCServer.py + +Remove a dict.has_key() and callable() usage in SimpleXMLRPCServer as triggered +under -3 through test_xmlrpc. + +----------------------------------- +[http://svn.python.org/view?rev=65455&view=rev r65455] | brett.cannon | 2008-08-03 19:52:32 -0400 (Sun, 03 Aug 2008) | 2 lines +Changed paths: + M /python/trunk/Lib/fileinput.py + +Remove a use of callable() in fileinput to silence a -3 warning. + +----------------------------------- +[http://svn.python.org/view?rev=65459&view=rev r65459] | gregory.p.smith | 2008-08-03 20:13:29 -0400 (Sun, 03 Aug 2008) | 4 lines +Changed paths: + M /python/trunk/Lib/subprocess.py + M /python/trunk/Misc/NEWS + +- Issue #1857: subprocess.Popen.poll gained an additional _deadstate keyword + argument in python 2.5, this broke code that subclassed Popen to include its + own poll method. Fixed my moving _deadstate to an _internal_poll method. + +----------------------------------- +[http://svn.python.org/view?rev=65464&view=rev r65464] | brett.cannon | 2008-08-03 20:27:29 -0400 (Sun, 03 Aug 2008) | 2 lines +Changed paths: + M /python/trunk/Lib/modulefinder.py + +Silence warnings under -3 about using dict.has_key() for modulefinder. + +----------------------------------- +[http://svn.python.org/view?rev=65472&view=rev r65472] | andrew.kuchling | 2008-08-03 21:43:43 -0400 (Sun, 03 Aug 2008) | 3 lines +Changed paths: + M /python/trunk/Lib/mailbox.py + M /python/trunk/Lib/test/test_mailbox.py + +Bug 3228: Explicitly supply the file mode to avoid creating executable files, +and add corresponding tests. +Possible 2.5 backport candidate +----------------------------------- +[http://svn.python.org/view?rev=65481&view=rev r65481] | gregory.p.smith | 2008-08-04 03:33:37 -0400 (Mon, 04 Aug 2008) | 22 lines +Changed paths: + M /python/trunk/Python/pystate.c + M /python/trunk/Python/thread.c + +Adds a sanity check to avoid a *very rare* infinite loop due to a corrupt tls +key list data structure in the thread startup path. + +This change is a companion to [http://svn.python.org/view?rev=60148&view=rev r60148] which already successfully dealt with a +similar issue on thread shutdown. + +In particular this loop has been observed happening from this call path: + #0 in find_key () + #1 in PyThread_set_key_value () + #2 in _PyGILState_NoteThreadState () + #3 in PyThreadState_New () + #4 in t_bootstrap () + #5 in pthread_start_thread () + +I don't know how this happens but it does, *very* rarely. On more than +one hardware platform. I have not been able to reproduce it manually. +(A flaky mutex implementation on the system in question is one hypothesis). + +As with [http://svn.python.org/view?rev=60148&view=rev r60148], the spinning we managed to observe in the wild was due to a +single list element pointing back upon itself. + + +----------------------------------- +[http://svn.python.org/view?rev=65488&view=rev r65488] | nick.coghlan | 2008-08-04 08:47:17 -0400 (Mon, 04 Aug 2008) | 1 line +Changed paths: + M /python/trunk/Misc/NEWS + +Add missing NEWS entry for [http://svn.python.org/view?rev=65487&view=rev r65487] +----------------------------------- +[http://svn.python.org/view?rev=65518&view=rev r65518] | mark.dickinson | 2008-08-04 17:30:09 -0400 (Mon, 04 Aug 2008) | 7 lines +Changed paths: + M /python/trunk/Lib/test/test_long.py + M /python/trunk/Misc/NEWS + M /python/trunk/Objects/longobject.c + +Issue #1481296: (again!) Make conversion of a float NaN to an int or +long raise ValueError instead of returning 0. Also, change the error +message for conversion of an infinity to an integer, replacing 'long' by +'integer', so that it's appropriate for both long(float('inf')) and +int(float('inf')). + + +----------------------------------- +[http://svn.python.org/view?rev=65519&view=rev r65519] | brett.cannon | 2008-08-04 17:30:53 -0400 (Mon, 04 Aug 2008) | 2 lines +Changed paths: + M /python/trunk/Lib/wsgiref/handlers.py + M /python/trunk/Lib/wsgiref/headers.py + M /python/trunk/Lib/wsgiref/simple_server.py + M /python/trunk/Lib/wsgiref/util.py + +Silence warnings under -3 triggered by wsgiref. + +----------------------------------- +[http://svn.python.org/view?rev=65528&view=rev r65528] | brett.cannon | 2008-08-04 17:52:25 -0400 (Mon, 04 Aug 2008) | 4 lines +Changed paths: + M /python/trunk/Misc/NEWS + +Add a note about all the modules/packages changed to silence -3 warnings. More +changes are needed once some decisions are made, but this is the work up to this +point. + +----------------------------------- +[http://svn.python.org/view?rev=65544&view=rev r65544] | guido.van.rossum | 2008-08-04 23:39:21 -0400 (Mon, 04 Aug 2008) | 28 lines +Changed paths: + M /python/trunk/Modules/_sre.c + +Tracker issue 3487: sre "bytecode" verifier. + +This is a verifier for the binary code used by the _sre module (this +is often called bytecode, though to distinguish it from Python bytecode +I put it in quotes). + +I wrote this for Google App Engine, and am making the patch available as +open source under the Apache 2 license. Below are the copyright +statement and license, for completeness. + +# Copyright 2008 Google Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +It's not necessary to include these copyrights and bytecode in the +source file. Google has signed a contributor's agreement with the PSF +already. + +----------------------------------- +[http://svn.python.org/view?rev=65578&view=rev r65578] | antoine.pitrou | 2008-08-07 14:42:40 -0400 (Thu, 07 Aug 2008) | 3 lines +Changed paths: + M /python/trunk/Lib/code.py + +#1288615: Python code.interact() and non-ASCII input + + +----------------------------------- +[http://svn.python.org/view?rev=65581&view=rev r65581] | guido.van.rossum | 2008-08-07 14:51:38 -0400 (Thu, 07 Aug 2008) | 3 lines +Changed paths: + M /python/trunk/Modules/fcntlmodule.c + +Patch by Ian Charnas from issue 3517. +Add F_FULLFSYNC if it exists (OS X only so far). + +----------------------------------- +[http://svn.python.org/view?rev=65605&view=rev r65605] | skip.montanaro | 2008-08-08 18:52:51 -0400 (Fri, 08 Aug 2008) | 1 line +Changed paths: + M /python/trunk/Doc/library/csv.rst + M /python/trunk/Lib/csv.py + M /python/trunk/Lib/test/test_csv.py + M /python/trunk/Misc/NEWS + +accept issue 3436 +----------------------------------- +[http://svn.python.org/view?rev=65606&view=rev r65606] | antoine.pitrou | 2008-08-09 08:43:23 -0400 (Sat, 09 Aug 2008) | 3 lines +Changed paths: + M /python/trunk/Misc/NEWS + +Fix slightly misleading statement in the NEWS file. + + +----------------------------------- +[http://svn.python.org/view?rev=65609&view=rev r65609] | antoine.pitrou | 2008-08-09 13:22:25 -0400 (Sat, 09 Aug 2008) | 3 lines +Changed paths: + M /python/trunk/Misc/NEWS + M /python/trunk/Modules/bz2module.c + +#3205: bz2 iterator fails silently on MemoryError + + +----------------------------------- +[http://svn.python.org/view?rev=65610&view=rev r65610] | antoine.pitrou | 2008-08-09 13:27:23 -0400 (Sat, 09 Aug 2008) | 3 lines +Changed paths: + M /python/trunk/Misc/NEWS + +move NEWS entry to the appropriate section (oops!) + + +----------------------------------- +[http://svn.python.org/view?rev=65619&view=rev r65619] | brett.cannon | 2008-08-09 19:39:11 -0400 (Sat, 09 Aug 2008) | 3 lines +Changed paths: + M /python/trunk/Lib/csv.py + M /python/trunk/Misc/NEWS + +Silence warnings in csv about using reduce() when run under -3 by using +functools.reduce() instead. + +----------------------------------- +[http://svn.python.org/view?rev=65622&view=rev r65622] | robert.schuppenies | 2008-08-10 07:01:53 -0400 (Sun, 10 Aug 2008) | 4 lines +Changed paths: + M /python/trunk/Lib/lib-tk/Tkinter.py + M /python/trunk/Misc/NEWS + +Issue #1342811: Fix leak in Tkinter.Menu.delete. Commands associated to +menu entries were not deleted. + + +----------------------------------- +[http://svn.python.org/view?rev=65637&view=rev r65637] | georg.brandl | 2008-08-11 05:07:59 -0400 (Mon, 11 Aug 2008) | 3 lines +Changed paths: + M /python/trunk/Lib/test/test_dict.py + M /python/trunk/Misc/NEWS + M /python/trunk/Objects/dictobject.c + +- Issue #3537: Fix an assertion failure when an empty but presized dict + object was stored in the freelist. + +----------------------------------- +[http://svn.python.org/view?rev=65644&view=rev r65644] | antoine.pitrou | 2008-08-11 13:21:36 -0400 (Mon, 11 Aug 2008) | 3 lines +Changed paths: + M /python/trunk/Lib/shutil.py + M /python/trunk/Misc/NEWS + +#3134: shutil referenced undefined WindowsError symbol + + +----------------------------------- +[http://svn.python.org/view?rev=65652&view=rev r65652] | ronald.oussoren | 2008-08-12 08:29:13 -0400 (Tue, 12 Aug 2008) | 2 lines +Changed paths: + M /python/trunk/configure + M /python/trunk/configure.in + +Fix typo in the `arch` commandline + +----------------------------------- +[http://svn.python.org/view?rev=65653&view=rev r65653] | ronald.oussoren | 2008-08-12 08:41:45 -0400 (Tue, 12 Aug 2008) | 3 lines +Changed paths: + M /python/trunk/Mac/Modules/MacOS.c + M /python/trunk/Mac/Modules/file/_Filemodule.c + +Another fix for 4-way universal builds, use the right #ifndef guard +to detect the OSX 10.5 SDK. + +----------------------------------- +[http://svn.python.org/view?rev=65663&view=rev r65663] | hirokazu.yamamoto | 2008-08-13 21:33:44 -0400 (Wed, 13 Aug 2008) | 19 lines +Changed paths: + M /python/trunk/PC/VC6/_bsddb.dsp + A /python/trunk/PC/VC6/_msi.dsp + M /python/trunk/PC/VC6/_sqlite3.dsp + M /python/trunk/PC/VC6/build_ssl.py + M /python/trunk/PC/VC6/pcbuild.dsw + M /python/trunk/PC/VC6/python.dsp + M /python/trunk/PC/VC6/pythoncore.dsp + M /python/trunk/PC/VC6/readme.txt + +Issue #2065: VC6 related fix. + +- PC/VC6/_bsddb.dsp: + removed '/nodefaultlib:"msvcrt"' to fix linker error. + +- PC/VC6/_msi.dsp, PC/VC6/pcbuild.dsw: + added new module support. + +- PC/VC6/_sqlite3.dsp: + /D "MODULE_NAME=\"sqlite3\"" + caused extra leading space like + #define MODULE_NAME " sqlite3" + so uses + /D MODULE_NAME=\"sqlite3\" + instead. + +- PC/VC6/python.dsp: + changed stack size to 2MB to avoid stack overflow on + some tests. +----------------------------------- +[http://svn.python.org/view?rev=65665&view=rev r65665] | brett.cannon | 2008-08-14 01:00:03 -0400 (Thu, 14 Aug 2008) | 11 lines +Changed paths: + M /python/trunk/Lib/mimetools.py + M /python/trunk/Misc/NEWS + +Silence the DeprecationWarning of rfc822 triggered by its importation in +mimetools. + +This has an unfortunate side-effect of potentially not letting any warning +about rfc822's deprecation be seen by user-visible code if rfc822 is not +imported before mimetools. This is because modules are cached in sys.modules +and thus do not have their deprecation triggered more than once. But this +silencing would have happened by other code that silences the use of mimetools +or rfc822 anyway in the stdlib or user code, and thus seems justified to be +done here. + +----------------------------------- +[http://svn.python.org/view?rev=65667&view=rev r65667] | hirokazu.yamamoto | 2008-08-14 01:50:43 -0400 (Thu, 14 Aug 2008) | 1 line +Changed paths: + M /python/trunk/Lib/distutils/command/build_ext.py + +Fixed test_distutils error (test_build_ext) on VC6. +----------------------------------- +[http://svn.python.org/view?rev=65677&view=rev r65677] | martin.v.loewis | 2008-08-14 11:54:27 -0400 (Thu, 14 Aug 2008) | 3 lines +Changed paths: + M /python/trunk/Objects/abstract.c + +Make obj an owned reference in Py_buffer; this checkin +was missing from the patch for #3139. + +----------------------------------- +[http://svn.python.org/view?rev=65678&view=rev r65678] | martin.v.loewis | 2008-08-14 11:56:07 -0400 (Thu, 14 Aug 2008) | 2 lines +Changed paths: + M /python/trunk/Modules/_ctypes/_ctypes.c + +Properly INCREF reference in Py_buffer. + +----------------------------------- +[http://svn.python.org/view?rev=65679&view=rev r65679] | facundo.batista | 2008-08-14 12:51:00 -0400 (Thu, 14 Aug 2008) | 5 lines +Changed paths: + M /python/trunk/Lib/test/test_urlparse.py + M /python/trunk/Lib/urlparse.py + + +Issue 1432. Fixes a bug caused because of the evolution +of the RFC that describes the behaviour. Note that we now +have the same behaviour than the current browsers. + +----------------------------------- +[http://svn.python.org/view?rev=65681&view=rev r65681] | thomas.heller | 2008-08-14 15:10:48 -0400 (Thu, 14 Aug 2008) | 4 lines +Changed paths: + M /python/trunk/Lib/ctypes/__init__.py + M /python/trunk/Lib/ctypes/test/test_memfunctions.py + M /python/trunk/Misc/NEWS + +issue #3554: ctypes.string_at and ctypes.wstring_at must use the +pythonapi calling convention so that the GIL is held and error return +values are checked. + +----------------------------------- +[http://svn.python.org/view?rev=65682&view=rev r65682] | thomas.heller | 2008-08-14 16:04:38 -0400 (Thu, 14 Aug 2008) | 2 lines +Changed paths: + M /python/trunk/Lib/ctypes/test/test_memfunctions.py + +Try to fix the test on 64-bit platforms. + +----------------------------------- +[http://svn.python.org/view?rev=65684&view=rev r65684] | thomas.heller | 2008-08-14 16:19:18 -0400 (Thu, 14 Aug 2008) | 2 lines +Changed paths: + M /python/trunk/Lib/ctypes/test/test_memfunctions.py + +Disable the test until I have one that works. + +----------------------------------- +[http://svn.python.org/view?rev=65700&view=rev r65700] | antoine.pitrou | 2008-08-15 17:03:21 -0400 (Fri, 15 Aug 2008) | 3 lines +Changed paths: + M /python/trunk/Lib/email/message.py + M /python/trunk/Misc/NEWS + +#2676: email/message.py [Message.get_content_type]: Trivial regex hangs on pathological input + + +----------------------------------- +[http://svn.python.org/view?rev=65710&view=rev r65710] | facundo.batista | 2008-08-16 10:44:07 -0400 (Sat, 16 Aug 2008) | 4 lines +Changed paths: + M /python/trunk/Lib/test/test_urllib2.py + M /python/trunk/Lib/urllib2.py + M /python/trunk/Misc/NEWS + + +Issue #2776: fixed small issue when handling an URL with double slash +after a 302 response in the case of not going through a proxy. + +----------------------------------- +[http://svn.python.org/view?rev=65713&view=rev r65713] | benjamin.peterson | 2008-08-16 12:29:02 -0400 (Sat, 16 Aug 2008) | 1 line +Changed paths: + M /python/trunk/Lib/imghdr.py + +#3424 rearrange the order of tests in imghdr to place more common types first +----------------------------------- +[http://svn.python.org/view?rev=65716&view=rev r65716] | brett.cannon | 2008-08-16 17:47:07 -0400 (Sat, 16 Aug 2008) | 5 lines +Changed paths: + M /python/trunk/Lib/BaseHTTPServer.py + M /python/trunk/Misc/NEWS + +Silence the DeprecationWarning raised by importing mimetools in BaseHTTPServer. +This does have an unfortunate side-effect of silencing the warning for all +subsequent code that imports mimetools as well since the warning is only +executed upon the first import of mimetools. + +----------------------------------- +[http://svn.python.org/view?rev=65719&view=rev r65719] | brett.cannon | 2008-08-16 17:56:03 -0400 (Sat, 16 Aug 2008) | 2 lines +Changed paths: + M /python/trunk/Lib/httplib.py + M /python/trunk/Misc/NEWS + +Silence the DeprecationWarning raised in httplib when mimetools is imported. + +----------------------------------- +[http://svn.python.org/view?rev=65721&view=rev r65721] | brett.cannon | 2008-08-16 18:00:27 -0400 (Sat, 16 Aug 2008) | 2 lines +Changed paths: + M /python/trunk/Lib/cgi.py + M /python/trunk/Misc/NEWS + +Silence DeprecationWarning raised by mimetools and rfc822 in cgi. + +----------------------------------- +[http://svn.python.org/view?rev=65724&view=rev r65724] | benjamin.peterson | 2008-08-16 18:11:33 -0400 (Sat, 16 Aug 2008) | 2 lines +Changed paths: + M /python/trunk/Lib/test/test_syntax.py + M /python/trunk/Python/symtable.c + +include filename and line number in SyntaxError + +----------------------------------- +[http://svn.python.org/view?rev=65732&view=rev r65732] | benjamin.peterson | 2008-08-16 19:29:40 -0400 (Sat, 16 Aug 2008) | 1 line +Changed paths: + M /python/trunk/Python/symtable.c + +PySTEntry's constructor is static; there's no point in a fancy API name +----------------------------------- +[http://svn.python.org/view?rev=65736&view=rev r65736] | benjamin.peterson | 2008-08-16 21:09:17 -0400 (Sat, 16 Aug 2008) | 1 line +Changed paths: + M /python/trunk/Include/symtable.h + M /python/trunk/Python/symtable.c + +expose PySTEntry.nested so the symtable module will work +----------------------------------- +[http://svn.python.org/view?rev=65738&view=rev r65738] | benjamin.peterson | 2008-08-16 21:27:30 -0400 (Sat, 16 Aug 2008) | 1 line +Changed paths: + M /python/trunk/Include/symtable.h + +fix compile errors +----------------------------------- +[http://svn.python.org/view?rev=65739&view=rev r65739] | benjamin.peterson | 2008-08-16 22:23:43 -0400 (Sat, 16 Aug 2008) | 1 line +Changed paths: + M /python/trunk/Python/symtable.c + +uhh PySTEntry->ste_unoptimized has to be exposed too Added: sandbox/trunk/py2.5.3/7 ============================================================================== --- (empty file) +++ sandbox/trunk/py2.5.3/7 Wed Oct 8 14:16:10 2008 @@ -0,0 +1,1057 @@ +----------------------------------- +[http://svn.python.org/view?rev=65741&view=rev r65741] | facundo.batista | 2008-08-16 23:38:39 -0400 (Sat, 16 Aug 2008) | 4 lines +Changed paths: + M /python/trunk/Lib/urllib2.py + M /python/trunk/Misc/NEWS + + +Issue 2464. Supports a malformation in the URL received +in a redirect. + +----------------------------------- +[http://svn.python.org/view?rev=65745&view=rev r65745] | hirokazu.yamamoto | 2008-08-17 05:19:52 -0400 (Sun, 17 Aug 2008) | 2 lines +Changed paths: + M /python/trunk/Modules/posixmodule.c + +Issue #2222: Fixed reference leak when occured os.rename() +fails unicode conversion on 2nd parameter. (windows only) +----------------------------------- +[http://svn.python.org/view?rev=65748&view=rev r65748] | hirokazu.yamamoto | 2008-08-17 05:46:56 -0400 (Sun, 17 Aug 2008) | 1 line +Changed paths: + M /python/trunk/Misc/NEWS + +I forgot to update NEWS. +----------------------------------- +[http://svn.python.org/view?rev=65761&view=rev r65761] | antoine.pitrou | 2008-08-17 09:06:29 -0400 (Sun, 17 Aug 2008) | 3 lines +Changed paths: + M /python/trunk/Lib/zipfile.py + +fix ZipFile.testzip() to work with very large embedded files + + +----------------------------------- +[http://svn.python.org/view?rev=65775&view=rev r65775] | benjamin.peterson | 2008-08-17 13:13:26 -0400 (Sun, 17 Aug 2008) | 5 lines +Changed paths: + M /python/trunk/Lib/symtable.py + M /python/trunk/Lib/test/test_symtable.py + M /python/trunk/Modules/symtablemodule.c + +get the symtable module back in working order +- Fix broken functions +- Add (hopefully) extensive tests +- Modernize a little + +----------------------------------- +[http://svn.python.org/view?rev=65782&view=rev r65782] | benjamin.peterson | 2008-08-17 16:33:45 -0400 (Sun, 17 Aug 2008) | 1 line +Changed paths: + M /python/trunk/Tools/scripts/idle + +set svn:executable on a script +----------------------------------- +[http://svn.python.org/view?rev=65787&view=rev r65787] | brett.cannon | 2008-08-17 18:10:11 -0400 (Sun, 17 Aug 2008) | 3 lines +Changed paths: + M /python/trunk/Lib/dummy_thread.py + M /python/trunk/Lib/filecmp.py + M /python/trunk/Lib/shelve.py + M /python/trunk/Misc/NEWS + +Remove imports of 'warnings' that are no longer needed in dummy_thread, +filecmp, and shelve. + +----------------------------------- +[http://svn.python.org/view?rev=65795&view=rev r65795] | brett.cannon | 2008-08-17 20:46:22 -0400 (Sun, 17 Aug 2008) | 3 lines +Changed paths: + M /python/trunk/Lib/cookielib.py + M /python/trunk/Lib/csv.py + M /python/trunk/Lib/os.py + M /python/trunk/Lib/urllib2.py + M /python/trunk/Lib/weakref.py + M /python/trunk/Misc/NEWS + +Update __all__ for cookielib, csv, os, and urllib2 for objects imported into +the module but exposed as part of the API. + +----------------------------------- +[http://svn.python.org/view?rev=65802&view=rev r65802] | benjamin.peterson | 2008-08-17 22:01:21 -0400 (Sun, 17 Aug 2008) | 1 line +Changed paths: + M /python/trunk/Python/bltinmodule.c + +follup to #3473: don't duplicate the reduce code +----------------------------------- +[http://svn.python.org/view?rev=65806&view=rev r65806] | marc-andre.lemburg | 2008-08-18 07:13:45 -0400 (Mon, 18 Aug 2008) | 3 lines +Changed paths: + M /python/trunk/Lib/distutils/core.py + +Restore Python 2.3 compatibility and remove "with" usage. + + +----------------------------------- +[http://svn.python.org/view?rev=65809&view=rev r65809] | nick.coghlan | 2008-08-18 08:42:46 -0400 (Mon, 18 Aug 2008) | 1 line +Changed paths: + M /python/trunk/Misc/NEWS + +Belated NEWS entry for [http://svn.python.org/view?rev=65642&view=rev r65642] +----------------------------------- +[http://svn.python.org/view?rev=65810&view=rev r65810] | nick.coghlan | 2008-08-18 09:14:22 -0400 (Mon, 18 Aug 2008) | 1 line +Changed paths: + M /python/trunk/Doc/c-api/object.rst + M /python/trunk/Doc/c-api/typeobj.rst + M /python/trunk/Misc/NEWS + +Issue 2235: document PyObject_HashNotImplemented +----------------------------------- +[http://svn.python.org/view?rev=65818&view=rev r65818] | benjamin.peterson | 2008-08-18 12:40:03 -0400 (Mon, 18 Aug 2008) | 4 lines +Changed paths: + M /python/trunk/Doc/library/threading.rst + M /python/trunk/Lib/test/test_threading.py + M /python/trunk/Lib/threading.py + M /python/trunk/Misc/NEWS + +change threading.getIdent to a property + +This is new in 2.6 so now need to worry about backwards compatibility :) + +----------------------------------- +[http://svn.python.org/view?rev=65822&view=rev r65822] | benjamin.peterson | 2008-08-18 13:45:09 -0400 (Mon, 18 Aug 2008) | 1 line +Changed paths: + M /python/trunk/Lib/test/test_threading.py + M /python/trunk/Lib/threading.py + +backport threading property changes +----------------------------------- +[http://svn.python.org/view?rev=65826&view=rev r65826] | benjamin.peterson | 2008-08-18 14:13:17 -0400 (Mon, 18 Aug 2008) | 1 line +Changed paths: + M /python/trunk/Lib/threading.py + +bring back the old API +----------------------------------- +[http://svn.python.org/view?rev=65834&view=rev r65834] | amaury.forgeotdarc | 2008-08-18 15:23:47 -0400 (Mon, 18 Aug 2008) | 4 lines +Changed paths: + M /python/trunk/Lib/distutils/cygwinccompiler.py + M /python/trunk/Misc/NEWS + +#2234 distutils failed with mingw binutils 2.18.50.20080109. +Be less strict when parsing these version numbers, +they don't necessarily follow the python numbering scheme. + +----------------------------------- +[http://svn.python.org/view?rev=65842&view=rev r65842] | benjamin.peterson | 2008-08-18 18:29:19 -0400 (Mon, 18 Aug 2008) | 1 line +Changed paths: + M /python/trunk/Doc/library/threading.rst + M /python/trunk/Misc/NEWS + +update the threading docs to account for recent changes +----------------------------------- +[http://svn.python.org/view?rev=65846&view=rev r65846] | georg.brandl | 2008-08-18 19:09:49 -0400 (Mon, 18 Aug 2008) | 2 lines +Changed paths: + M /python/trunk/Doc/library/threading.rst + M /python/trunk/Misc/NEWS + +Fix grammar. + +----------------------------------- +[http://svn.python.org/view?rev=65859&view=rev r65859] | thomas.heller | 2008-08-19 13:47:13 -0400 (Tue, 19 Aug 2008) | 2 lines +Changed paths: + M /python/trunk/Modules/mmapmodule.c + +Fix strange character in the docstring. + +----------------------------------- +[http://svn.python.org/view?rev=65865&view=rev r65865] | benjamin.peterson | 2008-08-19 15:07:38 -0400 (Tue, 19 Aug 2008) | 1 line +Changed paths: + M /python/trunk/Lib/hmac.py + +silence callable warning in hmac +----------------------------------- +[http://svn.python.org/view?rev=65868&view=rev r65868] | thomas.heller | 2008-08-19 15:25:04 -0400 (Tue, 19 Aug 2008) | 3 lines +Changed paths: + M /python/trunk/Lib/ctypes/test/test_pointers.py + M /python/trunk/Misc/NEWS + M /python/trunk/Modules/_ctypes/_ctypes.c + +Fix a regression introduced by rev. 63792: ctypes function pointers +that are COM methods must have a boolean True value. + +----------------------------------- +[http://svn.python.org/view?rev=65869&view=rev r65869] | benjamin.peterson | 2008-08-19 15:27:53 -0400 (Tue, 19 Aug 2008) | 1 line +Changed paths: + M /python/trunk/Include/pymath.h + +fix a little typo +----------------------------------- +[http://svn.python.org/view?rev=65870&view=rev r65870] | thomas.heller | 2008-08-19 15:40:23 -0400 (Tue, 19 Aug 2008) | 1 line +Changed paths: + M /python/trunk/Modules/_ctypes/_ctypes.c + +COM method code is windows specific +----------------------------------- +[http://svn.python.org/view?rev=65872&view=rev r65872] | benjamin.peterson | 2008-08-19 15:52:46 -0400 (Tue, 19 Aug 2008) | 1 line +Changed paths: + M /python/trunk/Doc/reference/expressions.rst + M /python/trunk/Grammar/Grammar + M /python/trunk/Lib/test/test_grammar.py + M /python/trunk/Python/ast.c + M /python/trunk/Python/graminit.c + +allow keyword args to be passed in after *args #3473 +----------------------------------- +[http://svn.python.org/view?rev=65874&view=rev r65874] | guido.van.rossum | 2008-08-19 16:13:02 -0400 (Tue, 19 Aug 2008) | 3 lines +Changed paths: + M /python/trunk/Include/object.h + +Hopeful fix for issue 1878: remove Py_TPFLAGS_HAVE_VERSION_TAG from +Py_TPFLAGS_DEFAULT when not building the core. + +----------------------------------- +[http://svn.python.org/view?rev=65880&view=rev r65880] | guido.van.rossum | 2008-08-19 17:02:04 -0400 (Tue, 19 Aug 2008) | 2 lines +Changed paths: + M /python/trunk/Modules/imageop.c + +Issue 1179: [CVE-2007-4965] Integer overflow in imageop module. + +----------------------------------- +[http://svn.python.org/view?rev=65891&view=rev r65891] | amaury.forgeotdarc | 2008-08-19 20:08:47 -0400 (Tue, 19 Aug 2008) | 2 lines +Changed paths: + M /python/trunk/Lib/compiler/transformer.py + M /python/trunk/Lib/test/test_compiler.py + +follow-up of issue3473: update the compiler package to recognize the new syntax. + +----------------------------------- +[http://svn.python.org/view?rev=65894&view=rev r65894] | benjamin.peterson | 2008-08-19 21:44:45 -0400 (Tue, 19 Aug 2008) | 2 lines +Changed paths: + M /python/trunk/Lib/symtable.py + +newSymbolTable is not public API + +----------------------------------- +[http://svn.python.org/view?rev=65898&view=rev r65898] | benjamin.peterson | 2008-08-19 22:15:42 -0400 (Tue, 19 Aug 2008) | 1 line +Changed paths: + M /python/trunk/Lib/symtable.py + +fix silly errors of mine +----------------------------------- +[http://svn.python.org/view?rev=65912&view=rev r65912] | guido.van.rossum | 2008-08-20 10:57:20 -0400 (Wed, 20 Aug 2008) | 2 lines +Changed paths: + M /python/trunk/Misc/NEWS + +News for the imageop fix. + +----------------------------------- +[http://svn.python.org/view?rev=65914&view=rev r65914] | guido.van.rossum | 2008-08-20 11:01:50 -0400 (Wed, 20 Aug 2008) | 2 lines +Changed paths: + M /python/trunk/Misc/NEWS + +News for the tp_flags change. + +----------------------------------- +[http://svn.python.org/view?rev=65971&view=rev r65971] | robert.schuppenies | 2008-08-22 04:03:43 -0400 (Fri, 22 Aug 2008) | 2 lines +Changed paths: + M /python/trunk/Lib/lib-tk/Tkinter.py + +Issue #1342811: Fixed broken patch. Reviewed by benjamin.peterson. + +----------------------------------- +[http://svn.python.org/view?rev=65975&view=rev r65975] | christian.heimes | 2008-08-22 15:34:15 -0400 (Fri, 22 Aug 2008) | 1 line +Changed paths: + M /python/trunk/Misc/NEWS + M /python/trunk/Objects/obmalloc.c + +Changed type of numarenas from uint to size_t to silence a GCC warning on 64bit OSes. Reviewed by Benjamin Peterson. +----------------------------------- +[http://svn.python.org/view?rev=65978&view=rev r65978] | christian.heimes | 2008-08-22 15:55:54 -0400 (Fri, 22 Aug 2008) | 3 lines +Changed paths: + M /python/trunk/Misc/NEWS + M /python/trunk/Modules/_sqlite/row.c + +Silenced a compiler warning in the sqlite module +Modules/_sqlite/row.c:187: warning: suggest parentheses around && within || +Reviewed by Benjamin Peterson +----------------------------------- +[http://svn.python.org/view?rev=65980&view=rev r65980] | christian.heimes | 2008-08-22 16:10:27 -0400 (Fri, 22 Aug 2008) | 3 lines +Changed paths: + M /python/trunk/Misc/NEWS + M /python/trunk/Modules/_collectionsmodule.c + +Fixed two format strings in the _collections module. For example +Modules/_collectionsmodule.c:674: warning: format '%i' expects type 'int', but argument 2 has type 'Py_ssize_t' +Reviewed by Benjamin Peterson +----------------------------------- +[http://svn.python.org/view?rev=65982&view=rev r65982] | benjamin.peterson | 2008-08-22 16:43:48 -0400 (Fri, 22 Aug 2008) | 4 lines +Changed paths: + M /python/trunk/Lib/threading.py + +fix a few get_name() calls and turn then to .name + +Reviewer: Christian Heimes + +----------------------------------- +[http://svn.python.org/view?rev=65984&view=rev r65984] | christian.heimes | 2008-08-22 17:23:47 -0400 (Fri, 22 Aug 2008) | 1 line +Changed paths: + M /python/trunk/Modules/_collectionsmodule.c + +d is the correct format string +----------------------------------- +[http://svn.python.org/view?rev=66000&view=rev r66000] | benjamin.peterson | 2008-08-23 16:27:43 -0400 (Sat, 23 Aug 2008) | 5 lines +Changed paths: + M /python/trunk/Misc/NEWS + M /python/trunk/Modules/_testcapimodule.c + +#3643 add a few more checks to _testcapi to prevent segfaults + +Author: Victor Stinner +Reviewer: Benjamin Peterson + +----------------------------------- +[http://svn.python.org/view?rev=66011&view=rev r66011] | neal.norwitz | 2008-08-24 13:27:43 -0400 (Sun, 24 Aug 2008) | 1 line +Changed paths: + M /python/trunk/Misc/build.sh + +Ignore a couple more tests that report leaks inconsistently. +----------------------------------- +[http://svn.python.org/view?rev=66012&view=rev r66012] | neal.norwitz | 2008-08-24 13:29:53 -0400 (Sun, 24 Aug 2008) | 1 line +Changed paths: + M /python/trunk/Misc/build.sh + +Use the actual blacklist of leaky tests +----------------------------------- +[http://svn.python.org/view?rev=66018&view=rev r66018] | neal.norwitz | 2008-08-24 18:03:05 -0400 (Sun, 24 Aug 2008) | 6 lines +Changed paths: + M /python/trunk/Lib/test/test_fileio.py + M /python/trunk/Modules/_fileio.c + +#3662: Fix segfault introduced when fixing memory leaks. + +TESTED=./python -E -tt ./Lib/test/regrtest.py test_fileio +R (approach from bug)=Amaury and Benjamin + + +----------------------------------- +[http://svn.python.org/view?rev=66076&view=rev r66076] | georg.brandl | 2008-08-30 15:03:43 -0400 (Sat, 30 Aug 2008) | 2 lines +Changed paths: + M /python/trunk/Lib/pydoc.py + +#3707: fix inf. recursion in pydoc topic search. Rev'd by Antoine. + +----------------------------------- +[http://svn.python.org/view?rev=66093&view=rev r66093] | gregory.p.smith | 2008-08-31 12:34:18 -0400 (Sun, 31 Aug 2008) | 3 lines +Changed paths: + M /python/trunk/Lib/hashlib.py + +issue3715: docstring representation of hex escaped string needs to be double +escaped. + +----------------------------------- +[http://svn.python.org/view?rev=66099&view=rev r66099] | benjamin.peterson | 2008-09-01 10:18:30 -0400 (Mon, 01 Sep 2008) | 4 lines +Changed paths: + M /python/trunk/Misc/NEWS + M /python/trunk/Python/import.c + +Fix compilation when --without-threads is given #3683 + +Reviewer: Georg Brandl, Benjamin Peterson + +----------------------------------- +[http://svn.python.org/view?rev=66100&view=rev r66100] | hirokazu.yamamoto | 2008-09-01 10:24:04 -0400 (Mon, 01 Sep 2008) | 3 lines +Changed paths: + M /python/trunk/Lib/msilib/__init__.py + +Issue #3732: Backported r53335 to supress deprecation warning. +Reviewed by Benjamin Peterson. + +----------------------------------- +[http://svn.python.org/view?rev=66103&view=rev r66103] | vinay.sajip | 2008-09-01 10:30:10 -0400 (Mon, 01 Sep 2008) | 1 line +Changed paths: + M /python/trunk/Lib/logging/__init__.py + +logging: fixed lack of use of encoding attribute specified on a stream. +----------------------------------- +[http://svn.python.org/view?rev=66104&view=rev r66104] | hirokazu.yamamoto | 2008-09-01 10:32:58 -0400 (Mon, 01 Sep 2008) | 2 lines +Changed paths: + M /python/trunk/Lib/platform.py + +Issue #3748: platform.architecture() printed vogus message on windows. +Reviewed by Marc-Andre Lemburg. +----------------------------------- +[http://svn.python.org/view?rev=66105&view=rev r66105] | vinay.sajip | 2008-09-01 10:33:59 -0400 (Mon, 01 Sep 2008) | 1 line +Changed paths: + M /python/trunk/Misc/NEWS + +logging: fixed lack of use of encoding attribute specified on a stream. +----------------------------------- +[http://svn.python.org/view?rev=66119&view=rev r66119] | amaury.forgeotdarc | 2008-09-01 15:52:00 -0400 (Mon, 01 Sep 2008) | 5 lines +Changed paths: + M /python/trunk/Lib/test/string_tests.py + M /python/trunk/Misc/NEWS + M /python/trunk/Objects/stringobject.c + +Issue #3751: str.rpartition would perform a left-partition when called with +a unicode argument. + +will backport. + +----------------------------------- +[http://svn.python.org/view?rev=66141&view=rev r66141] | gregory.p.smith | 2008-09-02 01:29:51 -0400 (Tue, 02 Sep 2008) | 3 lines +Changed paths: + M /python/trunk/Makefile.pre.in + M /python/trunk/Misc/NEWS + +Issue #3678: Correctly pass LDFLAGS and LDLAST to the linker on shared +library targets in the Makefile. + +----------------------------------- +[http://svn.python.org/view?rev=66142&view=rev r66142] | gregory.p.smith | 2008-09-02 01:36:11 -0400 (Tue, 02 Sep 2008) | 3 lines +Changed paths: + M /python/trunk/Lib/os.py + M /python/trunk/Lib/test/test_os.py + M /python/trunk/Misc/NEWS + +Issue #3708: os.urandom no longer goes into an infinite loop when passed a +non-integer floating point number. + +----------------------------------- +[http://svn.python.org/view?rev=66145&view=rev r66145] | marc-andre.lemburg | 2008-09-02 06:32:34 -0400 (Tue, 02 Sep 2008) | 5 lines +Changed paths: + M /python/trunk/Lib/platform.py + +Add quotes around the file name to avoid issues with spaces. + +Closes #3719. + + +----------------------------------- +[http://svn.python.org/view?rev=66167&view=rev r66167] | amaury.forgeotdarc | 2008-09-02 17:50:47 -0400 (Tue, 02 Sep 2008) | 5 lines +Changed paths: + M /python/trunk/PC/VS7.1/pythoncore.vcproj + M /python/trunk/PC/VS7.1/readme.txt + +Attempt to correct the build files for the Microsoft VS7.1 compiler. + +I don't have a working VS7.1, but VS2005 can automatically convert +the project and build a working python interpreter. + +----------------------------------- +[http://svn.python.org/view?rev=66171&view=rev r66171] | amaury.forgeotdarc | 2008-09-02 19:19:56 -0400 (Tue, 02 Sep 2008) | 9 lines +Changed paths: + M /python/trunk/Lib/distutils/msvc9compiler.py + M /python/trunk/Misc/NEWS + +Issue 2975: when compiling multiple extension modules with visual studio 2008 +from the same python instance, some environment variables (LIB, INCLUDE) +would grow without limit. + +Tested with these statements: + distutils.ccompiler.new_compiler().initialize() + print os.environ['LIB'] +But I don't know how to turn them into reliable unit tests. + +----------------------------------- +[http://svn.python.org/view?rev=66179&view=rev r66179] | gregory.p.smith | 2008-09-03 01:57:48 -0400 (Wed, 03 Sep 2008) | 7 lines +Changed paths: + M /python/trunk/configure + M /python/trunk/configure.in + +Fix issue 3645: OpenBSD required -lcurses when linking with readline +to get the correct completion_matches function to avoid crashes on +x86_64 (amd64). + +I don't have OpenBSD to test myself. I tested that it does not break +anything on linux. It is simple. + +----------------------------------- +[http://svn.python.org/view?rev=66180&view=rev r66180] | vinay.sajip | 2008-09-03 05:20:05 -0400 (Wed, 03 Sep 2008) | 1 line +Changed paths: + M /python/trunk/Lib/logging/config.py + M /python/trunk/Lib/test/test_logging.py + M /python/trunk/Misc/NEWS + +Issue #3726: Allowed spaces in separators in logging configuration files. +----------------------------------- +[http://svn.python.org/view?rev=66181&view=rev r66181] | marc-andre.lemburg | 2008-09-03 07:13:56 -0400 (Wed, 03 Sep 2008) | 4 lines +Changed paths: + M /python/trunk/Lib/distutils/dist.py + M /python/trunk/Lib/distutils/tests/test_dist.py + M /python/trunk/Misc/NEWS + +Issue #2562: Fix distutils PKG-INFO writing logic to allow having +non-ascii characters and Unicode in setup.py meta-data. + + +----------------------------------- +[http://svn.python.org/view?rev=66182&view=rev r66182] | jesus.cea | 2008-09-03 13:50:32 -0400 (Wed, 03 Sep 2008) | 1 line +Changed paths: + M /python/trunk/Modules/_bsddb.c + M /python/trunk/Modules/bsddb.h + +Fix some leaks - Neal Norwitz +----------------------------------- +[http://svn.python.org/view?rev=66211&view=rev r66211] | vinay.sajip | 2008-09-04 03:31:21 -0400 (Thu, 04 Sep 2008) | 1 line +Changed paths: + M /python/trunk/Lib/logging/__init__.py + M /python/trunk/Lib/test/test_logging.py + M /python/trunk/Misc/NEWS + +Issue #3772: Fixed regression problem in StreamHandler.emit(). +----------------------------------- +[http://svn.python.org/view?rev=66213&view=rev r66213] | hirokazu.yamamoto | 2008-09-04 07:15:14 -0400 (Thu, 04 Sep 2008) | 2 lines +Changed paths: + M /python/trunk/Lib/platform.py + +Issue #3762: platform.architecture() fails if python is lanched via its symbolic link. +Reviewed by Amaury Forgeot d'Arc. +----------------------------------- +[http://svn.python.org/view?rev=66237&view=rev r66237] | brett.cannon | 2008-09-05 18:59:17 -0400 (Fri, 05 Sep 2008) | 7 lines +Changed paths: + M /python/trunk/Makefile.pre.in + M /python/trunk/Misc/NEWS + +GNU coding guidelines say that ``make check`` should verify the build. That +clashes with what Python's build target did. Rename the target to 'patchcheck' +to avoid the culture clash. + +Closes issue 3758. +Reviewed by Benjamin Peterson. + +----------------------------------- +[http://svn.python.org/view?rev=66240&view=rev r66240] | antoine.pitrou | 2008-09-05 19:30:23 -0400 (Fri, 05 Sep 2008) | 5 lines +Changed paths: + M /python/trunk/Lib/zipfile.py + M /python/trunk/Misc/NEWS + +Issue #3535: zipfile couldn't read some zip files larger than 2GB. + +Reviewed by Amaury Forgeot d'Arc. + + +----------------------------------- +[http://svn.python.org/view?rev=66264&view=rev r66264] | benjamin.peterson | 2008-09-06 15:42:39 -0400 (Sat, 06 Sep 2008) | 1 line +Changed paths: + M /python/trunk/README + +docs are pretty good about new-style classes these days +----------------------------------- +[http://svn.python.org/view?rev=66270&view=rev r66270] | amaury.forgeotdarc | 2008-09-06 16:53:51 -0400 (Sat, 06 Sep 2008) | 3 lines +Changed paths: + M /python/trunk/Lib/test/test_float.py + M /python/trunk/Misc/NEWS + +#3796: A test class was not run in test_float. +Reviewed by Benjamin. + +----------------------------------- +[http://svn.python.org/view?rev=66275&view=rev r66275] | antoine.pitrou | 2008-09-06 19:04:32 -0400 (Sat, 06 Sep 2008) | 3 lines +Changed paths: + M /python/trunk/Lib/threading.py + +Backport relevant part of [http://svn.python.org/view?rev=66274&view=rev r66274] (in issue #874900). + + +----------------------------------- +[http://svn.python.org/view?rev=66282&view=rev r66282] | josiah.carlson | 2008-09-07 00:37:10 -0400 (Sun, 07 Sep 2008) | 3 lines +Changed paths: + M /python/trunk/Lib/asyncore.py + +undoing change that broke trunk. Need to find a better solution to this. + + +----------------------------------- +[http://svn.python.org/view?rev=66283&view=rev r66283] | gregory.p.smith | 2008-09-07 01:15:18 -0400 (Sun, 07 Sep 2008) | 5 lines +Changed paths: + M /python/trunk/Misc/NEWS + M /python/trunk/configure.in + M /python/trunk/pyconfig.h.in + +- Issue #1204: The configure script now tests for additional libraries + that may be required when linking against readline. This fixes issues + with x86_64 builds on some platforms (at least a few Linux flavors as + well as OpenBSD/amd64). + +----------------------------------- +[http://svn.python.org/view?rev=66284&view=rev r66284] | gregory.p.smith | 2008-09-07 01:15:58 -0400 (Sun, 07 Sep 2008) | 2 lines +Changed paths: + M /python/trunk/configure + +reran autoconf for [http://svn.python.org/view?rev=66283&view=rev r66283]'s checkin + +----------------------------------- +[http://svn.python.org/view?rev=66295&view=rev r66295] | gregory.p.smith | 2008-09-07 15:18:16 -0400 (Sun, 07 Sep 2008) | 2 lines +Changed paths: + M /python/trunk/configure.in + +bugfix to [http://svn.python.org/view?rev=66283&view=rev r66283] (see issue #1204). + +----------------------------------- +[http://svn.python.org/view?rev=66296&view=rev r66296] | gregory.p.smith | 2008-09-07 15:19:04 -0400 (Sun, 07 Sep 2008) | 2 lines +Changed paths: + M /python/trunk/configure + +reran autoconf + +----------------------------------- +[http://svn.python.org/view?rev=66304&view=rev r66304] | martin.v.loewis | 2008-09-08 08:02:45 -0400 (Mon, 08 Sep 2008) | 2 lines +Changed paths: + M /python/trunk/Misc/NEWS + M /python/trunk/Tools/msi/merge.py + +Allow passing the MSI file name to merge.py. + +----------------------------------- +[http://svn.python.org/view?rev=66305&view=rev r66305] | martin.v.loewis | 2008-09-08 09:50:10 -0400 (Mon, 08 Sep 2008) | 3 lines +Changed paths: + M /python/trunk/Misc/NEWS + M /python/trunk/Tools/msi/msi.py + +Issue #2271: Set SecureCustomProperties so that installation will properly +use the TARGETDIR even for unprivileged users. + +----------------------------------- +[http://svn.python.org/view?rev=66332&view=rev r66332] | amaury.forgeotdarc | 2008-09-09 03:24:30 -0400 (Tue, 09 Sep 2008) | 6 lines +Changed paths: + M /python/trunk/Lib/test/test_long.py + M /python/trunk/Misc/NEWS + M /python/trunk/Objects/floatobject.c + +#3777: long(4.2) returned an int, and broke backward compatibility. +the __long__ slot is allowed to return either int or long, but the behaviour of +float objects should not change between 2.5 and 2.6. + +Reviewed by Benjamin Peterson + +----------------------------------- +[http://svn.python.org/view?rev=66337&view=rev r66337] | vinay.sajip | 2008-09-09 09:42:08 -0400 (Tue, 09 Sep 2008) | 1 line +Changed paths: + M /python/trunk/Lib/test/test_logging.py + M /python/trunk/Misc/NEWS + +Issue #3809: Fixed spurious 'test.blah' file left behind by test_logging. +----------------------------------- +[http://svn.python.org/view?rev=66347&view=rev r66347] | georg.brandl | 2008-09-09 15:26:00 -0400 (Tue, 09 Sep 2008) | 2 lines +Changed paths: + M /python/trunk/Objects/unicodeobject.c + +Fix varname in docstring. #3822. + +----------------------------------- +[http://svn.python.org/view?rev=66352&view=rev r66352] | benjamin.peterson | 2008-09-09 16:55:01 -0400 (Tue, 09 Sep 2008) | 4 lines +Changed paths: + M /python/trunk/Lib/test/test_weakref.py + M /python/trunk/Misc/NEWS + M /python/trunk/Objects/weakrefobject.c + +Fix #3634 invalid return value from _weakref.ref(Exception).__init__ + +Reviewers: Amaury, Antoine, Benjamin + +----------------------------------- +[http://svn.python.org/view?rev=66362&view=rev r66362] | martin.v.loewis | 2008-09-10 09:38:12 -0400 (Wed, 10 Sep 2008) | 3 lines +Changed paths: + M /python/trunk/Doc/library/unicodedata.rst + M /python/trunk/Lib/test/test_unicodedata.py + M /python/trunk/Misc/NEWS + M /python/trunk/Modules/unicodedata.c + M /python/trunk/Modules/unicodedata_db.h + M /python/trunk/Modules/unicodename_db.h + M /python/trunk/Objects/unicodectype.c + M /python/trunk/Objects/unicodetype_db.h + M /python/trunk/Tools/unicode/makeunicodedata.py + +Issue #3811: The Unicode database was updated to 5.1. +Reviewed by Fredrik Lundh and Marc-Andre Lemburg. + +----------------------------------- +[http://svn.python.org/view?rev=66364&view=rev r66364] | guido.van.rossum | 2008-09-10 10:27:00 -0400 (Wed, 10 Sep 2008) | 3 lines +Changed paths: + M /python/trunk/Lib/test/test_re.py + M /python/trunk/Misc/NEWS + M /python/trunk/Modules/_sre.c + +- Issue #3629: Fix sre "bytecode" validator for an end case. + Reviewed by Amaury. + +----------------------------------- +[http://svn.python.org/view?rev=66379&view=rev r66379] | benjamin.peterson | 2008-09-10 18:28:00 -0400 (Wed, 10 Sep 2008) | 1 line +Changed paths: + M /python/trunk/Parser/asdl_c.py + +update asdl_c.py from [http://svn.python.org/view?rev=66377&view=rev r66377] +----------------------------------- +[http://svn.python.org/view?rev=66383&view=rev r66383] | martin.v.loewis | 2008-09-11 02:53:30 -0400 (Thu, 11 Sep 2008) | 3 lines +Changed paths: + M /python/trunk/Misc/NEWS + M /python/trunk/Objects/obmalloc.c + +Issue #3642: Suppress warning in obmalloc when size_t is +larger than uint. Reverts [http://svn.python.org/view?rev=65975&view=rev r65975]. Reviewed by Brett Cannon. + +----------------------------------- +[http://svn.python.org/view?rev=66390&view=rev r66390] | amaury.forgeotdarc | 2008-09-11 16:56:13 -0400 (Thu, 11 Sep 2008) | 4 lines +Changed paths: + M /python/trunk/Misc/NEWS + M /python/trunk/Misc/find_recursionlimit.py + M /python/trunk/Modules/cPickle.c + +#3640: Correct a crash in cPickle on 64bit platforms, in the case of deeply nested lists or dicts. + +Reviewed by Martin von Loewis. + +----------------------------------- +[http://svn.python.org/view?rev=66404&view=rev r66404] | gerhard.haering | 2008-09-12 09:54:06 -0400 (Fri, 12 Sep 2008) | 2 lines +Changed paths: + M /python/trunk/Misc/NEWS + M /python/trunk/Modules/_sqlite/connection.c + +sqlite3 module: Mark iterdump() method as "Non-standard" like all the other methods not found in DB-API. + +----------------------------------- +[http://svn.python.org/view?rev=66412&view=rev r66412] | gerhard.haering | 2008-09-12 14:58:57 -0400 (Fri, 12 Sep 2008) | 2 lines +Changed paths: + M /python/trunk/Misc/NEWS + M /python/trunk/Modules/_sqlite/connection.c + M /python/trunk/Modules/_sqlite/cursor.c + M /python/trunk/Modules/_sqlite/microprotocols.c + M /python/trunk/Modules/_sqlite/microprotocols.h + M /python/trunk/Modules/_sqlite/module.c + M /python/trunk/Modules/_sqlite/statement.c + M /python/trunk/Modules/_sqlite/util.c + M /python/trunk/Modules/_sqlite/util.h + +Fixes issue #3103. In the sqlite3 module, made one more function static. All renaming public symbos now have the pysqlite prefix to avoid name clashes. This at least once created problems where the same symbol name appeared somewhere in Apache and the sqlite3 module was used from mod_python. + +----------------------------------- +[http://svn.python.org/view?rev=66414&view=rev r66414] | gerhard.haering | 2008-09-12 18:33:22 -0400 (Fri, 12 Sep 2008) | 2 lines +Changed paths: + M /python/trunk/Misc/NEWS + M /python/trunk/Modules/_sqlite/cursor.c + M /python/trunk/Modules/_sqlite/statement.c + +Issue #3846: Release GIL during calls to sqlite3_prepare. This improves concurrent access to the same database file from multiple threads/processes. + +----------------------------------- +[http://svn.python.org/view?rev=66439&view=rev r66439] | martin.v.loewis | 2008-09-13 04:11:57 -0400 (Sat, 13 Sep 2008) | 1 line +Changed paths: + M /python/trunk/Misc/NEWS + M /python/trunk/Tools/msi/msi.py + +Issue #3833: Use a different upgrade code for Win64 installers. +----------------------------------- +[http://svn.python.org/view?rev=66441&view=rev r66441] | martin.v.loewis | 2008-09-13 04:36:22 -0400 (Sat, 13 Sep 2008) | 1 line +Changed paths: + M /python/trunk/Tools/msi/msi.py + +Change product code of Win64 installer to allow simultaneous installation on Win32 and Win64; also change product name to be able to distinguish the two in ARP. +----------------------------------- +[http://svn.python.org/view?rev=66457&view=rev r66457] | antoine.pitrou | 2008-09-13 16:30:30 -0400 (Sat, 13 Sep 2008) | 5 lines +Changed paths: + M /python/trunk/Misc/NEWS + M /python/trunk/Misc/find_recursionlimit.py + +Issue #3850: Misc/find_recursionlimit.py was broken. + +Reviewed by A.M. Kuchling. + + +----------------------------------- +[http://svn.python.org/view?rev=66460&view=rev r66460] | martin.v.loewis | 2008-09-14 16:22:39 -0400 (Sun, 14 Sep 2008) | 1 line +Changed paths: + M /python/trunk/Misc/NEWS + A /python/trunk/Tools/msi/crtlicense.txt + M /python/trunk/Tools/msi/msi.py + +Issue #3617: Include a licensing statement regarding the Microsoft C runtime in the Windows installer. +----------------------------------- +[http://svn.python.org/view?rev=66461&view=rev r66461] | martin.v.loewis | 2008-09-14 16:25:40 -0400 (Sun, 14 Sep 2008) | 1 line +Changed paths: + M /python/trunk/Tools/msi/crtlicense.txt + +Set eol-style to native. +----------------------------------- +[http://svn.python.org/view?rev=66463&view=rev r66463] | martin.v.loewis | 2008-09-14 21:30:21 -0400 (Sun, 14 Sep 2008) | 2 lines +Changed paths: + M /python/trunk/Tools/msi/crtlicense.txt + +Fix grammar. + +----------------------------------- +[http://svn.python.org/view?rev=66496&view=rev r66496] | benjamin.peterson | 2008-09-17 21:22:16 -0400 (Wed, 17 Sep 2008) | 1 line +Changed paths: + M /python/trunk/Lib/test/test_hashlib.py + M /python/trunk/Misc/NEWS + M /python/trunk/Modules/_hashopenssl.c + +fix possible integer overflows in _hashopenssl #3886 +----------------------------------- +[http://svn.python.org/view?rev=66498&view=rev r66498] | mark.hammond | 2008-09-17 22:47:35 -0400 (Wed, 17 Sep 2008) | 4 lines +Changed paths: + M /python/trunk/Lib/bsddb/test/test_replication.py + +On Windows, temporarily disable the bsddb test referenced in bug 3892. +We do yell to stderr and the bug is marked as a blocker. +Reviewed by barry in #python-dev. + +----------------------------------- +[http://svn.python.org/view?rev=66502&view=rev r66502] | mark.hammond | 2008-09-17 23:51:46 -0400 (Wed, 17 Sep 2008) | 3 lines +Changed paths: + M /python/trunk/Lib/distutils/msvc9compiler.py + +avoid putting unicode objects in the environment causing +later test failures. As discussed on #python-dev + +----------------------------------- +[http://svn.python.org/view?rev=66508&view=rev r66508] | benjamin.peterson | 2008-09-18 19:20:28 -0400 (Thu, 18 Sep 2008) | 1 line +Changed paths: + M /python/trunk/Modules/config.c.in + +tabify +----------------------------------- +[http://svn.python.org/view?rev=66514&view=rev r66514] | martin.v.loewis | 2008-09-19 11:21:07 -0400 (Fri, 19 Sep 2008) | 2 lines +Changed paths: + M /python/trunk/Misc/NEWS + M /python/trunk/Tools/msi/merge.py + +Bug #3887: Package x64 version of CRT for AMD64 +Windows binaries. +----------------------------------- +[http://svn.python.org/view?rev=66516&view=rev r66516] | martin.v.loewis | 2008-09-19 15:20:03 -0400 (Fri, 19 Sep 2008) | 1 line +Changed paths: + M /python/trunk/Tools/msi/msi.py + +Use AMD64 version of CRT in just-for-me installations for Win64 installers. +----------------------------------- +[http://svn.python.org/view?rev=66523&view=rev r66523] | georg.brandl | 2008-09-21 03:14:44 -0400 (Sun, 21 Sep 2008) | 2 lines +Changed paths: + M /python/trunk/Doc/library/select.rst + M /python/trunk/Modules/selectmodule.c + +#3852: fix some select.kqueue and kevent docs. + +----------------------------------- +[http://svn.python.org/view?rev=66525&view=rev r66525] | georg.brandl | 2008-09-21 03:17:00 -0400 (Sun, 21 Sep 2008) | 2 lines +Changed paths: + M /python/trunk/Doc/using/windows.rst + M /python/trunk/PCbuild/readme.txt + +#3916: fixes for docs wrt. Windows directory layout + +----------------------------------- +[http://svn.python.org/view?rev=66529&view=rev r66529] | georg.brandl | 2008-09-21 03:24:11 -0400 (Sun, 21 Sep 2008) | 2 lines +Changed paths: + M /python/trunk/PCbuild/readme.txt + +#3901: bsddb fix. + +----------------------------------- +[http://svn.python.org/view?rev=66530&view=rev r66530] | georg.brandl | 2008-09-21 03:31:52 -0400 (Sun, 21 Sep 2008) | 2 lines +Changed paths: + M /python/trunk/Modules/Setup.dist + +#3897: _collections now has an underscore. + +----------------------------------- +[http://svn.python.org/view?rev=66542&view=rev r66542] | hirokazu.yamamoto | 2008-09-21 16:48:41 -0400 (Sun, 21 Sep 2008) | 2 lines +Changed paths: + M /python/trunk/Lib/distutils/tests/test_build_ext.py + +Issue #3925: Ignores shutil.rmtree error on cygwin too. +Reviewed by Benjamin Peterson. +----------------------------------- +[http://svn.python.org/view?rev=66544&view=rev r66544] | benjamin.peterson | 2008-09-21 17:27:51 -0400 (Sun, 21 Sep 2008) | 4 lines +Changed paths: + M /python/trunk/Lib/test/test_urllib.py + M /python/trunk/Lib/urllib.py + M /python/trunk/Misc/NEWS + +#3879 fix a regression in urllib.getproxies_environment + +reviewers: Benjamin, Georg + +----------------------------------- +[http://svn.python.org/view?rev=66552&view=rev r66552] | andrew.macintyre | 2008-09-22 10:10:54 -0400 (Mon, 22 Sep 2008) | 5 lines +Changed paths: + M /python/trunk/Objects/floatobject.c + +should use macro'ed symbols not direct + +Part of source_os2emx.patch in issue 3868 +Reviewed by Amaury Forgeot d'Arc + +----------------------------------- +[http://svn.python.org/view?rev=66553&view=rev r66553] | andrew.macintyre | 2008-09-22 10:11:41 -0400 (Mon, 22 Sep 2008) | 5 lines +Changed paths: + M /python/trunk/Python/pymath.c + +any platform without HAVE_LOG1P should have DBL_EPSILON in + +Part of source_os2emx.patch in issue 3868 +Reviewed by Amaury Forgeot d'Arc + +----------------------------------- +[http://svn.python.org/view?rev=66554&view=rev r66554] | andrew.macintyre | 2008-09-22 10:23:45 -0400 (Mon, 22 Sep 2008) | 8 lines +Changed paths: + M /python/trunk/Include/pystrcmp.h + M /python/trunk/Lib/test/test_io.py + M /python/trunk/PC/os2emx/Makefile + M /python/trunk/PC/os2emx/config.c + M /python/trunk/PC/os2emx/pyconfig.h + +build_os2emx.patch in issue 3868 - update OS/2 EMX makefile and config files + +Part of source_os2emx.patch in issue 3868: + Include/pystrcmp.h: OS/2 has same C APIs as Windows + Lib/test/test_io.py: OS/2 has same behaviour as Windows for this test + +Reviewed by Amaury Forgeot d'Arc + +----------------------------------- +[http://svn.python.org/view?rev=66566&view=rev r66566] | hirokazu.yamamoto | 2008-09-23 12:11:09 -0400 (Tue, 23 Sep 2008) | 2 lines +Changed paths: + M /python/trunk/Modules/_fileio.c + +Issue #3945: Fixed compile error on cygwin. (initializer element is not constant) +Reviewed by Amaury Forgeot d'Arc. +----------------------------------- +[http://svn.python.org/view?rev=66568&view=rev r66568] | jesus.cea | 2008-09-23 14:54:08 -0400 (Tue, 23 Sep 2008) | 5 lines +Changed paths: + M /python/trunk/Lib/bsddb/test/test_basics.py + M /python/trunk/Modules/_bsddb.c + M /python/trunk/Modules/bsddb.h + +Bugfix for issue3885 and 'DB.verify()' crash. + +Reviewed by Nick Coghlan. + + +----------------------------------- +[http://svn.python.org/view?rev=66611&view=rev r66611] | thomas.heller | 2008-09-24 14:26:05 -0400 (Wed, 24 Sep 2008) | 3 lines +Changed paths: + M /python/trunk/Lib/ctypes/test/test_bitfields.py + M /python/trunk/Misc/NEWS + M /python/trunk/Modules/_ctypes/cfield.c + +Fix issue #3547: ctypes is confused by bitfields of varying integer types + +Reviewed by Fredrik Lundh and Skip Montanaro. +----------------------------------- +[http://svn.python.org/view?rev=66614&view=rev r66614] | benjamin.peterson | 2008-09-24 18:11:59 -0400 (Wed, 24 Sep 2008) | 4 lines +Changed paths: + M /python/trunk/Lib/lib-tk/turtle.py + +#3950 fix missing scale factors in turtle.py + +reviewers: Georg, Benjamin + +----------------------------------- +[http://svn.python.org/view?rev=66616&view=rev r66616] | martin.v.loewis | 2008-09-25 00:12:50 -0400 (Thu, 25 Sep 2008) | 2 lines +Changed paths: + M /python/trunk/Misc/NEWS + M /python/trunk/Objects/obmalloc.c + +Bug #3951: Py_USING_MEMORY_DEBUGGER should not be enabled by default. + +----------------------------------- +[http://svn.python.org/view?rev=66620&view=rev r66620] | amaury.forgeotdarc | 2008-09-25 16:52:56 -0400 (Thu, 25 Sep 2008) | 5 lines +Changed paths: + M /python/trunk/Lib/test/test_file.py + M /python/trunk/Misc/NEWS + M /python/trunk/Objects/fileobject.c + +#3965: on Windows, open() crashes if the filename or the mode is invalid, +and if the filename is a unicode string. + +Reviewed by Martin von Loewis. + +----------------------------------- +[http://svn.python.org/view?rev=66624&view=rev r66624] | raymond.hettinger | 2008-09-25 19:31:52 -0400 (Thu, 25 Sep 2008) | 1 line +Changed paths: + M /python/trunk/Lib/collections.py + M /python/trunk/Lib/test/test_collections.py + +Fix namedtuple bug reported by Glenn Linderman. Template did not form correctly if the field names were input in Unicode. +----------------------------------- +[http://svn.python.org/view?rev=66657&view=rev r66657] | benjamin.peterson | 2008-09-27 18:08:12 -0400 (Sat, 27 Sep 2008) | 1 line +Changed paths: + M /python/trunk/Lib/ftplib.py + +backport [http://svn.python.org/view?rev=66656&view=rev r66656] so people using -Qnew aren't affected +----------------------------------- +[http://svn.python.org/view?rev=66676&view=rev r66676] | jesus.cea | 2008-09-28 19:24:19 -0400 (Sun, 28 Sep 2008) | 1 line +Changed paths: + M /python/trunk/Misc/NEWS + M /python/trunk/Modules/bsddb.h + +bsddb4.7.3pre9 renamed to 4.7.3 +----------------------------------- +[http://svn.python.org/view?rev=66677&view=rev r66677] | brett.cannon | 2008-09-28 23:41:21 -0400 (Sun, 28 Sep 2008) | 7 lines +Changed paths: + M /python/trunk/Lib/test/test_cprofile.py + M /python/trunk/Misc/NEWS + M /python/trunk/Modules/_lsprof.c + +The _lsprof module could crash the interpreter if it was given an external +timer that did not return a float and a timer was still running when the +Profiler object was garbage collected. + +Fixes issue 3895. +Code review by Benjamin Peterson. + +----------------------------------- +[http://svn.python.org/view?rev=66681&view=rev r66681] | georg.brandl | 2008-09-29 12:51:35 -0400 (Mon, 29 Sep 2008) | 2 lines +Changed paths: + M /python/trunk/PCbuild/readme.txt + +Update nasm location. + +----------------------------------- +[http://svn.python.org/view?rev=66683&view=rev r66683] | thomas.heller | 2008-09-29 15:56:24 -0400 (Mon, 29 Sep 2008) | 1 line +Changed paths: + M /python/trunk/Lib/ctypes/test/test_bitfields.py + M /python/trunk/Modules/_ctypes/cfield.c + +Fix issue #3547 for MingW, update comments. +----------------------------------- +[http://svn.python.org/view?rev=66686&view=rev r66686] | martin.v.loewis | 2008-09-29 18:09:07 -0400 (Mon, 29 Sep 2008) | 5 lines +Changed paths: + M /python/trunk/Demo/turtle/turtleDemo.py + M /python/trunk/Doc/library/turtle.rst + M /python/trunk/Lib/lib-tk/turtle.py + M /python/trunk/Misc/NEWS + +Issue #3965: Allow repeated calls to turtle.Screen, by making it a +true singleton object. + +Reviewed by Gregor Lingl. + +----------------------------------- +[http://svn.python.org/view?rev=66689&view=rev r66689] | benjamin.peterson | 2008-09-29 21:31:49 -0400 (Mon, 29 Sep 2008) | 5 lines +Changed paths: + M /python/trunk/Lib/test/test_imageop.py + M /python/trunk/Misc/NEWS + M /python/trunk/Modules/imageop.c + +fix security issue 2: imageop's poor validation of arguments could result in segfaults + +patch by Victor Stinner +reviewed by myself and Brett + +----------------------------------- +[http://svn.python.org/view?rev=66700&view=rev r66700] | brett.cannon | 2008-09-30 13:46:03 -0400 (Tue, 30 Sep 2008) | 5 lines +Changed paths: + M /python/trunk/Modules/_lsprof.c + +Fix a refleak introduced by [http://svn.python.org/view?rev=66677&view=rev r66677]. + +Fix suggested by Amaury Forgeot d'Arc. +Closes issue #4003. + +----------------------------------- +[http://svn.python.org/view?rev=66703&view=rev r66703] | gregory.p.smith | 2008-09-30 16:41:13 -0400 (Tue, 30 Sep 2008) | 6 lines +Changed paths: + M /python/trunk/Doc/library/os.rst + M /python/trunk/Lib/test/test_threading.py + M /python/trunk/Misc/NEWS + +Works around issue3863: freebsd4/5/6 and os2emx are known to have OS bugs when +calling fork() from a child thread. This disables that unit test (with a note +printed to stderr) on those platforms. + +A caveat about buggy platforms is added to the os.fork documentation. + From python-checkins at python.org Wed Oct 8 14:21:19 2008 From: python-checkins at python.org (andrew.kuchling) Date: Wed, 8 Oct 2008 14:21:19 +0200 (CEST) Subject: [Python-checkins] r66850 - in sandbox/trunk/py2.5.3: demo-only.txt doc-only.txt test-only.txt Message-ID: <20081008122119.B3AF81E4002@bag.python.org> Author: andrew.kuchling Date: Wed Oct 8 14:21:18 2008 New Revision: 66850 Log: Add files listing commits that only touch the Doc/, Demo/, or Lib/test/ directories Added: sandbox/trunk/py2.5.3/demo-only.txt sandbox/trunk/py2.5.3/doc-only.txt sandbox/trunk/py2.5.3/test-only.txt Added: sandbox/trunk/py2.5.3/demo-only.txt ============================================================================== --- (empty file) +++ sandbox/trunk/py2.5.3/demo-only.txt Wed Oct 8 14:21:18 2008 @@ -0,0 +1,103 @@ +Commits that only affect the Demo/ directory -- lower-priority for +2.5.3 than commits that fix bugs in library or interpreter code. + +----------------------------------- +[http://svn.python.org/view?rev=61020&view=rev r61020] | georg.brandl | 2008-02-23 17:14:02 -0500 (Sat, 23 Feb 2008) | 2 lines +Changed paths: + M /python/trunk/Demo/tkinter/guido/ShellWindow.py + +Use os.closerange(). + + +----------------------------------- +[http://svn.python.org/view?rev=65798&view=rev r65798] | benjamin.peterson | 2008-08-17 21:27:05 -0400 (Sun, 17 Aug 2008) | 1 line +Changed paths: + M /python/trunk/Demo/embed/Makefile + +correct version + +----------------------------------- +[http://svn.python.org/view?rev=65861&view=rev r65861] | benjamin.peterson | 2008-08-19 13:59:23 -0400 (Tue, 19 Aug 2008) | 1 line +Changed paths: + M /python/trunk/Demo/parser/unparse.py + +get unparse to at least unparse its self + +----------------------------------- +[http://svn.python.org/view?rev=66424&view=rev r66424] | andrew.kuchling | 2008-09-12 21:22:08 -0400 (Fri, 12 Sep 2008) | 1 line +Changed paths: + M /python/trunk/Demo/curses/life.py + M /python/trunk/Demo/curses/ncurses.py + +#687648 from Robert Schuppenies: use classic division. (RM Barry gave permission to update the demos.) + +----------------------------------- +[http://svn.python.org/view?rev=66425&view=rev r66425] | andrew.kuchling | 2008-09-12 21:27:33 -0400 (Fri, 12 Sep 2008) | 1 line +Changed paths: + M /python/trunk/Demo/threads/Generator.py + +#687648 from Robert Schuppenies: use classic division. From me: don't use string exception; flush stdout after printing + +----------------------------------- +[http://svn.python.org/view?rev=66426&view=rev r66426] | andrew.kuchling | 2008-09-12 21:34:41 -0400 (Fri, 12 Sep 2008) | 1 line +Changed paths: + M /python/trunk/Demo/classes/Dates.py + +#687648 from Robert Schuppenies: use classic division. From me: don't use string exception; add __main__ section + +----------------------------------- +[http://svn.python.org/view?rev=66427&view=rev r66427] | andrew.kuchling | 2008-09-12 21:42:55 -0400 (Fri, 12 Sep 2008) | 1 line +Changed paths: + M /python/trunk/Demo/md5test/md5driver.py + +#687648 from Robert Schuppenies: use classic division. From me: remove two stray semicolons + +----------------------------------- +[http://svn.python.org/view?rev=66428&view=rev r66428] | andrew.kuchling | 2008-09-12 21:43:28 -0400 (Fri, 12 Sep 2008) | 1 line +Changed paths: + M /python/trunk/Demo/pdist/cmptree.py + M /python/trunk/Demo/rpc/xdr.py + M /python/trunk/Demo/scripts/fact.py + M /python/trunk/Demo/scripts/ftpstats.py + M /python/trunk/Demo/scripts/lpwatch.py + M /python/trunk/Demo/scripts/markov.py + M /python/trunk/Demo/scripts/pi.py + M /python/trunk/Demo/scripts/unbirthday.py + M /python/trunk/Demo/sockets/ftp.py + M /python/trunk/Demo/tkinter/guido/hanoi.py + M /python/trunk/Demo/tkinter/guido/solitaire.py + M /python/trunk/Demo/tkinter/guido/sortvisu.py + +#687648 from Robert Schuppenies: use classic division. + +----------------------------------- +[http://svn.python.org/view?rev=66429&view=rev r66429] | andrew.kuchling | 2008-09-12 21:47:02 -0400 (Fri, 12 Sep 2008) | 1 line +Changed paths: + M /python/trunk/Demo/scripts/newslist.py + +Remove semicolon + +----------------------------------- +[http://svn.python.org/view?rev=66430&view=rev r66430] | andrew.kuchling | 2008-09-12 21:48:36 -0400 (Fri, 12 Sep 2008) | 1 line +Changed paths: + M /python/trunk/Demo/classes/bitvec.py + +Subclass exception + +----------------------------------- +[http://svn.python.org/view?rev=66431&view=rev r66431] | andrew.kuchling | 2008-09-12 21:56:56 -0400 (Fri, 12 Sep 2008) | 1 line +Changed paths: + M /python/trunk/Demo/rpc/nfsclient.py + +Fix SyntaxError + +----------------------------------- +[http://svn.python.org/view?rev=66432&view=rev r66432] | andrew.kuchling | 2008-09-12 21:57:25 -0400 (Fri, 12 Sep 2008) | 1 line +Changed paths: + M /python/trunk/Demo/classes/bitvec.py + M /python/trunk/Demo/rpc/rpc.py + M /python/trunk/Demo/scripts/fact.py + M /python/trunk/Demo/threads/Coroutine.py + +Update uses of string exceptions + Added: sandbox/trunk/py2.5.3/doc-only.txt ============================================================================== --- (empty file) +++ sandbox/trunk/py2.5.3/doc-only.txt Wed Oct 8 14:21:18 2008 @@ -0,0 +1,3412 @@ +Commits that only affect the Doc/ directory -- lower-priority for +2.5.3 than commits that fix bugs in library or interpreter code. +Commits here would require converting changes from reST to LaTeX. + +----------------------------------- +[http://svn.python.org/view?rev=61004&view=rev r61004] | georg.brandl | 2008-02-23 13:47:04 -0500 (Sat, 23 Feb 2008) | 2 lines +Changed paths: + M /python/trunk/Doc/Makefile + M /python/trunk/Doc/README.txt + M /python/trunk/Doc/conf.py + +Documentation coverage builder, part 1. + + +----------------------------------- +[http://svn.python.org/view?rev=61017&view=rev r61017] | georg.brandl | 2008-02-23 16:59:11 -0500 (Sat, 23 Feb 2008) | 2 lines +Changed paths: + M /python/trunk/Doc/library/xml.dom.rst + +#2101: fix removeAttribute docs. + + +----------------------------------- +[http://svn.python.org/view?rev=61018&view=rev r61018] | georg.brandl | 2008-02-23 17:05:38 -0500 (Sat, 23 Feb 2008) | 2 lines +Changed paths: + M /python/trunk/Doc/library/modulefinder.rst + +Add examples to modulefinder docs. Written for GHOP by Josip Dzolonga. + + +----------------------------------- +[http://svn.python.org/view?rev=61024&view=rev r61024] | facundo.batista | 2008-02-23 17:54:12 -0500 (Sat, 23 Feb 2008) | 3 lines +Changed paths: + A /python/trunk/Lib/test/test_mutex.py + + +Added simple test case. Thanks Benjamin Peterson. + + +----------------------------------- +[http://svn.python.org/view?rev=61025&view=rev r61025] | georg.brandl | 2008-02-23 17:55:18 -0500 (Sat, 23 Feb 2008) | 2 lines +Changed paths: + M /python/trunk/Doc/library/msilib.rst + +#1825: correctly document msilib.add_data. + + +----------------------------------- +[http://svn.python.org/view?rev=61029&view=rev r61029] | georg.brandl | 2008-02-23 18:25:26 -0500 (Sat, 23 Feb 2008) | 2 lines +Changed paths: + M /python/trunk/Doc/library/thread.rst + M /python/trunk/Doc/library/threading.rst + +Document import ./. threading issues. #1720705. + + +----------------------------------- +[http://svn.python.org/view?rev=61032&view=rev r61032] | georg.brandl | 2008-02-23 18:43:01 -0500 (Sat, 23 Feb 2008) | 2 lines +Changed paths: + M /python/trunk/Doc/using/cmdline.rst + +Specify what kind of warning -3 emits. + + +----------------------------------- +[http://svn.python.org/view?rev=61039&view=rev r61039] | andrew.kuchling | 2008-02-23 21:39:15 -0500 (Sat, 23 Feb 2008) | 1 line +Changed paths: + M /python/trunk/Doc/howto/regex.rst + +Remove stray word + +----------------------------------- +[http://svn.python.org/view?rev=61071&view=rev r61071] | georg.brandl | 2008-02-25 15:20:45 -0500 (Mon, 25 Feb 2008) | 2 lines +Changed paths: + M /python/trunk/Doc/library/thread.rst + M /python/trunk/Doc/library/threading.rst + +Revert [http://svn.python.org/view?rev=61029&view=rev r61029]. + + +----------------------------------- +[http://svn.python.org/view?rev=61076&view=rev r61076] | raymond.hettinger | 2008-02-25 21:46:54 -0500 (Mon, 25 Feb 2008) | 1 line +Changed paths: + M /python/trunk/Doc/library/itertools.rst + +Docs for itertools.combinations(). Implementation in forthcoming checkin. + +----------------------------------- +[http://svn.python.org/view?rev=61080&view=rev r61080] | georg.brandl | 2008-02-26 01:40:10 -0500 (Tue, 26 Feb 2008) | 2 lines +Changed paths: + M /python/trunk/Doc/library/itertools.rst + +Banish tab. + + +----------------------------------- +[http://svn.python.org/view?rev=61087&view=rev r61087] | georg.brandl | 2008-02-26 14:13:45 -0500 (Tue, 26 Feb 2008) | 2 lines +Changed paths: + M /python/trunk/Doc/tutorial/interpreter.rst + M /python/trunk/Doc/using/unix.rst + M /python/trunk/Doc/using/windows.rst + +#2194: fix some typos. + + +----------------------------------- +[http://svn.python.org/view?rev=61091&view=rev r61091] | raymond.hettinger | 2008-02-26 20:44:34 -0500 (Tue, 26 Feb 2008) | 1 line +Changed paths: + M /python/trunk/Doc/library/itertools.rst + +Simply the sample code for combinations(). + +----------------------------------- +[http://svn.python.org/view?rev=61101&view=rev r61101] | raymond.hettinger | 2008-02-28 04:23:48 -0500 (Thu, 28 Feb 2008) | 1 line +Changed paths: + M /python/trunk/Doc/library/itertools.rst + +Add repeat keyword argument to itertools.product(). + +----------------------------------- +[http://svn.python.org/view?rev=61107&view=rev r61107] | raymond.hettinger | 2008-02-28 14:41:24 -0500 (Thu, 28 Feb 2008) | 1 line +Changed paths: + M /python/trunk/Doc/library/itertools.rst + +Document impending updates to itertools. + +----------------------------------- +[http://svn.python.org/view?rev=61135&view=rev r61135] | georg.brandl | 2008-02-29 13:21:29 -0500 (Fri, 29 Feb 2008) | 2 lines +Changed paths: + M /python/trunk/Doc/make.bat + +#2208: allow for non-standard HHC location. + + +----------------------------------- +[http://svn.python.org/view?rev=61165&view=rev r61165] | georg.brandl | 2008-03-02 01:28:16 -0500 (Sun, 02 Mar 2008) | 2 lines +Changed paths: + M /python/trunk/Doc/tutorial/interpreter.rst + +It's 2.6 now. + + +----------------------------------- +[http://svn.python.org/view?rev=61166&view=rev r61166] | georg.brandl | 2008-03-02 01:32:32 -0500 (Sun, 02 Mar 2008) | 2 lines +Changed paths: + M /python/trunk/Doc/copyright.rst + M /python/trunk/Doc/license.rst + +Update year. + + +----------------------------------- +[http://svn.python.org/view?rev=61168&view=rev r61168] | georg.brandl | 2008-03-02 01:45:40 -0500 (Sun, 02 Mar 2008) | 2 lines +Changed paths: + M /python/trunk/Doc/conf.py + +New default basename for HTML help files. + + +----------------------------------- +[http://svn.python.org/view?rev=61170&view=rev r61170] | raymond.hettinger | 2008-03-02 05:59:31 -0500 (Sun, 02 Mar 2008) | 1 line +Changed paths: + M /python/trunk/Doc/library/itertools.rst + +Finish-up docs for combinations() and permutations() in itertools. + +----------------------------------- +[http://svn.python.org/view?rev=61171&view=rev r61171] | raymond.hettinger | 2008-03-02 06:17:51 -0500 (Sun, 02 Mar 2008) | 1 line +Changed paths: + M /python/trunk/Doc/library/itertools.rst + +Tighten example code. + +----------------------------------- +[http://svn.python.org/view?rev=61176&view=rev r61176] | georg.brandl | 2008-03-02 08:41:39 -0500 (Sun, 02 Mar 2008) | 2 lines +Changed paths: + M /python/trunk/Doc/library/logging.rst + +Make clear that the constants are strings. + + +----------------------------------- +[http://svn.python.org/view?rev=61177&view=rev r61177] | georg.brandl | 2008-03-02 09:15:04 -0500 (Sun, 02 Mar 2008) | 2 lines +Changed paths: + M /python/trunk/Doc/library/logging.rst + +Fix factual error. + + +----------------------------------- +[http://svn.python.org/view?rev=61203&view=rev r61203] | christian.heimes | 2008-03-03 07:40:17 -0500 (Mon, 03 Mar 2008) | 3 lines +Changed paths: + M /python/trunk + +Initialized merge tracking via "svnmerge" with revisions "1-60195" from +svn+ssh://pythondev at svn.python.org/python/branches/trunk-math + + +----------------------------------- +[http://svn.python.org/view?rev=61209&view=rev r61209] | georg.brandl | 2008-03-03 15:37:55 -0500 (Mon, 03 Mar 2008) | 2 lines +Changed paths: + M /python/trunk/Doc/library/inspect.rst + +There are now sixteen isfoo functions. + + +----------------------------------- +[http://svn.python.org/view?rev=61212&view=rev r61212] | georg.brandl | 2008-03-03 16:31:50 -0500 (Mon, 03 Mar 2008) | 2 lines +Changed paths: + M /python/trunk/Doc/reference/expressions.rst + +Expand a bit on genexp scopes. + + +----------------------------------- +[http://svn.python.org/view?rev=61219&view=rev r61219] | andrew.kuchling | 2008-03-03 20:47:38 -0500 (Mon, 03 Mar 2008) | 1 line +Changed paths: + M /python/trunk/Doc/library/itertools.rst + +Fix sentence fragment + +----------------------------------- +[http://svn.python.org/view?rev=61221&view=rev r61221] | andrew.kuchling | 2008-03-03 20:49:37 -0500 (Mon, 03 Mar 2008) | 1 line +Changed paths: + M /python/trunk/Doc/library/inspect.rst + +Add versionadded tags + +----------------------------------- +[http://svn.python.org/view?rev=61226&view=rev r61226] | georg.brandl | 2008-03-04 02:33:30 -0500 (Tue, 04 Mar 2008) | 2 lines +Changed paths: + M /python/trunk/Doc/c-api/arg.rst + +#2230: document that PyArg_* leaves addresses alone on error. + + +----------------------------------- +[http://svn.python.org/view?rev=61255&view=rev r61255] | georg.brandl | 2008-03-05 14:31:44 -0500 (Wed, 05 Mar 2008) | 2 lines +Changed paths: + M /python/trunk/Doc/using/cmdline.rst + +#2239: PYTHONPATH delimiter is os.pathsep. + + +----------------------------------- +[http://svn.python.org/view?rev=61261&view=rev r61261] | raymond.hettinger | 2008-03-05 20:15:52 -0500 (Wed, 05 Mar 2008) | 1 line +Changed paths: + M /python/trunk/Doc/library/itertools.rst + +Add examples. + +----------------------------------- +[http://svn.python.org/view?rev=61269&view=rev r61269] | georg.brandl | 2008-03-06 02:19:15 -0500 (Thu, 06 Mar 2008) | 2 lines +Changed paths: + M /python/trunk/Doc/library/re.rst + +Expand on re.split behavior with captured expressions. + + +----------------------------------- +[http://svn.python.org/view?rev=61270&view=rev r61270] | georg.brandl | 2008-03-06 02:22:09 -0500 (Thu, 06 Mar 2008) | 2 lines +Changed paths: + M /python/trunk/Doc/tutorial/classes.rst + +Little clarification of assignments. + + +----------------------------------- +[http://svn.python.org/view?rev=61271&view=rev r61271] | georg.brandl | 2008-03-06 02:31:34 -0500 (Thu, 06 Mar 2008) | 2 lines +Changed paths: + M /python/trunk/Doc/tutorial/classes.rst + +Add isinstance/issubclass to tutorial. + + +----------------------------------- +[http://svn.python.org/view?rev=61298&view=rev r61298] | andrew.kuchling | 2008-03-07 16:09:23 -0500 (Fri, 07 Mar 2008) | 1 line +Changed paths: + M /python/trunk/Doc/library/email.message.rst + +Grammar fix + +----------------------------------- +[http://svn.python.org/view?rev=61303&view=rev r61303] | georg.brandl | 2008-03-08 04:54:06 -0500 (Sat, 08 Mar 2008) | 2 lines +Changed paths: + M /python/trunk/Doc/reference/simple_stmts.rst + +#2253: fix continue vs. finally docs. + + +----------------------------------- +[http://svn.python.org/view?rev=61305&view=rev r61305] | georg.brandl | 2008-03-08 05:05:24 -0500 (Sat, 08 Mar 2008) | 2 lines +Changed paths: + M /python/trunk/Doc/c-api/intro.rst + +#1533486: fix types in refcount intro. + + +----------------------------------- +[http://svn.python.org/view?rev=61329&view=rev r61329] | georg.brandl | 2008-03-09 11:11:39 -0400 (Sun, 09 Mar 2008) | 2 lines +Changed paths: + M /python/trunk/Doc/library/unittest.rst + +#2249: document assertTrue and assertFalse. + + +----------------------------------- +[http://svn.python.org/view?rev=61351&view=rev r61351] | raymond.hettinger | 2008-03-11 17:37:46 -0400 (Tue, 11 Mar 2008) | 1 line +Changed paths: + M /python/trunk/Doc/library/operator.rst + +Improve docs for itemgetter(). Show that it works with slices. + +----------------------------------- +[http://svn.python.org/view?rev=61363&view=rev r61363] | georg.brandl | 2008-03-13 03:15:56 -0400 (Thu, 13 Mar 2008) | 2 lines +Changed paths: + M /python/trunk/Doc/library/mailbox.rst + +#2265: fix example. + + +----------------------------------- +[http://svn.python.org/view?rev=61364&view=rev r61364] | georg.brandl | 2008-03-13 03:17:14 -0400 (Thu, 13 Mar 2008) | 2 lines +Changed paths: + M /python/trunk/Doc/library/xml.dom.rst + +#2270: fix typo. + + +----------------------------------- +[http://svn.python.org/view?rev=61365&view=rev r61365] | georg.brandl | 2008-03-13 03:21:41 -0400 (Thu, 13 Mar 2008) | 2 lines +Changed paths: + M /python/trunk/Doc/library/threading.rst + +#1720705: add docs about import/threading interaction, wording by Nick. + + +----------------------------------- +[http://svn.python.org/view?rev=61366&view=rev r61366] | andrew.kuchling | 2008-03-13 07:07:35 -0400 (Thu, 13 Mar 2008) | 1 line +Changed paths: + M /python/trunk/Doc/reference/compound_stmts.rst + +Add class decorators + +----------------------------------- +[http://svn.python.org/view?rev=61392&view=rev r61392] | georg.brandl | 2008-03-14 19:10:34 -0400 (Fri, 14 Mar 2008) | 2 lines +Changed paths: + M /python/trunk/Doc/library/urllib.rst + +Remove obsolete paragraph. #2288. + + +----------------------------------- +[http://svn.python.org/view?rev=61396&view=rev r61396] | skip.montanaro | 2008-03-14 22:32:49 -0400 (Fri, 14 Mar 2008) | 1 line +Changed paths: + M /python/trunk/Doc/library/os.rst + +note that fork and forkpty raise OSError on failure + +----------------------------------- +[http://svn.python.org/view?rev=61413&view=rev r61413] | raymond.hettinger | 2008-03-16 01:20:42 -0400 (Sun, 16 Mar 2008) | 1 line +Changed paths: + M /python/trunk/Doc/library/numbers.rst + +Update docs to reflect removal of Exact/Inexact + +----------------------------------- +[http://svn.python.org/view?rev=61414&view=rev r61414] | georg.brandl | 2008-03-16 04:00:19 -0400 (Sun, 16 Mar 2008) | 2 lines +Changed paths: + M /python/trunk/Doc/extending/newtypes.rst + +#2299: typos in newtypes.rst. + + +----------------------------------- +[http://svn.python.org/view?rev=61431&view=rev r61431] | vinay.sajip | 2008-03-16 17:35:58 -0400 (Sun, 16 Mar 2008) | 1 line +Changed paths: + M /python/trunk/Doc/library/logging.rst + +Clarified documentation on use of shutdown(). + +----------------------------------- +[http://svn.python.org/view?rev=61433&view=rev r61433] | mark.summerfield | 2008-03-17 04:28:15 -0400 (Mon, 17 Mar 2008) | 5 lines +Changed paths: + M /python/trunk/Doc/library/pyexpat.rst + M /python/trunk/Doc/library/xml.dom.minidom.rst + M /python/trunk/Doc/library/xml.etree.elementtree.rst + +Added a footnote to each pointing out that for XML output if an encoding +string is given it should conform to the appropriate XML standards---for +example, "UTF-8" is okay, but "UTF8" is not. + + + +----------------------------------- +[http://svn.python.org/view?rev=61453&view=rev r61453] | steven.bethard | 2008-03-17 15:33:11 -0400 (Mon, 17 Mar 2008) | 1 line +Changed paths: + M /python/trunk/Doc/library/stdtypes.rst + +Document unicode.isnumeric() and unicode.isdecimal() (issue2326) + +----------------------------------- +[http://svn.python.org/view?rev=61563&view=rev r61563] | brett.cannon | 2008-03-18 17:12:42 -0400 (Tue, 18 Mar 2008) | 2 lines +Changed paths: + M /python/trunk + +Ignore BIG5HKSCS-2004.TXT which is downloaded as part of a test. + + +----------------------------------- +[http://svn.python.org/view?rev=61615&view=rev r61615] | georg.brandl | 2008-03-19 03:56:40 -0400 (Wed, 19 Mar 2008) | 2 lines +Changed paths: + M /python/trunk/Doc/library/xml.dom.minidom.rst + +Remove footnote from versionchanged as it upsets LaTeX. + + +----------------------------------- +[http://svn.python.org/view?rev=61616&view=rev r61616] | georg.brandl | 2008-03-19 03:57:57 -0400 (Wed, 19 Mar 2008) | 2 lines +Changed paths: + M /python/trunk/Doc/library/xml.dom.minidom.rst + +Another one. + + +----------------------------------- +[http://svn.python.org/view?rev=61663&view=rev r61663] | sean.reifschneider | 2008-03-19 23:20:48 -0400 (Wed, 19 Mar 2008) | 2 lines +Changed paths: + M /python/trunk/Doc/library/urllib2.rst + +Issue 2188: Documentation hint about disabling proxy detection. + + +----------------------------------- +[http://svn.python.org/view?rev=61676&view=rev r61676] | marc-andre.lemburg | 2008-03-20 13:55:31 -0400 (Thu, 20 Mar 2008) | 5 lines +Changed paths: + M /python/trunk/Doc/library/platform.rst + +Add documentation for updated Windows support in win32_ver(). + +Add documentation for linux_distribution() API. + + + +----------------------------------- +[http://svn.python.org/view?rev=61678&view=rev r61678] | marc-andre.lemburg | 2008-03-20 14:58:14 -0400 (Thu, 20 Mar 2008) | 3 lines +Changed paths: + M /python/trunk/Doc/library/platform.rst + +Clarfiy the availability of the extended support for win32_ver() in Py2.6. + + + +----------------------------------- +[http://svn.python.org/view?rev=61696&view=rev r61696] | georg.brandl | 2008-03-21 10:32:33 -0400 (Fri, 21 Mar 2008) | 2 lines +Changed paths: + M /python/trunk/Doc/tutorial/datastructures.rst + +Mark the descitems in the tutorial as "noindex" so that :meth: cross-refs don't link to them. + + +----------------------------------- +[http://svn.python.org/view?rev=61707&view=rev r61707] | georg.brandl | 2008-03-21 15:14:38 -0400 (Fri, 21 Mar 2008) | 2 lines +Changed paths: + M /python/trunk/Doc/library/__future__.rst + +Fix a code block in __future__ docs. + + +----------------------------------- +[http://svn.python.org/view?rev=61708&view=rev r61708] | georg.brandl | 2008-03-21 15:20:21 -0400 (Fri, 21 Mar 2008) | 2 lines +Changed paths: + M /python/trunk/Doc/library/inspect.rst + M /python/trunk/Doc/reference/datamodel.rst + +Add docs for __func__ and __self__ on methods. + + +----------------------------------- +[http://svn.python.org/view?rev=61709&view=rev r61709] | georg.brandl | 2008-03-21 15:37:57 -0400 (Fri, 21 Mar 2008) | 2 lines +Changed paths: + M /python/trunk/Doc/library/functions.rst + A /python/trunk/Doc/library/future_builtins.rst + M /python/trunk/Doc/library/python.rst + +Add docs for print_function and future_builtins. Fixes #2442. + + +----------------------------------- +[http://svn.python.org/view?rev=61718&view=rev r61718] | georg.brandl | 2008-03-21 16:55:20 -0400 (Fri, 21 Mar 2008) | 2 lines +Changed paths: + M /python/trunk/Doc/c-api/import.rst + +#2160: document PyImport_GetImporter. + + +----------------------------------- +[http://svn.python.org/view?rev=61719&view=rev r61719] | georg.brandl | 2008-03-21 16:55:51 -0400 (Fri, 21 Mar 2008) | 2 lines +Changed paths: + M /python/trunk/Doc/ACKS.txt + +Update doc ACKS. + + +----------------------------------- +[http://svn.python.org/view?rev=61721&view=rev r61721] | georg.brandl | 2008-03-21 17:05:03 -0400 (Fri, 21 Mar 2008) | 2 lines +Changed paths: + M /python/trunk/Doc/library/sys.rst + +Add missing versionadded tag. + + +----------------------------------- +[http://svn.python.org/view?rev=61733&view=rev r61733] | georg.brandl | 2008-03-22 06:07:29 -0400 (Sat, 22 Mar 2008) | 4 lines +Changed paths: + M /python/trunk/Doc/library/weakref.rst + +#1918: document that weak references *to* an object are +cleared before the object's __del__ is called, to ensure that the weak +reference callback (if any) finds the object healthy. + + +----------------------------------- +[http://svn.python.org/view?rev=61735&view=rev r61735] | georg.brandl | 2008-03-22 06:58:38 -0400 (Sat, 22 Mar 2008) | 2 lines +Changed paths: + M /python/trunk/Doc/Makefile + +Allow giving source names on the cmdline. + + +----------------------------------- +[http://svn.python.org/view?rev=61743&view=rev r61743] | georg.brandl | 2008-03-22 08:59:37 -0400 (Sat, 22 Mar 2008) | 2 lines +Changed paths: + M /python/trunk/Doc/library/pprint.rst + +Make more doctests in pprint docs testable. + + +----------------------------------- +[http://svn.python.org/view?rev=61744&view=rev r61744] | georg.brandl | 2008-03-22 09:07:06 -0400 (Sat, 22 Mar 2008) | 2 lines +Changed paths: + M /python/trunk/Doc/howto/functional.rst + M /python/trunk/Doc/library/decimal.rst + M /python/trunk/Doc/library/re.rst + +No need to specify explicit "doctest_block" anymore. + + +----------------------------------- +[http://svn.python.org/view?rev=61753&view=rev r61753] | georg.brandl | 2008-03-22 16:08:43 -0400 (Sat, 22 Mar 2008) | 2 lines +Changed paths: + M /python/trunk/Doc/library/select.rst + +Fix-up syntax problems. + + +----------------------------------- +[http://svn.python.org/view?rev=61761&view=rev r61761] | georg.brandl | 2008-03-22 17:06:20 -0400 (Sat, 22 Mar 2008) | 4 lines +Changed paths: + M /python/trunk/Doc/library/collections.rst + +Make collections' doctests executable. + +(The s will be stripped from presentation output.) + + +----------------------------------- +[http://svn.python.org/view?rev=61765&view=rev r61765] | georg.brandl | 2008-03-22 17:21:57 -0400 (Sat, 22 Mar 2008) | 2 lines +Changed paths: + M /python/trunk/Doc/library/datetime.rst + +Test doctests in datetime docs. + + +----------------------------------- +[http://svn.python.org/view?rev=61766&view=rev r61766] | georg.brandl | 2008-03-22 17:26:44 -0400 (Sat, 22 Mar 2008) | 2 lines +Changed paths: + M /python/trunk/Doc/library/operator.rst + +Test doctests in operator docs. + + +----------------------------------- +[http://svn.python.org/view?rev=61767&view=rev r61767] | georg.brandl | 2008-03-22 17:38:33 -0400 (Sat, 22 Mar 2008) | 2 lines +Changed paths: + M /python/trunk/Doc/library/functions.rst + +Enable doctests in functions.rst. Already found two errors :) + + +----------------------------------- +[http://svn.python.org/view?rev=61769&view=rev r61769] | georg.brandl | 2008-03-22 18:04:10 -0400 (Sat, 22 Mar 2008) | 3 lines +Changed paths: + M /python/trunk/Doc/library/base64.rst + M /python/trunk/Doc/library/bisect.rst + M /python/trunk/Doc/library/cookie.rst + M /python/trunk/Doc/library/difflib.rst + M /python/trunk/Doc/library/fnmatch.rst + M /python/trunk/Doc/library/fractions.rst + M /python/trunk/Doc/library/functools.rst + M /python/trunk/Doc/library/getopt.rst + M /python/trunk/Doc/library/hashlib.rst + M /python/trunk/Doc/library/heapq.rst + M /python/trunk/Doc/library/itertools.rst + M /python/trunk/Doc/library/md5.rst + M /python/trunk/Doc/library/sched.rst + M /python/trunk/Doc/library/sets.rst + M /python/trunk/Doc/library/stdtypes.rst + M /python/trunk/Doc/library/string.rst + M /python/trunk/Doc/library/time.rst + M /python/trunk/Doc/library/unicodedata.rst + M /python/trunk/Doc/library/urlparse.rst + M /python/trunk/Doc/library/weakref.rst + +Enable doctest running for several other documents. +We have now over 640 doctests that are run with "make doctest". + + +----------------------------------- +[http://svn.python.org/view?rev=61788&view=rev r61788] | georg.brandl | 2008-03-23 04:05:30 -0400 (Sun, 23 Mar 2008) | 2 lines +Changed paths: + M /python/trunk/Doc/library/operator.rst + +Make the doctests presentation-friendlier. + + +----------------------------------- +[http://svn.python.org/view?rev=61834&view=rev r61834] | raymond.hettinger | 2008-03-24 02:07:49 -0400 (Mon, 24 Mar 2008) | 1 line +Changed paths: + M /python/trunk/Doc/library/random.rst + +Tighten documentation for Random.triangular. + +----------------------------------- +[http://svn.python.org/view?rev=61842&view=rev r61842] | georg.brandl | 2008-03-24 05:34:34 -0400 (Mon, 24 Mar 2008) | 2 lines +Changed paths: + M /python/trunk/Doc/library/audioop.rst + +#1700821: add a note to audioop docs about signedness of sample formats. + + +----------------------------------- +[http://svn.python.org/view?rev=61871&view=rev r61871] | georg.brandl | 2008-03-25 03:20:15 -0400 (Tue, 25 Mar 2008) | 2 lines +Changed paths: + M /python/trunk/Doc/library/functions.rst + +#868845: document <...> reprs. + + +----------------------------------- +[http://svn.python.org/view?rev=61882&view=rev r61882] | georg.brandl | 2008-03-25 04:39:10 -0400 (Tue, 25 Mar 2008) | 2 lines +Changed paths: + M /python/trunk/Doc/library/optparse.rst + +#2476: document that %default feature is new in 2.4. + + +----------------------------------- +[http://svn.python.org/view?rev=61929&view=rev r61929] | georg.brandl | 2008-03-26 05:32:46 -0400 (Wed, 26 Mar 2008) | 2 lines +Changed paths: + M /python/trunk/Doc/library/configparser.rst + +Add an example for an RFC 822 continuation. + + +----------------------------------- +[http://svn.python.org/view?rev=61935&view=rev r61935] | christian.heimes | 2008-03-26 08:32:49 -0400 (Wed, 26 Mar 2008) | 1 line +Changed paths: + M /python/trunk + +Prepare integration of bytearray backport branch + +----------------------------------- +[http://svn.python.org/view?rev=61937&view=rev r61937] | christian.heimes | 2008-03-26 08:50:32 -0400 (Wed, 26 Mar 2008) | 3 lines +Changed paths: + M /python/trunk + +Removed merge tracking for "svnmerge" for +svn+ssh://pythondev at svn.python.org/python/branches/libffi3-branch + + +----------------------------------- +[http://svn.python.org/view?rev=61938&view=rev r61938] | christian.heimes | 2008-03-26 08:50:43 -0400 (Wed, 26 Mar 2008) | 3 lines +Changed paths: + M /python/trunk + +Removed merge tracking for "svnmerge" for +svn+ssh://pythondev at svn.python.org/python/branches/trunk-bytearray + + +----------------------------------- +[http://svn.python.org/view?rev=61952&view=rev r61952] | mark.dickinson | 2008-03-26 17:41:36 -0400 (Wed, 26 Mar 2008) | 2 lines +Changed paths: + M /python/trunk/Doc/c-api/structures.rst + +Typo: "objects reference count" -> "object's reference count" + + +----------------------------------- +[http://svn.python.org/view?rev=61957&view=rev r61957] | christian.heimes | 2008-03-26 18:55:31 -0400 (Wed, 26 Mar 2008) | 1 line +Changed paths: + A /python/trunk/Lib/test/test_future4.py + +I forgot to svn add the future test + +----------------------------------- +[http://svn.python.org/view?rev=61999&view=rev r61999] | georg.brandl | 2008-03-28 04:06:56 -0400 (Fri, 28 Mar 2008) | 2 lines +Changed paths: + M /python/trunk/Doc/library/gzip.rst + +#2406: add examples to gzip docs. + + +----------------------------------- +[http://svn.python.org/view?rev=62005&view=rev r62005] | georg.brandl | 2008-03-28 08:22:12 -0400 (Fri, 28 Mar 2008) | 2 lines +Changed paths: + M /python/trunk/Doc/c-api/mapping.rst + M /python/trunk/Doc/library/rfc822.rst + M /python/trunk/Doc/tutorial/datastructures.rst + +Phase out has_key usage in the tutorial; correct docs for PyMapping_HasKey*. + + +----------------------------------- +[http://svn.python.org/view?rev=62006&view=rev r62006] | georg.brandl | 2008-03-28 08:24:51 -0400 (Fri, 28 Mar 2008) | 2 lines +Changed paths: + M /python/trunk/Doc/reference/expressions.rst + +Don't use the confusing term "set membership". + + +----------------------------------- +[http://svn.python.org/view?rev=62007&view=rev r62007] | georg.brandl | 2008-03-28 08:58:26 -0400 (Fri, 28 Mar 2008) | 2 lines +Changed paths: + M /python/trunk/Doc/library/collections.rst + +#2502: add example how to do enum types with named tuples. + + +----------------------------------- +[http://svn.python.org/view?rev=62012&view=rev r62012] | gregory.p.smith | 2008-03-28 16:11:49 -0400 (Fri, 28 Mar 2008) | 2 lines +Changed paths: + A /python/trunk/Lib/sqlite3/dump.py + A /python/trunk/Lib/sqlite3/test/dump.py + +These svn adds were forgotten in [http://svn.python.org/view?rev=62000&view=rev r62000] + + +----------------------------------- +[http://svn.python.org/view?rev=62026&view=rev r62026] | gerhard.haering | 2008-03-28 21:27:37 -0400 (Fri, 28 Mar 2008) | 3 lines +Changed paths: + A /python/trunk/Doc/includes/sqlite3/ctx_manager.py + M /python/trunk/Doc/library/sqlite3.rst + +Brought documentation for sqlite3 module up-to-date. Fixed Issue1625205 which +complained about commit, rollback and close not being documented. + + +----------------------------------- +[http://svn.python.org/view?rev=62035&view=rev r62035] | raymond.hettinger | 2008-03-29 06:42:07 -0400 (Sat, 29 Mar 2008) | 1 line +Changed paths: + M /python/trunk/Doc/library/array.rst + +Be explicit about what efficient means. + +----------------------------------- +[http://svn.python.org/view?rev=62036&view=rev r62036] | georg.brandl | 2008-03-29 07:46:18 -0400 (Sat, 29 Mar 2008) | 2 lines +Changed paths: + M /python/trunk/Doc/library/array.rst + +Fix capitalization. + + +----------------------------------- +[http://svn.python.org/view?rev=62044&view=rev r62044] | gerhard.haering | 2008-03-29 15:11:52 -0400 (Sat, 29 Mar 2008) | 2 lines +Changed paths: + M /python/trunk/Doc/library/sqlite3.rst + +Documented the lastrowid attribute. + + +----------------------------------- +[http://svn.python.org/view?rev=62084&view=rev r62084] | benjamin.peterson | 2008-03-31 17:57:13 -0400 (Mon, 31 Mar 2008) | 2 lines +Changed paths: + M /python/trunk/Doc/library/warnings.rst + +PyErr_Warn is decrepated. Use PyErr_WarnEx + + +----------------------------------- +[http://svn.python.org/view?rev=62112&view=rev r62112] | vinay.sajip | 2008-04-02 17:17:25 -0400 (Wed, 02 Apr 2008) | 1 line +Changed paths: + M /python/trunk/Doc/library/logging.rst + +Added updates with respect to recent changes to TimedRotatingFileHandler. + +----------------------------------- +[http://svn.python.org/view?rev=62158&view=rev r62158] | andrew.kuchling | 2008-04-04 22:42:20 -0400 (Fri, 04 Apr 2008) | 1 line +Changed paths: + M /python/trunk/Doc/library/signal.rst + +Minor edits + +----------------------------------- +[http://svn.python.org/view?rev=62169&view=rev r62169] | martin.v.loewis | 2008-04-05 11:50:58 -0400 (Sat, 05 Apr 2008) | 1 line +Changed paths: + A /python/trunk/Tools/msi/merge.py + +Add script to merge msvcr90. + +----------------------------------- +[http://svn.python.org/view?rev=62173&view=rev r62173] | georg.brandl | 2008-04-05 13:45:58 -0400 (Sat, 05 Apr 2008) | 2 lines +Changed paths: + M /python/trunk/Doc/library/pickle.rst + +Mention that the tuple returned by __reduce__ is pickled as normal. + + +----------------------------------- +[http://svn.python.org/view?rev=62198&view=rev r62198] | mark.hammond | 2008-04-06 21:59:40 -0400 (Sun, 06 Apr 2008) | 2 lines +Changed paths: + M /python/trunk/Doc/distutils/builtdist.rst + +correct heading underline for new "Cross-compiling on Windows" section + + +----------------------------------- +[http://svn.python.org/view?rev=62205&view=rev r62205] | mark.summerfield | 2008-04-07 03:39:23 -0400 (Mon, 07 Apr 2008) | 4 lines +Changed paths: + M /python/trunk/Doc/library/index.rst + +changed "2500 components" to "several thousand" since the number keeps +growning:-) + + + +----------------------------------- +[http://svn.python.org/view?rev=62214&view=rev r62214] | georg.brandl | 2008-04-07 14:51:59 -0400 (Mon, 07 Apr 2008) | 2 lines +Changed paths: + M /python/trunk/Doc/includes/tzinfo-examples.py + +#2525: update timezone info examples in the docs. + + +----------------------------------- +[http://svn.python.org/view?rev=62220&view=rev r62220] | andrew.kuchling | 2008-04-07 19:57:21 -0400 (Mon, 07 Apr 2008) | 1 line +Changed paths: + M /python/trunk/Doc/library/select.rst + +Typo fix + +----------------------------------- +[http://svn.python.org/view?rev=62277&view=rev r62277] | andrew.kuchling | 2008-04-10 17:27:10 -0400 (Thu, 10 Apr 2008) | 1 line +Changed paths: + M /python/trunk/Doc/reference/simple_stmts.rst + +Remove forward-looking statement + +----------------------------------- +[http://svn.python.org/view?rev=62278&view=rev r62278] | andrew.kuchling | 2008-04-10 17:28:51 -0400 (Thu, 10 Apr 2008) | 1 line +Changed paths: + M /python/trunk/Doc/reference/expressions.rst + +Add punctuation + +----------------------------------- +[http://svn.python.org/view?rev=62294&view=rev r62294] | georg.brandl | 2008-04-12 14:11:18 -0400 (Sat, 12 Apr 2008) | 2 lines +Changed paths: + M /python/trunk/Doc/conf.py + +Use absolute path in sys.path. + + +----------------------------------- +[http://svn.python.org/view?rev=62295&view=rev r62295] | georg.brandl | 2008-04-12 14:36:09 -0400 (Sat, 12 Apr 2008) | 2 lines +Changed paths: + M /python/trunk/Doc/library/xml.dom.minidom.rst + +#2615: small consistency update by Jeroen Ruigrok van der Werven. + + +----------------------------------- +[http://svn.python.org/view?rev=62297&view=rev r62297] | georg.brandl | 2008-04-12 15:05:37 -0400 (Sat, 12 Apr 2008) | 2 lines +Changed paths: + M /python/trunk/Doc/tutorial/appetite.rst + +Don't offend snake lovers. + + +----------------------------------- +[http://svn.python.org/view?rev=62330&view=rev r62330] | benjamin.peterson | 2008-04-13 16:40:03 -0400 (Sun, 13 Apr 2008) | 2 lines +Changed paths: + A /python/trunk/.bzrignore + +Added an ignore file for Bazaar #2510 + + +----------------------------------- +[http://svn.python.org/view?rev=62351&view=rev r62351] | nick.coghlan | 2008-04-15 06:28:14 -0400 (Tue, 15 Apr 2008) | 1 line +Changed paths: + A /python/trunk/Lib/test/test_pkgutil.py + +Add test file missing from rev 62350 + +----------------------------------- +[http://svn.python.org/view?rev=62352&view=rev r62352] | benjamin.peterson | 2008-04-15 07:58:46 -0400 (Tue, 15 Apr 2008) | 2 lines +Changed paths: + M /python/trunk/Doc/ACKS.txt + +Add myself to Doc/ACKS.txt + + +----------------------------------- +[http://svn.python.org/view?rev=62353&view=rev r62353] | andrew.kuchling | 2008-04-15 09:10:07 -0400 (Tue, 15 Apr 2008) | 6 lines +Changed paths: + M /python/trunk/Doc/reference/compound_stmts.rst + M /python/trunk/Doc/tutorial/controlflow.rst + +Add *,**,@ to index, as suggested by +http://farmdev.com/thoughts/24/what-does-the-def-star-variable-or-def-asterisk-parameter-syntax-do-in-python-/ + +The right entry type to use isn't clear; operator seems wrong, because *,**,@ +aren't being used in expressions here. I put them as 'statement'; 'syntax' +might be better. + +----------------------------------- +[http://svn.python.org/view?rev=62354&view=rev r62354] | andrew.kuchling | 2008-04-15 09:10:41 -0400 (Tue, 15 Apr 2008) | 1 line +Changed paths: + M /python/trunk/Doc/tutorial/controlflow.rst + +Typo fix + +----------------------------------- +[http://svn.python.org/view?rev=62358&view=rev r62358] | jeroen.ruigrok | 2008-04-16 08:47:01 -0400 (Wed, 16 Apr 2008) | 2 lines +Changed paths: + M /python/trunk/Doc/library/mmap.rst + +Reformat to 80 columns prior to adding documentation. + + +----------------------------------- +[http://svn.python.org/view?rev=62359&view=rev r62359] | jeroen.ruigrok | 2008-04-16 08:57:43 -0400 (Wed, 16 Apr 2008) | 2 lines +Changed paths: + M /python/trunk/Doc/library/mmap.rst + +Add details about the return value for mmap.flush(). + + +----------------------------------- +[http://svn.python.org/view?rev=62364&view=rev r62364] | raymond.hettinger | 2008-04-17 06:48:31 -0400 (Thu, 17 Apr 2008) | 1 line +Changed paths: + M /python/trunk/Doc/library/decimal.rst + M /python/trunk/Doc/library/itertools.rst + +Issue 2648: Add leading zero to money format recipe in the docs. + +----------------------------------- +[http://svn.python.org/view?rev=62365&view=rev r62365] | jeroen.ruigrok | 2008-04-17 08:39:45 -0400 (Thu, 17 Apr 2008) | 2 lines +Changed paths: + M /python/trunk/Doc/library/mmap.rst + +Be consistent in the use of read-only. + + +----------------------------------- +[http://svn.python.org/view?rev=62370&view=rev r62370] | andrew.kuchling | 2008-04-17 16:44:06 -0400 (Thu, 17 Apr 2008) | 1 line +Changed paths: + M /python/trunk/Doc/library/itertools.rst + +Typo fixes + +----------------------------------- +[http://svn.python.org/view?rev=62372&view=rev r62372] | andrew.kuchling | 2008-04-17 22:40:47 -0400 (Thu, 17 Apr 2008) | 1 line +Changed paths: + M /python/trunk/Doc/library/ssl.rst + +Use correct parameter name + +----------------------------------- +[http://svn.python.org/view?rev=62373&view=rev r62373] | andrew.kuchling | 2008-04-18 12:53:09 -0400 (Fri, 18 Apr 2008) | 1 line +Changed paths: + M /python/trunk/Doc/howto/doanddont.rst + +#2654: fix typo + +----------------------------------- +[http://svn.python.org/view?rev=62374&view=rev r62374] | andrew.kuchling | 2008-04-18 14:28:23 -0400 (Fri, 18 Apr 2008) | 4 lines +Changed paths: + M /python/trunk/Doc/library/profile.rst + +Remove personal note from Jim Roskind; it no longer applies, and the +e-mail address is for a previous employer. + +Can we move the big long copyright statement into a sidebar or something? + +----------------------------------- +[http://svn.python.org/view?rev=62375&view=rev r62375] | andrew.kuchling | 2008-04-18 14:39:55 -0400 (Fri, 18 Apr 2008) | 1 line +Changed paths: + M /python/trunk/Doc/library/profile.rst + +Rewrite introductory section, and remove old section. (It was already commented-out, but why keep it?) + +----------------------------------- +[http://svn.python.org/view?rev=62387&view=rev r62387] | georg.brandl | 2008-04-19 04:23:59 -0400 (Sat, 19 Apr 2008) | 2 lines +Changed paths: + M /python/trunk/Doc/library/subprocess.rst + +Fix-up docs for revision 62386. + + +----------------------------------- +[http://svn.python.org/view?rev=62389&view=rev r62389] | georg.brandl | 2008-04-19 12:57:43 -0400 (Sat, 19 Apr 2008) | 2 lines +Changed paths: + M /python/trunk/Doc/library/shutil.rst + +#2369: clarify that copyfile() doesn't take a target directory. + + +----------------------------------- +[http://svn.python.org/view?rev=62390&view=rev r62390] | georg.brandl | 2008-04-19 12:58:28 -0400 (Sat, 19 Apr 2008) | 2 lines +Changed paths: + M /python/trunk/Doc/library/os.rst + +#2634: clarify meaning of env parameter to spawn/exec*e. + + +----------------------------------- +[http://svn.python.org/view?rev=62391&view=rev r62391] | georg.brandl | 2008-04-19 12:58:49 -0400 (Sat, 19 Apr 2008) | 2 lines +Changed paths: + M /python/trunk/Doc/library/subprocess.rst + +#2633: clarify meaning of env parameter. + + +----------------------------------- +[http://svn.python.org/view?rev=62392&view=rev r62392] | georg.brandl | 2008-04-19 12:59:16 -0400 (Sat, 19 Apr 2008) | 2 lines +Changed paths: + M /python/trunk/Doc/library/dis.rst + +#2631: clarify IMPORT_NAME semantics. + + +----------------------------------- +[http://svn.python.org/view?rev=62401&view=rev r62401] | benjamin.peterson | 2008-04-19 15:47:34 -0400 (Sat, 19 Apr 2008) | 2 lines +Changed paths: + M /python/trunk/Doc/library/io.rst + +Complete documentation for errors argument of io's open and TextIOWrapper + + +----------------------------------- +[http://svn.python.org/view?rev=62409&view=rev r62409] | mark.dickinson | 2008-04-19 17:35:35 -0400 (Sat, 19 Apr 2008) | 5 lines +Changed paths: + M /python/trunk/Doc/library/math.rst + +Correct documentation for math.pow; +0**nan is nan, not 0. (But nan**0 and 1**nan are 1.) + +Also fix minor typo: 'quite NaN' -> 'quiet NaN' + + +----------------------------------- +[http://svn.python.org/view?rev=62410&view=rev r62410] | mark.dickinson | 2008-04-19 17:49:22 -0400 (Sat, 19 Apr 2008) | 4 lines +Changed paths: + M /python/trunk/Doc/library/math.rst + +Move asinh documentation to the proper place. +Remove meaningless 'in radians' from inverse +hyperbolic functions. + + +----------------------------------- +[http://svn.python.org/view?rev=62428&view=rev r62428] | andrew.kuchling | 2008-04-20 22:08:13 -0400 (Sun, 20 Apr 2008) | 1 line +Changed paths: + M /python/trunk/Doc/library/pkgutil.rst + +Wording changes + +----------------------------------- +[http://svn.python.org/view?rev=62431&view=rev r62431] | benjamin.peterson | 2008-04-21 07:57:40 -0400 (Mon, 21 Apr 2008) | 1 line +Changed paths: + M /python/trunk/Doc/library/io.rst + +Moved Mark SummerField's io doc changes back to the trunk. (He will edit here in the future.) + +----------------------------------- +[http://svn.python.org/view?rev=62436&view=rev r62436] | david.goodger | 2008-04-21 10:43:33 -0400 (Mon, 21 Apr 2008) | 1 line +Changed paths: + M /python/trunk/Doc/about.rst + +capitalization + +----------------------------------- +[http://svn.python.org/view?rev=62444&view=rev r62444] | jeroen.ruigrok | 2008-04-21 16:15:39 -0400 (Mon, 21 Apr 2008) | 2 lines +Changed paths: + M /python/trunk/Doc/library/sys.rst + +Windows x64 also falls under VER_PLATFORM_WIN32_NT. + + +----------------------------------- +[http://svn.python.org/view?rev=62452&view=rev r62452] | benjamin.peterson | 2008-04-21 22:16:03 -0400 (Mon, 21 Apr 2008) | 2 lines +Changed paths: + M /python/trunk/Doc/library/io.rst + +Various io doc updates + + +----------------------------------- +[http://svn.python.org/view?rev=62465&view=rev r62465] | skip.montanaro | 2008-04-22 18:45:09 -0400 (Tue, 22 Apr 2008) | 3 lines +Changed paths: + M /python/trunk/Doc/library/xmlrpclib.rst + +Factor in documentation changes from issue 1753732. + + + +----------------------------------- +[http://svn.python.org/view?rev=62466&view=rev r62466] | gregory.p.smith | 2008-04-22 21:06:42 -0400 (Tue, 22 Apr 2008) | 2 lines +Changed paths: + M /python/trunk/Doc/library/getpass.rst + +syntax fixup + + +----------------------------------- +[http://svn.python.org/view?rev=62469&view=rev r62469] | benjamin.peterson | 2008-04-23 16:38:06 -0400 (Wed, 23 Apr 2008) | 2 lines +Changed paths: + M /python/trunk/Doc/library/optparse.rst + +#2673 Fix example typo in optparse docs + + +----------------------------------- +[http://svn.python.org/view?rev=62490&view=rev r62490] | benjamin.peterson | 2008-04-24 21:29:10 -0400 (Thu, 24 Apr 2008) | 2 lines +Changed paths: + M /python/trunk/Doc/library/asynchat.rst + M /python/trunk/Doc/library/asyncore.rst + M /python/trunk/Doc/library/basehttpserver.rst + M /python/trunk/Doc/library/bdb.rst + M /python/trunk/Doc/library/bz2.rst + M /python/trunk/Doc/library/calendar.rst + M /python/trunk/Doc/library/cgihttpserver.rst + M /python/trunk/Doc/library/chunk.rst + M /python/trunk/Doc/library/codecs.rst + M /python/trunk/Doc/library/collections.rst + M /python/trunk/Doc/library/compiler.rst + M /python/trunk/Doc/library/csv.rst + M /python/trunk/Doc/library/ctypes.rst + M /python/trunk/Doc/library/curses.rst + M /python/trunk/Doc/library/decimal.rst + M /python/trunk/Doc/library/difflib.rst + M /python/trunk/Doc/library/doctest.rst + M /python/trunk/Doc/library/email.charset.rst + M /python/trunk/Doc/library/email.generator.rst + M /python/trunk/Doc/library/email.header.rst + M /python/trunk/Doc/library/email.message.rst + M /python/trunk/Doc/library/email.parser.rst + M /python/trunk/Doc/library/filecmp.rst + M /python/trunk/Doc/library/fractions.rst + M /python/trunk/Doc/library/ftplib.rst + M /python/trunk/Doc/library/gettext.rst + M /python/trunk/Doc/library/logging.rst + M /python/trunk/Doc/library/mailbox.rst + M /python/trunk/Doc/library/mmap.rst + M /python/trunk/Doc/library/modulefinder.rst + M /python/trunk/Doc/library/msilib.rst + M /python/trunk/Doc/library/numbers.rst + M /python/trunk/Doc/library/pickle.rst + M /python/trunk/Doc/library/robotparser.rst + M /python/trunk/Doc/library/simplehttpserver.rst + M /python/trunk/Doc/library/smtpd.rst + M /python/trunk/Doc/library/string.rst + M /python/trunk/Doc/library/struct.rst + M /python/trunk/Doc/library/textwrap.rst + M /python/trunk/Doc/library/xml.etree.elementtree.rst + M /python/trunk/Doc/library/xmllib.rst + M /python/trunk/Doc/library/zipimport.rst + +reformat some documentation of classes so methods and attributes are under the class directive + + +----------------------------------- +[http://svn.python.org/view?rev=62497&view=rev r62497] | armin.rigo | 2008-04-25 05:35:18 -0400 (Fri, 25 Apr 2008) | 2 lines +Changed paths: + A /python/trunk/Lib/test/crashers/mutation_inside_cyclegc.py + +A new crasher. + + +----------------------------------- +[http://svn.python.org/view?rev=62511&view=rev r62511] | georg.brandl | 2008-04-26 14:25:43 -0400 (Sat, 26 Apr 2008) | 2 lines +Changed paths: + M /python/trunk/Doc/library/functions.rst + +#2668: nit in apply() docs. + + +----------------------------------- +[http://svn.python.org/view?rev=62513&view=rev r62513] | georg.brandl | 2008-04-26 14:31:07 -0400 (Sat, 26 Apr 2008) | 2 lines +Changed paths: + M /python/trunk/Doc/c-api/long.rst + +#2691: document PyLong (s)size_t APIs, patch by Alexander Belopolsky. + + +----------------------------------- +[http://svn.python.org/view?rev=62521&view=rev r62521] | georg.brandl | 2008-04-27 05:39:59 -0400 (Sun, 27 Apr 2008) | 2 lines +Changed paths: + M /python/trunk/Doc/reference/expressions.rst + +#2677: add note that not all functions may accept keyword args. + + +----------------------------------- +[http://svn.python.org/view?rev=62535&view=rev r62535] | benjamin.peterson | 2008-04-27 14:14:39 -0400 (Sun, 27 Apr 2008) | 2 lines +Changed paths: + M /python/trunk/Doc/c-api/number.rst + +#2700 Document PyNumber_ToBase + + +----------------------------------- +[http://svn.python.org/view?rev=62545&view=rev r62545] | skip.montanaro | 2008-04-27 16:53:57 -0400 (Sun, 27 Apr 2008) | 1 line +Changed paths: + M /python/trunk/Doc/library/simplehttpserver.rst + +minor wording changes, rewrap a few lines + +----------------------------------- +[http://svn.python.org/view?rev=62551&view=rev r62551] | skip.montanaro | 2008-04-27 18:52:02 -0400 (Sun, 27 Apr 2008) | 4 lines +Changed paths: + M /python/trunk/Doc/library/tempfile.rst + +Wrap some long paragraphs and include the default values for optional +function parameters. + + + +----------------------------------- +[http://svn.python.org/view?rev=62554&view=rev r62554] | skip.montanaro | 2008-04-27 22:59:45 -0400 (Sun, 27 Apr 2008) | 6 lines +Changed paths: + M /python/trunk/Doc/library/pyclbr.rst + +Correct documentation to match implementation: "Class" instead of +"class_descriptor", "Function" instead of "function_descriptor". Note +default path value for readmodule*. Wrap some long paragraphs. Don't +mention 'inpackage' which isn't part of the public API. + + + +----------------------------------- +[http://svn.python.org/view?rev=62556&view=rev r62556] | skip.montanaro | 2008-04-27 23:25:37 -0400 (Sun, 27 Apr 2008) | 2 lines +Changed paths: + M /python/trunk/Doc/library/robotparser.rst + +Wrap some long lines. + + +----------------------------------- +[http://svn.python.org/view?rev=62593&view=rev r62593] | nick.coghlan | 2008-04-30 10:23:36 -0400 (Wed, 30 Apr 2008) | 1 line +Changed paths: + M /python/trunk/Doc/using/cmdline.rst + +Update command line usage documentation to reflect 2.6 changes (also includes some minor cleanups). Addresses TODO list issue 2258 + +----------------------------------- +[http://svn.python.org/view?rev=62602&view=rev r62602] | georg.brandl | 2008-04-30 16:02:37 -0400 (Wed, 30 Apr 2008) | 2 lines +Changed paths: + M /python/trunk/Doc/c-api/typeobj.rst + +#2727: clarify tp_iternext docs. + + +----------------------------------- +[http://svn.python.org/view?rev=62616&view=rev r62616] | georg.brandl | 2008-05-01 14:24:32 -0400 (Thu, 01 May 2008) | 2 lines +Changed paths: + M /python/trunk/Doc/library/carbon.rst + +Fix synopsis. + + +----------------------------------- +[http://svn.python.org/view?rev=62671&view=rev r62671] | georg.brandl | 2008-05-03 16:16:47 -0400 (Sat, 03 May 2008) | 2 lines +Changed paths: + M /python/trunk/Doc/conf.py + +Insert correct OpenSearch base URL. + + +----------------------------------- +[http://svn.python.org/view?rev=62696&view=rev r62696] | georg.brandl | 2008-05-04 05:15:04 -0400 (Sun, 04 May 2008) | 2 lines +Changed paths: + M /python/trunk/Doc/library/socket.rst + +#2752: wrong meaning of '' for socket host. + + +----------------------------------- +[http://svn.python.org/view?rev=62703&view=rev r62703] | georg.brandl | 2008-05-04 11:45:05 -0400 (Sun, 04 May 2008) | 2 lines +Changed paths: + M /python/trunk/Doc/library/unittest.rst + +#2757: Remove spare newline. + + +----------------------------------- +[http://svn.python.org/view?rev=62711&view=rev r62711] | benjamin.peterson | 2008-05-04 15:10:02 -0400 (Sun, 04 May 2008) | 2 lines +Changed paths: + M /python/trunk/Doc/bugs.rst + +Fix typo in bugs.rst + + +----------------------------------- +[http://svn.python.org/view?rev=62736&view=rev r62736] | georg.brandl | 2008-05-05 16:53:39 -0400 (Mon, 05 May 2008) | 2 lines +Changed paths: + M /python/trunk/Doc/library/json.rst + +Fix JSON module docs. + + +----------------------------------- +[http://svn.python.org/view?rev=62740&view=rev r62740] | georg.brandl | 2008-05-05 17:06:48 -0400 (Mon, 05 May 2008) | 2 lines +Changed paths: + M /python/trunk/Doc/library/socket.rst + +#2752: fix second example too. + + +----------------------------------- +[http://svn.python.org/view?rev=62774&view=rev r62774] | georg.brandl | 2008-05-06 13:11:42 -0400 (Tue, 06 May 2008) | 2 lines +Changed paths: + M /python/trunk/Doc/library/stdtypes.rst + +#2773: fix description of 'g' and 'G' formatting spec. + + +----------------------------------- +[http://svn.python.org/view?rev=62775&view=rev r62775] | georg.brandl | 2008-05-06 13:20:54 -0400 (Tue, 06 May 2008) | 2 lines +Changed paths: + M /python/trunk/Doc/library/stdtypes.rst + +> != (!<). + + +----------------------------------- +[http://svn.python.org/view?rev=62800&view=rev r62800] | brett.cannon | 2008-05-06 19:44:04 -0400 (Tue, 06 May 2008) | 2 lines +Changed paths: + A /python/trunk/Misc/TextMate + A /python/trunk/Misc/TextMate/Python-Dev.tmbundle + A /python/trunk/Misc/TextMate/Python-Dev.tmbundle/Commands + A /python/trunk/Misc/TextMate/Python-Dev.tmbundle/Commands/2 to 3 - Module Deletion.tmCommand + A /python/trunk/Misc/TextMate/Python-Dev.tmbundle/Commands/Build Docs.tmCommand + A /python/trunk/Misc/TextMate/Python-Dev.tmbundle/Commands/Build.tmCommand + A /python/trunk/Misc/TextMate/Python-Dev.tmbundle/Commands/Go to Issue.tmCommand + A /python/trunk/Misc/TextMate/Python-Dev.tmbundle/Commands/Open Docs.tmCommand + A /python/trunk/Misc/TextMate/Python-Dev.tmbundle/Commands/Open PEP.tmCommand + A /python/trunk/Misc/TextMate/Python-Dev.tmbundle/info.plist + +Create a TextMate directory in Misc to house a Python-Dev bundle. + + +----------------------------------- +[http://svn.python.org/view?rev=62853&view=rev r62853] | raymond.hettinger | 2008-05-08 03:23:30 -0400 (Thu, 08 May 2008) | 1 line +Changed paths: + M /python/trunk/Doc/library/collections.rst + +Fix-up the enumerate type example and move it to the end. + +----------------------------------- +[http://svn.python.org/view?rev=62873&view=rev r62873] | raymond.hettinger | 2008-05-08 13:18:13 -0400 (Thu, 08 May 2008) | 1 line +Changed paths: + M /python/trunk/Doc/library/stdtypes.rst + +Issue 2778. Document the temporary frozenset swap in __contains__(), remove(), and discard(). + +----------------------------------- +[http://svn.python.org/view?rev=62893&view=rev r62893] | brett.cannon | 2008-05-08 16:20:54 -0400 (Thu, 08 May 2008) | 2 lines +Changed paths: + M /python/trunk/Doc/library/test.rst + +Document the 'record' argument for test.test_support.catch_warning(). + + +----------------------------------- +[http://svn.python.org/view?rev=62914&view=rev r62914] | skip.montanaro | 2008-05-08 20:45:00 -0400 (Thu, 08 May 2008) | 4 lines +Changed paths: + M /python/trunk/Doc/library/tempfile.rst + +Add an example about using NamedTemporaryFile() to replace mktemp(). I'm +unclear whether the verbatim text should have been indented or by how much. + + + +----------------------------------- +[http://svn.python.org/view?rev=62915&view=rev r62915] | benjamin.peterson | 2008-05-08 20:50:40 -0400 (Thu, 08 May 2008) | 2 lines +Changed paths: + M /python/trunk/Doc/library/tempfile.rst + +reindent example + + +----------------------------------- +[http://svn.python.org/view?rev=62927&view=rev r62927] | georg.brandl | 2008-05-09 02:09:25 -0400 (Fri, 09 May 2008) | 2 lines +Changed paths: + A /python/trunk/.hgignore + +#2788: add .hgignore file. + + +----------------------------------- +[http://svn.python.org/view?rev=62928&view=rev r62928] | georg.brandl | 2008-05-09 02:10:43 -0400 (Fri, 09 May 2008) | 2 lines +Changed paths: + M /python/trunk/Doc/library/_winreg.rst + +#2781: fix function name. + + +----------------------------------- +[http://svn.python.org/view?rev=62929&view=rev r62929] | georg.brandl | 2008-05-09 02:18:27 -0400 (Fri, 09 May 2008) | 2 lines +Changed paths: + M /python/trunk/Doc/library/logging.rst + +Add a sentence to basicConfig() that is in the docstring. + + +----------------------------------- +[http://svn.python.org/view?rev=62930&view=rev r62930] | georg.brandl | 2008-05-09 02:26:54 -0400 (Fri, 09 May 2008) | 2 lines +Changed paths: + M /python/trunk/Doc/library/colorsys.rst + +Add another link to colorsys docs. + + +----------------------------------- +[http://svn.python.org/view?rev=62931&view=rev r62931] | georg.brandl | 2008-05-09 02:36:07 -0400 (Fri, 09 May 2008) | 2 lines +Changed paths: + M /python/trunk/Doc/library/re.rst + +Add Kodos as a re reference. + + +----------------------------------- +[http://svn.python.org/view?rev=62932&view=rev r62932] | georg.brandl | 2008-05-09 02:39:58 -0400 (Fri, 09 May 2008) | 2 lines +Changed paths: + M /python/trunk/Doc/tutorial/modules.rst + +Add a note about using reload(). + + +----------------------------------- +[http://svn.python.org/view?rev=62957&view=rev r62957] | benjamin.peterson | 2008-05-09 17:30:26 -0400 (Fri, 09 May 2008) | 2 lines +Changed paths: + M /python/trunk/Doc/library/stdtypes.rst + +In stdtypes.rst, move methods under class directives where applicable + + +----------------------------------- +[http://svn.python.org/view?rev=62967&view=rev r62967] | brett.cannon | 2008-05-09 22:25:00 -0400 (Fri, 09 May 2008) | 2 lines +Changed paths: + M /python/trunk/Doc/library/new.rst + M /python/trunk/Doc/library/user.rst + +Fix some errors in the deprecation warnings for new and user. + + +----------------------------------- +[http://svn.python.org/view?rev=62993&view=rev r62993] | skip.montanaro | 2008-05-10 10:48:49 -0400 (Sat, 10 May 2008) | 2 lines +Changed paths: + M /python/trunk/Doc/library/bsddb.rst + +Note the PyPI-edness of bsddb185 for people who might still need it. + + +----------------------------------- +[http://svn.python.org/view?rev=62995&view=rev r62995] | andrew.kuchling | 2008-05-10 13:37:05 -0400 (Sat, 10 May 2008) | 1 line +Changed paths: + M /python/trunk/Doc/library/warnings.rst + +Document the 'line' argument + +----------------------------------- +[http://svn.python.org/view?rev=62996&view=rev r62996] | andrew.kuchling | 2008-05-10 13:48:45 -0400 (Sat, 10 May 2008) | 1 line +Changed paths: + M /python/trunk/Doc/library/imp.rst + +#1625509: describe behaviour of import lock + +----------------------------------- +[http://svn.python.org/view?rev=63014&view=rev r63014] | andrew.kuchling | 2008-05-10 18:12:38 -0400 (Sat, 10 May 2008) | 1 line +Changed paths: + A /python/trunk/Lib/distutils/config.py + +#1858: add distutils.config module + +----------------------------------- +[http://svn.python.org/view?rev=63028&view=rev r63028] | skip.montanaro | 2008-05-10 22:59:30 -0400 (Sat, 10 May 2008) | 4 lines +Changed paths: + M /python/trunk/Doc/library/tempfile.rst + +Copied two versions of the example from the interactive session. Delete +one. + + + +----------------------------------- +[http://svn.python.org/view?rev=63037&view=rev r63037] | georg.brandl | 2008-05-11 03:02:17 -0400 (Sun, 11 May 2008) | 2 lines +Changed paths: + M /python/trunk/Doc/tutorial/modules.rst + +reload() takes the module itself. + + +----------------------------------- +[http://svn.python.org/view?rev=63039&view=rev r63039] | georg.brandl | 2008-05-11 03:06:05 -0400 (Sun, 11 May 2008) | 2 lines +Changed paths: + M /python/trunk/Doc/library/socket.rst + +#2742: ``''`` is not converted to NULL in getaddrinfo. + + +----------------------------------- +[http://svn.python.org/view?rev=63043&view=rev r63043] | georg.brandl | 2008-05-11 04:47:53 -0400 (Sun, 11 May 2008) | 2 lines +Changed paths: + M /python/trunk/Doc/library/functions.rst + +#2812: document property.getter/setter/deleter. + + +----------------------------------- +[http://svn.python.org/view?rev=63049&view=rev r63049] | georg.brandl | 2008-05-11 05:06:30 -0400 (Sun, 11 May 2008) | 2 lines +Changed paths: + M /python/trunk/Doc/library/stdtypes.rst + +#1153769: document PEP 237 changes to string formatting. + + +----------------------------------- +[http://svn.python.org/view?rev=63051&view=rev r63051] | georg.brandl | 2008-05-11 06:13:59 -0400 (Sun, 11 May 2008) | 2 lines +Changed paths: + M /python/trunk/Doc/library/socket.rst + +Fix typo. + + +----------------------------------- +[http://svn.python.org/view?rev=63052&view=rev r63052] | georg.brandl | 2008-05-11 06:33:27 -0400 (Sun, 11 May 2008) | 2 lines +Changed paths: + M /python/trunk/Doc/library/tk.rst + +#2709: clarification. + + +----------------------------------- +[http://svn.python.org/view?rev=63055&view=rev r63055] | georg.brandl | 2008-05-11 06:55:59 -0400 (Sun, 11 May 2008) | 2 lines +Changed paths: + M /python/trunk/Doc/library/exceptions.rst + M /python/trunk/Doc/library/stdtypes.rst + M /python/trunk/Doc/reference/datamodel.rst + M /python/trunk/Doc/reference/expressions.rst + +#2147: PEP 237 changes to overflow behavior. + + +----------------------------------- +[http://svn.python.org/view?rev=63057&view=rev r63057] | georg.brandl | 2008-05-11 06:59:39 -0400 (Sun, 11 May 2008) | 2 lines +Changed paths: + M /python/trunk/Doc/library/socketserver.rst + +#2741: clarification of value range for address_family. + + +----------------------------------- +[http://svn.python.org/view?rev=63058&view=rev r63058] | georg.brandl | 2008-05-11 07:09:35 -0400 (Sun, 11 May 2008) | 2 lines +Changed paths: + M /python/trunk/Doc/library/ftplib.rst + M /python/trunk/Doc/library/httplib.rst + M /python/trunk/Doc/library/smtplib.rst + M /python/trunk/Doc/library/telnetlib.rst + M /python/trunk/Doc/library/urllib2.rst + +#2452: timeout is used for all blocking operations. + + +----------------------------------- +[http://svn.python.org/view?rev=63066&view=rev r63066] | georg.brandl | 2008-05-11 10:56:04 -0400 (Sun, 11 May 2008) | 2 lines +Changed paths: + M /python/trunk/Doc/library/othergui.rst + M /python/trunk/Doc/library/tk.rst + +#2709 followup: better description of Tk's pros and cons. + + +----------------------------------- +[http://svn.python.org/view?rev=63095&view=rev r63095] | georg.brandl | 2008-05-11 17:16:37 -0400 (Sun, 11 May 2008) | 2 lines +Changed paths: + M /python/trunk/Doc/library/os.rst + +Clarify os.strerror()s exception behavior. + + +----------------------------------- +[http://svn.python.org/view?rev=63098&view=rev r63098] | georg.brandl | 2008-05-11 17:37:53 -0400 (Sun, 11 May 2008) | 2 lines +Changed paths: + M /python/trunk/Doc/library/cgi.rst + +Formally deprecate old classes in the cgi module. + + +----------------------------------- +[http://svn.python.org/view?rev=63100&view=rev r63100] | georg.brandl | 2008-05-11 17:54:09 -0400 (Sun, 11 May 2008) | 2 lines +Changed paths: + M /python/trunk/Doc/library/mailbox.rst + +Add a deprecation notice to mailbox' old classes' doc. + + +----------------------------------- +[http://svn.python.org/view?rev=63104&view=rev r63104] | alexandre.vassalotti | 2008-05-11 19:04:27 -0400 (Sun, 11 May 2008) | 2 lines +Changed paths: + D /python/trunk/Lib/Queue.py + A /python/trunk/Lib/lib-old/Queue.py (from /python/trunk/Lib/Queue.py:63101) + +Moved the Queue module stub in lib-old. + + +----------------------------------- +[http://svn.python.org/view?rev=63134&view=rev r63134] | alexandre.vassalotti | 2008-05-11 22:18:15 -0400 (Sun, 11 May 2008) | 3 lines +Changed paths: + M /python/trunk/Doc/library/socketserver.rst + A /python/trunk/Doc/library/socketserver_old.rst + +Added stub entry in the documentation mentioning SocketServer +was renamed. + + +----------------------------------- +[http://svn.python.org/view?rev=63153&view=rev r63153] | georg.brandl | 2008-05-12 06:03:16 -0400 (Mon, 12 May 2008) | 2 lines +Changed paths: + M /python/trunk/Doc/library/queue.rst + M /python/trunk/Doc/library/socketserver.rst + D /python/trunk/Doc/library/socketserver_old.rst + M /python/trunk/Doc/library/threading.rst + M /python/trunk/Doc/reference/simple_stmts.rst + M /python/trunk/Doc/tutorial/stdlib2.rst + +Fix-up docs for socketserver and queue renaming. + + +----------------------------------- +[http://svn.python.org/view?rev=63154&view=rev r63154] | georg.brandl | 2008-05-12 06:05:39 -0400 (Mon, 12 May 2008) | 2 lines +Changed paths: + M /python/trunk/Doc/library/copy.rst + D /python/trunk/Doc/library/copy_reg.rst + A /python/trunk/Doc/library/copyreg.rst (from /python/trunk/Doc/library/copy_reg.rst:63151) + M /python/trunk/Doc/library/persistence.rst + M /python/trunk/Doc/library/pickle.rst + +Fix-up docs for the copyreg module renaming. + + +----------------------------------- +[http://svn.python.org/view?rev=63170&view=rev r63170] | georg.brandl | 2008-05-12 12:53:42 -0400 (Mon, 12 May 2008) | 2 lines +Changed paths: + M /python/trunk/Doc/library/functions.rst + +Fix parameter name for enumerate(). + + +----------------------------------- +[http://svn.python.org/view?rev=63175&view=rev r63175] | georg.brandl | 2008-05-12 13:14:51 -0400 (Mon, 12 May 2008) | 2 lines +Changed paths: + M /python/trunk/Doc/reference/executionmodel.rst + +#1760: try-except-finally is one statement since PEP 341. + + +----------------------------------- +[http://svn.python.org/view?rev=63178&view=rev r63178] | georg.brandl | 2008-05-12 13:47:53 -0400 (Mon, 12 May 2008) | 2 lines +Changed paths: + M /python/trunk/Doc/c-api/marshal.rst + +Marshal is at version 2. + + +----------------------------------- +[http://svn.python.org/view?rev=63179&view=rev r63179] | georg.brandl | 2008-05-12 13:48:56 -0400 (Mon, 12 May 2008) | 2 lines +Changed paths: + M /python/trunk/Doc/c-api/marshal.rst + +Mention version in which the new marshal version was introduced. + + +----------------------------------- +[http://svn.python.org/view?rev=63180&view=rev r63180] | georg.brandl | 2008-05-12 13:52:13 -0400 (Mon, 12 May 2008) | 2 lines +Changed paths: + M /python/trunk/Doc/library/winsound.rst + +Win 95/98 is no longer supported. + + +----------------------------------- +[http://svn.python.org/view?rev=63240&view=rev r63240] | alexandre.vassalotti | 2008-05-14 17:52:37 -0400 (Wed, 14 May 2008) | 5 lines +Changed paths: + D /python/trunk/Lib/copy_reg.py + A /python/trunk/Lib/lib-old/copy_reg.py (from /python/trunk/Lib/copy_reg.py:63239) + +Moved copy_reg stub module to lib-old/. + +Stub modules will be easier to track (and remove) if they are all kept +in lib-old/, instead of sprinkling them throughout the library. + + +----------------------------------- +[http://svn.python.org/view?rev=63247&view=rev r63247] | georg.brandl | 2008-05-14 18:30:31 -0400 (Wed, 14 May 2008) | 2 lines +Changed paths: + M /python/trunk/Doc/library/configparser.rst + M /python/trunk/Doc/library/logging.rst + M /python/trunk/Doc/library/shlex.rst + +Update configparser docs for lowercasing rename. + + +----------------------------------- +[http://svn.python.org/view?rev=63249&view=rev r63249] | alexandre.vassalotti | 2008-05-14 18:51:10 -0400 (Wed, 14 May 2008) | 2 lines +Changed paths: + M /python/trunk/Doc/library/configparser.rst + +Added documentation stub for ConfigParser. + + +----------------------------------- +[http://svn.python.org/view?rev=63308&view=rev r63308] | brett.cannon | 2008-05-15 00:34:17 -0400 (Thu, 15 May 2008) | 1 line +Changed paths: + M /python/trunk/Doc/library/al.rst + M /python/trunk/Doc/library/cd.rst + M /python/trunk/Doc/library/fl.rst + M /python/trunk/Doc/library/fm.rst + M /python/trunk/Doc/library/gl.rst + M /python/trunk/Doc/library/imgfile.rst + M /python/trunk/Doc/library/jpeg.rst + +Update docs for deprecation of IRIX modules. + +----------------------------------- +[http://svn.python.org/view?rev=63358&view=rev r63358] | alexandre.vassalotti | 2008-05-16 03:00:58 -0400 (Fri, 16 May 2008) | 2 lines +Changed paths: + M /python/trunk/Doc/library/reprlib.rst + +Updated reprlib's documentation to mention the renaming. + + +----------------------------------- +[http://svn.python.org/view?rev=63361&view=rev r63361] | alexandre.vassalotti | 2008-05-16 03:14:08 -0400 (Fri, 16 May 2008) | 2 lines +Changed paths: + D /python/trunk/Lib/test/test_repr.py + A /python/trunk/Lib/test/test_reprlib.py (from /python/trunk/Lib/test/test_repr.py:63357) + +Rename the test file of reprlib. + + +----------------------------------- +[http://svn.python.org/view?rev=63365&view=rev r63365] | georg.brandl | 2008-05-16 05:47:29 -0400 (Fri, 16 May 2008) | 2 lines +Changed paths: + M /python/trunk/Doc/library/calendar.rst + +#2869: remove parameter from signature. + + +----------------------------------- +[http://svn.python.org/view?rev=63369&view=rev r63369] | georg.brandl | 2008-05-16 09:18:50 -0400 (Fri, 16 May 2008) | 2 lines +Changed paths: + M /python/trunk/Doc/library/shutil.rst + +#2845: fix copy2's docs. + + +----------------------------------- +[http://svn.python.org/view?rev=63373&view=rev r63373] | georg.brandl | 2008-05-16 09:41:26 -0400 (Fri, 16 May 2008) | 2 lines +Changed paths: + M /python/trunk/Doc/library/os.rst + +Document O_ASYNC addition. + + +----------------------------------- +[http://svn.python.org/view?rev=63374&view=rev r63374] | georg.brandl | 2008-05-16 10:24:45 -0400 (Fri, 16 May 2008) | 2 lines +Changed paths: + D /python/trunk/Lib/lib-tk/Dialog.py + D /python/trunk/Lib/lib-tk/FileDialog.py + D /python/trunk/Lib/lib-tk/FixTk.py + D /python/trunk/Lib/lib-tk/ScrolledText.py + D /python/trunk/Lib/lib-tk/SimpleDialog.py + D /python/trunk/Lib/lib-tk/Tix.py + D /python/trunk/Lib/lib-tk/Tkconstants.py + D /python/trunk/Lib/lib-tk/Tkdnd.py + D /python/trunk/Lib/lib-tk/Tkinter.py + D /python/trunk/Lib/lib-tk/tkColorChooser.py + D /python/trunk/Lib/lib-tk/tkCommonDialog.py + D /python/trunk/Lib/lib-tk/tkFont.py + D /python/trunk/Lib/lib-tk/tkMessageBox.py + D /python/trunk/Lib/lib-tk/turtle.py + A /python/trunk/Lib/tkinter + A /python/trunk/Lib/tkinter/__init__.py (from /python/trunk/Lib/lib-tk/Tkinter.py:63367) + A /python/trunk/Lib/tkinter/_fix.py (from /python/trunk/Lib/lib-tk/FixTk.py:63367) + A /python/trunk/Lib/tkinter/colorchooser.py (from /python/trunk/Lib/lib-tk/tkColorChooser.py:63367) + A /python/trunk/Lib/tkinter/commondialog.py (from /python/trunk/Lib/lib-tk/tkCommonDialog.py:63367) + A /python/trunk/Lib/tkinter/constants.py (from /python/trunk/Lib/lib-tk/Tkconstants.py:63367) + A /python/trunk/Lib/tkinter/dialog.py (from /python/trunk/Lib/lib-tk/Dialog.py:63367) + A /python/trunk/Lib/tkinter/dnd.py (from /python/trunk/Lib/lib-tk/Tkdnd.py:63367) + A /python/trunk/Lib/tkinter/filedialog.py (from /python/trunk/Lib/lib-tk/FileDialog.py:63367) + A /python/trunk/Lib/tkinter/font.py (from /python/trunk/Lib/lib-tk/tkFont.py:63367) + A /python/trunk/Lib/tkinter/messagebox.py (from /python/trunk/Lib/lib-tk/tkMessageBox.py:63367) + A /python/trunk/Lib/tkinter/scrolledtext.py (from /python/trunk/Lib/lib-tk/ScrolledText.py:63367) + A /python/trunk/Lib/tkinter/simpledialog.py (from /python/trunk/Lib/lib-tk/SimpleDialog.py:63367) + A /python/trunk/Lib/tkinter/tix.py (from /python/trunk/Lib/lib-tk/Tix.py:63367) + A /python/trunk/Lib/tkinter/turtle.py (from /python/trunk/Lib/lib-tk/turtle.py:63367) + +Step 1 of Tkinter renaming: move lib-tk modules into a new "tkinter" package. + + +----------------------------------- +[http://svn.python.org/view?rev=63380&view=rev r63380] | georg.brandl | 2008-05-16 13:33:13 -0400 (Fri, 16 May 2008) | 2 lines +Changed paths: + M /python/trunk/Doc/library/datatypes.rst + M /python/trunk/Doc/library/reprlib.rst + +Fix reprlib docs. + + +----------------------------------- +[http://svn.python.org/view?rev=63381&view=rev r63381] | georg.brandl | 2008-05-16 13:37:53 -0400 (Fri, 16 May 2008) | 2 lines +Changed paths: + M /python/trunk/Doc/library/idle.rst + M /python/trunk/Doc/library/othergui.rst + D /python/trunk/Doc/library/scrolledtext.rst + D /python/trunk/Doc/library/tix.rst + M /python/trunk/Doc/library/tk.rst + M /python/trunk/Doc/library/tkinter.rst + A /python/trunk/Doc/library/tkinter.scrolledtext.rst (from /python/trunk/Doc/library/scrolledtext.rst:63373) + A /python/trunk/Doc/library/tkinter.tix.rst (from /python/trunk/Doc/library/tix.rst:63373) + A /python/trunk/Doc/library/tkinter.turtle.rst (from /python/trunk/Doc/library/turtle.rst:63373) + D /python/trunk/Doc/library/turtle.rst + +Doc changes for the big Tkinter rename. + + +----------------------------------- +[http://svn.python.org/view?rev=63411&view=rev r63411] | lars.gustaebel | 2008-05-17 12:50:22 -0400 (Sat, 17 May 2008) | 8 lines +Changed paths: + M /python/trunk/Doc/library/tarfile.rst + +Replace signatures with optional arguments in square brackets with +keyword arguments and the actual default values. +Fix references that point nowhere or to the wrong place. +Add description of the ENCODING module-level variable. +Fix the URL pointing to the GNU tar manual. +Remove two obsolete examples. +Add an example on how to use a generator with TarFile.extractall(). + + +----------------------------------- +[http://svn.python.org/view?rev=63434&view=rev r63434] | fred.drake | 2008-05-17 17:23:02 -0400 (Sat, 17 May 2008) | 3 lines +Changed paths: + M /python/trunk/Doc/library/htmllib.rst + M /python/trunk/Doc/library/htmlparser.rst + +document the renames for modules moved to the html package +(http://bugs.python.org/issue2882) + + +----------------------------------- +[http://svn.python.org/view?rev=63445&view=rev r63445] | georg.brandl | 2008-05-18 04:52:59 -0400 (Sun, 18 May 2008) | 2 lines +Changed paths: + M /python/trunk/Doc/library/socketserver.rst + +GHOP #180 by Michael Schneider: add examples to the socketserver documentation. + + +----------------------------------- +[http://svn.python.org/view?rev=63450&view=rev r63450] | georg.brandl | 2008-05-18 07:52:36 -0400 (Sun, 18 May 2008) | 2 lines +Changed paths: + A /python/trunk/Lib/distutils/tests/test_build_ext.py + +GHOP #257: test distutils' build_ext command, written by Josip Dzolonga. + + +----------------------------------- +[http://svn.python.org/view?rev=63485&view=rev r63485] | georg.brandl | 2008-05-20 02:49:28 -0400 (Tue, 20 May 2008) | 2 lines +Changed paths: + D /python/trunk/Lib/lib-tk/FileDialog.py + D /python/trunk/Lib/lib-tk/FixTk.py + D /python/trunk/Lib/lib-tk/ScrolledText.py + D /python/trunk/Lib/lib-tk/SimpleDialog.py + D /python/trunk/Lib/lib-tk/Tix.py + D /python/trunk/Lib/lib-tk/Tkconstants.py + D /python/trunk/Lib/lib-tk/Tkdnd.py + D /python/trunk/Lib/lib-tk/Tkinter.py + D /python/trunk/Lib/lib-tk/tkColorChooser.py + D /python/trunk/Lib/lib-tk/tkCommonDialog.py + D /python/trunk/Lib/lib-tk/tkFileDialog.py + D /python/trunk/Lib/lib-tk/tkFont.py + D /python/trunk/Lib/lib-tk/tkMessageBox.py + D /python/trunk/Lib/lib-tk/tkSimpleDialog.py + D /python/trunk/Lib/lib-tk/turtle.py + +Tkinter renaming reversal: Delete all stubs from lib-tk. + + +----------------------------------- +[http://svn.python.org/view?rev=63486&view=rev r63486] | georg.brandl | 2008-05-20 02:58:21 -0400 (Tue, 20 May 2008) | 2 lines +Changed paths: + A /python/trunk/Lib/lib-tk/Dialog.py (from /python/trunk/Lib/tkinter/dialog.py:63480) + A /python/trunk/Lib/lib-tk/FileDialog.py + A /python/trunk/Lib/lib-tk/FixTk.py (from /python/trunk/Lib/tkinter/_fix.py:63480) + A /python/trunk/Lib/lib-tk/ScrolledText.py (from /python/trunk/Lib/tkinter/scrolledtext.py:63480) + A /python/trunk/Lib/lib-tk/SimpleDialog.py + A /python/trunk/Lib/lib-tk/Tix.py (from /python/trunk/Lib/tkinter/tix.py:63480) + A /python/trunk/Lib/lib-tk/Tkconstants.py (from /python/trunk/Lib/tkinter/constants.py:63480) + A /python/trunk/Lib/lib-tk/Tkdnd.py (from /python/trunk/Lib/tkinter/dnd.py:63480) + A /python/trunk/Lib/lib-tk/Tkinter.py (from /python/trunk/Lib/tkinter/__init__.py:63480) + A /python/trunk/Lib/lib-tk/tkColorChooser.py (from /python/trunk/Lib/tkinter/colorchooser.py:63480) + A /python/trunk/Lib/lib-tk/tkCommonDialog.py (from /python/trunk/Lib/tkinter/commondialog.py:63480) + A /python/trunk/Lib/lib-tk/tkFileDialog.py + A /python/trunk/Lib/lib-tk/tkFont.py (from /python/trunk/Lib/tkinter/font.py:63480) + A /python/trunk/Lib/lib-tk/tkMessageBox.py (from /python/trunk/Lib/tkinter/messagebox.py:63480) + A /python/trunk/Lib/lib-tk/tkSimpleDialog.py + A /python/trunk/Lib/lib-tk/turtle.py (from /python/trunk/Lib/tkinter/turtle.py:63480) + +Tkinter renaming reversal: move modules back in their place. + + +----------------------------------- +[http://svn.python.org/view?rev=63488&view=rev r63488] | georg.brandl | 2008-05-20 03:20:12 -0400 (Tue, 20 May 2008) | 2 lines +Changed paths: + M /python/trunk/Doc/glossary.rst + M /python/trunk/Doc/library/future_builtins.rst + M /python/trunk/Doc/library/scrolledtext.rst + M /python/trunk/Doc/library/tix.rst + M /python/trunk/Doc/library/tkinter.rst + +Add notes that tkinter modules will be renamed. + + +----------------------------------- +[http://svn.python.org/view?rev=63489&view=rev r63489] | georg.brandl | 2008-05-20 03:21:58 -0400 (Tue, 20 May 2008) | 2 lines +Changed paths: + M /python/trunk/Doc/library/htmllib.rst + M /python/trunk/Doc/library/htmlparser.rst + +Standardize renaming notes. + + +----------------------------------- +[http://svn.python.org/view?rev=63490&view=rev r63490] | georg.brandl | 2008-05-20 03:23:25 -0400 (Tue, 20 May 2008) | 2 lines +Changed paths: + D /python/trunk/Lib/tkinter + +Remove rest of the tkinter package. + + +----------------------------------- +[http://svn.python.org/view?rev=63541&view=rev r63541] | raymond.hettinger | 2008-05-22 20:49:27 -0400 (Thu, 22 May 2008) | 1 line +Changed paths: + M /python/trunk/Doc/library/math.rst + +Docs for Issue 2819. + +----------------------------------- +[http://svn.python.org/view?rev=63549&view=rev r63549] | brett.cannon | 2008-05-23 01:05:20 -0400 (Fri, 23 May 2008) | 1 line +Changed paths: + D /python/trunk/Lib/lib-old/repr.py + +Remove the old repr stub. + +----------------------------------- +[http://svn.python.org/view?rev=63564&view=rev r63564] | raymond.hettinger | 2008-05-23 13:21:44 -0400 (Fri, 23 May 2008) | 1 line +Changed paths: + M /python/trunk/Doc/library/struct.rst + +Issue 2909: show how to name unpacked fields. + +----------------------------------- +[http://svn.python.org/view?rev=63567&view=rev r63567] | raymond.hettinger | 2008-05-23 13:34:34 -0400 (Fri, 23 May 2008) | 1 line +Changed paths: + M /python/trunk/Doc/library/collections.rst + +Fix typo + +----------------------------------- +[http://svn.python.org/view?rev=63586&view=rev r63586] | georg.brandl | 2008-05-24 14:08:33 -0400 (Sat, 24 May 2008) | 2 lines +Changed paths: + D /python/trunk/Lib/lib-old/SocketServer.py + +socketserver renaming reversal part 1: remove stub module. + + +----------------------------------- +[http://svn.python.org/view?rev=63587&view=rev r63587] | georg.brandl | 2008-05-24 14:11:29 -0400 (Sat, 24 May 2008) | 5 lines +Changed paths: + A /python/trunk/Lib/lib-old/SocketServer.py (from /python/trunk/Lib/socketserver.py:63585) + D /python/trunk/Lib/socketserver.py + +socketserver renaming reversal part 2: move rename module. + +I'm doing this case-only rename in a two-step process via a different directory +to hopefully avoid problems with case-insensitive filesystems. + + +----------------------------------- +[http://svn.python.org/view?rev=63597&view=rev r63597] | gregory.p.smith | 2008-05-24 17:21:23 -0400 (Sat, 24 May 2008) | 3 lines +Changed paths: + M /python/trunk/Doc/library/bsddb.rst + +Correct the url to the external bsddb.db docs (likely to be integrated +soon anyways?) + + +----------------------------------- +[http://svn.python.org/view?rev=63599&view=rev r63599] | georg.brandl | 2008-05-25 03:08:35 -0400 (Sun, 25 May 2008) | 2 lines +Changed paths: + D /python/trunk/Lib/lib-old/Queue.py + +Queue renaming reversal part 1: remove stub module. + + +----------------------------------- +[http://svn.python.org/view?rev=63600&view=rev r63600] | georg.brandl | 2008-05-25 03:10:03 -0400 (Sun, 25 May 2008) | 2 lines +Changed paths: + A /python/trunk/Lib/lib-old/Queue.py (from /python/trunk/Lib/queue.py:63585) + D /python/trunk/Lib/queue.py + +Queue renaming reversal part 2: move module. + + +----------------------------------- +[http://svn.python.org/view?rev=63605&view=rev r63605] | georg.brandl | 2008-05-25 03:21:41 -0400 (Sun, 25 May 2008) | 2 lines +Changed paths: + D /python/trunk/Lib/lib-old/ConfigParser.py + +ConfigParser renaming reversal part 1: remove stub module. + + +----------------------------------- +[http://svn.python.org/view?rev=63606&view=rev r63606] | georg.brandl | 2008-05-25 03:21:58 -0400 (Sun, 25 May 2008) | 2 lines +Changed paths: + D /python/trunk/Lib/configparser.py + A /python/trunk/Lib/lib-old/ConfigParser.py (from /python/trunk/Lib/configparser.py:63602) + +ConfigParser renaming reversal part 2: move module. + + +----------------------------------- +[http://svn.python.org/view?rev=63611&view=rev r63611] | georg.brandl | 2008-05-25 03:46:33 -0400 (Sun, 25 May 2008) | 2 lines +Changed paths: + M /python/trunk/Doc/library/_winreg.rst + +Hint about _winreg renaming in the docs. + + +----------------------------------- +[http://svn.python.org/view?rev=63630&view=rev r63630] | georg.brandl | 2008-05-25 08:34:57 -0400 (Sun, 25 May 2008) | 2 lines +Changed paths: + M /python/trunk/Doc/library/dummy_thread.rst + M /python/trunk/Doc/library/thread.rst + +Add renaming notices to thread and dummy_thread. + + +----------------------------------- +[http://svn.python.org/view?rev=63649&view=rev r63649] | benjamin.peterson | 2008-05-25 16:05:52 -0400 (Sun, 25 May 2008) | 2 lines +Changed paths: + M /python/trunk/Doc/library/string.rst + +rename the section about new formatting 'new-string-formatting' + + +----------------------------------- +[http://svn.python.org/view?rev=63655&view=rev r63655] | benjamin.peterson | 2008-05-25 20:54:22 -0400 (Sun, 25 May 2008) | 2 lines +Changed paths: + M /python/trunk/Doc/tutorial/controlflow.rst + M /python/trunk/Doc/tutorial/datastructures.rst + M /python/trunk/Doc/tutorial/errors.rst + M /python/trunk/Doc/tutorial/floatingpoint.rst + M /python/trunk/Doc/tutorial/inputoutput.rst + M /python/trunk/Doc/tutorial/introduction.rst + M /python/trunk/Doc/tutorial/stdlib2.rst + +update the tutorial to use str.format + + +----------------------------------- +[http://svn.python.org/view?rev=63660&view=rev r63660] | georg.brandl | 2008-05-26 06:22:15 -0400 (Mon, 26 May 2008) | 2 lines +Changed paths: + M /python/trunk/Doc/library/anydbm.rst + M /python/trunk/Doc/library/dbhash.rst + M /python/trunk/Doc/library/dbm.rst + M /python/trunk/Doc/library/dumbdbm.rst + M /python/trunk/Doc/library/gdbm.rst + M /python/trunk/Doc/library/whichdb.rst + +Add renaming notices to 2.6 dbm module docs. + + +----------------------------------- +[http://svn.python.org/view?rev=63665&view=rev r63665] | georg.brandl | 2008-05-26 06:47:43 -0400 (Mon, 26 May 2008) | 2 lines +Changed paths: + M /python/trunk/Doc/library/docxmlrpcserver.rst + M /python/trunk/Doc/library/simplexmlrpcserver.rst + M /python/trunk/Doc/library/xmlrpclib.rst + +Add renaming notices to xmlrpc modules. + + +----------------------------------- +[http://svn.python.org/view?rev=63686&view=rev r63686] | benjamin.peterson | 2008-05-26 10:02:09 -0400 (Mon, 26 May 2008) | 2 lines +Changed paths: + M /python/trunk/Doc/c-api/string.rst + +note that PyString and has been aliased to PyBytes + + +----------------------------------- +[http://svn.python.org/view?rev=63688&view=rev r63688] | benjamin.peterson | 2008-05-26 10:29:09 -0400 (Mon, 26 May 2008) | 2 lines +Changed paths: + M /python/trunk/Doc/c-api/string.rst + +fix a minor typo + + +----------------------------------- +[http://svn.python.org/view?rev=63696&view=rev r63696] | benjamin.peterson | 2008-05-26 11:54:26 -0400 (Mon, 26 May 2008) | 2 lines +Changed paths: + A /python/trunk/Doc/c-api/bytearray.rst + M /python/trunk/Doc/c-api/concrete.rst + +add PyByteArray docs + + +----------------------------------- +[http://svn.python.org/view?rev=63726&view=rev r63726] | benjamin.peterson | 2008-05-26 16:43:24 -0400 (Mon, 26 May 2008) | 2 lines +Changed paths: + M /python/trunk/Doc/library/codecs.rst + +fix minor grammar typo + + +----------------------------------- +[http://svn.python.org/view?rev=63754&view=rev r63754] | benjamin.peterson | 2008-05-27 21:12:35 -0400 (Tue, 27 May 2008) | 2 lines +Changed paths: + M /python/trunk/Doc/tutorial/controlflow.rst + +update tutorial function with more appropiate one from Eric Smith + + +----------------------------------- +[http://svn.python.org/view?rev=63758&view=rev r63758] | benjamin.peterson | 2008-05-28 07:51:41 -0400 (Wed, 28 May 2008) | 2 lines +Changed paths: + M /python/trunk/Doc/tutorial/controlflow.rst + +fix spelling + + +----------------------------------- +[http://svn.python.org/view?rev=63775&view=rev r63775] | georg.brandl | 2008-05-29 03:18:17 -0400 (Thu, 29 May 2008) | 2 lines +Changed paths: + M /python/trunk/Doc/c-api/bytearray.rst + +Two fixes in bytearray docs. + + +----------------------------------- +[http://svn.python.org/view?rev=63781&view=rev r63781] | georg.brandl | 2008-05-29 03:38:37 -0400 (Thu, 29 May 2008) | 2 lines +Changed paths: + M /python/trunk/Doc/library/cookie.rst + +#2988: add note about catching CookieError when parsing untrusted cookie data. + + +----------------------------------- +[http://svn.python.org/view?rev=63818&view=rev r63818] | georg.brandl | 2008-05-30 15:12:13 -0400 (Fri, 30 May 2008) | 2 lines +Changed paths: + M /python/trunk/Doc/library/os.rst + +getloadavg() is not available on Windows. + + +----------------------------------- +[http://svn.python.org/view?rev=63819&view=rev r63819] | georg.brandl | 2008-05-30 15:17:29 -0400 (Fri, 30 May 2008) | 2 lines +Changed paths: + M /python/trunk/Doc/tutorial/interpreter.rst + +Better quote with single quotes. + + +----------------------------------- +[http://svn.python.org/view?rev=63823&view=rev r63823] | benjamin.peterson | 2008-05-30 16:44:39 -0400 (Fri, 30 May 2008) | 2 lines +Changed paths: + M /python/trunk/Doc/c-api/bytearray.rst + +fix grammar + + +----------------------------------- +[http://svn.python.org/view?rev=63830&view=rev r63830] | georg.brandl | 2008-05-31 10:40:09 -0400 (Sat, 31 May 2008) | 2 lines +Changed paths: + M /python/trunk/Doc/library/cmd.rst + +#3010: clarification about stdin/use_rawinput. + + +----------------------------------- +[http://svn.python.org/view?rev=63831&view=rev r63831] | georg.brandl | 2008-05-31 10:45:55 -0400 (Sat, 31 May 2008) | 2 lines +Changed paths: + M /python/trunk/Doc/library/easydialogs.rst + +#3005: add explaining sentence to easydialogs docs. + + +----------------------------------- +[http://svn.python.org/view?rev=63858&view=rev r63858] | georg.brandl | 2008-06-01 12:41:31 -0400 (Sun, 01 Jun 2008) | 2 lines +Changed paths: + M /python/trunk/Doc/Makefile + M /python/trunk/Doc/README.txt + +Add plain text make target. + + +----------------------------------- +[http://svn.python.org/view?rev=63932&view=rev r63932] | georg.brandl | 2008-06-04 07:17:26 -0400 (Wed, 04 Jun 2008) | 2 lines +Changed paths: + M /python/trunk/Doc/library/turtle.rst + +Complete revision of new turtle module's docs. + + +----------------------------------- + +On Windows, the same scheme is implemented for the error value which +is managed by the GetLastError() and SetLastError() windows api calls. + +The ctypes functions are 'ctypes.set_last_error(value)' and +'ctypes.get_last_error()', the CDLL and WinDLL optional parameter is +named 'use_last_error', defaults to False. + + +----------------------------------- + +On Windows, TlsSetValue and TlsGetValue calls are used to provide +thread local storage for the variables; ctypes compiled with __GNUC__ +uses __thread variables. + + + +----------------------------------- +[http://svn.python.org/view?rev=63970&view=rev r63970] | andrew.kuchling | 2008-06-05 19:33:54 -0400 (Thu, 05 Jun 2008) | 1 line +Changed paths: + M /python/trunk/Doc/library/logging.rst + +Document 'utc' parameter + +----------------------------------- +[http://svn.python.org/view?rev=63982&view=rev r63982] | georg.brandl | 2008-06-06 06:43:43 -0400 (Fri, 06 Jun 2008) | 2 lines +Changed paths: + M /python/trunk/Doc/reference/simple_stmts.rst + +Fix brackets. + + +----------------------------------- +[http://svn.python.org/view?rev=64022&view=rev r64022] | georg.brandl | 2008-06-07 14:17:37 -0400 (Sat, 07 Jun 2008) | 3 lines +Changed paths: + M /python/trunk/Doc/library/parser.rst + +Document the "st" API, to avoid confusion with the "new" AST. +Add a note about using the new AST module. + + +----------------------------------- +[http://svn.python.org/view?rev=64028&view=rev r64028] | benjamin.peterson | 2008-06-07 16:44:48 -0400 (Sat, 07 Jun 2008) | 2 lines +Changed paths: + M /python/trunk/Doc/library/_ast.rst + +capitalization nit + + +----------------------------------- +[http://svn.python.org/view?rev=64036&view=rev r64036] | georg.brandl | 2008-06-08 04:54:40 -0400 (Sun, 08 Jun 2008) | 2 lines +Changed paths: + M /python/trunk/Doc/library/tokenize.rst + +#3028: tokenize passes the physical line. + + +----------------------------------- +[http://svn.python.org/view?rev=64037&view=rev r64037] | georg.brandl | 2008-06-08 04:59:38 -0400 (Sun, 08 Jun 2008) | 2 lines +Changed paths: + M /python/trunk/Doc/library/tokenize.rst + +Argh, I read it wrong. Reverted 64036 and added a clarifying remark. + + +----------------------------------- +[http://svn.python.org/view?rev=64089&view=rev r64089] | armin.ronacher | 2008-06-10 16:37:02 -0400 (Tue, 10 Jun 2008) | 3 lines +Changed paths: + M /python/trunk/Doc/library/ast.rst + +Fix a formatting error in the ast documentation. + + + +----------------------------------- +[http://svn.python.org/view?rev=64090&view=rev r64090] | armin.ronacher | 2008-06-10 16:52:19 -0400 (Tue, 10 Jun 2008) | 3 lines +Changed paths: + M /python/trunk/Doc/library/ast.rst + +Documented the new AST constructor. + + + +----------------------------------- +[http://svn.python.org/view?rev=64100&view=rev r64100] | raymond.hettinger | 2008-06-10 20:28:51 -0400 (Tue, 10 Jun 2008) | 1 line +Changed paths: + M /python/trunk/Doc/library/numbers.rst + +Update numbers doc for the Integral simplification. + +----------------------------------- +[http://svn.python.org/view?rev=64129&view=rev r64129] | georg.brandl | 2008-06-11 13:53:38 -0400 (Wed, 11 Jun 2008) | 2 lines +Changed paths: + M /python/trunk/Doc/library/threading.rst + +Fix typos. + + +----------------------------------- +[http://svn.python.org/view?rev=64130&view=rev r64130] | georg.brandl | 2008-06-11 13:57:44 -0400 (Wed, 11 Jun 2008) | 2 lines +Changed paths: + M /python/trunk/Doc/using/cmdline.rst + +Clarify what ":errorhandler" refers to. + + +----------------------------------- +[http://svn.python.org/view?rev=64135&view=rev r64135] | thomas.heller | 2008-06-11 14:10:43 -0400 (Wed, 11 Jun 2008) | 1 line +Changed paths: + M /python/trunk/Doc/library/ctypes.rst + +More doc fixes. + +----------------------------------- +[http://svn.python.org/view?rev=64139&view=rev r64139] | thomas.heller | 2008-06-11 14:40:51 -0400 (Wed, 11 Jun 2008) | 1 line +Changed paths: + M /python/trunk/Doc/library/ctypes.rst + +Smaller doc fixes. + +----------------------------------- +[http://svn.python.org/view?rev=64143&view=rev r64143] | thomas.heller | 2008-06-11 15:10:22 -0400 (Wed, 11 Jun 2008) | 1 line +Changed paths: + M /python/trunk/Doc/library/ctypes.rst + +Add versionadded marker to ctypes.c_longdouble. + +----------------------------------- +[http://svn.python.org/view?rev=64229&view=rev r64229] | georg.brandl | 2008-06-13 09:26:54 -0400 (Fri, 13 Jun 2008) | 2 lines +Changed paths: + M /python/trunk/Doc/library/optparse.rst + +Clarification. + + +----------------------------------- +[http://svn.python.org/view?rev=64253&view=rev r64253] | andrew.kuchling | 2008-06-13 15:38:18 -0400 (Fri, 13 Jun 2008) | 1 line +Changed paths: + M /python/trunk/Doc/library/hotshot.rst + +Typo fixes + +----------------------------------- +[http://svn.python.org/view?rev=64328&view=rev r64328] | georg.brandl | 2008-06-17 05:01:35 -0400 (Tue, 17 Jun 2008) | 2 lines +Changed paths: + M /python/trunk/Doc/conf.py + +Split the HTML index. + + +----------------------------------- +[http://svn.python.org/view?rev=64370&view=rev r64370] | mark.dickinson | 2008-06-18 05:20:17 -0400 (Wed, 18 Jun 2008) | 2 lines +Changed paths: + M /python/trunk/Doc/library/math.rst + +Typo fix + + +----------------------------------- +[http://svn.python.org/view?rev=64371&view=rev r64371] | georg.brandl | 2008-06-18 05:28:22 -0400 (Wed, 18 Jun 2008) | 2 lines +Changed paths: + M /python/trunk/Doc/library/math.rst + +Add versionadded tags to new math functions. + + +----------------------------------- +[http://svn.python.org/view?rev=64392&view=rev r64392] | benjamin.peterson | 2008-06-18 18:59:32 -0400 (Wed, 18 Jun 2008) | 2 lines +Changed paths: + D /python/trunk/Lib/test/test_socket_ssl.py + +Fix test_socket_ssl the easy way and remove it per #1489 + + +----------------------------------- +[http://svn.python.org/view?rev=64409&view=rev r64409] | andrew.kuchling | 2008-06-19 16:33:31 -0400 (Thu, 19 Jun 2008) | 1 line +Changed paths: + M /python/trunk/Doc/library/someos.rst + +Put threading in front of thread + +----------------------------------- +[http://svn.python.org/view?rev=64431&view=rev r64431] | benjamin.peterson | 2008-06-20 16:33:33 -0400 (Fri, 20 Jun 2008) | 1 line +Changed paths: + M /python/trunk/Doc/library/os.path.rst + +rephrase + +----------------------------------- +[http://svn.python.org/view?rev=64434&view=rev r64434] | andrew.kuchling | 2008-06-20 19:13:58 -0400 (Fri, 20 Jun 2008) | 1 line +Changed paths: + M /python/trunk/Doc/library/cgi.rst + +Remove request for e-mail; it's unlikely these classes will be saved + +----------------------------------- +[http://svn.python.org/view?rev=64435&view=rev r64435] | andrew.kuchling | 2008-06-20 19:14:32 -0400 (Fri, 20 Jun 2008) | 1 line +Changed paths: + M /python/trunk/Doc/library/commands.rst + M /python/trunk/Doc/library/stdtypes.rst + +Grammar fixes + +----------------------------------- +[http://svn.python.org/view?rev=64437&view=rev r64437] | andrew.kuchling | 2008-06-20 20:17:22 -0400 (Fri, 20 Jun 2008) | 1 line +Changed paths: + M /python/trunk/Doc/library/py_compile.rst + M /python/trunk/Doc/library/zlib.rst + +Correct two versionchanged directives, to improve the 'changes' output + +----------------------------------- +[http://svn.python.org/view?rev=64443&view=rev r64443] | georg.brandl | 2008-06-21 10:26:19 -0400 (Sat, 21 Jun 2008) | 2 lines +Changed paths: + M /python/trunk/Doc/library/ast.rst + +Documentation fix. + + +----------------------------------- +[http://svn.python.org/view?rev=64445&view=rev r64445] | facundo.batista | 2008-06-21 13:30:06 -0400 (Sat, 21 Jun 2008) | 3 lines +Changed paths: + M /python/trunk/Doc/library/decimal.rst + + +Reviewed and updated the documentation. Fixes #3017. + + +----------------------------------- +[http://svn.python.org/view?rev=64448&view=rev r64448] | facundo.batista | 2008-06-21 15:48:19 -0400 (Sat, 21 Jun 2008) | 5 lines +Changed paths: + M /python/trunk/Doc/library/os.rst + M /python/trunk/Doc/library/popen2.rst + + +In the deprecated functions I added an alert to review +specially a section of the subprocess documentation +that helps with the replacing of those functionss. + + +----------------------------------- +[http://svn.python.org/view?rev=64450&view=rev r64450] | georg.brandl | 2008-06-22 05:05:29 -0400 (Sun, 22 Jun 2008) | 2 lines +Changed paths: + M /python/trunk/Doc/library/os.rst + M /python/trunk/Doc/library/popen2.rst + M /python/trunk/Doc/library/subprocess.rst + +Turn section references into proper cross-references. + + +----------------------------------- +[http://svn.python.org/view?rev=64461&view=rev r64461] | georg.brandl | 2008-06-22 14:11:52 -0400 (Sun, 22 Jun 2008) | 2 lines +Changed paths: + M /python/trunk/Doc/library/subprocess.rst + +#3085: Fix syntax error. + + +----------------------------------- +[http://svn.python.org/view?rev=64466&view=rev r64466] | georg.brandl | 2008-06-22 15:07:59 -0400 (Sun, 22 Jun 2008) | 2 lines +Changed paths: + M /python/trunk/Doc/library/cmath.rst + +Write out "phi" consistently. + + +----------------------------------- +[http://svn.python.org/view?rev=64535&view=rev r64535] | georg.brandl | 2008-06-26 14:55:37 -0400 (Thu, 26 Jun 2008) | 2 lines +Changed paths: + M /python/trunk/Doc/library/socketserver.rst + +Add a version tag for shutdown(). + + +----------------------------------- +[http://svn.python.org/view?rev=64544&view=rev r64544] | georg.brandl | 2008-06-26 17:12:55 -0400 (Thu, 26 Jun 2008) | 2 lines +Changed paths: + M /python/trunk/Doc/Makefile + +Use newer versions of externals. + + +----------------------------------- +[http://svn.python.org/view?rev=64545&view=rev r64545] | benjamin.peterson | 2008-06-26 17:23:30 -0400 (Thu, 26 Jun 2008) | 1 line +Changed paths: + M /python/trunk/Doc/Makefile + +add a htmlview directive + +----------------------------------- +[http://svn.python.org/view?rev=64554&view=rev r64554] | trent.nelson | 2008-06-26 22:24:49 -0400 (Thu, 26 Jun 2008) | 3 lines +Changed paths: + M /python/trunk + +Initialized merge tracking via "svnmerge" with revisions "1-64347" from +svn+ssh://pythondev at svn.python.org/python/branches/tnelson-trunk-bsddb-47-upgrade + + +----------------------------------- +[http://svn.python.org/view?rev=64561&view=rev r64561] | mark.dickinson | 2008-06-27 12:49:27 -0400 (Fri, 27 Jun 2008) | 2 lines +Changed paths: + M /python/trunk/Doc/library/fractions.rst + +Issue #3197: rework documentation for fractions module. + + +----------------------------------- +[http://svn.python.org/view?rev=64565&view=rev r64565] | raymond.hettinger | 2008-06-27 17:34:24 -0400 (Fri, 27 Jun 2008) | 1 line +Changed paths: + M /python/trunk/Doc/library/collections.rst + +Fix whitespace in example code. + +----------------------------------- +[http://svn.python.org/view?rev=64583&view=rev r64583] | benjamin.peterson | 2008-06-28 19:06:49 -0400 (Sat, 28 Jun 2008) | 1 line +Changed paths: + M /python/trunk/Doc/reference/compound_stmts.rst + +rewrap + +----------------------------------- +[http://svn.python.org/view?rev=64590&view=rev r64590] | benjamin.peterson | 2008-06-29 09:43:07 -0400 (Sun, 29 Jun 2008) | 1 line +Changed paths: + M /python/trunk/Doc/reference/compound_stmts.rst + +reinstate the ending backtick. thanks Nick :) + +----------------------------------- +[http://svn.python.org/view?rev=64625&view=rev r64625] | georg.brandl | 2008-07-01 15:59:00 -0400 (Tue, 01 Jul 2008) | 2 lines +Changed paths: + M /python/trunk/Doc/library/subprocess.rst + +Add a link to PEP 324. + + +----------------------------------- +[http://svn.python.org/view?rev=64630&view=rev r64630] | georg.brandl | 2008-07-01 16:18:10 -0400 (Tue, 01 Jul 2008) | 2 lines +Changed paths: + M /python/trunk/Doc/library/msilib.rst + +#3216: fix Execute's parameter description. + + +----------------------------------- +[http://svn.python.org/view?rev=64635&view=rev r64635] | georg.brandl | 2008-07-01 16:45:09 -0400 (Tue, 01 Jul 2008) | 2 lines +Changed paths: + M /python/trunk/Doc/library/stdtypes.rst + +#1523853: add note about fread(). + + +----------------------------------- +[http://svn.python.org/view?rev=64638&view=rev r64638] | georg.brandl | 2008-07-01 16:50:02 -0400 (Tue, 01 Jul 2008) | 2 lines +Changed paths: + M /python/trunk/Doc/reference/expressions.rst + +#1410739: add a footnote about "is" and "unusual" behavior. + + +----------------------------------- +[http://svn.python.org/view?rev=64687&view=rev r64687] | andrew.kuchling | 2008-07-03 08:50:03 -0400 (Thu, 03 Jul 2008) | 1 line +Changed paths: + M /python/trunk/Doc/library/stdtypes.rst + +Tweak wording + +----------------------------------- +[http://svn.python.org/view?rev=64689&view=rev r64689] | benjamin.peterson | 2008-07-03 08:57:35 -0400 (Thu, 03 Jul 2008) | 1 line +Changed paths: + M /python/trunk/Doc/glossary.rst + +lowercase glossary term + +----------------------------------- +[http://svn.python.org/view?rev=64702&view=rev r64702] | georg.brandl | 2008-07-04 13:22:53 -0400 (Fri, 04 Jul 2008) | 2 lines +Changed paths: + M /python/trunk/Doc/library/pickle.rst + +Give the pickle special methods a signature. + + +----------------------------------- +[http://svn.python.org/view?rev=64760&view=rev r64760] | andrew.kuchling | 2008-07-06 13:43:16 -0400 (Sun, 06 Jul 2008) | 1 line +Changed paths: + M /python/trunk/Doc/library/shutil.rst + +Wording fix + +----------------------------------- +[http://svn.python.org/view?rev=64788&view=rev r64788] | georg.brandl | 2008-07-08 03:05:23 -0400 (Tue, 08 Jul 2008) | 2 lines +Changed paths: + M /python/trunk/Doc/library/collections.rst + +Add missing ABCs to list. + + +----------------------------------- +[http://svn.python.org/view?rev=64871&view=rev r64871] | raymond.hettinger | 2008-07-11 08:00:21 -0400 (Fri, 11 Jul 2008) | 1 line +Changed paths: + M /python/trunk/Doc/c-api/sequence.rst + +Add cautionary note on the use of PySequence_Fast_ITEMS. + +----------------------------------- +[http://svn.python.org/view?rev=64900&view=rev r64900] | alexandre.vassalotti | 2008-07-12 18:06:53 -0400 (Sat, 12 Jul 2008) | 2 lines +Changed paths: + M /python/trunk/Doc/library/thread.rst + +Fixed typo. + + +----------------------------------- +[http://svn.python.org/view?rev=64926&view=rev r64926] | martin.v.loewis | 2008-07-13 16:31:49 -0400 (Sun, 13 Jul 2008) | 2 lines +Changed paths: + M /python/trunk/Doc/library/turtle.rst + +Add turtle into the module index. + + +----------------------------------- +[http://svn.python.org/view?rev=64928&view=rev r64928] | andrew.kuchling | 2008-07-13 17:43:25 -0400 (Sun, 13 Jul 2008) | 1 line +Changed paths: + M /python/trunk/Doc/library/ctypes.rst + +Re-word + +----------------------------------- +[http://svn.python.org/view?rev=64982&view=rev r64982] | georg.brandl | 2008-07-15 19:59:15 -0400 (Tue, 15 Jul 2008) | 2 lines +Changed paths: + M /python/trunk/Doc/library/stdtypes.rst + +Move label to correct heading. + + +----------------------------------- +[http://svn.python.org/view?rev=65048&view=rev r65048] | georg.brandl | 2008-07-16 19:35:54 -0400 (Wed, 16 Jul 2008) | 2 lines +Changed paths: + M /python/trunk/Doc/tutorial/inputoutput.rst + +#3388: add a paragraph about using "with" for file objects. + + +----------------------------------- +[http://svn.python.org/view?rev=65094&view=rev r65094] | vinay.sajip | 2008-07-18 05:00:35 -0400 (Fri, 18 Jul 2008) | 1 line +Changed paths: + M /python/trunk/Doc/library/logging.rst + +Issue #3389: Allow resolving dotted names for handlers in logging configuration files. Thanks to Philip Jenvey for the patch. + +----------------------------------- +[http://svn.python.org/view?rev=65099&view=rev r65099] | georg.brandl | 2008-07-18 07:15:06 -0400 (Fri, 18 Jul 2008) | 3 lines +Changed paths: + M /python/trunk/Doc/library/string.rst + +Document the different meaning of precision for {:f} and {:g}. +Also document how inf and nan are formatted. #3404. + + +----------------------------------- +[http://svn.python.org/view?rev=65102&view=rev r65102] | benjamin.peterson | 2008-07-18 10:14:41 -0400 (Fri, 18 Jul 2008) | 1 line +Changed paths: + A /python/trunk/Lib/test/test_fileio.py + +backport test_fileio + +----------------------------------- +[http://svn.python.org/view?rev=65136&view=rev r65136] | georg.brandl | 2008-07-19 09:09:42 -0400 (Sat, 19 Jul 2008) | 3 lines +Changed paths: + M /python/trunk/Doc/reference/datamodel.rst + +#3323: mention that if inheriting from a class without __slots__, +the subclass will have a __dict__ available too. + + +----------------------------------- +[http://svn.python.org/view?rev=65139&view=rev r65139] | georg.brandl | 2008-07-19 09:48:44 -0400 (Sat, 19 Jul 2008) | 2 lines +Changed paths: + M /python/trunk/Doc/library/re.rst + +Add ordering info for findall and finditer. + + +----------------------------------- +[http://svn.python.org/view?rev=65155&view=rev r65155] | georg.brandl | 2008-07-20 07:50:29 -0400 (Sun, 20 Jul 2008) | 2 lines +Changed paths: + M /python/trunk/Doc/glossary.rst + M /python/trunk/Doc/reference/compound_stmts.rst + +#926501: add info where to put the docstring. + + +----------------------------------- +[http://svn.python.org/view?rev=65172&view=rev r65172] | georg.brandl | 2008-07-21 14:26:21 -0400 (Mon, 21 Jul 2008) | 2 lines +Changed paths: + M /python/trunk/Doc/tutorial/classes.rst + +nonlocal is not in 2.6. + + +----------------------------------- +[http://svn.python.org/view?rev=65205&view=rev r65205] | georg.brandl | 2008-07-23 12:00:44 -0400 (Wed, 23 Jul 2008) | 2 lines +Changed paths: + M /python/trunk/Doc/library/itertools.rst + +Use correct indentation. + + +----------------------------------- +[http://svn.python.org/view?rev=65211&view=rev r65211] | benjamin.peterson | 2008-07-23 22:27:46 -0400 (Wed, 23 Jul 2008) | 1 line +Changed paths: + M /python/trunk/Doc/library/development.rst + +fix spacing + +----------------------------------- +[http://svn.python.org/view?rev=65226&view=rev r65226] | benjamin.peterson | 2008-07-25 13:02:11 -0400 (Fri, 25 Jul 2008) | 1 line +Changed paths: + M /python/trunk/Doc/library/itertools.rst + +document default value for fillvalue + +----------------------------------- +[http://svn.python.org/view?rev=65246&view=rev r65246] | andrew.kuchling | 2008-07-26 09:08:19 -0400 (Sat, 26 Jul 2008) | 1 line +Changed paths: + M /python/trunk/Doc/library/stdtypes.rst + +This sentence continues to bug me; rewrite it for the second time + +----------------------------------- +[http://svn.python.org/view?rev=65247&view=rev r65247] | andrew.kuchling | 2008-07-26 09:09:06 -0400 (Sat, 26 Jul 2008) | 1 line +Changed paths: + M /python/trunk/Doc/library/email.message.rst + +Remove extra words + +----------------------------------- +[http://svn.python.org/view?rev=65253&view=rev r65253] | georg.brandl | 2008-07-26 18:13:29 -0400 (Sat, 26 Jul 2008) | 2 lines +Changed paths: + M /python/trunk/Doc/tutorial/inputoutput.rst + +Shorten some overlong lines. + + +----------------------------------- +[http://svn.python.org/view?rev=65259&view=rev r65259] | benjamin.peterson | 2008-07-27 11:22:14 -0400 (Sun, 27 Jul 2008) | 1 line +Changed paths: + M /python/trunk/Doc/library/subprocess.rst + +clarify Popen argument + +----------------------------------- +[http://svn.python.org/view?rev=65263&view=rev r65263] | andrew.kuchling | 2008-07-28 13:04:48 -0400 (Mon, 28 Jul 2008) | 1 line +Changed paths: + M /python/trunk/Doc/library/popen2.rst + +Clarify wording + +----------------------------------- +[http://svn.python.org/view?rev=65293&view=rev r65293] | benjamin.peterson | 2008-07-29 15:28:49 -0400 (Tue, 29 Jul 2008) | 1 line +Changed paths: + M /python/trunk/Doc/library/stdtypes.rst + +the from __future__ import with_statement isn't needed in 2.6 + +----------------------------------- +[http://svn.python.org/view?rev=65315&view=rev r65315] | mark.dickinson | 2008-07-30 16:23:15 -0400 (Wed, 30 Jul 2008) | 2 lines +Changed paths: + M /python/trunk/Doc/library/math.rst + +Add note about problems with math.fsum on x86 hardware. + + +----------------------------------- +[http://svn.python.org/view?rev=65366&view=rev r65366] | mark.dickinson | 2008-08-01 05:13:07 -0400 (Fri, 01 Aug 2008) | 2 lines +Changed paths: + M /python/trunk/Doc/library/math.rst + +Tone down math.fsum warning. + + +----------------------------------- +[http://svn.python.org/view?rev=65378&view=rev r65378] | georg.brandl | 2008-08-01 16:04:43 -0400 (Fri, 01 Aug 2008) | 4 lines +Changed paths: + A /python/trunk/Doc/reference/grammar.rst + M /python/trunk/Doc/reference/index.rst + +Add the grammar to the reference manual, since the new docs don't +have the feature of putting all the small EBNF snippets together +into one big file. + + +----------------------------------- +[http://svn.python.org/view?rev=65379&view=rev r65379] | georg.brandl | 2008-08-01 16:13:29 -0400 (Fri, 01 Aug 2008) | 2 lines +Changed paths: + M /python/trunk/Doc/reference/simple_stmts.rst + +This should really be a comment. + + +----------------------------------- +[http://svn.python.org/view?rev=65382&view=rev r65382] | benjamin.peterson | 2008-08-01 22:57:17 -0400 (Fri, 01 Aug 2008) | 1 line +Changed paths: + M /python/trunk/Doc/tutorial/controlflow.rst + +fix indentation that caused logic bug + +----------------------------------- +[http://svn.python.org/view?rev=65383&view=rev r65383] | benjamin.peterson | 2008-08-01 23:05:11 -0400 (Fri, 01 Aug 2008) | 1 line +Changed paths: + M /python/trunk/Doc/tutorial/controlflow.rst + +revert last revision; code was right + +----------------------------------- +[http://svn.python.org/view?rev=65430&view=rev r65430] | georg.brandl | 2008-08-03 05:21:18 -0400 (Sun, 03 Aug 2008) | 2 lines +Changed paths: + M /python/trunk/Doc/library/site.rst + +#3495: use current version. + + +----------------------------------- +[http://svn.python.org/view?rev=65469&view=rev r65469] | gregory.p.smith | 2008-08-03 21:03:50 -0400 (Sun, 03 Aug 2008) | 3 lines +Changed paths: + M /python/trunk/Doc/library/subprocess.rst + +issue1606: Add warnings to the subprocess documentation about common pitfalls +of using pipes that cause deadlocks. + + +----------------------------------- +[http://svn.python.org/view?rev=65477&view=rev r65477] | georg.brandl | 2008-08-04 03:23:29 -0400 (Mon, 04 Aug 2008) | 2 lines +Changed paths: + M /python/trunk/Doc/library/tempfile.rst + +Template is always "tmp". + + +----------------------------------- +[http://svn.python.org/view?rev=65480&view=rev r65480] | georg.brandl | 2008-08-04 03:31:50 -0400 (Mon, 04 Aug 2008) | 3 lines +Changed paths: + M /python/trunk/Doc/library/select.rst + +Clarify the meaning of the select() parameters and sync +names with docstring. + + +----------------------------------- +[http://svn.python.org/view?rev=65487&view=rev r65487] | nick.coghlan | 2008-08-04 08:40:59 -0400 (Mon, 04 Aug 2008) | 1 line +Changed paths: + M /python/trunk/Doc/reference/datamodel.rst + +Issue 643841: better documentation of the special method lookup process, especially for new-style classes. Also removes the warnings about not being authoritative for new-style classes - the language reference actually covers those fairly well now (albeit in a fashion that isn't always particularly easy to follow). + +----------------------------------- +[http://svn.python.org/view?rev=65502&view=rev r65502] | gregory.p.smith | 2008-08-04 14:34:07 -0400 (Mon, 04 Aug 2008) | 2 lines +Changed paths: + M /python/trunk/Doc/library/subprocess.rst + +more cleanup ups of the recently added warnings in the subprocess docs. + + +----------------------------------- +[http://svn.python.org/view?rev=65558&view=rev r65558] | georg.brandl | 2008-08-06 13:20:41 -0400 (Wed, 06 Aug 2008) | 2 lines +Changed paths: + M /python/trunk/Doc/reference/lexical_analysis.rst + +Fix longstringitem definition. #3505. + + +----------------------------------- +[http://svn.python.org/view?rev=65591&view=rev r65591] | georg.brandl | 2008-08-08 02:42:20 -0400 (Fri, 08 Aug 2008) | 2 lines +Changed paths: + M /python/trunk/Doc/reference/expressions.rst + +#3519: callee is an expression too. + + +----------------------------------- +[http://svn.python.org/view?rev=65601&view=rev r65601] | georg.brandl | 2008-08-08 11:34:34 -0400 (Fri, 08 Aug 2008) | 2 lines +Changed paths: + M /python/trunk/Doc/tutorial/inputoutput.rst + +Remove mention of backquotes in the tutorial. + + +----------------------------------- +[http://svn.python.org/view?rev=65639&view=rev r65639] | georg.brandl | 2008-08-11 06:27:31 -0400 (Mon, 11 Aug 2008) | 2 lines +Changed paths: + M /python/trunk/Doc/library/mailbox.rst + +#3540: fix exception name. + + +----------------------------------- +[http://svn.python.org/view?rev=65658&view=rev r65658] | bill.janssen | 2008-08-12 13:09:57 -0400 (Tue, 12 Aug 2008) | 1 line +Changed paths: + M /python/trunk/Doc/library/ssl.rst + +update ssl documentation + +----------------------------------- +[http://svn.python.org/view?rev=65693&view=rev r65693] | georg.brandl | 2008-08-15 14:35:09 -0400 (Fri, 15 Aug 2008) | 2 lines +Changed paths: + M /python/trunk/Doc/reference/expressions.rst + +#3558: Attribute reference binds more tightly than subscription and call. + + +----------------------------------- +[http://svn.python.org/view?rev=65702&view=rev r65702] | gregory.p.smith | 2008-08-15 19:14:00 -0400 (Fri, 15 Aug 2008) | 2 lines +Changed paths: + M /python/trunk/Doc/library/os.rst + +document that waitpid raises OSError + + +----------------------------------- +[http://svn.python.org/view?rev=65707&view=rev r65707] | benjamin.peterson | 2008-08-15 23:13:07 -0400 (Fri, 15 Aug 2008) | 1 line +Changed paths: + M /python/trunk/Doc/library/os.rst + +note how os.utime should be used for emulating touch + +----------------------------------- +[http://svn.python.org/view?rev=65715&view=rev r65715] | benjamin.peterson | 2008-08-16 17:04:16 -0400 (Sat, 16 Aug 2008) | 1 line +Changed paths: + M /python/trunk/Doc/library/language.rst + A /python/trunk/Doc/library/symtable.rst + +add some documentation for symtable + +----------------------------------- +[http://svn.python.org/view?rev=65726&view=rev r65726] | georg.brandl | 2008-08-16 18:37:05 -0400 (Sat, 16 Aug 2008) | 2 lines +Changed paths: + M /python/trunk/Doc/library/symtable.rst + +Review symtable docs. + + +----------------------------------- +[http://svn.python.org/view?rev=65737&view=rev r65737] | benjamin.peterson | 2008-08-16 21:17:15 -0400 (Sat, 16 Aug 2008) | 1 line +Changed paths: + M /python/trunk/Doc/library/symtable.rst + +a few improvements + +----------------------------------- +[http://svn.python.org/view?rev=65812&view=rev r65812] | nick.coghlan | 2008-08-18 09:32:19 -0400 (Mon, 18 Aug 2008) | 1 line +Changed paths: + M /python/trunk/Doc/c-api/object.rst + +Fix typo + +----------------------------------- +[http://svn.python.org/view?rev=65995&view=rev r65995] | georg.brandl | 2008-08-23 11:15:31 -0400 (Sat, 23 Aug 2008) | 2 lines +Changed paths: + M /python/trunk/Doc/library/types.rst + +Small updates to types member docs, backport from [http://svn.python.org/view?rev=65994&view=rev r65994]. + + +----------------------------------- +[http://svn.python.org/view?rev=66004&view=rev r66004] | benjamin.peterson | 2008-08-23 17:40:15 -0400 (Sat, 23 Aug 2008) | 1 line +Changed paths: + M /python/trunk/Doc/library/types.rst + +fix warning + +----------------------------------- +[http://svn.python.org/view?rev=66017&view=rev r66017] | benjamin.peterson | 2008-08-24 17:55:03 -0400 (Sun, 24 Aug 2008) | 1 line +Changed paths: + M /python/trunk/Doc/bugs.rst + +remove note about unimplemented feature + +----------------------------------- +[http://svn.python.org/view?rev=66053&view=rev r66053] | georg.brandl | 2008-08-28 05:40:18 -0400 (Thu, 28 Aug 2008) | 2 lines +Changed paths: + M /python/trunk/Doc/extending/windows.rst + +#3711: .dll isn't a valid Python extension anymore. + + +----------------------------------- +[http://svn.python.org/view?rev=66060&view=rev r66060] | armin.rigo | 2008-08-29 17:21:52 -0400 (Fri, 29 Aug 2008) | 3 lines +Changed paths: + A /python/trunk/Lib/test/crashers/iter.py + +A collection of crashers, all variants of the idea +of issue #3720. + + +----------------------------------- +[http://svn.python.org/view?rev=66062&view=rev r66062] | georg.brandl | 2008-08-30 05:49:36 -0400 (Sat, 30 Aug 2008) | 2 lines +Changed paths: + M /python/trunk/Doc/library/basehttpserver.rst + +#3730: mention "server" attribute explicitly. + + +----------------------------------- +[http://svn.python.org/view?rev=66063&view=rev r66063] | georg.brandl | 2008-08-30 05:52:44 -0400 (Sat, 30 Aug 2008) | 2 lines +Changed paths: + M /python/trunk/Doc/reference/datamodel.rst + +#3716: fix typo. + + +----------------------------------- +[http://svn.python.org/view?rev=66065&view=rev r66065] | georg.brandl | 2008-08-30 06:03:09 -0400 (Sat, 30 Aug 2008) | 2 lines +Changed paths: + M /python/trunk/Doc/library/functions.rst + +#3569: eval() also accepts "exec"able code objects. + + +----------------------------------- +[http://svn.python.org/view?rev=66067&view=rev r66067] | georg.brandl | 2008-08-30 09:17:39 -0400 (Sat, 30 Aug 2008) | 2 lines +Changed paths: + M /python/trunk/Doc/library/functions.rst + +super() actually returns a super object. + + +----------------------------------- +[http://svn.python.org/view?rev=66072&view=rev r66072] | andrew.kuchling | 2008-08-30 11:21:23 -0400 (Sat, 30 Aug 2008) | 1 line +Changed paths: + M /python/trunk/Doc/library/ctypes.rst + +Tidy up some sentences + +----------------------------------- +[http://svn.python.org/view?rev=66085&view=rev r66085] | nick.coghlan | 2008-08-31 09:10:50 -0400 (Sun, 31 Aug 2008) | 1 line +Changed paths: + M /python/trunk/Doc/reference/datamodel.rst + +Issue 2235: document the ability to block inheritance of __hash__ in the language reference + +----------------------------------- +[http://svn.python.org/view?rev=66098&view=rev r66098] | georg.brandl | 2008-09-01 10:15:55 -0400 (Mon, 01 Sep 2008) | 2 lines +Changed paths: + M /python/trunk/Doc/library/codecs.rst + +#3749: fix c'n'p errors. + + +----------------------------------- +[http://svn.python.org/view?rev=66110&view=rev r66110] | vinay.sajip | 2008-09-01 11:08:07 -0400 (Mon, 01 Sep 2008) | 1 line +Changed paths: + M /python/trunk/Doc/library/logging.rst + +Added section about configuring logging in a library. Thanks to Thomas Heller for the idea. + +----------------------------------- +[http://svn.python.org/view?rev=66118&view=rev r66118] | vinay.sajip | 2008-09-01 13:44:14 -0400 (Mon, 01 Sep 2008) | 1 line +Changed paths: + M /python/trunk/Doc/library/logging.rst + +Bug #3738: Documentation is now more accurate in describing handler close methods. + +----------------------------------- +[http://svn.python.org/view?rev=66136&view=rev r66136] | andrew.kuchling | 2008-09-01 21:39:18 -0400 (Mon, 01 Sep 2008) | 1 line +Changed paths: + M /python/trunk/Doc/library/warnings.rst + +typo fix + +----------------------------------- +[http://svn.python.org/view?rev=66229&view=rev r66229] | brett.cannon | 2008-09-04 23:52:59 -0400 (Thu, 04 Sep 2008) | 1 line +Changed paths: + M /python/trunk/Doc/library/warnings.rst + +Make it more obvious that warnings.catch_warnings() and its arguments should be considered keyword-only. + +----------------------------------- +[http://svn.python.org/view?rev=66250&view=rev r66250] | andrew.kuchling | 2008-09-06 09:04:02 -0400 (Sat, 06 Sep 2008) | 1 line +Changed paths: + M /python/trunk/Doc/library/optparse.rst + +#3040: include 'dest' argument in example; trim some trailing whitespace + +----------------------------------- +[http://svn.python.org/view?rev=66268&view=rev r66268] | andrew.kuchling | 2008-09-06 16:28:01 -0400 (Sat, 06 Sep 2008) | 1 line +Changed paths: + M /python/trunk/Doc/library/sqlite3.rst + +#3669 from Robert Lehmann: simplify use of iterator in example + +----------------------------------- +[http://svn.python.org/view?rev=66272&view=rev r66272] | andrew.kuchling | 2008-09-06 17:26:02 -0400 (Sat, 06 Sep 2008) | 1 line +Changed paths: + M /python/trunk/Doc/library/smtplib.rst + +#1317: describe the does_esmtp, ehlo_resp, esmtp_features, and helo_resp attributes + +----------------------------------- +[http://svn.python.org/view?rev=66294&view=rev r66294] | georg.brandl | 2008-09-07 13:00:17 -0400 (Sun, 07 Sep 2008) | 2 lines +Changed paths: + M /python/trunk/Doc/howto/index.rst + A /python/trunk/Doc/howto/webservers.rst + +Add a new howto about Python and the web, by Marek Kubica. + + +----------------------------------- +[http://svn.python.org/view?rev=66306&view=rev r66306] | mark.summerfield | 2008-09-08 10:45:37 -0400 (Mon, 08 Sep 2008) | 3 lines +Changed paths: + M /python/trunk/Doc/library/getopt.rst + M /python/trunk/Doc/library/optparse.rst + +Added xrefs to each other. + + + +----------------------------------- +[http://svn.python.org/view?rev=66350&view=rev r66350] | georg.brandl | 2008-09-09 16:28:31 -0400 (Tue, 09 Sep 2008) | 2 lines +Changed paths: + M /python/trunk/Doc/using/mac.rst + +#3472: update Mac-bundled Python version info. + + +----------------------------------- +[http://svn.python.org/view?rev=66358&view=rev r66358] | benjamin.peterson | 2008-09-09 19:16:48 -0400 (Tue, 09 Sep 2008) | 1 line +Changed paths: + M /python/trunk/Doc/Makefile + +use the latest pygments version + +----------------------------------- +[http://svn.python.org/view?rev=66394&view=rev r66394] | benjamin.peterson | 2008-09-11 18:04:02 -0400 (Thu, 11 Sep 2008) | 1 line +Changed paths: + M /python/trunk/Doc/library/string.rst + +fix typo + +----------------------------------- +[http://svn.python.org/view?rev=66433&view=rev r66433] | andrew.kuchling | 2008-09-12 22:08:30 -0400 (Fri, 12 Sep 2008) | 1 line +Changed paths: + M /python/trunk/Doc/reference/index.rst + +Use title case + +----------------------------------- +[http://svn.python.org/view?rev=66434&view=rev r66434] | andrew.kuchling | 2008-09-12 22:09:15 -0400 (Fri, 12 Sep 2008) | 1 line +Changed paths: + M /python/trunk/Doc/library/index.rst + +Remove extra 'the'; the following title includes it + +----------------------------------- +[http://svn.python.org/view?rev=66435&view=rev r66435] | andrew.kuchling | 2008-09-12 22:11:51 -0400 (Fri, 12 Sep 2008) | 1 line +Changed paths: + M /python/trunk/Doc/library/stdtypes.rst + +#3288: Document as_integer_ratio + +----------------------------------- +[http://svn.python.org/view?rev=66436&view=rev r66436] | andrew.kuchling | 2008-09-12 22:14:15 -0400 (Fri, 12 Sep 2008) | 1 line +Changed paths: + M /python/trunk/Doc/tutorial/index.rst + +Use title case + +----------------------------------- +[http://svn.python.org/view?rev=66447&view=rev r66447] | georg.brandl | 2008-09-13 13:18:11 -0400 (Sat, 13 Sep 2008) | 2 lines +Changed paths: + M /python/trunk/Doc/tutorial/classes.rst + M /python/trunk/Doc/tutorial/controlflow.rst + M /python/trunk/Doc/tutorial/datastructures.rst + M /python/trunk/Doc/tutorial/introduction.rst + +Incorporate some suggestions by Tait Stevens. + + +----------------------------------- +[http://svn.python.org/view?rev=66450&view=rev r66450] | benjamin.peterson | 2008-09-13 13:31:08 -0400 (Sat, 13 Sep 2008) | 1 line +Changed paths: + M /python/trunk/Doc/tutorial/datastructures.rst + +remove duplicate target + +----------------------------------- +[http://svn.python.org/view?rev=66459&view=rev r66459] | benjamin.peterson | 2008-09-14 12:02:22 -0400 (Sun, 14 Sep 2008) | 1 line +Changed paths: + M /python/trunk/Doc/library/functions.rst + +clarify that radix for int is not 'guessed' + +----------------------------------- +[http://svn.python.org/view?rev=66465&view=rev r66465] | skip.montanaro | 2008-09-14 22:03:05 -0400 (Sun, 14 Sep 2008) | 3 lines +Changed paths: + M /python/trunk/Doc/glossary.rst + +Review usage. Fix a mistake in the new-style class definition. Add a +couple new definitions (CPython and virtual machine). + + +----------------------------------- +[http://svn.python.org/view?rev=66466&view=rev r66466] | skip.montanaro | 2008-09-14 22:19:53 -0400 (Sun, 14 Sep 2008) | 2 lines +Changed paths: + M /python/trunk/Doc/glossary.rst + +Pick up a few more definitions from the glossary on the wiki. + + +----------------------------------- +[http://svn.python.org/view?rev=66483&view=rev r66483] | georg.brandl | 2008-09-16 06:17:45 -0400 (Tue, 16 Sep 2008) | 2 lines +Changed paths: + M /python/trunk/Doc/tutorial/errors.rst + +Fix typo. + + +----------------------------------- +[http://svn.python.org/view?rev=66487&view=rev r66487] | skip.montanaro | 2008-09-17 07:50:36 -0400 (Wed, 17 Sep 2008) | 2 lines +Changed paths: + M /python/trunk/Doc/library/collections.rst + +usage + + +----------------------------------- +[http://svn.python.org/view?rev=66491&view=rev r66491] | benjamin.peterson | 2008-09-17 17:54:56 -0400 (Wed, 17 Sep 2008) | 1 line +Changed paths: + M /python/trunk/Doc/library/compileall.rst + +document compileall command flags + +----------------------------------- +[http://svn.python.org/view?rev=66510&view=rev r66510] | josiah.carlson | 2008-09-18 22:07:22 -0400 (Thu, 18 Sep 2008) | 2 lines +Changed paths: + M /python/trunk/Doc/library/asynchat.rst + +Fix for documentation bug. Fixes issue 3904. + + +----------------------------------- +[http://svn.python.org/view?rev=66512&view=rev r66512] | raymond.hettinger | 2008-09-19 04:07:48 -0400 (Fri, 19 Sep 2008) | 1 line +Changed paths: + M /python/trunk/Doc/library/functions.rst + +Improve docs for super(). + +----------------------------------- +[http://svn.python.org/view?rev=66524&view=rev r66524] | georg.brandl | 2008-09-21 03:15:59 -0400 (Sun, 21 Sep 2008) | 2 lines +Changed paths: + M /python/trunk/Doc/library/unittest.rst + +#3912: document default for *places* arg. + + +----------------------------------- +[http://svn.python.org/view?rev=66526&view=rev r66526] | georg.brandl | 2008-09-21 03:18:28 -0400 (Sun, 21 Sep 2008) | 2 lines +Changed paths: + M /python/trunk/Doc/reference/simple_stmts.rst + +#3914: add //= to the augmented assign operators. + + +----------------------------------- +[http://svn.python.org/view?rev=66532&view=rev r66532] | georg.brandl | 2008-09-21 03:36:22 -0400 (Sun, 21 Sep 2008) | 2 lines +Changed paths: + M /python/trunk/Doc/Makefile + M /python/trunk/Doc/README.txt + +Update readme and Makefile (web builder doesn't exist). + + +----------------------------------- +[http://svn.python.org/view?rev=66535&view=rev r66535] | georg.brandl | 2008-09-21 04:03:21 -0400 (Sun, 21 Sep 2008) | 2 lines +Changed paths: + M /python/trunk/Doc/library/random.rst + +#3918: note that uniform() args can be swapped. + + +----------------------------------- +[http://svn.python.org/view?rev=66538&view=rev r66538] | georg.brandl | 2008-09-21 06:03:39 -0400 (Sun, 21 Sep 2008) | 2 lines +Changed paths: + M /python/trunk/Doc/Makefile + +Add "dist" target. + + +----------------------------------- +[http://svn.python.org/view?rev=66561&view=rev r66561] | benjamin.peterson | 2008-09-22 18:13:29 -0400 (Mon, 22 Sep 2008) | 1 line +Changed paths: + M /python/trunk/Doc/library/platform.rst + +clean up docs for platform's linux_distribution and dist functions + +----------------------------------- +[http://svn.python.org/view?rev=66564&view=rev r66564] | benjamin.peterson | 2008-09-23 09:32:46 -0400 (Tue, 23 Sep 2008) | 1 line +Changed paths: + M /python/trunk/Doc/reference/expressions.rst + +mention how to override boolean evaluation + +----------------------------------- +[http://svn.python.org/view?rev=66580&view=rev r66580] | georg.brandl | 2008-09-24 05:47:55 -0400 (Wed, 24 Sep 2008) | 2 lines +Changed paths: + M /python/trunk/Doc/library/json.rst + +Indentation normalization. + + +----------------------------------- +[http://svn.python.org/view?rev=66610&view=rev r66610] | andrew.kuchling | 2008-09-24 13:27:55 -0400 (Wed, 24 Sep 2008) | 1 line +Changed paths: + M /python/trunk/Doc/library/socket.rst + +Improve wording + +----------------------------------- +[http://svn.python.org/view?rev=66625&view=rev r66625] | benjamin.peterson | 2008-09-25 22:58:36 -0400 (Thu, 25 Sep 2008) | 1 line +Changed paths: + A /python/trunk/Doc/howto/cporting.rst + M /python/trunk/Doc/howto/index.rst + +add the beginnings of a C-API 2 -> 3 porting guide + +----------------------------------- +[http://svn.python.org/view?rev=66628&view=rev r66628] | benjamin.peterson | 2008-09-26 16:52:06 -0400 (Fri, 26 Sep 2008) | 1 line +Changed paths: + M /python/trunk/Doc/howto/cporting.rst + +add an 'other options' section + +----------------------------------- +[http://svn.python.org/view?rev=66629&view=rev r66629] | georg.brandl | 2008-09-26 17:15:21 -0400 (Fri, 26 Sep 2008) | 2 lines +Changed paths: + M /python/trunk/Doc/howto/cporting.rst + +typos. + + +----------------------------------- +[http://svn.python.org/view?rev=66660&view=rev r66660] | andrew.kuchling | 2008-09-27 18:54:08 -0400 (Sat, 27 Sep 2008) | 1 line +Changed paths: + M /python/trunk/Doc/library/site.rst + +#3510: future-proof text + +----------------------------------- +[http://svn.python.org/view?rev=66661&view=rev r66661] | benjamin.peterson | 2008-09-27 19:28:43 -0400 (Sat, 27 Sep 2008) | 1 line +Changed paths: + M /python/trunk/Doc/howto/cporting.rst + +clarify a few things + +----------------------------------- +[http://svn.python.org/view?rev=66662&view=rev r66662] | andrew.kuchling | 2008-09-27 20:15:27 -0400 (Sat, 27 Sep 2008) | 1 line +Changed paths: + M /python/trunk/Doc/library/os.rst + +#1579477: mention necessity to flush output before exec'ing + +----------------------------------- +[http://svn.python.org/view?rev=66663&view=rev r66663] | andrew.kuchling | 2008-09-27 21:08:47 -0400 (Sat, 27 Sep 2008) | 1 line +Changed paths: + M /python/trunk/Doc/library/optparse.rst + +#1415508: Document two functions + +----------------------------------- +[http://svn.python.org/view?rev=66664&view=rev r66664] | benjamin.peterson | 2008-09-27 21:51:36 -0400 (Sat, 27 Sep 2008) | 1 line +Changed paths: + M /python/trunk/Doc/library/autogil.rst + +better grammar + Added: sandbox/trunk/py2.5.3/test-only.txt ============================================================================== --- (empty file) +++ sandbox/trunk/py2.5.3/test-only.txt Wed Oct 8 14:21:18 2008 @@ -0,0 +1,1821 @@ +Commits that only affect the Lib/test/ directory -- lower-priority for +2.5.3 than commits that fix bugs in library or interpreter code. + +----------------------------------- +[http://svn.python.org/view?rev=61021&view=rev r61021] | georg.brandl | 2008-02-23 17:35:33 -0500 (Sat, 23 Feb 2008) | 3 lines +Changed paths: + M /python/trunk/Lib/test/test_bisect.py + M /python/trunk/Lib/test/test_heapq.py + +In test_heapq and test_bisect, test both the Python and the C implementation. +Originally written for GHOP by Josip Dzolonga, heavily patched by me. + + +----------------------------------- +[http://svn.python.org/view?rev=61060&view=rev r61060] | brett.cannon | 2008-02-25 00:33:33 -0500 (Mon, 25 Feb 2008) | 2 lines +Changed paths: + M /python/trunk/Lib/test/test_support.py + +Fix a minor typo in a docstring. + + +----------------------------------- +[http://svn.python.org/view?rev=61063&view=rev r61063] | andrew.kuchling | 2008-02-25 11:29:19 -0500 (Mon, 25 Feb 2008) | 1 line +Changed paths: + M /python/trunk/Lib/test/test_curses.py + +Move .setupterm() output so that we don't try to call endwin() if it fails + +----------------------------------- +[http://svn.python.org/view?rev=61077&view=rev r61077] | neal.norwitz | 2008-02-25 23:50:37 -0500 (Mon, 25 Feb 2008) | 3 lines +Changed paths: + M /python/trunk/Lib/test/test_ftplib.py + +Don't use a hard coded port. This test could hang/fail if the port is in use. +Speed this test up by avoiding a sleep and using the event. + + +----------------------------------- +[http://svn.python.org/view?rev=61081&view=rev r61081] | neal.norwitz | 2008-02-26 03:04:59 -0500 (Tue, 26 Feb 2008) | 7 lines +Changed paths: + M /python/trunk/Lib/test/test_smtplib.py + +Speed up this test by about 99%. Remove sleeps and replace with events. +(This may fail on some slow platforms, but we can fix those cases which +should be relatively isolated and easier to find now.) +Move two test cases that didn't require a server to be started +to a separate TestCase. These tests were taking 3 seconds which +is what the timeout was set to. + + +----------------------------------- +[http://svn.python.org/view?rev=61090&view=rev r61090] | raymond.hettinger | 2008-02-26 20:08:30 -0500 (Tue, 26 Feb 2008) | 1 line +Changed paths: + M /python/trunk/Lib/test/test_itertools.py + +Larger test range + +----------------------------------- +[http://svn.python.org/view?rev=61099&view=rev r61099] | jeffrey.yasskin | 2008-02-28 00:53:18 -0500 (Thu, 28 Feb 2008) | 3 lines +Changed paths: + M /python/trunk/Lib/test/test_socketserver.py + +Speed test_socketserver up from 28.739s to 0.226s, simplify the logic, and make +sure all tests run even if some fail. + + +----------------------------------- +[http://svn.python.org/view?rev=61113&view=rev r61113] | christian.heimes | 2008-02-28 16:00:45 -0500 (Thu, 28 Feb 2008) | 2 lines +Changed paths: + M /python/trunk/Lib/test/test_signal.py + +Windows fix for signal test - skip it earlier + + +----------------------------------- +[http://svn.python.org/view?rev=61192&view=rev r61192] | brett.cannon | 2008-03-02 21:41:40 -0500 (Sun, 02 Mar 2008) | 4 lines +Changed paths: + M /python/trunk/Lib/test/test_largefile.py + +Move test_largefile over to using 'with' statements for open files. + +Also rename the driver function to test_main() instead of main_test(). + + +----------------------------------- +[http://svn.python.org/view?rev=61194&view=rev r61194] | brett.cannon | 2008-03-02 22:24:48 -0500 (Sun, 02 Mar 2008) | 3 lines +Changed paths: + M /python/trunk/Lib/test/test_largefile.py + +Add a note in the main test class' docstring that the order of execution of the +tests is important. + + +----------------------------------- +[http://svn.python.org/view?rev=61195&view=rev r61195] | brett.cannon | 2008-03-02 22:26:43 -0500 (Sun, 02 Mar 2008) | 3 lines +Changed paths: + M /python/trunk/Lib/test/test_pep247.py + +Add a note in the main test class' docstring that the order of execution of the +tests is important. + + +----------------------------------- +[http://svn.python.org/view?rev=61198&view=rev r61198] | brett.cannon | 2008-03-02 23:19:29 -0500 (Sun, 02 Mar 2008) | 4 lines +Changed paths: + M /python/trunk/Lib/test/test_al.py + M /python/trunk/Lib/test/test_audioop.py + M /python/trunk/Lib/test/test_cd.py + M /python/trunk/Lib/test/test_cl.py + M /python/trunk/Lib/test/test_dbm.py + M /python/trunk/Lib/test/test_gl.py + M /python/trunk/Lib/test/test_imageop.py + M /python/trunk/Lib/test/test_imgfile.py + M /python/trunk/Lib/test/test_sunaudiodev.py + +Add test_main() functions to various tests where it was simple to do. Done so +that regrtest can execute the test_main() directly instead of relying on import +side-effects. + + +----------------------------------- +[http://svn.python.org/view?rev=61207&view=rev r61207] | christian.heimes | 2008-03-03 15:30:29 -0500 (Mon, 03 Mar 2008) | 1 line +Changed paths: + M /python/trunk/Lib/test/test_inspect.py + +15 -> 16 + +----------------------------------- +[http://svn.python.org/view?rev=61210&view=rev r61210] | georg.brandl | 2008-03-03 15:39:00 -0500 (Mon, 03 Mar 2008) | 2 lines +Changed paths: + M /python/trunk/Lib/test/test_inspect.py + +15 -> 16, the 2nd + + +----------------------------------- +[http://svn.python.org/view?rev=61242&view=rev r61242] | neal.norwitz | 2008-03-05 00:14:18 -0500 (Wed, 05 Mar 2008) | 3 lines +Changed paths: + M /python/trunk/Lib/test/test_winsound.py + +Get this test to pass even when there is no sound card in the system. +Patch from Trent Nelson. (I can't test this.) + + +----------------------------------- +[http://svn.python.org/view?rev=61244&view=rev r61244] | neal.norwitz | 2008-03-05 00:38:06 -0500 (Wed, 05 Mar 2008) | 5 lines +Changed paths: + M /python/trunk/Lib/test/test_smtplib.py + +Make the timeout longer to give slow machines a chance to pass the test +before timing out. This doesn't change the duration of the test under +normal circumstances. This is targetted at fixing the spurious failures +on the FreeBSD buildbot primarily. + + +----------------------------------- +[http://svn.python.org/view?rev=61248&view=rev r61248] | jeffrey.yasskin | 2008-03-05 01:19:56 -0500 (Wed, 05 Mar 2008) | 5 lines +Changed paths: + M /python/trunk/Lib/test/test_socketserver.py + +Fix test_socketserver on Windows after [http://svn.python.org/view?rev=61099&view=rev r61099] added several signal.alarm() +calls (which don't exist on non-Unix platforms). + +Thanks to Trent Nelson for the report and patch. + + +----------------------------------- +[http://svn.python.org/view?rev=61285&view=rev r61285] | raymond.hettinger | 2008-03-06 15:52:01 -0500 (Thu, 06 Mar 2008) | 1 line +Changed paths: + M /python/trunk/Lib/test/test_itertools.py + +More tests. + +----------------------------------- +[http://svn.python.org/view?rev=61332&view=rev r61332] | neal.norwitz | 2008-03-09 15:03:42 -0400 (Sun, 09 Mar 2008) | 4 lines +Changed paths: + M /python/trunk/Lib/test/test_ssl.py + +Introduce a lock to fix a race condition which caused an exception in the test. +Some buildbots were consistently failing (e.g., amd64). +Also remove a couple of semi-colons. + + +----------------------------------- +[http://svn.python.org/view?rev=61382&view=rev r61382] | brett.cannon | 2008-03-14 10:03:10 -0400 (Fri, 14 Mar 2008) | 2 lines +Changed paths: + M /python/trunk/Lib/test/test_gdbm.py + +Remove a bad test. + + +----------------------------------- +[http://svn.python.org/view?rev=61495&view=rev r61495] | jeffrey.yasskin | 2008-03-18 00:56:06 -0400 (Tue, 18 Mar 2008) | 4 lines +Changed paths: + M /python/trunk/Lib/test/test_thread.py + +Speed test_thread up from 51.328s to 0.081s by reducing its sleep times. We +still sleep at all to make it likely that all threads are active at the same +time. + + +----------------------------------- +[http://svn.python.org/view?rev=61496&view=rev r61496] | jeffrey.yasskin | 2008-03-18 01:12:41 -0400 (Tue, 18 Mar 2008) | 4 lines +Changed paths: + M /python/trunk/Lib/test/test_dict.py + +Speed up test_dict by about 10x by only checking selected dict literal sizes, +instead of every integer from 0 to 400. Exhaustive testing wastes time without +providing enough more assurance that the code is correct. + + +----------------------------------- +[http://svn.python.org/view?rev=61498&view=rev r61498] | neal.norwitz | 2008-03-18 01:20:29 -0400 (Tue, 18 Mar 2008) | 1 line +Changed paths: + M /python/trunk/Lib/test/test_smtplib.py + +Try increasing the timeout to reduce the flakiness of this test. + +----------------------------------- +[http://svn.python.org/view?rev=61503&view=rev r61503] | brett.cannon | 2008-03-18 01:43:04 -0400 (Tue, 18 Mar 2008) | 2 lines +Changed paths: + M /python/trunk/Lib/test/test_errno.py + +Improve the error message for a test that failed on the S-390 Debian buildbot. + + +----------------------------------- +[http://svn.python.org/view?rev=61504&view=rev r61504] | jeffrey.yasskin | 2008-03-18 01:45:40 -0400 (Tue, 18 Mar 2008) | 3 lines +Changed paths: + M /python/trunk/Lib/test/regrtest.py + +Add a -S/--slow flag to regrtest to have it print the 10 slowest tests with +their times. + + +----------------------------------- +[http://svn.python.org/view?rev=61507&view=rev r61507] | neal.norwitz | 2008-03-18 02:03:46 -0400 (Tue, 18 Mar 2008) | 1 line +Changed paths: + M /python/trunk/Lib/test/test_errno.py + +Add some info to the failure messages + +----------------------------------- +[http://svn.python.org/view?rev=61515&view=rev r61515] | martin.v.loewis | 2008-03-18 08:20:15 -0400 (Tue, 18 Mar 2008) | 2 lines +Changed paths: + M /python/trunk/Lib/test/test_errno.py + +norwitz-amd64 (gentoo) has EREMOTEIO. + + +----------------------------------- +[http://svn.python.org/view?rev=61516&view=rev r61516] | martin.v.loewis | 2008-03-18 08:45:37 -0400 (Tue, 18 Mar 2008) | 2 lines +Changed paths: + M /python/trunk/Lib/test/test_errno.py + +Add more Linux error codes. + + +----------------------------------- +[http://svn.python.org/view?rev=61517&view=rev r61517] | martin.v.loewis | 2008-03-18 09:05:03 -0400 (Tue, 18 Mar 2008) | 2 lines +Changed paths: + M /python/trunk/Lib/test/test_errno.py + +Add WSA errors. + + +----------------------------------- +[http://svn.python.org/view?rev=61518&view=rev r61518] | martin.v.loewis | 2008-03-18 09:16:05 -0400 (Tue, 18 Mar 2008) | 2 lines +Changed paths: + M /python/trunk/Lib/test/test_parser.py + +Note that the stderr output of the test is intentional. + + +----------------------------------- +[http://svn.python.org/view?rev=61524&view=rev r61524] | brett.cannon | 2008-03-18 11:52:00 -0400 (Tue, 18 Mar 2008) | 2 lines +Changed paths: + M /python/trunk/Lib/test/test_errno.py + +Fix test_errno to only check for error numbers that are defined by Standard C. + + +----------------------------------- +[http://svn.python.org/view?rev=61525&view=rev r61525] | steven.bethard | 2008-03-18 12:00:19 -0400 (Tue, 18 Mar 2008) | 1 line +Changed paths: + M /python/trunk/Lib/test/test_shelve.py + +Use test_support.unlink instead of os.unlink in tearDown(). (Seems to fix an occasional failure in Windows Vista.) + +----------------------------------- +[http://svn.python.org/view?rev=61532&view=rev r61532] | neal.norwitz | 2008-03-18 13:58:02 -0400 (Tue, 18 Mar 2008) | 1 line +Changed paths: + M /python/trunk/Lib/test/regrtest.py + +Get regrtest working when re-running tests + +----------------------------------- +[http://svn.python.org/view?rev=61539&view=rev r61539] | steven.bethard | 2008-03-18 15:04:32 -0400 (Tue, 18 Mar 2008) | 1 line +Changed paths: + M /python/trunk/Lib/test/test_winsound.py + +_have_soundcard() is a bad check for winsound.Beep, since you can have a soundcard but have the beep driver disabled. This revision basically disables the beep tests by wrapping them in a try/except. The Right Way To Do It is to come up with a _have_enabled_beep_driver() and use that. + +----------------------------------- +[http://svn.python.org/view?rev=61556&view=rev r61556] | steven.bethard | 2008-03-18 15:59:14 -0400 (Tue, 18 Mar 2008) | 1 line +Changed paths: + M /python/trunk/Lib/test/test_atexit.py + +Fix test_atexit so that it still passes when -3 is supplied. (It was catching the warning messages on stdio from using the reload() function.) + +----------------------------------- +[http://svn.python.org/view?rev=61605&view=rev r61605] | martin.v.loewis | 2008-03-19 02:00:28 -0400 (Wed, 19 Mar 2008) | 2 lines +Changed paths: + M /python/trunk/Lib/test/test_import.py + +Import relimport using a relative import. + + +----------------------------------- +[http://svn.python.org/view?rev=61622&view=rev r61622] | eric.smith | 2008-03-19 08:09:55 -0400 (Wed, 19 Mar 2008) | 2 lines +Changed paths: + M /python/trunk/Lib/test/test_print.py + +Use test.test_support.captured_stdout instead of a custom contextmanager. +Thanks Nick Coghlan. + +----------------------------------- +[http://svn.python.org/view?rev=61623&view=rev r61623] | eric.smith | 2008-03-19 08:15:10 -0400 (Wed, 19 Mar 2008) | 1 line +Changed paths: + M /python/trunk/Lib/test/test_int_literal.py + +Trivial typo. + +----------------------------------- +[http://svn.python.org/view?rev=61650&view=rev r61650] | trent.nelson | 2008-03-19 18:51:42 -0400 (Wed, 19 Mar 2008) | 1 line +Changed paths: + M /python/trunk/Lib/test/test_socketserver.py + +Bump the SIGALM delay from 3 seconds to 20 seconds, mainly in an effort to see if it fixes the alarm failures in this test experienced by some of the buildbots. + +----------------------------------- +[http://svn.python.org/view?rev=61658&view=rev r61658] | trent.nelson | 2008-03-19 20:58:44 -0400 (Wed, 19 Mar 2008) | 1 line +Changed paths: + M /python/trunk/Lib/test/test_socketserver.py + +Revert [http://svn.python.org/view?rev=61650&view=rev r61650]; the intent of this commit was to try and address alarm failures on some of the build slaves. As Neal points out, it's called after test_main(), so it's not going to factor into the test when run via regrtest.py (and removes the original functionality that Jeffrey wanted that would kill the test if it took longer than 3 seconds to run when executing it directly during development). + +----------------------------------- +[http://svn.python.org/view?rev=61665&view=rev r61665] | gregory.p.smith | 2008-03-20 01:41:53 -0400 (Thu, 20 Mar 2008) | 7 lines +Changed paths: + M /python/trunk/Lib/test/test_fcntl.py + M /python/trunk/Lib/test/test_ioctl.py + +Attempt to fix the Solaris Sparc 10 buildbot. It was failing with an invalid +argument error on ioctl. This was caused by the added test_fcntl ioctl test +that hard coded 0 as the fd to use. Without a terminal, this fails on solaris. +(it passed from the command line on sol 10, both 32 and 64 bit) + +Also, test_ioctl exists so I moved the test into there where it belongs. + + +----------------------------------- +[http://svn.python.org/view?rev=61687&view=rev r61687] | jeffrey.yasskin | 2008-03-21 01:02:44 -0400 (Fri, 21 Mar 2008) | 2 lines +Changed paths: + M /python/trunk/Lib/test/test_signal.py + +Speed up test_signal from ~24s to 4s by avoiding nearly all of the sleep calls. + + +----------------------------------- +[http://svn.python.org/view?rev=61688&view=rev r61688] | jeffrey.yasskin | 2008-03-21 01:51:37 -0400 (Fri, 21 Mar 2008) | 5 lines +Changed paths: + M /python/trunk/Lib/test/test_signal.py + +Try to fix test_signal breakages on Linux due to [http://svn.python.org/view?rev=61687&view=rev r61687]. It appears that at +least two of the linux build bots aren't leaving zombie processes around for +os.waitpid to wait for, causing ECHILD errors. This would be a symptom of a bug +somewhere, but probably not in signal itself. + + +----------------------------------- +[http://svn.python.org/view?rev=61704&view=rev r61704] | jeffrey.yasskin | 2008-03-21 14:25:06 -0400 (Fri, 21 Mar 2008) | 3 lines +Changed paths: + M /python/trunk/Lib/test/test_signal.py + +Try to fix test_signal on FreeBSD. I'm assuming that os.kill is failing to +raise a signal, but switching to subprocess makes the code cleaner anyway. + + +----------------------------------- +[http://svn.python.org/view?rev=61705&view=rev r61705] | jeffrey.yasskin | 2008-03-21 14:48:04 -0400 (Fri, 21 Mar 2008) | 7 lines +Changed paths: + M /python/trunk/Lib/test/test_threading.py + +Speed test_threading up from 14s to .5s, and avoid a deadlock on certain +failures. The test for enumerate-after-join is now a little less rigorous, but +the bug it references says the error happened in the first couple iterations, +so 100 iterations should still be enough. + +cProfile was useful for identifying the slow tests here. + + +----------------------------------- +[http://svn.python.org/view?rev=61731&view=rev r61731] | facundo.batista | 2008-03-21 22:45:37 -0400 (Fri, 21 Mar 2008) | 4 lines +Changed paths: + M /python/trunk/Lib/test/test_decimal.py + + +Small fix that complicated the test actually when that +test failed. + + +----------------------------------- +[http://svn.python.org/view?rev=61776&view=rev r61776] | neal.norwitz | 2008-03-22 23:43:33 -0400 (Sat, 22 Mar 2008) | 7 lines +Changed paths: + M /python/trunk/Lib/test/test_timeout.py + +Try to make this test a little more robust and not fail with: + timeout (10.0025) is more than 2 seconds more than expected (0.001) + +I'm assuming this problem is caused by DNS lookup. This change +does a DNS lookup of the hostname before trying to connect, so the time +is not included. + + +----------------------------------- +[http://svn.python.org/view?rev=61777&view=rev r61777] | neal.norwitz | 2008-03-23 00:08:30 -0400 (Sun, 23 Mar 2008) | 1 line +Changed paths: + M /python/trunk/Lib/test/test_xmlrpc.py + +Speed up the test by avoiding socket timeouts. + +----------------------------------- +[http://svn.python.org/view?rev=61778&view=rev r61778] | neal.norwitz | 2008-03-23 00:43:09 -0400 (Sun, 23 Mar 2008) | 1 line +Changed paths: + M /python/trunk/Lib/test/test_epoll.py + +Skip the epoll test if epoll() does not work + +----------------------------------- +[http://svn.python.org/view?rev=61780&view=rev r61780] | neal.norwitz | 2008-03-23 01:47:20 -0400 (Sun, 23 Mar 2008) | 1 line +Changed paths: + M /python/trunk/Lib/test/test_socket_ssl.py + +Suppress failure (to avoid a flaky test) if we cannot connect to svn.python.org + +----------------------------------- +[http://svn.python.org/view?rev=61782&view=rev r61782] | neal.norwitz | 2008-03-23 02:16:04 -0400 (Sun, 23 Mar 2008) | 1 line +Changed paths: + M /python/trunk/Lib/test/test_socketserver.py + +Try to prevent the alarm going off early in tearDown + +----------------------------------- +[http://svn.python.org/view?rev=61863&view=rev r61863] | neal.norwitz | 2008-03-25 00:17:38 -0400 (Tue, 25 Mar 2008) | 2 lines +Changed paths: + M /python/trunk/Lib/test/test_deque.py + M /python/trunk/Lib/test/test_uu.py + +Fix a bunch of UnboundLocalErrors when the tests fail. + + +----------------------------------- +[http://svn.python.org/view?rev=61869&view=rev r61869] | neal.norwitz | 2008-03-25 02:35:10 -0400 (Tue, 25 Mar 2008) | 3 lines +Changed paths: + M /python/trunk/Lib/test/test_set.py + +Don't try to close a non-open file. +Don't let file removal cause the test to fail. + + +----------------------------------- +[http://svn.python.org/view?rev=61870&view=rev r61870] | neal.norwitz | 2008-03-25 03:00:39 -0400 (Tue, 25 Mar 2008) | 7 lines +Changed paths: + M /python/trunk/Lib/test/test_signal.py + +Try to get this test to be more stable: + * disable gc during the test run because we are spawning objects and there + was an exception when calling Popen.__del__ + * Always set an alarm handler so the process doesn't exit if the test fails + (should probably add assertions on the value of hndl_called in more places) + * Using a negative time causes Linux to treat it as zero, so disable that test. + + +----------------------------------- +[http://svn.python.org/view?rev=61922&view=rev r61922] | neal.norwitz | 2008-03-26 00:55:51 -0400 (Wed, 26 Mar 2008) | 6 lines +Changed paths: + M /python/trunk/Lib/test/test_timeout.py + +Try to get this test to be less flaky. It was failing sometimes because +the connect would succeed before the timeout occurred. Try using an +address and port that hopefully doesn't exist to ensure we get no response. +If this doesn't work, we can use a public address close to python.org +and hopefully that address never gets taken. + + +----------------------------------- +[http://svn.python.org/view?rev=61923&view=rev r61923] | jerry.seutter | 2008-03-26 01:03:03 -0400 (Wed, 26 Mar 2008) | 1 line +Changed paths: + M /python/trunk/Lib/test/test_imaplib.py + +Changed test so it no longer runs as a side effect of importing. + +----------------------------------- +[http://svn.python.org/view?rev=61925&view=rev r61925] | jerry.seutter | 2008-03-26 01:32:51 -0400 (Wed, 26 Mar 2008) | 1 line +Changed paths: + M /python/trunk/Lib/test/test_format.py + +Changed test so it no longer runs as a side effect of importing. + +----------------------------------- +[http://svn.python.org/view?rev=61926&view=rev r61926] | jerry.seutter | 2008-03-26 01:58:14 -0400 (Wed, 26 Mar 2008) | 1 line +Changed paths: + M /python/trunk/Lib/test/test_ntpath.py + +Changed test so it no longer runs as a side effect of importing. + +----------------------------------- +[http://svn.python.org/view?rev=61978&view=rev r61978] | georg.brandl | 2008-03-27 09:34:59 -0400 (Thu, 27 Mar 2008) | 2 lines +Changed paths: + M /python/trunk/Lib/test/outstanding_bugs.py + +The bug for which there was a test in outstanding_bugs.py was agreed not to be a bug. + + +----------------------------------- +[http://svn.python.org/view?rev=61985&view=rev r61985] | neal.norwitz | 2008-03-28 00:41:34 -0400 (Fri, 28 Mar 2008) | 1 line +Changed paths: + M /python/trunk/Lib/test/test_telnetlib.py + +Allow use of other ports so the test can pass if 9091 is in use + +----------------------------------- +[http://svn.python.org/view?rev=61986&view=rev r61986] | jeffrey.yasskin | 2008-03-28 00:53:10 -0400 (Fri, 28 Mar 2008) | 2 lines +Changed paths: + M /python/trunk/Lib/test/test_socket.py + +Print more information the next time test_socket throws the wrong exception. + + +----------------------------------- +[http://svn.python.org/view?rev=61993&view=rev r61993] | neal.norwitz | 2008-03-28 02:34:03 -0400 (Fri, 28 Mar 2008) | 11 lines +Changed paths: + M /python/trunk/Lib/test/test_xmlrpc.py + +Bug 1503: Get the test to pass on OSX. This should make the test more +reliable, but I'm not convinced it is the right solution. We need +to determine if this causes the test to hang on any platforms or do +other bad things. + +Even if it gets the test to pass reliably, it might be that we want +to fix this in socket. The socket returned from accept() is different +on different platforms (inheriting attributes or not) and we might +want to ensure that the attributes (at least blocking) is the same +across all platforms. + + +----------------------------------- +[http://svn.python.org/view?rev=61997&view=rev r61997] | neal.norwitz | 2008-03-28 03:36:31 -0400 (Fri, 28 Mar 2008) | 1 line +Changed paths: + M /python/trunk/Lib/test/test_sax.py + +Name the main method correctly so the test is run + +----------------------------------- +[http://svn.python.org/view?rev=61998&view=rev r61998] | gregory.p.smith | 2008-03-28 04:00:44 -0400 (Fri, 28 Mar 2008) | 7 lines +Changed paths: + M /python/trunk/Lib/test/test_urllib2_localnet.py + M /python/trunk/Lib/test/test_urllib2net.py + +This patch moves some tests from test_urllib2_net to test_urllib2_localnet. +The moved tests use a local server rather than going out to external servers. + +Accepts patch from issue2429. + +Contributed by Jerry Seutter & Michael Foord (fuzzyman) at PyCon 2008. + + +----------------------------------- +[http://svn.python.org/view?rev=62029&view=rev r62029] | amaury.forgeotdarc | 2008-03-28 21:42:31 -0400 (Fri, 28 Mar 2008) | 3 lines +Changed paths: + M /python/trunk/Lib/test/test_logging.py + +Correctly call the base class tearDown(); +otherwise running test_logging twice produce the errors we see on all buildbots + + +----------------------------------- +[http://svn.python.org/view?rev=62038&view=rev r62038] | amaury.forgeotdarc | 2008-03-29 09:14:52 -0400 (Sat, 29 Mar 2008) | 4 lines +Changed paths: + M /python/trunk/Lib/test/regrtest.py + +Now that Lib/test/output is gone, tests should not print anything, +except in verbose mode. +Support code is much simpler. + + +----------------------------------- +[http://svn.python.org/view?rev=62040&view=rev r62040] | amaury.forgeotdarc | 2008-03-29 09:47:05 -0400 (Sat, 29 Mar 2008) | 5 lines +Changed paths: + M /python/trunk/Lib/test/test_socket.py + +The buildbot "x86 W2k8 trunk" seems to hang in test_socket. +http://www.python.org/dev/buildbot/trunk/x86%20W2k8%20trunk/builds/255/step-test/0 + +Temporarily increase verbosity of this test. + + +----------------------------------- +[http://svn.python.org/view?rev=62042&view=rev r62042] | amaury.forgeotdarc | 2008-03-29 10:53:05 -0400 (Sat, 29 Mar 2008) | 3 lines +Changed paths: + M /python/trunk/Lib/test/test_socket.py + +Still investigating on the hanging test_socket. +the test itself doesn't do anything on windows, focus on setUp and tearDown. + + +----------------------------------- +[http://svn.python.org/view?rev=62048&view=rev r62048] | georg.brandl | 2008-03-30 02:53:55 -0400 (Sun, 30 Mar 2008) | 2 lines +Changed paths: + M /python/trunk/Lib/test/test_ast.py + +Adapt test_ast to the new ExceptHandler type. + + +----------------------------------- +[http://svn.python.org/view?rev=62050&view=rev r62050] | georg.brandl | 2008-03-30 03:09:22 -0400 (Sun, 30 Mar 2008) | 2 lines +Changed paths: + M /python/trunk/Lib/test/test_ast.py + +Convert test_ast to unittest and add a test for [http://svn.python.org/view?rev=62049&view=rev r62049]. + + +----------------------------------- +[http://svn.python.org/view?rev=62085&view=rev r62085] | neal.norwitz | 2008-04-01 01:40:43 -0400 (Tue, 01 Apr 2008) | 4 lines +Changed paths: + M /python/trunk/Lib/test/test_mmap.py + +Be sure to close the file. 2 places were deleting the file, so it was probably +fine, but the last change may be required for the test to pass on Windows. +Should we always close the mmap too? + + +----------------------------------- +[http://svn.python.org/view?rev=62090&view=rev r62090] | brett.cannon | 2008-04-01 08:37:43 -0400 (Tue, 01 Apr 2008) | 3 lines +Changed paths: + M /python/trunk/Lib/test/test_support.py + +Generalize test.test_support.test_stdout() with a base context manager so that +it is easy to capture stderr if desired. + + +----------------------------------- +[http://svn.python.org/view?rev=62096&view=rev r62096] | amaury.forgeotdarc | 2008-04-01 18:52:48 -0400 (Tue, 01 Apr 2008) | 4 lines +Changed paths: + M /python/trunk/Lib/test/test_io.py + +Newly enabled test appears to leak: +it registers the same codec on each iteration. +Do it only once at load time. + + +----------------------------------- +[http://svn.python.org/view?rev=62100&view=rev r62100] | amaury.forgeotdarc | 2008-04-01 20:55:04 -0400 (Tue, 01 Apr 2008) | 4 lines +Changed paths: + M /python/trunk/Lib/test/test_collections.py + +A DocTestSuite cannot run multiple times: it clears its globals dictionary after the first run. + +Rebuild the DocTestSuite on each iteration. + + +----------------------------------- +[http://svn.python.org/view?rev=62102&view=rev r62102] | jeffrey.yasskin | 2008-04-02 00:07:44 -0400 (Wed, 02 Apr 2008) | 3 lines +Changed paths: + M /python/trunk/Lib/test/test_signal.py + +Try to make test_signal less flaky. I still see some flakiness in +test_itimer_prof. + + +----------------------------------- +[http://svn.python.org/view?rev=62113&view=rev r62113] | amaury.forgeotdarc | 2008-04-02 17:18:46 -0400 (Wed, 02 Apr 2008) | 2 lines +Changed paths: + M /python/trunk/Lib/test/test_socket.py + +Remove debug prints; the buildbot now passes the tests + + +----------------------------------- +[http://svn.python.org/view?rev=62141&view=rev r62141] | jeffrey.yasskin | 2008-04-04 00:51:19 -0400 (Fri, 04 Apr 2008) | 5 lines +Changed paths: + M /python/trunk/Lib/test/test_signal.py + +Doh! os.read() raises an OSError, not an IOError when it's interrupted. + +And fix some flakiness in test_itimer_prof, which could detect that the timer +had reached 0 before the signal arrived announcing that fact. + + +----------------------------------- +[http://svn.python.org/view?rev=62150&view=rev r62150] | jeffrey.yasskin | 2008-04-04 12:48:19 -0400 (Fri, 04 Apr 2008) | 2 lines +Changed paths: + M /python/trunk/Lib/test/test_signal.py + +Oops again. EINTR is in errno, not signal. + + +----------------------------------- +[http://svn.python.org/view?rev=62152&view=rev r62152] | trent.nelson | 2008-04-04 13:26:21 -0400 (Fri, 04 Apr 2008) | 1 line +Changed paths: + M /python/trunk/Lib/test/test_socket.py + +Issue 2550: extend test_socket.py to test SO_REUSEADDR semantics when bind() is called on identical (host, port) combinations in two separate sockets. This should raise an EADDRINUSE socket.error in all cases, irrespective of whether or not SO_REUSEADDR is set on the sockets. However, with Windows, when SO_REUSEADDR is set on the sockets, no error is thrown (an error is thrown when the option isn't set), which results in an extremely wedged python process whenever accept() is called on either of the bound sockets. I'm committing this test now to observe if it's only Windows that has this behaviour (via the buildbots). Note: this WILL break all Windows buildbots for now; once I've observed the results on other platforms, I'll revert, then start looking into a patch. + +----------------------------------- +[http://svn.python.org/view?rev=62156&view=rev r62156] | trent.nelson | 2008-04-04 16:04:09 -0400 (Fri, 04 Apr 2008) | 1 line +Changed paths: + M /python/trunk/Lib/test/test_socket.py + +Revert [http://svn.python.org/view?rev=62152&view=rev r62152] (Issue #2550). Being able to observe the results of all the buildbots was certainly useful. All of the platforms that have some form of BSD lineage -- FreeBSD, OS X, Solaris and Tru64 -- all pass the test. Windows and Linux, on the other hand, don't. Windows I knew about, Linux was a surprise. Knowing this, I believe a more appropriate fix will revolve around test_support.bind_socket() -- this method needs to return a port that nothing in the system has bound already. The best way to do this may just be to rely on ephemeral ports, rather than having the user specify a desired port, then fall back to four random ports, then try 0. + +----------------------------------- +[http://svn.python.org/view?rev=62194&view=rev r62194] | jeffrey.yasskin | 2008-04-06 19:04:28 -0400 (Sun, 06 Apr 2008) | 7 lines +Changed paths: + M /python/trunk/Lib/test/test_signal.py + +Add enough debugging information to diagnose failures where the +HandlerBException is ignored, and fix one such problem, where it was thrown +during the __del__ method of the previous Popen object. + +We may want to find a better way of printing verbose information so it's not +spammy when the test passes. + + +----------------------------------- +[http://svn.python.org/view?rev=62237&view=rev r62237] | trent.nelson | 2008-04-08 20:34:53 -0400 (Tue, 08 Apr 2008) | 1 line +Changed paths: + M /python/trunk/Lib/test/test_httplib.py + M /python/trunk/Lib/test/test_socket_ssl.py + +Fix typo with regards to self.PORT shadowing class variables with the same name. + +----------------------------------- +[http://svn.python.org/view?rev=62239&view=rev r62239] | jerry.seutter | 2008-04-09 01:07:58 -0400 (Wed, 09 Apr 2008) | 1 line +Changed paths: + M /python/trunk/Lib/test/test_sundry.py + +Changed test so it no longer runs as a side effect of importing. + +----------------------------------- +[http://svn.python.org/view?rev=62260&view=rev r62260] | gregory.p.smith | 2008-04-09 19:11:56 -0400 (Wed, 09 Apr 2008) | 2 lines +Changed paths: + M /python/trunk/Lib/test/test_quopri.py + +better diagnostics + + +----------------------------------- +[http://svn.python.org/view?rev=62266&view=rev r62266] | neal.norwitz | 2008-04-10 01:46:39 -0400 (Thu, 10 Apr 2008) | 5 lines +Changed paths: + M /python/trunk/Lib/test/test_array.py + M /python/trunk/Lib/test/test_deque.py + M /python/trunk/Lib/test/test_gzip.py + M /python/trunk/Lib/test/test_uu.py + +Remove the test file before writing it in case there is no write permission. +This might help fix some of the failures on Windows box(es). It doesn't hurt +either way and ensure the tests are a little more self contained (ie have +less assumptions). + + +----------------------------------- +[http://svn.python.org/view?rev=62313&view=rev r62313] | brett.cannon | 2008-04-12 22:42:36 -0400 (Sat, 12 Apr 2008) | 3 lines +Changed paths: + M /python/trunk/Lib/test/test_warnings.py + +Fix test_warnings by making the state of things more consistent for each test +when it is run. + + +----------------------------------- +[http://svn.python.org/view?rev=62314&view=rev r62314] | skip.montanaro | 2008-04-12 23:17:30 -0400 (Sat, 12 Apr 2008) | 2 lines +Changed paths: + M /python/trunk/Lib/test/test_support.py + +spelling + + +----------------------------------- +[http://svn.python.org/view?rev=62323&view=rev r62323] | brett.cannon | 2008-04-13 13:09:43 -0400 (Sun, 13 Apr 2008) | 3 lines +Changed paths: + M /python/trunk/Lib/test/test_warnings.py + +Add an explicit check for output in a test to try to diagnose a failure on +Windows. + + +----------------------------------- +[http://svn.python.org/view?rev=62324&view=rev r62324] | brett.cannon | 2008-04-13 13:41:31 -0400 (Sun, 13 Apr 2008) | 3 lines +Changed paths: + M /python/trunk/Lib/test/test_warnings.py + +Fix spliting on colons on Windows machines with a file path by limiting the +number of splits. + + +----------------------------------- +[http://svn.python.org/view?rev=62381&view=rev r62381] | amaury.forgeotdarc | 2008-04-18 19:31:33 -0400 (Fri, 18 Apr 2008) | 3 lines +Changed paths: + M /python/trunk/Lib/test/regrtest.py + M /python/trunk/Lib/test/test_frozen.py + M /python/trunk/Lib/test/test_pkg.py + M /python/trunk/Lib/test/test_pkgutil.py + M /python/trunk/Lib/test/test_profile.py + M /python/trunk/Lib/test/test_structmembers.py + M /python/trunk/Lib/test/test_warnings.py + +Some tests did not pass on repeated calls (regrtest -R::) +Perform additional cleanup, mostly deleting from sys.modules, or clearing the warnings registry. + + +----------------------------------- +[http://svn.python.org/view?rev=62412&view=rev r62412] | mark.dickinson | 2008-04-19 21:22:30 -0400 (Sat, 19 Apr 2008) | 5 lines +Changed paths: + M /python/trunk/Lib/test/test_math.py + +Report additional diagnostic information in +test_math, to help track down debian-alpha +buildbot failure. + + + +----------------------------------- +[http://svn.python.org/view?rev=62421&view=rev r62421] | mark.dickinson | 2008-04-20 16:38:48 -0400 (Sun, 20 Apr 2008) | 2 lines +Changed paths: + M /python/trunk/Lib/test/test_math.py + +Add test for tanh(-0.) == -0. on IEEE 754 systems + + +----------------------------------- +[http://svn.python.org/view?rev=62423&view=rev r62423] | amaury.forgeotdarc | 2008-04-20 17:02:21 -0400 (Sun, 20 Apr 2008) | 3 lines +Changed paths: + M /python/trunk/Lib/test/test_pkgutil.py + +Correct an apparent refleak in test_pkgutil: zipimport._zip_directory_cache contains +info for all processed zip files, even when they are no longer used. + + +----------------------------------- +[http://svn.python.org/view?rev=62425&view=rev r62425] | andrew.kuchling | 2008-04-20 21:45:57 -0400 (Sun, 20 Apr 2008) | 1 line +Changed paths: + M /python/trunk/Lib/test/test_xmlrpc.py + +Comment typo + +----------------------------------- +[http://svn.python.org/view?rev=62485&view=rev r62485] | amaury.forgeotdarc | 2008-04-24 16:10:26 -0400 (Thu, 24 Apr 2008) | 5 lines +Changed paths: + M /python/trunk/Lib/test/test_trace.py + +Disable gc when running test_trace, or we may record the __del__ of collected objects. + +See http://mail.python.org/pipermail/python-checkins/2008-April/068633.html +the extra events perfectly match several calls to socket._fileobject.__del__() + + +----------------------------------- +[http://svn.python.org/view?rev=62487&view=rev r62487] | amaury.forgeotdarc | 2008-04-24 16:41:50 -0400 (Thu, 24 Apr 2008) | 2 lines +Changed paths: + M /python/trunk/Lib/test/test_pydoc.py + +Use absolute import for test package + + +----------------------------------- +[http://svn.python.org/view?rev=62507&view=rev r62507] | benjamin.peterson | 2008-04-25 17:43:56 -0400 (Fri, 25 Apr 2008) | 2 lines +Changed paths: + M /python/trunk/Lib/test/test_import.py + +Allow test_import to work when it is invoked directly + + +----------------------------------- +[http://svn.python.org/view?rev=62569&view=rev r62569] | amaury.forgeotdarc | 2008-04-28 17:07:06 -0400 (Mon, 28 Apr 2008) | 5 lines +Changed paths: + M /python/trunk/Lib/test/test_sundry.py + +test_sundry performs minimal tests (a simple import...) on modules that are not tested otherwise. + +Some of them now have tests and can be removed. +Only 70 to go... + + +----------------------------------- +[http://svn.python.org/view?rev=62604&view=rev r62604] | benjamin.peterson | 2008-04-30 17:03:58 -0400 (Wed, 30 Apr 2008) | 2 lines +Changed paths: + M /python/trunk/Lib/test/test_support.py + +make test_support's captured_output a bit more robust when exceptions happen + + +----------------------------------- +[http://svn.python.org/view?rev=62680&view=rev r62680] | benjamin.peterson | 2008-05-03 17:35:18 -0400 (Sat, 03 May 2008) | 2 lines +Changed paths: + M /python/trunk/Lib/test/test_builtin.py + M /python/trunk/Lib/test/test_float.py + A /python/trunk/Lib/test/test_int.py + M /python/trunk/Lib/test/test_list.py + M /python/trunk/Lib/test/test_long.py + M /python/trunk/Lib/test/test_str.py + M /python/trunk/Lib/test/test_tuple.py + +Moved testing of builtin types out of test_builtin and into type specific modules + + +----------------------------------- +[http://svn.python.org/view?rev=62726&view=rev r62726] | martin.v.loewis | 2008-05-05 13:47:06 -0400 (Mon, 05 May 2008) | 2 lines +Changed paths: + M /python/trunk/Lib/test/test_zipfile.py + +Fix Unicode filename test. + + +----------------------------------- +[http://svn.python.org/view?rev=62728&view=rev r62728] | martin.v.loewis | 2008-05-05 13:54:01 -0400 (Mon, 05 May 2008) | 2 lines +Changed paths: + M /python/trunk/Lib/test/regrtest.py + +Revert bogus checkin in [http://svn.python.org/view?rev=62724&view=rev r62724] to that file. + + +----------------------------------- +[http://svn.python.org/view?rev=62792&view=rev r62792] | brett.cannon | 2008-05-06 19:22:02 -0400 (Tue, 06 May 2008) | 2 lines +Changed paths: + M /python/trunk/Lib/test/test___all__.py + +When testing a module's __all__, we really don't care if it is deprecated. + + +----------------------------------- +[http://svn.python.org/view?rev=62799&view=rev r62799] | christian.heimes | 2008-05-06 19:42:58 -0400 (Tue, 06 May 2008) | 1 line +Changed paths: + M /python/trunk/Lib/test/test_subprocess.py + +Disabled some unit tests for the upcoming release. See #2777 + +----------------------------------- +[http://svn.python.org/view?rev=62975&view=rev r62975] | brett.cannon | 2008-05-09 22:54:52 -0400 (Fri, 09 May 2008) | 3 lines +Changed paths: + M /python/trunk/Lib/test/test_support.py + +Suppress deprecations for packages as well when using +test.test_support.import_module(). + + +----------------------------------- +[http://svn.python.org/view?rev=62976&view=rev r62976] | brett.cannon | 2008-05-09 22:57:03 -0400 (Fri, 09 May 2008) | 2 lines +Changed paths: + M /python/trunk/Lib/test/test___all__.py + +Also ignore package deprecations. + + +----------------------------------- +[http://svn.python.org/view?rev=63040&view=rev r63040] | alexandre.vassalotti | 2008-05-11 03:08:12 -0400 (Sun, 11 May 2008) | 2 lines +Changed paths: + M /python/trunk/Lib/test/test_support.py + +Fixed typo in a comment of test_support.CleanImport. + + +----------------------------------- +[http://svn.python.org/view?rev=63189&view=rev r63189] | amaury.forgeotdarc | 2008-05-12 18:21:39 -0400 (Mon, 12 May 2008) | 3 lines +Changed paths: + M /python/trunk/Lib/test/test_pyclbr.py + +Adapt test_pyclbr to the new version of urllib.py: +The new mac-specific functions must be ignored. + + +----------------------------------- +[http://svn.python.org/view?rev=63218&view=rev r63218] | gregory.p.smith | 2008-05-14 00:27:01 -0400 (Wed, 14 May 2008) | 2 lines +Changed paths: + M /python/trunk/Lib/test/test_bsddb3.py + +Enable the updated Lib/bsddb/test suite to run. + + +----------------------------------- +[http://svn.python.org/view?rev=63220&view=rev r63220] | neal.norwitz | 2008-05-14 02:47:56 -0400 (Wed, 14 May 2008) | 3 lines +Changed paths: + M /python/trunk/Lib/test/test_site.py + +Fix "refleak" by restoring the tearDown method removed by accident (AFAICT) +in [http://svn.python.org/view?rev=62788&view=rev r62788]. + + +----------------------------------- +[http://svn.python.org/view?rev=63221&view=rev r63221] | georg.brandl | 2008-05-14 03:18:22 -0400 (Wed, 14 May 2008) | 2 lines +Changed paths: + M /python/trunk/Lib/test/test_warnings.py + +Fix another "refleak" by clearing the filters after test. + + +----------------------------------- +[http://svn.python.org/view?rev=63327&view=rev r63327] | alexandre.vassalotti | 2008-05-15 16:31:42 -0400 (Thu, 15 May 2008) | 2 lines +Changed paths: + M /python/trunk/Lib/test/test_genexps.py + +Fixed typo in a doctest of test_genexps. + + +----------------------------------- +[http://svn.python.org/view?rev=63339&view=rev r63339] | brett.cannon | 2008-05-15 20:37:42 -0400 (Thu, 15 May 2008) | 2 lines +Changed paths: + M /python/trunk/Lib/test/test_os.py + +Remove the last usage of statvfs in the stdlib. + + +----------------------------------- +[http://svn.python.org/view?rev=63348&view=rev r63348] | benjamin.peterson | 2008-05-15 22:24:49 -0400 (Thu, 15 May 2008) | 2 lines +Changed paths: + M /python/trunk/Lib/test/test_platform.py + +make test_platform a bit more assertive (We'll see what the buildbots say.) + + +----------------------------------- +[http://svn.python.org/view?rev=63405&view=rev r63405] | gregory.p.smith | 2008-05-17 03:17:34 -0400 (Sat, 17 May 2008) | 3 lines +Changed paths: + M /python/trunk/Lib/test/test_subprocess.py + +fix issue2381: test_subprocess fails if your sys.executable is on a +path with a space in it. + + +----------------------------------- +[http://svn.python.org/view?rev=63447&view=rev r63447] | georg.brandl | 2008-05-18 06:39:26 -0400 (Sun, 18 May 2008) | 3 lines +Changed paths: + M /python/trunk/Lib/test/test_collections.py + +Take namedtuple item names only from ascii_letters (this blew up on OSX), +and make sure there are no duplicate names. + + +----------------------------------- +[http://svn.python.org/view?rev=63454&view=rev r63454] | georg.brandl | 2008-05-18 12:32:48 -0400 (Sun, 18 May 2008) | 2 lines +Changed paths: + A /python/trunk/Lib/test/pydoc_mod.py + M /python/trunk/Lib/test/test_pydoc.py + +GHOP #121: improve test_pydoc, by Benjamin Peterson. + + +----------------------------------- +[http://svn.python.org/view?rev=63459&view=rev r63459] | benjamin.peterson | 2008-05-18 16:48:07 -0400 (Sun, 18 May 2008) | 2 lines +Changed paths: + M /python/trunk/Lib/test/test_pydoc.py + +bring test_pydoc up to my high standards (now that I have them) + + +----------------------------------- +[http://svn.python.org/view?rev=63463&view=rev r63463] | georg.brandl | 2008-05-18 17:10:19 -0400 (Sun, 18 May 2008) | 2 lines +Changed paths: + M /python/trunk/Lib/test/test_pyclbr.py + +Fix test_pyclbr after another platform-dependent function was added to urllib. + + +----------------------------------- +[http://svn.python.org/view?rev=63464&view=rev r63464] | benjamin.peterson | 2008-05-18 18:07:42 -0400 (Sun, 18 May 2008) | 2 lines +Changed paths: + M /python/trunk/Lib/test/test_platform.py + +fix test_platform (os was not imported) + + +----------------------------------- +[http://svn.python.org/view?rev=63483&view=rev r63483] | georg.brandl | 2008-05-20 02:15:36 -0400 (Tue, 20 May 2008) | 2 lines +Changed paths: + M /python/trunk/Lib/test/test_httpservers.py + +Activate two more test cases in test_httpservers. + + +----------------------------------- +[http://svn.python.org/view?rev=63484&view=rev r63484] | georg.brandl | 2008-05-20 02:47:31 -0400 (Tue, 20 May 2008) | 2 lines +Changed paths: + M /python/trunk/Lib/test/test_httpservers.py + +Argh, this is the *actual* test that works under Windows. + + +----------------------------------- +[http://svn.python.org/view?rev=63495&view=rev r63495] | georg.brandl | 2008-05-20 03:58:42 -0400 (Tue, 20 May 2008) | 2 lines +Changed paths: + D /python/trunk/Lib/html + M /python/trunk/Lib/test/test_htmlparser.py + +Remove html package and fix test_htmlparser. + + +----------------------------------- +[http://svn.python.org/view?rev=63496&view=rev r63496] | georg.brandl | 2008-05-20 04:07:36 -0400 (Tue, 20 May 2008) | 2 lines +Changed paths: + M /python/trunk/Lib/test/test_pydoc.py + +Improve diffing logic and output for test_pydoc. + + +----------------------------------- +[http://svn.python.org/view?rev=63497&view=rev r63497] | georg.brandl | 2008-05-20 04:10:03 -0400 (Tue, 20 May 2008) | 2 lines +Changed paths: + M /python/trunk/Lib/test/test_pydoc.py + +Use inspect.getabsfile() to get the documented module's filename. + + +----------------------------------- +[http://svn.python.org/view?rev=63528&view=rev r63528] | benjamin.peterson | 2008-05-21 18:52:39 -0400 (Wed, 21 May 2008) | 2 lines +Changed paths: + M /python/trunk/Lib/test/test_platform.py + +check for toolbox glue before testing platform.mac_ver intensly + + +----------------------------------- +[http://svn.python.org/view?rev=63530&view=rev r63530] | benjamin.peterson | 2008-05-21 20:57:02 -0400 (Wed, 21 May 2008) | 2 lines +Changed paths: + M /python/trunk/Lib/test/test_opcodes.py + +use more specific asserts in test_opcode + + +----------------------------------- +[http://svn.python.org/view?rev=63540&view=rev r63540] | benjamin.peterson | 2008-05-22 19:09:26 -0400 (Thu, 22 May 2008) | 3 lines +Changed paths: + M /python/trunk/Lib/test/test_pydoc.py + +fix test_pydoc so it works on make installed Python installations +Also let it pass when invoked directly + + +----------------------------------- +[http://svn.python.org/view?rev=63543&view=rev r63543] | mark.dickinson | 2008-05-22 22:36:48 -0400 (Thu, 22 May 2008) | 2 lines +Changed paths: + M /python/trunk/Lib/test/test_math.py + +Add tests for math.sum (Issue #2819) + + +----------------------------------- +[http://svn.python.org/view?rev=63544&view=rev r63544] | mark.dickinson | 2008-05-22 23:30:01 -0400 (Thu, 22 May 2008) | 2 lines +Changed paths: + M /python/trunk/Lib/test/test_math.py + +Better error reporting in test_math.py + + +----------------------------------- +[http://svn.python.org/view?rev=63553&view=rev r63553] | mark.dickinson | 2008-05-23 08:07:36 -0400 (Fri, 23 May 2008) | 3 lines +Changed paths: + M /python/trunk/Lib/test/test_math.py + +Skip math.sum tests on non IEEE 754 platforms, and on IEEE 754 platforms +that exhibit the problem described in issue #2937. + + +----------------------------------- +[http://svn.python.org/view?rev=63576&view=rev r63576] | martin.v.loewis | 2008-05-24 05:36:45 -0400 (Sat, 24 May 2008) | 3 lines +Changed paths: + M /python/trunk/Lib/test/test_ioctl.py + +Don't try to get the window size if it was never set before. +Fixes the test failure on Solaris. + + +----------------------------------- +[http://svn.python.org/view?rev=63698&view=rev r63698] | benjamin.peterson | 2008-05-26 12:22:27 -0400 (Mon, 26 May 2008) | 2 lines +Changed paths: + M /python/trunk/Lib/test/test___all__.py + M /python/trunk/Lib/test/test_support.py + +add __all__ to test_support + + +----------------------------------- +[http://svn.python.org/view?rev=63732&view=rev r63732] | benjamin.peterson | 2008-05-26 17:44:26 -0400 (Mon, 26 May 2008) | 2 lines +Changed paths: + M /python/trunk/Lib/test/pydoc_mod.py + +remove duplication in test module + + +----------------------------------- +[http://svn.python.org/view?rev=63802&view=rev r63802] | mark.dickinson | 2008-05-29 22:46:53 -0400 (Thu, 29 May 2008) | 2 lines +Changed paths: + M /python/trunk/Lib/test/test_math.py + +Fix typo in testSum + + +----------------------------------- +[http://svn.python.org/view?rev=63860&view=rev r63860] | georg.brandl | 2008-06-01 13:05:56 -0400 (Sun, 01 Jun 2008) | 2 lines +Changed paths: + M /python/trunk/Lib/test/test_descrtut.py + +Fix test_descrtut. + + +----------------------------------- +[http://svn.python.org/view?rev=63861&view=rev r63861] | robert.schuppenies | 2008-06-01 13:11:09 -0400 (Sun, 01 Jun 2008) | 2 lines +Changed paths: + M /python/trunk/Lib/test/test_sys.py + +Fix test_sys. + + +----------------------------------- +[http://svn.python.org/view?rev=63910&view=rev r63910] | benjamin.peterson | 2008-06-02 21:30:37 -0400 (Mon, 02 Jun 2008) | 2 lines +Changed paths: + M /python/trunk/Lib/test/test_mutex.py + +make test_mutex more elegant + + +----------------------------------- +[http://svn.python.org/view?rev=64012&view=rev r64012] | facundo.batista | 2008-06-07 09:36:36 -0400 (Sat, 07 Jun 2008) | 4 lines +Changed paths: + M /python/trunk/Lib/test/test_urllib2net.py + + +Finished bug #2451. Fixed the retrying part to make it +more robust. + + +----------------------------------- +[http://svn.python.org/view?rev=64095&view=rev r64095] | amaury.forgeotdarc | 2008-06-10 17:37:15 -0400 (Tue, 10 Jun 2008) | 3 lines +Changed paths: + M /python/trunk/Lib/test/test_pydoc.py + +Correct test_pydoc for win32 platforms, to account for normalized URLs: +C:\temp => file:///C|temp/ + + +----------------------------------- +[http://svn.python.org/view?rev=64097&view=rev r64097] | benjamin.peterson | 2008-06-10 18:39:25 -0400 (Tue, 10 Jun 2008) | 2 lines +Changed paths: + M /python/trunk/Lib/test/test_platform.py + +backport of 64096 + + +----------------------------------- +[http://svn.python.org/view?rev=64102&view=rev r64102] | benjamin.peterson | 2008-06-10 21:31:28 -0400 (Tue, 10 Jun 2008) | 4 lines +Changed paths: + M /python/trunk/Lib/test/test_struct.py + +convert test_struct to a unittest thanks to Giampaolo Rodola +I had to disable one test because it was functioning incorrectly, see #1530559 +I also removed the debugging prints + + +----------------------------------- +[http://svn.python.org/view?rev=64120&view=rev r64120] | raymond.hettinger | 2008-06-11 09:14:50 -0400 (Wed, 11 Jun 2008) | 1 line +Changed paths: + M /python/trunk/Lib/test/test_heapq.py + +Add test for heapq using both __lt__ and __le__. + +----------------------------------- +[http://svn.python.org/view?rev=64165&view=rev r64165] | armin.rigo | 2008-06-12 05:50:58 -0400 (Thu, 12 Jun 2008) | 3 lines +Changed paths: + M /python/trunk/Lib/test/crashers/loosing_mro_ref.py + +Sounds obvious, but I didn't even realize that you can put non-string +keys in type dictionaries without using this locals() hack. + + +----------------------------------- +[http://svn.python.org/view?rev=64221&view=rev r64221] | neal.norwitz | 2008-06-13 02:03:25 -0400 (Fri, 13 Jun 2008) | 3 lines +Changed paths: + M /python/trunk/Lib/test/test_heapq.py + +Fix typo in method name. The LT class implemented less than. The LE class +should implement less than or equal to (as the code does). + + +----------------------------------- +[http://svn.python.org/view?rev=64280&view=rev r64280] | gregory.p.smith | 2008-06-14 13:34:09 -0400 (Sat, 14 Jun 2008) | 3 lines +Changed paths: + M /python/trunk/Lib/test/test_struct.py + +silence the test when it is skipped on some platforms. should fix a +buildbot. + + +----------------------------------- +[http://svn.python.org/view?rev=64301&view=rev r64301] | georg.brandl | 2008-06-15 15:54:36 -0400 (Sun, 15 Jun 2008) | 2 lines +Changed paths: + M /python/trunk/Lib/test/test_grammar.py + +Forward-port new test from [http://svn.python.org/view?rev=64300&view=rev r64300]. + + +----------------------------------- +[http://svn.python.org/view?rev=64326&view=rev r64326] | robert.schuppenies | 2008-06-17 04:42:15 -0400 (Tue, 17 Jun 2008) | 2 lines +Changed paths: + M /python/trunk/Lib/test/test_sys.py + +Issue 3048: Fixed sys.sizeof test fails with wide unicode. + + +----------------------------------- +[http://svn.python.org/view?rev=64386&view=rev r64386] | amaury.forgeotdarc | 2008-06-18 17:18:27 -0400 (Wed, 18 Jun 2008) | 3 lines +Changed paths: + M /python/trunk/Lib/test/test_socket_ssl.py + +The ssl certificate at https://sf.net is not valid. +Switch to https://sourceforge.net + + +----------------------------------- +[http://svn.python.org/view?rev=64408&view=rev r64408] | amaury.forgeotdarc | 2008-06-19 15:57:39 -0400 (Thu, 19 Jun 2008) | 2 lines +Changed paths: + M /python/trunk/Lib/test/regrtest.py + +test_macos can be skipped on non-mac platforms. + + +----------------------------------- +[http://svn.python.org/view?rev=64412&view=rev r64412] | amaury.forgeotdarc | 2008-06-19 17:17:12 -0400 (Thu, 19 Jun 2008) | 3 lines +Changed paths: + M /python/trunk/Lib/test/test_site.py + +In test_site, correctly escape backslashes in path names. +This allows the test to pass when the username begins with a lowercase 't'... + + +----------------------------------- +[http://svn.python.org/view?rev=64413&view=rev r64413] | benjamin.peterson | 2008-06-19 17:39:06 -0400 (Thu, 19 Jun 2008) | 1 line +Changed paths: + M /python/trunk/Lib/test/regrtest.py + M /python/trunk/Lib/test/test_macostools.py + +skip test_macostools when UCS4 is enabled + +----------------------------------- +[http://svn.python.org/view?rev=64456&view=rev r64456] | facundo.batista | 2008-06-22 12:11:34 -0400 (Sun, 22 Jun 2008) | 4 lines +Changed paths: + M /python/trunk/Lib/test/test_posix.py + + +Trying to see if the @ in a path is causing the issue in the +shutil.rmtree() in the trunk.loewis-sun buildbot. + + +----------------------------------- +[http://svn.python.org/view?rev=64462&view=rev r64462] | facundo.batista | 2008-06-22 14:23:55 -0400 (Sun, 22 Jun 2008) | 4 lines +Changed paths: + M /python/trunk/Lib/test/test_posix.py + + +Trying to see if the problem in Martin's buildot is at +directory creation time... + + +----------------------------------- +[http://svn.python.org/view?rev=64468&view=rev r64468] | facundo.batista | 2008-06-22 15:35:24 -0400 (Sun, 22 Jun 2008) | 4 lines +Changed paths: + M /python/trunk/Lib/test/test_posix.py + + +Just returning nothing instead of rising TestSkipped, because +it makes the test fail in the trunk.loewis-sun buildbot. + + +----------------------------------- +[http://svn.python.org/view?rev=64518&view=rev r64518] | robert.schuppenies | 2008-06-25 05:20:03 -0400 (Wed, 25 Jun 2008) | 2 lines +Changed paths: + M /python/trunk/Lib/test/test_sys.py + +Issue 3147: Fixed SizeofTest failure for LLP64 systems. + + +----------------------------------- +[http://svn.python.org/view?rev=64580&view=rev r64580] | bill.janssen | 2008-06-28 19:00:39 -0400 (Sat, 28 Jun 2008) | 1 line +Changed paths: + M /python/trunk/Lib/test/test_ssl.py + +make sure we close the active channels when eof is received on them + +----------------------------------- +[http://svn.python.org/view?rev=64582&view=rev r64582] | benjamin.peterson | 2008-06-28 19:06:05 -0400 (Sat, 28 Jun 2008) | 2 lines +Changed paths: + M /python/trunk/Lib/test/test_audioop.py + +convert test_audioop to unittest. Thanks to Giampaolo Rodola. + + +----------------------------------- +[http://svn.python.org/view?rev=64585&view=rev r64585] | benjamin.peterson | 2008-06-28 19:35:31 -0400 (Sat, 28 Jun 2008) | 1 line +Changed paths: + M /python/trunk/Lib/test/test_audioop.py + +fix typo + +----------------------------------- +[http://svn.python.org/view?rev=64673&view=rev r64673] | brett.cannon | 2008-07-02 17:40:11 -0400 (Wed, 02 Jul 2008) | 4 lines +Changed paths: + M /python/trunk/Lib/test/test_cookielib.py + +FIx some Latin-1 characters to be UTF-8 as the file encoding specifies. + +Closes issue #3261. THankjs Leo Soto for the bug report. + + +----------------------------------- +[http://svn.python.org/view?rev=64677&view=rev r64677] | brett.cannon | 2008-07-02 17:52:42 -0400 (Wed, 02 Jul 2008) | 2 lines +Changed paths: + M /python/trunk/Lib/test/test_cookielib.py + +Revert [http://svn.python.org/view?rev=64673&view=rev r64673] and instead just change the file encoding. + + +----------------------------------- +[http://svn.python.org/view?rev=64744&view=rev r64744] | georg.brandl | 2008-07-05 12:43:45 -0400 (Sat, 05 Jul 2008) | 2 lines +Changed paths: + M /python/trunk/Lib/test/regrtest.py + +Keep below 80 chars. + + +----------------------------------- +[http://svn.python.org/view?rev=64757&view=rev r64757] | benjamin.peterson | 2008-07-06 08:39:09 -0400 (Sun, 06 Jul 2008) | 1 line +Changed paths: + M /python/trunk/Lib/test/test_sys.py + +remove test_compact_freelists from test_sys + +----------------------------------- +[http://svn.python.org/view?rev=64885&view=rev r64885] | josiah.carlson | 2008-07-11 19:26:59 -0400 (Fri, 11 Jul 2008) | 2 lines +Changed paths: + M /python/trunk/Lib/test/test_asyncore.py + +Fixed test for asyncore. + + +----------------------------------- +[http://svn.python.org/view?rev=64945&view=rev r64945] | robert.schuppenies | 2008-07-14 04:42:18 -0400 (Mon, 14 Jul 2008) | 2 lines +Changed paths: + M /python/trunk/Lib/test/test_sys.py + +Fixed test failure on Win64 machines. + + +----------------------------------- +[http://svn.python.org/view?rev=64981&view=rev r64981] | mark.dickinson | 2008-07-15 17:55:23 -0400 (Tue, 15 Jul 2008) | 4 lines +Changed paths: + M /python/trunk/Lib/test/test_float.py + +Fix float.from_hex tests. It appears that Linux/ia64 doesn't like +computing 2.0**-1074 accurately. Using ldexp(1.0, -1074) should be +safer. + + +----------------------------------- +[http://svn.python.org/view?rev=65046&view=rev r65046] | georg.brandl | 2008-07-16 19:18:51 -0400 (Wed, 16 Jul 2008) | 2 lines +Changed paths: + M /python/trunk/Lib/test/test_bytes.py + +Byte items *can* be chars in 2.6. + + +----------------------------------- +[http://svn.python.org/view?rev=65059&view=rev r65059] | benjamin.peterson | 2008-07-17 08:57:22 -0400 (Thu, 17 Jul 2008) | 1 line +Changed paths: + M /python/trunk/Lib/test/test_threading.py + +try to fix test_threading on the Windows bot + +----------------------------------- +[http://svn.python.org/view?rev=65070&view=rev r65070] | bill.janssen | 2008-07-17 14:01:57 -0400 (Thu, 17 Jul 2008) | 1 line +Changed paths: + M /python/trunk/Lib/test/test_ssl.py + +catch socket.error errors in badCertTest + +----------------------------------- +[http://svn.python.org/view?rev=65093&view=rev r65093] | vinay.sajip | 2008-07-18 05:00:00 -0400 (Fri, 18 Jul 2008) | 1 line +Changed paths: + M /python/trunk/Lib/test/test_logging.py + +Issue #3389: Allow resolving dotted names for handlers in logging configuration files. Thanks to Philip Jenvey for the patch. + +----------------------------------- +[http://svn.python.org/view?rev=65097&view=rev r65097] | georg.brandl | 2008-07-18 06:20:59 -0400 (Fri, 18 Jul 2008) | 2 lines +Changed paths: + M /python/trunk/Lib/test/test_support.py + +Remove duplicate entry in __all__. + + +----------------------------------- +[http://svn.python.org/view?rev=65098&view=rev r65098] | georg.brandl | 2008-07-18 06:29:30 -0400 (Fri, 18 Jul 2008) | 2 lines +Changed paths: + M /python/trunk/Lib/test/test_robotparser.py + +Correct attribute name. + + +----------------------------------- +[http://svn.python.org/view?rev=65127&view=rev r65127] | raymond.hettinger | 2008-07-18 20:42:03 -0400 (Fri, 18 Jul 2008) | 1 line +Changed paths: + M /python/trunk/Lib/test/test_random.py + +Improve accuracy of gamma test function + +----------------------------------- +[http://svn.python.org/view?rev=65135&view=rev r65135] | georg.brandl | 2008-07-19 09:00:22 -0400 (Sat, 19 Jul 2008) | 3 lines +Changed paths: + M /python/trunk/Lib/test/pystone.py + +#3319: don't raise ZeroDivisionError if number of rounds is so +low that benchtime is zero. + + +----------------------------------- +[http://svn.python.org/view?rev=65159&view=rev r65159] | neal.norwitz | 2008-07-20 16:39:36 -0400 (Sun, 20 Jul 2008) | 1 line +Changed paths: + M /python/trunk/Lib/test/test_audioop.py + +Fix misspeeld method name (negative) + +----------------------------------- +[http://svn.python.org/view?rev=65178&view=rev r65178] | benjamin.peterson | 2008-07-21 18:05:34 -0400 (Mon, 21 Jul 2008) | 1 line +Changed paths: + M /python/trunk/Lib/test/test_scope.py + +don't use assert statement + +----------------------------------- +[http://svn.python.org/view?rev=65192&view=rev r65192] | benjamin.peterson | 2008-07-22 19:44:37 -0400 (Tue, 22 Jul 2008) | 1 line +Changed paths: + M /python/trunk/Lib/test/test_support.py + +remove unneeded import + +----------------------------------- +[http://svn.python.org/view?rev=65244&view=rev r65244] | antoine.pitrou | 2008-07-26 06:29:43 -0400 (Sat, 26 Jul 2008) | 3 lines +Changed paths: + M /python/trunk/Lib/test/test_locale.py + +try to fix most buildbot failures on test_locale + add a debug output for the solaris buildbot + + + +----------------------------------- +[http://svn.python.org/view?rev=65245&view=rev r65245] | antoine.pitrou | 2008-07-26 07:56:37 -0400 (Sat, 26 Jul 2008) | 3 lines +Changed paths: + M /python/trunk/Lib/test/test_locale.py + +Fix more buildbot failures on test_locale. + + + +----------------------------------- +[http://svn.python.org/view?rev=65248&view=rev r65248] | antoine.pitrou | 2008-07-26 09:49:13 -0400 (Sat, 26 Jul 2008) | 4 lines +Changed paths: + M /python/trunk/Lib/test/test_locale.py + +disable some failing tests in test_locale due to a bug in locale.py. +this should fix the failures on the solaris buildbot. + + + +----------------------------------- +[http://svn.python.org/view?rev=65258&view=rev r65258] | mark.dickinson | 2008-07-27 03:15:29 -0400 (Sun, 27 Jul 2008) | 4 lines +Changed paths: + M /python/trunk/Lib/test/test_math.py + +Remove math.sum tests related to overflow, special values, and behaviour +near the extremes of the floating-point range. (The behaviour of math.sum +should be regarded as undefined in these cases.) + + +----------------------------------- +[http://svn.python.org/view?rev=65312&view=rev r65312] | benjamin.peterson | 2008-07-30 15:35:27 -0400 (Wed, 30 Jul 2008) | 1 line +Changed paths: + M /python/trunk/Lib/test/exception_hierarchy.txt + +add BufferError to the exception hieracrchy + +----------------------------------- +[http://svn.python.org/view?rev=65318&view=rev r65318] | benjamin.peterson | 2008-07-30 19:49:28 -0400 (Wed, 30 Jul 2008) | 1 line +Changed paths: + M /python/trunk/Lib/test/exception_hierarchy.txt + +I mess up again; BufferError inherits StandardError + +----------------------------------- +[http://svn.python.org/view?rev=65326&view=rev r65326] | mark.dickinson | 2008-07-31 10:48:32 -0400 (Thu, 31 Jul 2008) | 2 lines +Changed paths: + M /python/trunk/Lib/test/test_math.py + +Rename testSum to testFsum and move it to proper place in test_math.py + + +----------------------------------- +[http://svn.python.org/view?rev=65340&view=rev r65340] | amaury.forgeotdarc | 2008-07-31 17:35:03 -0400 (Thu, 31 Jul 2008) | 2 lines +Changed paths: + M /python/trunk/Lib/test/test_exceptions.py + +Remove a dummy test that was checked in by mistake + + +----------------------------------- +[http://svn.python.org/view?rev=65536&view=rev r65536] | andrew.kuchling | 2008-08-04 21:00:57 -0400 (Mon, 04 Aug 2008) | 1 line +Changed paths: + M /python/trunk/Lib/test/test_mailbox.py + +Bug 3228: take a test from Niels Gustaebel's patch, and based on his patch, check for having os.stat available + +----------------------------------- +[http://svn.python.org/view?rev=65733&view=rev r65733] | antoine.pitrou | 2008-08-16 20:36:03 -0400 (Sat, 16 Aug 2008) | 3 lines +Changed paths: + M /python/trunk/Lib/test/test_ossaudiodev.py + +Make test_ossaudiodev work. + + + +----------------------------------- +[http://svn.python.org/view?rev=65768&view=rev r65768] | antoine.pitrou | 2008-08-17 10:43:41 -0400 (Sun, 17 Aug 2008) | 3 lines +Changed paths: + M /python/trunk/Lib/test/test_os.py + +backport [http://svn.python.org/view?rev=65723&view=rev r65723]: strengthen test_os.test_closerange + + + +----------------------------------- +[http://svn.python.org/view?rev=65773&view=rev r65773] | antoine.pitrou | 2008-08-17 13:01:49 -0400 (Sun, 17 Aug 2008) | 3 lines +Changed paths: + M /python/trunk/Lib/test/test_unicode.py + +#3556: test_raiseMemError consumes an insane amount of memory + + + +----------------------------------- +[http://svn.python.org/view?rev=65780&view=rev r65780] | antoine.pitrou | 2008-08-17 16:15:07 -0400 (Sun, 17 Aug 2008) | 3 lines +Changed paths: + M /python/trunk/Lib/test/test_os.py + +#3580: fix a failure in test_os + + + +----------------------------------- +[http://svn.python.org/view?rev=65829&view=rev r65829] | benjamin.peterson | 2008-08-18 14:39:57 -0400 (Mon, 18 Aug 2008) | 1 line +Changed paths: + M /python/trunk/Lib/test/test_ssl.py + +fix old API names in test_ssl + +----------------------------------- +[http://svn.python.org/view?rev=65885&view=rev r65885] | benjamin.peterson | 2008-08-19 18:06:11 -0400 (Tue, 19 Aug 2008) | 1 line +Changed paths: + M /python/trunk/Lib/test/test_parser.py + +check that the parser module can handle the new keyword syntax + +----------------------------------- +[http://svn.python.org/view?rev=65917&view=rev r65917] | hirokazu.yamamoto | 2008-08-20 12:15:28 -0400 (Wed, 20 Aug 2008) | 1 line +Changed paths: + M /python/trunk/Lib/test/test_os.py + +Reverted [http://svn.python.org/view?rev=65900&view=rev r65900]. See http://mail.python.org/pipermail/python-checkins/2008-August/073116.html + +----------------------------------- +[http://svn.python.org/view?rev=65986&view=rev r65986] | mark.hammond | 2008-08-22 20:59:14 -0400 (Fri, 22 Aug 2008) | 2 lines +Changed paths: + M /python/trunk/Lib/test/test_bytes.py + M /python/trunk/Lib/test/test_list.py + M /python/trunk/Lib/test/test_struct.py + +Fix bug 3625: test issues on 64bit windows. r=pitrou + + +----------------------------------- +[http://svn.python.org/view?rev=66014&view=rev r66014] | georg.brandl | 2008-08-24 14:11:07 -0400 (Sun, 24 Aug 2008) | 2 lines +Changed paths: + M /python/trunk/Lib/test/test_re.py + +#3654: fix duplicate test method name. Review by Benjamin P. + + +----------------------------------- +[http://svn.python.org/view?rev=66028&view=rev r66028] | neal.norwitz | 2008-08-24 23:52:40 -0400 (Sun, 24 Aug 2008) | 1 line +Changed paths: + M /python/trunk/Lib/test/test_smtplib.py + +Try to reduce the flakiness of this test + +----------------------------------- +[http://svn.python.org/view?rev=66162&view=rev r66162] | hirokazu.yamamoto | 2008-09-02 16:36:44 -0400 (Tue, 02 Sep 2008) | 2 lines +Changed paths: + M /python/trunk/Lib/test/test_asyncore.py + +Issue #3759: test_asyncore.py leaked handle. +Reviewed by Amaury Forgeot d'Arc + +----------------------------------- +[http://svn.python.org/view?rev=66235&view=rev r66235] | antoine.pitrou | 2008-09-05 18:04:54 -0400 (Fri, 05 Sep 2008) | 6 lines +Changed paths: + M /python/trunk/Lib/test/test_unicode.py + +#3601: test_unicode.test_raiseMemError fails in UCS4 + +Reviewed by Benjamin Peterson on IRC. + + + + +----------------------------------- +[http://svn.python.org/view?rev=66277&view=rev r66277] | benjamin.peterson | 2008-09-06 19:19:15 -0400 (Sat, 06 Sep 2008) | 1 line +Changed paths: + M /python/trunk/Lib/test/test_float.py + +fix missing module + +----------------------------------- +[http://svn.python.org/view?rev=66316&view=rev r66316] | hirokazu.yamamoto | 2008-09-08 19:03:47 -0400 (Mon, 08 Sep 2008) | 2 lines +Changed paths: + M /python/trunk/Lib/test/test_os.py + +Issue #3804: Added test for Issue #2222. +Reviewed by Benjamin Peterson. + +----------------------------------- +[http://svn.python.org/view?rev=66319&view=rev r66319] | hirokazu.yamamoto | 2008-09-08 19:38:42 -0400 (Mon, 08 Sep 2008) | 2 lines +Changed paths: + M /python/trunk/Lib/test/test_imp.py + +Issue #3806: LockTests in test_imp should be skipped when thread is not available. +Reviewed by Benjamin Peterson. + +----------------------------------- +[http://svn.python.org/view?rev=66367&view=rev r66367] | martin.v.loewis | 2008-09-10 14:43:49 -0400 (Wed, 10 Sep 2008) | 2 lines +Changed paths: + M /python/trunk/Lib/test/test_normalization.py + +Update to test Unicode 5.1. + + +----------------------------------- +[http://svn.python.org/view?rev=66369&view=rev r66369] | martin.v.loewis | 2008-09-10 15:16:35 -0400 (Wed, 10 Sep 2008) | 4 lines +Changed paths: + M /python/trunk/Lib/test/test_normalization.py + +Read unidata_version from unicodedata module. +Delete old NormalizationTest.txt if it doesn't match +unidata_version. + + +----------------------------------- +[http://svn.python.org/view?rev=66539&view=rev r66539] | hirokazu.yamamoto | 2008-09-21 07:44:23 -0400 (Sun, 21 Sep 2008) | 2 lines +Changed paths: + M /python/trunk/Lib/test/test_tarfile.py + +Issue #3838: TarFile object assigned to self.tar should be closed explicitly. +Reviewed by Lars Gust?\195?\164bel. + +----------------------------------- +[http://svn.python.org/view?rev=66569&view=rev r66569] | benjamin.peterson | 2008-09-23 16:43:09 -0400 (Tue, 23 Sep 2008) | 1 line +Changed paths: + M /python/trunk/Lib/test/test_atexit.py + +backport the atexit test for [http://svn.python.org/view?rev=66563&view=rev r66563] + +----------------------------------- +[http://svn.python.org/view?rev=66634&view=rev r66634] | benjamin.peterson | 2008-09-26 22:49:54 -0400 (Fri, 26 Sep 2008) | 7 lines +Changed paths: + M /python/trunk/Lib/test/test_ftplib.py + +give ftplib a real test suite + +A asyncore based mock ftp server is used to test the protocol. +This is all thanks to Giampaolo Rodola #3939 + +(Barry gave me permission to do this before final on IRC.) + + +----------------------------------- +[http://svn.python.org/view?rev=66673&view=rev r66673] | benjamin.peterson | 2008-09-28 16:57:21 -0400 (Sun, 28 Sep 2008) | 1 line +Changed paths: + M /python/trunk/Lib/test/test_ftplib.py + +merge in the fix for test_ftplib on some bots [reviewed by Georg] + +----------------------------------- +[http://svn.python.org/view?rev=66708&view=rev r66708] | andrew.macintyre | 2008-09-30 23:25:25 -0400 (Tue, 30 Sep 2008) | 9 lines +Changed paths: + M /python/trunk/Lib/test/test_array.py + +fix for issue 3862: test_array fails FreeBSD 7 amd64 + +FreeBSD 7's underlying malloc() is behaves differently to earlier versions +and seriously overcommits available memory on amd64. This may affect +other 64bit platforms in some circumstances, so the scale of the +problematic test is wound back. + +Patch by Mark Dickinson, reviewed by Martin von Loewis. + + From python-checkins at python.org Wed Oct 8 15:21:14 2008 From: python-checkins at python.org (andrew.kuchling) Date: Wed, 8 Oct 2008 15:21:14 +0200 (CEST) Subject: [Python-checkins] r66851 - python/branches/release26-maint/Doc/whatsnew/2.6.rst Message-ID: <20081008132114.BAF2C1E4002@bag.python.org> Author: andrew.kuchling Date: Wed Oct 8 15:21:14 2008 New Revision: 66851 Log: Note how bytes alias is expected to be used Modified: python/branches/release26-maint/Doc/whatsnew/2.6.rst Modified: python/branches/release26-maint/Doc/whatsnew/2.6.rst ============================================================================== --- python/branches/release26-maint/Doc/whatsnew/2.6.rst (original) +++ python/branches/release26-maint/Doc/whatsnew/2.6.rst Wed Oct 8 15:21:14 2008 @@ -949,6 +949,20 @@ Python 2.6 adds :class:`bytes` as a synonym for the :class:`str` type, and it also supports the ``b''`` notation. + +The 2.6 :class:`str` differs from 3.0's :class:`bytes` type in various +ways; most notably, the constructor is completely different. In 3.0, +``bytes([65, 66, 67])`` is 3 elements long, containing the bytes +representing ``ABC``; in 2.6, ``bytes([65, 66, 67])`` returns the +12-byte string representing the :func:`str` of the list. + +The primary use of :class:`bytes` in 2.6 will be to write tests of +object type such as ``isinstance(x, bytes)``. This will help the 2to3 +converter, which can't tell whether 2.x code intends strings to +contain either characters or 8-bit bytes; you can now +use either :class:`bytes` or :class:`str` to represent your intention +exactly, and the resulting code will also be correct in Python 3.0. + There's also a ``__future__`` import that causes all string literals to become Unicode strings. This means that ``\u`` escape sequences can be used to include Unicode characters:: From python-checkins at python.org Wed Oct 8 15:21:27 2008 From: python-checkins at python.org (andrew.kuchling) Date: Wed, 8 Oct 2008 15:21:27 +0200 (CEST) Subject: [Python-checkins] r66852 - python/trunk/Doc/whatsnew/2.6.rst Message-ID: <20081008132127.C90DE1E4002@bag.python.org> Author: andrew.kuchling Date: Wed Oct 8 15:21:27 2008 New Revision: 66852 Log: Note how bytes alias is expected to be used Modified: python/trunk/Doc/whatsnew/2.6.rst Modified: python/trunk/Doc/whatsnew/2.6.rst ============================================================================== --- python/trunk/Doc/whatsnew/2.6.rst (original) +++ python/trunk/Doc/whatsnew/2.6.rst Wed Oct 8 15:21:27 2008 @@ -949,6 +949,20 @@ Python 2.6 adds :class:`bytes` as a synonym for the :class:`str` type, and it also supports the ``b''`` notation. + +The 2.6 :class:`str` differs from 3.0's :class:`bytes` type in various +ways; most notably, the constructor is completely different. In 3.0, +``bytes([65, 66, 67])`` is 3 elements long, containing the bytes +representing ``ABC``; in 2.6, ``bytes([65, 66, 67])`` returns the +12-byte string representing the :func:`str` of the list. + +The primary use of :class:`bytes` in 2.6 will be to write tests of +object type such as ``isinstance(x, bytes)``. This will help the 2to3 +converter, which can't tell whether 2.x code intends strings to +contain either characters or 8-bit bytes; you can now +use either :class:`bytes` or :class:`str` to represent your intention +exactly, and the resulting code will also be correct in Python 3.0. + There's also a ``__future__`` import that causes all string literals to become Unicode strings. This means that ``\u`` escape sequences can be used to include Unicode characters:: From python-checkins at python.org Wed Oct 8 19:20:20 2008 From: python-checkins at python.org (georg.brandl) Date: Wed, 8 Oct 2008 19:20:20 +0200 (CEST) Subject: [Python-checkins] r66854 - python/trunk/Doc/library/sqlite3.rst Message-ID: <20081008172020.7699C1E4002@bag.python.org> Author: georg.brandl Date: Wed Oct 8 19:20:20 2008 New Revision: 66854 Log: #4059: patch up some sqlite docs. Modified: python/trunk/Doc/library/sqlite3.rst Modified: python/trunk/Doc/library/sqlite3.rst ============================================================================== --- python/trunk/Doc/library/sqlite3.rst (original) +++ python/trunk/Doc/library/sqlite3.rst Wed Oct 8 19:20:20 2008 @@ -27,7 +27,7 @@ You can also supply the special name ``:memory:`` to create a database in RAM. Once you have a :class:`Connection`, you can create a :class:`Cursor` object -and call its :meth:`execute` method to perform SQL commands:: +and call its :meth:`~Cursor.execute` method to perform SQL commands:: c = conn.cursor() @@ -52,7 +52,7 @@ Instead, use the DB-API's parameter substitution. Put ``?`` as a placeholder wherever you want to use a value, and then provide a tuple of values as the -second argument to the cursor's :meth:`execute` method. (Other database modules +second argument to the cursor's :meth:`~Cursor.execute` method. (Other database modules may use a different placeholder, such as ``%s`` or ``:1``.) For example:: # Never do this -- insecure! @@ -71,8 +71,8 @@ c.execute('insert into stocks values (?,?,?,?,?)', t) To retrieve data after executing a SELECT statement, you can either treat the -cursor as an :term:`iterator`, call the cursor's :meth:`fetchone` method to -retrieve a single matching row, or call :meth:`fetchall` to get a list of the +cursor as an :term:`iterator`, call the cursor's :meth:`~Cursor.fetchone` method to +retrieve a single matching row, or call :meth:`~Cursor.fetchall` to get a list of the matching rows. This example uses the iterator form:: @@ -130,7 +130,7 @@ returns. It will look for a string formed [mytype] in there, and then decide that 'mytype' is the type of the column. It will try to find an entry of 'mytype' in the converters dictionary and then use the converter function found - there to return the value. The column name found in :attr:`cursor.description` + there to return the value. The column name found in :attr:`Cursor.description` is only the first word of the column name, i. e. if you use something like ``'as "x [datetime]"'`` in your SQL, then we will parse out everything until the first blank for the column name: the column name would simply be "x". @@ -217,11 +217,13 @@ Connection Objects ------------------ -A :class:`Connection` instance has the following attributes and methods: +.. class:: Connection + + A SQLite database connection has the following attributes and methods: .. attribute:: Connection.isolation_level - Get or set the current isolation level. None for autocommit mode or one of + Get or set the current isolation level. :const:`None` for autocommit mode or one of "DEFERRED", "IMMEDIATE" or "EXLUSIVE". See section :ref:`sqlite3-controlling-transactions` for a more detailed explanation. @@ -236,7 +238,7 @@ .. method:: Connection.commit() This method commits the current transaction. If you don't call this method, - anything you did since the last call to commit() is not visible from from + anything you did since the last call to ``commit()`` is not visible from from other database connections. If you wonder why you don't see the data you've written to the database, please check you didn't forget to call this method. @@ -386,9 +388,9 @@ .. attribute:: Connection.text_factory - Using this attribute you can control what objects are returned for the TEXT data - type. By default, this attribute is set to :class:`unicode` and the - :mod:`sqlite3` module will return Unicode objects for TEXT. If you want to + Using this attribute you can control what objects are returned for the ``TEXT`` + data type. By default, this attribute is set to :class:`unicode` and the + :mod:`sqlite3` module will return Unicode objects for ``TEXT``. If you want to return bytestrings instead, you can set it to :class:`str`. For efficiency reasons, there's also a way to return Unicode objects only for @@ -435,8 +437,9 @@ Cursor Objects -------------- -A :class:`Cursor` instance has the following attributes and methods: +.. class:: Cursor + A SQLite database cursor has the following attributes and methods: .. method:: Cursor.execute(sql, [parameters]) @@ -475,7 +478,7 @@ .. method:: Cursor.executescript(sql_script) This is a nonstandard convenience method for executing multiple SQL statements - at once. It issues a COMMIT statement first, then executes the SQL script it + at once. It issues a ``COMMIT`` statement first, then executes the SQL script it gets as a parameter. *sql_script* can be a bytestring or a Unicode string. @@ -488,7 +491,7 @@ .. method:: Cursor.fetchone() Fetches the next row of a query result set, returning a single sequence, - or ``None`` when no more data is available. + or :const:`None` when no more data is available. .. method:: Cursor.fetchmany([size=cursor.arraysize]) @@ -527,8 +530,8 @@ into :attr:`rowcount`. As required by the Python DB API Spec, the :attr:`rowcount` attribute "is -1 in - case no executeXX() has been performed on the cursor or the rowcount of the last - operation is not determinable by the interface". + case no ``executeXX()`` has been performed on the cursor or the rowcount of the + last operation is not determinable by the interface". This includes ``SELECT`` statements because we cannot determine the number of rows a query produced until all rows were fetched. @@ -540,6 +543,81 @@ method. For operations other than ``INSERT`` or when :meth:`executemany` is called, :attr:`lastrowid` is set to :const:`None`. +.. attribute:: Cursor.description + + This read-only attribute provides the column names of the last query. To + remain compatible with the Python DB API, it returns a 7-tuple for each + column where the last six items of each tuple are :const:`None`. + + It is set for ``SELECT`` statements without any matching rows as well. + +.. _sqlite3-row-objects: + +Row Objects +----------- + +.. class:: Row + + A :class:`Row` instance serves as a highly optimized + :attr:`~Connection.row_factory` for :class:`Connection` objects. + It tries to mimic a tuple in most of its features. + + It supports mapping access by column name and index, iteration, + representation, equality testing and :func:`len`. + + If two :class:`Row` objects have exactly the same columns and their + members are equal, they compare equal. + + .. versionchanged:: 2.6 + Added iteration and equality (hashability). + + .. method:: keys + + This method returns a tuple of column names. Immediately after a query, + it is the first member of each tuple in :attr:`Cursor.description`. + + .. versionadded:: 2.6 + +Let's assume we initialize a table as in the example given above:: + + conn = sqlite3.connect(":memory:") + c = conn.cursor() + c.execute('''create table stocks + (date text, trans text, symbol text, + qty real, price real)''') + c.execute("""insert into stocks + values ('2006-01-05','BUY','RHAT',100,35.14)""") + conn.commit() + c.close() + +Now we plug :class:`Row` in:: + + >>> conn.row_factory = sqlite3.Row + >>> c = conn.cursor() + >>> c.execute('select * from stocks') + + >>> r = c.fetchone() + >>> type(r) + + >>> r + (u'2006-01-05', u'BUY', u'RHAT', 100.0, 35.140000000000001) + >>> len(r) + 5 + >>> r[2] + u'RHAT' + >>> r.keys() + ['date', 'trans', 'symbol', 'qty', 'price'] + >>> r['qty'] + 100.0 + >>> for member in r: print member + ... + 2006-01-05 + BUY + RHAT + 100.0 + 35.14 + + .. _sqlite3-types: SQLite and Python types @@ -549,43 +627,46 @@ Introduction ^^^^^^^^^^^^ -SQLite natively supports the following types: NULL, INTEGER, REAL, TEXT, BLOB. +SQLite natively supports the following types: ``NULL``, ``INTEGER``, +``REAL``, ``TEXT``, ``BLOB``. The following Python types can thus be sent to SQLite without any problem: -+------------------------+-------------+ -| Python type | SQLite type | -+========================+=============+ -| ``None`` | NULL | -+------------------------+-------------+ -| ``int`` | INTEGER | -+------------------------+-------------+ -| ``long`` | INTEGER | -+------------------------+-------------+ -| ``float`` | REAL | -+------------------------+-------------+ -| ``str (UTF8-encoded)`` | TEXT | -+------------------------+-------------+ -| ``unicode`` | TEXT | -+------------------------+-------------+ -| ``buffer`` | BLOB | -+------------------------+-------------+ ++-----------------------------+-------------+ +| Python type | SQLite type | ++=============================+=============+ +| :const:`None` | ``NULL`` | ++-----------------------------+-------------+ +| :class:`int` | ``INTEGER`` | ++-----------------------------+-------------+ +| :class:`long` | ``INTEGER`` | ++-----------------------------+-------------+ +| :class:`float` | ``REAL`` | ++-----------------------------+-------------+ +| :class:`str` (UTF8-encoded) | ``TEXT`` | ++-----------------------------+-------------+ +| :class:`unicode` | ``TEXT`` | ++-----------------------------+-------------+ +| :class:`buffer` | ``BLOB`` | ++-----------------------------+-------------+ This is how SQLite types are converted to Python types by default: -+-------------+---------------------------------------------+ -| SQLite type | Python type | -+=============+=============================================+ -| ``NULL`` | None | -+-------------+---------------------------------------------+ -| ``INTEGER`` | int or long, depending on size | -+-------------+---------------------------------------------+ -| ``REAL`` | float | -+-------------+---------------------------------------------+ -| ``TEXT`` | depends on text_factory, unicode by default | -+-------------+---------------------------------------------+ -| ``BLOB`` | buffer | -+-------------+---------------------------------------------+ ++-------------+----------------------------------------------+ +| SQLite type | Python type | ++=============+==============================================+ +| ``NULL`` | :const:`None` | ++-------------+----------------------------------------------+ +| ``INTEGER`` | :class:`int` or :class:`long`, | +| | depending on size | ++-------------+----------------------------------------------+ +| ``REAL`` | :class:`float` | ++-------------+----------------------------------------------+ +| ``TEXT`` | depends on :attr:`~Connection.text_factory`, | +| | :class:`unicode` by default | ++-------------+----------------------------------------------+ +| ``BLOB`` | :class:`buffer` | ++-------------+----------------------------------------------+ The type system of the :mod:`sqlite3` module is extensible in two ways: you can store additional Python types in a SQLite database via object adaptation, and @@ -713,9 +794,10 @@ ------------------------ By default, the :mod:`sqlite3` module opens transactions implicitly before a -Data Modification Language (DML) statement (i.e. INSERT/UPDATE/DELETE/REPLACE), -and commits transactions implicitly before a non-DML, non-query statement (i. e. -anything other than SELECT/INSERT/UPDATE/DELETE/REPLACE). +Data Modification Language (DML) statement (i.e. +``INSERT``/``UPDATE``/``DELETE``/``REPLACE``), and commits transactions +implicitly before a non-DML, non-query statement (i. e. +anything other than ``SELECT`` or the aforementioned). So if you are within a transaction and issue a command like ``CREATE TABLE ...``, ``VACUUM``, ``PRAGMA``, the :mod:`sqlite3` module will commit implicitly @@ -724,7 +806,7 @@ is that pysqlite needs to keep track of the transaction state (if a transaction is active or not). -You can control which kind of "BEGIN" statements pysqlite implicitly executes +You can control which kind of ``BEGIN`` statements pysqlite implicitly executes (or none at all) via the *isolation_level* parameter to the :func:`connect` call, or via the :attr:`isolation_level` property of connections. @@ -748,7 +830,7 @@ be written more concisely because you don't have to create the (often superfluous) :class:`Cursor` objects explicitly. Instead, the :class:`Cursor` objects are created implicitly and these shortcut methods return the cursor -objects. This way, you can execute a SELECT statement and iterate over it +objects. This way, you can execute a ``SELECT`` statement and iterate over it directly using only a single call on the :class:`Connection` object. .. literalinclude:: ../includes/sqlite3/shortcut_methods.py From python-checkins at python.org Wed Oct 8 19:30:56 2008 From: python-checkins at python.org (georg.brandl) Date: Wed, 8 Oct 2008 19:30:56 +0200 (CEST) Subject: [Python-checkins] r66855 - python/trunk/Doc/whatsnew/2.6.rst Message-ID: <20081008173056.61BE71E4014@bag.python.org> Author: georg.brandl Date: Wed Oct 8 19:30:55 2008 New Revision: 66855 Log: #4058: fix some whatsnew markup. Modified: python/trunk/Doc/whatsnew/2.6.rst Modified: python/trunk/Doc/whatsnew/2.6.rst ============================================================================== --- python/trunk/Doc/whatsnew/2.6.rst (original) +++ python/trunk/Doc/whatsnew/2.6.rst Wed Oct 8 19:30:55 2008 @@ -662,33 +662,33 @@ from multiprocessing import Pool, Manager def factorial(N, dictionary): - "Compute a factorial." - # Calculate the result - fact = 1L - for i in range(1, N+1): - fact = fact * i + "Compute a factorial." + # Calculate the result + fact = 1L + for i in range(1, N+1): + fact = fact * i # Store result in dictionary - dictionary[N] = fact + dictionary[N] = fact if __name__ == '__main__': - p = Pool(5) - mgr = Manager() - d = mgr.dict() # Create shared dictionary - - # Run tasks using the pool - for N in range(1, 1000, 10): - p.apply_async(factorial, (N, d)) - - # Mark pool as closed -- no more tasks can be added. - p.close() - - # Wait for tasks to exit - p.join() - - # Output results - for k, v in sorted(d.items()): - print k, v + p = Pool(5) + mgr = Manager() + d = mgr.dict() # Create shared dictionary + + # Run tasks using the pool + for N in range(1, 1000, 10): + p.apply_async(factorial, (N, d)) + + # Mark pool as closed -- no more tasks can be added. + p.close() + + # Wait for tasks to exit + p.join() + + # Output results + for k, v in sorted(d.items()): + print k, v This will produce the output:: @@ -723,32 +723,33 @@ treats the string as a template and takes the arguments to be formatted. The formatting template uses curly brackets (`{`, `}`) as special characters:: - # Substitute positional argument 0 into the string. - "User ID: {0}".format("root") -> "User ID: root" - - # Use the named keyword arguments - 'User ID: {uid} Last seen: {last_login}'.format( - uid='root', - last_login = '5 Mar 2008 07:20') -> - 'User ID: root Last seen: 5 Mar 2008 07:20' + >>> # Substitute positional argument 0 into the string. + >>> "User ID: {0}".format("root") + 'User ID: root' + >>> # Use the named keyword arguments + >>> "User ID: {uid} Last seen: {last_login}".format( + ... uid="root", + ... last_login = "5 Mar 2008 07:20") + 'User ID: root Last seen: 5 Mar 2008 07:20' Curly brackets can be escaped by doubling them:: - format("Empty dict: {{}}") -> "Empty dict: {}" + >>> format("Empty dict: {{}}") + "Empty dict: {}" Field names can be integers indicating positional arguments, such as ``{0}``, ``{1}``, etc. or names of keyword arguments. You can also supply compound field names that read attributes or access dictionary keys:: - import sys - 'Platform: {0.platform}\nPython version: {0.version}'.format(sys) -> - 'Platform: darwin\n - Python version: 2.6a1+ (trunk:61261M, Mar 5 2008, 20:29:41) \n - [GCC 4.0.1 (Apple Computer, Inc. build 5367)]' - - import mimetypes - 'Content-type: {0[.mp4]}'.format(mimetypes.types_map) -> - 'Content-type: video/mp4' + >>> import sys + >>> print 'Platform: {0.platform}\nPython version: {0.version}'.format(sys) + Platform: darwin + Python version: 2.6a1+ (trunk:61261M, Mar 5 2008, 20:29:41) + [GCC 4.0.1 (Apple Computer, Inc. build 5367)]' + + >>> import mimetypes + >>> 'Content-type: {0[.mp4]}'.format(mimetypes.types_map) + 'Content-type: video/mp4' Note that when using dictionary-style notation such as ``[.mp4]``, you don't need to put any quotation marks around the string; it will look @@ -760,30 +761,25 @@ resulting string. The precise formatting used is also controllable by adding a colon followed by a format specifier. For example:: - # Field 0: left justify, pad to 15 characters - # Field 1: right justify, pad to 6 characters - fmt = '{0:15} ${1:>6}' - - fmt.format('Registration', 35) -> - 'Registration $ 35' - - fmt.format('Tutorial', 50) -> - 'Tutorial $ 50' - - fmt.format('Banquet', 125) -> - 'Banquet $ 125' + >>> # Field 0: left justify, pad to 15 characters + >>> # Field 1: right justify, pad to 6 characters + >>> fmt = '{0:15} ${1:>6}' + >>> fmt.format('Registration', 35) + 'Registration $ 35' + >>> fmt.format('Tutorial', 50) + 'Tutorial $ 50' + >>> fmt.format('Banquet', 125) + 'Banquet $ 125' Format specifiers can reference other fields through nesting:: - fmt = '{0:{1}}' - - width = 15 - fmt.format('Invoice #1234', width) -> - 'Invoice #1234 ' - - width = 35 - fmt.format('Invoice #1234', width) -> - 'Invoice #1234 ' + >>> fmt = '{0:{1}}' + >>> width = 15 + >>> fmt.format('Invoice #1234', width) + 'Invoice #1234 ' + >>> width = 35 + >>> fmt.format('Invoice #1234', width) + 'Invoice #1234 ' The alignment of a field within the desired width can be specified: @@ -798,7 +794,7 @@ Format specifiers can also include a presentation type, which controls how the value is formatted. For example, floating-point numbers -can be formatted as a general number or in exponential notation: +can be formatted as a general number or in exponential notation:: >>> '{0:g}'.format(3.75) '3.75' @@ -806,25 +802,27 @@ '3.750000e+00' A variety of presentation types are available. Consult the 2.6 -documentation for a :ref:`complete list `; here's a sample:: +documentation for a :ref:`complete list `; here's a sample: - 'b' - Binary. Outputs the number in base 2. - 'c' - Character. Converts the integer to the corresponding - Unicode character before printing. - 'd' - Decimal Integer. Outputs the number in base 10. - 'o' - Octal format. Outputs the number in base 8. - 'x' - Hex format. Outputs the number in base 16, using lower- - case letters for the digits above 9. - 'e' - Exponent notation. Prints the number in scientific - notation using the letter 'e' to indicate the exponent. - 'g' - General format. This prints the number as a fixed-point - number, unless the number is too large, in which case - it switches to 'e' exponent notation. - 'n' - Number. This is the same as 'g' (for floats) or 'd' (for - integers), except that it uses the current locale setting to - insert the appropriate number separator characters. - '%' - Percentage. Multiplies the number by 100 and displays - in fixed ('f') format, followed by a percent sign. +===== ======================================================================== +``b`` Binary. Outputs the number in base 2. +``c`` Character. Converts the integer to the corresponding Unicode character + before printing. +``d`` Decimal Integer. Outputs the number in base 10. +``o`` Octal format. Outputs the number in base 8. +``x`` Hex format. Outputs the number in base 16, using lower-case letters for + the digits above 9. +``e`` Exponent notation. Prints the number in scientific notation using the + letter 'e' to indicate the exponent. +``g`` General format. This prints the number as a fixed-point number, unless + the number is too large, in which case it switches to 'e' exponent + notation. +``n`` Number. This is the same as 'g' (for floats) or 'd' (for integers), + except that it uses the current locale setting to insert the appropriate + number separator characters. +``%`` Percentage. Multiplies the number by 100 and displays in fixed ('f') + format, followed by a percent sign. +===== ======================================================================== Classes and types can define a :meth:`__format__` method to control how they're formatted. It receives a single argument, the format specifier:: @@ -865,13 +863,14 @@ Python 2.6 has a ``__future__`` import that removes ``print`` as language syntax, letting you use the functional form instead. For example:: - from __future__ import print_function - print('# of entries', len(dictionary), file=sys.stderr) + >>> from __future__ import print_function + >>> print('# of entries', len(dictionary), file=sys.stderr) The signature of the new function is:: def print(*args, sep=' ', end='\n', file=None) + The parameters are: * *args*: positional arguments whose values will be printed out. @@ -1002,6 +1001,8 @@ and some of the methods of lists, such as :meth:`append`, :meth:`pop`, and :meth:`reverse`. +:: + >>> b = bytearray('ABC') >>> b.append('d') >>> b.append(ord('e')) @@ -1224,8 +1225,8 @@ now write:: def func(d): - if not isinstance(d, collections.MutableMapping): - raise ValueError("Mapping object expected, not %r" % d) + if not isinstance(d, collections.MutableMapping): + raise ValueError("Mapping object expected, not %r" % d) Don't feel that you must now begin writing lots of checks as in the above example. Python has a strong tradition of duck-typing, where @@ -1237,22 +1238,22 @@ You can write your own ABCs by using ``abc.ABCMeta`` as the metaclass in a class definition:: - from abc import ABCMeta, abstractmethod + from abc import ABCMeta, abstractmethod - class Drawable(): - __metaclass__ = ABCMeta + class Drawable(): + __metaclass__ = ABCMeta - @abstractmethod - def draw(self, x, y, scale=1.0): - pass + @abstractmethod + def draw(self, x, y, scale=1.0): + pass - def draw_doubled(self, x, y): - self.draw(x, y, scale=2.0) + def draw_doubled(self, x, y): + self.draw(x, y, scale=2.0) - class Square(Drawable): - def draw(self, x, y, scale): - ... + class Square(Drawable): + def draw(self, x, y, scale): + ... In the :class:`Drawable` ABC above, the :meth:`draw_doubled` method @@ -1272,7 +1273,7 @@ >>> class Circle(Drawable): ... pass ... - >>> c=Circle() + >>> c = Circle() Traceback (most recent call last): File "", line 1, in TypeError: Can't instantiate abstract class Circle with abstract methods draw @@ -1331,7 +1332,7 @@ The :func:`int` and :func:`long` built-ins will now accept the "0o" and "0b" prefixes when base-8 or base-2 are requested, or when the *base* argument is zero (signalling that the base used should be -determined from the string): +determined from the string):: >>> int ('0o52', 0) 42 @@ -1504,7 +1505,7 @@ (Contributed by Alexander Belopolsky; :issue:`1686487`.) It's also become legal to provide keyword arguments after a ``*args`` argument - to a function call. + to a function call. :: >>> def f(*args, **kw): ... print args, kw @@ -1545,17 +1546,17 @@ property. You would use them like this:: class C(object): - @property - def x(self): - return self._x - - @x.setter - def x(self, value): - self._x = value - - @x.deleter - def x(self): - del self._x + @property + def x(self): + return self._x + + @x.setter + def x(self, value): + self._x = value + + @x.deleter + def x(self): + del self._x class D(C): @C.x.getter @@ -1878,8 +1879,8 @@ >>> var_type = collections.namedtuple('variable', ... 'id name type size') - # Names are separated by spaces or commas. - # 'id, name, type, size' would also work. + >>> # Names are separated by spaces or commas. + >>> # 'id, name, type, size' would also work. >>> var_type._fields ('id', 'name', 'type', 'size') @@ -1929,11 +1930,13 @@ * A new window method in the :mod:`curses` module, :meth:`chgat`, changes the display attributes for a certain number of - characters on a single line. (Contributed by Fabian Kreutz.) :: + characters on a single line. (Contributed by Fabian Kreutz.) + + :: # Boldface text starting at y=0,x=21 # and affecting the rest of the line. - stdscr.chgat(0,21, curses.A_BOLD) + stdscr.chgat(0, 21, curses.A_BOLD) The :class:`Textbox` class in the :mod:`curses.textpad` module now supports editing in insert mode as well as overwrite mode. @@ -1999,8 +2002,8 @@ order, and returns a new generator that returns the contents of all the iterators, also in sorted order. For example:: - heapq.merge([1, 3, 5, 9], [2, 8, 16]) -> - [1, 2, 3, 5, 8, 9, 16] + >>> list(heapq.merge([1, 3, 5, 9], [2, 8, 16])) + [1, 2, 3, 5, 8, 9, 16] Another new function, ``heappushpop(heap, item)``, pushes *item* onto *heap*, then pops off and returns the smallest item. @@ -2034,57 +2037,55 @@ each of the elements; if some of the iterables are shorter than others, the missing values are set to *fillvalue*. For example:: - itertools.izip_longest([1,2,3], [1,2,3,4,5]) -> - (1, 1), (2, 2), (3, 3), (None, 4), (None, 5) + >>> tuple(itertools.izip_longest([1,2,3], [1,2,3,4,5])) + ((1, 1), (2, 2), (3, 3), (None, 4), (None, 5)) ``product(iter1, iter2, ..., [repeat=N])`` returns the Cartesian product of the supplied iterables, a set of tuples containing every possible combination of the elements returned from each iterable. :: - itertools.product([1,2,3], [4,5,6]) -> - (1, 4), (1, 5), (1, 6), - (2, 4), (2, 5), (2, 6), - (3, 4), (3, 5), (3, 6) + >>> list(itertools.product([1,2,3], [4,5,6])) + [(1, 4), (1, 5), (1, 6), + (2, 4), (2, 5), (2, 6), + (3, 4), (3, 5), (3, 6)] The optional *repeat* keyword argument is used for taking the product of an iterable or a set of iterables with themselves, repeated *N* times. With a single iterable argument, *N*-tuples are returned:: - itertools.product([1,2], repeat=3) -> - (1, 1, 1), (1, 1, 2), (1, 2, 1), (1, 2, 2), - (2, 1, 1), (2, 1, 2), (2, 2, 1), (2, 2, 2) + >>> list(itertools.product([1,2], repeat=3)) + [(1, 1, 1), (1, 1, 2), (1, 2, 1), (1, 2, 2), + (2, 1, 1), (2, 1, 2), (2, 2, 1), (2, 2, 2)] With two iterables, *2N*-tuples are returned. :: - itertools.product([1,2], [3,4], repeat=2) -> - (1, 3, 1, 3), (1, 3, 1, 4), (1, 3, 2, 3), (1, 3, 2, 4), - (1, 4, 1, 3), (1, 4, 1, 4), (1, 4, 2, 3), (1, 4, 2, 4), - (2, 3, 1, 3), (2, 3, 1, 4), (2, 3, 2, 3), (2, 3, 2, 4), - (2, 4, 1, 3), (2, 4, 1, 4), (2, 4, 2, 3), (2, 4, 2, 4) + >>> list(itertools.product([1,2], [3,4], repeat=2)) + [(1, 3, 1, 3), (1, 3, 1, 4), (1, 3, 2, 3), (1, 3, 2, 4), + (1, 4, 1, 3), (1, 4, 1, 4), (1, 4, 2, 3), (1, 4, 2, 4), + (2, 3, 1, 3), (2, 3, 1, 4), (2, 3, 2, 3), (2, 3, 2, 4), + (2, 4, 1, 3), (2, 4, 1, 4), (2, 4, 2, 3), (2, 4, 2, 4)] ``combinations(iterable, r)`` returns sub-sequences of length *r* from the elements of *iterable*. :: - itertools.combinations('123', 2) -> - ('1', '2'), ('1', '3'), ('2', '3') - - itertools.combinations('123', 3) -> - ('1', '2', '3') - - itertools.combinations('1234', 3) -> - ('1', '2', '3'), ('1', '2', '4'), ('1', '3', '4'), - ('2', '3', '4') + >>> list(itertools.combinations('123', 2)) + [('1', '2'), ('1', '3'), ('2', '3')] + >>> list(itertools.combinations('123', 3)) + [('1', '2', '3')] + >>> list(itertools.combinations('1234', 3)) + [('1', '2', '3'), ('1', '2', '4'), + ('1', '3', '4'), ('2', '3', '4')] ``permutations(iter[, r])`` returns all the permutations of length *r* of the iterable's elements. If *r* is not specified, it will default to the number of elements produced by the iterable. :: - itertools.permutations([1,2,3,4], 2) -> - (1, 2), (1, 3), (1, 4), - (2, 1), (2, 3), (2, 4), - (3, 1), (3, 2), (3, 4), - (4, 1), (4, 2), (4, 3) + >>> list(itertools.permutations([1,2,3,4], 2)) + [(1, 2), (1, 3), (1, 4), + (2, 1), (2, 3), (2, 4), + (3, 1), (3, 2), (3, 4), + (4, 1), (4, 2), (4, 3)] ``itertools.chain(*iterables)`` is an existing function in :mod:`itertools` that gained a new constructor in Python 2.6. @@ -2093,8 +2094,8 @@ then return all the elements of the first iterable, then all the elements of the second, and so on. :: - chain.from_iterable([[1,2,3], [4,5,6]]) -> - 1, 2, 3, 4, 5, 6 + >>> list(itertools.chain.from_iterable([[1,2,3], [4,5,6]])) + [1, 2, 3, 4, 5, 6] (All contributed by Raymond Hettinger.) @@ -2265,16 +2266,15 @@ with an installed Python package. For example:: >>> import pkgutil - >>> pkgutil.get_data('test', 'exception_hierarchy.txt') - 'BaseException + >>> print pkgutil.get_data('test', 'exception_hierarchy.txt') + BaseException +-- SystemExit +-- KeyboardInterrupt +-- GeneratorExit +-- Exception +-- StopIteration +-- StandardError - ...' - >>> + ... (Contributed by Paul Moore; :issue:`2439`.) @@ -2548,9 +2548,9 @@ with test_support.check_warnings() as wrec: warnings.simplefilter("always") - ... code that triggers a warning ... + # ... code that triggers a warning ... assert str(wrec.message) == "function is outdated" - assert len(wrec.warnings) == 1, "Multiple warnings raised" + assert len(wrec.warnings) == 1, "Multiple warnings raised" (Contributed by Brett Cannon.) @@ -2724,7 +2724,7 @@ t = ast.parse(""" d = {} for i in 'abcdefghijklm': - d[i + i] = ord(i) - ord('a') + 1 + d[i + i] = ord(i) - ord('a') + 1 print d """) print ast.dump(t) @@ -2733,32 +2733,32 @@ Module(body=[ Assign(targets=[ - Name(id='d', ctx=Store()) + Name(id='d', ctx=Store()) ], value=Dict(keys=[], values=[])) For(target=Name(id='i', ctx=Store()), - iter=Str(s='abcdefghijklm'), body=[ - Assign(targets=[ - Subscript(value= - Name(id='d', ctx=Load()), - slice= - Index(value= - BinOp(left=Name(id='i', ctx=Load()), op=Add(), - right=Name(id='i', ctx=Load()))), ctx=Store()) - ], value= - BinOp(left= - BinOp(left= - Call(func= - Name(id='ord', ctx=Load()), args=[ - Name(id='i', ctx=Load()) - ], keywords=[], starargs=None, kwargs=None), - op=Sub(), right=Call(func= - Name(id='ord', ctx=Load()), args=[ - Str(s='a') - ], keywords=[], starargs=None, kwargs=None)), - op=Add(), right=Num(n=1))) - ], orelse=[]) - Print(dest=None, values=[ - Name(id='d', ctx=Load()) + iter=Str(s='abcdefghijklm'), body=[ + Assign(targets=[ + Subscript(value= + Name(id='d', ctx=Load()), + slice= + Index(value= + BinOp(left=Name(id='i', ctx=Load()), op=Add(), + right=Name(id='i', ctx=Load()))), ctx=Store()) + ], value= + BinOp(left= + BinOp(left= + Call(func= + Name(id='ord', ctx=Load()), args=[ + Name(id='i', ctx=Load()) + ], keywords=[], starargs=None, kwargs=None), + op=Sub(), right=Call(func= + Name(id='ord', ctx=Load()), args=[ + Str(s='a') + ], keywords=[], starargs=None, kwargs=None)), + op=Add(), right=Num(n=1))) + ], orelse=[]) + Print(dest=None, values=[ + Name(id='d', ctx=Load()) ], nl=True) ]) @@ -2862,8 +2862,8 @@ # Create data structure data_struct = dict(lastAccessed=datetime.datetime.now(), - version=1, - categories=('Personal','Shared','Private')) + version=1, + categories=('Personal','Shared','Private')) # Create string containing XML. plist_str = plistlib.writePlistToString(data_struct) From python-checkins at python.org Wed Oct 8 20:47:18 2008 From: python-checkins at python.org (georg.brandl) Date: Wed, 8 Oct 2008 20:47:18 +0200 (CEST) Subject: [Python-checkins] r66856 - in python/trunk: Lib/test/test_bisect.py Misc/NEWS Modules/_bisectmodule.c Message-ID: <20081008184718.4D40D1E4002@bag.python.org> Author: georg.brandl Date: Wed Oct 8 20:47:17 2008 New Revision: 66856 Log: #3935: properly support list subclasses in the C impl. of bisect. Patch reviewed by Raymond. Modified: python/trunk/Lib/test/test_bisect.py python/trunk/Misc/NEWS python/trunk/Modules/_bisectmodule.c Modified: python/trunk/Lib/test/test_bisect.py ============================================================================== --- python/trunk/Lib/test/test_bisect.py (original) +++ python/trunk/Lib/test/test_bisect.py Wed Oct 8 20:47:17 2008 @@ -196,6 +196,17 @@ def test_backcompatibility(self): self.assertEqual(self.module.insort, self.module.insort_right) + def test_listDerived(self): + class List(list): + data = [] + def insert(self, index, item): + self.data.insert(index, item) + + lst = List() + self.module.insort_left(lst, 10) + self.module.insort_right(lst, 5) + self.assertEqual([5, 10], lst.data) + class TestInsortPython(TestInsort): module = py_bisect Modified: python/trunk/Misc/NEWS ============================================================================== --- python/trunk/Misc/NEWS (original) +++ python/trunk/Misc/NEWS Wed Oct 8 20:47:17 2008 @@ -20,6 +20,8 @@ Library ------- +- Issue #3935: Properly support list subclasses in bisect's C implementation. + - Issue #4014: Don't claim that Python has an Alpha release status, in addition to claiming it is Mature. Modified: python/trunk/Modules/_bisectmodule.c ============================================================================== --- python/trunk/Modules/_bisectmodule.c (original) +++ python/trunk/Modules/_bisectmodule.c Wed Oct 8 20:47:17 2008 @@ -82,7 +82,7 @@ index = internal_bisect_right(list, item, lo, hi); if (index < 0) return NULL; - if (PyList_Check(list)) { + if (PyList_CheckExact(list)) { if (PyList_Insert(list, index, item) < 0) return NULL; } else { @@ -183,7 +183,7 @@ index = internal_bisect_left(list, item, lo, hi); if (index < 0) return NULL; - if (PyList_Check(list)) { + if (PyList_CheckExact(list)) { if (PyList_Insert(list, index, item) < 0) return NULL; } else { From python-checkins at python.org Wed Oct 8 20:57:14 2008 From: python-checkins at python.org (georg.brandl) Date: Wed, 8 Oct 2008 20:57:14 +0200 (CEST) Subject: [Python-checkins] r66857 - in python/trunk/Doc: conf.py contents.rst tools/sphinxext/indexcontent.html whatsnew/2.5.rst whatsnew/index.rst Message-ID: <20081008185714.2E6C61E4002@bag.python.org> Author: georg.brandl Date: Wed Oct 8 20:57:13 2008 New Revision: 66857 Log: Make all whatsnew docs accessible. Added: python/trunk/Doc/whatsnew/index.rst (contents, props changed) Modified: python/trunk/Doc/conf.py python/trunk/Doc/contents.rst python/trunk/Doc/tools/sphinxext/indexcontent.html python/trunk/Doc/whatsnew/2.5.rst Modified: python/trunk/Doc/conf.py ============================================================================== --- python/trunk/Doc/conf.py (original) +++ python/trunk/Doc/conf.py Wed Oct 8 20:57:13 2008 @@ -41,13 +41,6 @@ # List of files that shouldn't be included in the build. unused_docs = [ - 'whatsnew/2.0', - 'whatsnew/2.1', - 'whatsnew/2.2', - 'whatsnew/2.3', - 'whatsnew/2.4', - 'whatsnew/2.5', - 'whatsnew/2.6', 'maclib/scrap', 'library/xmllib', 'library/xml.etree', Modified: python/trunk/Doc/contents.rst ============================================================================== --- python/trunk/Doc/contents.rst (original) +++ python/trunk/Doc/contents.rst Wed Oct 8 20:57:13 2008 @@ -4,7 +4,7 @@ .. toctree:: - whatsnew/2.7.rst + whatsnew/index.rst tutorial/index.rst using/index.rst reference/index.rst Modified: python/trunk/Doc/tools/sphinxext/indexcontent.html ============================================================================== --- python/trunk/Doc/tools/sphinxext/indexcontent.html (original) +++ python/trunk/Doc/tools/sphinxext/indexcontent.html Wed Oct 8 20:57:13 2008 @@ -4,7 +4,7 @@
    + or all "What's new" documents since 2.0