From buildbot at python.org Mon Dec 1 00:20:33 2008 From: buildbot at python.org (buildbot at python.org) Date: Sun, 30 Nov 2008 23:20:33 +0000 Subject: [Python-checkins] buildbot failure in PPC64 Debian 3.0 Message-ID: <20081130232033.6D8B11E402A@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/1848 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 BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_doctest make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Mon Dec 1 00:34:09 2008 From: buildbot at python.org (buildbot at python.org) Date: Sun, 30 Nov 2008 23:34:09 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.0 Message-ID: <20081130233409.42A501E4002@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/685 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: 3 tests failed: test_distutils test_posix test_smtplib ====================================================================== 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 buildbot at python.org Mon Dec 1 01:06:23 2008 From: buildbot at python.org (buildbot at python.org) Date: Mon, 01 Dec 2008 00:06:23 +0000 Subject: [Python-checkins] buildbot failure in amd64 gentoo 3.0 Message-ID: <20081201000623.CE1DD1E4002@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/1332 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: raymond.hettinger BUILD FAILED: failed test Excerpt from the test logfile: 2 tests failed: test_io test_traceback ====================================================================== 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 923, in testBasicIO self.assertEquals(f.write("abc"), 3) File "/home/buildbot/slave/py-build/3.0.norwitz-amd64/build/Lib/io.py", line 1491, 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 761, 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 1724, in read decoder.decode(self.buffer.read(), final=True)) File "/home/buildbot/slave/py-build/3.0.norwitz-amd64/build/Lib/io.py", line 1295, 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 779, 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 1491, 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 884, in testNewlinesInput self.assertEquals(txt.readlines(), expected) File "/home/buildbot/slave/py-build/3.0.norwitz-amd64/build/Lib/io.py", line 534, in readlines return list(self) File "/home/buildbot/slave/py-build/3.0.norwitz-amd64/build/Lib/io.py", line 1739, in __next__ line = self.readline() File "/home/buildbot/slave/py-build/3.0.norwitz-amd64/build/Lib/io.py", line 1813, in readline while self._read_chunk(): File "/home/buildbot/slave/py-build/3.0.norwitz-amd64/build/Lib/io.py", line 1562, 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 1295, 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 909, in testNewlinesOutput txt.write(data) File "/home/buildbot/slave/py-build/3.0.norwitz-amd64/build/Lib/io.py", line 1491, 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 1145, in test_issue1395_1 c = txt.read(1) File "/home/buildbot/slave/py-build/3.0.norwitz-amd64/build/Lib/io.py", line 1733, in read eof = not self._read_chunk() File "/home/buildbot/slave/py-build/3.0.norwitz-amd64/build/Lib/io.py", line 1562, 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 1295, 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 1157, in test_issue1395_2 c = txt.read(4) File "/home/buildbot/slave/py-build/3.0.norwitz-amd64/build/Lib/io.py", line 1733, in read eof = not self._read_chunk() File "/home/buildbot/slave/py-build/3.0.norwitz-amd64/build/Lib/io.py", line 1562, 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 1295, 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 1167, in test_issue1395_3 reads = txt.read(4) File "/home/buildbot/slave/py-build/3.0.norwitz-amd64/build/Lib/io.py", line 1733, in read eof = not self._read_chunk() File "/home/buildbot/slave/py-build/3.0.norwitz-amd64/build/Lib/io.py", line 1562, 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 1295, 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 1178, in test_issue1395_4 reads = txt.read(4) File "/home/buildbot/slave/py-build/3.0.norwitz-amd64/build/Lib/io.py", line 1733, in read eof = not self._read_chunk() File "/home/buildbot/slave/py-build/3.0.norwitz-amd64/build/Lib/io.py", line 1562, 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 1295, 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 1186, in test_issue1395_5 reads = txt.read(4) File "/home/buildbot/slave/py-build/3.0.norwitz-amd64/build/Lib/io.py", line 1733, in read eof = not self._read_chunk() File "/home/buildbot/slave/py-build/3.0.norwitz-amd64/build/Lib/io.py", line 1562, 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 1295, 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_encoded_file (test.test_traceback.SyntaxTracebackCases) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/buildbot/slave/py-build/3.0.norwitz-amd64/build/Lib/test/test_traceback.py", line 145, in test_encoded_file do_test("", "foo", "ascii", 3) File "/home/buildbot/slave/py-build/3.0.norwitz-amd64/build/Lib/test/test_traceback.py", line 117, in do_test """.format(firstlines, message)) File "/home/buildbot/slave/py-build/3.0.norwitz-amd64/build/Lib/io.py", line 1491, 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' make: *** [buildbottest] Error 1 sincerely, -The Buildbot From python-checkins at python.org Mon Dec 1 02:55:22 2008 From: python-checkins at python.org (skip.montanaro) Date: Mon, 1 Dec 2008 02:55:22 +0100 (CET) Subject: [Python-checkins] r67463 - python/trunk/configure.in Message-ID: <20081201015522.DD5491E4002@bag.python.org> Author: skip.montanaro Date: Mon Dec 1 02:55:22 2008 New Revision: 67463 Log: typo in comment Modified: python/trunk/configure.in Modified: python/trunk/configure.in ============================================================================== --- python/trunk/configure.in (original) +++ python/trunk/configure.in Mon Dec 1 02:55:22 2008 @@ -1844,7 +1844,7 @@ AC_CHECK_LIB(dl, dlopen) # Dynamic linking for SunOS/Solaris and SYSV AC_CHECK_LIB(dld, shl_load) # Dynamic linking for HP-UX -# only check for sem_ini if thread support is requested +# only check for sem_init if thread support is requested if test "$with_threads" = "yes" -o -z "$with_threads"; then AC_SEARCH_LIBS(sem_init, pthread rt posix4) # 'Real Time' functions on Solaris # posix4 on Solaris 2.6 From python-checkins at python.org Mon Dec 1 05:49:40 2008 From: python-checkins at python.org (martin.v.loewis) Date: Mon, 1 Dec 2008 05:49:40 +0100 (CET) Subject: [Python-checkins] r67466 - in python/branches/release26-maint: Misc/NEWS PC/msvcrtmodule.c Message-ID: <20081201044940.633391E4002@bag.python.org> Author: martin.v.loewis Date: Mon Dec 1 05:49:40 2008 New Revision: 67466 Log: Merged revisions 67455 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r67455 | martin.v.loewis | 2008-11-30 20:28:27 +0100 (So, 30 Nov 2008) | 1 line Issue #4365: Add crtassem.h constants to the msvcrt module. ........ Modified: python/branches/release26-maint/ (props changed) python/branches/release26-maint/Misc/NEWS python/branches/release26-maint/PC/msvcrtmodule.c Modified: python/branches/release26-maint/Misc/NEWS ============================================================================== --- python/branches/release26-maint/Misc/NEWS (original) +++ python/branches/release26-maint/Misc/NEWS Mon Dec 1 05:49:40 2008 @@ -104,6 +104,8 @@ Extension Modules ----------------- +- Issue #4365: Add crtassem.h constants to the msvcrt module. + - Issue #4396: The parser module now correctly validates the with statement. Modified: python/branches/release26-maint/PC/msvcrtmodule.c ============================================================================== --- python/branches/release26-maint/PC/msvcrtmodule.c (original) +++ python/branches/release26-maint/PC/msvcrtmodule.c Mon Dec 1 05:49:40 2008 @@ -22,6 +22,12 @@ #include #include +#ifdef _MSC_VER +#if _MSC_VER >= 1500 +#include +#endif +#endif + // Force the malloc heap to clean itself up, and free unused blocks // back to the OS. (According to the docs, only works on NT.) static PyObject * @@ -298,6 +304,7 @@ PyMODINIT_FUNC initmsvcrt(void) { + int st; PyObject *d; PyObject *m = Py_InitModule("msvcrt", msvcrt_functions); if (m == NULL) @@ -310,4 +317,21 @@ insertint(d, "LK_NBRLCK", _LK_NBRLCK); insertint(d, "LK_RLCK", _LK_RLCK); insertint(d, "LK_UNLCK", _LK_UNLCK); + + /* constants for the crt versions */ +#ifdef _VC_ASSEMBLY_PUBLICKEYTOKEN + st = PyModule_AddStringConstant(m, "VC_ASSEMBLY_PUBLICKEYTOKEN", + _VC_ASSEMBLY_PUBLICKEYTOKEN); + if (st < 0)return; +#endif +#ifdef _CRT_ASSEMBLY_VERSION + st = PyModule_AddStringConstant(m, "CRT_ASSEMBLY_VERSION", + _CRT_ASSEMBLY_VERSION); + if (st < 0)return; +#endif +#ifdef __LIBRARIES_ASSEMBLY_NAME_PREFIX + st = PyModule_AddStringConstant(m, "LIBRARIES_ASSEMBLY_NAME_PREFIX", + __LIBRARIES_ASSEMBLY_NAME_PREFIX); + if (st < 0)return; +#endif } From buildbot at python.org Mon Dec 1 06:04:40 2008 From: buildbot at python.org (buildbot at python.org) Date: Mon, 01 Dec 2008 05:04:40 +0000 Subject: [Python-checkins] buildbot failure in x86 osx.5 3.0 Message-ID: <20081201050440.F3F751E4002@bag.python.org> The Buildbot has detected a new failure of x86 osx.5 3.0. Full details are available at: http://www.python.org/dev/buildbot/all/x86%20osx.5%203.0/builds/555 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: heller-x86-osx5 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_calendar test_mailbox make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Mon Dec 1 06:29:09 2008 From: buildbot at python.org (buildbot at python.org) Date: Mon, 01 Dec 2008 05:29:09 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.0 Message-ID: <20081201052910.1867F1E4032@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/687 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 nnorwitz at gmail.com Mon Dec 1 07:20:13 2008 From: nnorwitz at gmail.com (Neal Norwitz) Date: Mon, 1 Dec 2008 01:20:13 -0500 Subject: [Python-checkins] Python Regression Test Failures doc (1) Message-ID: <20081201062013.GA10151@python.psfb.org> svn update tools/sphinx At revision 67466. svn update tools/docutils At revision 67466. svn update tools/jinja At revision 67466. svn update tools/pygments At revision 67466. mkdir -p build/html build/doctrees python tools/sphinx-build.py -b html -d build/doctrees -D latex_paper_size= . build/html Extension error: Could not import extension pyspecific (exception: No module named writers.text) make: *** [build] Error 1 From nnorwitz at gmail.com Mon Dec 1 07:20:14 2008 From: nnorwitz at gmail.com (Neal Norwitz) Date: Mon, 1 Dec 2008 01:20:14 -0500 Subject: [Python-checkins] Python Regression Test Failures doc dist (1) Message-ID: <20081201062014.GA10175@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 Extension error: Could not import extension pyspecific (exception: No module named writers.text) make[1]: *** [build] Error 1 make[1]: Leaving directory `/home/neal/python/r26/Doc' make: *** [dist] Error 2 From buildbot at python.org Mon Dec 1 07:47:48 2008 From: buildbot at python.org (buildbot at python.org) Date: Mon, 01 Dec 2008 06:47:48 +0000 Subject: [Python-checkins] buildbot failure in sparc Debian 3.0 Message-ID: <20081201064748.31A5C1E4002@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/725 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: martin.v.loewis BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_ssl make: *** [buildbottest] Error 1 sincerely, -The Buildbot From g.brandl at gmx.net Mon Dec 1 10:45:20 2008 From: g.brandl at gmx.net (Georg Brandl) Date: Mon, 01 Dec 2008 10:45:20 +0100 Subject: [Python-checkins] r67458 - python/trunk/Doc/tools/sphinxext/pyspecific.py In-Reply-To: <20081130214617.06A2D1E4002@bag.python.org> References: <20081130214617.06A2D1E4002@bag.python.org> Message-ID: benjamin.peterson schrieb: > Author: benjamin.peterson > Date: Sun Nov 30 22:46:16 2008 > New Revision: 67458 > > Log: > fix pyspecific extensions that were broken by Sphinx's grand renaming That's not a good idea if the renaming hasn't occurred in the SVN repo yet :) Georg From nnorwitz at gmail.com Mon Dec 1 11:32:03 2008 From: nnorwitz at gmail.com (Neal Norwitz) Date: Mon, 1 Dec 2008 05:32:03 -0500 Subject: [Python-checkins] Python Regression Test Failures doc (1) Message-ID: <20081201103203.GA3603@python.psfb.org> svn update tools/sphinx At revision 67466. svn update tools/docutils At revision 67466. svn update tools/jinja At revision 67466. svn update tools/pygments At revision 67466. mkdir -p build/html build/doctrees python tools/sphinx-build.py -b html -d build/doctrees -D latex_paper_size= . build/html Extension error: Could not import extension pyspecific (exception: No module named writers.text) make: *** [build] Error 1 From python-checkins at python.org Mon Dec 1 13:52:52 2008 From: python-checkins at python.org (benjamin.peterson) Date: Mon, 1 Dec 2008 13:52:52 +0100 (CET) Subject: [Python-checkins] r67467 - python/trunk/Doc/tools/sphinxext/pyspecific.py Message-ID: <20081201125252.4E6091E4002@bag.python.org> Author: benjamin.peterson Date: Mon Dec 1 13:52:51 2008 New Revision: 67467 Log: let people using SVN Sphinx still build the docs Modified: python/trunk/Doc/tools/sphinxext/pyspecific.py Modified: python/trunk/Doc/tools/sphinxext/pyspecific.py ============================================================================== --- python/trunk/Doc/tools/sphinxext/pyspecific.py (original) +++ python/trunk/Doc/tools/sphinxext/pyspecific.py Mon Dec 1 13:52:51 2008 @@ -48,7 +48,11 @@ from docutils.io import StringOutput from docutils.utils import new_document from sphinx.builder import Builder -from sphinx.writers.text import TextWriter + +try: + from sphinx.writers.text import TextWriter +except ImportError: + from sphinx.textwriter import TextWriter class PydocTopicsBuilder(Builder): name = 'pydoc-topics' From buildbot at python.org Mon Dec 1 22:00:54 2008 From: buildbot at python.org (buildbot at python.org) Date: Mon, 01 Dec 2008 21:00:54 +0000 Subject: [Python-checkins] buildbot failure in ppc Debian unstable trunk Message-ID: <20081201210055.0C8771E4010@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/2120 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-debian-ppc Build Reason: The web-page 'force build' button was pressed by 'Justin Lemay': TEsting Build Source Stamp: [branch Test] Nome Blamelist: BUILD FAILED: failed svn sincerely, -The Buildbot From buildbot at python.org Tue Dec 2 00:25:48 2008 From: buildbot at python.org (buildbot at python.org) Date: Mon, 01 Dec 2008 23:25:48 +0000 Subject: [Python-checkins] buildbot failure in amd64 gentoo 3.0 Message-ID: <20081201232548.D7BD71E4027@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/1334 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: georg.brandl,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 Tue Dec 2 00:26:41 2008 From: buildbot at python.org (buildbot at python.org) Date: Mon, 01 Dec 2008 23:26:41 +0000 Subject: [Python-checkins] buildbot failure in AMD64 W2k8 3.0 Message-ID: <20081201232641.E16651E4002@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/994 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: georg.brandl,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 "S:\buildbots\python.x64\3.0.nelson-win64\build\lib\test\test_io.py", line 923, in testBasicIO self.assertEquals(f.write("abc"), 3) File "S:\buildbots\python.x64\3.0.nelson-win64\build\lib\io.py", line 1491, in write b = encoder.encode(s) File "S:\buildbots\python.x64\3.0.nelson-win64\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 "S:\buildbots\python.x64\3.0.nelson-win64\build\lib\test\test_io.py", line 761, in testEncodingErrorsReading self.assertRaises(UnicodeError, t.read) File "S:\buildbots\python.x64\3.0.nelson-win64\build\lib\unittest.py", line 311, in failUnlessRaises callableObj(*args, **kwargs) File "S:\buildbots\python.x64\3.0.nelson-win64\build\lib\io.py", line 1724, in read decoder.decode(self.buffer.read(), final=True)) File "S:\buildbots\python.x64\3.0.nelson-win64\build\lib\io.py", line 1295, in decode output = self.decoder.decode(input, final=final) File "S:\buildbots\python.x64\3.0.nelson-win64\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 "S:\buildbots\python.x64\3.0.nelson-win64\build\lib\test\test_io.py", line 779, in testEncodingErrorsWriting self.assertRaises(UnicodeError, t.write, "\xff") File "S:\buildbots\python.x64\3.0.nelson-win64\build\lib\unittest.py", line 311, in failUnlessRaises callableObj(*args, **kwargs) File "S:\buildbots\python.x64\3.0.nelson-win64\build\lib\io.py", line 1491, in write b = encoder.encode(s) File "S:\buildbots\python.x64\3.0.nelson-win64\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 "S:\buildbots\python.x64\3.0.nelson-win64\build\lib\test\test_io.py", line 884, in testNewlinesInput self.assertEquals(txt.readlines(), expected) File "S:\buildbots\python.x64\3.0.nelson-win64\build\lib\io.py", line 534, in readlines return list(self) File "S:\buildbots\python.x64\3.0.nelson-win64\build\lib\io.py", line 1739, in __next__ line = self.readline() File "S:\buildbots\python.x64\3.0.nelson-win64\build\lib\io.py", line 1813, in readline while self._read_chunk(): File "S:\buildbots\python.x64\3.0.nelson-win64\build\lib\io.py", line 1562, in _read_chunk self._set_decoded_chars(self._decoder.decode(input_chunk, eof)) File "S:\buildbots\python.x64\3.0.nelson-win64\build\lib\io.py", line 1295, in decode output = self.decoder.decode(input, final=final) File "S:\buildbots\python.x64\3.0.nelson-win64\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 "S:\buildbots\python.x64\3.0.nelson-win64\build\lib\test\test_io.py", line 909, in testNewlinesOutput txt.write(data) File "S:\buildbots\python.x64\3.0.nelson-win64\build\lib\io.py", line 1491, in write b = encoder.encode(s) File "S:\buildbots\python.x64\3.0.nelson-win64\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 "S:\buildbots\python.x64\3.0.nelson-win64\build\lib\test\test_io.py", line 1145, in test_issue1395_1 c = txt.read(1) File "S:\buildbots\python.x64\3.0.nelson-win64\build\lib\io.py", line 1733, in read eof = not self._read_chunk() File "S:\buildbots\python.x64\3.0.nelson-win64\build\lib\io.py", line 1562, in _read_chunk self._set_decoded_chars(self._decoder.decode(input_chunk, eof)) File "S:\buildbots\python.x64\3.0.nelson-win64\build\lib\io.py", line 1295, in decode output = self.decoder.decode(input, final=final) File "S:\buildbots\python.x64\3.0.nelson-win64\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 "S:\buildbots\python.x64\3.0.nelson-win64\build\lib\test\test_io.py", line 1157, in test_issue1395_2 c = txt.read(4) File "S:\buildbots\python.x64\3.0.nelson-win64\build\lib\io.py", line 1733, in read eof = not self._read_chunk() File "S:\buildbots\python.x64\3.0.nelson-win64\build\lib\io.py", line 1562, in _read_chunk self._set_decoded_chars(self._decoder.decode(input_chunk, eof)) File "S:\buildbots\python.x64\3.0.nelson-win64\build\lib\io.py", line 1295, in decode output = self.decoder.decode(input, final=final) File "S:\buildbots\python.x64\3.0.nelson-win64\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 "S:\buildbots\python.x64\3.0.nelson-win64\build\lib\test\test_io.py", line 1167, in test_issue1395_3 reads = txt.read(4) File "S:\buildbots\python.x64\3.0.nelson-win64\build\lib\io.py", line 1733, in read eof = not self._read_chunk() File "S:\buildbots\python.x64\3.0.nelson-win64\build\lib\io.py", line 1562, in _read_chunk self._set_decoded_chars(self._decoder.decode(input_chunk, eof)) File "S:\buildbots\python.x64\3.0.nelson-win64\build\lib\io.py", line 1295, in decode output = self.decoder.decode(input, final=final) File "S:\buildbots\python.x64\3.0.nelson-win64\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 "S:\buildbots\python.x64\3.0.nelson-win64\build\lib\test\test_io.py", line 1178, in test_issue1395_4 reads = txt.read(4) File "S:\buildbots\python.x64\3.0.nelson-win64\build\lib\io.py", line 1733, in read eof = not self._read_chunk() File "S:\buildbots\python.x64\3.0.nelson-win64\build\lib\io.py", line 1562, in _read_chunk self._set_decoded_chars(self._decoder.decode(input_chunk, eof)) File "S:\buildbots\python.x64\3.0.nelson-win64\build\lib\io.py", line 1295, in decode output = self.decoder.decode(input, final=final) File "S:\buildbots\python.x64\3.0.nelson-win64\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 "S:\buildbots\python.x64\3.0.nelson-win64\build\lib\test\test_io.py", line 1186, in test_issue1395_5 reads = txt.read(4) File "S:\buildbots\python.x64\3.0.nelson-win64\build\lib\io.py", line 1733, in read eof = not self._read_chunk() File "S:\buildbots\python.x64\3.0.nelson-win64\build\lib\io.py", line 1562, in _read_chunk self._set_decoded_chars(self._decoder.decode(input_chunk, eof)) File "S:\buildbots\python.x64\3.0.nelson-win64\build\lib\io.py", line 1295, in decode output = self.decoder.decode(input, final=final) File "S:\buildbots\python.x64\3.0.nelson-win64\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' sincerely, -The Buildbot From buildbot at python.org Tue Dec 2 00:43:27 2008 From: buildbot at python.org (buildbot at python.org) Date: Mon, 01 Dec 2008 23:43:27 +0000 Subject: [Python-checkins] buildbot failure in ppc Debian unstable 3.0 Message-ID: <20081201234327.3E7D61E4002@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/1748 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: georg.brandl,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 nnorwitz at gmail.com Tue Dec 2 07:20:10 2008 From: nnorwitz at gmail.com (Neal Norwitz) Date: Tue, 2 Dec 2008 01:20:10 -0500 Subject: [Python-checkins] Python Regression Test Failures doc (1) Message-ID: <20081202062010.GA19212@python.psfb.org> svn update tools/sphinx At revision 67472. svn update tools/docutils At revision 67472. svn update tools/jinja At revision 67472. svn update tools/pygments At revision 67472. mkdir -p build/html build/doctrees python tools/sphinx-build.py -b html -d build/doctrees -D latex_paper_size= . build/html Extension error: Could not import extension pyspecific (exception: No module named writers.text) make: *** [build] Error 1 From nnorwitz at gmail.com Tue Dec 2 07:20:11 2008 From: nnorwitz at gmail.com (Neal Norwitz) Date: Tue, 2 Dec 2008 01:20:11 -0500 Subject: [Python-checkins] Python Regression Test Failures doc dist (1) Message-ID: <20081202062011.GA19236@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 Extension error: Could not import extension pyspecific (exception: No module named writers.text) make[1]: *** [build] Error 1 make[1]: Leaving directory `/home/neal/python/r26/Doc' make: *** [dist] Error 2 From buildbot at python.org Tue Dec 2 07:21:37 2008 From: buildbot at python.org (buildbot at python.org) Date: Tue, 02 Dec 2008 06:21:37 +0000 Subject: [Python-checkins] buildbot failure in x86 W2k8 3.0 Message-ID: <20081202062137.7A1931E4002@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/473 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: alexandre.vassalotti,benjamin.peterson,guido.van.rossum,martin.v.loewis BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_binascii ====================================================================== FAIL: test_no_binary_strings (test.test_binascii.BinASCIITest) ---------------------------------------------------------------------- Traceback (most recent call last): File "S:\buildbots\python\3.0.nelson-windows\build\lib\test\test_binascii.py", line 177, in test_no_binary_strings self.assertRaises(TypeError, f, "test") AssertionError: TypeError not raised by crc32 sincerely, -The Buildbot From buildbot at python.org Tue Dec 2 07:50:31 2008 From: buildbot at python.org (buildbot at python.org) Date: Tue, 02 Dec 2008 06:50:31 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.0 Message-ID: <20081202065031.563141E4002@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/689 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: alexandre.vassalotti,benjamin.peterson,guido.van.rossum,martin.v.loewis 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 python-checkins at python.org Tue Dec 2 09:25:01 2008 From: python-checkins at python.org (georg.brandl) Date: Tue, 2 Dec 2008 09:25:01 +0100 (CET) Subject: [Python-checkins] r67473 - in python/branches/release26-maint: Doc/tools/sphinxext/pyspecific.py Message-ID: <20081202082501.417751E4002@bag.python.org> Author: georg.brandl Date: Tue Dec 2 09:25:00 2008 New Revision: 67473 Log: Merged revisions 67467 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r67467 | benjamin.peterson | 2008-12-01 13:52:51 +0100 (Mon, 01 Dec 2008) | 1 line let people using SVN Sphinx still build the docs ........ Modified: python/branches/release26-maint/ (props changed) python/branches/release26-maint/Doc/tools/sphinxext/pyspecific.py Modified: python/branches/release26-maint/Doc/tools/sphinxext/pyspecific.py ============================================================================== --- python/branches/release26-maint/Doc/tools/sphinxext/pyspecific.py (original) +++ python/branches/release26-maint/Doc/tools/sphinxext/pyspecific.py Tue Dec 2 09:25:00 2008 @@ -48,7 +48,11 @@ from docutils.io import StringOutput from docutils.utils import new_document from sphinx.builder import Builder -from sphinx.writers.text import TextWriter + +try: + from sphinx.writers.text import TextWriter +except ImportError: + from sphinx.textwriter import TextWriter class PydocTopicsBuilder(Builder): name = 'pydoc-topics' From buildbot at python.org Tue Dec 2 23:25:44 2008 From: buildbot at python.org (buildbot at python.org) Date: Tue, 02 Dec 2008 22:25:44 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.0 Message-ID: <20081202222544.C17B41E4002@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/691 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: raymond.hettinger BUILD FAILED: failed test Excerpt from the test logfile: 3 tests failed: test_posix test_smtplib 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 python-checkins at python.org Wed Dec 3 01:51:50 2008 From: python-checkins at python.org (christian.heimes) Date: Wed, 3 Dec 2008 01:51:50 +0100 (CET) Subject: [Python-checkins] r67483 - python/branches/release26-maint/Modules/_ctypes/callproc.c Message-ID: <20081203005150.B423C1E4002@bag.python.org> Author: christian.heimes Date: Wed Dec 3 01:51:50 2008 New Revision: 67483 Log: Issue #4025 again Converted a C99 style comment to a C89 style comment (found by MAL). Modified: python/branches/release26-maint/Modules/_ctypes/callproc.c Modified: python/branches/release26-maint/Modules/_ctypes/callproc.c ============================================================================== --- python/branches/release26-maint/Modules/_ctypes/callproc.c (original) +++ python/branches/release26-maint/Modules/_ctypes/callproc.c Wed Dec 3 01:51:50 2008 @@ -221,7 +221,7 @@ n = FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM, NULL, code, - MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // Default language + MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), /* Default language */ (LPTSTR) &lpMsgBuf, 0, NULL); From python-checkins at python.org Wed Dec 3 01:53:18 2008 From: python-checkins at python.org (christian.heimes) Date: Wed, 3 Dec 2008 01:53:18 +0100 (CET) Subject: [Python-checkins] r67484 - python/trunk/Modules/_ctypes/callproc.c Message-ID: <20081203005318.7A4791E4002@bag.python.org> Author: christian.heimes Date: Wed Dec 3 01:53:18 2008 New Revision: 67484 Log: Issue #4025 again Converted a C99 style comment to a C89 style comment (found by MAL). Modified: python/trunk/Modules/_ctypes/callproc.c Modified: python/trunk/Modules/_ctypes/callproc.c ============================================================================== --- python/trunk/Modules/_ctypes/callproc.c (original) +++ python/trunk/Modules/_ctypes/callproc.c Wed Dec 3 01:53:18 2008 @@ -221,7 +221,7 @@ n = FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM, NULL, code, - MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // Default language + MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), /* Default language */ (LPTSTR) &lpMsgBuf, 0, NULL); From python-checkins at python.org Wed Dec 3 01:55:07 2008 From: python-checkins at python.org (guido.van.rossum) Date: Wed, 3 Dec 2008 01:55:07 +0100 (CET) Subject: [Python-checkins] r67486 - peps/trunk/pep-0274.txt Message-ID: <20081203005507.5CC701E4002@bag.python.org> Author: guido.van.rossum Date: Wed Dec 3 01:55:07 2008 New Revision: 67486 Log: Note that dict comprehensionss were implemented in Py3k! Modified: peps/trunk/pep-0274.txt Modified: peps/trunk/pep-0274.txt ============================================================================== --- peps/trunk/pep-0274.txt (original) +++ peps/trunk/pep-0274.txt Wed Dec 3 01:55:07 2008 @@ -24,6 +24,9 @@ This PEP is withdrawn. Substantially all of its benefits were subsumed by generator expressions coupled with the dict() constructor. + However, Python 3.0 introduces this exact feature, as well as the + closely related set comprehensions. + Proposed Solution From buildbot at python.org Wed Dec 3 02:21:15 2008 From: buildbot at python.org (buildbot at python.org) Date: Wed, 03 Dec 2008 01:21:15 +0000 Subject: [Python-checkins] buildbot failure in x86 osx.5 trunk Message-ID: <20081203012115.D6AEB1E4002@bag.python.org> The Buildbot has detected a new failure of x86 osx.5 trunk. Full details are available at: http://www.python.org/dev/buildbot/all/x86%20osx.5%20trunk/builds/358 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: heller-x86-osx5 Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: benjamin.peterson,christian.heimes BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_socket make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Wed Dec 3 02:37:39 2008 From: buildbot at python.org (buildbot at python.org) Date: Wed, 03 Dec 2008 01:37:39 +0000 Subject: [Python-checkins] buildbot failure in ppc Debian unstable 3.0 Message-ID: <20081203013739.778021E4002@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/1752 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: christian.heimes,gregory.p.smith,guido.van.rossum 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 Dec 3 02:43:08 2008 From: buildbot at python.org (buildbot at python.org) Date: Wed, 03 Dec 2008 01:43:08 +0000 Subject: [Python-checkins] buildbot failure in x86 W2k8 trunk Message-ID: <20081203014308.3A7AF1E4002@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/348 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,christian.heimes BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_bsddb3 sincerely, -The Buildbot From python-checkins at python.org Wed Dec 3 07:46:46 2008 From: python-checkins at python.org (jeffrey.yasskin) Date: Wed, 3 Dec 2008 07:46:46 +0100 (CET) Subject: [Python-checkins] r67494 - python/trunk/Python/ceval.c Message-ID: <20081203064646.283061E4002@bag.python.org> Author: jeffrey.yasskin Date: Wed Dec 3 07:46:45 2008 New Revision: 67494 Log: Speed up Python (according to pybench and 2to3-on-itself) by 1-2% by caching whether any thread has tracing turned on, which saves one load instruction in the fast_next_opcode path in PyEval_EvalFrameEx(). See issue 4477. Modified: python/trunk/Python/ceval.c Modified: python/trunk/Python/ceval.c ============================================================================== --- python/trunk/Python/ceval.c (original) +++ python/trunk/Python/ceval.c Wed Dec 3 07:46:45 2008 @@ -504,6 +504,13 @@ static enum why_code do_raise(PyObject *, PyObject *, PyObject *); static int unpack_iterable(PyObject *, int, PyObject **); +/* Records whether tracing is on for any thread. Counts the number of + threads for which tstate->c_tracefunc is non-NULL, so if the value + is 0, we know we don't have to check this thread's c_tracefunc. + This speeds up the if statement in PyEval_EvalFrameEx() after + fast_next_opcode*/ +static int _Py_TracingPossible = 0; + /* for manipulating the thread switch and periodic "stuff" - used to be per thread, now just a pair o' globals */ int _Py_CheckInterval = 100; @@ -886,7 +893,8 @@ /* line-by-line tracing support */ - if (tstate->c_tracefunc != NULL && !tstate->tracing) { + if (_Py_TracingPossible && + tstate->c_tracefunc != NULL && !tstate->tracing) { /* see maybe_call_line_trace for expository comments */ f->f_stacktop = stack_pointer; @@ -3414,6 +3422,7 @@ { PyThreadState *tstate = PyThreadState_GET(); PyObject *temp = tstate->c_traceobj; + _Py_TracingPossible += (func != NULL) - (tstate->c_tracefunc != NULL); Py_XINCREF(arg); tstate->c_tracefunc = NULL; tstate->c_traceobj = NULL; From python-checkins at python.org Wed Dec 3 16:42:11 2008 From: python-checkins at python.org (raymond.hettinger) Date: Wed, 3 Dec 2008 16:42:11 +0100 (CET) Subject: [Python-checkins] r67498 - in python/trunk: Lib/test/list_tests.py Misc/NEWS Objects/listobject.c Message-ID: <20081203154211.017E11E400C@bag.python.org> Author: raymond.hettinger Date: Wed Dec 3 16:42:10 2008 New Revision: 67498 Log: Backport r67478 Modified: python/trunk/Lib/test/list_tests.py python/trunk/Misc/NEWS python/trunk/Objects/listobject.c Modified: python/trunk/Lib/test/list_tests.py ============================================================================== --- python/trunk/Lib/test/list_tests.py (original) +++ python/trunk/Lib/test/list_tests.py Wed Dec 3 16:42:10 2008 @@ -84,6 +84,8 @@ self.assertRaises(StopIteration, r.next) self.assertEqual(list(reversed(self.type2test())), self.type2test()) + # Bug 3689: make sure list-reversed-iterator doesn't have __len__ + self.assertRaises(TypeError, len, reversed([1,2,3])) def test_setitem(self): a = self.type2test([0, 1]) Modified: python/trunk/Misc/NEWS ============================================================================== --- python/trunk/Misc/NEWS (original) +++ python/trunk/Misc/NEWS Wed Dec 3 16:42:10 2008 @@ -16,6 +16,9 @@ interpreter to abort ("Fatal Python error: Could not reset the stack!") instead of throwing a MemoryError. +- Issue #3689: The list reversed iterator now supports __length_hint__ + instead of __len__. Behavior now matches other reversed iterators. + - Issue #4367: Python would segfault during compiling when the unicodedata module couldn't be imported and \N escapes were present. Modified: python/trunk/Objects/listobject.c ============================================================================== --- python/trunk/Objects/listobject.c (original) +++ python/trunk/Objects/listobject.c Wed Dec 3 16:42:10 2008 @@ -2911,11 +2911,11 @@ static void listreviter_dealloc(listreviterobject *); static int listreviter_traverse(listreviterobject *, visitproc, void *); static PyObject *listreviter_next(listreviterobject *); -static Py_ssize_t listreviter_len(listreviterobject *); +static PyObject *listreviter_len(listreviterobject *); -static PySequenceMethods listreviter_as_sequence = { - (lenfunc)listreviter_len, /* sq_length */ - 0, /* sq_concat */ +static PyMethodDef listreviter_methods[] = { + {"__length_hint__", (PyCFunction)listreviter_len, METH_NOARGS, length_hint_doc}, + {NULL, NULL} /* sentinel */ }; PyTypeObject PyListRevIter_Type = { @@ -2931,7 +2931,7 @@ 0, /* tp_compare */ 0, /* tp_repr */ 0, /* tp_as_number */ - &listreviter_as_sequence, /* tp_as_sequence */ + 0, /* tp_as_sequence */ 0, /* tp_as_mapping */ 0, /* tp_hash */ 0, /* tp_call */ @@ -2947,6 +2947,7 @@ 0, /* tp_weaklistoffset */ PyObject_SelfIter, /* tp_iter */ (iternextfunc)listreviter_next, /* tp_iternext */ + listreviter_methods, /* tp_methods */ 0, }; @@ -3002,11 +3003,11 @@ return NULL; } -static Py_ssize_t +static PyObject * listreviter_len(listreviterobject *it) { Py_ssize_t len = it->it_index + 1; if (it->it_seq == NULL || PyList_GET_SIZE(it->it_seq) < len) - return 0; - return len; + len = 0; + return PyLong_FromSsize_t(len); } From python-checkins at python.org Wed Dec 3 17:25:53 2008 From: python-checkins at python.org (barry.warsaw) Date: Wed, 3 Dec 2008 17:25:53 +0100 (CET) Subject: [Python-checkins] r67499 - python/branches/release30-maint Message-ID: <20081203162553.694A61E4045@bag.python.org> Author: barry.warsaw Date: Wed Dec 3 17:25:53 2008 New Revision: 67499 Log: Creating the Python 3.0 maintenance branch. Added: python/branches/release30-maint/ - copied from r67498, /python/branches/py3k/ From buildbot at python.org Wed Dec 3 17:32:27 2008 From: buildbot at python.org (buildbot at python.org) Date: Wed, 03 Dec 2008 16:32:27 +0000 Subject: [Python-checkins] buildbot failure in AMD64 W2k8 trunk Message-ID: <20081203163227.6DD301E4002@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/1104 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: nelson-win64 Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: raymond.hettinger BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_bsddb3 sincerely, -The Buildbot From python-checkins at python.org Wed Dec 3 17:58:41 2008 From: python-checkins at python.org (christian.heimes) Date: Wed, 3 Dec 2008 17:58:41 +0100 (CET) Subject: [Python-checkins] r67501 - python/branches/release30-maint Message-ID: <20081203165841.A60F61E4002@bag.python.org> Author: christian.heimes Date: Wed Dec 3 17:58:41 2008 New Revision: 67501 Log: Removed merge tracking for "svnmerge" for svn+ssh://pythondev at svn.python.org/python/trunk Modified: python/branches/release30-maint/ (props changed) From python-checkins at python.org Wed Dec 3 17:58:54 2008 From: python-checkins at python.org (christian.heimes) Date: Wed, 3 Dec 2008 17:58:54 +0100 (CET) Subject: [Python-checkins] r67502 - python/branches/release30-maint Message-ID: <20081203165854.A8F931E4002@bag.python.org> Author: christian.heimes Date: Wed Dec 3 17:58:54 2008 New Revision: 67502 Log: Initialized merge tracking via "svnmerge" with revisions "1-67498" from svn+ssh://pythondev at svn.python.org/python/branches/py3k Modified: python/branches/release30-maint/ (props changed) From python-checkins at python.org Wed Dec 3 18:15:14 2008 From: python-checkins at python.org (barry.warsaw) Date: Wed, 3 Dec 2008 18:15:14 +0100 (CET) Subject: [Python-checkins] r67503 - in python/branches/release30-maint: Include/patchlevel.h Lib/distutils/__init__.py Lib/idlelib/idlever.py Lib/pydoc_topics.py Misc/NEWS Misc/RPM/python-3.0.spec README RELNOTES Message-ID: <20081203171514.7BCAF1E400C@bag.python.org> Author: barry.warsaw Date: Wed Dec 3 18:15:13 2008 New Revision: 67503 Log: Bumping to 3.0 final. Modified: python/branches/release30-maint/Include/patchlevel.h python/branches/release30-maint/Lib/distutils/__init__.py python/branches/release30-maint/Lib/idlelib/idlever.py python/branches/release30-maint/Lib/pydoc_topics.py python/branches/release30-maint/Misc/NEWS python/branches/release30-maint/Misc/RPM/python-3.0.spec python/branches/release30-maint/README python/branches/release30-maint/RELNOTES Modified: python/branches/release30-maint/Include/patchlevel.h ============================================================================== --- python/branches/release30-maint/Include/patchlevel.h (original) +++ python/branches/release30-maint/Include/patchlevel.h Wed Dec 3 18:15:13 2008 @@ -19,11 +19,11 @@ #define PY_MAJOR_VERSION 3 #define PY_MINOR_VERSION 0 #define PY_MICRO_VERSION 0 -#define PY_RELEASE_LEVEL PY_RELEASE_LEVEL_GAMMA -#define PY_RELEASE_SERIAL 3 +#define PY_RELEASE_LEVEL PY_RELEASE_LEVEL_FINAL +#define PY_RELEASE_SERIAL 0 /* Version as a string */ -#define PY_VERSION "3.0rc3+" +#define PY_VERSION "3.0" /*--end constants--*/ /* Subversion Revision number of this file (not of the repository) */ Modified: python/branches/release30-maint/Lib/distutils/__init__.py ============================================================================== --- python/branches/release30-maint/Lib/distutils/__init__.py (original) +++ python/branches/release30-maint/Lib/distutils/__init__.py Wed Dec 3 18:15:13 2008 @@ -20,5 +20,5 @@ # #--start constants-- -__version__ = "3.0rc3" +__version__ = "3.0" #--end constants-- Modified: python/branches/release30-maint/Lib/idlelib/idlever.py ============================================================================== --- python/branches/release30-maint/Lib/idlelib/idlever.py (original) +++ python/branches/release30-maint/Lib/idlelib/idlever.py Wed Dec 3 18:15:13 2008 @@ -1 +1 @@ -IDLE_VERSION = "3.0rc3" +IDLE_VERSION = "3.0" Modified: python/branches/release30-maint/Lib/pydoc_topics.py ============================================================================== --- python/branches/release30-maint/Lib/pydoc_topics.py (original) +++ python/branches/release30-maint/Lib/pydoc_topics.py Wed Dec 3 18:15:13 2008 @@ -1,4 +1,4 @@ -# Autogenerated by Sphinx on Thu Nov 20 20:13:48 2008 +# Autogenerated by Sphinx on Wed Dec 3 12:00:16 2008 topics = {'assert': '\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': '\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 | "*" target\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, optionally enclosed in\nparentheses or square brackets, is recursively defined as follows.\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:\n\n * If the target list contains one target prefixed with an asterisk,\n called a "starred" target: The object must be a sequence with at\n least as many items as there are targets in the target list, minus\n one. The first items of the sequence are assigned, from left to\n right, to the targets before the starred target. The final items\n of the sequence are assigned to the targets after the starred\n target. A list of the remaining items in the sequence is then\n assigned to the starred target (the list can be empty).\n\n * Else: The object must be a sequence with the same number of items\n as there are targets in the target list, and the items are\n assigned, from left to right, to the corresponding targets.\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`` or ``nonlocal``\n statement in the current code block: the name is bound to the\n object in the current local namespace.\n\n * Otherwise: the name is bound to the object in the global namespace\n or the outer namespace determined by ``nonlocal``, respectively.\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 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 an integer. If it is negative, the sequence\'s\n length is added to it. The resulting value must be a nonnegative\n integer less than the sequence\'s length, and the sequence is asked\n to assign the assigned object to its item with that index. If the\n index is out of range, ``IndexError`` is raised (assignment to a\n subscripted sequence cannot add new items to a 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 For user-defined objects, the ``__setitem__()`` method is called\n with appropriate arguments.\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 integers. If either bound is\n negative, the sequence\'s length is added to it. The resulting\n bounds are clipped to lie between zero and the sequence\'s length,\n inclusive. Finally, the sequence object is asked to replace the\n slice with the items of the assigned sequence. The length of the\n 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\nSee also:\n\n **PEP 3132** - Extended Iterable Unpacking\n The specification for the ``*target`` feature.\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': '\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', @@ -18,7 +18,7 @@ 'callable-types': '\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': '\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 [","] | comprehension] ")"\n argument_list ::= positional_arguments ["," keyword_arguments]\n ["," "*" expression] ["," keyword_arguments]\n ["," "**" expression]\n | keyword_arguments ["," "*" expression]\n ["," keyword_arguments] ["," "**" expression]\n | "*" expression ["," keyword_arguments] ["," "**" 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 all objects having a\n``__call__()`` method are callable). All argument expressions are\nevaluated before the call is attempted. Please refer to section\n*Function definitions* for the syntax 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.\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': '\nClass definitions\n*****************\n\nA class definition defines a class object (see section *The standard\ntype hierarchy*):\n\n classdef ::= [decorators] "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\nClasses can also be decorated; as with functions,\n\n @f1(arg)\n @f2\n class Foo: pass\n\nis equivalent to\n\n class Foo: pass\n Foo = f1(arg)(f2(Foo))\n\n**Programmer\'s note:** Variables defined in the class definition are\nclass variables; they are shared by instances. Instance variables can\nbe set in a method with ``self.name = value``. Both class and\ninstance 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. Descriptors can be used to create\ninstance variables with different implementation details.\n\nSee also:\n\n **PEP 3129** - Class Decorators\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', - 'comparisons': '\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 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,\nthe ``==`` and ``!=`` operators *always* consider objects of different\ntypes to be unequal, while the ``<``, ``>``, ``>=`` and ``<=``\noperators raise a ``TypeError`` when comparing objects of different\ntypes that do not implement these operators for the given pair of\ntypes. You can control comparison behavior of objects of non-builtin\ntypes by defining rich comparison methods like ``__gt__()``, described\nin section *Basic customization*.\n\nComparison of objects of the same type depends on the type:\n\n* Numbers are compared arithmetically.\n\n* The values ``float(\'NaN\')`` and ``Decimal(\'NaN\')`` are special. The\n are identical to themselves, ``x is x`` but are not equal to\n themselves, ``x != x``. Additionally, comparing any value to a\n not-a-number value will return ``False``. For example, both ``3 <\n float(\'NaN\')`` and ``float(\'NaN\') < 3`` will return ``False``.\n\n* Bytes objects are compared lexicographically using the numeric\n values of their elements.\n\n* Strings are compared lexicographically using the numeric equivalents\n (the result of the built-in function ``ord()``) of their characters.\n [3] String and bytes object can\'t be compared!\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. [4] Outcomes other than\n equality are resolved consistently, but are not otherwise defined.\n [5]\n\n* Sets and frozensets define comparison operators to mean subset and\n superset tests. Those relations do not define total orderings (the\n two sets ``{1,2}`` and {2,3} are not equal, nor subsets of one\n another, nor supersets of one another). Accordingly, sets are not\n appropriate arguments for functions which depend on total ordering.\n For example, ``min()``, ``max()``, and ``sorted()`` produce\n undefined results given a list of sets as inputs.\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\nComparison of objects of the differing types depends on whether either\nof the types provide explicit support for the comparison. Most\nnumberic types can be compared with one another, but comparisons of\n``float`` and ``Decimal`` are not supported to avoid the inevitable\nconfusion arising from representation issues such as ``float(\'1.1\')``\nbeing inexactly represented and therefore not exactly equal to\n``Decimal(\'1.1\')`` which is. When cross-type comparison is not\nsupported, the comparison method returns ``NotImplemented``. This can\ncreate the illusion of non-transitivity between supported cross-type\ncomparisons and unsupported comparisons. For example, ``Decimal(2) ==\n2`` and *2 == float(2)`* but ``Decimal(2) != float(2)``.\n\nThe operators ``in`` and ``not in`` test for membership. ``x in s``\nevaluates to true if *x* is a member of *s*, and false otherwise. ``x\nnot in s`` returns the negation of ``x in s``. All built-in sequences\nand set types support this as well as dictionary, for which ``in``\ntests whether a the dictionary has a given key. For container types\nsuch as list, tuple, set, frozenset, dict, or collections.deque, the\nexpression ``x in y`` equivalent to ``any(x is e or x == e for val e\nin y)``.\n\nFor the string and bytes types, ``x in y`` is true if and only if *x*\nis a substring of *y*. An equivalent test is ``y.find(x) != -1``.\nEmpty strings are always considered to be a substring of any other\nstring, so ``"" in "abc"`` will return ``True``.\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. [6]\n', + 'comparisons': '\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 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,\nthe ``==`` and ``!=`` operators *always* consider objects of different\ntypes to be unequal, while the ``<``, ``>``, ``>=`` and ``<=``\noperators raise a ``TypeError`` when comparing objects of different\ntypes that do not implement these operators for the given pair of\ntypes. You can control comparison behavior of objects of non-builtin\ntypes by defining rich comparison methods like ``__gt__()``, described\nin section *Basic customization*.\n\nComparison of objects of the same type depends on the type:\n\n* Numbers are compared arithmetically.\n\n* The values ``float(\'NaN\')`` and ``Decimal(\'NaN\')`` are special. The\n are identical to themselves, ``x is x`` but are not equal to\n themselves, ``x != x``. Additionally, comparing any value to a\n not-a-number value will return ``False``. For example, both ``3 <\n float(\'NaN\')`` and ``float(\'NaN\') < 3`` will return ``False``.\n\n* Bytes objects are compared lexicographically using the numeric\n values of their elements.\n\n* Strings are compared lexicographically using the numeric equivalents\n (the result of the built-in function ``ord()``) of their characters.\n [3] String and bytes object can\'t be compared!\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. [4] Outcomes other than\n equality are resolved consistently, but are not otherwise defined.\n [5]\n\n* Sets and frozensets define comparison operators to mean subset and\n superset tests. Those relations do not define total orderings (the\n two sets ``{1,2}`` and {2,3} are not equal, nor subsets of one\n another, nor supersets of one another). Accordingly, sets are not\n appropriate arguments for functions which depend on total ordering.\n For example, ``min()``, ``max()``, and ``sorted()`` produce\n undefined results given a list of sets as inputs.\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\nComparison of objects of the differing types depends on whether either\nof the types provide explicit support for the comparison. Most\nnumeric types can be compared with one another, but comparisons of\n``float`` and ``Decimal`` are not supported to avoid the inevitable\nconfusion arising from representation issues such as ``float(\'1.1\')``\nbeing inexactly represented and therefore not exactly equal to\n``Decimal(\'1.1\')`` which is. When cross-type comparison is not\nsupported, the comparison method returns ``NotImplemented``. This can\ncreate the illusion of non-transitivity between supported cross-type\ncomparisons and unsupported comparisons. For example, ``Decimal(2) ==\n2`` and *2 == float(2)`* but ``Decimal(2) != float(2)``.\n\nThe operators ``in`` and ``not in`` test for membership. ``x in s``\nevaluates to true if *x* is a member of *s*, and false otherwise. ``x\nnot in s`` returns the negation of ``x in s``. All built-in sequences\nand set types support this as well as dictionary, for which ``in``\ntests whether a the dictionary has a given key. For container types\nsuch as list, tuple, set, frozenset, dict, or collections.deque, the\nexpression ``x in y`` is equivalent to ``any(x is e or x == e for val\ne in y)``.\n\nFor the string and bytes types, ``x in y`` is true if and only if *x*\nis a substring of *y*. An equivalent test is ``y.find(x) != -1``.\nEmpty strings are always considered to be a substring of any other\nstring, so ``"" in "abc"`` will return ``True``.\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. [6]\n', 'compound': '\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, while the ``with`` statement\nallows the execution of initialization and finalization code around a\nblock of code. Function and class definitions are also syntactically\ncompound 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()`` calls 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 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 (see *Assignment statements*), and then the suite is\nexecuted. When the items are exhausted (which is immediately when the\nsequence is empty or an iterator raises a ``StopIteration``\nexception), the suite in the ``else`` clause, if present, is executed,\nand 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\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\nNames in the target list are not deleted when the loop is finished,\nbut if the sequence is empty, it will not have been assigned to at all\nby the loop. Hint: the built-in function ``range()`` returns an\niterator of integers suitable to emulate the effect of Pascal\'s ``for\ni := a to b do``; 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\n internal counter is used to keep track of which item is used next,\n and this is incremented on each iteration. When this counter has\n reached the length of the sequence the loop terminates. This means\n that if the suite deletes the current (or a previous) item from the\n sequence, the next item will be skipped (since it gets the index of\n the 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 ["as" target]] ":" suite)+\n ["else" ":" suite]\n ["finally" ":" suite]\n try2_stmt ::= "try" ":" suite\n "finally" ":" suite\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 or a tuple containing an item compatible with the\nexception.\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 after the ``as`` keyword in that except clause,\nif present, and the except clause\'s suite is executed. All except\nclauses must have an executable block. When the end of this block is\nreached, execution continues normally after the entire try statement.\n(This means that if two nested handlers exist for the same exception,\nand the exception occurs in the try clause of the inner handler, the\nouter handler will not handle the exception.)\n\nWhen an exception has been assigned using ``as target``, it is cleared\nat the end of the except clause. This is as if\n\n except E as N:\n foo\n\nwas translated to\n\n except E as N:\n try:\n foo\n finally:\n N = None\n del N\n\nThat means that you have to assign the exception to a different name\nif you want to be able to refer to it after the except clause. The\nreason for this is that with the traceback attached to them,\nexceptions will form a reference cycle with the stack frame, keeping\nall locals in that frame alive until the next garbage collection\noccurs.\n\nBefore an except clause\'s suite is executed, details about the\nexception are stored in the ``sys`` module and can be access via\n``sys.exc_info()``. ``sys.exc_info()`` returns a 3-tuple consisting\nof: ``exc_type``, the exception class; ``exc_value``, the exception\ninstance; ``exc_traceback``, a traceback object (see section *The\nstandard type hierarchy*) identifying the point in the program where\nthe exception occurred. ``sys.exc_info()`` values 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\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\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 funcdef ::= [decorators] "def" funcname "(" [parameter_list] ")" ["->" expression] ":" suite\n decorators ::= decorator+\n decorator ::= "@" dotted_name ["(" [argument_list [","]] ")"] NEWLINE\n dotted_name ::= identifier ("." identifier)*\n parameter_list ::= (defparameter ",")*\n ( "*" [parameter] ("," defparameter)*\n [, "**" parameter]\n | "**" parameter\n | defparameter [","] )\n parameter ::= identifier [":" expression]\n defparameter ::= parameter ["=" expression]\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 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 up until the "``*``" must also have a default value ---\nthis is a syntactic restriction 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. Parameters after "``*``" or "``*identifier``" are\nkeyword-only parameters and may only be passed used keyword arguments.\n\nParameters may have annotations of the form "``: expression``"\nfollowing the parameter name. Any parameter may have an annotation\neven those of the form ``*identifier`` or ``**identifier``. Functions\nmay have "return" annotation of the form "``-> expression``" after the\nparameter list. These annotations can be any valid Python expression\nand are evaluated when the function definition is executed.\nAnnotations may be evaluated in a different order than they appear in\nthe source code. The presence of annotations does not change the\nsemantics of a function. The annotation values are available as\nvalues of a dictionary keyed by the parameters\' names in the\n``__annotations__`` attribute of the function object.\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 and annotations.\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 ::= [decorators] "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\nClasses can also be decorated; as with functions,\n\n @f1(arg)\n @f2\n class Foo: pass\n\nis equivalent to\n\n class Foo: pass\n Foo = f1(arg)(f2(Foo))\n\n**Programmer\'s note:** Variables defined in the class definition are\nclass variables; they are shared by instances. Instance variables can\nbe set in a method with ``self.name = value``. Both class and\ninstance 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. Descriptors can be used to create\ninstance variables with different implementation details.\n\nSee also:\n\n **PEP 3129** - Class Decorators\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': '\nWith Statement Context Managers\n*******************************\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': '\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', @@ -42,7 +42,7 @@ 'if': '\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': '\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': '\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 3.0 are ``absolute_import``,\n``division``, ``generators``, ``unicode_literals``,\n``print_function``, ``nested_scopes`` and ``with_statement``. They\nare all redundant because they are always enabled, and only kept for\nbackwards compatibility.\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 calls to the builtin functions ``exec()`` and\n``compile()`` that occur in a module ``M`` containing a future\nstatement will, by default, use the new syntax or semantics associated\nwith the future statement. This can be controlled by optional\narguments to ``compile()`` --- see the documentation of that function\nfor 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': '\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 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,\nthe ``==`` and ``!=`` operators *always* consider objects of different\ntypes to be unequal, while the ``<``, ``>``, ``>=`` and ``<=``\noperators raise a ``TypeError`` when comparing objects of different\ntypes that do not implement these operators for the given pair of\ntypes. You can control comparison behavior of objects of non-builtin\ntypes by defining rich comparison methods like ``__gt__()``, described\nin section *Basic customization*.\n\nComparison of objects of the same type depends on the type:\n\n* Numbers are compared arithmetically.\n\n* The values ``float(\'NaN\')`` and ``Decimal(\'NaN\')`` are special. The\n are identical to themselves, ``x is x`` but are not equal to\n themselves, ``x != x``. Additionally, comparing any value to a\n not-a-number value will return ``False``. For example, both ``3 <\n float(\'NaN\')`` and ``float(\'NaN\') < 3`` will return ``False``.\n\n* Bytes objects are compared lexicographically using the numeric\n values of their elements.\n\n* Strings are compared lexicographically using the numeric equivalents\n (the result of the built-in function ``ord()``) of their characters.\n [3] String and bytes object can\'t be compared!\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. [4] Outcomes other than\n equality are resolved consistently, but are not otherwise defined.\n [5]\n\n* Sets and frozensets define comparison operators to mean subset and\n superset tests. Those relations do not define total orderings (the\n two sets ``{1,2}`` and {2,3} are not equal, nor subsets of one\n another, nor supersets of one another). Accordingly, sets are not\n appropriate arguments for functions which depend on total ordering.\n For example, ``min()``, ``max()``, and ``sorted()`` produce\n undefined results given a list of sets as inputs.\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\nComparison of objects of the differing types depends on whether either\nof the types provide explicit support for the comparison. Most\nnumberic types can be compared with one another, but comparisons of\n``float`` and ``Decimal`` are not supported to avoid the inevitable\nconfusion arising from representation issues such as ``float(\'1.1\')``\nbeing inexactly represented and therefore not exactly equal to\n``Decimal(\'1.1\')`` which is. When cross-type comparison is not\nsupported, the comparison method returns ``NotImplemented``. This can\ncreate the illusion of non-transitivity between supported cross-type\ncomparisons and unsupported comparisons. For example, ``Decimal(2) ==\n2`` and *2 == float(2)`* but ``Decimal(2) != float(2)``.\n\nThe operators ``in`` and ``not in`` test for membership. ``x in s``\nevaluates to true if *x* is a member of *s*, and false otherwise. ``x\nnot in s`` returns the negation of ``x in s``. All built-in sequences\nand set types support this as well as dictionary, for which ``in``\ntests whether a the dictionary has a given key. For container types\nsuch as list, tuple, set, frozenset, dict, or collections.deque, the\nexpression ``x in y`` equivalent to ``any(x is e or x == e for val e\nin y)``.\n\nFor the string and bytes types, ``x in y`` is true if and only if *x*\nis a substring of *y*. An equivalent test is ``y.find(x) != -1``.\nEmpty strings are always considered to be a substring of any other\nstring, so ``"" in "abc"`` will return ``True``.\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. [6]\n', + 'in': '\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 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,\nthe ``==`` and ``!=`` operators *always* consider objects of different\ntypes to be unequal, while the ``<``, ``>``, ``>=`` and ``<=``\noperators raise a ``TypeError`` when comparing objects of different\ntypes that do not implement these operators for the given pair of\ntypes. You can control comparison behavior of objects of non-builtin\ntypes by defining rich comparison methods like ``__gt__()``, described\nin section *Basic customization*.\n\nComparison of objects of the same type depends on the type:\n\n* Numbers are compared arithmetically.\n\n* The values ``float(\'NaN\')`` and ``Decimal(\'NaN\')`` are special. The\n are identical to themselves, ``x is x`` but are not equal to\n themselves, ``x != x``. Additionally, comparing any value to a\n not-a-number value will return ``False``. For example, both ``3 <\n float(\'NaN\')`` and ``float(\'NaN\') < 3`` will return ``False``.\n\n* Bytes objects are compared lexicographically using the numeric\n values of their elements.\n\n* Strings are compared lexicographically using the numeric equivalents\n (the result of the built-in function ``ord()``) of their characters.\n [3] String and bytes object can\'t be compared!\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. [4] Outcomes other than\n equality are resolved consistently, but are not otherwise defined.\n [5]\n\n* Sets and frozensets define comparison operators to mean subset and\n superset tests. Those relations do not define total orderings (the\n two sets ``{1,2}`` and {2,3} are not equal, nor subsets of one\n another, nor supersets of one another). Accordingly, sets are not\n appropriate arguments for functions which depend on total ordering.\n For example, ``min()``, ``max()``, and ``sorted()`` produce\n undefined results given a list of sets as inputs.\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\nComparison of objects of the differing types depends on whether either\nof the types provide explicit support for the comparison. Most\nnumeric types can be compared with one another, but comparisons of\n``float`` and ``Decimal`` are not supported to avoid the inevitable\nconfusion arising from representation issues such as ``float(\'1.1\')``\nbeing inexactly represented and therefore not exactly equal to\n``Decimal(\'1.1\')`` which is. When cross-type comparison is not\nsupported, the comparison method returns ``NotImplemented``. This can\ncreate the illusion of non-transitivity between supported cross-type\ncomparisons and unsupported comparisons. For example, ``Decimal(2) ==\n2`` and *2 == float(2)`* but ``Decimal(2) != float(2)``.\n\nThe operators ``in`` and ``not in`` test for membership. ``x in s``\nevaluates to true if *x* is a member of *s*, and false otherwise. ``x\nnot in s`` returns the negation of ``x in s``. All built-in sequences\nand set types support this as well as dictionary, for which ``in``\ntests whether a the dictionary has a given key. For container types\nsuch as list, tuple, set, frozenset, dict, or collections.deque, the\nexpression ``x in y`` is equivalent to ``any(x is e or x == e for val\ne in y)``.\n\nFor the string and bytes types, ``x in y`` is true if and only if *x*\nis a substring of *y*. An equivalent test is ``y.find(x) != -1``.\nEmpty strings are always considered to be a substring of any other\nstring, so ``"" in "abc"`` will return ``True``.\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. [6]\n', 'integers': '\nInteger literals\n****************\n\nInteger literals are described by the following lexical definitions:\n\n integer ::= decimalinteger | octinteger | hexinteger | bininteger\n decimalinteger ::= nonzerodigit digit* | "0"+\n nonzerodigit ::= "1"..."9"\n digit ::= "0"..."9"\n octinteger ::= "0" ("o" | "O") octdigit+\n hexinteger ::= "0" ("x" | "X") hexdigit+\n bininteger ::= "0" ("b" | "B") bindigit+\n octdigit ::= "0"..."7"\n hexdigit ::= digit | "a"..."f" | "A"..."F"\n bindigit ::= "0" | "1"\n\nThere is no limit for the length of integer literals apart from what\ncan be stored in available memory.\n\nNote that leading zeros in a non-zero decimal number are not allowed.\nThis is for disambiguation with C-style octal literals, which Python\nused before version 3.0.\n\nSome examples of integer literals:\n\n 7 2147483647 0o177 0b100110111\n 3 79228162514264337593543950336 0o377 0x100000000\n 79228162514264337593543950336 0xdeadbeef\n', 'lambda': '\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': '\nList displays\n*************\n\nA list display is a possibly empty series of expressions enclosed in\nsquare brackets:\n\n list_display ::= "[" [expression_list | comprehension] "]"\n\nA list display yields a new list object, the contents being specified\nby either a list of expressions or a comprehension. When a comma-\nseparated list of expressions is supplied, its elements are evaluated\nfrom left to right and placed into the list object in that order.\nWhen a comprehension is supplied, the list is constructed from the\nelements resulting from the comprehension.\n', Modified: python/branches/release30-maint/Misc/NEWS ============================================================================== --- python/branches/release30-maint/Misc/NEWS (original) +++ python/branches/release30-maint/Misc/NEWS Wed Dec 3 18:15:13 2008 @@ -7,7 +7,7 @@ What's New in Python 3.0 final ============================== -*Release date: XX-XXX-2008* +*Release date: 03-Dec-2008* Core and Builtins ----------------- @@ -58,8 +58,8 @@ Build ----- -- Issue #4407: Fix source file that caused the compileall step in Windows installer - to fail. +- Issue #4407: Fix source file that caused the compileall step in Windows + installer to fail. Docs ---- Modified: python/branches/release30-maint/Misc/RPM/python-3.0.spec ============================================================================== --- python/branches/release30-maint/Misc/RPM/python-3.0.spec (original) +++ python/branches/release30-maint/Misc/RPM/python-3.0.spec Wed Dec 3 18:15:13 2008 @@ -34,7 +34,7 @@ %define name python #--start constants-- -%define version 3.0rc3 +%define version 3.0 %define libver 3.0 #--end constants-- %define release 1pydotorg Modified: python/branches/release30-maint/README ============================================================================== --- python/branches/release30-maint/README (original) +++ python/branches/release30-maint/README Wed Dec 3 18:15:13 2008 @@ -1,56 +1,38 @@ -This is Python version 3.0 release candidate 3 -============================================== +This is Python version 3.0 final +================================ For notes specific to this release, see RELNOTES in this directory. Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 Python Software Foundation. All rights reserved. -Python 3000 (a.k.a. "Py3k", and released as Python 3.0) is a new -version of the language, which is incompatible with the 2.x line of -releases. The language is mostly the same, but many details, -especially how built-in objects like dictionaries and strings work, -have changed considerably, and a lot of deprecated features have -finally been removed. - -This is an ongoing project; the cleanup isn't expected to be complete -until some time in 2008. In particular there are plans to reorganize -the standard library namespace. - - -Release Schedule ----------------- - -The release plan is to have a series of alpha releases in 2007 and 2008, -beta releases in 2008, and a final release in October 2008. The alpha -releases are primarily aimed at developers who want a sneak peek at the -new langauge, especially those folks who plan to port their code to -Python 3000. The hope is that by the time of the final release, many -3rd party packages will already be available in a 3.0-compatible form. - -See PEP 361 for release details: http://www.python.org/dev/peps/pep-0361/ +Python 3 (a.k.a. "Python 3000" or "Py3k", and released as Python 3.0) is a new +version of the language, which is incompatible with the 2.x line of releases. +The language is mostly the same, but many details, especially how built-in +objects like dictionaries and strings work, have changed considerably, and a +lot of deprecated features have finally been removed. Documentation ------------- -Documentation for Python 3000 is online, updated twice a day: +Documentation for Python 3.0 is online, updated twice a day: http://docs.python.org/dev/3.0/ All documentation is also available online at the Python web site -(http://docs.python.org/, see below). It is available online for -occasional reference, or can be downloaded in many formats for faster -access. The documentation is downloadable in HTML, PostScript, PDF, -LaTeX (through 2.5), and reStructuredText (2.6+) formats; the LaTeX and -reStructuredText versions are primarily for documentation authors, +(http://docs.python.org/, see below). It is available online for occasional +reference, and it can be downloaded in many formats for faster local access. +The documentation is downloadable in HTML, PostScript, PDF, LaTeX (through +2.5), and reStructuredText (2.6, 3.0, and going forward) formats; the LaTeX +and reStructuredText versions are primarily for documentation authors, translators, and people with special formatting requirements. This is a work in progress; please help improve it! -The design documents for Python 3000 are also online. While the -reference documentation is being updated, the PEPs are often the best -source of information about new features. Start by reading PEP 3000: +The design documents for Python 3 are also online. While the reference +documentation is being updated, the PEPs are often the best source of +information about new features. Start by reading PEP 3000: http://python.org/dev/peps/pep-3000/ @@ -58,21 +40,20 @@ What's New ---------- -For an overview of what's new in Python 3000, see Guido van Rossum's -blog at artima.com: +For an overview of what's new in Python 3.0, see Guido van Rossum's blog at +artima.com: http://www.artima.com/weblogs/index.jsp?blogger=guido -We try to eventually have a comprehensive overview of the changes in -the "What's New in Python 3.0" document, found at +We try to eventually have a comprehensive overview of the changes in the +"What's New in Python 3.0" document, found at http://docs.python.org/dev/3.0/whatsnew/3.0 -Please help write it! +Please help improve it! -For a more detailed change log, read Misc/NEWS (though this file, too, -is incomplete, and also doesn't list anything merged in from the 2.6 -release under development). +For a more detailed change log, read Misc/NEWS, though this file, too, is +incomplete, and also doesn't list anything merged in from the 2.6 release. If you want to install multiple versions of Python see the section below entitled "Installing multiple versions". @@ -82,8 +63,8 @@ ------------------------- If you have a proposal to change Python, you may want to send an email to the -comp.lang.python or python-ideas mailing lists for inital feedback. A Python -Enhancement Proposal (PEP) may be submitted if your idea gains ground. All +comp.lang.python or python-ideas mailing lists for initial feedback. A Python +Enhancement Proposal (PEP) may be submitted if your idea gains ground. All current PEPs, as well as guidelines for submitting a new PEP, are listed at http://www.python.org/dev/peps/. @@ -91,33 +72,8 @@ Converting From Python 2.x to 3.0 --------------------------------- -Python 2.6 (to be released concurrent with Python 3.0) will contain features -to help locating code that needs to be changed, such as optional warnings when -deprecated features are used, and backported versions of certain key Python -3000 features. - - -Installing multiple versions ----------------------------- - -On Unix and Mac systems if you intend to install multiple versions of Python -using the same installation prefix (--prefix argument to the configure -script) you must take care that your primary python executable is not -overwritten by the installation of a different versio. All files and -directories installed using "make altinstall" contain the major and minor -version and can thus live side-by-side. "make install" also creates -${prefix}/bin/python which refers to ${prefix}/bin/pythonX.Y. If you intend -to install multiple versions using the same prefix you must decide which -version (if any) is your "primary" version. Install that version using -"make install". Install all other versions using "make altinstall". - -For example, if you want to install Python 2.5, 2.6 and 3.0 with 2.6 being -the primary version, you would execute "make install" in your 2.6 build -directory and "make altinstall" in the others. - - -Configuration options and variables ------------------------------------ +Python 2.6 contains features to help locating and updating code that needs to +be changed when migrating to Python 3. A source-to-source translation tool, "2to3", can take care of the mundane task of converting large amounts of source code. It is not a @@ -127,21 +83,40 @@ http://svn.python.org/view/sandbox/trunk/2to3/ +Installing multiple versions +---------------------------- + +On Unix and Mac systems if you intend to install multiple versions of Python +using the same installation prefix (--prefix argument to the configure script) +you must take care that your primary python executable is not overwritten by +the installation of a different version. All files and directories installed +using "make altinstall" contain the major and minor version and can thus live +side-by-side. "make install" also creates ${prefix}/bin/python which refers +to ${prefix}/bin/pythonX.Y. If you intend to install multiple versions using +the same prefix you must decide which version (if any) is your "primary" +version. Install that version using "make install". Install all other +versions using "make altinstall". + +For example, if you want to install Python 2.5, 2.6 and 3.0 with 2.6 being the +primary version, you would execute "make install" in your 2.6 build directory +and "make altinstall" in the others. + + Issue Tracker and Mailing List ------------------------------ -We're soliciting bug reports about all aspects of the language. Fixes -are also welcome, preferable in unified diff format. Please use the -issue tracker: +We're soliciting bug reports about all aspects of the language. Fixes are +also welcome, preferable in unified diff format. Please use the issue +tracker: http://bugs.python.org/ -If you're not sure whether you're dealing with a bug or a feature, use -the mailing list: +If you're not sure whether you're dealing with a bug or a feature, use the +mailing list: python-3000 at python.org -To subscribe to the list, use the mailman form: +To subscribe to the list, use the Mailman form: http://mail.python.org/mailman/listinfo/python-3000/ Modified: python/branches/release30-maint/RELNOTES ============================================================================== --- python/branches/release30-maint/RELNOTES (original) +++ python/branches/release30-maint/RELNOTES Wed Dec 3 18:15:13 2008 @@ -23,7 +23,7 @@ * The email package needs quite a bit of work to make it consistent with respect to bytes and strings. There have been discussions on - email-sig at python.org about where to go with the email package for 3.0, but - this was not resolved in time for 3.0 final. With enough care though, the - email package in Python 3.0 should be about as usable as it is with Python - 2. + email-sig at python.org about where to go with the email package for Python + 3.0, but this was not resolved in time for 3.0 final. With enough care + though, the email package in Python 3.0 should be about as usable as it is + with Python 2. From python-checkins at python.org Wed Dec 3 18:20:02 2008 From: python-checkins at python.org (barry.warsaw) Date: Wed, 3 Dec 2008 18:20:02 +0100 (CET) Subject: [Python-checkins] r67504 - python/tags/r30 Message-ID: <20081203172002.612F91E4002@bag.python.org> Author: barry.warsaw Date: Wed Dec 3 18:20:02 2008 New Revision: 67504 Log: Tagging for 3.0 final. Added: python/tags/r30/ - copied from r67503, /python/branches/release30-maint/ From python-checkins at python.org Wed Dec 3 18:29:10 2008 From: python-checkins at python.org (barry.warsaw) Date: Wed, 3 Dec 2008 18:29:10 +0100 (CET) Subject: [Python-checkins] r67505 - python/tags/r30 Message-ID: <20081203172910.3A7191E4002@bag.python.org> Author: barry.warsaw Date: Wed Dec 3 18:29:10 2008 New Revision: 67505 Log: Oops, one revision we forgot. Removed: python/tags/r30/ From python-checkins at python.org Wed Dec 3 18:29:25 2008 From: python-checkins at python.org (barry.warsaw) Date: Wed, 3 Dec 2008 18:29:25 +0100 (CET) Subject: [Python-checkins] r67506 - python/tags/r30 Message-ID: <20081203172925.B43241E4002@bag.python.org> Author: barry.warsaw Date: Wed Dec 3 18:29:25 2008 New Revision: 67506 Log: Re-tagging. Added: python/tags/r30/ - copied from r67505, /python/branches/release30-maint/ From buildbot at python.org Wed Dec 3 18:35:40 2008 From: buildbot at python.org (buildbot at python.org) Date: Wed, 03 Dec 2008 17:35:40 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.0 Message-ID: <20081203173540.8293E1E4002@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/693 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: barry.warsaw,christian.heimes,georg.brandl,guido.van.rossum,raymond.hettinger 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 Wed Dec 3 19:38:13 2008 From: python-checkins at python.org (barry.warsaw) Date: Wed, 3 Dec 2008 19:38:13 +0100 (CET) Subject: [Python-checkins] r67509 - sandbox/trunk/release/release.py Message-ID: <20081203183813.20EAB1E4002@bag.python.org> Author: barry.warsaw Date: Wed Dec 3 19:38:12 2008 New Revision: 67509 Log: configure.in needs to be changed when bumping the major version (well, second digit). Modified: sandbox/trunk/release/release.py Modified: sandbox/trunk/release/release.py ============================================================================== --- sandbox/trunk/release/release.py (original) +++ sandbox/trunk/release/release.py Wed Dec 3 19:38:12 2008 @@ -164,9 +164,12 @@ constant_replace('Lib/distutils/__init__.py', new, '#', '') print 'done' + extra_work = False other_files = ['README', 'Misc/NEWS'] if tag.patch == 0 and tag.level == "a" and tag.serial == 0: + extra_work = True other_files += [ + 'configure.in', 'Doc/tutorial/interpreter.rst', 'Doc/tutorial/stdlib.rst', 'Doc/tutorial/stdlib2.rst', @@ -181,6 +184,8 @@ manual_edit(fn) print 'Bumped revision' + if extra_work: + print 'configure.in has change; re-run autotools !' print 'Please commit and use --tag' @@ -250,8 +255,9 @@ print 'Removing .hgignore and .bzrignore' for name in ('.hgignore', '.bzrignore'): try: - os.unlink(os.path.join('dist', name)) - except OSError: pass + os.unlink(name) + except OSError: + pass print 'Touching Python-ast.h and Python-ast.c' for name in ('Include/Python-ast.h', 'Python/Python-ast.c'): os.utime(name, None) From buildbot at python.org Wed Dec 3 19:40:35 2008 From: buildbot at python.org (buildbot at python.org) Date: Wed, 03 Dec 2008 18:40:35 +0000 Subject: [Python-checkins] buildbot failure in amd64 gentoo 3.0 Message-ID: <20081203184035.A853B1E4002@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/1340 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: christian.heimes BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_doctest make: *** [buildbottest] Error 1 sincerely, -The Buildbot From python-checkins at python.org Wed Dec 3 19:42:03 2008 From: python-checkins at python.org (barry.warsaw) Date: Wed, 3 Dec 2008 19:42:03 +0100 (CET) Subject: [Python-checkins] r67510 - peps/trunk/pep-0101.txt Message-ID: <20081203184203.C24C01E4002@bag.python.org> Author: barry.warsaw Date: Wed Dec 3 19:42:03 2008 New Revision: 67510 Log: updates based on 3.0 final release Modified: peps/trunk/pep-0101.txt Modified: peps/trunk/pep-0101.txt ============================================================================== --- peps/trunk/pep-0101.txt (original) +++ peps/trunk/pep-0101.txt Wed Dec 3 19:42:03 2008 @@ -122,10 +122,49 @@ use your judgement, taking into account whether you are making an alpha, beta, or final release. + ___ If this is a final major release, branch the tree for X.Y + + 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 the release from this new + branch. + + % svn co \ + svn+ssh://pythondev at svn.python.org/python/branches/release26-maint + + ___ cd release26-maint # cd into the branch directory. + + ___ Set the original trunk up to be the next release. + + % .../sandbox/release/release.py --bump 2.7a0 + + ___ Edit all version references in the README + + ___ Move any historical "what's new" entries from Misc/NEWS to + Misc/HISTORY. + + ___ The LICENSE file. Add the pending version to the list of + releases, and be sure to check the release dates. + + ___ There's a copy of the license in Doc/license.rst + + ___ 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 + each one reference to '[Pp]ython26'. + + ___ Update the version number in configure.in and re-run autoconf. + ___ 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``. + ``build/pydoc-topics/pydoc-topics.py`` to ``../Lib/pydoc_topics.py``. ___ Bump version numbers via the release script. @@ -141,20 +180,6 @@ 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: - - ___ The LICENSE file. Add the pending version to the list of releases, - and be sure to check the release dates. - - ___ There's a copy of the license in Doc/license.rst - - ___ 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 - each one reference to '[Pp]ython26'. - ___ Check the years on the copyright notice. If the last release was some time last year, add the current year to the copyright notice in several places: @@ -172,9 +197,6 @@ contains what purports to be an HTML-ized copy of the LICENSE file from the distribution. BROKEN - ___ For major releases (e.g. 2.6 final), move any historical "what's - new" entries from Misc/NEWS to Misc/HISTORY. - ___ Check with the IDLE maintainer to be sure that Lib/idlelib/NEWS.txt has been similarly updated. @@ -193,24 +215,6 @@ For a final release, the RM may block at this point waiting for confirmation from the Experts. - ___ If this is a final major release, branch the tree for X.YaZ - - 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 - directory and you want to keep it straight from your trunk working - directory. E.g. - - % svn co \ - svn+ssh://pythondev at svn.python.org/python/branches/release26-maint - - ___ cd release26-maint # cd into the branch directory. - ___ XXX The WE builds the Windows helpfile, using (in Doc/) either $ make htmlhelp (on Unix) From buildbot at python.org Wed Dec 3 19:58:51 2008 From: buildbot at python.org (buildbot at python.org) Date: Wed, 03 Dec 2008 18:58:51 +0000 Subject: [Python-checkins] buildbot failure in sparc Debian 3.0 Message-ID: <20081203185851.4750B1E4002@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/731 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: barry.warsaw,christian.heimes,georg.brandl,guido.van.rossum,raymond.hettinger BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_site ====================================================================== FAIL: test_s_option (test.test_site.HelperFunctionsTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/pybot/buildarea-sid/3.0.klose-debian-sparc/build/Lib/test/test_site.py", line 101, in test_s_option self.assert_(usersite in sys.path) AssertionError: None make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Wed Dec 3 22:01:17 2008 From: buildbot at python.org (buildbot at python.org) Date: Wed, 03 Dec 2008 21:01:17 +0000 Subject: [Python-checkins] buildbot failure in sparc Ubuntu 3.0 Message-ID: <20081203210117.634821E4002@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/818 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: christian.heimes BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_doctest make: *** [buildbottest] Error 1 sincerely, -The Buildbot From python-checkins at python.org Thu Dec 4 00:22:58 2008 From: python-checkins at python.org (vinay.sajip) Date: Thu, 4 Dec 2008 00:22:58 +0100 (CET) Subject: [Python-checkins] r67511 - in python/trunk: Doc/library/logging.rst Lib/logging/__init__.py Lib/test/test_logging.py Misc/NEWS Message-ID: <20081203232258.7526A1E4002@bag.python.org> Author: vinay.sajip Date: Thu Dec 4 00:22:58 2008 New Revision: 67511 Log: Issue #4384: Added integration with warnings module using captureWarnings(). This change includes a NullHandler which does nothing; it will be of use to library developers who want to avoid the "No handlers could be found for logger XXX" message which can appear if the library user doesn't configure logging. Modified: python/trunk/Doc/library/logging.rst python/trunk/Lib/logging/__init__.py python/trunk/Lib/test/test_logging.py python/trunk/Misc/NEWS Modified: python/trunk/Doc/library/logging.rst ============================================================================== --- python/trunk/Doc/library/logging.rst (original) +++ python/trunk/Doc/library/logging.rst Thu Dec 4 00:22:58 2008 @@ -461,6 +461,12 @@ libraries, then the logger name specified can be "orgname.foo" rather than just "foo". +.. versionadded:: 2.7 + +The :class:`NullHandler` class was not present in previous versions, but is now +included, so that it need not be defined in library code. + + Logging Levels -------------- @@ -553,6 +559,15 @@ #. :class:`HTTPHandler` instances send error messages to an HTTP server using either ``GET`` or ``POST`` semantics. +#. :class:`NullHandler` instances do nothing with error messages. They are used + by library developers who want to use logging, but want to avoid the "No + handlers could be found for logger XXX" message which can be displayed if + the library user has not configured logging. + +.. versionadded:: 2.7 + +The :class:`NullHandler` class was not present in previous versions. + The :class:`StreamHandler` and :class:`FileHandler` classes are defined in the core logging package. The other handlers are defined in a sub- module, :mod:`logging.handlers`. (There is also another sub-module, Modified: python/trunk/Lib/logging/__init__.py ============================================================================== --- python/trunk/Lib/logging/__init__.py (original) +++ python/trunk/Lib/logging/__init__.py Thu Dec 4 00:22:58 2008 @@ -46,8 +46,8 @@ __author__ = "Vinay Sajip " __status__ = "production" -__version__ = "0.5.0.5" -__date__ = "24 January 2008" +__version__ = "0.5.0.6" +__date__ = "03 December 2008" #--------------------------------------------------------------------------- # Miscellaneous module data @@ -1488,3 +1488,58 @@ old_exit(status) sys.exit = exithook + +# Null handler + +class NullHandler(Handler): + """ + This handler does nothing. It's intended to be used to avoid the + "No handlers could be found for logger XXX" one-off warning. This is + important for library code, which may contain code to log events. If a user + of the library does not configure logging, the one-off warning might be + produced; to avoid this, the library developer simply needs to instantiate + a NullHandler and add it to the top-level logger of the library module or + package. + """ + def emit(self, record): + pass + +# Warnings integration + +_warnings_showwarning = None + +def _showwarning(message, category, filename, lineno, file=None, line=None): + """ + Implementation of showwarnings which redirects to logging, which will first + check to see if the file parameter is None. If a file is specified, it will + delegate to the original warnings implementation of showwarning. Otherwise, + it will call warnings.formatwarning and will log the resulting string to a + warnings logger named "py.warnings" with level logging.WARNING. + """ + if file is not None: + if _warnings_showwarning is not None: + _warnings_showwarning(message, category, filename, lineno, file, line) + else: + import warnings + s = warnings.formatwarning(message, category, filename, lineno, line) + logger = getLogger("py.warnings") + if not logger.handlers: + logger.addHandler(NullHandler()) + logger.warning("%s", s) + +def captureWarnings(capture): + """ + If capture is true, redirect all warnings to the logging package. + If capture is False, ensure that warnings are not redirected to logging + but to their original destinations. + """ + import warnings + global _warnings_showwarning + if capture: + if _warnings_showwarning is None: + _warnings_showwarning = warnings.showwarning + warnings.showwarning = _showwarning + else: + if _warnings_showwarning is not None: + warnings.showwarning = _warnings_showwarning + _warnings_showwarning = None Modified: python/trunk/Lib/test/test_logging.py ============================================================================== --- python/trunk/Lib/test/test_logging.py (original) +++ python/trunk/Lib/test/test_logging.py Thu Dec 4 00:22:58 2008 @@ -18,7 +18,7 @@ """Test harness for the logging module. Run all tests. -Copyright (C) 2001-2002 Vinay Sajip. All Rights Reserved. +Copyright (C) 2001-2008 Vinay Sajip. All Rights Reserved. """ import logging @@ -44,6 +44,7 @@ import time import types import unittest +import warnings import weakref @@ -885,6 +886,32 @@ if os.path.isfile(fn): os.remove(fn) +class WarningsTest(BaseTest): + def test_warnings(self): + logging.captureWarnings(True) + warnings.filterwarnings("always", category=UserWarning) + try: + file = cStringIO.StringIO() + h = logging.StreamHandler(file) + logger = logging.getLogger("py.warnings") + logger.addHandler(h) + warnings.warn("I'm warning you...") + logger.removeHandler(h) + s = file.getvalue() + h.close() + self.assertTrue(s.find("UserWarning: I'm warning you...\n") > 0) + + #See if an explicit file uses the original implementation + file = cStringIO.StringIO() + warnings.showwarning("Explicit", UserWarning, "dummy.py", 42, file, + "Dummy line") + s = file.getvalue() + file.close() + self.assertEqual(s, "dummy.py:42: UserWarning: Explicit\n Dummy line\n") + finally: + warnings.resetwarnings() + logging.captureWarnings(False) + # Set the locale to the platform-dependent default. I have no idea # why the test does this, but in any case we save the current locale # first and restore it at the end. @@ -893,7 +920,7 @@ run_unittest(BuiltinLevelsTest, BasicFilterTest, CustomLevelsAndFiltersTest, MemoryHandlerTest, ConfigFileTest, SocketHandlerTest, MemoryTest, - EncodingTest) + EncodingTest, WarningsTest) if __name__ == "__main__": test_main() Modified: python/trunk/Misc/NEWS ============================================================================== --- python/trunk/Misc/NEWS (original) +++ python/trunk/Misc/NEWS Thu Dec 4 00:22:58 2008 @@ -22,7 +22,7 @@ - Issue #4367: Python would segfault during compiling when the unicodedata module couldn't be imported and \N escapes were present. -- Issue #4233: Changed semantic of ``_fileio.FileIO``'s ``close()`` +- Issue #4233: Changed semantic of ``_fileio.FileIO``'s ``close()`` method on file objects with closefd=False. The file descriptor is still kept open but the file object behaves like a closed file. The ``FileIO`` object also got a new readonly attribute ``closefd``. @@ -60,6 +60,12 @@ Library ------- +- Issue #4384: Added integration with warnings module using captureWarnings(). + This change includes a NullHandler which does nothing; it will be of use to + library developers who want to avoid the "No handlers could be found for + logger XXX" message which can appear if the library user doesn't configure + logging. + - Issue #3741: DISTUTILS_USE_SDK set causes msvc9compiler.py to raise an exception. From python-checkins at python.org Thu Dec 4 00:27:39 2008 From: python-checkins at python.org (vinay.sajip) Date: Thu, 4 Dec 2008 00:27:39 +0100 (CET) Subject: [Python-checkins] r67511 - svn:log Message-ID: <20081203232739.94C291E4002@bag.python.org> Author: vinay.sajip Revision: 67511 Property Name: svn:log Action: modified Property diff: --- old property value +++ new property value @@ -1 +1 @@ -Issue #4384: Added integration with warnings module using captureWarnings(). This change includes a NullHandler which does nothing; it will be of use to library developers who want to avoid the "No handlers could be found for logger XXX" message which can appear if the library user doesn't configure logging. \ No newline at end of file +Issue #4384: Added logging integration with warnings module using captureWarnings(). This change includes a NullHandler which does nothing; it will be of use to library developers who want to avoid the "No handlers could be found for logger XXX" message which can appear if the library user doesn't configure logging. \ No newline at end of file From buildbot at python.org Thu Dec 4 01:19:25 2008 From: buildbot at python.org (buildbot at python.org) Date: Thu, 04 Dec 2008 00:19:25 +0000 Subject: [Python-checkins] buildbot failure in x86 W2k8 3.0 Message-ID: <20081204001925.9E6BB1E4002@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/481 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': Build Source Stamp: [branch branches/py3k] HEAD Blamelist: BUILD FAILED: failed compile sincerely, -The Buildbot From python-checkins at python.org Thu Dec 4 02:58:34 2008 From: python-checkins at python.org (barry.warsaw) Date: Thu, 4 Dec 2008 02:58:34 +0100 (CET) Subject: [Python-checkins] r67512 - in python/branches/release30-maint: Include/patchlevel.h Misc/NEWS Message-ID: <20081204015834.4ACA81E4002@bag.python.org> Author: barry.warsaw Date: Thu Dec 4 02:58:34 2008 New Revision: 67512 Log: post release bump Modified: python/branches/release30-maint/Include/patchlevel.h python/branches/release30-maint/Misc/NEWS Modified: python/branches/release30-maint/Include/patchlevel.h ============================================================================== --- python/branches/release30-maint/Include/patchlevel.h (original) +++ python/branches/release30-maint/Include/patchlevel.h Thu Dec 4 02:58:34 2008 @@ -23,7 +23,7 @@ #define PY_RELEASE_SERIAL 0 /* Version as a string */ -#define PY_VERSION "3.0" +#define PY_VERSION "3.0+" /*--end constants--*/ /* Subversion Revision number of this file (not of the repository) */ Modified: python/branches/release30-maint/Misc/NEWS ============================================================================== --- python/branches/release30-maint/Misc/NEWS (original) +++ python/branches/release30-maint/Misc/NEWS Thu Dec 4 02:58:34 2008 @@ -4,6 +4,18 @@ (editors: check NEWS.help for information about editing NEWS using ReST.) +What's New in Python 3.0.1? +=========================== + +*Release date: XX-XXX-200X* + +Core and Builtins +----------------- + +Library +------- + + What's New in Python 3.0 final ============================== From python-checkins at python.org Thu Dec 4 02:59:41 2008 From: python-checkins at python.org (barry.warsaw) Date: Thu, 4 Dec 2008 02:59:41 +0100 (CET) Subject: [Python-checkins] r67513 - peps/trunk/pep-0101.txt Message-ID: <20081204015941.C2B451E4002@bag.python.org> Author: barry.warsaw Date: Thu Dec 4 02:59:41 2008 New Revision: 67513 Log: minor fix Modified: peps/trunk/pep-0101.txt Modified: peps/trunk/pep-0101.txt ============================================================================== --- peps/trunk/pep-0101.txt (original) +++ peps/trunk/pep-0101.txt Thu Dec 4 02:59:41 2008 @@ -411,7 +411,7 @@ the new release. ___ Mention the release as the most recent stable one in - `doc/faq/general.ht` (section "How stable is Python?") + `doc/faq/general/content.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' From python-checkins at python.org Thu Dec 4 03:20:19 2008 From: python-checkins at python.org (barry.warsaw) Date: Thu, 4 Dec 2008 03:20:19 +0100 (CET) Subject: [Python-checkins] r67514 - peps/trunk/pep-0361.txt Message-ID: <20081204022019.E51121E4002@bag.python.org> Author: barry.warsaw Date: Thu Dec 4 03:20:19 2008 New Revision: 67514 Log: 3.0 final is released Modified: peps/trunk/pep-0361.txt Modified: peps/trunk/pep-0361.txt ============================================================================== --- peps/trunk/pep-0361.txt (original) +++ peps/trunk/pep-0361.txt Thu Dec 4 03:20:19 2008 @@ -63,7 +63,7 @@ Oct 01 2008: Python 2.6 final released Nov 06 2008: Python 3.0rc2 released Nov 21 2008: Python 3.0rc3 released - Dec 03 2008: Python 3.0 final planned + Dec 03 2008: Python 3.0 final released See the public `Google calendar`_ From python-checkins at python.org Thu Dec 4 03:59:52 2008 From: python-checkins at python.org (barry.warsaw) Date: Thu, 4 Dec 2008 03:59:52 +0100 (CET) Subject: [Python-checkins] r67515 - in python/branches/release26-maint: Include/patchlevel.h Lib/distutils/__init__.py Lib/idlelib/idlever.py Lib/pydoc_topics.py Misc/NEWS Misc/RPM/python-2.6.spec README Message-ID: <20081204025952.ECBA51E4002@bag.python.org> Author: barry.warsaw Date: Thu Dec 4 03:59:51 2008 New Revision: 67515 Log: Prep for 2.6.1 Modified: python/branches/release26-maint/Include/patchlevel.h python/branches/release26-maint/Lib/distutils/__init__.py python/branches/release26-maint/Lib/idlelib/idlever.py python/branches/release26-maint/Lib/pydoc_topics.py python/branches/release26-maint/Misc/NEWS python/branches/release26-maint/Misc/RPM/python-2.6.spec python/branches/release26-maint/README Modified: python/branches/release26-maint/Include/patchlevel.h ============================================================================== --- python/branches/release26-maint/Include/patchlevel.h (original) +++ python/branches/release26-maint/Include/patchlevel.h Thu Dec 4 03:59:51 2008 @@ -22,12 +22,12 @@ /*--start constants--*/ #define PY_MAJOR_VERSION 2 #define PY_MINOR_VERSION 6 -#define PY_MICRO_VERSION 0 +#define PY_MICRO_VERSION 1 #define PY_RELEASE_LEVEL PY_RELEASE_LEVEL_FINAL #define PY_RELEASE_SERIAL 0 /* Version as a string */ -#define PY_VERSION "2.6+" +#define PY_VERSION "2.6.1" /*--end constants--*/ /* Subversion Revision number of this file (not of the repository) */ Modified: python/branches/release26-maint/Lib/distutils/__init__.py ============================================================================== --- python/branches/release26-maint/Lib/distutils/__init__.py (original) +++ python/branches/release26-maint/Lib/distutils/__init__.py Thu Dec 4 03:59:51 2008 @@ -22,5 +22,5 @@ # #--start constants-- -__version__ = "2.6" +__version__ = "2.6.1" #--end constants-- Modified: python/branches/release26-maint/Lib/idlelib/idlever.py ============================================================================== --- python/branches/release26-maint/Lib/idlelib/idlever.py (original) +++ python/branches/release26-maint/Lib/idlelib/idlever.py Thu Dec 4 03:59:51 2008 @@ -1 +1 @@ -IDLE_VERSION = "2.6" +IDLE_VERSION = "2.6.1" 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 Thu Dec 4 03:59:51 2008 @@ -1,9 +1,9 @@ -# Autogenerated by Sphinx on Thu Oct 2 17:24:06 2008 +# Autogenerated by Sphinx on Wed Dec 3 21:11:28 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', '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 ``__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-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* Nonempty *__slots__* does not work for classes derived from\n "variable-length" built-in types such as ``long``, ``str`` and\n ``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 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', @@ -20,7 +20,7 @@ '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', + '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 [("as" | ",") 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', @@ -43,9 +43,9 @@ '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``.\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', + '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.6 are ``unicode_literals``,\n``print_function``, ``absolute_import``, ``division``, ``generators``,\n``nested_scopes`` and ``with_statement``. ``generators``,\n``with_statement``, ``nested_scopes`` are redundant in Python version\n2.6 and above because they are always enabled.\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', + '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 | bininteger\n decimalinteger ::= nonzerodigit digit* | "0"\n octinteger ::= "0" ("o" | "O") octdigit+ | "0" octdigit+\n hexinteger ::= "0" ("x" | "X") hexdigit+\n bininteger ::= "0" ("b" | "B") bindigit+\n nonzerodigit ::= "1"..."9"\n octdigit ::= "0"..."7"\n bindigit ::= "0" | "1"\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', @@ -63,16 +63,16 @@ '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 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', + '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* Nonempty *__slots__* does not work for classes derived from\n "variable-length" built-in types such as ``long``, ``str`` and\n ``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 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', + '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 [("as" | ",") 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 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 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', + '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 Test for the presence of *key* in the dictionary. ``has_key()``\n is deprecated in favor of ``key in d``.\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 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', Modified: python/branches/release26-maint/Misc/NEWS ============================================================================== --- python/branches/release26-maint/Misc/NEWS (original) +++ python/branches/release26-maint/Misc/NEWS Thu Dec 4 03:59:51 2008 @@ -4,10 +4,10 @@ (editors: check NEWS.help for information about editing NEWS using ReST.) -What's New in Python 2.6.1 alpha 1 -================================== +What's New in Python 2.6.1 +========================== -*Release date: XX-XXX-2008* +*Release date: 04-Dec-2008* Core and Builtins ----------------- Modified: python/branches/release26-maint/Misc/RPM/python-2.6.spec ============================================================================== --- python/branches/release26-maint/Misc/RPM/python-2.6.spec (original) +++ python/branches/release26-maint/Misc/RPM/python-2.6.spec Thu Dec 4 03:59:51 2008 @@ -34,7 +34,7 @@ %define name python #--start constants-- -%define version 2.6 +%define version 2.6.1 %define libver 2.6 #--end constants-- %define release 1pydotorg Modified: python/branches/release26-maint/README ============================================================================== --- python/branches/release26-maint/README (original) +++ python/branches/release26-maint/README Thu Dec 4 03:59:51 2008 @@ -1,5 +1,5 @@ -This is Python version 2.6 -========================== +This is Python version 2.6.1 +============================ Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 Python Software Foundation. From python-checkins at python.org Thu Dec 4 04:00:26 2008 From: python-checkins at python.org (barry.warsaw) Date: Thu, 4 Dec 2008 04:00:26 +0100 (CET) Subject: [Python-checkins] r67516 - python/tags/r261 Message-ID: <20081204030026.5624A1E4002@bag.python.org> Author: barry.warsaw Date: Thu Dec 4 04:00:25 2008 New Revision: 67516 Log: Tagging for 2.6.1 Added: python/tags/r261/ - copied from r67515, /python/branches/release26-maint/ From martin at v.loewis.de Thu Dec 4 08:36:11 2008 From: martin at v.loewis.de (=?ISO-8859-1?Q?=22Martin_v=2E_L=F6wis=22?=) Date: Thu, 04 Dec 2008 08:36:11 +0100 Subject: [Python-checkins] Merging mailing lists Message-ID: <4937886B.4000002@v.loewis.de> I would like to merge mailing lists, now that the design and first implementation of Python 3000 is complete. In particular, I would like to merge the python-3000 mailing list back into python-dev, and the python-3000-checkins mailing list back into python-checkins. The rationale is to simplify usage of the lists, and to avoid cross-postings. To implement this, all subscribers of the 3000 mailing lists would be added to the trunk mailing lists (avoiding duplicates, of course), and all automated messages going to python-3000-checkins would then be directed to the trunk lists. The 3000 mailing lists would change into read-only mode (i.e. primarily leaving the archives behind). Any objections? Regards, Martin From fdrake at gmail.com Thu Dec 4 09:04:27 2008 From: fdrake at gmail.com (Fred Drake) Date: Thu, 4 Dec 2008 03:04:27 -0500 Subject: [Python-checkins] Merging mailing lists In-Reply-To: <4937886B.4000002@v.loewis.de> References: <4937886B.4000002@v.loewis.de> Message-ID: <9cee7ab80812040004r54cce844lbd3728d99dc780d8@mail.gmail.com> On Thu, Dec 4, 2008 at 2:36 AM, "Martin v. L?wis" wrote: > I would like to merge mailing lists, now that the design and first > implementation of Python 3000 is complete. In particular, I would +1 -Fred -- Fred L. Drake, Jr. "Chaos is the score upon which reality is written." --Henry Miller From buildbot at python.org Thu Dec 4 09:57:04 2008 From: buildbot at python.org (buildbot at python.org) Date: Thu, 04 Dec 2008 08:57:04 +0000 Subject: [Python-checkins] buildbot failure in ARM Linux EABI 2.5 Message-ID: <20081204085704.CFA801E4002@bag.python.org> The Buildbot has detected a new failure of ARM Linux EABI 2.5. Full details are available at: http://www.python.org/dev/buildbot/all/ARM%20Linux%20EABI%202.5/builds/14 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-linux-armeabi Build Reason: The web-page 'rebuild' button was pressed by '': Build Source Stamp: [branch branches/release25-maint] HEAD Blamelist: amaury.forgeotdarc BUILD FAILED: failed svn sincerely, -The Buildbot From ncoghlan at gmail.com Thu Dec 4 12:07:02 2008 From: ncoghlan at gmail.com (Nick Coghlan) Date: Thu, 04 Dec 2008 21:07:02 +1000 Subject: [Python-checkins] r67511 - in python/trunk: Doc/library/logging.rst Lib/logging/__init__.py Lib/test/test_logging.py Misc/NEWS In-Reply-To: <20081203232258.7526A1E4002@bag.python.org> References: <20081203232258.7526A1E4002@bag.python.org> Message-ID: <4937B9D6.3020906@gmail.com> vinay.sajip wrote: > +def _showwarning(message, category, filename, lineno, file=None, line=None): > + """ > + Implementation of showwarnings which redirects to logging, which will first > + check to see if the file parameter is None. If a file is specified, it will > + delegate to the original warnings implementation of showwarning. Otherwise, > + it will call warnings.formatwarning and will log the resulting string to a > + warnings logger named "py.warnings" with level logging.WARNING. > + """ > + if file is not None: > + if _warnings_showwarning is not None: > + _warnings_showwarning(message, category, filename, lineno, file, line) > + else: > + import warnings > + s = warnings.formatwarning(message, category, filename, lineno, line) > + logger = getLogger("py.warnings") > + if not logger.handlers: > + logger.addHandler(NullHandler()) > + logger.warning("%s", s) I'd be careful here - this could deadlock if a thread spawned as a side effect of importing a module happens to trigger a warning. warnings is pulled into sys.modules as part of the interpreter startup - having a global "import warnings" shouldn't have any real effect on logging's import time. Cheers, Nick. -- Nick Coghlan | ncoghlan at gmail.com | Brisbane, Australia --------------------------------------------------------------- From jeremy at alum.mit.edu Thu Dec 4 14:24:57 2008 From: jeremy at alum.mit.edu (Jeremy Hylton) Date: Thu, 4 Dec 2008 08:24:57 -0500 Subject: [Python-checkins] [Python-3000] Merging mailing lists In-Reply-To: <4937886B.4000002@v.loewis.de> References: <4937886B.4000002@v.loewis.de> Message-ID: On Thu, Dec 4, 2008 at 2:36 AM, "Martin v. L?wis" wrote: > I would like to merge mailing lists, now that the design and first > implementation of Python 3000 is complete. In particular, I would > like to merge the python-3000 mailing list back into python-dev, > and the python-3000-checkins mailing list back into python-checkins. > The rationale is to simplify usage of the lists, and to avoid > cross-postings. +1 > To implement this, all subscribers of the 3000 mailing lists would > be added to the trunk mailing lists (avoiding duplicates, of course), > and all automated messages going to python-3000-checkins would then > be directed to the trunk lists. The 3000 mailing lists would change > into read-only mode (i.e. primarily leaving the archives behind). > > Any objections? No Jeremy > Regards, > Martin > _______________________________________________ > Python-3000 mailing list > Python-3000 at python.org > http://mail.python.org/mailman/listinfo/python-3000 > Unsubscribe: http://mail.python.org/mailman/options/python-3000/jeremy%40alum.mit.edu > From python-checkins at python.org Thu Dec 4 14:49:55 2008 From: python-checkins at python.org (georg.brandl) Date: Thu, 4 Dec 2008 14:49:55 +0100 (CET) Subject: [Python-checkins] r67518 - python/branches/release30-maint/Misc/build.sh Message-ID: <20081204134955.188511E4002@bag.python.org> Author: georg.brandl Date: Thu Dec 4 14:49:54 2008 New Revision: 67518 Log: Update upload location for stable 3.0 docs. Modified: python/branches/release30-maint/Misc/build.sh Modified: python/branches/release30-maint/Misc/build.sh ============================================================================== --- python/branches/release30-maint/Misc/build.sh (original) +++ python/branches/release30-maint/Misc/build.sh Thu Dec 4 14:49:54 2008 @@ -50,7 +50,7 @@ #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/3.0" +REMOTE_DIR="/data/ftp.python.org/pub/www.python.org/doc/3.0" RESULT_FILE="$DIR/build/index.html" INSTALL_DIR="/tmp/python-test-3.0/local" RSYNC_OPTS="-aC -e ssh" From python-checkins at python.org Thu Dec 4 15:29:52 2008 From: python-checkins at python.org (christian.heimes) Date: Thu, 4 Dec 2008 15:29:52 +0100 (CET) Subject: [Python-checkins] r67520 - peps/trunk/pep-0101.txt Message-ID: <20081204142952.101B61E4002@bag.python.org> Author: christian.heimes Date: Thu Dec 4 15:29:51 2008 New Revision: 67520 Log: Explain how to bump up the version numbers for Windows builds Modified: peps/trunk/pep-0101.txt Modified: peps/trunk/pep-0101.txt ============================================================================== --- peps/trunk/pep-0101.txt (original) +++ peps/trunk/pep-0101.txt Thu Dec 4 15:29:51 2008 @@ -161,6 +161,13 @@ ___ Update the version number in configure.in and re-run autoconf. + ___ Update the version numbers for the Windows builds in PC/ and + PCbuild/, which have references to python26. + + % find PC/ PCbuild/ \( -type f -and -not -wholename '*/.svn/*' \) | xargs sed -i 's/python26/python27/g' + % svn mv PC/os2emx/python26.def PC/os2emx/python27.def + + ___ Regenerate Lib/pydoc-topics.py cd to the Doc directory and type ``make pydoc-topics``. Then copy From python-checkins at python.org Thu Dec 4 15:34:40 2008 From: python-checkins at python.org (christian.heimes) Date: Thu, 4 Dec 2008 15:34:40 +0100 (CET) Subject: [Python-checkins] r67521 - in python/trunk/PC: VS7.1/pythoncore.vcproj VS7.1/readme.txt VS8.0/pyproject.vsprops example_nt/example.vcproj os2emx/Makefile os2emx/README.os2emx os2emx/python26.def os2emx/python27.def Message-ID: <20081204143440.80BFB1E4002@bag.python.org> Author: christian.heimes Date: Thu Dec 4 15:34:40 2008 New Revision: 67521 Log: Bumped up 2.6 to 2.7 Added: python/trunk/PC/os2emx/python27.def (contents, props changed) - copied, changed from r67518, /python/trunk/PC/os2emx/python26.def Removed: python/trunk/PC/os2emx/python26.def Modified: python/trunk/PC/VS7.1/pythoncore.vcproj python/trunk/PC/VS7.1/readme.txt python/trunk/PC/VS8.0/pyproject.vsprops python/trunk/PC/example_nt/example.vcproj python/trunk/PC/os2emx/Makefile python/trunk/PC/os2emx/README.os2emx Modified: python/trunk/PC/VS7.1/pythoncore.vcproj ============================================================================== --- python/trunk/PC/VS7.1/pythoncore.vcproj (original) +++ python/trunk/PC/VS7.1/pythoncore.vcproj Thu Dec 4 15:34:40 2008 @@ -39,15 +39,15 @@ @@ -99,15 +99,15 @@ @@ -166,15 +166,15 @@ Name="VCLinkerTool" AdditionalOptions=" /MACHINE:IA64 /USELINK:MS_SDK" AdditionalDependencies="getbuildinfo.o" - OutputFile="./python26.dll" + OutputFile="./python27.dll" LinkIncremental="1" SuppressStartupBanner="FALSE" IgnoreDefaultLibraryNames="libc" GenerateDebugInformation="TRUE" - ProgramDatabaseFile=".\./python26.pdb" + ProgramDatabaseFile=".\./python27.pdb" SubSystem="2" BaseAddress="0x1e000000" - ImportLibrary=".\./python26.lib" + ImportLibrary=".\./python27.lib" TargetMachine="0"/> @@ -233,15 +233,15 @@ Name="VCLinkerTool" AdditionalOptions=" /MACHINE:AMD64 /USELINK:MS_SDK" AdditionalDependencies="getbuildinfo.o" - OutputFile="./python26.dll" + OutputFile="./python27.dll" LinkIncremental="1" SuppressStartupBanner="TRUE" IgnoreDefaultLibraryNames="libc" GenerateDebugInformation="TRUE" - ProgramDatabaseFile=".\./python26.pdb" + ProgramDatabaseFile=".\./python27.pdb" SubSystem="2" BaseAddress="0x1e000000" - ImportLibrary=".\./python26.lib" + ImportLibrary=".\./python27.lib" TargetMachine="0"/> Modified: python/trunk/PC/VS7.1/readme.txt ============================================================================== --- python/trunk/PC/VS7.1/readme.txt (original) +++ python/trunk/PC/VS7.1/readme.txt Thu Dec 4 15:34:40 2008 @@ -12,7 +12,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) NOTE: in previous releases, this subproject was named after the release number, e.g. python20. @@ -26,7 +26,7 @@ test slave; see SUBPROJECTS below) When using the Debug setting, the output files have a _d added to -their name: python26_d.dll, python_d.exe, parser_d.pyd, and so on. +their name: python27_d.dll, python_d.exe, parser_d.pyd, and so on. SUBPROJECTS ----------- Modified: python/trunk/PC/VS8.0/pyproject.vsprops ============================================================================== --- python/trunk/PC/VS8.0/pyproject.vsprops (original) +++ python/trunk/PC/VS8.0/pyproject.vsprops Thu Dec 4 15:34:40 2008 @@ -38,7 +38,7 @@ /> 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/1343 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: christian.heimes BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_smtplib make: *** [buildbottest] Error 1 sincerely, -The Buildbot From barry at python.org Thu Dec 4 16:01:06 2008 From: barry at python.org (Barry Warsaw) Date: Thu, 4 Dec 2008 10:01:06 -0500 Subject: [Python-checkins] r67520 - peps/trunk/pep-0101.txt In-Reply-To: <20081204142952.101B61E4002@bag.python.org> References: <20081204142952.101B61E4002@bag.python.org> Message-ID: -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Dec 4, 2008, at 9:29 AM, christian.heimes wrote: > Author: christian.heimes > Date: Thu Dec 4 15:29:51 2008 > New Revision: 67520 > > Log: > Explain how to bump up the version numbers for Windows builds > > Modified: > peps/trunk/pep-0101.txt > > Modified: peps/trunk/pep-0101.txt > = > = > = > = > = > = > = > = > ====================================================================== > --- peps/trunk/pep-0101.txt (original) > +++ peps/trunk/pep-0101.txt Thu Dec 4 15:29:51 2008 > @@ -161,6 +161,13 @@ > > ___ Update the version number in configure.in and re-run > autoconf. > > + ___ Update the version numbers for the Windows builds in > PC/ and > + PCbuild/, which have references to python26. > + > + % find PC/ PCbuild/ \( -type f -and -not -wholename > '*/.svn/*' \) | xargs sed -i 's/python26/python27/g' > + % svn mv PC/os2emx/python26.def PC/os2emx/python27.def > + > + > Can you add this to release.py? - -Barry -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (Darwin) iQCVAwUBSTfwsnEjvBPtnXfVAQLkWAP8C5ZuIAHVh9XMOQ9+eJn0w72ScI9ThFRr Wwpy1RUpJgb80Tw/6W6Zh13w14G1hg0zaYoHiSOeacVzbP1iPtkhrgfS2NENqQ9m Tp0E8KXOF1wUzb6c1jzcnILYrf9e/dLIjCto255BdKnOEoP7FfQHRhzwS8b9HbRw Ffh+8efEfGQ= =mTfi -----END PGP SIGNATURE----- From buildbot at python.org Thu Dec 4 16:08:59 2008 From: buildbot at python.org (buildbot at python.org) Date: Thu, 04 Dec 2008 15:08:59 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.0 Message-ID: <20081204150859.BD5461E4002@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/697 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: 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/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 Thu Dec 4 16:52:18 2008 From: buildbot at python.org (buildbot at python.org) Date: Thu, 04 Dec 2008 15:52:18 +0000 Subject: [Python-checkins] buildbot failure in sparc Ubuntu 3.0 Message-ID: <20081204155218.2CF861E400C@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/820 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: christian.heimes 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 Dec 4 16:53:23 2008 From: buildbot at python.org (buildbot at python.org) Date: Thu, 04 Dec 2008 15:53:23 +0000 Subject: [Python-checkins] buildbot failure in sparc Debian 3.0 Message-ID: <20081204155323.3D0EF1E400C@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/734 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: christian.heimes BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_tarfile make: *** [buildbottest] Error 1 sincerely, -The Buildbot From python-checkins at python.org Thu Dec 4 16:55:40 2008 From: python-checkins at python.org (fred.drake) Date: Thu, 4 Dec 2008 16:55:40 +0100 (CET) Subject: [Python-checkins] r67524 - in python/branches/release30-maint: Doc/whatsnew/3.0.rst Message-ID: <20081204155540.B59D11E4022@bag.python.org> Author: fred.drake Date: Thu Dec 4 16:55:40 2008 New Revision: 67524 Log: Merged revisions 67522-67523 via svnmerge from svn+ssh://pythondev at svn.python.org/python/branches/py3k ........ r67522 | andrew.kuchling | 2008-12-04 10:07:14 -0500 (Thu, 04 Dec 2008) | 1 line Wording change (flaunt -> disobey); markup fixes. The largest edit is to the paragraph on relative imports; please review. (Backport candidate) ........ r67523 | fred.drake | 2008-12-04 10:28:51 -0500 (Thu, 04 Dec 2008) | 3 lines - fix markup error - remove silly emoticon ........ Modified: python/branches/release30-maint/ (props changed) python/branches/release30-maint/Doc/whatsnew/3.0.rst Modified: python/branches/release30-maint/Doc/whatsnew/3.0.rst ============================================================================== --- python/branches/release30-maint/Doc/whatsnew/3.0.rst (original) +++ python/branches/release30-maint/Doc/whatsnew/3.0.rst Thu Dec 4 16:55:40 2008 @@ -456,10 +456,11 @@ * The :keyword:`from` *module* :keyword:`import` ``*`` syntax is only allowed at the module level, no longer inside functions. -* The only acceptable syntax for relative imports is :keyword:`from` - ``.``[*module*] :keyword:`import` *name*; :keyword:`import` forms - not starting with ``.`` are always interpreted as absolute imports. - (:pep:`0328`) +* The only acceptable syntaxes for relative imports are :keyword:`from` + ``.`` :keyword:`import` *name* or + :keyword:`from` ``.module`` :keyword:`import` *name*. + :keyword:`import` forms not starting with ``.`` are always + interpreted as absolute imports. (:pep:`0328`) * Classic classes are gone. @@ -559,8 +560,8 @@ release schedule. However, the package is alive and well, externally maintained at http://www.jcea.es/programacion/pybsddb.htm. -* Some modules were renamed because their old name flaunted - :pep:`0008`, or for various other reasons: +* Some modules were renamed because their old name disobeyed + :pep:`0008`, or for various other reasons. Here's the list: ======================= ======================= Old Name New Name @@ -607,7 +608,7 @@ really care about :mod:`tkinter`. Also note that as of Python 2.6, the functionality of :mod:`turtle` has been greatly enhanced. - * :mod:`urllib` (:mod:`urllib`, :mod:`urllib`2, :mod:`urlparse`, + * :mod:`urllib` (:mod:`urllib`, :mod:`urllib2`, :mod:`urlparse`, :mod:`robotparse`). * :mod:`xmlrpc` (:mod:`xmlrpclib`, :mod:`DocXMLRPCServer`, @@ -649,7 +650,7 @@ * :data:`string.letters` and its friends (:data:`string.lowercase` and :data:`string.uppercase`) are gone. Use :data:`string.ascii_letters` etc. instead. (The reason for the - removal is that :data:string.letters` and friends had + removal is that :data:`string.letters` and friends had locale-specific behavior, which is a bad idea for such attractively-named global "constants".) @@ -702,8 +703,8 @@ :attr:`__traceback__` attribute (see below). * :pep:`3110`: Catching exceptions. You must now use - *:keyword:`except` SomeException* :keyword:`as` *variable* instead - *of :keyword:`except` *SomeException*, variable*. Moreover, the + :keyword:`except` *SomeException* :keyword:`as` *variable* instead + of :keyword:`except` *SomeException*, *variable*. Moreover, the *variable* is explicitly deleted when the :keyword:`except` block is left. @@ -725,7 +726,7 @@ traceback printed when an unhandled exception occurs walks the chain of :attr:`__cause__` and :attr:`__context__` attributes and prints a separate traceback for each component of the chain, with the primary - exception at the top. (Java users may recognize this behavior. :-) + exception at the top. (Java users may recognize this behavior.) * :pep:`3134`: Exception objects now store their traceback as the :attr:`__traceback__` attribute. This means that an exception From brett at python.org Thu Dec 4 18:37:05 2008 From: brett at python.org (Brett Cannon) Date: Thu, 4 Dec 2008 09:37:05 -0800 Subject: [Python-checkins] [Python-3000-checkins] Merging mailing lists In-Reply-To: <4937886B.4000002@v.loewis.de> References: <4937886B.4000002@v.loewis.de> Message-ID: On Wed, Dec 3, 2008 at 23:36, "Martin v. L?wis" wrote: > I would like to merge mailing lists, now that the design and first > implementation of Python 3000 is complete. In particular, I would > like to merge the python-3000 mailing list back into python-dev, > and the python-3000-checkins mailing list back into python-checkins. > The rationale is to simplify usage of the lists, and to avoid > cross-postings. > > To implement this, all subscribers of the 3000 mailing lists would > be added to the trunk mailing lists (avoiding duplicates, of course), > and all automated messages going to python-3000-checkins would then > be directed to the trunk lists. The 3000 mailing lists would change > into read-only mode (i.e. primarily leaving the archives behind). > > Any objections? > Nope; +1. -Brett From python-checkins at python.org Thu Dec 4 19:25:18 2008 From: python-checkins at python.org (fred.drake) Date: Thu, 4 Dec 2008 19:25:18 +0100 (CET) Subject: [Python-checkins] r67528 - in python/trunk: Lib/cgi.py Lib/test/test_cgi.py Misc/NEWS Message-ID: <20081204182518.13EB51E4037@bag.python.org> Author: fred.drake Date: Thu Dec 4 19:25:17 2008 New Revision: 67528 Log: Issue #1055234: cgi.parse_header(): Fixed parsing of header parameters to support unusual filenames (such as those containing semi-colons) in Content-Disposition headers. Modified: python/trunk/Lib/cgi.py python/trunk/Lib/test/test_cgi.py python/trunk/Misc/NEWS Modified: python/trunk/Lib/cgi.py ============================================================================== --- python/trunk/Lib/cgi.py (original) +++ python/trunk/Lib/cgi.py Thu Dec 4 19:25:17 2008 @@ -289,16 +289,28 @@ return partdict +def _parseparam(s): + while s[:1] == ';': + s = s[1:] + end = s.find(';') + while end > 0 and s.count('"', 0, end) % 2: + end = s.find(';', end + 1) + if end < 0: + end = len(s) + f = s[:end] + yield f.strip() + s = s[end:] + def parse_header(line): """Parse a Content-type like header. Return the main content-type and a dictionary of options. """ - plist = [x.strip() for x in line.split(';')] - key = plist.pop(0).lower() + parts = _parseparam(';' + line) + key = parts.next() pdict = {} - for p in plist: + for p in parts: i = p.find('=') if i >= 0: name = p[:i].strip().lower() Modified: python/trunk/Lib/test/test_cgi.py ============================================================================== --- python/trunk/Lib/test/test_cgi.py (original) +++ python/trunk/Lib/test/test_cgi.py Thu Dec 4 19:25:17 2008 @@ -354,6 +354,32 @@ self.assertEqual([('a', 'A1'), ('b', 'B2'), ('B', 'B3')], cgi.parse_qsl('a=A1&b=B2&B=B3')) + def test_parse_header(self): + self.assertEqual( + cgi.parse_header("text/plain"), + ("text/plain", {})) + self.assertEqual( + cgi.parse_header("text/vnd.just.made.this.up ; "), + ("text/vnd.just.made.this.up", {})) + self.assertEqual( + cgi.parse_header("text/plain;charset=us-ascii"), + ("text/plain", {"charset": "us-ascii"})) + self.assertEqual( + cgi.parse_header('text/plain ; charset="us-ascii"'), + ("text/plain", {"charset": "us-ascii"})) + self.assertEqual( + cgi.parse_header('text/plain ; charset="us-ascii"; another=opt'), + ("text/plain", {"charset": "us-ascii", "another": "opt"})) + self.assertEqual( + cgi.parse_header('attachment; filename="silly.txt"'), + ("attachment", {"filename": "silly.txt"})) + self.assertEqual( + cgi.parse_header('attachment; filename="strange;name"'), + ("attachment", {"filename": "strange;name"})) + self.assertEqual( + cgi.parse_header('attachment; filename="strange;name";size=123;'), + ("attachment", {"filename": "strange;name", "size": "123"})) + def test_main(): run_unittest(CgiTests) Modified: python/trunk/Misc/NEWS ============================================================================== --- python/trunk/Misc/NEWS (original) +++ python/trunk/Misc/NEWS Thu Dec 4 19:25:17 2008 @@ -60,6 +60,10 @@ Library ------- +- Issue #1055234: cgi.parse_header(): Fixed parsing of header parameters to + support unusual filenames (such as those containing semi-colons) in + Content-Disposition headers. + - Issue #4384: Added integration with warnings module using captureWarnings(). This change includes a NullHandler which does nothing; it will be of use to library developers who want to avoid the "No handlers could be found for From buildbot at python.org Thu Dec 4 19:53:49 2008 From: buildbot at python.org (buildbot at python.org) Date: Thu, 04 Dec 2008 18:53:49 +0000 Subject: [Python-checkins] buildbot failure in x86 osx.5 trunk Message-ID: <20081204185350.273A31E405A@bag.python.org> The Buildbot has detected a new failure of x86 osx.5 trunk. Full details are available at: http://www.python.org/dev/buildbot/all/x86%20osx.5%20trunk/builds/363 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: heller-x86-osx5 Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: fred.drake BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_socket ====================================================================== ERROR: testShutdown (test.test_socket.BasicTCPTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/trunk.heller-x86-osx5/build/Lib/test/test_socket.py", line 120, in _tearDown self.fail(msg) AssertionError: [Errno 57] Socket is not connected make: *** [buildbottest] Error 1 sincerely, -The Buildbot From python-checkins at python.org Thu Dec 4 19:54:06 2008 From: python-checkins at python.org (georg.brandl) Date: Thu, 4 Dec 2008 19:54:06 +0100 (CET) Subject: [Python-checkins] r67531 - python/trunk/Doc/tutorial/controlflow.rst Message-ID: <20081204185406.09E151E403B@bag.python.org> Author: georg.brandl Date: Thu Dec 4 19:54:05 2008 New Revision: 67531 Log: Add reference to enumerate() to indices example. Modified: python/trunk/Doc/tutorial/controlflow.rst Modified: python/trunk/Doc/tutorial/controlflow.rst ============================================================================== --- python/trunk/Doc/tutorial/controlflow.rst (original) +++ python/trunk/Doc/tutorial/controlflow.rst Thu Dec 4 19:54:05 2008 @@ -104,8 +104,8 @@ >>> range(-10, -100, -30) [-10, -40, -70] -To iterate over the indices of a sequence, combine :func:`range` and :func:`len` -as follows:: +To iterate over the indices of a sequence, you can combine :func:`range` and +:func:`len` as follows:: >>> a = ['Mary', 'had', 'a', 'little', 'lamb'] >>> for i in range(len(a)): @@ -117,6 +117,9 @@ 3 little 4 lamb +In most such cases, however, it is convenient to use the :func:`enumerate` +function, see :ref:`tut-loopidioms`. + .. _tut-break: From python-checkins at python.org Thu Dec 4 19:59:16 2008 From: python-checkins at python.org (georg.brandl) Date: Thu, 4 Dec 2008 19:59:16 +0100 (CET) Subject: [Python-checkins] r67532 - python/trunk/Doc/library/heapq.rst Message-ID: <20081204185916.B4B261E4002@bag.python.org> Author: georg.brandl Date: Thu Dec 4 19:59:16 2008 New Revision: 67532 Log: Add another heapq example. Modified: python/trunk/Doc/library/heapq.rst Modified: python/trunk/Doc/library/heapq.rst ============================================================================== --- python/trunk/Doc/library/heapq.rst (original) +++ python/trunk/Doc/library/heapq.rst Thu Dec 4 19:59:16 2008 @@ -88,6 +88,21 @@ >>> print data == ordered True +Using a heap to insert items at the correct place in a priority queue: + + >>> heap = [] + >>> data = [(1, 'J'), (4, 'N'), (3, 'H'), (2, 'O')] + >>> for item in data: + ... heappush(heap, item) + ... + >>> while heap: + ... print heappop(heap)[1] + J + O + H + N + + The module also offers three general purpose functions based on heaps. From python-checkins at python.org Thu Dec 4 20:01:29 2008 From: python-checkins at python.org (fred.drake) Date: Thu, 4 Dec 2008 20:01:29 +0100 (CET) Subject: [Python-checkins] r67533 - in python/branches/release26-maint: Lib/cgi.py Lib/test/test_cgi.py Misc/NEWS Message-ID: <20081204190129.1866E1E400C@bag.python.org> Author: fred.drake Date: Thu Dec 4 20:01:28 2008 New Revision: 67533 Log: Merged revisions 67528 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r67528 | fred.drake | 2008-12-04 13:25:17 -0500 (Thu, 04 Dec 2008) | 4 lines Issue #1055234: cgi.parse_header(): Fixed parsing of header parameters to support unusual filenames (such as those containing semi-colons) in Content-Disposition headers. ........ Modified: python/branches/release26-maint/ (props changed) python/branches/release26-maint/Lib/cgi.py python/branches/release26-maint/Lib/test/test_cgi.py python/branches/release26-maint/Misc/NEWS Modified: python/branches/release26-maint/Lib/cgi.py ============================================================================== --- python/branches/release26-maint/Lib/cgi.py (original) +++ python/branches/release26-maint/Lib/cgi.py Thu Dec 4 20:01:28 2008 @@ -289,16 +289,28 @@ return partdict +def _parseparam(s): + while s[:1] == ';': + s = s[1:] + end = s.find(';') + while end > 0 and s.count('"', 0, end) % 2: + end = s.find(';', end + 1) + if end < 0: + end = len(s) + f = s[:end] + yield f.strip() + s = s[end:] + def parse_header(line): """Parse a Content-type like header. Return the main content-type and a dictionary of options. """ - plist = [x.strip() for x in line.split(';')] - key = plist.pop(0).lower() + parts = _parseparam(';' + line) + key = parts.next() pdict = {} - for p in plist: + for p in parts: i = p.find('=') if i >= 0: name = p[:i].strip().lower() Modified: python/branches/release26-maint/Lib/test/test_cgi.py ============================================================================== --- python/branches/release26-maint/Lib/test/test_cgi.py (original) +++ python/branches/release26-maint/Lib/test/test_cgi.py Thu Dec 4 20:01:28 2008 @@ -354,6 +354,32 @@ self.assertEqual([('a', 'A1'), ('b', 'B2'), ('B', 'B3')], cgi.parse_qsl('a=A1&b=B2&B=B3')) + def test_parse_header(self): + self.assertEqual( + cgi.parse_header("text/plain"), + ("text/plain", {})) + self.assertEqual( + cgi.parse_header("text/vnd.just.made.this.up ; "), + ("text/vnd.just.made.this.up", {})) + self.assertEqual( + cgi.parse_header("text/plain;charset=us-ascii"), + ("text/plain", {"charset": "us-ascii"})) + self.assertEqual( + cgi.parse_header('text/plain ; charset="us-ascii"'), + ("text/plain", {"charset": "us-ascii"})) + self.assertEqual( + cgi.parse_header('text/plain ; charset="us-ascii"; another=opt'), + ("text/plain", {"charset": "us-ascii", "another": "opt"})) + self.assertEqual( + cgi.parse_header('attachment; filename="silly.txt"'), + ("attachment", {"filename": "silly.txt"})) + self.assertEqual( + cgi.parse_header('attachment; filename="strange;name"'), + ("attachment", {"filename": "strange;name"})) + self.assertEqual( + cgi.parse_header('attachment; filename="strange;name";size=123;'), + ("attachment", {"filename": "strange;name", "size": "123"})) + def test_main(): run_unittest(CgiTests) Modified: python/branches/release26-maint/Misc/NEWS ============================================================================== --- python/branches/release26-maint/Misc/NEWS (original) +++ python/branches/release26-maint/Misc/NEWS Thu Dec 4 20:01:28 2008 @@ -52,6 +52,10 @@ Library ------- +- Issue #1055234: cgi.parse_header(): Fixed parsing of header parameters to + support unusual filenames (such as those containing semi-colons) in + Content-Disposition headers. + - Issue #3741: DISTUTILS_USE_SDK set causes msvc9compiler.py to raise an exception. From buildbot at python.org Thu Dec 4 20:53:25 2008 From: buildbot at python.org (buildbot at python.org) Date: Thu, 04 Dec 2008 19:53:25 +0000 Subject: [Python-checkins] buildbot failure in x86 osx.5 3.0 Message-ID: <20081204195325.992111E4002@bag.python.org> The Buildbot has detected a new failure of x86 osx.5 3.0. Full details are available at: http://www.python.org/dev/buildbot/all/x86%20osx.5%203.0/builds/567 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: heller-x86-osx5 Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: fred.drake,georg.brandl BUILD FAILED: failed test Excerpt from the test logfile: 2 tests failed: test_email test_mailbox make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Thu Dec 4 21:06:23 2008 From: buildbot at python.org (buildbot at python.org) Date: Thu, 04 Dec 2008 20:06:23 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.0 Message-ID: <20081204200623.6FAA01E4002@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/699 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: fred.drake,georg.brandl 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 Thu Dec 4 21:11:57 2008 From: python-checkins at python.org (fred.drake) Date: Thu, 4 Dec 2008 21:11:57 +0100 (CET) Subject: [Python-checkins] r67535 - in python/branches/release30-maint: Lib/cgi.py Lib/test/test_cgi.py Misc/NEWS Message-ID: <20081204201157.D66561E402D@bag.python.org> Author: fred.drake Date: Thu Dec 4 21:11:57 2008 New Revision: 67535 Log: Merged revisions 67534 via svnmerge from svn+ssh://pythondev at svn.python.org/python/branches/py3k ................ r67534 | fred.drake | 2008-12-04 14:24:50 -0500 (Thu, 04 Dec 2008) | 11 lines Merged revisions 67528 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r67528 | fred.drake | 2008-12-04 13:25:17 -0500 (Thu, 04 Dec 2008) | 4 lines Issue #1055234: cgi.parse_header(): Fixed parsing of header parameters to support unusual filenames (such as those containing semi-colons) in Content-Disposition headers. ........ ................ Modified: python/branches/release30-maint/ (props changed) python/branches/release30-maint/Lib/cgi.py python/branches/release30-maint/Lib/test/test_cgi.py python/branches/release30-maint/Misc/NEWS Modified: python/branches/release30-maint/Lib/cgi.py ============================================================================== --- python/branches/release30-maint/Lib/cgi.py (original) +++ python/branches/release30-maint/Lib/cgi.py Thu Dec 4 21:11:57 2008 @@ -272,16 +272,28 @@ return partdict +def _parseparam(s): + while s[:1] == ';': + s = s[1:] + end = s.find(';') + while end > 0 and s.count('"', 0, end) % 2: + end = s.find(';', end + 1) + if end < 0: + end = len(s) + f = s[:end] + yield f.strip() + s = s[end:] + def parse_header(line): """Parse a Content-type like header. Return the main content-type and a dictionary of options. """ - plist = [x.strip() for x in line.split(';')] - key = plist.pop(0).lower() + parts = _parseparam(';' + line) + key = parts.__next__() pdict = {} - for p in plist: + for p in parts: i = p.find('=') if i >= 0: name = p[:i].strip().lower() Modified: python/branches/release30-maint/Lib/test/test_cgi.py ============================================================================== --- python/branches/release30-maint/Lib/test/test_cgi.py (original) +++ python/branches/release30-maint/Lib/test/test_cgi.py Thu Dec 4 21:11:57 2008 @@ -325,6 +325,33 @@ self.assertEqual([('a', 'A1'), ('b', 'B2'), ('B', 'B3')], cgi.parse_qsl('a=A1&b=B2&B=B3')) + def test_parse_header(self): + self.assertEqual( + cgi.parse_header("text/plain"), + ("text/plain", {})) + self.assertEqual( + cgi.parse_header("text/vnd.just.made.this.up ; "), + ("text/vnd.just.made.this.up", {})) + self.assertEqual( + cgi.parse_header("text/plain;charset=us-ascii"), + ("text/plain", {"charset": "us-ascii"})) + self.assertEqual( + cgi.parse_header('text/plain ; charset="us-ascii"'), + ("text/plain", {"charset": "us-ascii"})) + self.assertEqual( + cgi.parse_header('text/plain ; charset="us-ascii"; another=opt'), + ("text/plain", {"charset": "us-ascii", "another": "opt"})) + self.assertEqual( + cgi.parse_header('attachment; filename="silly.txt"'), + ("attachment", {"filename": "silly.txt"})) + self.assertEqual( + cgi.parse_header('attachment; filename="strange;name"'), + ("attachment", {"filename": "strange;name"})) + self.assertEqual( + cgi.parse_header('attachment; filename="strange;name";size=123;'), + ("attachment", {"filename": "strange;name", "size": "123"})) + + def test_main(): run_unittest(CgiTests) Modified: python/branches/release30-maint/Misc/NEWS ============================================================================== --- python/branches/release30-maint/Misc/NEWS (original) +++ python/branches/release30-maint/Misc/NEWS Thu Dec 4 21:11:57 2008 @@ -15,6 +15,10 @@ Library ------- +- Issue #1055234: cgi.parse_header(): Fixed parsing of header parameters to + support unusual filenames (such as those containing semi-colons) in + Content-Disposition headers. + What's New in Python 3.0 final ============================== From python-checkins at python.org Thu Dec 4 21:21:09 2008 From: python-checkins at python.org (gregory.p.smith) Date: Thu, 4 Dec 2008 21:21:09 +0100 (CET) Subject: [Python-checkins] r67536 - in python/trunk: Doc/library/subprocess.rst Lib/subprocess.py Lib/test/test_subprocess.py Misc/NEWS Message-ID: <20081204202109.B685E1E4036@bag.python.org> Author: gregory.p.smith Date: Thu Dec 4 21:21:09 2008 New Revision: 67536 Log: Adds a subprocess.check_call_output() function to return the output from a process on success or raise an exception on error. Modified: python/trunk/Doc/library/subprocess.rst python/trunk/Lib/subprocess.py python/trunk/Lib/test/test_subprocess.py python/trunk/Misc/NEWS Modified: python/trunk/Doc/library/subprocess.rst ============================================================================== --- python/trunk/Doc/library/subprocess.rst (original) +++ python/trunk/Doc/library/subprocess.rst Thu Dec 4 21:21:09 2008 @@ -149,6 +149,30 @@ .. versionadded:: 2.5 +.. function:: check_call_output(*popenargs, **kwargs) + + Run command with arguments and return its output as a byte string. + + If the exit code was non-zero it raises a CalledProcessError. The + CalledProcessError object will have the return code in the returncode + attribute and output in the output attribute. + + The arguments are the same as for the Popen constructor. Example: + + >>> subprocess.check_call_output(["ls", "-l", "/dev/null"]) + 'crw-rw-rw- 1 root root 1, 3 Oct 18 2007 /dev/null\n' + + The stdout argument is not allowed as it is used internally. + To capture standard error in the result, use stderr=subprocess.STDOUT. + + >>> subprocess.check_call_output( + ["/bin/sh", "-c", "ls non_existant_file ; exit 0"], + stderr=subprocess.STDOUT) + 'ls: non_existant_file: No such file or directory\n' + + .. versionadded:: 2.7 + + Exceptions ^^^^^^^^^^ Modified: python/trunk/Lib/subprocess.py ============================================================================== --- python/trunk/Lib/subprocess.py (original) +++ python/trunk/Lib/subprocess.py Thu Dec 4 21:21:09 2008 @@ -107,7 +107,7 @@ (Windows only) -This module also defines two shortcut functions: +This module also defines some shortcut functions: call(*popenargs, **kwargs): Run command with arguments. Wait for command to complete, then @@ -127,6 +127,17 @@ check_call(["ls", "-l"]) +check_call_output(*popenargs, **kwargs): + Run command with arguments and return its output as a byte string. + + If the exit code was non-zero it raises a CalledProcessError. The + CalledProcessError object will have the return code in the returncode + attribute and output in the output attribute. + + The arguments are the same as for the Popen constructor. Example: + + output = subprocess.check_call_output(["ls", "-l", "/dev/null"]) + Exceptions ---------- Exceptions raised in the child process, before the new program has @@ -141,8 +152,8 @@ A ValueError will be raised if Popen is called with invalid arguments. -check_call() will raise CalledProcessError, if the called process -returns a non-zero return code. +check_call() and check_call_output() will raise CalledProcessError, if the +called process returns a non-zero return code. Security @@ -361,12 +372,15 @@ # Exception classes used by this module. class CalledProcessError(Exception): - """This exception is raised when a process run by check_call() returns - a non-zero exit status. The exit status will be stored in the - returncode attribute.""" - def __init__(self, returncode, cmd): + """This exception is raised when a process run by check_call() or + check_call_output() returns a non-zero exit status. + The exit status will be stored in the returncode attribute; + check_call_output() will also store the output in the output attribute. + """ + def __init__(self, returncode, cmd, output=None): self.returncode = returncode self.cmd = cmd + self.output = output def __str__(self): return "Command '%s' returned non-zero exit status %d" % (self.cmd, self.returncode) @@ -403,7 +417,8 @@ import fcntl import pickle -__all__ = ["Popen", "PIPE", "STDOUT", "call", "check_call", "CalledProcessError"] +__all__ = ["Popen", "PIPE", "STDOUT", "call", "check_call", + "check_call_output", "CalledProcessError"] try: MAXFD = os.sysconf("SC_OPEN_MAX") @@ -455,12 +470,45 @@ check_call(["ls", "-l"]) """ retcode = call(*popenargs, **kwargs) - cmd = kwargs.get("args") - if cmd is None: - cmd = popenargs[0] if retcode: + cmd = kwargs.get("args") + if cmd is None: + cmd = popenargs[0] raise CalledProcessError(retcode, cmd) - return retcode + return 0 + + +def check_call_output(*popenargs, **kwargs): + """Run command with arguments and return its output as a byte string. + + If the exit code was non-zero it raises a CalledProcessError. The + CalledProcessError object will have the return code in the returncode + attribute and output in the output attribute. + + The arguments are the same as for the Popen constructor. Example: + + >>> check_call_output(["ls", "-l", "/dev/null"]) + 'crw-rw-rw- 1 root root 1, 3 Oct 18 2007 /dev/null\n' + + The stdout argument is not allowed as it is used internally. + To capture standard error in the result, use stderr=subprocess.STDOUT. + + >>> check_call_output(["/bin/sh", "-c", + "ls -l non_existant_file ; exit 0"], + stderr=subprocess.STDOUT) + 'ls: non_existant_file: No such file or directory\n' + """ + if 'stdout' in kwargs: + raise ValueError('stdout argument not allowed, it will be overridden.') + process = Popen(*popenargs, stdout=PIPE, **kwargs) + output, unused_err = process.communicate() + retcode = process.poll() + if retcode: + cmd = kwargs.get("args") + if cmd is None: + cmd = popenargs[0] + raise CalledProcessError(retcode, cmd, output=output) + return output def list2cmdline(seq): Modified: python/trunk/Lib/test/test_subprocess.py ============================================================================== --- python/trunk/Lib/test/test_subprocess.py (original) +++ python/trunk/Lib/test/test_subprocess.py Thu Dec 4 21:21:09 2008 @@ -72,6 +72,40 @@ else: self.fail("Expected CalledProcessError") + def test_check_call_output(self): + # check_call_output() function with zero return code + output = subprocess.check_call_output( + [sys.executable, "-c", "print 'BDFL'"]) + self.assertTrue('BDFL' in output) + + def test_check_call_output_nonzero(self): + # check_call() function with non-zero return code + try: + subprocess.check_call_output( + [sys.executable, "-c", "import sys; sys.exit(5)"]) + except subprocess.CalledProcessError, e: + self.assertEqual(e.returncode, 5) + else: + self.fail("Expected CalledProcessError") + + def test_check_call_output_stderr(self): + # check_call_output() function stderr redirected to stdout + output = subprocess.check_call_output( + [sys.executable, "-c", "import sys; sys.stderr.write('BDFL')"], + stderr=subprocess.STDOUT) + self.assertTrue('BDFL' in output) + + def test_check_call_output_stdout_arg(self): + # check_call_output() function stderr redirected to stdout + try: + output = subprocess.check_call_output( + [sys.executable, "-c", "print 'will not be run'"], + stdout=sys.stdout) + except ValueError, e: + self.assertTrue('stdout' in e.args[0]) + else: + self.fail("Expected ValueError when stdout arg supplied.") + def test_call_kwargs(self): # call() function with keyword args newenv = os.environ.copy() Modified: python/trunk/Misc/NEWS ============================================================================== --- python/trunk/Misc/NEWS (original) +++ python/trunk/Misc/NEWS Thu Dec 4 21:21:09 2008 @@ -60,6 +60,9 @@ Library ------- +- Added the subprocess.check_call_output() convenience function to get output + from a subprocess on success or raise an exception on error. + - Issue #1055234: cgi.parse_header(): Fixed parsing of header parameters to support unusual filenames (such as those containing semi-colons) in Content-Disposition headers. From p.f.moore at gmail.com Thu Dec 4 21:21:28 2008 From: p.f.moore at gmail.com (Paul Moore) Date: Thu, 4 Dec 2008 20:21:28 +0000 Subject: [Python-checkins] [Python-3000] Merging mailing lists In-Reply-To: <4937886B.4000002@v.loewis.de> References: <4937886B.4000002@v.loewis.de> Message-ID: <79990c6b0812041221y6feaae02k87c7133b535e1ece@mail.gmail.com> 2008/12/4 "Martin v. L?wis" : > Any objections? The timing is right, go for it. Paul From python-checkins at python.org Thu Dec 4 21:32:18 2008 From: python-checkins at python.org (vinay.sajip) Date: Thu, 4 Dec 2008 21:32:18 +0100 (CET) Subject: [Python-checkins] r67537 - in python/trunk: Lib/logging/__init__.py Misc/NEWS Message-ID: <20081204203218.9D2FA1E401E@bag.python.org> Author: vinay.sajip Date: Thu Dec 4 21:32:18 2008 New Revision: 67537 Log: Took Nick Coghlan's advice about importing warnings globally in logging, to avoid the possibility of race conditions: "This could deadlock if a thread spawned as a side effect of importing a module happens to trigger a warning. warnings is pulled into sys.modules as part of the interpreter startup - having a global "import warnings" shouldn't have any real effect on logging's import time. Modified: python/trunk/Lib/logging/__init__.py python/trunk/Misc/NEWS Modified: python/trunk/Lib/logging/__init__.py ============================================================================== --- python/trunk/Lib/logging/__init__.py (original) +++ python/trunk/Lib/logging/__init__.py Thu Dec 4 21:32:18 2008 @@ -31,7 +31,7 @@ 'INFO', 'LogRecord', 'Logger', 'Manager', 'NOTSET', 'PlaceHolder', 'RootLogger', 'StreamHandler', 'WARN', 'WARNING'] -import sys, os, types, time, string, cStringIO, traceback +import sys, os, types, time, string, cStringIO, traceback, warnings try: import codecs @@ -1520,7 +1520,6 @@ if _warnings_showwarning is not None: _warnings_showwarning(message, category, filename, lineno, file, line) else: - import warnings s = warnings.formatwarning(message, category, filename, lineno, line) logger = getLogger("py.warnings") if not logger.handlers: @@ -1533,7 +1532,6 @@ If capture is False, ensure that warnings are not redirected to logging but to their original destinations. """ - import warnings global _warnings_showwarning if capture: if _warnings_showwarning is None: Modified: python/trunk/Misc/NEWS ============================================================================== --- python/trunk/Misc/NEWS (original) +++ python/trunk/Misc/NEWS Thu Dec 4 21:32:18 2008 @@ -67,11 +67,11 @@ support unusual filenames (such as those containing semi-colons) in Content-Disposition headers. -- Issue #4384: Added integration with warnings module using captureWarnings(). - This change includes a NullHandler which does nothing; it will be of use to - library developers who want to avoid the "No handlers could be found for - logger XXX" message which can appear if the library user doesn't configure - logging. +- Issue #4384: Added logging integration with warnings module using + captureWarnings(). This change includes a NullHandler which does nothing; + it will be of use to library developers who want to avoid the "No handlers + could be found for logger XXX" message which can appear if the library user + doesn't configure logging. - Issue #3741: DISTUTILS_USE_SDK set causes msvc9compiler.py to raise an exception. From python-checkins at python.org Thu Dec 4 21:35:18 2008 From: python-checkins at python.org (vinay.sajip) Date: Thu, 4 Dec 2008 21:35:18 +0100 (CET) Subject: [Python-checkins] r67537 - svn:log Message-ID: <20081204203518.7967A1E403C@bag.python.org> Author: vinay.sajip Revision: 67537 Property Name: svn:log Action: modified Property diff: --- old property value +++ new property value @@ -1 +1 @@ -Took Nick Coghlan's advice about importing warnings globally in logging, to avoid the possibility of race conditions: "This could deadlock if a thread spawned as a side effect of importing a module happens to trigger a warning. warnings is pulled into sys.modules as part of the interpreter startup - having a global "import warnings" shouldn't have any real effect on logging's import time. \ No newline at end of file +Took Nick Coghlan's advice about importing warnings globally in logging, to avoid the possibility of race conditions: "This could deadlock if a thread spawned as a side effect of importing a module happens to trigger a warning. warnings is pulled into sys.modules as part of the interpreter startup - having a global 'import warnings' shouldn't have any real effect on logging's import time." \ No newline at end of file From buildbot at python.org Thu Dec 4 22:09:39 2008 From: buildbot at python.org (buildbot at python.org) Date: Thu, 04 Dec 2008 21:09:39 +0000 Subject: [Python-checkins] buildbot failure in x86 osx.5 trunk Message-ID: <20081204210940.4975D1E4029@bag.python.org> The Buildbot has detected a new failure of x86 osx.5 trunk. Full details are available at: http://www.python.org/dev/buildbot/all/x86%20osx.5%20trunk/builds/365 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: heller-x86-osx5 Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: vinay.sajip BUILD FAILED: failed failed slave lost sincerely, -The Buildbot From python-checkins at python.org Thu Dec 4 22:28:16 2008 From: python-checkins at python.org (georg.brandl) Date: Thu, 4 Dec 2008 22:28:16 +0100 (CET) Subject: [Python-checkins] r67538 - python/trunk/Doc/library/subprocess.rst Message-ID: <20081204212816.872531E4002@bag.python.org> Author: georg.brandl Date: Thu Dec 4 22:28:16 2008 New Revision: 67538 Log: Clarification to avoid confusing output with file descriptors. Modified: python/trunk/Doc/library/subprocess.rst Modified: python/trunk/Doc/library/subprocess.rst ============================================================================== --- python/trunk/Doc/library/subprocess.rst (original) +++ python/trunk/Doc/library/subprocess.rst Thu Dec 4 22:28:16 2008 @@ -231,7 +231,7 @@ *input* argument should be a string to be sent to the child process, or ``None``, if no data should be sent to the child. - :meth:`communicate` returns a tuple ``(stdout, stderr)``. + :meth:`communicate` returns a tuple ``(stdoutdata, stderrdata)``. Note that if you want to send data to the process's stdin, you need to create the Popen object with ``stdin=PIPE``. Similarly, to get anything other than From dima at hlabs.spb.ru Thu Dec 4 21:58:40 2008 From: dima at hlabs.spb.ru (Dmitry Vasiliev) Date: Thu, 04 Dec 2008 23:58:40 +0300 Subject: [Python-checkins] [Python-3000] Merging mailing lists In-Reply-To: <4937886B.4000002@v.loewis.de> References: <4937886B.4000002@v.loewis.de> Message-ID: <49384480.8090806@hlabs.spb.ru> Martin v. L?wis wrote: > I would like to merge mailing lists, now that the design and first > implementation of Python 3000 is complete. In particular, I would +1 -- Dmitry Vasiliev (dima at hlabs.spb.ru) http://hlabs.spb.ru From python-checkins at python.org Fri Dec 5 02:07:16 2008 From: python-checkins at python.org (amaury.forgeotdarc) Date: Fri, 5 Dec 2008 02:07:16 +0100 (CET) Subject: [Python-checkins] r67540 - in python/branches/release30-maint: Lib/webbrowser.py Misc/NEWS Message-ID: <20081205010716.2308C1E4002@bag.python.org> Author: amaury.forgeotdarc Date: Fri Dec 5 02:07:15 2008 New Revision: 67540 Log: Merged revisions 67539 via svnmerge from svn+ssh://pythondev at svn.python.org/python/branches/py3k ........ r67539 | amaury.forgeotdarc | 2008-12-05 02:02:21 +0100 (ven., 05 d?c. 2008) | 5 lines Issue #4537: webbrowser.UnixBrowser failed because this module defines an open() function which shadows the builtin. Will backport to 3.0 ........ Modified: python/branches/release30-maint/ (props changed) python/branches/release30-maint/Lib/webbrowser.py python/branches/release30-maint/Misc/NEWS Modified: python/branches/release30-maint/Lib/webbrowser.py ============================================================================== --- python/branches/release30-maint/Lib/webbrowser.py (original) +++ python/branches/release30-maint/Lib/webbrowser.py Fri Dec 5 02:07:15 2008 @@ -223,7 +223,7 @@ cmdline = [self.name] + raise_opt + args if remote or self.background: - inout = open(os.devnull, "r+") + inout = io.open(os.devnull, "r+") else: # for TTY browsers, we need stdin/out inout = None Modified: python/branches/release30-maint/Misc/NEWS ============================================================================== --- python/branches/release30-maint/Misc/NEWS (original) +++ python/branches/release30-maint/Misc/NEWS Fri Dec 5 02:07:15 2008 @@ -15,6 +15,9 @@ Library ------- +- Issue #4537: webbrowser.UnixBrowser would fail to open the browser because + it was calling the wrong open() function. + - Issue #1055234: cgi.parse_header(): Fixed parsing of header parameters to support unusual filenames (such as those containing semi-colons) in Content-Disposition headers. From buildbot at python.org Fri Dec 5 02:25:23 2008 From: buildbot at python.org (buildbot at python.org) Date: Fri, 05 Dec 2008 01:25:23 +0000 Subject: [Python-checkins] buildbot failure in amd64 gentoo 3.0 Message-ID: <20081205012524.706AA1E4002@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/1346 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: amaury.forgeotdarc BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_threading_local make: *** [buildbottest] Error 1 sincerely, -The Buildbot From python-checkins at python.org Fri Dec 5 02:42:09 2008 From: python-checkins at python.org (amaury.forgeotdarc) Date: Fri, 5 Dec 2008 02:42:09 +0100 (CET) Subject: [Python-checkins] r67542 - in python/branches/release30-maint: Misc/NEWS Modules/binascii.c Message-ID: <20081205014209.585221E4002@bag.python.org> Author: amaury.forgeotdarc Date: Fri Dec 5 02:42:09 2008 New Revision: 67542 Log: Merged revisions 67541 via svnmerge from svn+ssh://pythondev at svn.python.org/python/branches/py3k ........ r67541 | amaury.forgeotdarc | 2008-12-05 02:40:43 +0100 (ven., 05 d?c. 2008) | 5 lines #4542: On Windows, binascii.crc32 still accepted str as binary input. This fixes test_binascii. Will backport to 3.0 ........ Modified: python/branches/release30-maint/ (props changed) python/branches/release30-maint/Misc/NEWS python/branches/release30-maint/Modules/binascii.c Modified: python/branches/release30-maint/Misc/NEWS ============================================================================== --- python/branches/release30-maint/Misc/NEWS (original) +++ python/branches/release30-maint/Misc/NEWS Fri Dec 5 02:42:09 2008 @@ -15,6 +15,9 @@ Library ------- +- Issue #4542: On Windows, binascii.crc32 still accepted str as binary input; + the corresponding tests now pass. + - Issue #4537: webbrowser.UnixBrowser would fail to open the browser because it was calling the wrong open() function. Modified: python/branches/release30-maint/Modules/binascii.c ============================================================================== --- python/branches/release30-maint/Modules/binascii.c (original) +++ python/branches/release30-maint/Modules/binascii.c Fri Dec 5 02:42:09 2008 @@ -1019,7 +1019,7 @@ Py_ssize_t len; unsigned int result; - if ( !PyArg_ParseTuple(args, "s*|I:crc32", &pbin, &crc) ) + if ( !PyArg_ParseTuple(args, "y*|I:crc32", &pbin, &crc) ) return NULL; bin_data = pbin.buf; len = pbin.len; From buildbot at python.org Fri Dec 5 03:22:14 2008 From: buildbot at python.org (buildbot at python.org) Date: Fri, 05 Dec 2008 02:22:14 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.0 Message-ID: <20081205022214.BFA3E1E4002@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/701 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: 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 Fri Dec 5 03:27:01 2008 From: python-checkins at python.org (gregory.p.smith) Date: Fri, 5 Dec 2008 03:27:01 +0100 (CET) Subject: [Python-checkins] r67543 - in python/trunk: Doc/library/subprocess.rst Lib/subprocess.py Lib/test/test_subprocess.py Misc/NEWS Message-ID: <20081205022701.AC0911E4002@bag.python.org> Author: gregory.p.smith Date: Fri Dec 5 03:27:01 2008 New Revision: 67543 Log: rename the new check_call_output to check_output. its less ugly. Modified: python/trunk/Doc/library/subprocess.rst python/trunk/Lib/subprocess.py python/trunk/Lib/test/test_subprocess.py python/trunk/Misc/NEWS Modified: python/trunk/Doc/library/subprocess.rst ============================================================================== --- python/trunk/Doc/library/subprocess.rst (original) +++ python/trunk/Doc/library/subprocess.rst Fri Dec 5 03:27:01 2008 @@ -149,7 +149,7 @@ .. versionadded:: 2.5 -.. function:: check_call_output(*popenargs, **kwargs) +.. function:: check_output(*popenargs, **kwargs) Run command with arguments and return its output as a byte string. @@ -159,13 +159,13 @@ The arguments are the same as for the Popen constructor. Example: - >>> subprocess.check_call_output(["ls", "-l", "/dev/null"]) + >>> subprocess.check_output(["ls", "-l", "/dev/null"]) 'crw-rw-rw- 1 root root 1, 3 Oct 18 2007 /dev/null\n' The stdout argument is not allowed as it is used internally. To capture standard error in the result, use stderr=subprocess.STDOUT. - >>> subprocess.check_call_output( + >>> subprocess.check_output( ["/bin/sh", "-c", "ls non_existant_file ; exit 0"], stderr=subprocess.STDOUT) 'ls: non_existant_file: No such file or directory\n' Modified: python/trunk/Lib/subprocess.py ============================================================================== --- python/trunk/Lib/subprocess.py (original) +++ python/trunk/Lib/subprocess.py Fri Dec 5 03:27:01 2008 @@ -127,7 +127,7 @@ check_call(["ls", "-l"]) -check_call_output(*popenargs, **kwargs): +check_output(*popenargs, **kwargs): Run command with arguments and return its output as a byte string. If the exit code was non-zero it raises a CalledProcessError. The @@ -136,7 +136,7 @@ The arguments are the same as for the Popen constructor. Example: - output = subprocess.check_call_output(["ls", "-l", "/dev/null"]) + output = subprocess.check_output(["ls", "-l", "/dev/null"]) Exceptions ---------- @@ -152,7 +152,7 @@ A ValueError will be raised if Popen is called with invalid arguments. -check_call() and check_call_output() will raise CalledProcessError, if the +check_call() and check_output() will raise CalledProcessError, if the called process returns a non-zero return code. @@ -373,9 +373,9 @@ # Exception classes used by this module. class CalledProcessError(Exception): """This exception is raised when a process run by check_call() or - check_call_output() returns a non-zero exit status. + check_output() returns a non-zero exit status. The exit status will be stored in the returncode attribute; - check_call_output() will also store the output in the output attribute. + check_output() will also store the output in the output attribute. """ def __init__(self, returncode, cmd, output=None): self.returncode = returncode @@ -418,7 +418,7 @@ import pickle __all__ = ["Popen", "PIPE", "STDOUT", "call", "check_call", - "check_call_output", "CalledProcessError"] + "check_output", "CalledProcessError"] try: MAXFD = os.sysconf("SC_OPEN_MAX") @@ -478,7 +478,7 @@ return 0 -def check_call_output(*popenargs, **kwargs): +def check_output(*popenargs, **kwargs): """Run command with arguments and return its output as a byte string. If the exit code was non-zero it raises a CalledProcessError. The @@ -487,15 +487,15 @@ The arguments are the same as for the Popen constructor. Example: - >>> check_call_output(["ls", "-l", "/dev/null"]) + >>> check_output(["ls", "-l", "/dev/null"]) 'crw-rw-rw- 1 root root 1, 3 Oct 18 2007 /dev/null\n' The stdout argument is not allowed as it is used internally. To capture standard error in the result, use stderr=subprocess.STDOUT. - >>> check_call_output(["/bin/sh", "-c", - "ls -l non_existant_file ; exit 0"], - stderr=subprocess.STDOUT) + >>> check_output(["/bin/sh", "-c", + "ls -l non_existant_file ; exit 0"], + stderr=subprocess.STDOUT) 'ls: non_existant_file: No such file or directory\n' """ if 'stdout' in kwargs: Modified: python/trunk/Lib/test/test_subprocess.py ============================================================================== --- python/trunk/Lib/test/test_subprocess.py (original) +++ python/trunk/Lib/test/test_subprocess.py Fri Dec 5 03:27:01 2008 @@ -72,33 +72,33 @@ else: self.fail("Expected CalledProcessError") - def test_check_call_output(self): - # check_call_output() function with zero return code - output = subprocess.check_call_output( + def test_check_output(self): + # check_output() function with zero return code + output = subprocess.check_output( [sys.executable, "-c", "print 'BDFL'"]) self.assertTrue('BDFL' in output) - def test_check_call_output_nonzero(self): + def test_check_output_nonzero(self): # check_call() function with non-zero return code try: - subprocess.check_call_output( + subprocess.check_output( [sys.executable, "-c", "import sys; sys.exit(5)"]) except subprocess.CalledProcessError, e: self.assertEqual(e.returncode, 5) else: self.fail("Expected CalledProcessError") - def test_check_call_output_stderr(self): - # check_call_output() function stderr redirected to stdout - output = subprocess.check_call_output( + def test_check_output_stderr(self): + # check_output() function stderr redirected to stdout + output = subprocess.check_output( [sys.executable, "-c", "import sys; sys.stderr.write('BDFL')"], stderr=subprocess.STDOUT) self.assertTrue('BDFL' in output) - def test_check_call_output_stdout_arg(self): - # check_call_output() function stderr redirected to stdout + def test_check_output_stdout_arg(self): + # check_output() function stderr redirected to stdout try: - output = subprocess.check_call_output( + output = subprocess.check_output( [sys.executable, "-c", "print 'will not be run'"], stdout=sys.stdout) except ValueError, e: Modified: python/trunk/Misc/NEWS ============================================================================== --- python/trunk/Misc/NEWS (original) +++ python/trunk/Misc/NEWS Fri Dec 5 03:27:01 2008 @@ -60,7 +60,7 @@ Library ------- -- Added the subprocess.check_call_output() convenience function to get output +- Added the subprocess.check_output() convenience function to get output from a subprocess on success or raise an exception on error. - Issue #1055234: cgi.parse_header(): Fixed parsing of header parameters to From buildbot at python.org Fri Dec 5 04:22:08 2008 From: buildbot at python.org (buildbot at python.org) Date: Fri, 05 Dec 2008 03:22:08 +0000 Subject: [Python-checkins] buildbot failure in x86 W2k8 3.0 Message-ID: <20081205032208.F368F1E4002@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/488 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: fred.drake BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_tarfile sincerely, -The Buildbot From buildbot at python.org Fri Dec 5 04:24:02 2008 From: buildbot at python.org (buildbot at python.org) Date: Fri, 05 Dec 2008 03:24:02 +0000 Subject: [Python-checkins] buildbot failure in AMD64 W2k8 3.0 Message-ID: <20081205032402.D7B5F1E4002@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/1008 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: fred.drake BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_tarfile sincerely, -The Buildbot From python-checkins at python.org Fri Dec 5 06:01:54 2008 From: python-checkins at python.org (barry.warsaw) Date: Fri, 5 Dec 2008 06:01:54 +0100 (CET) Subject: [Python-checkins] r67546 - sandbox/trunk/release/release.py Message-ID: <20081205050154.A6D9B1E401A@bag.python.org> Author: barry.warsaw Date: Fri Dec 5 06:01:54 2008 New Revision: 67546 Log: More pycs to remove. Modified: sandbox/trunk/release/release.py Modified: sandbox/trunk/release/release.py ============================================================================== --- sandbox/trunk/release/release.py (original) +++ sandbox/trunk/release/release.py Fri Dec 5 06:01:54 2008 @@ -270,9 +270,14 @@ shutil.rmtree('build') shutil.rmtree('dist') shutil.rmtree('tools/docutils') - shutil.rmtree('tools/sphinx') shutil.rmtree('tools/jinja') shutil.rmtree('tools/pygments') + shutil.rmtree('tools/sphinx') + shutil.rmtree('tools/sphinxext') + for dirpath, dirnames, filenames in os.walk('.'): + for filename in filenames: + if filename.endswith('.pyc'): + os.remove(os.path.join(dirpath, filename)) tarball(archivename) print '\n**Now extract the archives and run the tests**' From python-checkins at python.org Fri Dec 5 06:03:06 2008 From: python-checkins at python.org (barry.warsaw) Date: Fri, 5 Dec 2008 06:03:06 +0100 (CET) Subject: [Python-checkins] r67547 - in python/branches/release26-maint: Include/patchlevel.h Misc/NEWS Message-ID: <20081205050306.96C511E4002@bag.python.org> Author: barry.warsaw Date: Fri Dec 5 06:03:06 2008 New Revision: 67547 Log: Post-2.6.1 tweak 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 Fri Dec 5 06:03:06 2008 @@ -27,7 +27,7 @@ #define PY_RELEASE_SERIAL 0 /* Version as a string */ -#define PY_VERSION "2.6.1" +#define PY_VERSION "2.6.1+" /*--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 Fri Dec 5 06:03:06 2008 @@ -4,6 +4,18 @@ (editors: check NEWS.help for information about editing NEWS using ReST.) +What's New in Python 2.6.2 +========================== + +*Release date: XX-XXX-200X* + +Core and Builtins +----------------- + +Library +------- + + What's New in Python 2.6.1 ========================== From python-checkins at python.org Fri Dec 5 08:20:46 2008 From: python-checkins at python.org (martin.v.loewis) Date: Fri, 5 Dec 2008 08:20:46 +0100 (CET) Subject: [Python-checkins] r67549 - python/branches/py3k/Misc/build.sh Message-ID: <20081205072046.E13901E4002@bag.python.org> Author: martin.v.loewis Date: Fri Dec 5 08:20:46 2008 New Revision: 67549 Log: Send mails to python-checkins now. Modified: python/branches/py3k/Misc/build.sh Modified: python/branches/py3k/Misc/build.sh ============================================================================== --- python/branches/py3k/Misc/build.sh (original) +++ python/branches/py3k/Misc/build.sh Fri Dec 5 08:20:46 2008 @@ -46,7 +46,7 @@ FAILURE_SUBJECT="Python Regression Test Failures" #FAILURE_MAILTO="YOUR_ACCOUNT at gmail.com" -FAILURE_MAILTO="python-3000-checkins at python.org" +FAILURE_MAILTO="python-checkins at python.org" #FAILURE_CC="optional--uncomment and set to desired address" REMOTE_SYSTEM="neal at dinsdale.python.org" From python-checkins at python.org Fri Dec 5 08:32:39 2008 From: python-checkins at python.org (georg.brandl) Date: Fri, 5 Dec 2008 08:32:39 +0100 (CET) Subject: [Python-checkins] r67550 - python/branches/py3k/Misc/build.sh Message-ID: <20081205073239.D1C251E4002@bag.python.org> Author: georg.brandl Date: Fri Dec 5 08:32:39 2008 New Revision: 67550 Log: Update build URL. Modified: python/branches/py3k/Misc/build.sh Modified: python/branches/py3k/Misc/build.sh ============================================================================== --- python/branches/py3k/Misc/build.sh (original) +++ python/branches/py3k/Misc/build.sh Fri Dec 5 08:32:39 2008 @@ -50,7 +50,7 @@ #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/3.0" +REMOTE_DIR="/data/ftp.python.org/pub/docs.python.org/dev/py3k" RESULT_FILE="$DIR/build/index.html" INSTALL_DIR="/tmp/python-test-3.0/local" RSYNC_OPTS="-aC -e ssh" From python-checkins at python.org Fri Dec 5 08:32:56 2008 From: python-checkins at python.org (georg.brandl) Date: Fri, 5 Dec 2008 08:32:56 +0100 (CET) Subject: [Python-checkins] r67551 - in python/branches/py3k/Doc/library: urllib.parse.rst urllib.request.rst Message-ID: <20081205073256.F1F641E4002@bag.python.org> Author: georg.brandl Date: Fri Dec 5 08:32:56 2008 New Revision: 67551 Log: #4355: refer to urlencode in the correct module. Modified: python/branches/py3k/Doc/library/urllib.parse.rst python/branches/py3k/Doc/library/urllib.request.rst Modified: python/branches/py3k/Doc/library/urllib.parse.rst ============================================================================== --- python/branches/py3k/Doc/library/urllib.parse.rst (original) +++ python/branches/py3k/Doc/library/urllib.parse.rst Fri Dec 5 08:32:56 2008 @@ -106,8 +106,8 @@ parsing errors. If false (the default), errors are silently ignored. If true, errors raise a :exc:`ValueError` exception. - Use the :func:`urllib.urlencode` function to convert such dictionaries into - query strings. + Use the :func:`urllib.parse.urlencode` function to convert such + dictionaries into query strings. .. function:: parse_qsl(qs[, keep_blank_values[, strict_parsing]]) Modified: python/branches/py3k/Doc/library/urllib.request.rst ============================================================================== --- python/branches/py3k/Doc/library/urllib.request.rst (original) +++ python/branches/py3k/Doc/library/urllib.request.rst Fri Dec 5 08:32:56 2008 @@ -23,8 +23,8 @@ that use *data*; the HTTP request will be a POST instead of a GET when the *data* parameter is provided. *data* should be a buffer in the standard :mimetype:`application/x-www-form-urlencoded` format. The - :func:`urllib.urlencode` function takes a mapping or sequence of 2-tuples and - returns a string in this format. + :func:`urllib.parse.urlencode` function takes a mapping or sequence + of 2-tuples and returns a string in this format. The optional *timeout* parameter specifies a timeout in seconds for blocking operations like the connection attempt (if not specified, the global default @@ -172,8 +172,8 @@ that use *data*; the HTTP request will be a POST instead of a GET when the *data* parameter is provided. *data* should be a buffer in the standard :mimetype:`application/x-www-form-urlencoded` format. The - :func:`urllib.urlencode` function takes a mapping or sequence of 2-tuples and - returns a string in this format. + :func:`urllib.parse.urlencode` function takes a mapping or sequence + of 2-tuples and returns a string in this format. *headers* should be a dictionary, and will be treated as if :meth:`add_header` was called with each key and value as arguments. This is often used to "spoof" From python-checkins at python.org Fri Dec 5 08:45:55 2008 From: python-checkins at python.org (georg.brandl) Date: Fri, 5 Dec 2008 08:45:55 +0100 (CET) Subject: [Python-checkins] r67552 - python/branches/py3k/Lib/os.py Message-ID: <20081205074555.1055C1E4002@bag.python.org> Author: georg.brandl Date: Fri Dec 5 08:45:54 2008 New Revision: 67552 Log: #4401: Re-add os.extsep. Modified: python/branches/py3k/Lib/os.py Modified: python/branches/py3k/Lib/os.py ============================================================================== --- python/branches/py3k/Lib/os.py (original) +++ python/branches/py3k/Lib/os.py Fri Dec 5 08:45:54 2008 @@ -7,6 +7,7 @@ - os.curdir is a string representing the current directory ('.' or ':') - os.pardir is a string representing the parent directory ('..' or '::') - os.sep is the (or a most common) pathname separator ('/' or ':' or '\\') + - os.extsep is the extension separator (always '.') - os.altsep is the alternate pathname separator (None or '/') - os.pathsep is the component separator used in $PATH etc - os.linesep is the line separator in text files ('\r' or '\n' or '\r\n') @@ -102,7 +103,8 @@ raise ImportError('no os specific module found') sys.modules['os.path'] = path -from os.path import curdir, pardir, sep, pathsep, defpath, altsep, devnull +from os.path import (curdir, pardir, sep, pathsep, defpath, extsep, altsep, + devnull) del _names From python-checkins at python.org Fri Dec 5 08:49:49 2008 From: python-checkins at python.org (georg.brandl) Date: Fri, 5 Dec 2008 08:49:49 +0100 (CET) Subject: [Python-checkins] r67553 - python/trunk/Doc/library/re.rst Message-ID: <20081205074949.45C591E4002@bag.python.org> Author: georg.brandl Date: Fri Dec 5 08:49:49 2008 New Revision: 67553 Log: #4408: document regex.groups. Modified: python/trunk/Doc/library/re.rst Modified: python/trunk/Doc/library/re.rst ============================================================================== --- python/trunk/Doc/library/re.rst (original) +++ python/trunk/Doc/library/re.rst Fri Dec 5 08:49:49 2008 @@ -750,6 +750,11 @@ were provided. +.. attribute:: RegexObject.groups + + The number of capturing groups in the pattern. + + .. attribute:: RegexObject.groupindex A dictionary mapping any symbolic group names defined by ``(?P)`` to group From python-checkins at python.org Fri Dec 5 08:52:26 2008 From: python-checkins at python.org (georg.brandl) Date: Fri, 5 Dec 2008 08:52:26 +0100 (CET) Subject: [Python-checkins] r67554 - python/trunk/Doc/library/subprocess.rst Message-ID: <20081205075226.712D11E4002@bag.python.org> Author: georg.brandl Date: Fri Dec 5 08:52:26 2008 New Revision: 67554 Log: #4409: fix asterisks looking like footnotes. Modified: python/trunk/Doc/library/subprocess.rst Modified: python/trunk/Doc/library/subprocess.rst ============================================================================== --- python/trunk/Doc/library/subprocess.rst (original) +++ python/trunk/Doc/library/subprocess.rst Fri Dec 5 08:52:26 2008 @@ -382,8 +382,8 @@ print >>sys.stderr, "Execution failed:", e -Replacing os.spawn\* -^^^^^^^^^^^^^^^^^^^^ +Replacing the os.spawn family +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ P_NOWAIT example:: @@ -410,8 +410,8 @@ Popen(["/bin/mycmd", "myarg"], env={"PATH": "/usr/bin"}) -Replacing os.popen\* -^^^^^^^^^^^^^^^^^^^^ +Replacing os.popen, os.popen2, os.popen3 +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ :: @@ -454,8 +454,8 @@ (child_stdin, child_stdout_and_stderr) = (p.stdin, p.stdout) -Replacing popen2.\* -^^^^^^^^^^^^^^^^^^^ +Replacing functions from the popen2 module +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ .. note:: From python-checkins at python.org Fri Dec 5 08:57:52 2008 From: python-checkins at python.org (georg.brandl) Date: Fri, 5 Dec 2008 08:57:52 +0100 (CET) Subject: [Python-checkins] r67555 - python/branches/py3k/Doc/c-api/arg.rst Message-ID: <20081205075752.A52DE1E4002@bag.python.org> Author: georg.brandl Date: Fri Dec 5 08:57:51 2008 New Revision: 67555 Log: #4427: fix arguments for "y" BuildValue type. Modified: python/branches/py3k/Doc/c-api/arg.rst Modified: python/branches/py3k/Doc/c-api/arg.rst ============================================================================== --- python/branches/py3k/Doc/c-api/arg.rst (original) +++ python/branches/py3k/Doc/c-api/arg.rst Fri Dec 5 08:57:51 2008 @@ -438,7 +438,7 @@ Convert a C string and its length to a Python object. If the C string pointer is *NULL*, the length is ignored and ``None`` is returned. - ``y`` (bytes) [char \*, int] + ``y`` (bytes) [char \*] This converts a C string to a Python :func:`bytes` object. If the C string pointer is *NULL*, ``None`` is returned. From python-checkins at python.org Fri Dec 5 09:02:20 2008 From: python-checkins at python.org (georg.brandl) Date: Fri, 5 Dec 2008 09:02:20 +0100 (CET) Subject: [Python-checkins] r67556 - python/trunk/Doc/library/os.rst Message-ID: <20081205080220.1A8421E4002@bag.python.org> Author: georg.brandl Date: Fri Dec 5 09:02:17 2008 New Revision: 67556 Log: #4441: improve doc for os.open() flags. Modified: python/trunk/Doc/library/os.rst Modified: python/trunk/Doc/library/os.rst ============================================================================== --- python/trunk/Doc/library/os.rst (original) +++ python/trunk/Doc/library/os.rst Fri Dec 5 09:02:17 2008 @@ -681,10 +681,11 @@ :func:`fdopen`, or :data:`sys.stdout` or :data:`sys.stderr`, use its :meth:`write` method. -The following data items are available for use in constructing the *flags* -parameter to the :func:`open` function. Some items will not be available on all -platforms. For descriptions of their availability and use, consult -:manpage:`open(2)`. +The following constants are options for the *flags* parameter to the +:func:`open` function. They can be combined using the bitwise OR operator +``|``. Some of them are not available on all platforms. For descriptions of +their availability and use, consult the :manpage:`open(2)` manual page or the +respective documentation for your operating system. .. data:: O_RDONLY @@ -695,8 +696,7 @@ O_EXCL O_TRUNC - Options for the *flag* argument to the :func:`open` function. These can be - combined using the bitwise OR operator ``|``. Availability: Unix, Windows. + These constants are available on Unix and Windows. .. data:: O_DSYNC @@ -708,8 +708,7 @@ O_SHLOCK O_EXLOCK - More options for the *flag* argument to the :func:`open` function. Availability: - Unix. + These constants are only available on Unix. .. data:: O_BINARY @@ -720,8 +719,7 @@ O_SEQUENTIAL O_TEXT - Options for the *flag* argument to the :func:`open` function. These can be - combined using the bitwise OR operator ``|``. Availability: Windows. + These constants are only available on Windows. .. data:: O_ASYNC @@ -730,8 +728,8 @@ O_NOFOLLOW O_NOATIME - Options for the *flag* argument to the :func:`open` function. These are - GNU extensions and not present if they are not defined by the C library. + These constants are GNU extensions and not present if they are not defined by + the C library. .. data:: SEEK_SET From python-checkins at python.org Fri Dec 5 09:06:58 2008 From: python-checkins at python.org (georg.brandl) Date: Fri, 5 Dec 2008 09:06:58 +0100 (CET) Subject: [Python-checkins] r67557 - python/trunk/Doc/reference/datamodel.rst Message-ID: <20081205080658.2802E1E4002@bag.python.org> Author: georg.brandl Date: Fri Dec 5 09:06:57 2008 New Revision: 67557 Log: Add an index entry for "subclassing immutable types". Modified: python/trunk/Doc/reference/datamodel.rst Modified: python/trunk/Doc/reference/datamodel.rst ============================================================================== --- python/trunk/Doc/reference/datamodel.rst (original) +++ python/trunk/Doc/reference/datamodel.rst Fri Dec 5 09:06:57 2008 @@ -1162,9 +1162,10 @@ Basic customization ------------------- - .. method:: object.__new__(cls[, ...]) + .. index:: pair: subclassing; immutable types + Called to create a new instance of class *cls*. :meth:`__new__` is a static method (special-cased so you need not declare it as such) that takes the class of which an instance was requested as its first argument. The remaining From buildbot at python.org Fri Dec 5 09:12:01 2008 From: buildbot at python.org (buildbot at python.org) Date: Fri, 05 Dec 2008 08:12:01 +0000 Subject: [Python-checkins] buildbot failure in x86 osx.5 3.0 Message-ID: <20081205081201.F0B171E4002@bag.python.org> The Buildbot has detected a new failure of x86 osx.5 3.0. Full details are available at: http://www.python.org/dev/buildbot/all/x86%20osx.5%203.0/builds/571 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: heller-x86-osx5 Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: benjamin.peterson,georg.brandl,guido.van.rossum,martin.v.loewis BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_socket ====================================================================== ERROR: testShutdown (test.test_socket.BasicTCPTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_socket.py", line 121, in _tearDown self.fail(msg) AssertionError: [Errno 57] Socket is not connected make: *** [buildbottest] Error 1 sincerely, -The Buildbot From python-checkins at python.org Fri Dec 5 09:19:56 2008 From: python-checkins at python.org (georg.brandl) Date: Fri, 5 Dec 2008 09:19:56 +0100 (CET) Subject: [Python-checkins] r67558 - peps/trunk/pep-0101.txt Message-ID: <20081205081956.615311E4002@bag.python.org> Author: georg.brandl Date: Fri Dec 5 09:19:56 2008 New Revision: 67558 Log: Update the docs steps. Modified: peps/trunk/pep-0101.txt Modified: peps/trunk/pep-0101.txt ============================================================================== --- peps/trunk/pep-0101.txt (original) +++ peps/trunk/pep-0101.txt Fri Dec 5 09:19:56 2008 @@ -38,6 +38,7 @@ * RM = Release Manager: Barry Warsaw (US/Eastern) * WE = Windows: Martin von Loewis (Central Europe) * ME = Mac: Ronald Oussoren (Central Europe) + * DE = Docs: Georg Brandl (Central Europe) * IE = Idle Expert: ?? NOTE: It is highly recommended that the RM contact the Experts the day @@ -300,7 +301,7 @@ steps to take: % cd /tmp - % tar zxvf ~/Python-2.6c2.tgz # tar xjvf ~/Python-2.6c2.tar.bz2 + % tar xzvf ~/Python-2.6c2.tgz # tar xjvf ~/Python-2.6c2.tar.bz2 % cd Python-2.6c2 % ls (Do things look reasonable?) @@ -308,7 +309,7 @@ (Are there stray .pyc files?) % ls Doc/tools (Make sure it doesn't contain "docutils", "sphinx", "jinja" or - "pygments" directories.) + "pygments" directories. Also look for stray .pyc files.) % ./configure (Loads of configure output) % make test @@ -371,6 +372,11 @@ /data/ftp.python.org/pub/python/doc/X.Y[.Z], and adapt the "current" symlink in that directory. + ___ If this is a final release, also unpack the HTML docs to + /data/ftp.python.org/pub/www.python.org/doc/X.Y[.Z]. + + ___ Let the DE check if the docs are built and work all right. + Now it's time to twiddle the web site. To do these steps, you must have the permission to edit the website. If you From python-checkins at python.org Fri Dec 5 09:26:56 2008 From: python-checkins at python.org (christian.heimes) Date: Fri, 5 Dec 2008 09:26:56 +0100 (CET) Subject: [Python-checkins] r67559 - in python/branches/py3k: Misc/NEWS Modules/_fileio.c Message-ID: <20081205082656.417501E4002@bag.python.org> Author: christian.heimes Date: Fri Dec 5 09:26:55 2008 New Revision: 67559 Log: Fixed issue #4533: File read operation was dreadfully slow Modified: python/branches/py3k/Misc/NEWS python/branches/py3k/Modules/_fileio.c Modified: python/branches/py3k/Misc/NEWS ============================================================================== --- python/branches/py3k/Misc/NEWS (original) +++ python/branches/py3k/Misc/NEWS Fri Dec 5 09:26:55 2008 @@ -12,6 +12,10 @@ Core and Builtins ----------------- +- Issue #4533: File read operation was dreadfully slow due to a slowly + growing read buffer. Fixed by using the same growth rate algorithm as + Python 2.x. + Library ------- Modified: python/branches/py3k/Modules/_fileio.c ============================================================================== --- python/branches/py3k/Modules/_fileio.c (original) +++ python/branches/py3k/Modules/_fileio.c Fri Dec 5 09:26:55 2008 @@ -27,6 +27,20 @@ #include #endif +#if BUFSIZ < (8*1024) +#define SMALLCHUNK (8*1024) +#elif (BUFSIZ >= (2 << 25)) +#error "unreasonable BUFSIZ > 64MB defined" +#else +#define SMALLCHUNK BUFSIZ +#endif + +#if SIZEOF_INT < 4 +#define BIGCHUNK (512 * 32) +#else +#define BIGCHUNK (512 * 1024) +#endif + typedef struct { PyObject_HEAD int fd; @@ -387,8 +401,6 @@ return PyLong_FromSsize_t(n); } -#define DEFAULT_BUFFER_SIZE (8*1024) - static PyObject * fileio_readall(PyFileIOObject *self) { @@ -396,12 +408,23 @@ Py_ssize_t total = 0; int n; - result = PyBytes_FromStringAndSize(NULL, DEFAULT_BUFFER_SIZE); + result = PyBytes_FromStringAndSize(NULL, SMALLCHUNK); if (result == NULL) return NULL; while (1) { - Py_ssize_t newsize = total + DEFAULT_BUFFER_SIZE; + Py_ssize_t newsize = (total < SMALLCHUNK) ? SMALLCHUNK : total; + + /* Keep doubling until we reach BIGCHUNK; + then keep adding BIGCHUNK. */ + if (newsize <= BIGCHUNK) { + newsize += newsize; + } + else { + /* NOTE: overflow impossible due to limits on BUFSIZ */ + newsize += BIGCHUNK; + } + if (PyBytes_GET_SIZE(result) < newsize) { if (_PyBytes_Resize(&result, newsize) < 0) { if (total == 0) { From python-checkins at python.org Fri Dec 5 09:32:07 2008 From: python-checkins at python.org (christian.heimes) Date: Fri, 5 Dec 2008 09:32:07 +0100 (CET) Subject: [Python-checkins] r67560 - in python/branches/release30-maint: Misc/NEWS Modules/_fileio.c Message-ID: <20081205083207.7DC161E4002@bag.python.org> Author: christian.heimes Date: Fri Dec 5 09:32:07 2008 New Revision: 67560 Log: Merged revisions 67559 via svnmerge from svn+ssh://pythondev at svn.python.org/python/branches/py3k ........ r67559 | christian.heimes | 2008-12-05 09:26:55 +0100 (Fri, 05 Dec 2008) | 1 line Fixed issue #4533: File read operation was dreadfully slow ........ Modified: python/branches/release30-maint/ (props changed) python/branches/release30-maint/Misc/NEWS python/branches/release30-maint/Modules/_fileio.c Modified: python/branches/release30-maint/Misc/NEWS ============================================================================== --- python/branches/release30-maint/Misc/NEWS (original) +++ python/branches/release30-maint/Misc/NEWS Fri Dec 5 09:32:07 2008 @@ -12,6 +12,11 @@ Core and Builtins ----------------- +- Issue #4533: File read operation was dreadfully slow due to a slowly + growing read buffer. Fixed by using the same growth rate algorithm as + Python 2.x. + + Library ------- Modified: python/branches/release30-maint/Modules/_fileio.c ============================================================================== --- python/branches/release30-maint/Modules/_fileio.c (original) +++ python/branches/release30-maint/Modules/_fileio.c Fri Dec 5 09:32:07 2008 @@ -27,6 +27,20 @@ #include #endif +#if BUFSIZ < (8*1024) +#define SMALLCHUNK (8*1024) +#elif (BUFSIZ >= (2 << 25)) +#error "unreasonable BUFSIZ > 64MB defined" +#else +#define SMALLCHUNK BUFSIZ +#endif + +#if SIZEOF_INT < 4 +#define BIGCHUNK (512 * 32) +#else +#define BIGCHUNK (512 * 1024) +#endif + typedef struct { PyObject_HEAD int fd; @@ -387,8 +401,6 @@ return PyLong_FromSsize_t(n); } -#define DEFAULT_BUFFER_SIZE (8*1024) - static PyObject * fileio_readall(PyFileIOObject *self) { @@ -396,12 +408,23 @@ Py_ssize_t total = 0; int n; - result = PyBytes_FromStringAndSize(NULL, DEFAULT_BUFFER_SIZE); + result = PyBytes_FromStringAndSize(NULL, SMALLCHUNK); if (result == NULL) return NULL; while (1) { - Py_ssize_t newsize = total + DEFAULT_BUFFER_SIZE; + Py_ssize_t newsize = (total < SMALLCHUNK) ? SMALLCHUNK : total; + + /* Keep doubling until we reach BIGCHUNK; + then keep adding BIGCHUNK. */ + if (newsize <= BIGCHUNK) { + newsize += newsize; + } + else { + /* NOTE: overflow impossible due to limits on BUFSIZ */ + newsize += BIGCHUNK; + } + if (PyBytes_GET_SIZE(result) < newsize) { if (_PyBytes_Resize(&result, newsize) < 0) { if (total == 0) { From python-checkins at python.org Fri Dec 5 09:35:10 2008 From: python-checkins at python.org (georg.brandl) Date: Fri, 5 Dec 2008 09:35:10 +0100 (CET) Subject: [Python-checkins] r67561 - in python/branches/release26-maint: Doc/conf.py Doc/documenting/index.rst Doc/documenting/markup.rst Doc/documenting/rest.rst Doc/documenting/sphinx.rst Doc/documenting/style.rst Doc/library/ast.rst Doc/library/functions.rst Doc/library/httplib.rst Doc/library/locale.rst Doc/library/multiprocessing.rst Doc/tools/sphinxext/download.html Lib/string.py Modules/posixmodule.c Message-ID: <20081205083510.2FC3A1E4010@bag.python.org> Author: georg.brandl Date: Fri Dec 5 09:35:09 2008 New Revision: 67561 Log: Merged revisions 67154,67157-67159,67162-67163,67166,67175-67176,67189,67224-67225,67243 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r67154 | hirokazu.yamamoto | 2008-11-08 04:46:17 +0100 (Sat, 08 Nov 2008) | 1 line Issue #4071: ntpath.abspath returned an empty string for long unicode path. ........ r67157 | georg.brandl | 2008-11-08 12:47:44 +0100 (Sat, 08 Nov 2008) | 2 lines Don't use "HOWTO" as the title for all howto .tex files. ........ r67158 | georg.brandl | 2008-11-08 12:48:20 +0100 (Sat, 08 Nov 2008) | 2 lines Update "Documenting" a bit. Concentrate on Python-specifics. ........ r67159 | georg.brandl | 2008-11-08 13:52:25 +0100 (Sat, 08 Nov 2008) | 2 lines Fix warning. ........ r67162 | benjamin.peterson | 2008-11-08 17:55:33 +0100 (Sat, 08 Nov 2008) | 1 line a few compile() and ast doc improvements ........ r67163 | benjamin.peterson | 2008-11-08 18:04:18 +0100 (Sat, 08 Nov 2008) | 1 line move context clue to versionchanged tag ........ r67166 | benjamin.peterson | 2008-11-08 18:07:06 +0100 (Sat, 08 Nov 2008) | 1 line clarify what was added ........ r67175 | benjamin.peterson | 2008-11-09 02:44:32 +0100 (Sun, 09 Nov 2008) | 1 line update link ........ r67176 | benjamin.peterson | 2008-11-09 02:52:32 +0100 (Sun, 09 Nov 2008) | 1 line fix comment ........ r67189 | benjamin.peterson | 2008-11-11 22:56:06 +0100 (Tue, 11 Nov 2008) | 1 line use correct name ........ r67224 | georg.brandl | 2008-11-15 09:10:04 +0100 (Sat, 15 Nov 2008) | 2 lines #4324: fix getlocale() argument. ........ r67225 | brett.cannon | 2008-11-15 23:33:25 +0100 (Sat, 15 Nov 2008) | 1 line Clarify the docs for the 'strict' argument to httplib.HTTPConnection. ........ r67243 | benjamin.peterson | 2008-11-17 22:39:05 +0100 (Mon, 17 Nov 2008) | 1 line a few fixes on the download page ........ Removed: python/branches/release26-maint/Doc/documenting/sphinx.rst Modified: python/branches/release26-maint/ (props changed) python/branches/release26-maint/Doc/conf.py python/branches/release26-maint/Doc/documenting/index.rst python/branches/release26-maint/Doc/documenting/markup.rst python/branches/release26-maint/Doc/documenting/rest.rst python/branches/release26-maint/Doc/documenting/style.rst python/branches/release26-maint/Doc/library/ast.rst python/branches/release26-maint/Doc/library/functions.rst python/branches/release26-maint/Doc/library/httplib.rst python/branches/release26-maint/Doc/library/locale.rst python/branches/release26-maint/Doc/library/multiprocessing.rst python/branches/release26-maint/Doc/tools/sphinxext/download.html python/branches/release26-maint/Lib/string.py python/branches/release26-maint/Modules/posixmodule.c Modified: python/branches/release26-maint/Doc/conf.py ============================================================================== --- python/branches/release26-maint/Doc/conf.py (original) +++ python/branches/release26-maint/Doc/conf.py Fri Dec 5 09:35:09 2008 @@ -128,7 +128,7 @@ ] # Collect all HOWTOs individually latex_documents.extend(('howto/' + fn[:-4], 'howto-' + fn[:-4] + '.tex', - 'HOWTO', _stdauthor, 'howto') + '', _stdauthor, 'howto') for fn in os.listdir('howto') if fn.endswith('.rst') and fn != 'index.rst') Modified: python/branches/release26-maint/Doc/documenting/index.rst ============================================================================== --- python/branches/release26-maint/Doc/documenting/index.rst (original) +++ python/branches/release26-maint/Doc/documenting/index.rst Fri Dec 5 09:35:09 2008 @@ -8,7 +8,7 @@ The Python language has a substantial body of documentation, much of it contributed by various authors. The markup used for the Python documentation is `reStructuredText`_, developed by the `docutils`_ project, amended by custom -directives and using a toolset named *Sphinx* to postprocess the HTML output. +directives and using a toolset named `Sphinx`_ to postprocess the HTML output. This document describes the style guide for our documentation, the custom reStructuredText markup introduced to support Python documentation and how it @@ -16,6 +16,7 @@ .. _reStructuredText: http://docutils.sf.net/rst.html .. _docutils: http://docutils.sf.net/ +.. _Sphinx: http://sphinx.pocoo.org/ If you're interested in contributing to Python's documentation, there's no need to write reStructuredText if you're not so inclined; plain text contributions @@ -28,7 +29,3 @@ rest.rst markup.rst fromlatex.rst - sphinx.rst - -.. XXX add credits, thanks etc. - Modified: python/branches/release26-maint/Doc/documenting/markup.rst ============================================================================== --- python/branches/release26-maint/Doc/documenting/markup.rst (original) +++ python/branches/release26-maint/Doc/documenting/markup.rst Fri Dec 5 09:35:09 2008 @@ -8,24 +8,11 @@ Documentation for "standard" reST constructs is not included here, though they are used in the Python documentation. -File-wide metadata ------------------- - -reST has the concept of "field lists"; these are a sequence of fields marked up -like this:: - - :Field name: Field content - -A field list at the very top of a file is parsed as the "docinfo", which in -normal documents can be used to record the author, date of publication and -other metadata. In Sphinx, the docinfo is used as metadata, too, but not -displayed in the output. - -At the moment, only one metadata field is recognized: +.. note:: -``nocomments`` - If set, the web application won't display a comment form for a page generated - from this source file. + This is just an overview of Sphinx' extended markup capabilities; full + coverage can be found in `its own documentation + `_. Meta-information markup @@ -88,7 +75,6 @@ authors of the module code, just like ``sectionauthor`` names the author(s) of a piece of documentation. It too does not result in any output currently. - .. note:: It is important to make the section title of a module-describing file @@ -272,7 +258,7 @@ This language is used until the next ``highlightlang`` directive is encountered. -* The valid values for the highlighting language are: +* The values normally used for the highlighting language are: * ``python`` (the default) * ``c`` @@ -799,7 +785,7 @@ ------------- The documentation system provides three substitutions that are defined by default. -They are set in the build configuration file, see :ref:`doc-build-config`. +They are set in the build configuration file :file:`conf.py`. .. describe:: |release| Modified: python/branches/release26-maint/Doc/documenting/rest.rst ============================================================================== --- python/branches/release26-maint/Doc/documenting/rest.rst (original) +++ python/branches/release26-maint/Doc/documenting/rest.rst Fri Dec 5 09:35:09 2008 @@ -67,12 +67,6 @@ #. This is a numbered list. #. It has two items too. -Note that Sphinx disables the use of enumerated lists introduced by alphabetic -or roman numerals, such as :: - - A. First item - B. Second item - Nested lists are possible, but be aware that they must be separated from the parent list items by blank lines:: @@ -247,5 +241,3 @@ * **Separation of inline markup:** As said above, inline markup spans must be separated from the surrounding text by non-word characters, you have to use an escaped space to get around that. - -.. XXX more? Deleted: python/branches/release26-maint/Doc/documenting/sphinx.rst ============================================================================== --- python/branches/release26-maint/Doc/documenting/sphinx.rst Fri Dec 5 09:35:09 2008 +++ (empty file) @@ -1,76 +0,0 @@ -.. highlightlang:: rest - -The Sphinx build system -======================= - -.. XXX: intro... - -.. _doc-build-config: - -The build configuration file ----------------------------- - -The documentation root, that is the ``Doc`` subdirectory of the source -distribution, contains a file named ``conf.py``. This file is called the "build -configuration file", and it contains several variables that are read and used -during a build run. - -These variables are: - -version : string - A string that is used as a replacement for the ``|version|`` reST - substitution. It should be the Python version the documentation refers to. - This consists only of the major and minor version parts, e.g. ``2.5``, even - for version 2.5.1. - -release : string - A string that is used as a replacement for the ``|release|`` reST - substitution. It should be the full version string including - alpha/beta/release candidate tags, e.g. ``2.5.2b3``. - -Both ``release`` and ``version`` can be ``'auto'``, which means that they are -determined at runtime from the ``Include/patchlevel.h`` file, if a complete -Python source distribution can be found, or else from the interpreter running -Sphinx. - -today_fmt : string - A ``strftime`` format that is used to format a replacement for the - ``|today|`` reST substitution. - -today : string - A string that can contain a date that should be written to the documentation - output literally. If this is nonzero, it is used instead of - ``strftime(today_fmt)``. - -unused_files : list of strings - A list of reST filenames that are to be disregarded during building. This - could be docs for temporarily disabled modules or documentation that's not - yet ready for public consumption. - -add_function_parentheses : bool - If true, ``()`` will be appended to the content of ``:func:``, ``:meth:`` and - ``:cfunc:`` cross-references. - -add_module_names : bool - If true, the current module name will be prepended to all description unit - titles (such as ``.. function::``). - -Builder-specific variables -^^^^^^^^^^^^^^^^^^^^^^^^^^ - -html_download_base_url : string - The base URL for download links on the download page. - -html_last_updated_fmt : string - If this is not an empty string, it will be given to ``time.strftime()`` and - written to each generated output file after "last updated on:". - -html_use_smartypants : bool - If true, use SmartyPants to convert quotes and dashes to the typographically - correct entities. - -latex_paper_size : "letter" or "a4" - The paper size option for the LaTeX document class. - -latex_font_size : "10pt", "11pt" or "12pt" - The font size option for the LaTeX document class. \ No newline at end of file Modified: python/branches/release26-maint/Doc/documenting/style.rst ============================================================================== --- python/branches/release26-maint/Doc/documenting/style.rst (original) +++ python/branches/release26-maint/Doc/documenting/style.rst Fri Dec 5 09:35:09 2008 @@ -66,5 +66,5 @@ 1970s. -.. _Apple Publications Style Guide: http://developer.apple.com/documentation/UserExperience/Conceptual/APStyleGuide/AppleStyleGuide2006.pdf +.. _Apple Publications Style Guide: http://developer.apple.com/documentation/UserExperience/Conceptual/APStyleGuide/APSG_2008.pdf Modified: python/branches/release26-maint/Doc/library/ast.rst ============================================================================== --- python/branches/release26-maint/Doc/library/ast.rst (original) +++ python/branches/release26-maint/Doc/library/ast.rst Fri Dec 5 09:35:09 2008 @@ -21,13 +21,12 @@ Python release; this module helps to find out programmatically what the current grammar looks like. -An abstract syntax tree can be generated by passing :data:`_ast.PyCF_ONLY_AST` -as a flag to the :func:`compile` builtin function, or using the :func:`parse` +An abstract syntax tree can be generated by passing :data:`ast.PyCF_ONLY_AST` as +a flag to the :func:`compile` builtin function, or using the :func:`parse` helper provided in this module. The result will be a tree of objects whose -classes all inherit from :class:`ast.AST`. +classes all inherit from :class:`ast.AST`. An abstract syntax tree can be +compiled into a Python code object using the built-in :func:`compile` function. -A modified abstract syntax tree can be compiled into a Python code object using -the built-in :func:`compile` function. Node classes ------------ @@ -126,7 +125,7 @@ .. function:: parse(expr, filename='', mode='exec') Parse an expression into an AST node. Equivalent to ``compile(expr, - filename, mode, PyCF_ONLY_AST)``. + filename, mode, ast.PyCF_ONLY_AST)``. .. function:: literal_eval(node_or_string) 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 Fri Dec 5 09:35:09 2008 @@ -199,15 +199,8 @@ Compile the *source* into a code or AST object. Code objects can be executed by an :keyword:`exec` statement or evaluated by a call to :func:`eval`. - *source* can either be a string or an AST object. Refer to the :mod:`_ast` - module documentation for information on how to compile into and from AST - objects. - - When compiling a string with multi-line statements, two caveats apply: line - endings must be represented by a single newline character (``'\n'``), and the - input must be terminated by at least one newline character. If line endings - are represented by ``'\r\n'``, use the string :meth:`replace` method to - change them into ``'\n'``. + *source* can either be a string or an AST object. Refer to the :mod:`ast` + module documentation for information on how to work with AST objects. The *filename* argument should give the file from which the code was read; pass some recognizable value if it wasn't read from a file (``''`` is @@ -219,15 +212,15 @@ interactive statement (in the latter case, expression statements that evaluate to something else than ``None`` will be printed). - The optional arguments *flags* and *dont_inherit* (which are new in Python 2.2) - control which future statements (see :pep:`236`) affect the compilation of - *source*. If neither is present (or both are zero) the code is compiled with - those future statements that are in effect in the code that is calling compile. - If the *flags* argument is given and *dont_inherit* is not (or is zero) then the + The optional arguments *flags* and *dont_inherit* control which future + statements (see :pep:`236`) affect the compilation of *source*. If neither + is present (or both are zero) the code is compiled with those future + statements that are in effect in the code that is calling compile. If the + *flags* argument is given and *dont_inherit* is not (or is zero) then the future statements specified by the *flags* argument are used in addition to those that would be used anyway. If *dont_inherit* is a non-zero integer then - the *flags* argument is it -- the future statements in effect around the call to - compile are ignored. + the *flags* argument is it -- the future statements in effect around the call + to compile are ignored. Future statements are specified by bits which can be bitwise ORed together to specify multiple statements. The bitfield required to specify a given feature @@ -237,7 +230,18 @@ This function raises :exc:`SyntaxError` if the compiled source is invalid, and :exc:`TypeError` if the source contains null bytes. - .. versionadded:: 2.6 + .. note:: + + When compiling a string with multi-line statements, line endings must be + represented by a single newline character (``'\n'``), and the input must + be terminated by at least one newline character. If line endings are + represented by ``'\r\n'``, use :meth:`str.replace` to change them into + ``'\n'``. + + .. versionchanged:: 2.3 + The *flags* and *dont_inherit* arguments were added. + + .. versionchanged:: 2.6 Support for compiling AST objects. Modified: python/branches/release26-maint/Doc/library/httplib.rst ============================================================================== --- python/branches/release26-maint/Doc/library/httplib.rst (original) +++ python/branches/release26-maint/Doc/library/httplib.rst Fri Dec 5 09:35:09 2008 @@ -40,7 +40,8 @@ server. It should be instantiated passing it a host and optional port number. If no port number is passed, the port is extracted from the host string if it has the form ``host:port``, else the default HTTP port (80) is - used. When True, the optional parameter *strict* causes ``BadStatusLine`` to + used. When True, the optional parameter *strict* (which defaults to a false + value) causes ``BadStatusLine`` to be raised if the status line can't be parsed as a valid HTTP/1.0 or 1.1 status line. If the optional *timeout* parameter is given, blocking operations (like connection attempts) will timeout after that many seconds Modified: python/branches/release26-maint/Doc/library/locale.rst ============================================================================== --- python/branches/release26-maint/Doc/library/locale.rst (original) +++ python/branches/release26-maint/Doc/library/locale.rst Fri Dec 5 09:35:09 2008 @@ -492,7 +492,7 @@ Example:: >>> import locale - >>> loc = locale.getlocale(locale.LC_ALL) # get current locale + >>> loc = locale.getlocale() # get current locale >>> locale.setlocale(locale.LC_ALL, 'de_DE') # use German locale; name might vary with platform >>> locale.strcoll('f\xe4n', 'foo') # compare a string containing an umlaut >>> locale.setlocale(locale.LC_ALL, '') # use user's preferred locale Modified: python/branches/release26-maint/Doc/library/multiprocessing.rst ============================================================================== --- python/branches/release26-maint/Doc/library/multiprocessing.rst (original) +++ python/branches/release26-maint/Doc/library/multiprocessing.rst Fri Dec 5 09:35:09 2008 @@ -1870,7 +1870,7 @@ Below is an example session with logging turned on:: >>> import multiprocessing, logging - >>> logger = multiprocessing.getLogger() + >>> logger = multiprocessing.get_logger() >>> logger.setLevel(logging.INFO) >>> logger.warning('doomed') [WARNING/MainProcess] doomed 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 Fri Dec 5 09:35:09 2008 @@ -14,7 +14,7 @@

To download an archive containing all the documents for this version of Python in one of various formats, follow one of links in this table. The numbers -in the table are the size of the download files in Kilobytes.

+in the table are the size of the download files in megabytes.

@@ -54,7 +54,7 @@

Problems

If you have comments or suggestions for the Python documentation, please send -email to docs at python.org.

+email to docs at python.org.

{% endif %} {% endblock %} Modified: python/branches/release26-maint/Lib/string.py ============================================================================== --- python/branches/release26-maint/Lib/string.py (original) +++ python/branches/release26-maint/Lib/string.py Fri Dec 5 09:35:09 2008 @@ -532,9 +532,8 @@ # the Formatter class # see PEP 3101 for details and purpose of this class -# The hard parts are reused from the C implementation. They're -# exposed here via the sys module. sys was chosen because it's always -# available and doesn't have to be dynamically loaded. +# The hard parts are reused from the C implementation. They're exposed as "_" +# prefixed methods of str and unicode. # The overall parser is implemented in str._formatter_parser. # The field name parser is implemented in str._formatter_field_name_split Modified: python/branches/release26-maint/Modules/posixmodule.c ============================================================================== --- python/branches/release26-maint/Modules/posixmodule.c (original) +++ python/branches/release26-maint/Modules/posixmodule.c Fri Dec 5 09:35:09 2008 @@ -2393,13 +2393,27 @@ if (unicode_file_names()) { PyUnicodeObject *po; if (PyArg_ParseTuple(args, "U|:_getfullpathname", &po)) { - Py_UNICODE woutbuf[MAX_PATH*2]; + Py_UNICODE *wpath = PyUnicode_AS_UNICODE(po); + Py_UNICODE woutbuf[MAX_PATH*2], *woutbufp = woutbuf; Py_UNICODE *wtemp; - if (!GetFullPathNameW(PyUnicode_AS_UNICODE(po), - sizeof(woutbuf)/sizeof(woutbuf[0]), - woutbuf, &wtemp)) - return win32_error("GetFullPathName", ""); - return PyUnicode_FromUnicode(woutbuf, wcslen(woutbuf)); + DWORD result; + PyObject *v; + result = GetFullPathNameW(wpath, + sizeof(woutbuf)/sizeof(woutbuf[0]), + woutbuf, &wtemp); + if (result > sizeof(woutbuf)/sizeof(woutbuf[0])) { + woutbufp = malloc(result * sizeof(Py_UNICODE)); + if (!woutbufp) + return PyErr_NoMemory(); + result = GetFullPathNameW(wpath, result, woutbufp, &wtemp); + } + if (result) + v = PyUnicode_FromUnicode(woutbufp, wcslen(woutbufp)); + else + v = win32_error_unicode("GetFullPathNameW", wpath); + if (woutbufp != woutbuf) + free(woutbufp); + return v; } /* Drop the argument parsing error as narrow strings are also valid. */ From buildbot at python.org Fri Dec 5 09:36:03 2008 From: buildbot at python.org (buildbot at python.org) Date: Fri, 05 Dec 2008 08:36:03 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.0 Message-ID: <20081205083603.A2BD11E4002@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/703 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,guido.van.rossum,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 Fri Dec 5 09:36:09 2008 From: python-checkins at python.org (georg.brandl) Date: Fri, 5 Dec 2008 09:36:09 +0100 (CET) Subject: [Python-checkins] r67562 - python/branches/release26-maint Message-ID: <20081205083609.ED3E21E400C@bag.python.org> Author: georg.brandl Date: Fri Dec 5 09:36:09 2008 New Revision: 67562 Log: Blocked revisions 67171,67226,67234 via svnmerge ........ r67171 | benjamin.peterson | 2008-11-08 19:38:54 +0100 (Sat, 08 Nov 2008) | 4 lines check for assignment to __debug__ during AST generation Also, give assignment to None a better error message ........ r67226 | brett.cannon | 2008-11-15 23:40:44 +0100 (Sat, 15 Nov 2008) | 4 lines The docs for httplib.HTTPConnection.putheader() have claimed for quite a while that their could be an arbitrary number of values passed in. Turns out the code did not match that. The code now matches the docs. ........ r67234 | benjamin.peterson | 2008-11-16 18:54:55 +0100 (Sun, 16 Nov 2008) | 1 line run autoconf ........ Modified: python/branches/release26-maint/ (props changed) From python-checkins at python.org Fri Dec 5 09:51:31 2008 From: python-checkins at python.org (georg.brandl) Date: Fri, 5 Dec 2008 09:51:31 +0100 (CET) Subject: [Python-checkins] r67563 - in python/branches/release26-maint: Doc/howto/unicode.rst Doc/library/bdb.rst Doc/library/collections.rst Doc/library/ctypes.rst Doc/library/io.rst Doc/library/multiprocessing.rst Doc/library/os.rst Doc/library/pdb.rst Doc/library/sys.rst Doc/reference/datamodel.rst Lib/doctest.py Lib/io.py Lib/lib2to3/tests/data/fixers Lib/lib2to3/tests/data/fixers/myfixes Lib/multiprocessing/pool.py Lib/test/test_bytes.py Lib/test/test_io.py Lib/test/test_xmlrpc.py Misc/NEWS Modules/_fileio.c Message-ID: <20081205085131.8FEE41E4002@bag.python.org> Author: georg.brandl Date: Fri Dec 5 09:51:30 2008 New Revision: 67563 Log: Merged revisions 67245,67277,67289,67295,67301-67303,67307,67330,67332,67336,67355,67359,67362,67364,67367-67368,67370 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r67245 | benjamin.peterson | 2008-11-17 23:05:19 +0100 (Mon, 17 Nov 2008) | 1 line improve __hash__ docs ........ r67277 | skip.montanaro | 2008-11-19 04:35:41 +0100 (Wed, 19 Nov 2008) | 1 line patch from issue 1108 ........ r67289 | brett.cannon | 2008-11-19 21:29:39 +0100 (Wed, 19 Nov 2008) | 2 lines Ignore .pyc and .pyo files. ........ r67295 | benjamin.peterson | 2008-11-20 05:05:12 +0100 (Thu, 20 Nov 2008) | 1 line move useful sys.settrace information to the function's documentation from the debugger ........ r67301 | benjamin.peterson | 2008-11-20 22:25:31 +0100 (Thu, 20 Nov 2008) | 1 line fix indentation and a sphinx warning ........ r67302 | benjamin.peterson | 2008-11-20 22:44:23 +0100 (Thu, 20 Nov 2008) | 1 line oops! didn't mean to disable that test ........ r67303 | benjamin.peterson | 2008-11-20 23:06:22 +0100 (Thu, 20 Nov 2008) | 1 line backport r67300 ........ r67307 | amaury.forgeotdarc | 2008-11-21 00:34:31 +0100 (Fri, 21 Nov 2008) | 9 lines Fixed issue #4233. Changed semantic of _fileio.FileIO's close() method on file objects with closefd=False. The file descriptor is still kept open but the file object behaves like a closed file. The FileIO object also got a new readonly attribute closefd. Approved by Barry Backport of r67106 from the py3k branch ........ r67330 | georg.brandl | 2008-11-22 09:34:14 +0100 (Sat, 22 Nov 2008) | 2 lines #4364: fix attribute name on ctypes object. ........ r67332 | georg.brandl | 2008-11-22 09:45:33 +0100 (Sat, 22 Nov 2008) | 2 lines Fix typo. ........ r67336 | georg.brandl | 2008-11-22 11:08:50 +0100 (Sat, 22 Nov 2008) | 2 lines Fix error about "-*-" being mandatory in coding cookies. ........ r67355 | georg.brandl | 2008-11-23 20:17:25 +0100 (Sun, 23 Nov 2008) | 2 lines #4392: fix parameter name. ........ r67359 | georg.brandl | 2008-11-23 22:57:30 +0100 (Sun, 23 Nov 2008) | 2 lines #4399: fix typo. ........ r67362 | gregory.p.smith | 2008-11-24 01:41:43 +0100 (Mon, 24 Nov 2008) | 2 lines Document PY_SSIZE_T_CLEAN for PyArg_ParseTuple. ........ r67364 | benjamin.peterson | 2008-11-24 02:16:29 +0100 (Mon, 24 Nov 2008) | 2 lines replace reference to debugger-hooks ........ r67367 | georg.brandl | 2008-11-24 17:16:07 +0100 (Mon, 24 Nov 2008) | 2 lines Fix typo. ........ r67368 | georg.brandl | 2008-11-24 20:56:47 +0100 (Mon, 24 Nov 2008) | 2 lines #4404: make clear what "path" is. ........ r67370 | jeremy.hylton | 2008-11-24 23:00:29 +0100 (Mon, 24 Nov 2008) | 8 lines Add unittests that verify documented behavior of public methods in Transport class. These methods can be overridden. The tests verify that the overridden methods are called, and that changes to the connection have a visible effect on the request. ........ Modified: python/branches/release26-maint/ (props changed) python/branches/release26-maint/Doc/howto/unicode.rst python/branches/release26-maint/Doc/library/bdb.rst python/branches/release26-maint/Doc/library/collections.rst python/branches/release26-maint/Doc/library/ctypes.rst python/branches/release26-maint/Doc/library/io.rst python/branches/release26-maint/Doc/library/multiprocessing.rst python/branches/release26-maint/Doc/library/os.rst python/branches/release26-maint/Doc/library/pdb.rst python/branches/release26-maint/Doc/library/sys.rst python/branches/release26-maint/Doc/reference/datamodel.rst python/branches/release26-maint/Lib/doctest.py python/branches/release26-maint/Lib/io.py python/branches/release26-maint/Lib/lib2to3/tests/data/fixers/ (props changed) python/branches/release26-maint/Lib/lib2to3/tests/data/fixers/myfixes/ (props changed) python/branches/release26-maint/Lib/multiprocessing/pool.py python/branches/release26-maint/Lib/test/test_bytes.py python/branches/release26-maint/Lib/test/test_io.py python/branches/release26-maint/Lib/test/test_xmlrpc.py python/branches/release26-maint/Misc/NEWS python/branches/release26-maint/Modules/_fileio.c Modified: python/branches/release26-maint/Doc/howto/unicode.rst ============================================================================== --- python/branches/release26-maint/Doc/howto/unicode.rst (original) +++ python/branches/release26-maint/Doc/howto/unicode.rst Fri Dec 5 09:51:30 2008 @@ -410,9 +410,9 @@ The syntax is inspired by Emacs's notation for specifying variables local to a file. Emacs supports many different variables, but Python only supports -'coding'. The ``-*-`` symbols indicate that the comment is special; within -them, you must supply the name ``coding`` and the name of your chosen encoding, -separated by ``':'``. +'coding'. The ``-*-`` symbols indicate to Emacs that the comment is special; +they have no significance to Python but are a convention. Python looks for +``coding: name`` or ``coding=name`` in the comment. If you don't include such a comment, the default encoding used will be ASCII. Versions of Python before 2.4 were Euro-centric and assumed Latin-1 as a default Modified: python/branches/release26-maint/Doc/library/bdb.rst ============================================================================== --- python/branches/release26-maint/Doc/library/bdb.rst (original) +++ python/branches/release26-maint/Doc/library/bdb.rst Fri Dec 5 09:51:30 2008 @@ -107,8 +107,9 @@ The *arg* parameter depends on the previous event. - For more information on trace functions, see :ref:`debugger-hooks`. For - more information on code and frame objects, refer to :ref:`types`. + See the documentation for :func:`sys.settrace` for more information on the + trace function. For more information on code and frame objects, refer to + :ref:`types`. .. method:: dispatch_line(frame) Modified: python/branches/release26-maint/Doc/library/collections.rst ============================================================================== --- python/branches/release26-maint/Doc/library/collections.rst (original) +++ python/branches/release26-maint/Doc/library/collections.rst Fri Dec 5 09:51:30 2008 @@ -60,7 +60,7 @@ :class:`Iterable`, and ``__len__`` ``index``, and ``count`` :class:`Container` -:class:`MutableSequnce` :class:`Sequence` ``__getitem__`` Inherited Sequence methods and +:class:`MutableSequence` :class:`Sequence` ``__getitem__`` Inherited Sequence methods and ``__delitem__``, ``append``, ``reverse``, ``extend``, ``pop``, ``insert``, ``remove``, and ``__iadd__`` and ``__len__`` @@ -487,16 +487,16 @@ self-documenting code. They can be used wherever regular tuples are used, and they add the ability to access fields by name instead of position index. -.. function:: namedtuple(typename, fieldnames, [verbose]) +.. function:: namedtuple(typename, field_names, [verbose]) Returns a new tuple subclass named *typename*. The new subclass is used to create tuple-like objects that have fields accessible by attribute lookup as well as being indexable and iterable. Instances of the subclass also have a - helpful docstring (with typename and fieldnames) and a helpful :meth:`__repr__` + helpful docstring (with typename and field_names) and a helpful :meth:`__repr__` method which lists the tuple contents in a ``name=value`` format. - The *fieldnames* are a single string with each fieldname separated by whitespace - and/or commas, for example ``'x y'`` or ``'x, y'``. Alternatively, *fieldnames* + The *field_names* are a single string with each fieldname separated by whitespace + and/or commas, for example ``'x y'`` or ``'x, y'``. Alternatively, *field_names* can be a sequence of strings such as ``['x', 'y']``. Any valid Python identifier may be used for a fieldname except for names Modified: python/branches/release26-maint/Doc/library/ctypes.rst ============================================================================== --- python/branches/release26-maint/Doc/library/ctypes.rst (original) +++ python/branches/release26-maint/Doc/library/ctypes.rst Fri Dec 5 09:51:30 2008 @@ -1370,7 +1370,7 @@ All these classes can be instantiated by calling them with at least one argument, the pathname of the shared library. If you have an existing handle to -an already loaded shard library, it can be passed as the ``handle`` named +an already loaded shared library, it can be passed as the ``handle`` named parameter, otherwise the underlying platforms ``dlopen`` or :meth:`LoadLibrary` function is used to load the library into the process, and to get a handle to it. Modified: python/branches/release26-maint/Doc/library/io.rst ============================================================================== --- python/branches/release26-maint/Doc/library/io.rst (original) +++ python/branches/release26-maint/Doc/library/io.rst Fri Dec 5 09:51:30 2008 @@ -214,8 +214,10 @@ .. method:: close() - Flush and close this stream. This method has no effect if the file is - already closed. + Flush and close this stream. This method has no effect if the file is + already closed. Once the file is closed, any operation on the file + (e.g. reading or writing) will raise an :exc:`IOError`. The internal + file descriptor isn't closed if *closefd* was False. .. attribute:: closed Modified: python/branches/release26-maint/Doc/library/multiprocessing.rst ============================================================================== --- python/branches/release26-maint/Doc/library/multiprocessing.rst (original) +++ python/branches/release26-maint/Doc/library/multiprocessing.rst Fri Dec 5 09:51:30 2008 @@ -919,7 +919,7 @@ Note that *lock* is a keyword only argument. - Note that an array of :data:`ctypes.c_char` has *value* and *rawvalue* + Note that an array of :data:`ctypes.c_char` has *value* and *raw* attributes which allow one to use it to store and retrieve strings. @@ -968,7 +968,7 @@ :func:`Value` instead to make sure that access is automatically synchronized using a lock. - Note that an array of :data:`ctypes.c_char` has ``value`` and ``rawvalue`` + Note that an array of :data:`ctypes.c_char` has ``value`` and ``raw`` attributes which allow one to use it to store and retrieve strings -- see documentation for :mod:`ctypes`. Modified: python/branches/release26-maint/Doc/library/os.rst ============================================================================== --- python/branches/release26-maint/Doc/library/os.rst (original) +++ python/branches/release26-maint/Doc/library/os.rst Fri Dec 5 09:51:30 2008 @@ -933,10 +933,10 @@ .. function:: listdir(path) - Return a list containing the names of the entries in the directory. The list is - in arbitrary order. It does not include the special entries ``'.'`` and - ``'..'`` even if they are present in the directory. Availability: - Unix, Windows. + Return a list containing the names of the entries in the directory given by + *path*. The list is in arbitrary order. It does not include the special + entries ``'.'`` and ``'..'`` even if they are present in the + directory. Availability: Unix, Windows. .. versionchanged:: 2.3 On Windows NT/2k/XP and Unix, if *path* is a Unicode object, the result will be Modified: python/branches/release26-maint/Doc/library/pdb.rst ============================================================================== --- python/branches/release26-maint/Doc/library/pdb.rst (original) +++ python/branches/release26-maint/Doc/library/pdb.rst Fri Dec 5 09:51:30 2008 @@ -351,68 +351,3 @@ q(uit) Quit from the debugger. The program being executed is aborted. - - -.. _debugger-hooks: - -How It Works -============ - -Some changes were made to the interpreter: - -* ``sys.settrace(func)`` sets the global trace function - -* there can also a local trace function (see later) - -Trace functions have three arguments: *frame*, *event*, and *arg*. *frame* is -the current stack frame. *event* is a string: ``'call'``, ``'line'``, -``'return'``, ``'exception'``, ``'c_call'``, ``'c_return'``, or -``'c_exception'``. *arg* depends on the event type. - -The global trace function is invoked (with *event* set to ``'call'``) whenever a -new local scope is entered; it should return a reference to the local trace -function to be used that scope, or ``None`` if the scope shouldn't be traced. - -The local trace function should return a reference to itself (or to another -function for further tracing in that scope), or ``None`` to turn off tracing in -that scope. - -Instance methods are accepted (and very useful!) as trace functions. - -The events have the following meaning: - -``'call'`` - A function is called (or some other code block entered). The global trace - function is called; *arg* is ``None``; the return value specifies the local - trace function. - -``'line'`` - The interpreter is about to execute a new line of code (sometimes multiple line - events on one line exist). The local trace function is called; *arg* is - ``None``; the return value specifies the new local trace function. - -``'return'`` - A function (or other code block) is about to return. The local trace function - is called; *arg* is the value that will be returned. The trace function's - return value is ignored. - -``'exception'`` - An exception has occurred. The local trace function is called; *arg* is a - triple ``(exception, value, traceback)``; the return value specifies the new - local trace function. - -``'c_call'`` - A C function is about to be called. This may be an extension function or a - builtin. *arg* is the C function object. - -``'c_return'`` - A C function has returned. *arg* is ``None``. - -``'c_exception'`` - A C function has thrown an exception. *arg* is ``None``. - -Note that as an exception is propagated down the chain of callers, an -``'exception'`` event is generated at each level. - -For more information on code and frame objects, refer to :ref:`types`. - Modified: python/branches/release26-maint/Doc/library/sys.rst ============================================================================== --- python/branches/release26-maint/Doc/library/sys.rst (original) +++ python/branches/release26-maint/Doc/library/sys.rst Fri Dec 5 09:51:30 2008 @@ -712,11 +712,60 @@ single: debugger Set the system's trace function, which allows you to implement a Python - source code debugger in Python. See section :ref:`debugger-hooks` in the - chapter on the Python debugger. The function is thread-specific; for a + source code debugger in Python. The function is thread-specific; for a debugger to support multiple threads, it must be registered using :func:`settrace` for each thread being debugged. + Trace functions should have three arguments: *frame*, *event*, and + *arg*. *frame* is the current stack frame. *event* is a string: ``'call'``, + ``'line'``, ``'return'``, ``'exception'``, ``'c_call'``, ``'c_return'``, or + ``'c_exception'``. *arg* depends on the event type. + + The trace function is invoked (with *event* set to ``'call'``) whenever a new + local scope is entered; it should return a reference to a local trace + function to be used that scope, or ``None`` if the scope shouldn't be traced. + + The local trace function should return a reference to itself (or to another + function for further tracing in that scope), or ``None`` to turn off tracing + in that scope. + + The events have the following meaning: + + ``'call'`` + A function is called (or some other code block entered). The + global trace function is called; *arg* is ``None``; the return value + specifies the local trace function. + + ``'line'`` + The interpreter is about to execute a new line of code (sometimes multiple + line events on one line exist). The local trace function is called; *arg* + is ``None``; the return value specifies the new local trace function. + + ``'return'`` + A function (or other code block) is about to return. The local trace + function is called; *arg* is the value that will be returned. The trace + function's return value is ignored. + + ``'exception'`` + An exception has occurred. The local trace function is called; *arg* is a + tuple ``(exception, value, traceback)``; the return value specifies the + new local trace function. + + ``'c_call'`` + A C function is about to be called. This may be an extension function or + a builtin. *arg* is the C function object. + + ``'c_return'`` + A C function has returned. *arg* is ``None``. + + ``'c_exception'`` + A C function has thrown an exception. *arg* is ``None``. + + Note that as an exception is propagated down the chain of callers, an + ``'exception'`` event is generated at each level. + + For more information on code and frame objects, refer to :ref:`types`. + .. note:: The :func:`settrace` function is intended only for implementing debuggers, Modified: python/branches/release26-maint/Doc/reference/datamodel.rst ============================================================================== --- python/branches/release26-maint/Doc/reference/datamodel.rst (original) +++ python/branches/release26-maint/Doc/reference/datamodel.rst Fri Dec 5 09:51:30 2008 @@ -1365,21 +1365,21 @@ object: dictionary builtin: hash - Called for the key object for dictionary operations, and by the built-in - function :func:`hash`. Should return an integer usable as a hash value - for dictionary operations. The only required property is that objects which - compare equal have the same hash value; it is advised to somehow mix together - (e.g., using exclusive or) the hash values for the components of the object that - also play a part in comparison of objects. + Called by built-in function :func:`hash` and for operations on members of + hashed collections including :class:`set`, :class:`frozenset`, and + :class:`dict`. :meth:`__hash__` should return an integer. The only required + property is that objects which compare equal have the same hash value; it is + advised to somehow mix together (e.g. using exclusive or) the hash values for + the components of the object that also play a part in comparison of objects. If a class does not define a :meth:`__cmp__` or :meth:`__eq__` method it should not define a :meth:`__hash__` operation either; if it defines :meth:`__cmp__` or :meth:`__eq__` but not :meth:`__hash__`, its instances - will not be usable as dictionary keys. If a class defines mutable objects + will not be usable in hashed collections. If a class defines mutable objects and implements a :meth:`__cmp__` or :meth:`__eq__` method, it should not - implement :meth:`__hash__`, since the dictionary implementation requires that - a key's hash value is immutable (if the object's hash value changes, it will - be in the wrong hash bucket). + implement :meth:`__hash__`, since hashable collection implementations require + that a object's hash value is immutable (if the object's hash value changes, + it will be in the wrong hash bucket). User-defined classes have :meth:`__cmp__` and :meth:`__hash__` methods by default; with them, all objects compare unequal (except with themselves) @@ -1389,13 +1389,13 @@ change the meaning of :meth:`__cmp__` or :meth:`__eq__` such that the hash value returned is no longer appropriate (e.g. by switching to a value-based concept of equality instead of the default identity based equality) can - explicitly flag themselves as being unhashable by setting - ``__hash__ = None`` in the class definition. Doing so means that not only - will instances of the class raise an appropriate :exc:`TypeError` when - a program attempts to retrieve their hash value, but they will also be - correctly identified as unhashable when checking - ``isinstance(obj, collections.Hashable)`` (unlike classes which define - their own :meth:`__hash__` to explicitly raise :exc:`TypeError`). + explicitly flag themselves as being unhashable by setting ``__hash__ = None`` + in the class definition. Doing so means that not only will instances of the + class raise an appropriate :exc:`TypeError` when a program attempts to + retrieve their hash value, but they will also be correctly identified as + unhashable when checking ``isinstance(obj, collections.Hashable)`` (unlike + classes which define their own :meth:`__hash__` to explicitly raise + :exc:`TypeError`). .. versionchanged:: 2.5 :meth:`__hash__` may now also return a long integer object; the 32-bit Modified: python/branches/release26-maint/Lib/doctest.py ============================================================================== --- python/branches/release26-maint/Lib/doctest.py (original) +++ python/branches/release26-maint/Lib/doctest.py Fri Dec 5 09:51:30 2008 @@ -854,12 +854,12 @@ """ if module is None: return True + elif inspect.getmodule(object) is not None: + return module is inspect.getmodule(object) elif inspect.isfunction(object): return module.__dict__ is object.func_globals elif inspect.isclass(object): return module.__name__ == object.__module__ - elif inspect.getmodule(object) is not None: - return module is inspect.getmodule(object) elif hasattr(object, '__module__'): return module.__name__ == object.__module__ elif isinstance(object, property): Modified: python/branches/release26-maint/Lib/io.py ============================================================================== --- python/branches/release26-maint/Lib/io.py (original) +++ python/branches/release26-maint/Lib/io.py Fri Dec 5 09:51:30 2008 @@ -238,8 +238,6 @@ raise ValueError("invalid buffering size") if buffering == 0: if binary: - raw._name = file - raw._mode = mode return raw raise ValueError("can't have unbuffered text I/O") if updating: @@ -251,11 +249,8 @@ else: raise ValueError("unknown mode: %r" % mode) if binary: - buffer.name = file - buffer.mode = mode return buffer text = TextIOWrapper(buffer, encoding, errors, newline, line_buffering) - text.name = file text.mode = mode return text @@ -622,6 +617,10 @@ # that _fileio._FileIO inherits from io.RawIOBase (which would be hard # to do since _fileio.c is written in C). + def __init__(self, name, mode="r", closefd=True): + _fileio._FileIO.__init__(self, name, mode, closefd) + self._name = name + def close(self): _fileio._FileIO.close(self) RawIOBase.close(self) @@ -630,10 +629,6 @@ def name(self): return self._name - @property - def mode(self): - return self._mode - class BufferedIOBase(IOBase): @@ -767,6 +762,14 @@ def closed(self): return self.raw.closed + @property + def name(self): + return self.raw.name + + @property + def mode(self): + return self.raw.mode + ### Lower-level APIs ### def fileno(self): @@ -1473,6 +1476,10 @@ def closed(self): return self.buffer.closed + @property + def name(self): + return self.buffer.name + def fileno(self): return self.buffer.fileno() Modified: python/branches/release26-maint/Lib/multiprocessing/pool.py ============================================================================== --- python/branches/release26-maint/Lib/multiprocessing/pool.py (original) +++ python/branches/release26-maint/Lib/multiprocessing/pool.py Fri Dec 5 09:51:30 2008 @@ -149,7 +149,7 @@ def imap(self, func, iterable, chunksize=1): ''' - Equivalent of `itertool.imap()` -- can be MUCH slower than `Pool.map()` + Equivalent of `itertools.imap()` -- can be MUCH slower than `Pool.map()` ''' assert self._state == RUN if chunksize == 1: Modified: python/branches/release26-maint/Lib/test/test_bytes.py ============================================================================== --- python/branches/release26-maint/Lib/test/test_bytes.py (original) +++ python/branches/release26-maint/Lib/test/test_bytes.py Fri Dec 5 09:51:30 2008 @@ -725,7 +725,7 @@ # Issue 4348. Make sure that operations that don't mutate the array # copy the bytes. b = bytearray(b'abc') - #self.assertFalse(b is b.replace(b'abc', b'cde', 0)) + self.assertFalse(b is b.replace(b'abc', b'cde', 0)) t = bytearray([i for i in range(256)]) x = bytearray(b'') Modified: python/branches/release26-maint/Lib/test/test_io.py ============================================================================== --- python/branches/release26-maint/Lib/test/test_io.py (original) +++ python/branches/release26-maint/Lib/test/test_io.py Fri Dec 5 09:51:30 2008 @@ -272,6 +272,30 @@ self.assertRaises(ValueError, io.open, test_support.TESTFN, 'w', closefd=False) + def testReadClosed(self): + with io.open(test_support.TESTFN, "w") as f: + f.write("egg\n") + with io.open(test_support.TESTFN, "r") as f: + file = io.open(f.fileno(), "r", closefd=False) + self.assertEqual(file.read(), "egg\n") + file.seek(0) + file.close() + self.assertRaises(ValueError, file.read) + + def test_no_closefd_with_filename(self): + # can't use closefd in combination with a file name + self.assertRaises(ValueError, + io.open, test_support.TESTFN, "r", closefd=False) + + def test_closefd_attr(self): + with io.open(test_support.TESTFN, "wb") as f: + f.write(b"egg\n") + with io.open(test_support.TESTFN, "r") as f: + self.assertEqual(f.buffer.raw.closefd, True) + file = io.open(f.fileno(), "r", closefd=False) + self.assertEqual(file.buffer.raw.closefd, False) + + class MemorySeekTestMixin: def testInit(self): @@ -1225,6 +1249,9 @@ class MiscIOTest(unittest.TestCase): + def tearDown(self): + test_support.unlink(test_support.TESTFN) + def testImport__all__(self): for name in io.__all__: obj = getattr(io, name, None) @@ -1237,6 +1264,34 @@ self.assert_(issubclass(obj, io.IOBase)) + def test_attributes(self): + f = io.open(test_support.TESTFN, "wb", buffering=0) + self.assertEquals(f.mode, "w") + f.close() + + f = io.open(test_support.TESTFN, "U") + self.assertEquals(f.name, test_support.TESTFN) + self.assertEquals(f.buffer.name, test_support.TESTFN) + self.assertEquals(f.buffer.raw.name, test_support.TESTFN) + self.assertEquals(f.mode, "U") + self.assertEquals(f.buffer.mode, "r") + self.assertEquals(f.buffer.raw.mode, "r") + f.close() + + f = io.open(test_support.TESTFN, "w+") + self.assertEquals(f.mode, "w+") + self.assertEquals(f.buffer.mode, "r+") # Does it really matter? + self.assertEquals(f.buffer.raw.mode, "r+") + + g = io.open(f.fileno(), "wb", closefd=False) + self.assertEquals(g.mode, "w") + self.assertEquals(g.raw.mode, "w") + self.assertEquals(g.name, f.fileno()) + self.assertEquals(g.raw.name, f.fileno()) + f.close() + g.close() + + def test_main(): test_support.run_unittest(IOTest, BytesIOTest, StringIOTest, BufferedReaderTest, BufferedWriterTest, Modified: python/branches/release26-maint/Lib/test/test_xmlrpc.py ============================================================================== --- python/branches/release26-maint/Lib/test/test_xmlrpc.py (original) +++ python/branches/release26-maint/Lib/test/test_xmlrpc.py Fri Dec 5 09:51:30 2008 @@ -9,6 +9,7 @@ import mimetools import httplib import socket +import StringIO import os from test import test_support @@ -639,9 +640,93 @@ os.remove("xmldata.txt") os.remove(test_support.TESTFN) +class FakeSocket: + + def __init__(self): + self.data = StringIO.StringIO() + + def send(self, buf): + self.data.write(buf) + return len(buf) + + def sendall(self, buf): + self.data.write(buf) + + def getvalue(self): + return self.data.getvalue() + + def makefile(self, x, y): + raise RuntimeError + +class FakeTransport(xmlrpclib.Transport): + """A Transport instance that records instead of sending a request. + + This class replaces the actual socket used by httplib with a + FakeSocket object that records the request. It doesn't provide a + response. + """ + + def make_connection(self, host): + conn = xmlrpclib.Transport.make_connection(self, host) + conn._conn.sock = self.fake_socket = FakeSocket() + return conn + +class TransportSubclassTestCase(unittest.TestCase): + + def issue_request(self, transport_class): + """Return an HTTP request made via transport_class.""" + transport = transport_class() + proxy = xmlrpclib.ServerProxy("http://example.com/", + transport=transport) + try: + proxy.pow(6, 8) + except RuntimeError: + return transport.fake_socket.getvalue() + return None + + def test_custom_user_agent(self): + class TestTransport(FakeTransport): + + def send_user_agent(self, conn): + xmlrpclib.Transport.send_user_agent(self, conn) + conn.putheader("X-Test", "test_custom_user_agent") + + req = self.issue_request(TestTransport) + self.assert_("X-Test: test_custom_user_agent\r\n" in req) + + def test_send_host(self): + class TestTransport(FakeTransport): + + def send_host(self, conn, host): + xmlrpclib.Transport.send_host(self, conn, host) + conn.putheader("X-Test", "test_send_host") + + req = self.issue_request(TestTransport) + self.assert_("X-Test: test_send_host\r\n" in req) + + def test_send_request(self): + class TestTransport(FakeTransport): + + def send_request(self, conn, url, body): + xmlrpclib.Transport.send_request(self, conn, url, body) + conn.putheader("X-Test", "test_send_request") + + req = self.issue_request(TestTransport) + self.assert_("X-Test: test_send_request\r\n" in req) + + def test_send_content(self): + class TestTransport(FakeTransport): + + def send_content(self, conn, body): + conn.putheader("X-Test", "test_send_content") + xmlrpclib.Transport.send_content(self, conn, body) + + req = self.issue_request(TestTransport) + self.assert_("X-Test: test_send_content\r\n" in req) + def test_main(): xmlrpc_tests = [XMLRPCTestCase, HelperTestCase, DateTimeTestCase, - BinaryTestCase, FaultTestCase] + BinaryTestCase, FaultTestCase, TransportSubclassTestCase] # The test cases against a SimpleXMLRPCServer raise a socket error # 10035 (WSAEWOULDBLOCK) in the server thread handle_request call when Modified: python/branches/release26-maint/Misc/NEWS ============================================================================== --- python/branches/release26-maint/Misc/NEWS (original) +++ python/branches/release26-maint/Misc/NEWS Fri Dec 5 09:51:30 2008 @@ -12,6 +12,11 @@ Core and Builtins ----------------- +- Issue #4233: Changed semantic of ``_fileio.FileIO``'s ``close()`` + method on file objects with closefd=False. The file descriptor is still + kept open but the file object behaves like a closed file. The ``FileIO`` + object also got a new readonly attribute ``closefd``. + Library ------- Modified: python/branches/release26-maint/Modules/_fileio.c ============================================================================== --- python/branches/release26-maint/Modules/_fileio.c (original) +++ python/branches/release26-maint/Modules/_fileio.c Fri Dec 5 09:51:30 2008 @@ -61,10 +61,7 @@ fileio_close(PyFileIOObject *self) { if (!self->closefd) { - if (PyErr_WarnEx(PyExc_RuntimeWarning, - "Trying to close unclosable fd!", 3) < 0) { - return NULL; - } + self->fd = -1; Py_RETURN_NONE; } errno = internal_close(self); @@ -821,6 +818,12 @@ } static PyObject * +get_closefd(PyFileIOObject *self, void *closure) +{ + return PyBool_FromLong((long)(self->closefd)); +} + +static PyObject * get_mode(PyFileIOObject *self, void *closure) { return PyString_FromString(mode_string(self)); @@ -828,6 +831,8 @@ static PyGetSetDef fileio_getsetlist[] = { {"closed", (getter)get_closed, NULL, "True if the file is closed"}, + {"closefd", (getter)get_closefd, NULL, + "True if the file descriptor will be closed"}, {"mode", (getter)get_mode, NULL, "String giving the file mode"}, {0}, }; From python-checkins at python.org Fri Dec 5 09:52:52 2008 From: python-checkins at python.org (georg.brandl) Date: Fri, 5 Dec 2008 09:52:52 +0100 (CET) Subject: [Python-checkins] r67564 - python/branches/release26-maint Message-ID: <20081205085252.4E3271E4036@bag.python.org> Author: georg.brandl Date: Fri Dec 5 09:52:52 2008 New Revision: 67564 Log: Blocked revisions 67287,67342,67348-67349,67353 via svnmerge ........ r67287 | josiah.carlson | 2008-11-19 19:26:12 +0100 (Wed, 19 Nov 2008) | 2 lines Fix for issue 4332 in trunk. ........ r67342 | amaury.forgeotdarc | 2008-11-22 20:39:38 +0100 (Sat, 22 Nov 2008) | 3 lines yuvconvert.c is a part of the "sv" module, an old IRIX thing and certainly not useful for any Windows build. ........ r67348 | benjamin.peterson | 2008-11-23 03:09:41 +0100 (Sun, 23 Nov 2008) | 1 line raise a better error ........ r67349 | matthias.klose | 2008-11-23 14:37:03 +0100 (Sun, 23 Nov 2008) | 3 lines - Modules/Setup.dist: Mention _functools in section "Modules that should always be present (non UNIX dependent)" ........ r67353 | matthias.klose | 2008-11-23 14:54:42 +0100 (Sun, 23 Nov 2008) | 2 lines - Fix typo in last checkin ........ Modified: python/branches/release26-maint/ (props changed) From python-checkins at python.org Fri Dec 5 10:00:55 2008 From: python-checkins at python.org (georg.brandl) Date: Fri, 5 Dec 2008 10:00:55 +0100 (CET) Subject: [Python-checkins] r67565 - in python/branches/release26-maint: Doc/includes/mp_benchmarks.py Doc/includes/mp_distributing.py Doc/includes/mp_newtype.py Doc/includes/mp_pool.py Doc/includes/mp_synchronize.py Doc/includes/mp_webserver.py Doc/includes/mp_workers.py Doc/library/sqlite3.rst Doc/library/stringio.rst Lib/multiprocessing/__init__.py Lib/test/test_httplib.py Modules/_multiprocessing/semaphore.c Objects/unicodeobject.c Tools/scripts/svneol.py configure.in Message-ID: <20081205090055.B67771E400C@bag.python.org> Author: georg.brandl Date: Fri Dec 5 10:00:55 2008 New Revision: 67565 Log: Merged revisions 67398,67423-67424,67432,67440-67441,67444-67445,67454,67457,67463 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r67398 | benjamin.peterson | 2008-11-26 18:39:17 +0100 (Wed, 26 Nov 2008) | 1 line fix typo in sqlite3 docs ........ r67423 | jesse.noller | 2008-11-28 19:59:35 +0100 (Fri, 28 Nov 2008) | 2 lines issue4238: bsd support for cpu_count ........ r67424 | christian.heimes | 2008-11-28 20:33:33 +0100 (Fri, 28 Nov 2008) | 1 line Retain copyright of processing examples. This was requested by a Debian maintainer during packaging of the multiprocessing package for 2.4/2.5 ........ r67432 | benjamin.peterson | 2008-11-29 00:18:46 +0100 (Sat, 29 Nov 2008) | 1 line SVN format 9 is the same it seems ........ r67440 | jeremy.hylton | 2008-11-29 00:42:59 +0100 (Sat, 29 Nov 2008) | 4 lines Move definition int sval into branch of ifdef where it is used. Otherwise, you get a warning about an undefined variable. ........ r67441 | jeremy.hylton | 2008-11-29 01:09:16 +0100 (Sat, 29 Nov 2008) | 2 lines Reflow long lines. ........ r67444 | amaury.forgeotdarc | 2008-11-29 03:03:32 +0100 (Sat, 29 Nov 2008) | 2 lines Fix a small typo in docstring ........ r67445 | benjamin.peterson | 2008-11-30 04:07:33 +0100 (Sun, 30 Nov 2008) | 1 line StringIO.close() stops you from using the buffer, too ........ r67454 | benjamin.peterson | 2008-11-30 15:43:23 +0100 (Sun, 30 Nov 2008) | 1 line note the version that works ........ r67457 | christian.heimes | 2008-11-30 22:16:28 +0100 (Sun, 30 Nov 2008) | 1 line w# requires Py_ssize_t ........ r67463 | skip.montanaro | 2008-12-01 02:55:22 +0100 (Mon, 01 Dec 2008) | 1 line typo in comment ........ Modified: python/branches/release26-maint/ (props changed) python/branches/release26-maint/Doc/includes/mp_benchmarks.py python/branches/release26-maint/Doc/includes/mp_distributing.py python/branches/release26-maint/Doc/includes/mp_newtype.py python/branches/release26-maint/Doc/includes/mp_pool.py python/branches/release26-maint/Doc/includes/mp_synchronize.py python/branches/release26-maint/Doc/includes/mp_webserver.py python/branches/release26-maint/Doc/includes/mp_workers.py python/branches/release26-maint/Doc/library/sqlite3.rst python/branches/release26-maint/Doc/library/stringio.rst python/branches/release26-maint/Lib/multiprocessing/__init__.py python/branches/release26-maint/Lib/test/test_httplib.py python/branches/release26-maint/Modules/_multiprocessing/semaphore.c python/branches/release26-maint/Objects/unicodeobject.c python/branches/release26-maint/Tools/scripts/svneol.py python/branches/release26-maint/configure.in Modified: python/branches/release26-maint/Doc/includes/mp_benchmarks.py ============================================================================== --- python/branches/release26-maint/Doc/includes/mp_benchmarks.py (original) +++ python/branches/release26-maint/Doc/includes/mp_benchmarks.py Fri Dec 5 10:00:55 2008 @@ -1,6 +1,9 @@ # # Simple benchmarks for the multiprocessing package # +# Copyright (c) 2006-2008, R Oudkerk +# All rights reserved. +# import time, sys, multiprocessing, threading, Queue, gc Modified: python/branches/release26-maint/Doc/includes/mp_distributing.py ============================================================================== --- python/branches/release26-maint/Doc/includes/mp_distributing.py (original) +++ python/branches/release26-maint/Doc/includes/mp_distributing.py Fri Dec 5 10:00:55 2008 @@ -3,6 +3,9 @@ # # Depends on `multiprocessing` package -- tested with `processing-0.60` # +# Copyright (c) 2006-2008, R Oudkerk +# All rights reserved. +# __all__ = ['Cluster', 'Host', 'get_logger', 'current_process'] Modified: python/branches/release26-maint/Doc/includes/mp_newtype.py ============================================================================== --- python/branches/release26-maint/Doc/includes/mp_newtype.py (original) +++ python/branches/release26-maint/Doc/includes/mp_newtype.py Fri Dec 5 10:00:55 2008 @@ -2,6 +2,9 @@ # This module shows how to use arbitrary callables with a subclass of # `BaseManager`. # +# Copyright (c) 2006-2008, R Oudkerk +# All rights reserved. +# from multiprocessing import freeze_support from multiprocessing.managers import BaseManager, BaseProxy Modified: python/branches/release26-maint/Doc/includes/mp_pool.py ============================================================================== --- python/branches/release26-maint/Doc/includes/mp_pool.py (original) +++ python/branches/release26-maint/Doc/includes/mp_pool.py Fri Dec 5 10:00:55 2008 @@ -1,6 +1,9 @@ # # A test of `multiprocessing.Pool` class # +# Copyright (c) 2006-2008, R Oudkerk +# All rights reserved. +# import multiprocessing import time Modified: python/branches/release26-maint/Doc/includes/mp_synchronize.py ============================================================================== --- python/branches/release26-maint/Doc/includes/mp_synchronize.py (original) +++ python/branches/release26-maint/Doc/includes/mp_synchronize.py Fri Dec 5 10:00:55 2008 @@ -1,6 +1,9 @@ # # A test file for the `multiprocessing` package # +# Copyright (c) 2006-2008, R Oudkerk +# All rights reserved. +# import time, sys, random from Queue import Empty Modified: python/branches/release26-maint/Doc/includes/mp_webserver.py ============================================================================== --- python/branches/release26-maint/Doc/includes/mp_webserver.py (original) +++ python/branches/release26-maint/Doc/includes/mp_webserver.py Fri Dec 5 10:00:55 2008 @@ -8,6 +8,9 @@ # Not sure if we should synchronize access to `socket.accept()` method by # using a process-shared lock -- does not seem to be necessary. # +# Copyright (c) 2006-2008, R Oudkerk +# All rights reserved. +# import os import sys Modified: python/branches/release26-maint/Doc/includes/mp_workers.py ============================================================================== --- python/branches/release26-maint/Doc/includes/mp_workers.py (original) +++ python/branches/release26-maint/Doc/includes/mp_workers.py Fri Dec 5 10:00:55 2008 @@ -7,6 +7,9 @@ # in the original order then consider using `Pool.map()` or # `Pool.imap()` (which will save on the amount of code needed anyway). # +# Copyright (c) 2006-2008, R Oudkerk +# All rights reserved. +# import time import random Modified: python/branches/release26-maint/Doc/library/sqlite3.rst ============================================================================== --- python/branches/release26-maint/Doc/library/sqlite3.rst (original) +++ python/branches/release26-maint/Doc/library/sqlite3.rst Fri Dec 5 10:00:55 2008 @@ -223,8 +223,8 @@ .. attribute:: Connection.isolation_level - Get or set the current isolation level. :const:`None` for autocommit mode or one of - "DEFERRED", "IMMEDIATE" or "EXLUSIVE". See section + Get or set the current isolation level. :const:`None` for autocommit mode or + one of "DEFERRED", "IMMEDIATE" or "EXCLUSIVE". See section :ref:`sqlite3-controlling-transactions` for a more detailed explanation. Modified: python/branches/release26-maint/Doc/library/stringio.rst ============================================================================== --- python/branches/release26-maint/Doc/library/stringio.rst (original) +++ python/branches/release26-maint/Doc/library/stringio.rst Fri Dec 5 10:00:55 2008 @@ -37,7 +37,8 @@ .. method:: StringIO.close() - Free the memory buffer. + Free the memory buffer. Attempting to do further operations with a closed + :class:`StringIO` object will raise a :exc:`ValueError`. Example usage:: Modified: python/branches/release26-maint/Lib/multiprocessing/__init__.py ============================================================================== --- python/branches/release26-maint/Lib/multiprocessing/__init__.py (original) +++ python/branches/release26-maint/Lib/multiprocessing/__init__.py Fri Dec 5 10:00:55 2008 @@ -113,7 +113,7 @@ num = int(os.environ['NUMBER_OF_PROCESSORS']) except (ValueError, KeyError): num = 0 - elif sys.platform == 'darwin': + elif 'bsd' in sys.platform or sys.platform == 'darwin': try: num = int(os.popen('sysctl -n hw.ncpu').read()) except ValueError: Modified: python/branches/release26-maint/Lib/test/test_httplib.py ============================================================================== --- python/branches/release26-maint/Lib/test/test_httplib.py (original) +++ python/branches/release26-maint/Lib/test/test_httplib.py Fri Dec 5 10:00:55 2008 @@ -107,19 +107,23 @@ for hp in ("www.python.org:abc", "www.python.org:"): self.assertRaises(httplib.InvalidURL, httplib.HTTP, hp) - for hp, h, p in (("[fe80::207:e9ff:fe9b]:8000", "fe80::207:e9ff:fe9b", 8000), + for hp, h, p in (("[fe80::207:e9ff:fe9b]:8000", "fe80::207:e9ff:fe9b", + 8000), ("www.python.org:80", "www.python.org", 80), ("www.python.org", "www.python.org", 80), ("[fe80::207:e9ff:fe9b]", "fe80::207:e9ff:fe9b", 80)): http = httplib.HTTP(hp) c = http._conn - if h != c.host: self.fail("Host incorrectly parsed: %s != %s" % (h, c.host)) - if p != c.port: self.fail("Port incorrectly parsed: %s != %s" % (p, c.host)) + if h != c.host: + self.fail("Host incorrectly parsed: %s != %s" % (h, c.host)) + if p != c.port: + self.fail("Port incorrectly parsed: %s != %s" % (p, c.host)) def test_response_headers(self): # test response with multiple message headers with the same field name. text = ('HTTP/1.1 200 OK\r\n' - 'Set-Cookie: Customer="WILE_E_COYOTE"; Version="1"; Path="/acme"\r\n' + 'Set-Cookie: Customer="WILE_E_COYOTE";' + ' Version="1"; Path="/acme"\r\n' 'Set-Cookie: Part_Number="Rocket_Launcher_0001"; Version="1";' ' Path="/acme"\r\n' '\r\n' @@ -187,7 +191,8 @@ resp.close() def test_negative_content_length(self): - sock = FakeSocket('HTTP/1.1 200 OK\r\nContent-Length: -1\r\n\r\nHello\r\n') + sock = FakeSocket('HTTP/1.1 200 OK\r\n' + 'Content-Length: -1\r\n\r\nHello\r\n') resp = httplib.HTTPResponse(sock, method="GET") resp.begin() self.assertEquals(resp.read(), 'Hello\r\n') Modified: python/branches/release26-maint/Modules/_multiprocessing/semaphore.c ============================================================================== --- python/branches/release26-maint/Modules/_multiprocessing/semaphore.c (original) +++ python/branches/release26-maint/Modules/_multiprocessing/semaphore.c Fri Dec 5 10:00:55 2008 @@ -512,7 +512,6 @@ static PyObject * semlock_iszero(SemLockObject *self) { - int sval; #if HAVE_BROKEN_SEM_GETVALUE if (sem_trywait(self->handle) < 0) { if (errno == EAGAIN) @@ -524,6 +523,7 @@ Py_RETURN_FALSE; } #else + int sval; if (SEM_GETVALUE(self->handle, &sval) < 0) return mp_SetError(NULL, MP_STANDARD_ERROR); return PyBool_FromLong((long)sval == 0); Modified: python/branches/release26-maint/Objects/unicodeobject.c ============================================================================== --- python/branches/release26-maint/Objects/unicodeobject.c (original) +++ python/branches/release26-maint/Objects/unicodeobject.c Fri Dec 5 10:00:55 2008 @@ -7680,7 +7680,7 @@ } PyDoc_STRVAR(splitlines__doc__, -"S.splitlines([keepends]]) -> list of strings\n\ +"S.splitlines([keepends]) -> list of strings\n\ \n\ Return a list of the lines in S, breaking at line boundaries.\n\ Line breaks are not included in the resulting list unless keepends\n\ Modified: python/branches/release26-maint/Tools/scripts/svneol.py ============================================================================== --- python/branches/release26-maint/Tools/scripts/svneol.py (original) +++ python/branches/release26-maint/Tools/scripts/svneol.py Fri Dec 5 10:00:55 2008 @@ -39,9 +39,9 @@ format = int(open(os.path.join(root, ".svn", "format")).read().strip()) except IOError: return [] - if format == 8: - # In version 8, committed props are stored in prop-base, - # local modifications in props + if format in (8, 9): + # In version 8 and 9, committed props are stored in prop-base, local + # modifications in props return [os.path.join(root, ".svn", "prop-base", fn+".svn-base"), os.path.join(root, ".svn", "props", fn+".svn-work")] raise ValueError, "Unknown repository format" Modified: python/branches/release26-maint/configure.in ============================================================================== --- python/branches/release26-maint/configure.in (original) +++ python/branches/release26-maint/configure.in Fri Dec 5 10:00:55 2008 @@ -1,7 +1,7 @@ dnl *********************************************** dnl * Please run autoreconf to test your changes! * dnl *********************************************** -dnl NOTE: autoconf 2.64 doesn't seem to work (use 2.63). +dnl NOTE: autoconf 2.64 doesn't seem to work (use 2.61). # Set VERSION so we only need to edit in one place (i.e., here) m4_define(PYTHON_VERSION, 2.6) @@ -1844,7 +1844,7 @@ AC_CHECK_LIB(dl, dlopen) # Dynamic linking for SunOS/Solaris and SYSV AC_CHECK_LIB(dld, shl_load) # Dynamic linking for HP-UX -# only check for sem_ini if thread support is requested +# only check for sem_init if thread support is requested if test "$with_threads" = "yes" -o -z "$with_threads"; then AC_SEARCH_LIBS(sem_init, pthread rt posix4) # 'Real Time' functions on Solaris # posix4 on Solaris 2.6 From python-checkins at python.org Fri Dec 5 10:01:55 2008 From: python-checkins at python.org (georg.brandl) Date: Fri, 5 Dec 2008 10:01:55 +0100 (CET) Subject: [Python-checkins] r67566 - python/branches/release26-maint Message-ID: <20081205090155.77E0D1E4002@bag.python.org> Author: georg.brandl Date: Fri Dec 5 10:01:55 2008 New Revision: 67566 Log: Blocked revisions 67396,67407,67411,67442,67494,67511,67521 via svnmerge ........ r67396 | matthias.klose | 2008-11-26 18:32:49 +0100 (Wed, 26 Nov 2008) | 2 lines - Modules/Setup.dist: Mention _elementtree and _pickle. ........ r67407 | matthias.klose | 2008-11-27 08:45:25 +0100 (Thu, 27 Nov 2008) | 2 lines - Modules/Setup.dist: Update pyexpat ........ r67411 | matthias.klose | 2008-11-27 11:14:22 +0100 (Thu, 27 Nov 2008) | 2 lines - Modules/Setup.dist: Update _elementtree, add _bisect, datetime ........ r67442 | jeremy.hylton | 2008-11-29 02:09:35 +0100 (Sat, 29 Nov 2008) | 18 lines Send HTTP headers and message body in a single send() call. This change addresses part of issue 4336. Change endheaders() to take an optional message_body argument that is sent along with the headers. Change xmlrpclib and httplib's other methods to use this new interface. It is more efficient to make a single send() call, which should get the entire client request into one packet (assuming it is smaller than the MTU) and will avoid the long pause for delayed ack following timeout. Also: - Add a comment about the buffer size for makefile(). - Extract _set_content_length() method and fix whitespace issues there. ........ r67494 | jeffrey.yasskin | 2008-12-03 07:46:45 +0100 (Wed, 03 Dec 2008) | 5 lines Speed up Python (according to pybench and 2to3-on-itself) by 1-2% by caching whether any thread has tracing turned on, which saves one load instruction in the fast_next_opcode path in PyEval_EvalFrameEx(). See issue 4477. ........ r67511 | vinay.sajip | 2008-12-04 00:22:58 +0100 (Thu, 04 Dec 2008) | 1 line Issue #4384: Added logging integration with warnings module using captureWarnings(). This change includes a NullHandler which does nothing; it will be of use to library developers who want to avoid the "No handlers could be found for logger XXX" message which can appear if the library user doesn't configure logging. ........ r67521 | christian.heimes | 2008-12-04 15:34:40 +0100 (Thu, 04 Dec 2008) | 1 line Bumped up 2.6 to 2.7 ........ Modified: python/branches/release26-maint/ (props changed) From python-checkins at python.org Fri Dec 5 10:02:43 2008 From: python-checkins at python.org (georg.brandl) Date: Fri, 5 Dec 2008 10:02:43 +0100 (CET) Subject: [Python-checkins] r67567 - in python/branches/release26-maint: Lib/lib2to3 Lib/lib2to3/fixes/fix_import.py Lib/lib2to3/fixes/fix_metaclass.py Lib/lib2to3/tests/test_fixers.py Message-ID: <20081205090243.044E11E4002@bag.python.org> Author: georg.brandl Date: Fri Dec 5 10:02:42 2008 New Revision: 67567 Log: Merged revisions 67376 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ................ r67376 | benjamin.peterson | 2008-11-25 05:07:45 +0100 (Tue, 25 Nov 2008) | 17 lines Merged revisions 67183,67191,67371 via svnmerge from svn+ssh://pythondev at svn.python.org/sandbox/trunk/2to3/lib2to3 ........ r67183 | benjamin.peterson | 2008-11-10 21:51:33 -0600 (Mon, 10 Nov 2008) | 1 line handle 'import x as y' in fix_imports; this still needs more work... ........ r67191 | benjamin.peterson | 2008-11-11 17:24:51 -0600 (Tue, 11 Nov 2008) | 1 line super() is good ........ r67371 | benjamin.peterson | 2008-11-24 16:02:00 -0600 (Mon, 24 Nov 2008) | 1 line don't blow up in the metaclass fixer when assignments in the class statement aren't simple ........ ................ Modified: python/branches/release26-maint/ (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/fixes/fix_metaclass.py python/branches/release26-maint/Lib/lib2to3/tests/test_fixers.py 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 Fri Dec 5 10:02:42 2008 @@ -13,7 +13,7 @@ # Local imports from .. import fixer_base from os.path import dirname, join, exists, pathsep -from ..fixer_util import FromImport +from ..fixer_util import FromImport, syms class FixImport(fixer_base.BaseFix): @@ -26,11 +26,14 @@ def transform(self, node, results): imp = results['imp'] - if unicode(imp).startswith('.'): + mod_name = unicode(imp.children[0] if imp.type == syms.dotted_as_name \ + else imp) + + if mod_name.startswith('.'): # Already a new-style import return - if not probably_a_local_import(unicode(imp), self.filename): + if not probably_a_local_import(mod_name, self.filename): # I guess this is a global import -- skip it! return Modified: python/branches/release26-maint/Lib/lib2to3/fixes/fix_metaclass.py ============================================================================== --- python/branches/release26-maint/Lib/lib2to3/fixes/fix_metaclass.py (original) +++ python/branches/release26-maint/Lib/lib2to3/fixes/fix_metaclass.py Fri Dec 5 10:02:42 2008 @@ -110,8 +110,11 @@ if simple_node.type == syms.simple_stmt and simple_node.children: expr_node = simple_node.children[0] if expr_node.type == syms.expr_stmt and expr_node.children: - leaf_node = expr_node.children[0] - if leaf_node.value == '__metaclass__': + # Check if the expr_node is a simple assignment. + left_node = expr_node.children[0] + if isinstance(left_node, Leaf) and \ + left_node.value == '__metaclass__': + # We found a assignment to __metaclass__. fixup_simple_stmt(node, i, simple_node) remove_trailing_newline(simple_node) yield (node, i, simple_node) 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 Fri Dec 5 10:02:42 2008 @@ -2656,7 +2656,7 @@ def check(self, b, a): self.unchanged("from future_builtins import map; " + b, a) - FixerTestCase.check(self, b, a) + super(Test_map, self).check(b, a) def test_prefix_preservation(self): b = """x = map( f, 'abc' )""" @@ -2763,7 +2763,7 @@ def check(self, b, a): self.unchanged("from future_builtins import zip; " + b, a) - FixerTestCase.check(self, b, a) + super(Test_zip, self).check(b, a) def test_zip_basic(self): b = """x = zip(a, b, c)""" @@ -3308,7 +3308,7 @@ fixer = "import" def setUp(self): - FixerTestCase.setUp(self) + super(Test_import, self).setUp() # Need to replace fix_import's exists method # so we can check that it's doing the right thing self.files_checked = [] @@ -3327,9 +3327,9 @@ def check_both(self, b, a): self.always_exists = True - FixerTestCase.check(self, b, a) + super(Test_import, self).check(b, a) self.always_exists = False - FixerTestCase.unchanged(self, b) + super(Test_import, self).unchanged(b) def test_files_checked(self): def p(path): @@ -3406,6 +3406,11 @@ a = "from . import foo, bar" self.check_both(b, a) + def test_import_as(self): + b = "import foo as x" + a = "from . import foo as x" + self.check_both(b, a) + def test_dotted_import(self): b = "import foo.bar" a = "from . import foo.bar" @@ -3800,6 +3805,17 @@ """ self.check(b, a) + b = """ + class X: + __metaclass__ = Meta + save.py = 23 + """ + a = """ + class X(metaclass=Meta): + save.py = 23 + """ + self.check(b, a) + class Test_getcwdu(FixerTestCase): From python-checkins at python.org Fri Dec 5 10:03:39 2008 From: python-checkins at python.org (georg.brandl) Date: Fri, 5 Dec 2008 10:03:39 +0100 (CET) Subject: [Python-checkins] r67568 - python/branches/release26-maint Message-ID: <20081205090339.7D6A91E4002@bag.python.org> Author: georg.brandl Date: Fri Dec 5 10:03:39 2008 New Revision: 67568 Log: Merged revisions 67484 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r67484 | christian.heimes | 2008-12-03 01:53:18 +0100 (Wed, 03 Dec 2008) | 2 lines Issue #4025 again Converted a C99 style comment to a C89 style comment (found by MAL). ........ Modified: python/branches/release26-maint/ (props changed) From python-checkins at python.org Fri Dec 5 10:08:29 2008 From: python-checkins at python.org (georg.brandl) Date: Fri, 5 Dec 2008 10:08:29 +0100 (CET) Subject: [Python-checkins] r67569 - in python/branches/release26-maint: Doc/library/heapq.rst Doc/library/os.rst Doc/library/re.rst Doc/library/subprocess.rst Doc/reference/datamodel.rst Doc/tutorial/controlflow.rst Lib/test/list_tests.py Lib/test/test_fileio.py Lib/test/test_io.py Misc/NEWS Modules/_fileio.c Objects/listobject.c Message-ID: <20081205090829.152F71E4002@bag.python.org> Author: georg.brandl Date: Fri Dec 5 10:08:28 2008 New Revision: 67569 Log: Merged revisions 67326,67498,67531-67532,67538,67553-67554,67556-67557 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r67326 | benjamin.peterson | 2008-11-22 02:59:15 +0100 (Sat, 22 Nov 2008) | 1 line backport r67325: make FileIO.mode always contain 'b' ........ r67498 | raymond.hettinger | 2008-12-03 16:42:10 +0100 (Wed, 03 Dec 2008) | 1 line Backport r67478 ........ r67531 | georg.brandl | 2008-12-04 19:54:05 +0100 (Thu, 04 Dec 2008) | 2 lines Add reference to enumerate() to indices example. ........ r67532 | georg.brandl | 2008-12-04 19:59:16 +0100 (Thu, 04 Dec 2008) | 2 lines Add another heapq example. ........ r67538 | georg.brandl | 2008-12-04 22:28:16 +0100 (Thu, 04 Dec 2008) | 2 lines Clarification to avoid confusing output with file descriptors. ........ r67553 | georg.brandl | 2008-12-05 08:49:49 +0100 (Fri, 05 Dec 2008) | 2 lines #4408: document regex.groups. ........ r67554 | georg.brandl | 2008-12-05 08:52:26 +0100 (Fri, 05 Dec 2008) | 2 lines #4409: fix asterisks looking like footnotes. ........ r67556 | georg.brandl | 2008-12-05 09:02:17 +0100 (Fri, 05 Dec 2008) | 2 lines #4441: improve doc for os.open() flags. ........ r67557 | georg.brandl | 2008-12-05 09:06:57 +0100 (Fri, 05 Dec 2008) | 2 lines Add an index entry for "subclassing immutable types". ........ Modified: python/branches/release26-maint/ (props changed) python/branches/release26-maint/Doc/library/heapq.rst python/branches/release26-maint/Doc/library/os.rst python/branches/release26-maint/Doc/library/re.rst python/branches/release26-maint/Doc/library/subprocess.rst python/branches/release26-maint/Doc/reference/datamodel.rst python/branches/release26-maint/Doc/tutorial/controlflow.rst python/branches/release26-maint/Lib/test/list_tests.py python/branches/release26-maint/Lib/test/test_fileio.py python/branches/release26-maint/Lib/test/test_io.py python/branches/release26-maint/Misc/NEWS python/branches/release26-maint/Modules/_fileio.c python/branches/release26-maint/Objects/listobject.c Modified: python/branches/release26-maint/Doc/library/heapq.rst ============================================================================== --- python/branches/release26-maint/Doc/library/heapq.rst (original) +++ python/branches/release26-maint/Doc/library/heapq.rst Fri Dec 5 10:08:28 2008 @@ -88,6 +88,21 @@ >>> print data == ordered True +Using a heap to insert items at the correct place in a priority queue: + + >>> heap = [] + >>> data = [(1, 'J'), (4, 'N'), (3, 'H'), (2, 'O')] + >>> for item in data: + ... heappush(heap, item) + ... + >>> while heap: + ... print heappop(heap)[1] + J + O + H + N + + The module also offers three general purpose functions based on heaps. Modified: python/branches/release26-maint/Doc/library/os.rst ============================================================================== --- python/branches/release26-maint/Doc/library/os.rst (original) +++ python/branches/release26-maint/Doc/library/os.rst Fri Dec 5 10:08:28 2008 @@ -681,10 +681,11 @@ :func:`fdopen`, or :data:`sys.stdout` or :data:`sys.stderr`, use its :meth:`write` method. -The following data items are available for use in constructing the *flags* -parameter to the :func:`open` function. Some items will not be available on all -platforms. For descriptions of their availability and use, consult -:manpage:`open(2)`. +The following constants are options for the *flags* parameter to the +:func:`open` function. They can be combined using the bitwise OR operator +``|``. Some of them are not available on all platforms. For descriptions of +their availability and use, consult the :manpage:`open(2)` manual page or the +respective documentation for your operating system. .. data:: O_RDONLY @@ -695,8 +696,7 @@ O_EXCL O_TRUNC - Options for the *flag* argument to the :func:`open` function. These can be - combined using the bitwise OR operator ``|``. Availability: Unix, Windows. + These constants are available on Unix and Windows. .. data:: O_DSYNC @@ -708,8 +708,7 @@ O_SHLOCK O_EXLOCK - More options for the *flag* argument to the :func:`open` function. Availability: - Unix. + These constants are only available on Unix. .. data:: O_BINARY @@ -720,8 +719,7 @@ O_SEQUENTIAL O_TEXT - Options for the *flag* argument to the :func:`open` function. These can be - combined using the bitwise OR operator ``|``. Availability: Windows. + These constants are only available on Windows. .. data:: O_ASYNC @@ -730,8 +728,8 @@ O_NOFOLLOW O_NOATIME - Options for the *flag* argument to the :func:`open` function. These are - GNU extensions and not present if they are not defined by the C library. + These constants are GNU extensions and not present if they are not defined by + the C library. .. data:: SEEK_SET Modified: python/branches/release26-maint/Doc/library/re.rst ============================================================================== --- python/branches/release26-maint/Doc/library/re.rst (original) +++ python/branches/release26-maint/Doc/library/re.rst Fri Dec 5 10:08:28 2008 @@ -750,6 +750,11 @@ were provided. +.. attribute:: RegexObject.groups + + The number of capturing groups in the pattern. + + .. attribute:: RegexObject.groupindex A dictionary mapping any symbolic group names defined by ``(?P)`` to group Modified: python/branches/release26-maint/Doc/library/subprocess.rst ============================================================================== --- python/branches/release26-maint/Doc/library/subprocess.rst (original) +++ python/branches/release26-maint/Doc/library/subprocess.rst Fri Dec 5 10:08:28 2008 @@ -207,7 +207,7 @@ *input* argument should be a string to be sent to the child process, or ``None``, if no data should be sent to the child. - :meth:`communicate` returns a tuple ``(stdout, stderr)``. + :meth:`communicate` returns a tuple ``(stdoutdata, stderrdata)``. Note that if you want to send data to the process's stdin, you need to create the Popen object with ``stdin=PIPE``. Similarly, to get anything other than @@ -358,8 +358,8 @@ print >>sys.stderr, "Execution failed:", e -Replacing os.spawn\* -^^^^^^^^^^^^^^^^^^^^ +Replacing the os.spawn family +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ P_NOWAIT example:: @@ -386,8 +386,8 @@ Popen(["/bin/mycmd", "myarg"], env={"PATH": "/usr/bin"}) -Replacing os.popen\* -^^^^^^^^^^^^^^^^^^^^ +Replacing os.popen, os.popen2, os.popen3 +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ :: @@ -430,8 +430,8 @@ (child_stdin, child_stdout_and_stderr) = (p.stdin, p.stdout) -Replacing popen2.\* -^^^^^^^^^^^^^^^^^^^ +Replacing functions from the popen2 module +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ .. note:: Modified: python/branches/release26-maint/Doc/reference/datamodel.rst ============================================================================== --- python/branches/release26-maint/Doc/reference/datamodel.rst (original) +++ python/branches/release26-maint/Doc/reference/datamodel.rst Fri Dec 5 10:08:28 2008 @@ -1162,9 +1162,10 @@ Basic customization ------------------- - .. method:: object.__new__(cls[, ...]) + .. index:: pair: subclassing; immutable types + Called to create a new instance of class *cls*. :meth:`__new__` is a static method (special-cased so you need not declare it as such) that takes the class of which an instance was requested as its first argument. The remaining Modified: python/branches/release26-maint/Doc/tutorial/controlflow.rst ============================================================================== --- python/branches/release26-maint/Doc/tutorial/controlflow.rst (original) +++ python/branches/release26-maint/Doc/tutorial/controlflow.rst Fri Dec 5 10:08:28 2008 @@ -104,8 +104,8 @@ >>> range(-10, -100, -30) [-10, -40, -70] -To iterate over the indices of a sequence, combine :func:`range` and :func:`len` -as follows:: +To iterate over the indices of a sequence, you can combine :func:`range` and +:func:`len` as follows:: >>> a = ['Mary', 'had', 'a', 'little', 'lamb'] >>> for i in range(len(a)): @@ -117,6 +117,9 @@ 3 little 4 lamb +In most such cases, however, it is convenient to use the :func:`enumerate` +function, see :ref:`tut-loopidioms`. + .. _tut-break: Modified: python/branches/release26-maint/Lib/test/list_tests.py ============================================================================== --- python/branches/release26-maint/Lib/test/list_tests.py (original) +++ python/branches/release26-maint/Lib/test/list_tests.py Fri Dec 5 10:08:28 2008 @@ -84,6 +84,8 @@ self.assertRaises(StopIteration, r.next) self.assertEqual(list(reversed(self.type2test())), self.type2test()) + # Bug 3689: make sure list-reversed-iterator doesn't have __len__ + self.assertRaises(TypeError, len, reversed([1,2,3])) def test_setitem(self): a = self.type2test([0, 1]) Modified: python/branches/release26-maint/Lib/test/test_fileio.py ============================================================================== --- python/branches/release26-maint/Lib/test/test_fileio.py (original) +++ python/branches/release26-maint/Lib/test/test_fileio.py Fri Dec 5 10:08:28 2008 @@ -50,7 +50,7 @@ # verify expected attributes exist f = self.f - self.assertEquals(f.mode, "w") + self.assertEquals(f.mode, "wb") self.assertEquals(f.closed, False) # verify the attributes are readonly @@ -160,7 +160,7 @@ def testModeStrings(self): # check invalid mode strings - for mode in ("", "aU", "wU+", "rb", "rt"): + for mode in ("", "aU", "wU+", "rw", "rt"): try: f = _fileio._FileIO(TESTFN, mode) except ValueError: Modified: python/branches/release26-maint/Lib/test/test_io.py ============================================================================== --- python/branches/release26-maint/Lib/test/test_io.py (original) +++ python/branches/release26-maint/Lib/test/test_io.py Fri Dec 5 10:08:28 2008 @@ -1266,7 +1266,7 @@ def test_attributes(self): f = io.open(test_support.TESTFN, "wb", buffering=0) - self.assertEquals(f.mode, "w") + self.assertEquals(f.mode, "wb") f.close() f = io.open(test_support.TESTFN, "U") @@ -1274,18 +1274,18 @@ self.assertEquals(f.buffer.name, test_support.TESTFN) self.assertEquals(f.buffer.raw.name, test_support.TESTFN) self.assertEquals(f.mode, "U") - self.assertEquals(f.buffer.mode, "r") - self.assertEquals(f.buffer.raw.mode, "r") + self.assertEquals(f.buffer.mode, "rb") + self.assertEquals(f.buffer.raw.mode, "rb") f.close() f = io.open(test_support.TESTFN, "w+") self.assertEquals(f.mode, "w+") - self.assertEquals(f.buffer.mode, "r+") # Does it really matter? - self.assertEquals(f.buffer.raw.mode, "r+") + self.assertEquals(f.buffer.mode, "rb+") # Does it really matter? + self.assertEquals(f.buffer.raw.mode, "rb+") g = io.open(f.fileno(), "wb", closefd=False) - self.assertEquals(g.mode, "w") - self.assertEquals(g.raw.mode, "w") + self.assertEquals(g.mode, "wb") + self.assertEquals(g.raw.mode, "wb") self.assertEquals(g.name, f.fileno()) self.assertEquals(g.raw.name, f.fileno()) f.close() Modified: python/branches/release26-maint/Misc/NEWS ============================================================================== --- python/branches/release26-maint/Misc/NEWS (original) +++ python/branches/release26-maint/Misc/NEWS Fri Dec 5 10:08:28 2008 @@ -17,9 +17,14 @@ kept open but the file object behaves like a closed file. The ``FileIO`` object also got a new readonly attribute ``closefd``. +- Issue #3689: The list reversed iterator now supports __length_hint__ + instead of __len__. Behavior now matches other reversed iterators. + Library ------- +- FileIO's mode attribute now always includes ``"b"``. + What's New in Python 2.6.1 ========================== Modified: python/branches/release26-maint/Modules/_fileio.c ============================================================================== --- python/branches/release26-maint/Modules/_fileio.c (original) +++ python/branches/release26-maint/Modules/_fileio.c Fri Dec 5 10:08:28 2008 @@ -208,6 +208,8 @@ flags |= O_CREAT; append = 1; break; + case 'b': + break; case '+': if (plus) goto bad_mode; @@ -682,12 +684,12 @@ { if (self->readable) { if (self->writable) - return "r+"; + return "rb+"; else - return "r"; + return "rb"; } else - return "w"; + return "wb"; } static PyObject * Modified: python/branches/release26-maint/Objects/listobject.c ============================================================================== --- python/branches/release26-maint/Objects/listobject.c (original) +++ python/branches/release26-maint/Objects/listobject.c Fri Dec 5 10:08:28 2008 @@ -2911,11 +2911,11 @@ static void listreviter_dealloc(listreviterobject *); static int listreviter_traverse(listreviterobject *, visitproc, void *); static PyObject *listreviter_next(listreviterobject *); -static Py_ssize_t listreviter_len(listreviterobject *); +static PyObject *listreviter_len(listreviterobject *); -static PySequenceMethods listreviter_as_sequence = { - (lenfunc)listreviter_len, /* sq_length */ - 0, /* sq_concat */ +static PyMethodDef listreviter_methods[] = { + {"__length_hint__", (PyCFunction)listreviter_len, METH_NOARGS, length_hint_doc}, + {NULL, NULL} /* sentinel */ }; PyTypeObject PyListRevIter_Type = { @@ -2931,7 +2931,7 @@ 0, /* tp_compare */ 0, /* tp_repr */ 0, /* tp_as_number */ - &listreviter_as_sequence, /* tp_as_sequence */ + 0, /* tp_as_sequence */ 0, /* tp_as_mapping */ 0, /* tp_hash */ 0, /* tp_call */ @@ -2947,6 +2947,7 @@ 0, /* tp_weaklistoffset */ PyObject_SelfIter, /* tp_iter */ (iternextfunc)listreviter_next, /* tp_iternext */ + listreviter_methods, /* tp_methods */ 0, }; @@ -3002,11 +3003,11 @@ return NULL; } -static Py_ssize_t +static PyObject * listreviter_len(listreviterobject *it) { Py_ssize_t len = it->it_index + 1; if (it->it_seq == NULL || PyList_GET_SIZE(it->it_seq) < len) - return 0; - return len; + len = 0; + return PyLong_FromSsize_t(len); } From python-checkins at python.org Fri Dec 5 10:09:32 2008 From: python-checkins at python.org (georg.brandl) Date: Fri, 5 Dec 2008 10:09:32 +0100 (CET) Subject: [Python-checkins] r67570 - python/branches/release26-maint Message-ID: <20081205090932.252E51E4002@bag.python.org> Author: georg.brandl Date: Fri Dec 5 10:09:31 2008 New Revision: 67570 Log: Blocked revisions 67536-67537,67543 via svnmerge ........ r67536 | gregory.p.smith | 2008-12-04 21:21:09 +0100 (Thu, 04 Dec 2008) | 3 lines Adds a subprocess.check_call_output() function to return the output from a process on success or raise an exception on error. ........ r67537 | vinay.sajip | 2008-12-04 21:32:18 +0100 (Thu, 04 Dec 2008) | 1 line Took Nick Coghlan's advice about importing warnings globally in logging, to avoid the possibility of race conditions: "This could deadlock if a thread spawned as a side effect of importing a module happens to trigger a warning. warnings is pulled into sys.modules as part of the interpreter startup - having a global 'import warnings' shouldn't have any real effect on logging's import time." ........ r67543 | gregory.p.smith | 2008-12-05 03:27:01 +0100 (Fri, 05 Dec 2008) | 2 lines rename the new check_call_output to check_output. its less ugly. ........ Modified: python/branches/release26-maint/ (props changed) From python-checkins at python.org Fri Dec 5 10:13:46 2008 From: python-checkins at python.org (georg.brandl) Date: Fri, 5 Dec 2008 10:13:46 +0100 (CET) Subject: [Python-checkins] r67571 - python/trunk/Doc/library/getopt.rst Message-ID: <20081205091346.BCDA81E4002@bag.python.org> Author: georg.brandl Date: Fri Dec 5 10:13:45 2008 New Revision: 67571 Log: Use markup. Modified: python/trunk/Doc/library/getopt.rst Modified: python/trunk/Doc/library/getopt.rst ============================================================================== --- python/trunk/Doc/library/getopt.rst (original) +++ python/trunk/Doc/library/getopt.rst Fri Dec 5 10:13:45 2008 @@ -63,8 +63,8 @@ non-option argument is encountered. If the first character of the option string is '+', or if the environment - variable POSIXLY_CORRECT is set, then option processing stops as soon as a - non-option argument is encountered. + variable :envvar:`POSIXLY_CORRECT` is set, then option processing stops as + soon as a non-option argument is encountered. .. versionadded:: 2.3 From python-checkins at python.org Fri Dec 5 10:23:14 2008 From: python-checkins at python.org (georg.brandl) Date: Fri, 5 Dec 2008 10:23:14 +0100 (CET) Subject: [Python-checkins] r67572 - in python/trunk: Lib/getopt.py Lib/test/test_getopt.py Misc/NEWS Message-ID: <20081205092314.54E221E4002@bag.python.org> Author: georg.brandl Date: Fri Dec 5 10:23:14 2008 New Revision: 67572 Log: #4458: recognize "-" as an argument, not a malformed option in gnu_getopt(). Modified: python/trunk/Lib/getopt.py python/trunk/Lib/test/test_getopt.py python/trunk/Misc/NEWS Modified: python/trunk/Lib/getopt.py ============================================================================== --- python/trunk/Lib/getopt.py (original) +++ python/trunk/Lib/getopt.py Fri Dec 5 10:23:14 2008 @@ -130,7 +130,7 @@ if args[0][:2] == '--': opts, args = do_longs(opts, args[0][2:], longopts, args[1:]) - elif args[0][:1] == '-': + elif args[0][:1] == '-' and args[0] != '-': opts, args = do_shorts(opts, args[0][1:], shortopts, args[1:]) else: if all_options_first: Modified: python/trunk/Lib/test/test_getopt.py ============================================================================== --- python/trunk/Lib/test/test_getopt.py (original) +++ python/trunk/Lib/test/test_getopt.py Fri Dec 5 10:23:14 2008 @@ -124,6 +124,11 @@ self.assertEqual(opts, [('-a', ''), ('-b', '1'), ('--alpha', ''), ('--beta', '2')]) + # recognize "-" as an argument + opts, args = getopt.gnu_getopt(['-a', '-', '-b', '-'], 'ab:', []) + self.assertEqual(args, ['-']) + self.assertEqual(opts, [('-a', ''), ('-b', '-')]) + # Posix style via + opts, args = getopt.gnu_getopt(cmdline, '+ab:', ['alpha', 'beta=']) self.assertEqual(opts, [('-a', '')]) Modified: python/trunk/Misc/NEWS ============================================================================== --- python/trunk/Misc/NEWS (original) +++ python/trunk/Misc/NEWS Fri Dec 5 10:23:14 2008 @@ -60,6 +60,9 @@ Library ------- +- Issue #4458: getopt.gnu_getopt() now recognizes a single "-" as an argument, + not a malformed option. + - Added the subprocess.check_output() convenience function to get output from a subprocess on success or raise an exception on error. From python-checkins at python.org Fri Dec 5 10:24:05 2008 From: python-checkins at python.org (georg.brandl) Date: Fri, 5 Dec 2008 10:24:05 +0100 (CET) Subject: [Python-checkins] r67573 - python/branches/release26-maint Message-ID: <20081205092405.0FA061E4002@bag.python.org> Author: georg.brandl Date: Fri Dec 5 10:24:04 2008 New Revision: 67573 Log: Blocked revisions 67572 via svnmerge ........ r67572 | georg.brandl | 2008-12-05 10:23:14 +0100 (Fri, 05 Dec 2008) | 2 lines #4458: recognize "-" as an argument, not a malformed option in gnu_getopt(). ........ Modified: python/branches/release26-maint/ (props changed) From python-checkins at python.org Fri Dec 5 10:25:32 2008 From: python-checkins at python.org (georg.brandl) Date: Fri, 5 Dec 2008 10:25:32 +0100 (CET) Subject: [Python-checkins] r67574 - python/trunk/Doc/library/os.rst Message-ID: <20081205092532.5496C1E400C@bag.python.org> Author: georg.brandl Date: Fri Dec 5 10:25:32 2008 New Revision: 67574 Log: #4441 followup: Add link to open() docs for Windows. Modified: python/trunk/Doc/library/os.rst Modified: python/trunk/Doc/library/os.rst ============================================================================== --- python/trunk/Doc/library/os.rst (original) +++ python/trunk/Doc/library/os.rst Fri Dec 5 10:25:32 2008 @@ -684,8 +684,8 @@ The following constants are options for the *flags* parameter to the :func:`open` function. They can be combined using the bitwise OR operator ``|``. Some of them are not available on all platforms. For descriptions of -their availability and use, consult the :manpage:`open(2)` manual page or the -respective documentation for your operating system. +their availability and use, consult the :manpage:`open(2)` manual page on Unix +or `the MSDN ` on Windows. .. data:: O_RDONLY From buildbot at python.org Fri Dec 5 10:28:24 2008 From: buildbot at python.org (buildbot at python.org) Date: Fri, 05 Dec 2008 09:28:24 +0000 Subject: [Python-checkins] buildbot failure in sparc Debian 3.0 Message-ID: <20081205092824.A71C71E400C@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/740 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: christian.heimes,georg.brandl BUILD FAILED: failed failed slave lost sincerely, -The Buildbot From buildbot at python.org Fri Dec 5 12:25:35 2008 From: buildbot at python.org (buildbot at python.org) Date: Fri, 05 Dec 2008 11:25:35 +0000 Subject: [Python-checkins] buildbot failure in sparc Debian trunk Message-ID: <20081205112535.411DE1E4042@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/856 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: 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 Fri Dec 5 12:34:51 2008 From: python-checkins at python.org (georg.brandl) Date: Fri, 5 Dec 2008 12:34:51 +0100 (CET) Subject: [Python-checkins] r67575 - python/trunk/Lib/textwrap.py Message-ID: <20081205113451.491971E4002@bag.python.org> Author: georg.brandl Date: Fri Dec 5 12:34:51 2008 New Revision: 67575 Log: #4544: add `dedent` to textwrap.__all__. Modified: python/trunk/Lib/textwrap.py Modified: python/trunk/Lib/textwrap.py ============================================================================== --- python/trunk/Lib/textwrap.py (original) +++ python/trunk/Lib/textwrap.py Fri Dec 5 12:34:51 2008 @@ -17,7 +17,7 @@ #except NameError: # (True, False) = (1, 0) -__all__ = ['TextWrapper', 'wrap', 'fill'] +__all__ = ['TextWrapper', 'wrap', 'fill', 'dedent'] # Hardcode the recognized whitespace characters to the US-ASCII # whitespace characters. The main reason for doing this is that in From buildbot at python.org Fri Dec 5 13:02:51 2008 From: buildbot at python.org (buildbot at python.org) Date: Fri, 05 Dec 2008 12:02:51 +0000 Subject: [Python-checkins] buildbot failure in x86 osx.5 trunk Message-ID: <20081205120252.0D9D91E400C@bag.python.org> The Buildbot has detected a new failure of x86 osx.5 trunk. Full details are available at: http://www.python.org/dev/buildbot/all/x86%20osx.5%20trunk/builds/369 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: heller-x86-osx5 Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: georg.brandl BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_socket ====================================================================== ERROR: testShutdown (test.test_socket.BasicTCPTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/trunk.heller-x86-osx5/build/Lib/test/test_socket.py", line 120, in _tearDown self.fail(msg) AssertionError: [Errno 57] Socket is not connected make: *** [buildbottest] Error 1 sincerely, -The Buildbot From python-checkins at python.org Fri Dec 5 13:09:42 2008 From: python-checkins at python.org (georg.brandl) Date: Fri, 5 Dec 2008 13:09:42 +0100 (CET) Subject: [Python-checkins] r67576 - in python/trunk: Lib/test/test_parser.py Misc/NEWS Modules/parsermodule.c Message-ID: <20081205120942.5DFB91E4002@bag.python.org> Author: georg.brandl Date: Fri Dec 5 13:09:41 2008 New Revision: 67576 Log: #4529: fix parser's validation for try-except-finally statements. Modified: python/trunk/Lib/test/test_parser.py python/trunk/Misc/NEWS python/trunk/Modules/parsermodule.c Modified: python/trunk/Lib/test/test_parser.py ============================================================================== --- python/trunk/Lib/test/test_parser.py (original) +++ python/trunk/Lib/test/test_parser.py Fri Dec 5 13:09:41 2008 @@ -200,6 +200,16 @@ self.check_suite("with open('x'): pass\n") self.check_suite("with open('x') as f: pass\n") + def test_try_stmt(self): + self.check_suite("try: pass\nexcept: pass\n") + self.check_suite("try: pass\nfinally: pass\n") + self.check_suite("try: pass\nexcept A: pass\nfinally: pass\n") + self.check_suite("try: pass\nexcept A: pass\nexcept: pass\n" + "finally: pass\n") + self.check_suite("try: pass\nexcept: pass\nelse: pass\n") + self.check_suite("try: pass\nexcept: pass\nelse: pass\n" + "finally: pass\n") + def test_position(self): # An absolutely minimal test of position information. Better # tests would be a big project. Modified: python/trunk/Misc/NEWS ============================================================================== --- python/trunk/Misc/NEWS (original) +++ python/trunk/Misc/NEWS Fri Dec 5 13:09:41 2008 @@ -60,6 +60,9 @@ Library ------- +- Issue #4529: fix the parser module's validation of try-except-finally + statements. + - Issue #4458: getopt.gnu_getopt() now recognizes a single "-" as an argument, not a malformed option. Modified: python/trunk/Modules/parsermodule.c ============================================================================== --- python/trunk/Modules/parsermodule.c (original) +++ python/trunk/Modules/parsermodule.c Fri Dec 5 13:09:41 2008 @@ -2057,6 +2057,7 @@ /* try_stmt: * 'try' ':' suite (except_clause ':' suite)+ ['else' ':' suite] + ['finally' ':' suite] * | 'try' ':' suite 'finally' ':' suite * */ @@ -2082,35 +2083,34 @@ PyErr_Format(parser_error, "Illegal number of children for try/%s node.", name); } - /* Skip past except_clause sections: */ + /* Handle try/finally statement */ + if (res && (TYPE(CHILD(tree, pos)) == NAME) && + (strcmp(STR(CHILD(tree, pos)), "finally") == 0)) { + res = (validate_numnodes(tree, 6, "try/finally") + && validate_colon(CHILD(tree, 4)) + && validate_suite(CHILD(tree, 5))); + return (res); + } + /* try/except statement: skip past except_clause sections */ while (res && (TYPE(CHILD(tree, pos)) == except_clause)) { res = (validate_except_clause(CHILD(tree, pos)) && validate_colon(CHILD(tree, pos + 1)) && validate_suite(CHILD(tree, pos + 2))); pos += 3; } - if (res && (pos < nch)) { - res = validate_ntype(CHILD(tree, pos), NAME); - if (res && (strcmp(STR(CHILD(tree, pos)), "finally") == 0)) - res = (validate_numnodes(tree, 6, "try/finally") - && validate_colon(CHILD(tree, 4)) - && validate_suite(CHILD(tree, 5))); - else if (res) { - if (nch == (pos + 3)) { - res = ((strcmp(STR(CHILD(tree, pos)), "except") == 0) - || (strcmp(STR(CHILD(tree, pos)), "else") == 0)); - if (!res) - err_string("illegal trailing triple in try statement"); - } - else if (nch == (pos + 6)) { - res = (validate_name(CHILD(tree, pos), "except") - && validate_colon(CHILD(tree, pos + 1)) - && validate_suite(CHILD(tree, pos + 2)) - && validate_name(CHILD(tree, pos + 3), "else")); - } - else - res = validate_numnodes(tree, pos + 3, "try/except"); - } + /* skip else clause */ + if (res && (TYPE(CHILD(tree, pos)) == NAME) && + (strcmp(STR(CHILD(tree, pos)), "else") == 0)) { + res = (validate_colon(CHILD(tree, pos + 1)) + && validate_suite(CHILD(tree, pos + 2))); + pos += 3; + } + if (res && pos < nch) { + /* last clause must be a finally */ + res = (validate_name(CHILD(tree, pos), "finally") + && validate_numnodes(tree, pos + 3, "try/except/finally") + && validate_colon(CHILD(tree, pos + 1)) + && validate_suite(CHILD(tree, pos + 2))); } return (res); } From buildbot at python.org Fri Dec 5 13:37:12 2008 From: buildbot at python.org (buildbot at python.org) Date: Fri, 05 Dec 2008 12:37:12 +0000 Subject: [Python-checkins] buildbot failure in OS X x86 trunk Message-ID: <20081205123712.7A9371E4002@bag.python.org> The Buildbot has detected a new failure of OS X x86 trunk. Full details are available at: http://www.python.org/dev/buildbot/all/OS%20X%20x86%20trunk/builds/471 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: noller-osx86 Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: georg.brandl BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_socket make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Fri Dec 5 13:56:32 2008 From: buildbot at python.org (buildbot at python.org) Date: Fri, 05 Dec 2008 12:56:32 +0000 Subject: [Python-checkins] buildbot failure in ppc Debian unstable trunk Message-ID: <20081205125632.8E64D1E4002@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/2131 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: georg.brandl 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 Fri Dec 5 13:58:21 2008 From: buildbot at python.org (buildbot at python.org) Date: Fri, 05 Dec 2008 12:58:21 +0000 Subject: [Python-checkins] buildbot failure in x86 W2k8 trunk Message-ID: <20081205125821.976F61E4002@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/359 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: nelson-windows Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: georg.brandl BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_bsddb3 sincerely, -The Buildbot From python-checkins at python.org Fri Dec 5 14:03:28 2008 From: python-checkins at python.org (barry.warsaw) Date: Fri, 5 Dec 2008 14:03:28 +0100 (CET) Subject: [Python-checkins] r67577 - in peps/trunk: pep-0000.txt pep-0364.txt Message-ID: <20081205130328.DC5731E4002@bag.python.org> Author: barry.warsaw Date: Fri Dec 5 14:03:28 2008 New Revision: 67577 Log: Withdraw PEP 364 Modified: peps/trunk/pep-0000.txt peps/trunk/pep-0364.txt Modified: peps/trunk/pep-0000.txt ============================================================================== --- peps/trunk/pep-0000.txt (original) +++ peps/trunk/pep-0000.txt Fri Dec 5 14:03:28 2008 @@ -97,7 +97,6 @@ S 337 Logging Usage in the Standard Library Dubner S 345 Metadata for Python Software Packages 1.2 Jones S 362 Function Signature Object Cannon, Seo - S 364 Transitioning to the Py3K Standard Library Warsaw S 368 Standard image protocol and class Mastrodomenico S 369 Post import hooks Heimes S 372 Adding an ordered dictionary to collections Ronacher @@ -265,6 +264,7 @@ SR 355 Path - Object oriented filesystem paths Lindqvist SW 359 The "make" Statement Bethard SR 363 Syntax For Dynamic Attribute Access North + SW 364 Transitioning to the Py3K Standard Library Warsaw SR 365 Adding the pkg_resources module Eby SR 367 New Super Spealman, Delaney SR 666 Reject Foolish Indentation Creighton @@ -471,7 +471,7 @@ I 361 Python 2.6 and 3.0 Release Schedule Norwitz, et al S 362 Function Signature Object Cannon, Seo SR 363 Syntax For Dynamic Attribute Access North - S 364 Transitioning to the Py3K Standard Library Warsaw + SW 364 Transitioning to the Py3K Standard Library Warsaw SR 365 Adding the pkg_resources module Eby SF 366 Main module explicit relative imports Coghlan SR 367 New Super Spealman, Delaney Modified: peps/trunk/pep-0364.txt ============================================================================== --- peps/trunk/pep-0364.txt (original) +++ peps/trunk/pep-0364.txt Fri Dec 5 14:03:28 2008 @@ -3,7 +3,7 @@ Version: $Revision$ Last-Modified: $Date$ Author: Barry Warsaw -Status: Draft +Status: Withdrawn Type: Standards Track Content-Type: text/x-rst Created: 01-Mar-2007 From python-checkins at python.org Fri Dec 5 16:12:16 2008 From: python-checkins at python.org (georg.brandl) Date: Fri, 5 Dec 2008 16:12:16 +0100 (CET) Subject: [Python-checkins] r67578 - in python/branches/py3k/Doc: extending/newtypes.rst includes/noddy.c includes/noddy2.c includes/noddy3.c includes/noddy4.c includes/shoddy.c includes/typestruct.h Message-ID: <20081205151216.0D90B1E4002@bag.python.org> Author: georg.brandl Date: Fri Dec 5 16:12:15 2008 New Revision: 67578 Log: #4504, #4505: Update noddy examples in "Extending & Embedding". Modified: python/branches/py3k/Doc/extending/newtypes.rst python/branches/py3k/Doc/includes/noddy.c python/branches/py3k/Doc/includes/noddy2.c python/branches/py3k/Doc/includes/noddy3.c python/branches/py3k/Doc/includes/noddy4.c python/branches/py3k/Doc/includes/shoddy.c python/branches/py3k/Doc/includes/typestruct.h Modified: python/branches/py3k/Doc/extending/newtypes.rst ============================================================================== --- python/branches/py3k/Doc/extending/newtypes.rst (original) +++ python/branches/py3k/Doc/extending/newtypes.rst Fri Dec 5 16:12:15 2008 @@ -73,26 +73,25 @@ static PyTypeObject noddy_NoddyType = { PyObject_HEAD_INIT(NULL) - 0, /*ob_size*/ - "noddy.Noddy", /*tp_name*/ - sizeof(noddy_NoddyObject), /*tp_basicsize*/ - 0, /*tp_itemsize*/ - 0, /*tp_dealloc*/ - 0, /*tp_print*/ - 0, /*tp_getattr*/ - 0, /*tp_setattr*/ - 0, /*tp_compare*/ - 0, /*tp_repr*/ - 0, /*tp_as_number*/ - 0, /*tp_as_sequence*/ - 0, /*tp_as_mapping*/ - 0, /*tp_hash */ - 0, /*tp_call*/ - 0, /*tp_str*/ - 0, /*tp_getattro*/ - 0, /*tp_setattro*/ - 0, /*tp_as_buffer*/ - Py_TPFLAGS_DEFAULT, /*tp_flags*/ + "noddy.Noddy", /* tp_name */ + sizeof(noddy_NoddyObject), /* tp_basicsize */ + 0, /* tp_itemsize */ + 0, /* tp_dealloc */ + 0, /* tp_print */ + 0, /* tp_getattr */ + 0, /* tp_setattr */ + 0, /* tp_compare */ + 0, /* tp_repr */ + 0, /* tp_as_number */ + 0, /* tp_as_sequence */ + 0, /* tp_as_mapping */ + 0, /* tp_hash */ + 0, /* tp_call */ + 0, /* tp_str */ + 0, /* tp_getattro */ + 0, /* tp_setattro */ + 0, /* tp_as_buffer */ + Py_TPFLAGS_DEFAULT, /* tp_flags */ "Noddy objects", /* tp_doc */ }; @@ -114,13 +113,6 @@ some compilers complain. Fortunately, this member will be filled in for us by :cfunc:`PyType_Ready`. :: - 0, /* ob_size */ - -The :attr:`ob_size` field of the header is not used; its presence in the type -structure is a historical artifact that is maintained for binary compatibility -with extension modules compiled for older versions of Python. Always set this -field to zero. :: - "noddy.Noddy", /* tp_name */ The name of our type. This will appear in the default textual representation of @@ -162,7 +154,7 @@ Skipping a number of type methods that we don't provide, we set the class flags to :const:`Py_TPFLAGS_DEFAULT`. :: - Py_TPFLAGS_DEFAULT, /*tp_flags*/ + Py_TPFLAGS_DEFAULT, /* tp_flags */ All types should include this constant in their flags. It enables all of the members defined by the current version of Python. @@ -193,7 +185,7 @@ for a later section! Everything else in the file should be familiar, except for some code in -:cfunc:`initnoddy`:: +:cfunc:`PyInit_noddy`:: if (PyType_Ready(&noddy_NoddyType) < 0) return; @@ -523,8 +515,8 @@ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /*tp_flags*/ -We rename :cfunc:`initnoddy` to :cfunc:`initnoddy2` and update the module name -passed to :cfunc:`Py_InitModule3`. +We rename :cfunc:`PyInit_noddy` to :cfunc:`PyInit_noddy2` and update the module +name in the :ctype:`PyModuleDef` struct. Finally, we update our :file:`setup.py` file to build the new module:: @@ -794,7 +786,7 @@ Finally, we add the :const:`Py_TPFLAGS_HAVE_GC` flag to the class flags:: - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE | Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE | Py_TPFLAGS_HAVE_GC, /* tp_flags */ That's pretty much it. If we had written custom :attr:`tp_alloc` or :attr:`tp_free` slots, we'd need to modify them for cyclic-garbage collection. @@ -865,20 +857,20 @@ the module's :cfunc:`init` function. :: PyMODINIT_FUNC - initshoddy(void) + PyInit_shoddy(void) { - PyObject *m; + PyObject *m; - ShoddyType.tp_base = &PyList_Type; - if (PyType_Ready(&ShoddyType) < 0) - return; + ShoddyType.tp_base = &PyList_Type; + if (PyType_Ready(&ShoddyType) < 0) + return NULL; - m = Py_InitModule3("shoddy", NULL, "Shoddy module"); - if (m == NULL) - return; + m = PyModule_Create(&shoddymodule); + if (m == NULL) + return NULL; - Py_INCREF(&ShoddyType); - PyModule_AddObject(m, "Shoddy", (PyObject *) &ShoddyType); + Py_INCREF(&ShoddyType); + PyModule_AddObject(m, "Shoddy", (PyObject *) &ShoddyType); } Before calling :cfunc:`PyType_Ready`, the type structure must have the @@ -1241,49 +1233,50 @@ return -1; } +.. XXX tp_compare is dead; need to rewrite for tp_richcompare! -Object Comparison ------------------ - -:: - - cmpfunc tp_compare; - -The :attr:`tp_compare` handler is called when comparisons are needed and the -object does not implement the specific rich comparison method which matches the -requested comparison. (It is always used if defined and the -:cfunc:`PyObject_Compare` or :cfunc:`PyObject_Cmp` functions are used, or if -:func:`cmp` is used from Python.) It is analogous to the :meth:`__cmp__` method. -This function should return ``-1`` if *obj1* is less than *obj2*, ``0`` if they -are equal, and ``1`` if *obj1* is greater than *obj2*. (It was previously -allowed to return arbitrary negative or positive integers for less than and -greater than, respectively; as of Python 2.2, this is no longer allowed. In the -future, other return values may be assigned a different meaning.) - -A :attr:`tp_compare` handler may raise an exception. In this case it should -return a negative value. The caller has to test for the exception using -:cfunc:`PyErr_Occurred`. - -Here is a sample implementation:: - - static int - newdatatype_compare(newdatatypeobject * obj1, newdatatypeobject * obj2) - { - long result; - - if (obj1->obj_UnderlyingDatatypePtr->size < - obj2->obj_UnderlyingDatatypePtr->size) { - result = -1; - } - else if (obj1->obj_UnderlyingDatatypePtr->size > - obj2->obj_UnderlyingDatatypePtr->size) { - result = 1; - } - else { - result = 0; - } - return result; - } + Object Comparison + ----------------- + + :: + + cmpfunc tp_compare; + + The :attr:`tp_compare` handler is called when comparisons are needed and the + object does not implement the specific rich comparison method which matches the + requested comparison. (It is always used if defined and the + :cfunc:`PyObject_Compare` or :cfunc:`PyObject_Cmp` functions are used, or if + :func:`cmp` is used from Python.) It is analogous to the :meth:`__cmp__` method. + This function should return ``-1`` if *obj1* is less than *obj2*, ``0`` if they + are equal, and ``1`` if *obj1* is greater than *obj2*. (It was previously + allowed to return arbitrary negative or positive integers for less than and + greater than, respectively; as of Python 2.2, this is no longer allowed. In the + future, other return values may be assigned a different meaning.) + + A :attr:`tp_compare` handler may raise an exception. In this case it should + return a negative value. The caller has to test for the exception using + :cfunc:`PyErr_Occurred`. + + Here is a sample implementation:: + + static int + newdatatype_compare(newdatatypeobject * obj1, newdatatypeobject * obj2) + { + long result; + + if (obj1->obj_UnderlyingDatatypePtr->size < + obj2->obj_UnderlyingDatatypePtr->size) { + result = -1; + } + else if (obj1->obj_UnderlyingDatatypePtr->size > + obj2->obj_UnderlyingDatatypePtr->size) { + result = 1; + } + else { + result = 0; + } + return result; + } Abstract Protocol Support Modified: python/branches/py3k/Doc/includes/noddy.c ============================================================================== --- python/branches/py3k/Doc/includes/noddy.c (original) +++ python/branches/py3k/Doc/includes/noddy.c Fri Dec 5 16:12:15 2008 @@ -7,47 +7,48 @@ static PyTypeObject noddy_NoddyType = { PyObject_HEAD_INIT(NULL) - 0, /*ob_size*/ - "noddy.Noddy", /*tp_name*/ - sizeof(noddy_NoddyObject), /*tp_basicsize*/ - 0, /*tp_itemsize*/ - 0, /*tp_dealloc*/ - 0, /*tp_print*/ - 0, /*tp_getattr*/ - 0, /*tp_setattr*/ - 0, /*tp_compare*/ - 0, /*tp_repr*/ - 0, /*tp_as_number*/ - 0, /*tp_as_sequence*/ - 0, /*tp_as_mapping*/ - 0, /*tp_hash */ - 0, /*tp_call*/ - 0, /*tp_str*/ - 0, /*tp_getattro*/ - 0, /*tp_setattro*/ - 0, /*tp_as_buffer*/ - Py_TPFLAGS_DEFAULT, /*tp_flags*/ + "noddy.Noddy", /* tp_name */ + sizeof(noddy_NoddyObject), /* tp_basicsize */ + 0, /* tp_itemsize */ + 0, /* tp_dealloc */ + 0, /* tp_print */ + 0, /* tp_getattr */ + 0, /* tp_setattr */ + 0, /* tp_compare */ + 0, /* tp_repr */ + 0, /* tp_as_number */ + 0, /* tp_as_sequence */ + 0, /* tp_as_mapping */ + 0, /* tp_hash */ + 0, /* tp_call */ + 0, /* tp_str */ + 0, /* tp_getattro */ + 0, /* tp_setattro */ + 0, /* tp_as_buffer */ + Py_TPFLAGS_DEFAULT, /* tp_flags */ "Noddy objects", /* tp_doc */ }; -static PyMethodDef noddy_methods[] = { - {NULL} /* Sentinel */ +static PyModuleDef noddymodule = { + PyModuleDef_HEAD_INIT, + "noddy", + "Example module that creates an extension type.", + -1, + NULL, NULL, NULL, NULL, NULL }; -#ifndef PyMODINIT_FUNC /* declarations for DLL import/export */ -#define PyMODINIT_FUNC void -#endif PyMODINIT_FUNC -initnoddy(void) +PyInit_noddy(void) { PyObject* m; noddy_NoddyType.tp_new = PyType_GenericNew; if (PyType_Ready(&noddy_NoddyType) < 0) - return; + return NULL; - m = Py_InitModule3("noddy", noddy_methods, - "Example module that creates an extension type."); + m = PyModule_Create(&noddymodule); + if (m == NULL) + return NULL; Py_INCREF(&noddy_NoddyType); PyModule_AddObject(m, "Noddy", (PyObject *)&noddy_NoddyType); Modified: python/branches/py3k/Doc/includes/noddy2.c ============================================================================== --- python/branches/py3k/Doc/includes/noddy2.c (original) +++ python/branches/py3k/Doc/includes/noddy2.c Fri Dec 5 16:12:15 2008 @@ -13,7 +13,7 @@ { Py_XDECREF(self->first); Py_XDECREF(self->last); - self->ob_type->tp_free((PyObject*)self); + Py_TYPE(self)->tp_free((PyObject*)self); } static PyObject * @@ -124,26 +124,26 @@ static PyTypeObject NoddyType = { PyObject_HEAD_INIT(NULL) - 0, /*ob_size*/ - "noddy.Noddy", /*tp_name*/ - sizeof(Noddy), /*tp_basicsize*/ - 0, /*tp_itemsize*/ - (destructor)Noddy_dealloc, /*tp_dealloc*/ - 0, /*tp_print*/ - 0, /*tp_getattr*/ - 0, /*tp_setattr*/ - 0, /*tp_compare*/ - 0, /*tp_repr*/ - 0, /*tp_as_number*/ - 0, /*tp_as_sequence*/ - 0, /*tp_as_mapping*/ - 0, /*tp_hash */ - 0, /*tp_call*/ - 0, /*tp_str*/ - 0, /*tp_getattro*/ - 0, /*tp_setattro*/ - 0, /*tp_as_buffer*/ - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /*tp_flags*/ + "noddy.Noddy", /* tp_name */ + sizeof(Noddy), /* tp_basicsize */ + 0, /* tp_itemsize */ + (destructor)Noddy_dealloc, /* tp_dealloc */ + 0, /* tp_print */ + 0, /* tp_getattr */ + 0, /* tp_setattr */ + 0, /* tp_compare */ + 0, /* tp_repr */ + 0, /* tp_as_number */ + 0, /* tp_as_sequence */ + 0, /* tp_as_mapping */ + 0, /* tp_hash */ + 0, /* tp_call */ + 0, /* tp_str */ + 0, /* tp_getattro */ + 0, /* tp_setattro */ + 0, /* tp_as_buffer */ + Py_TPFLAGS_DEFAULT | + Py_TPFLAGS_BASETYPE, /* tp_flags */ "Noddy objects", /* tp_doc */ 0, /* tp_traverse */ 0, /* tp_clear */ @@ -164,26 +164,25 @@ Noddy_new, /* tp_new */ }; -static PyMethodDef module_methods[] = { - {NULL} /* Sentinel */ +static PyModuleDef noddy2module = { + PyModuleDef_HEAD_INIT, + "noddy2", + "Example module that creates an extension type.", + -1, + NULL, NULL, NULL, NULL, NULL }; -#ifndef PyMODINIT_FUNC /* declarations for DLL import/export */ -#define PyMODINIT_FUNC void -#endif PyMODINIT_FUNC -initnoddy2(void) +PyInit_noddy2(void) { PyObject* m; if (PyType_Ready(&NoddyType) < 0) - return; - - m = Py_InitModule3("noddy2", module_methods, - "Example module that creates an extension type."); + return NULL; + m = PyModule_Create(&noddy2module); if (m == NULL) - return; + return NULL; Py_INCREF(&NoddyType); PyModule_AddObject(m, "Noddy", (PyObject *)&NoddyType); Modified: python/branches/py3k/Doc/includes/noddy3.c ============================================================================== --- python/branches/py3k/Doc/includes/noddy3.c (original) +++ python/branches/py3k/Doc/includes/noddy3.c Fri Dec 5 16:12:15 2008 @@ -13,7 +13,7 @@ { Py_XDECREF(self->first); Py_XDECREF(self->last); - self->ob_type->tp_free((PyObject*)self); + Py_TYPE(self)->tp_free((PyObject*)self); } static PyObject * @@ -177,26 +177,26 @@ static PyTypeObject NoddyType = { PyObject_HEAD_INIT(NULL) - 0, /*ob_size*/ - "noddy.Noddy", /*tp_name*/ - sizeof(Noddy), /*tp_basicsize*/ - 0, /*tp_itemsize*/ - (destructor)Noddy_dealloc, /*tp_dealloc*/ - 0, /*tp_print*/ - 0, /*tp_getattr*/ - 0, /*tp_setattr*/ - 0, /*tp_compare*/ - 0, /*tp_repr*/ - 0, /*tp_as_number*/ - 0, /*tp_as_sequence*/ - 0, /*tp_as_mapping*/ - 0, /*tp_hash */ - 0, /*tp_call*/ - 0, /*tp_str*/ - 0, /*tp_getattro*/ - 0, /*tp_setattro*/ - 0, /*tp_as_buffer*/ - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /*tp_flags*/ + "noddy.Noddy", /* tp_name */ + sizeof(Noddy), /* tp_basicsize */ + 0, /* tp_itemsize */ + (destructor)Noddy_dealloc, /* tp_dealloc */ + 0, /* tp_print */ + 0, /* tp_getattr */ + 0, /* tp_setattr */ + 0, /* tp_compare */ + 0, /* tp_repr */ + 0, /* tp_as_number */ + 0, /* tp_as_sequence */ + 0, /* tp_as_mapping */ + 0, /* tp_hash */ + 0, /* tp_call */ + 0, /* tp_str */ + 0, /* tp_getattro */ + 0, /* tp_setattro */ + 0, /* tp_as_buffer */ + Py_TPFLAGS_DEFAULT | + Py_TPFLAGS_BASETYPE, /* tp_flags */ "Noddy objects", /* tp_doc */ 0, /* tp_traverse */ 0, /* tp_clear */ @@ -217,26 +217,25 @@ Noddy_new, /* tp_new */ }; -static PyMethodDef module_methods[] = { - {NULL} /* Sentinel */ +static PyModuleDef noddy3module = { + PyModuleDef_HEAD_INIT, + "noddy3", + "Example module that creates an extension type.", + -1, + NULL, NULL, NULL, NULL, NULL }; -#ifndef PyMODINIT_FUNC /* declarations for DLL import/export */ -#define PyMODINIT_FUNC void -#endif PyMODINIT_FUNC -initnoddy3(void) +PyInit_noddy3(void) { PyObject* m; if (PyType_Ready(&NoddyType) < 0) - return; - - m = Py_InitModule3("noddy3", module_methods, - "Example module that creates an extension type."); + return NULL; + m = PyModule_Create(&noddy3module); if (m == NULL) - return; + return NULL; Py_INCREF(&NoddyType); PyModule_AddObject(m, "Noddy", (PyObject *)&NoddyType); Modified: python/branches/py3k/Doc/includes/noddy4.c ============================================================================== --- python/branches/py3k/Doc/includes/noddy4.c (original) +++ python/branches/py3k/Doc/includes/noddy4.c Fri Dec 5 16:12:15 2008 @@ -47,7 +47,7 @@ Noddy_dealloc(Noddy* self) { Noddy_clear(self); - self->ob_type->tp_free((PyObject*)self); + Py_TYPE(self)->tp_free((PyObject*)self); } static PyObject * @@ -158,26 +158,27 @@ static PyTypeObject NoddyType = { PyObject_HEAD_INIT(NULL) - 0, /*ob_size*/ - "noddy.Noddy", /*tp_name*/ - sizeof(Noddy), /*tp_basicsize*/ - 0, /*tp_itemsize*/ - (destructor)Noddy_dealloc, /*tp_dealloc*/ - 0, /*tp_print*/ - 0, /*tp_getattr*/ - 0, /*tp_setattr*/ - 0, /*tp_compare*/ - 0, /*tp_repr*/ - 0, /*tp_as_number*/ - 0, /*tp_as_sequence*/ - 0, /*tp_as_mapping*/ - 0, /*tp_hash */ - 0, /*tp_call*/ - 0, /*tp_str*/ - 0, /*tp_getattro*/ - 0, /*tp_setattro*/ - 0, /*tp_as_buffer*/ - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE | Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + "noddy.Noddy", /* tp_name */ + sizeof(Noddy), /* tp_basicsize */ + 0, /* tp_itemsize */ + (destructor)Noddy_dealloc, /* tp_dealloc */ + 0, /* tp_print */ + 0, /* tp_getattr */ + 0, /* tp_setattr */ + 0, /* tp_compare */ + 0, /* tp_repr */ + 0, /* tp_as_number */ + 0, /* tp_as_sequence */ + 0, /* tp_as_mapping */ + 0, /* tp_hash */ + 0, /* tp_call */ + 0, /* tp_str */ + 0, /* tp_getattro */ + 0, /* tp_setattro */ + 0, /* tp_as_buffer */ + Py_TPFLAGS_DEFAULT | + Py_TPFLAGS_BASETYPE | + Py_TPFLAGS_HAVE_GC, /* tp_flags */ "Noddy objects", /* tp_doc */ (traverseproc)Noddy_traverse, /* tp_traverse */ (inquiry)Noddy_clear, /* tp_clear */ @@ -198,26 +199,25 @@ Noddy_new, /* tp_new */ }; -static PyMethodDef module_methods[] = { - {NULL} /* Sentinel */ +static PyModuleDef noddy4module = { + PyModuleDef_HEAD_INIT, + "noddy4", + "Example module that creates an extension type.", + -1, + NULL, NULL, NULL, NULL, NULL }; -#ifndef PyMODINIT_FUNC /* declarations for DLL import/export */ -#define PyMODINIT_FUNC void -#endif PyMODINIT_FUNC -initnoddy4(void) +PyInit_noddy4(void) { PyObject* m; if (PyType_Ready(&NoddyType) < 0) - return; - - m = Py_InitModule3("noddy4", module_methods, - "Example module that creates an extension type."); + return NULL; + m = PyModule_Create(&noddy4module); if (m == NULL) - return; + return NULL; Py_INCREF(&NoddyType); PyModule_AddObject(m, "Noddy", (PyObject *)&NoddyType); Modified: python/branches/py3k/Doc/includes/shoddy.c ============================================================================== --- python/branches/py3k/Doc/includes/shoddy.c (original) +++ python/branches/py3k/Doc/includes/shoddy.c Fri Dec 5 16:12:15 2008 @@ -32,7 +32,6 @@ static PyTypeObject ShoddyType = { PyObject_HEAD_INIT(NULL) - 0, /* ob_size */ "shoddy.Shoddy", /* tp_name */ sizeof(Shoddy), /* tp_basicsize */ 0, /* tp_itemsize */ @@ -52,7 +51,7 @@ 0, /* tp_setattro */ 0, /* tp_as_buffer */ Py_TPFLAGS_DEFAULT | - Py_TPFLAGS_BASETYPE, /* tp_flags */ + Py_TPFLAGS_BASETYPE, /* tp_flags */ 0, /* tp_doc */ 0, /* tp_traverse */ 0, /* tp_clear */ @@ -73,18 +72,26 @@ 0, /* tp_new */ }; +static PyModuleDef shoddymodule = { + PyModuleDef_HEAD_INIT, + "shoddy", + "Shoddy module", + -1, + NULL, NULL, NULL, NULL, NULL +}; + PyMODINIT_FUNC -initshoddy(void) +PyInit_shoddy(void) { PyObject *m; ShoddyType.tp_base = &PyList_Type; if (PyType_Ready(&ShoddyType) < 0) - return; + return NULL; - m = Py_InitModule3("shoddy", NULL, "Shoddy module"); + m = PyModule_Create(&shoddymodule); if (m == NULL) - return; + return NULL; Py_INCREF(&ShoddyType); PyModule_AddObject(m, "Shoddy", (PyObject *) &ShoddyType); Modified: python/branches/py3k/Doc/includes/typestruct.h ============================================================================== --- python/branches/py3k/Doc/includes/typestruct.h (original) +++ python/branches/py3k/Doc/includes/typestruct.h Fri Dec 5 16:12:15 2008 @@ -34,21 +34,18 @@ char *tp_doc; /* Documentation string */ - /* Assigned meaning in release 2.0 */ /* call function for all accessible objects */ traverseproc tp_traverse; /* delete references to contained objects */ inquiry tp_clear; - /* Assigned meaning in release 2.1 */ /* rich comparisons */ richcmpfunc tp_richcompare; /* weak reference enabler */ long tp_weaklistoffset; - /* Added in release 2.2 */ /* Iterators */ getiterfunc tp_iter; iternextfunc tp_iternext; From python-checkins at python.org Fri Dec 5 16:29:39 2008 From: python-checkins at python.org (georg.brandl) Date: Fri, 5 Dec 2008 16:29:39 +0100 (CET) Subject: [Python-checkins] r67579 - in python/trunk/Doc: glossary.rst reference/datamodel.rst Message-ID: <20081205152939.513831E4002@bag.python.org> Author: georg.brandl Date: Fri Dec 5 16:29:39 2008 New Revision: 67579 Log: #4517: add "special method" glossary entry and clarify when __getattribute__ is bypassed. Modified: python/trunk/Doc/glossary.rst python/trunk/Doc/reference/datamodel.rst Modified: python/trunk/Doc/glossary.rst ============================================================================== --- python/trunk/Doc/glossary.rst (original) +++ python/trunk/Doc/glossary.rst Fri Dec 5 16:29:39 2008 @@ -498,6 +498,12 @@ (subscript) notation uses :class:`slice` objects internally (or in older versions, :meth:`__getslice__` and :meth:`__setslice__`). + special method + A method that is called implicitly by Python to execute a certain + operation on a type, such as addition. Such methods have names starting + and ending with double underscores. Special methods are documented in + :ref:`specialnames`. + statement A statement is part of a suite (a "block" of code). A statement is either an :term:`expression` or a one of several constructs with a keyword, such Modified: python/trunk/Doc/reference/datamodel.rst ============================================================================== --- python/trunk/Doc/reference/datamodel.rst (original) +++ python/trunk/Doc/reference/datamodel.rst Fri Dec 5 16:29:39 2008 @@ -2370,7 +2370,7 @@ True In addition to bypassing any instance attributes in the interest of -correctness, implicit special method lookup may also bypass the +correctness, implicit special method lookup generally also bypasses the :meth:`__getattribute__` method even of the object's metaclass:: >>> class Meta(type): From python-checkins at python.org Fri Dec 5 16:32:29 2008 From: python-checkins at python.org (georg.brandl) Date: Fri, 5 Dec 2008 16:32:29 +0100 (CET) Subject: [Python-checkins] r67580 - python/trunk/Doc/library/shutil.rst Message-ID: <20081205153229.BB3061E4002@bag.python.org> Author: georg.brandl Date: Fri Dec 5 16:32:29 2008 New Revision: 67580 Log: #4478: document that copyfile() can raise Error. Modified: python/trunk/Doc/library/shutil.rst Modified: python/trunk/Doc/library/shutil.rst ============================================================================== --- python/trunk/Doc/library/shutil.rst (original) +++ python/trunk/Doc/library/shutil.rst Fri Dec 5 16:32:29 2008 @@ -43,7 +43,8 @@ Copy the contents (no metadata) of the file named *src* to a file named *dst*. *dst* must be the complete target file name; look at :func:`copy` for a copy that - accepts a target directory path. + accepts a target directory path. If *src* and *dst* are the same files, + :exc:`Error` is raised. The destination location must be writable; otherwise, an :exc:`IOError` exception will be raised. If *dst* already exists, it will be replaced. Special files such as character or block devices and pipes cannot be copied with this From python-checkins at python.org Fri Dec 5 16:42:03 2008 From: python-checkins at python.org (georg.brandl) Date: Fri, 5 Dec 2008 16:42:03 +0100 (CET) Subject: [Python-checkins] r67581 - python/trunk/Doc/library/operator.rst Message-ID: <20081205154203.8BB6A1E4002@bag.python.org> Author: georg.brandl Date: Fri Dec 5 16:42:03 2008 New Revision: 67581 Log: #3171: document that *slice are removed in 3k. Modified: python/trunk/Doc/library/operator.rst Modified: python/trunk/Doc/library/operator.rst ============================================================================== --- python/trunk/Doc/library/operator.rst (original) +++ python/trunk/Doc/library/operator.rst Fri Dec 5 16:42:03 2008 @@ -240,6 +240,10 @@ Delete the slice of *a* from index *b* to index *c-1*. + .. deprecated:: 2.6 + This function is removed in Python 3.x. Use :func:`delitem` with a slice + index. + .. function:: getitem(a, b) __getitem__(a, b) @@ -252,6 +256,10 @@ Return the slice of *a* from index *b* to index *c-1*. + .. deprecated:: 2.6 + This function is removed in Python 3.x. Use :func:`getitem` with a slice + index. + .. function:: indexOf(a, b) @@ -283,6 +291,11 @@ Set the slice of *a* from index *b* to index *c-1* to the sequence *v*. + .. deprecated:: 2.6 + This function is removed in Python 3.x. Use :func:`setitem` with a slice + index. + + Many operations have an "in-place" version. The following functions provide a more primitive access to in-place operators than the usual syntax does; for example, the :term:`statement` ``x += y`` is equivalent to From python-checkins at python.org Fri Dec 5 16:43:49 2008 From: python-checkins at python.org (georg.brandl) Date: Fri, 5 Dec 2008 16:43:49 +0100 (CET) Subject: [Python-checkins] r67582 - peps/trunk/pep-0101.txt Message-ID: <20081205154349.EFB031E4046@bag.python.org> Author: georg.brandl Date: Fri Dec 5 16:43:49 2008 New Revision: 67582 Log: Fix typo. Modified: peps/trunk/pep-0101.txt Modified: peps/trunk/pep-0101.txt ============================================================================== --- peps/trunk/pep-0101.txt (original) +++ peps/trunk/pep-0101.txt Fri Dec 5 16:43:49 2008 @@ -430,7 +430,7 @@ version, and remove the current version from any 'in development' section. Update the version in the "What's New" link. - ___ Add the new version to `doc/version/content.ht`. + ___ Add the new version to `doc/versions/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 python-checkins at python.org Fri Dec 5 16:52:20 2008 From: python-checkins at python.org (georg.brandl) Date: Fri, 5 Dec 2008 16:52:20 +0100 (CET) Subject: [Python-checkins] r67583 - python/trunk/Doc/library/functions.rst Message-ID: <20081205155220.A740B1E400C@bag.python.org> Author: georg.brandl Date: Fri Dec 5 16:52:20 2008 New Revision: 67583 Log: Move __import__ to the bottom of the functions list. It doesn't make sense for such a fundamental document to have the most obscure function listed at the top. 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 Fri Dec 5 16:52:20 2008 @@ -8,67 +8,6 @@ available. They are listed here in alphabetical order. -.. function:: __import__(name[, globals[, locals[, fromlist[, level]]]]) - - .. index:: - statement: import - module: ihooks - module: rexec - module: imp - - .. note:: - - This is an advanced function that is not needed in everyday Python - programming. - - 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. - 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 spam.ham import eggs`` results in ``__import__('spam.ham', globals(), - locals(), ['eggs'], -1)``. Note that even though ``locals()`` and ``['eggs']`` - are passed in as arguments, the :func:`__import__` function does not set the - local variable named ``eggs``; this is done by subsequent code that is generated - for the import statement. (In fact, the standard implementation does not use - its *locals* argument at all, and uses its *globals* only to determine the - package context of the :keyword:`import` statement.) - - When the *name* variable is of the form ``package.module``, normally, the - top-level package (the name up till the first dot) is returned, *not* the - module named by *name*. However, when a non-empty *fromlist* argument is - given, the module named by *name* is returned. This is done for - compatibility with the :term:`bytecode` generated for the different kinds of import - statement; when using ``import spam.ham.eggs``, the top-level package - :mod:`spam` must be placed in the importing namespace, but when using ``from - spam.ham import eggs``, the ``spam.ham`` subpackage must be used to find the - ``eggs`` variable. As a workaround for this behavior, use :func:`getattr` to - extract the desired components. For example, you could define the following - helper:: - - def my_import(name): - mod = __import__(name) - components = name.split('.') - for comp in components[1:]: - mod = getattr(mod, comp) - return mod - - *level* specifies whether to use absolute or relative imports. The default is - ``-1`` which indicates both absolute and relative imports will be attempted. - ``0`` means only perform absolute imports. Positive values for *level* indicate - the number of parent directories to search relative to the directory of the - module calling :func:`__import__`. - - .. versionchanged:: 2.5 - The level parameter was added. - - .. versionchanged:: 2.5 - Keyword support for parameters was added. - - .. function:: abs(x) Return the absolute value of a number. The argument may be a plain or long @@ -1419,6 +1358,67 @@ Formerly, :func:`zip` required at least one argument and ``zip()`` raised a :exc:`TypeError` instead of returning an empty list. + +.. function:: __import__(name[, globals[, locals[, fromlist[, level]]]]) + + .. index:: + statement: import + module: ihooks + module: rexec + module: imp + + .. note:: + + This is an advanced function that is not needed in everyday Python + programming. + + 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. + 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 spam.ham import eggs`` results in ``__import__('spam.ham', globals(), + locals(), ['eggs'], -1)``. Note that even though ``locals()`` and ``['eggs']`` + are passed in as arguments, the :func:`__import__` function does not set the + local variable named ``eggs``; this is done by subsequent code that is generated + for the import statement. (In fact, the standard implementation does not use + its *locals* argument at all, and uses its *globals* only to determine the + package context of the :keyword:`import` statement.) + + When the *name* variable is of the form ``package.module``, normally, the + top-level package (the name up till the first dot) is returned, *not* the + module named by *name*. However, when a non-empty *fromlist* argument is + given, the module named by *name* is returned. This is done for + compatibility with the :term:`bytecode` generated for the different kinds of import + statement; when using ``import spam.ham.eggs``, the top-level package + :mod:`spam` must be placed in the importing namespace, but when using ``from + spam.ham import eggs``, the ``spam.ham`` subpackage must be used to find the + ``eggs`` variable. As a workaround for this behavior, use :func:`getattr` to + extract the desired components. For example, you could define the following + helper:: + + def my_import(name): + mod = __import__(name) + components = name.split('.') + for comp in components[1:]: + mod = getattr(mod, comp) + return mod + + *level* specifies whether to use absolute or relative imports. The default is + ``-1`` which indicates both absolute and relative imports will be attempted. + ``0`` means only perform absolute imports. Positive values for *level* indicate + the number of parent directories to search relative to the directory of the + module calling :func:`__import__`. + + .. versionchanged:: 2.5 + The level parameter was added. + + .. versionchanged:: 2.5 + Keyword support for parameters was added. + .. --------------------------------------------------------------------------- From python-checkins at python.org Fri Dec 5 16:52:26 2008 From: python-checkins at python.org (fred.drake) Date: Fri, 5 Dec 2008 16:52:26 +0100 (CET) Subject: [Python-checkins] r67584 - python/trunk/README Message-ID: <20081205155226.131151E4002@bag.python.org> Author: fred.drake Date: Fri Dec 5 16:52:25 2008 New Revision: 67584 Log: bump version number Modified: python/trunk/README Modified: python/trunk/README ============================================================================== --- python/trunk/README (original) +++ python/trunk/README Fri Dec 5 16:52:25 2008 @@ -1,4 +1,4 @@ -This is Python version 2.6 +This is Python version 2.7 ========================== Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 From python-checkins at python.org Fri Dec 5 16:54:46 2008 From: python-checkins at python.org (georg.brandl) Date: Fri, 5 Dec 2008 16:54:46 +0100 (CET) Subject: [Python-checkins] r67585 - python/branches/py3k Message-ID: <20081205155446.A13281E4038@bag.python.org> Author: georg.brandl Date: Fri Dec 5 16:54:46 2008 New Revision: 67585 Log: Blocked revisions 67583 via svnmerge ........ r67583 | georg.brandl | 2008-12-05 16:52:20 +0100 (Fri, 05 Dec 2008) | 4 lines Move __import__ to the bottom of the functions list. It doesn't make sense for such a fundamental document to have the most obscure function listed at the top. ........ Modified: python/branches/py3k/ (props changed) From python-checkins at python.org Fri Dec 5 16:55:41 2008 From: python-checkins at python.org (georg.brandl) Date: Fri, 5 Dec 2008 16:55:41 +0100 (CET) Subject: [Python-checkins] r67586 - python/branches/py3k/Doc/library/functions.rst Message-ID: <20081205155541.8E06B1E404B@bag.python.org> Author: georg.brandl Date: Fri Dec 5 16:55:41 2008 New Revision: 67586 Log: Manually merged r67583: move __import__ doc to the bottom. Modified: python/branches/py3k/Doc/library/functions.rst Modified: python/branches/py3k/Doc/library/functions.rst ============================================================================== --- python/branches/py3k/Doc/library/functions.rst (original) +++ python/branches/py3k/Doc/library/functions.rst Fri Dec 5 16:55:41 2008 @@ -8,59 +8,6 @@ are always available. They are listed here in alphabetical order. -.. function:: __import__(name[, globals[, locals[, fromlist[, level]]]]) - - .. index:: - statement: import - module: imp - - .. note:: - - This is an advanced function that is not needed in everyday Python - programming. - - 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. 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 spam.ham import eggs`` results in ``__import__('spam.ham', globals(), - locals(), ['eggs'], -1)``. Note that even though ``locals()`` and ``['eggs']`` - are passed in as arguments, the :func:`__import__` function does not set the - local variable named ``eggs``; this is done by subsequent code that is generated - for the import statement. (In fact, the standard implementation does not use - its *locals* argument at all, and uses its *globals* only to determine the - package context of the :keyword:`import` statement.) - - When the *name* variable is of the form ``package.module``, normally, the - top-level package (the name up till the first dot) is returned, *not* the - module named by *name*. However, when a non-empty *fromlist* argument is - given, the module named by *name* is returned. This is done for - compatibility with the :term:`bytecode` generated for the different kinds of import - statement; when using ``import spam.ham.eggs``, the top-level package - :mod:`spam` must be placed in the importing namespace, but when using ``from - spam.ham import eggs``, the ``spam.ham`` subpackage must be used to find the - ``eggs`` variable. As a workaround for this behavior, use :func:`getattr` to - extract the desired components. For example, you could define the following - helper:: - - def my_import(name): - mod = __import__(name) - components = name.split('.') - for comp in components[1:]: - mod = getattr(mod, comp) - return mod - - *level* specifies whether to use absolute or relative imports. The default is - ``-1`` which indicates both absolute and relative imports will be attempted. - ``0`` means only perform absolute imports. Positive values for *level* indicate - the number of parent directories to search relative to the directory of the - module calling :func:`__import__`. - - .. function:: abs(x) Return the absolute value of a number. The argument may be an @@ -1220,6 +1167,59 @@ True +.. function:: __import__(name[, globals[, locals[, fromlist[, level]]]]) + + .. index:: + statement: import + module: imp + + .. note:: + + This is an advanced function that is not needed in everyday Python + programming. + + 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. 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 spam.ham import eggs`` results in ``__import__('spam.ham', globals(), + locals(), ['eggs'], -1)``. Note that even though ``locals()`` and ``['eggs']`` + are passed in as arguments, the :func:`__import__` function does not set the + local variable named ``eggs``; this is done by subsequent code that is generated + for the import statement. (In fact, the standard implementation does not use + its *locals* argument at all, and uses its *globals* only to determine the + package context of the :keyword:`import` statement.) + + When the *name* variable is of the form ``package.module``, normally, the + top-level package (the name up till the first dot) is returned, *not* the + module named by *name*. However, when a non-empty *fromlist* argument is + given, the module named by *name* is returned. This is done for + compatibility with the :term:`bytecode` generated for the different kinds of import + statement; when using ``import spam.ham.eggs``, the top-level package + :mod:`spam` must be placed in the importing namespace, but when using ``from + spam.ham import eggs``, the ``spam.ham`` subpackage must be used to find the + ``eggs`` variable. As a workaround for this behavior, use :func:`getattr` to + extract the desired components. For example, you could define the following + helper:: + + def my_import(name): + mod = __import__(name) + components = name.split('.') + for comp in components[1:]: + mod = getattr(mod, comp) + return mod + + *level* specifies whether to use absolute or relative imports. The default is + ``-1`` which indicates both absolute and relative imports will be attempted. + ``0`` means only perform absolute imports. Positive values for *level* indicate + the number of parent directories to search relative to the directory of the + module calling :func:`__import__`. + + .. rubric:: Footnotes .. [#] Specifying a buffer size currently has no effect on systems that don't have From python-checkins at python.org Fri Dec 5 17:14:18 2008 From: python-checkins at python.org (fred.drake) Date: Fri, 5 Dec 2008 17:14:18 +0100 (CET) Subject: [Python-checkins] r67587 - python/trunk/README Message-ID: <20081205161418.AB4871E4002@bag.python.org> Author: fred.drake Date: Fri Dec 5 17:14:18 2008 New Revision: 67587 Log: be more specific, and parallel to the py3k branch Modified: python/trunk/README Modified: python/trunk/README ============================================================================== --- python/trunk/README (original) +++ python/trunk/README Fri Dec 5 17:14:18 2008 @@ -1,5 +1,5 @@ -This is Python version 2.7 -========================== +This is Python version 2.7 alpha 0 +================================== Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 Python Software Foundation. From buildbot at python.org Fri Dec 5 17:40:46 2008 From: buildbot at python.org (buildbot at python.org) Date: Fri, 05 Dec 2008 16:40:46 +0000 Subject: [Python-checkins] buildbot failure in x86 osx.5 3.0 Message-ID: <20081205164046.9D1641E4002@bag.python.org> The Buildbot has detected a new failure of x86 osx.5 3.0. Full details are available at: http://www.python.org/dev/buildbot/all/x86%20osx.5%203.0/builds/573 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: heller-x86-osx5 Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: georg.brandl BUILD FAILED: failed test Excerpt from the test logfile: 2 tests failed: test_calendar test_email make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Fri Dec 5 17:43:46 2008 From: buildbot at python.org (buildbot at python.org) Date: Fri, 05 Dec 2008 16:43:46 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.0 Message-ID: <20081205164346.240F51E4002@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/705 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: georg.brandl 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 Fri Dec 5 17:58:58 2008 From: buildbot at python.org (buildbot at python.org) Date: Fri, 05 Dec 2008 16:58:58 +0000 Subject: [Python-checkins] buildbot failure in x86 W2k8 3.0 Message-ID: <20081205165858.DB8441E4002@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/491 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: georg.brandl BUILD FAILED: failed test Excerpt from the test logfile: 2 tests failed: test_io test_traceback ====================================================================== ERROR: testBasicIO (test.test_io.TextIOWrapperTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "S:\buildbots\python\3.0.nelson-windows\build\lib\test\test_io.py", line 923, in testBasicIO self.assertEquals(f.write("abc"), 3) File "S:\buildbots\python\3.0.nelson-windows\build\lib\io.py", line 1491, in write b = encoder.encode(s) File "S:\buildbots\python\3.0.nelson-windows\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 "S:\buildbots\python\3.0.nelson-windows\build\lib\test\test_io.py", line 761, in testEncodingErrorsReading self.assertRaises(UnicodeError, t.read) File "S:\buildbots\python\3.0.nelson-windows\build\lib\unittest.py", line 311, in failUnlessRaises callableObj(*args, **kwargs) File "S:\buildbots\python\3.0.nelson-windows\build\lib\io.py", line 1724, in read decoder.decode(self.buffer.read(), final=True)) File "S:\buildbots\python\3.0.nelson-windows\build\lib\io.py", line 1295, in decode output = self.decoder.decode(input, final=final) File "S:\buildbots\python\3.0.nelson-windows\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 "S:\buildbots\python\3.0.nelson-windows\build\lib\test\test_io.py", line 779, in testEncodingErrorsWriting self.assertRaises(UnicodeError, t.write, "\xff") File "S:\buildbots\python\3.0.nelson-windows\build\lib\unittest.py", line 311, in failUnlessRaises callableObj(*args, **kwargs) File "S:\buildbots\python\3.0.nelson-windows\build\lib\io.py", line 1491, in write b = encoder.encode(s) File "S:\buildbots\python\3.0.nelson-windows\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 "S:\buildbots\python\3.0.nelson-windows\build\lib\test\test_io.py", line 884, in testNewlinesInput self.assertEquals(txt.readlines(), expected) File "S:\buildbots\python\3.0.nelson-windows\build\lib\io.py", line 534, in readlines return list(self) File "S:\buildbots\python\3.0.nelson-windows\build\lib\io.py", line 1739, in __next__ line = self.readline() File "S:\buildbots\python\3.0.nelson-windows\build\lib\io.py", line 1813, in readline while self._read_chunk(): File "S:\buildbots\python\3.0.nelson-windows\build\lib\io.py", line 1562, in _read_chunk self._set_decoded_chars(self._decoder.decode(input_chunk, eof)) File "S:\buildbots\python\3.0.nelson-windows\build\lib\io.py", line 1295, in decode output = self.decoder.decode(input, final=final) File "S:\buildbots\python\3.0.nelson-windows\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 "S:\buildbots\python\3.0.nelson-windows\build\lib\test\test_io.py", line 909, in testNewlinesOutput txt.write(data) File "S:\buildbots\python\3.0.nelson-windows\build\lib\io.py", line 1491, in write b = encoder.encode(s) File "S:\buildbots\python\3.0.nelson-windows\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 "S:\buildbots\python\3.0.nelson-windows\build\lib\test\test_io.py", line 1145, in test_issue1395_1 c = txt.read(1) File "S:\buildbots\python\3.0.nelson-windows\build\lib\io.py", line 1733, in read eof = not self._read_chunk() File "S:\buildbots\python\3.0.nelson-windows\build\lib\io.py", line 1562, in _read_chunk self._set_decoded_chars(self._decoder.decode(input_chunk, eof)) File "S:\buildbots\python\3.0.nelson-windows\build\lib\io.py", line 1295, in decode output = self.decoder.decode(input, final=final) File "S:\buildbots\python\3.0.nelson-windows\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 "S:\buildbots\python\3.0.nelson-windows\build\lib\test\test_io.py", line 1157, in test_issue1395_2 c = txt.read(4) File "S:\buildbots\python\3.0.nelson-windows\build\lib\io.py", line 1733, in read eof = not self._read_chunk() File "S:\buildbots\python\3.0.nelson-windows\build\lib\io.py", line 1562, in _read_chunk self._set_decoded_chars(self._decoder.decode(input_chunk, eof)) File "S:\buildbots\python\3.0.nelson-windows\build\lib\io.py", line 1295, in decode output = self.decoder.decode(input, final=final) File "S:\buildbots\python\3.0.nelson-windows\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 "S:\buildbots\python\3.0.nelson-windows\build\lib\test\test_io.py", line 1167, in test_issue1395_3 reads = txt.read(4) File "S:\buildbots\python\3.0.nelson-windows\build\lib\io.py", line 1733, in read eof = not self._read_chunk() File "S:\buildbots\python\3.0.nelson-windows\build\lib\io.py", line 1562, in _read_chunk self._set_decoded_chars(self._decoder.decode(input_chunk, eof)) File "S:\buildbots\python\3.0.nelson-windows\build\lib\io.py", line 1295, in decode output = self.decoder.decode(input, final=final) File "S:\buildbots\python\3.0.nelson-windows\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 "S:\buildbots\python\3.0.nelson-windows\build\lib\test\test_io.py", line 1178, in test_issue1395_4 reads = txt.read(4) File "S:\buildbots\python\3.0.nelson-windows\build\lib\io.py", line 1733, in read eof = not self._read_chunk() File "S:\buildbots\python\3.0.nelson-windows\build\lib\io.py", line 1562, in _read_chunk self._set_decoded_chars(self._decoder.decode(input_chunk, eof)) File "S:\buildbots\python\3.0.nelson-windows\build\lib\io.py", line 1295, in decode output = self.decoder.decode(input, final=final) File "S:\buildbots\python\3.0.nelson-windows\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 "S:\buildbots\python\3.0.nelson-windows\build\lib\test\test_io.py", line 1186, in test_issue1395_5 reads = txt.read(4) File "S:\buildbots\python\3.0.nelson-windows\build\lib\io.py", line 1733, in read eof = not self._read_chunk() File "S:\buildbots\python\3.0.nelson-windows\build\lib\io.py", line 1562, in _read_chunk self._set_decoded_chars(self._decoder.decode(input_chunk, eof)) File "S:\buildbots\python\3.0.nelson-windows\build\lib\io.py", line 1295, in decode output = self.decoder.decode(input, final=final) File "S:\buildbots\python\3.0.nelson-windows\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_encoded_file (test.test_traceback.SyntaxTracebackCases) ---------------------------------------------------------------------- Traceback (most recent call last): File "S:\buildbots\python\3.0.nelson-windows\build\lib\test\test_traceback.py", line 145, in test_encoded_file do_test("", "foo", "ascii", 3) File "S:\buildbots\python\3.0.nelson-windows\build\lib\test\test_traceback.py", line 117, in do_test """.format(firstlines, message)) File "S:\buildbots\python\3.0.nelson-windows\build\lib\io.py", line 1491, in write b = encoder.encode(s) File "S:\buildbots\python\3.0.nelson-windows\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' sincerely, -The Buildbot From python-checkins at python.org Fri Dec 5 18:14:30 2008 From: python-checkins at python.org (mark.dickinson) Date: Fri, 5 Dec 2008 18:14:30 +0100 (CET) Subject: [Python-checkins] r67588 - python/branches/py3k/Objects/longobject.c Message-ID: <20081205171430.3E6F51E4035@bag.python.org> Author: mark.dickinson Date: Fri Dec 5 18:14:29 2008 New Revision: 67588 Log: Issue 4497: silence compiler warnings on Windows. Modified: python/branches/py3k/Objects/longobject.c Modified: python/branches/py3k/Objects/longobject.c ============================================================================== --- python/branches/py3k/Objects/longobject.c (original) +++ python/branches/py3k/Objects/longobject.c Fri Dec 5 18:14:29 2008 @@ -44,7 +44,7 @@ } #define CHECK_SMALL_INT(ival) \ do if (-NSMALLNEGINTS <= ival && ival < NSMALLPOSINTS) { \ - return get_small_int(ival); \ + return get_small_int((int)ival); \ } while(0) static PyLongObject * @@ -198,7 +198,7 @@ v = _PyLong_New(1); if (v) { Py_SIZE(v) = sign; - v->ob_digit[0] = ival; + v->ob_digit[0] = (digit)ival; } return (PyObject*)v; } @@ -209,7 +209,7 @@ if (v) { Py_SIZE(v) = 2*sign; v->ob_digit[0] = (digit)ival & PyLong_MASK; - v->ob_digit[1] = ival >> PyLong_SHIFT; + v->ob_digit[1] = (digit)(ival >> PyLong_SHIFT); } return (PyObject*)v; } @@ -1103,7 +1103,7 @@ int ndigits = 0; if (ival < PyLong_BASE) - return PyLong_FromLong(ival); + return PyLong_FromLong((long)ival); /* Count the number of Python digits. */ t = (unsigned PY_LONG_LONG)ival; while (t) { From python-checkins at python.org Fri Dec 5 18:25:42 2008 From: python-checkins at python.org (mark.dickinson) Date: Fri, 5 Dec 2008 18:25:42 +0100 (CET) Subject: [Python-checkins] r67589 - in python/branches/release30-maint: Objects/longobject.c Message-ID: <20081205172542.8C1921E4002@bag.python.org> Author: mark.dickinson Date: Fri Dec 5 18:25:42 2008 New Revision: 67589 Log: Merged revisions 67588 via svnmerge from svn+ssh://pythondev at svn.python.org/python/branches/py3k ........ r67588 | mark.dickinson | 2008-12-05 17:14:29 +0000 (Fri, 05 Dec 2008) | 2 lines Issue 4497: silence compiler warnings on Windows. ........ Modified: python/branches/release30-maint/ (props changed) python/branches/release30-maint/Objects/longobject.c Modified: python/branches/release30-maint/Objects/longobject.c ============================================================================== --- python/branches/release30-maint/Objects/longobject.c (original) +++ python/branches/release30-maint/Objects/longobject.c Fri Dec 5 18:25:42 2008 @@ -44,7 +44,7 @@ } #define CHECK_SMALL_INT(ival) \ do if (-NSMALLNEGINTS <= ival && ival < NSMALLPOSINTS) { \ - return get_small_int(ival); \ + return get_small_int((int)ival); \ } while(0) static PyLongObject * @@ -198,7 +198,7 @@ v = _PyLong_New(1); if (v) { Py_SIZE(v) = sign; - v->ob_digit[0] = ival; + v->ob_digit[0] = (digit)ival; } return (PyObject*)v; } @@ -209,7 +209,7 @@ if (v) { Py_SIZE(v) = 2*sign; v->ob_digit[0] = (digit)ival & PyLong_MASK; - v->ob_digit[1] = ival >> PyLong_SHIFT; + v->ob_digit[1] = (digit)(ival >> PyLong_SHIFT); } return (PyObject*)v; } @@ -1103,7 +1103,7 @@ int ndigits = 0; if (ival < PyLong_BASE) - return PyLong_FromLong(ival); + return PyLong_FromLong((long)ival); /* Count the number of Python digits. */ t = (unsigned PY_LONG_LONG)ival; while (t) { From buildbot at python.org Fri Dec 5 18:39:57 2008 From: buildbot at python.org (buildbot at python.org) Date: Fri, 05 Dec 2008 17:39:57 +0000 Subject: [Python-checkins] buildbot failure in AMD64 W2k8 trunk Message-ID: <20081205173957.B62FA1E4002@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/1115 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: nelson-win64 Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: fred.drake BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_bsddb3 sincerely, -The Buildbot From python-checkins at python.org Fri Dec 5 18:59:46 2008 From: python-checkins at python.org (mark.dickinson) Date: Fri, 5 Dec 2008 18:59:46 +0100 (CET) Subject: [Python-checkins] r67590 - python/trunk/Python/ast.c Message-ID: <20081205175946.9B0301E4002@bag.python.org> Author: mark.dickinson Date: Fri Dec 5 18:59:46 2008 New Revision: 67590 Log: Issue #4461: Safety check in parsenumber (ast.c) Modified: python/trunk/Python/ast.c Modified: python/trunk/Python/ast.c ============================================================================== --- python/trunk/Python/ast.c (original) +++ python/trunk/Python/ast.c Fri Dec 5 18:59:46 2008 @@ -3184,6 +3184,7 @@ int imflag; #endif + assert(s != NULL); errno = 0; end = s + strlen(s) - 1; #ifndef WITHOUT_COMPLEX From python-checkins at python.org Fri Dec 5 19:00:06 2008 From: python-checkins at python.org (georg.brandl) Date: Fri, 5 Dec 2008 19:00:06 +0100 (CET) Subject: [Python-checkins] r67591 - python/trunk/Doc/glossary.rst Message-ID: <20081205180006.4FC6B1E404B@bag.python.org> Author: georg.brandl Date: Fri Dec 5 19:00:06 2008 New Revision: 67591 Log: Followup to #4511: add link from decorator glossary entry to definition. Modified: python/trunk/Doc/glossary.rst Modified: python/trunk/Doc/glossary.rst ============================================================================== --- python/trunk/Doc/glossary.rst (original) +++ python/trunk/Doc/glossary.rst Fri Dec 5 19:00:06 2008 @@ -123,6 +123,9 @@ def f(...): ... + See :ref:`the documentation for function definition ` for more + about decorators. + descriptor Any *new-style* object which defines the methods :meth:`__get__`, :meth:`__set__`, or :meth:`__delete__`. When a class attribute is a From python-checkins at python.org Fri Dec 5 19:01:46 2008 From: python-checkins at python.org (mark.dickinson) Date: Fri, 5 Dec 2008 19:01:46 +0100 (CET) Subject: [Python-checkins] r67592 - in python/branches/release26-maint: Python/ast.c Message-ID: <20081205180146.C89831E402F@bag.python.org> Author: mark.dickinson Date: Fri Dec 5 19:01:46 2008 New Revision: 67592 Log: Merged revisions 67590 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r67590 | mark.dickinson | 2008-12-05 17:59:46 +0000 (Fri, 05 Dec 2008) | 2 lines Issue #4461: Safety check in parsenumber (ast.c) ........ Modified: python/branches/release26-maint/ (props changed) python/branches/release26-maint/Python/ast.c Modified: python/branches/release26-maint/Python/ast.c ============================================================================== --- python/branches/release26-maint/Python/ast.c (original) +++ python/branches/release26-maint/Python/ast.c Fri Dec 5 19:01:46 2008 @@ -3177,6 +3177,7 @@ int imflag; #endif + assert(s != NULL); errno = 0; end = s + strlen(s) - 1; #ifndef WITHOUT_COMPLEX From python-checkins at python.org Fri Dec 5 19:04:41 2008 From: python-checkins at python.org (georg.brandl) Date: Fri, 5 Dec 2008 19:04:41 +0100 (CET) Subject: [Python-checkins] r67593 - python/branches/py3k/Doc/howto/webservers.rst Message-ID: <20081205180441.B84D41E4046@bag.python.org> Author: georg.brandl Date: Fri Dec 5 19:04:41 2008 New Revision: 67593 Log: #4550: fix 2.x syntax in webservers howto. Modified: python/branches/py3k/Doc/howto/webservers.rst Modified: python/branches/py3k/Doc/howto/webservers.rst ============================================================================== --- python/branches/py3k/Doc/howto/webservers.rst (original) +++ python/branches/py3k/Doc/howto/webservers.rst Fri Dec 5 19:04:41 2008 @@ -101,10 +101,10 @@ # enable debugging import cgitb; cgitb.enable() - print "Content-Type: text/plain;charset=utf-8" - print + print("Content-Type: text/plain;charset=utf-8") + print() - print "Hello World!" + print("Hello World!") You need to write this code into a file with a ``.py`` or ``.cgi`` extension, this depends on your web server configuration. Depending on your web server @@ -278,8 +278,8 @@ #!/usr/bin/env python # -*- coding: UTF-8 -*- - from cgi import escape import sys, os + from cgi import escape from flup.server.fcgi import WSGIServer def app(environ, start_response): @@ -288,7 +288,8 @@ yield '

FastCGI Environment

' yield '
FormatPacked as .zipPacked as .tar.bz2
' for k, v in sorted(environ.items()): - yield '' % (escape(k), escape(v)) + yield ''.format( + escape(k), escape(v)) yield '
%s%s
{0}{1}
' WSGIServer(app).run() @@ -476,8 +477,8 @@ Python already includes such simple templates:: # a simple template - template = "

Hello %s!

" - print template % "Reader" + template = "

Hello {who}!

" + print(template.format(who="Reader")) The Python standard library also includes some more advanced templates usable through :class:`string.Template`, but in HTML templates it is needed to use From python-checkins at python.org Fri Dec 5 19:06:58 2008 From: python-checkins at python.org (georg.brandl) Date: Fri, 5 Dec 2008 19:06:58 +0100 (CET) Subject: [Python-checkins] r67594 - python/branches/py3k/Doc/tutorial/classes.rst Message-ID: <20081205180658.EB8B21E4002@bag.python.org> Author: georg.brandl Date: Fri Dec 5 19:06:58 2008 New Revision: 67594 Log: #4549: Mention nonlocal statement in tutorial section about scoping. Modified: python/branches/py3k/Doc/tutorial/classes.rst Modified: python/branches/py3k/Doc/tutorial/classes.rst ============================================================================== --- python/branches/py3k/Doc/tutorial/classes.rst (original) +++ python/branches/py3k/Doc/tutorial/classes.rst Fri Dec 5 19:06:58 2008 @@ -119,12 +119,11 @@ last) is the namespace containing built-in names. If a name is declared global, then all references and assignments go directly to -the middle scope containing the module's global names. Otherwise, all variables -found outside of the innermost scope are read-only (an attempt to write to such -a variable will simply create a *new* local variable in the innermost scope, -leaving the identically named outer variable unchanged). - -.. XXX mention nonlocal +the middle scope containing the module's global names. To rebind variables +found outside of the innermost scope, the :keyword:`nonlocal` statement can be +used; if not declared nonlocal, those variable are read-only (an attempt to +write to such a variable will simply create a *new* local variable in the +innermost scope, leaving the identically named outer variable unchanged). Usually, the local scope references the local names of the (textually) current function. Outside functions, the local scope references the same namespace as From python-checkins at python.org Fri Dec 5 19:10:46 2008 From: python-checkins at python.org (mark.dickinson) Date: Fri, 5 Dec 2008 19:10:46 +0100 (CET) Subject: [Python-checkins] r67595 - in python/branches/py3k: Python/ast.c Message-ID: <20081205181046.9E0741E4002@bag.python.org> Author: mark.dickinson Date: Fri Dec 5 19:10:46 2008 New Revision: 67595 Log: Merged revisions 67590 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r67590 | mark.dickinson | 2008-12-05 17:59:46 +0000 (Fri, 05 Dec 2008) | 2 lines Issue #4461: Safety check in parsenumber (ast.c) ........ Modified: python/branches/py3k/ (props changed) python/branches/py3k/Python/ast.c Modified: python/branches/py3k/Python/ast.c ============================================================================== --- python/branches/py3k/Python/ast.c (original) +++ python/branches/py3k/Python/ast.c Fri Dec 5 19:10:46 2008 @@ -3137,6 +3137,7 @@ int imflag; #endif + assert(s != NULL); errno = 0; end = s + strlen(s) - 1; #ifndef WITHOUT_COMPLEX From python-checkins at python.org Fri Dec 5 19:31:51 2008 From: python-checkins at python.org (georg.brandl) Date: Fri, 5 Dec 2008 19:31:51 +0100 (CET) Subject: [Python-checkins] r67596 - python/branches/py3k/Doc/whatsnew/3.0.rst Message-ID: <20081205183151.EDF0B1E4002@bag.python.org> Author: georg.brandl Date: Fri Dec 5 19:31:51 2008 New Revision: 67596 Log: Use :samp: role. Modified: python/branches/py3k/Doc/whatsnew/3.0.rst Modified: python/branches/py3k/Doc/whatsnew/3.0.rst ============================================================================== --- python/branches/py3k/Doc/whatsnew/3.0.rst (original) +++ python/branches/py3k/Doc/whatsnew/3.0.rst Fri Dec 5 19:31:51 2008 @@ -369,7 +369,7 @@ (a, *rest, b) = range(5) - This sets *a* to ``0``, *b* to ``4``, and \*rest to ``[1, 2, 3]``. + This sets *a* to ``0``, *b* to ``4``, and *rest* to ``[1, 2, 3]``. * Dictionary comprehensions: ``{k: v for k, v in stuff}`` means the same thing as ``dict(stuff)`` but is more flexible. (This is @@ -393,7 +393,7 @@ -------------- * :pep:`3109` and :pep:`3134`: new :keyword:`raise` statement syntax: - ``raise [expr [from expr]]``. See below. + :samp:`raise [{expr} [from {expr}]]`. See below. * :keyword:`as` and :keyword:`with` are now reserved words. (Since 2.6, actually.) @@ -422,8 +422,8 @@ :class:`object`.) * List comprehensions no longer support the syntactic form - ``[... for var in item1, item2, ...]``. Use - ``[... for var in (item1, item2, ...)]`` instead. + :samp:`[... for {var} in {item1}, {item2}, ...]`. Use + :samp:`[... for {var} in ({item1}, {item2}, ...)]` instead. Also note that list comprehensions have different semantics: they are closer to syntactic sugar for a generator expression inside a :func:`list` constructor, and in particular the loop control @@ -457,9 +457,8 @@ * The :keyword:`from` *module* :keyword:`import` ``*`` syntax is only allowed at the module level, no longer inside functions. -* The only acceptable syntax for relative imports is :keyword:`from` - ``.`` [*module*] :keyword:`import` *name*. - All :keyword:`import` forms not starting with ``.`` are +* The only acceptable syntax for relative imports is :samp:`from .[{module}] + import {name}`. All :keyword:`import` forms not starting with ``.`` are interpreted as absolute imports. (:pep:`0328`) * Classic classes are gone. From buildbot at python.org Fri Dec 5 19:49:37 2008 From: buildbot at python.org (buildbot at python.org) Date: Fri, 05 Dec 2008 18:49:37 +0000 Subject: [Python-checkins] buildbot failure in x86 W2k8 trunk Message-ID: <20081205184938.691B21E4002@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/362 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: nelson-windows Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: georg.brandl,mark.dickinson BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_bsddb3 sincerely, -The Buildbot From buildbot at python.org Fri Dec 5 19:50:52 2008 From: buildbot at python.org (buildbot at python.org) Date: Fri, 05 Dec 2008 18:50:52 +0000 Subject: [Python-checkins] buildbot failure in ppc Debian unstable trunk Message-ID: <20081205185052.9EBAF1E4002@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/2134 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: georg.brandl,mark.dickinson 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 Fri Dec 5 19:59:43 2008 From: buildbot at python.org (buildbot at python.org) Date: Fri, 05 Dec 2008 18:59:43 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.0 Message-ID: <20081205185943.294E21E400C@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/707 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: georg.brandl,mark.dickinson 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 Fri Dec 5 20:03:19 2008 From: python-checkins at python.org (georg.brandl) Date: Fri, 5 Dec 2008 20:03:19 +0100 (CET) Subject: [Python-checkins] r67597 - python/trunk/Doc/documenting/rest.rst Message-ID: <20081205190319.694A71E4002@bag.python.org> Author: georg.brandl Date: Fri Dec 5 20:03:19 2008 New Revision: 67597 Log: Remove confusing sentence part. Modified: python/trunk/Doc/documenting/rest.rst Modified: python/trunk/Doc/documenting/rest.rst ============================================================================== --- python/trunk/Doc/documenting/rest.rst (original) +++ python/trunk/Doc/documenting/rest.rst Fri Dec 5 20:03:19 2008 @@ -98,7 +98,7 @@ ----------- Literal code blocks are introduced by ending a paragraph with the special marker -``::``. The literal block must be indented, to be able to include blank lines:: +``::``. The literal block must be indented:: This is a normal text paragraph. The next paragraph is a code sample:: From python-checkins at python.org Fri Dec 5 20:10:43 2008 From: python-checkins at python.org (georg.brandl) Date: Fri, 5 Dec 2008 20:10:43 +0100 (CET) Subject: [Python-checkins] r67598 - in doctools/trunk/sphinx: __init__.py application.py builder.py cmdline.py config.py directives/desc.py directives/other.py environment.py ext/autodoc.py ext/pngmath.py ext/todo.py htmlhelp.py htmlwriter.py latexwriter.py linkcheck.py locale/cs/LC_MESSAGES/sphinx.js locale/cs/LC_MESSAGES/sphinx.mo locale/cs/LC_MESSAGES/sphinx.po locale/de/LC_MESSAGES/sphinx.js locale/de/LC_MESSAGES/sphinx.mo locale/de/LC_MESSAGES/sphinx.po locale/es/LC_MESSAGES/sphinx.js locale/es/LC_MESSAGES/sphinx.mo locale/es/LC_MESSAGES/sphinx.po locale/fr/LC_MESSAGES/sphinx.js locale/fr/LC_MESSAGES/sphinx.mo locale/fr/LC_MESSAGES/sphinx.po locale/ja/LC_MESSAGES/sphinx.js locale/ja/LC_MESSAGES/sphinx.mo locale/ja/LC_MESSAGES/sphinx.po locale/nl locale/nl/LC_MESSAGES locale/nl/LC_MESSAGES/sphinx.js locale/nl/LC_MESSAGES/sphinx.mo locale/nl/LC_MESSAGES/sphinx.po locale/pl/LC_MESSAGES/sphinx.js locale/pl/LC_MESSAGES/sphinx.mo locale/pl/LC_MESSAGES/sphinx.po locale/pt_BR locale/pt_BR/LC_MESSAGES locale/pt_BR/LC_MESSAGES/sphinx.js locale/pt_BR/LC_MESSAGES/sphinx.mo locale/pt_BR/LC_MESSAGES/sphinx.po locale/sl locale/sl/LC_MESSAGES locale/sl/LC_MESSAGES/sphinx.js locale/sl/LC_MESSAGES/sphinx.mo locale/sl/LC_MESSAGES/sphinx.po locale/sphinx.pot locale/zh_TW locale/zh_TW/LC_MESSAGES locale/zh_TW/LC_MESSAGES/sphinx.js locale/zh_TW/LC_MESSAGES/sphinx.mo locale/zh_TW/LC_MESSAGES/sphinx.po quickstart.py roles.py static/default.css static/sphinxdoc.css templates/changes/frameset.html templates/changes/rstsource.html templates/changes/versionchanges.html templates/defindex.html templates/layout.html templates/modindex.html templates/opensearch.xml templates/search.html texinputs/sphinx.sty textwriter.py util/__init__.py util/jsdump.py Message-ID: <20081205191043.14BB51E4002@bag.python.org> Author: georg.brandl Date: Fri Dec 5 20:10:41 2008 New Revision: 67598 Log: Update from Sphinx 0.5 branch. Added: doctools/trunk/sphinx/cmdline.py (contents, props changed) doctools/trunk/sphinx/ext/todo.py (contents, props changed) doctools/trunk/sphinx/locale/nl/ doctools/trunk/sphinx/locale/nl/LC_MESSAGES/ doctools/trunk/sphinx/locale/nl/LC_MESSAGES/sphinx.js (contents, props changed) doctools/trunk/sphinx/locale/nl/LC_MESSAGES/sphinx.mo (contents, props changed) doctools/trunk/sphinx/locale/nl/LC_MESSAGES/sphinx.po (contents, props changed) doctools/trunk/sphinx/locale/pt_BR/ doctools/trunk/sphinx/locale/pt_BR/LC_MESSAGES/ doctools/trunk/sphinx/locale/pt_BR/LC_MESSAGES/sphinx.js (contents, props changed) doctools/trunk/sphinx/locale/pt_BR/LC_MESSAGES/sphinx.mo (contents, props changed) doctools/trunk/sphinx/locale/pt_BR/LC_MESSAGES/sphinx.po (contents, props changed) doctools/trunk/sphinx/locale/sl/ doctools/trunk/sphinx/locale/sl/LC_MESSAGES/ doctools/trunk/sphinx/locale/sl/LC_MESSAGES/sphinx.js (contents, props changed) doctools/trunk/sphinx/locale/sl/LC_MESSAGES/sphinx.mo (contents, props changed) doctools/trunk/sphinx/locale/sl/LC_MESSAGES/sphinx.po (contents, props changed) doctools/trunk/sphinx/locale/zh_TW/ doctools/trunk/sphinx/locale/zh_TW/LC_MESSAGES/ doctools/trunk/sphinx/locale/zh_TW/LC_MESSAGES/sphinx.js (contents, props changed) doctools/trunk/sphinx/locale/zh_TW/LC_MESSAGES/sphinx.mo (contents, props changed) doctools/trunk/sphinx/locale/zh_TW/LC_MESSAGES/sphinx.po (contents, props changed) Modified: doctools/trunk/sphinx/__init__.py doctools/trunk/sphinx/application.py doctools/trunk/sphinx/builder.py doctools/trunk/sphinx/config.py doctools/trunk/sphinx/directives/desc.py doctools/trunk/sphinx/directives/other.py doctools/trunk/sphinx/environment.py doctools/trunk/sphinx/ext/autodoc.py doctools/trunk/sphinx/ext/pngmath.py doctools/trunk/sphinx/htmlhelp.py doctools/trunk/sphinx/htmlwriter.py doctools/trunk/sphinx/latexwriter.py doctools/trunk/sphinx/linkcheck.py doctools/trunk/sphinx/locale/cs/LC_MESSAGES/sphinx.js doctools/trunk/sphinx/locale/cs/LC_MESSAGES/sphinx.mo doctools/trunk/sphinx/locale/cs/LC_MESSAGES/sphinx.po doctools/trunk/sphinx/locale/de/LC_MESSAGES/sphinx.js doctools/trunk/sphinx/locale/de/LC_MESSAGES/sphinx.mo doctools/trunk/sphinx/locale/de/LC_MESSAGES/sphinx.po doctools/trunk/sphinx/locale/es/LC_MESSAGES/sphinx.js doctools/trunk/sphinx/locale/es/LC_MESSAGES/sphinx.mo doctools/trunk/sphinx/locale/es/LC_MESSAGES/sphinx.po doctools/trunk/sphinx/locale/fr/LC_MESSAGES/sphinx.js doctools/trunk/sphinx/locale/fr/LC_MESSAGES/sphinx.mo doctools/trunk/sphinx/locale/fr/LC_MESSAGES/sphinx.po doctools/trunk/sphinx/locale/ja/LC_MESSAGES/sphinx.js doctools/trunk/sphinx/locale/ja/LC_MESSAGES/sphinx.mo doctools/trunk/sphinx/locale/ja/LC_MESSAGES/sphinx.po doctools/trunk/sphinx/locale/pl/LC_MESSAGES/sphinx.js doctools/trunk/sphinx/locale/pl/LC_MESSAGES/sphinx.mo doctools/trunk/sphinx/locale/pl/LC_MESSAGES/sphinx.po doctools/trunk/sphinx/locale/sphinx.pot doctools/trunk/sphinx/quickstart.py doctools/trunk/sphinx/roles.py doctools/trunk/sphinx/static/default.css doctools/trunk/sphinx/static/sphinxdoc.css doctools/trunk/sphinx/templates/changes/frameset.html doctools/trunk/sphinx/templates/changes/rstsource.html doctools/trunk/sphinx/templates/changes/versionchanges.html doctools/trunk/sphinx/templates/defindex.html doctools/trunk/sphinx/templates/layout.html doctools/trunk/sphinx/templates/modindex.html doctools/trunk/sphinx/templates/opensearch.xml doctools/trunk/sphinx/templates/search.html doctools/trunk/sphinx/texinputs/sphinx.sty doctools/trunk/sphinx/textwriter.py doctools/trunk/sphinx/util/__init__.py doctools/trunk/sphinx/util/jsdump.py Modified: doctools/trunk/sphinx/__init__.py ============================================================================== --- doctools/trunk/sphinx/__init__.py (original) +++ doctools/trunk/sphinx/__init__.py Fri Dec 5 20:10:41 2008 @@ -9,182 +9,39 @@ :license: BSD. """ -import os import sys -import getopt -import traceback -from os import path -from cStringIO import StringIO - -from sphinx.util import format_exception_cut_frames, save_traceback -from sphinx.util.console import darkred, nocolor, color_terminal __revision__ = '$Revision$' __version__ = '0.5' -__released__ = '0.5 (hg)' - - -def usage(argv, msg=None): - if msg: - print >>sys.stderr, msg - print >>sys.stderr - print >>sys.stderr, """\ -Sphinx v%s -Usage: %s [options] sourcedir outdir [filenames...] -Options: -b -- builder to use; default is html - -a -- write all files; default is to only write new and changed files - -E -- don't use a saved environment, always read all files - -d -- path for the cached environment and doctree files - (default: outdir/.doctrees) - -c -- path where configuration file (conf.py) is located - (default: same as sourcedir) - -D -- override a setting in configuration - -A -- pass a value into the templates, for HTML builder - -N -- do not do colored output - -q -- no output on stdout, just warnings on stderr - -Q -- no output at all, not even warnings - -P -- run Pdb on exception -Modi: -* without -a and without filenames, write new and changed files. -* with -a, write all files. -* with filenames, write these.""" % (__version__, argv[0]) +__released__ = '0.5' def main(argv=sys.argv): - # delay-import these to be able to get sphinx.__version__ from setup.py - # even without docutils installed - from sphinx.application import Sphinx, SphinxError - from docutils.utils import SystemMessage - - if not sys.stdout.isatty() or not color_terminal(): - # Windows' poor cmd box doesn't understand ANSI sequences - nocolor() - - try: - opts, args = getopt.getopt(argv[1:], 'ab:d:c:D:A:NEqP') - srcdir = confdir = path.abspath(args[0]) - if not path.isdir(srcdir): - print >>sys.stderr, 'Error: Cannot find source directory.' - return 1 - if not path.isfile(path.join(srcdir, 'conf.py')) and \ - '-c' not in (opt[0] for opt in opts): - print >>sys.stderr, 'Error: Source directory doesn\'t contain conf.py file.' - return 1 - outdir = path.abspath(args[1]) - if not path.isdir(outdir): - print >>sys.stderr, 'Making output directory...' - os.makedirs(outdir) - except (IndexError, getopt.error): - usage(argv) - return 1 - - filenames = args[2:] - err = 0 - for filename in filenames: - if not path.isfile(filename): - print >>sys.stderr, 'Cannot find file %r.' % filename - err = 1 - if err: + if sys.version_info[:3] < (2, 4, 0): + print >>sys.stderr, \ + 'Error: Sphinx requires at least Python 2.4 to run.' return 1 - buildername = all_files = None - freshenv = use_pdb = False - status = sys.stdout - warning = sys.stderr - confoverrides = {} - htmlcontext = {} - doctreedir = path.join(outdir, '.doctrees') - for opt, val in opts: - if opt == '-b': - buildername = val - elif opt == '-a': - if filenames: - usage(argv, 'Cannot combine -a option and filenames.') - return 1 - all_files = True - elif opt == '-d': - doctreedir = path.abspath(val) - elif opt == '-c': - confdir = path.abspath(val) - if not path.isfile(path.join(confdir, 'conf.py')): - print >>sys.stderr, \ - 'Error: Configuration directory doesn\'t contain conf.py file.' - return 1 - elif opt == '-D': - try: - key, val = val.split('=') - except ValueError: - print >>sys.stderr, \ - 'Error: -D option argument must be in the form name=value.' - return 1 - try: - val = int(val) - except ValueError: - pass - confoverrides[key] = val - elif opt == '-A': - try: - key, val = val.split('=') - except ValueError: - print >>sys.stderr, \ - 'Error: -A option argument must be in the form name=value.' - return 1 - try: - val = int(val) - except ValueError: - pass - htmlcontext[key] = val - elif opt == '-N': - nocolor() - elif opt == '-E': - freshenv = True - elif opt == '-q': - status = StringIO() - elif opt == '-Q': - status = StringIO() - warning = StringIO() - elif opt == '-P': - use_pdb = True - confoverrides['html_context'] = htmlcontext - try: - app = Sphinx(srcdir, confdir, outdir, doctreedir, buildername, - confoverrides, status, warning, freshenv) - app.build(all_files, filenames) - except KeyboardInterrupt: - if use_pdb: - import pdb - print >>sys.stderr, darkred('Interrupted while building, starting debugger:') - traceback.print_exc() - pdb.post_mortem(sys.exc_info()[2]) - return 1 - except Exception, err: - if use_pdb: - import pdb - print >>sys.stderr, darkred('Exception occurred while building, ' - 'starting debugger:') - traceback.print_exc() - pdb.post_mortem(sys.exc_info()[2]) - else: - if isinstance(err, SystemMessage): - print >>sys.stderr, darkred('reST markup error:') - print >>sys.stderr, err.args[0].encode('ascii', 'backslashreplace') - elif isinstance(err, SphinxError): - print >>sys.stderr, darkred('%s:' % err.category) - print >>sys.stderr, err + from sphinx import cmdline + except ImportError, err: + errstr = str(err) + if errstr.lower().startswith('no module named'): + whichmod = errstr[16:] + if whichmod.startswith('docutils'): + whichmod = 'Docutils library' + elif whichmod.startswith('jinja'): + whichmod = 'Jinja library' + elif whichmod == 'roman': + whichmod = 'roman module (which is distributed with Docutils)' else: - print >>sys.stderr, darkred('Exception occurred:') - print >>sys.stderr, format_exception_cut_frames().rstrip() - tbpath = save_traceback() - print >>sys.stderr, darkred('The full traceback has been saved ' - 'in %s, if you want to report the ' - 'issue to the author.' % tbpath) - print >>sys.stderr, ('Please also report this if it was a user ' - 'error, so that a better error message ' - 'can be provided next time.') - print >>sys.stderr, ('Send reports to sphinx-dev at googlegroups.com. ' - 'Thanks!') + whichmod += ' module' + print >>sys.stderr, \ + 'Error: The %s cannot be found. Did you install Sphinx '\ + 'and its dependencies correctly?' % whichmod return 1 + raise + return cmdline.main(argv) if __name__ == '__main__': Modified: doctools/trunk/sphinx/application.py ============================================================================== --- doctools/trunk/sphinx/application.py (original) +++ doctools/trunk/sphinx/application.py Fri Dec 5 20:10:41 2008 @@ -14,6 +14,7 @@ import sys import posixpath +from cStringIO import StringIO from docutils import nodes from docutils.parsers.rst import directives, roles @@ -58,6 +59,7 @@ # List of all known core events. Maps name to arguments description. events = { 'builder-inited': '', + 'env-purge-doc': 'env, docname', 'source-read': 'docname, source text', 'doctree-read': 'the doctree before being pickled', 'missing-reference': 'env, node, contnode', @@ -83,12 +85,23 @@ self.outdir = outdir self.doctreedir = doctreedir - self._status = status - self._warning = warning + if status is None: + self._status = StringIO() + self.quiet = True + else: + self._status = status + self.quiet = False + if warning is None: + self._warning = StringIO() + else: + self._warning = warning self._warncount = 0 self._events = events.copy() + # status code for command-line application + self.statuscode = 0 + # read config self.config = Config(confdir, CONFIG_FILENAME, confoverrides) Modified: doctools/trunk/sphinx/builder.py ============================================================================== --- doctools/trunk/sphinx/builder.py (original) +++ doctools/trunk/sphinx/builder.py Fri Dec 5 20:10:41 2008 @@ -26,7 +26,7 @@ from docutils.readers.doctree import Reader as DoctreeReader from sphinx import addnodes, locale, __version__ -from sphinx.util import ensuredir, relative_uri, SEP, os_path, texescape +from sphinx.util import ensuredir, relative_uri, SEP, os_path, texescape, ustrftime from sphinx.htmlhelp import build_hhx from sphinx.htmlwriter import HTMLWriter, HTMLTranslator, SmartyPantsHTMLTranslator from sphinx.textwriter import TextWriter @@ -40,7 +40,7 @@ import json except ImportError: try: - import ssimplejson as json + import simplejson as json except ImportError: json = None @@ -405,7 +405,7 @@ # typically doesn't include the time of day lufmt = self.config.html_last_updated_fmt if lufmt is not None: - self.last_updated = time.strftime(lufmt or _('%b %d, %Y')) + self.last_updated = ustrftime(lufmt or _('%b %d, %Y')) else: self.last_updated = None Added: doctools/trunk/sphinx/cmdline.py ============================================================================== --- (empty file) +++ doctools/trunk/sphinx/cmdline.py Fri Dec 5 20:10:41 2008 @@ -0,0 +1,186 @@ +# -*- coding: utf-8 -*- +""" + sphinx.cmdline + ~~~~~~~~~~~~~~ + + sphinx-build command-line handling. + + :copyright: 2008 by Georg Brandl. + :license: BSD. +""" + +import os +import sys +import getopt +import traceback +from os import path + +from docutils.utils import SystemMessage + +from sphinx import __version__ +from sphinx.application import Sphinx, SphinxError +from sphinx.util import format_exception_cut_frames, save_traceback +from sphinx.util.console import darkred, nocolor, color_terminal + + +def usage(argv, msg=None): + if msg: + print >>sys.stderr, msg + print >>sys.stderr + print >>sys.stderr, """\ +Sphinx v%s +Usage: %s [options] sourcedir outdir [filenames...] +Options: -b -- builder to use; default is html + -a -- write all files; default is to only write new and changed files + -E -- don't use a saved environment, always read all files + -d -- path for the cached environment and doctree files + (default: outdir/.doctrees) + -c -- path where configuration file (conf.py) is located + (default: same as sourcedir) + -C -- use no config file at all, only -D options + -D -- override a setting in configuration + -A -- pass a value into the templates, for HTML builder + -N -- do not do colored output + -q -- no output on stdout, just warnings on stderr + -Q -- no output at all, not even warnings + -P -- run Pdb on exception +Modi: +* without -a and without filenames, write new and changed files. +* with -a, write all files. +* with filenames, write these.""" % (__version__, argv[0]) + + +def main(argv): + if not sys.stdout.isatty() or not color_terminal(): + # Windows' poor cmd box doesn't understand ANSI sequences + nocolor() + + try: + opts, args = getopt.getopt(argv[1:], 'ab:d:c:CD:A:NEqP') + allopts = set(opt[0] for opt in opts) + srcdir = confdir = path.abspath(args[0]) + if not path.isdir(srcdir): + print >>sys.stderr, 'Error: Cannot find source directory.' + return 1 + if not path.isfile(path.join(srcdir, 'conf.py')) and \ + '-c' not in allopts and '-C' not in allopts: + print >>sys.stderr, 'Error: Source directory doesn\'t contain conf.py file.' + return 1 + outdir = path.abspath(args[1]) + if not path.isdir(outdir): + print >>sys.stderr, 'Making output directory...' + os.makedirs(outdir) + except (IndexError, getopt.error): + usage(argv) + return 1 + + filenames = args[2:] + err = 0 + for filename in filenames: + if not path.isfile(filename): + print >>sys.stderr, 'Cannot find file %r.' % filename + err = 1 + if err: + return 1 + + buildername = all_files = None + freshenv = use_pdb = False + status = sys.stdout + warning = sys.stderr + confoverrides = {} + htmlcontext = {} + doctreedir = path.join(outdir, '.doctrees') + for opt, val in opts: + if opt == '-b': + buildername = val + elif opt == '-a': + if filenames: + usage(argv, 'Cannot combine -a option and filenames.') + return 1 + all_files = True + elif opt == '-d': + doctreedir = path.abspath(val) + elif opt == '-c': + confdir = path.abspath(val) + if not path.isfile(path.join(confdir, 'conf.py')): + print >>sys.stderr, \ + 'Error: Configuration directory doesn\'t contain conf.py file.' + return 1 + elif opt == '-C': + confdir = None + elif opt == '-D': + try: + key, val = val.split('=') + except ValueError: + print >>sys.stderr, \ + 'Error: -D option argument must be in the form name=value.' + return 1 + try: + val = int(val) + except ValueError: + pass + confoverrides[key] = val + elif opt == '-A': + try: + key, val = val.split('=') + except ValueError: + print >>sys.stderr, \ + 'Error: -A option argument must be in the form name=value.' + return 1 + try: + val = int(val) + except ValueError: + pass + htmlcontext[key] = val + elif opt == '-N': + nocolor() + elif opt == '-E': + freshenv = True + elif opt == '-q': + status = None + elif opt == '-Q': + status = None + warning = None + elif opt == '-P': + use_pdb = True + confoverrides['html_context'] = htmlcontext + + try: + app = Sphinx(srcdir, confdir, outdir, doctreedir, buildername, + confoverrides, status, warning, freshenv) + app.build(all_files, filenames) + return app.statuscode + except KeyboardInterrupt: + if use_pdb: + import pdb + print >>sys.stderr, darkred('Interrupted while building, starting debugger:') + traceback.print_exc() + pdb.post_mortem(sys.exc_info()[2]) + return 1 + except Exception, err: + if use_pdb: + import pdb + print >>sys.stderr, darkred('Exception occurred while building, ' + 'starting debugger:') + traceback.print_exc() + pdb.post_mortem(sys.exc_info()[2]) + else: + if isinstance(err, SystemMessage): + print >>sys.stderr, darkred('reST markup error:') + print >>sys.stderr, err.args[0].encode('ascii', 'backslashreplace') + elif isinstance(err, SphinxError): + print >>sys.stderr, darkred('%s:' % err.category) + print >>sys.stderr, err + else: + print >>sys.stderr, darkred('Exception occurred:') + print >>sys.stderr, format_exception_cut_frames().rstrip() + tbpath = save_traceback() + print >>sys.stderr, darkred('The full traceback has been saved ' + 'in %s, if you want to report the ' + 'issue to the author.' % tbpath) + print >>sys.stderr, ('Please also report this if it was a user ' + 'error, so that a better error message ' + 'can be provided next time.') + print >>sys.stderr, ('Send reports to sphinx-dev at googlegroups.com. ' + 'Thanks!') + return 1 Modified: doctools/trunk/sphinx/config.py ============================================================================== --- doctools/trunk/sphinx/config.py (original) +++ doctools/trunk/sphinx/config.py Fri Dec 5 20:10:41 2008 @@ -94,13 +94,15 @@ def __init__(self, dirname, filename, overrides): self.overrides = overrides self.values = Config.config_values.copy() - config = {'__file__': path.join(dirname, filename)} - olddir = os.getcwd() - try: - os.chdir(dirname) - execfile(config['__file__'], config) - finally: - os.chdir(olddir) + config = {} + if dirname is not None: + config['__file__'] = path.join(dirname, filename) + olddir = os.getcwd() + try: + os.chdir(dirname) + execfile(config['__file__'], config) + finally: + os.chdir(olddir) self._raw_config = config # these two must be preinitialized because extensions can add their # own config values Modified: doctools/trunk/sphinx/directives/desc.py ============================================================================== --- doctools/trunk/sphinx/directives/desc.py (original) +++ doctools/trunk/sphinx/directives/desc.py Fri Dec 5 20:10:41 2008 @@ -14,10 +14,9 @@ from docutils.parsers.rst import directives from sphinx import addnodes +from sphinx.util import ws_re -ws_re = re.compile(r'\s+') - # ------ information units --------------------------------------------------------- def desc_index_text(desctype, module, name, add_modules): @@ -109,6 +108,8 @@ 'return': 'Returns', } +doc_fields_with_linked_arg = ('raises', 'raise', 'exception', 'except') + doc_fields_without_arg = { 'returns': 'Returns', 'return': 'Returns', @@ -117,7 +118,7 @@ del _ -def handle_doc_fields(node): +def handle_doc_fields(node, env): # don't traverse, only handle field lists that are immediate children for child in node.children: if not isinstance(child, nodes.field_list): @@ -130,13 +131,13 @@ fname, fbody = field try: typ, obj = fname.astext().split(None, 1) - typ = _(doc_fields_with_arg[typ]) + typdesc = _(doc_fields_with_arg[typ]) if len(fbody.children) == 1 and \ isinstance(fbody.children[0], nodes.paragraph): children = fbody.children[0].children else: children = fbody.children - if typ == '%param': + if typdesc == '%param': if not params: pfield = nodes.field() pfield += nodes.field_name('', _('Parameters')) @@ -152,12 +153,22 @@ param_nodes[obj] = dlpar dlitem += dlpar params += dlitem - elif typ == '%type': + elif typdesc == '%type': param_types[obj] = fbody.astext() else: - fieldname = typ + ' ' + obj + fieldname = typdesc + ' ' nfield = nodes.field() - nfield += nodes.field_name(fieldname, fieldname) + nfieldname = nodes.field_name(fieldname, fieldname) + nfield += nfieldname + node = nfieldname + if typ in doc_fields_with_linked_arg: + node = addnodes.pending_xref(obj, reftype='obj', + refcaption=False, + reftarget=obj, + modname=env.currmodule, + classname=env.currclass) + nfieldname += node + node += nodes.Text(obj, obj) nfield += nodes.field_body() nfield[1] += fbody.children new_list += nfield @@ -352,17 +363,17 @@ option_desc_re = re.compile( - r'(/|-|--)([-_a-zA-Z0-9]+)(\s*.*?)(?=,\s+(?:/|-|--)|$)') + r'((?:/|-|--)[-_a-zA-Z0-9]+)(\s*.*?)(?=,\s+(?:/|-|--)|$)') def parse_option_desc(signode, sig): """Transform an option description into RST nodes.""" count = 0 firstname = '' for m in option_desc_re.finditer(sig): - prefix, optname, args = m.groups() + optname, args = m.groups() if count: signode += addnodes.desc_addname(', ', ', ') - signode += addnodes.desc_name(prefix+optname, prefix+optname) + signode += addnodes.desc_name(optname, optname) signode += addnodes.desc_addname(args, args) if not count: firstname = optname @@ -372,6 +383,8 @@ return firstname +strip_backslash_re = re.compile(r'\\(?=[^\\])') + def desc_directive(desctype, arguments, options, content, lineno, content_offset, block_text, state, state_machine): env = state.document.settings.env @@ -382,7 +395,8 @@ noindex = ('noindex' in options) node['noindex'] = noindex # remove backslashes to support (dummy) escapes; helps Vim's highlighting - signatures = map(lambda s: s.strip().replace('\\', ''), arguments[0].split('\n')) + signatures = map(lambda s: strip_backslash_re.sub('', s.strip()), + arguments[0].split('\n')) names = [] clsname = None module = options.get('module', env.currmodule) @@ -402,12 +416,17 @@ elif desctype == 'cmdoption': optname = parse_option_desc(signode, sig) if not noindex: - targetname = 'cmdoption-' + optname + targetname = optname.replace('/', '-') + if env.currprogram: + targetname = '-' + env.currprogram + targetname + targetname = 'cmdoption' + targetname signode['ids'].append(targetname) state.document.note_explicit_target(signode) - inode['entries'].append(('pair', _('command line option; %s') % sig, - targetname, targetname)) - env.note_reftarget('option', optname, targetname) + inode['entries'].append( + ('pair', _('%scommand line option; %s') % + ((env.currprogram and env.currprogram + ' ' or ''), sig), + targetname, targetname)) + env.note_progoption(optname, targetname) continue elif desctype == 'describe': signode.clear() @@ -475,7 +494,7 @@ if names: env.currdesc = names[0] state.nested_parse(content, content_offset, subnode) - handle_doc_fields(subnode) + handle_doc_fields(subnode, env) if clsname_set: env.currclass = None env.currdesc = None Modified: doctools/trunk/sphinx/directives/other.py ============================================================================== --- doctools/trunk/sphinx/directives/other.py (original) +++ doctools/trunk/sphinx/directives/other.py Fri Dec 5 20:10:41 2008 @@ -14,9 +14,8 @@ from docutils.parsers.rst import directives from sphinx import addnodes -from sphinx.util import patfilter -from sphinx.roles import caption_ref_re from sphinx.locale import pairindextypes +from sphinx.util import patfilter, ws_re, caption_ref_re from sphinx.util.compat import make_admonition @@ -159,6 +158,20 @@ directives.register_directive('moduleauthor', author_directive) +def program_directive(name, arguments, options, content, lineno, + content_offset, block_text, state, state_machine): + env = state.document.settings.env + program = ws_re.sub('-', arguments[0].strip()) + if program == 'None': + env.currprogram = None + else: + env.currprogram = program + return [] + +program_directive.arguments = (1, 0, 1) +directives.register_directive('program', program_directive) + + # ------ index markup -------------------------------------------------------------- indextypes = [ @@ -192,7 +205,10 @@ # shorthand notation for single entries else: for value in entry.split(','): - ne.append(('single', value.strip(), targetid, value.strip())) + value = value.strip() + if not value: + continue + ne.append(('single', value, targetid, value)) return [indexnode, targetnode] index_directive.arguments = (1, 0, 1) Modified: doctools/trunk/sphinx/environment.py ============================================================================== --- doctools/trunk/sphinx/environment.py (original) +++ doctools/trunk/sphinx/environment.py Fri Dec 5 20:10:41 2008 @@ -42,7 +42,7 @@ from docutils.transforms.parts import ContentsFilter from sphinx import addnodes -from sphinx.util import get_matching_docs, SEP +from sphinx.util import get_matching_docs, SEP, ustrftime from sphinx.directives import additional_xref_types default_settings = { @@ -57,7 +57,7 @@ # This is increased every time an environment attribute is added # or changed to properly invalidate pickle files. -ENV_VERSION = 25 +ENV_VERSION = 26 default_substitutions = set([ @@ -99,7 +99,7 @@ text = config[refname] if refname == 'today' and not text: # special handling: can also specify a strftime format - text = time.strftime(config.today_fmt or _('%B %d, %Y')) + text = ustrftime(config.today_fmt or _('%B %d, %Y')) ref.replace_self(nodes.Text(text, text)) @@ -171,7 +171,8 @@ within table-of-contents link nodes. """ def visit_pending_xref(self, node): - self.parent.append(nodes.literal(node['reftarget'], node['reftarget'])) + text = node.astext() + self.parent.append(nodes.literal(text, text)) raise nodes.SkipNode @@ -266,8 +267,9 @@ self.modules = {} # modname -> docname, synopsis, platform, deprecated self.labels = {} # labelname -> docname, labelid, sectionname self.anonlabels = {} # labelname -> docname, labelid + self.progoptions = {} # (program, name) -> docname, labelid self.reftargets = {} # (type, name) -> docname, labelid - # where type is term, token, option, envvar, citation + # where type is term, token, envvar, citation # Other inventories self.indexentries = {} # docname -> list of @@ -281,6 +283,7 @@ self.currmodule = None # current module name self.currclass = None # current class name self.currdesc = None # current descref name + self.currprogram = None # current program name self.index_num = 0 # autonumber for index targets self.gloss_entries = set() # existing definition labels @@ -331,6 +334,9 @@ for key, (fn, _) in self.reftargets.items(): if fn == docname: del self.reftargets[key] + for key, (fn, _) in self.progoptions.items(): + if fn == docname: + del self.progoptions[key] for version, changes in self.versionchanges.items(): new = [change for change in changes if change[1] != docname] changes[:] = new @@ -460,6 +466,8 @@ # clear all files no longer present for docname in removed: + if app: + app.emit('env-purge-doc', self, docname) self.clear_doc(docname) # read all new and changed files @@ -490,6 +498,8 @@ If srcpath is given, read from a different source file. """ # remove all inventory entries for that file + if app: + app.emit('env-purge-doc', self, docname) self.clear_doc(docname) if src_path is None: @@ -822,6 +832,9 @@ self.modules[modname] = (self.docname, synopsis, platform, deprecated) self.filemodules.setdefault(self.docname, []).append(modname) + def note_progoption(self, optname, labelid): + self.progoptions[self.currprogram, optname] = (self.docname, labelid) + def note_reftarget(self, type, name, labelid): self.reftargets[type, name] = (self.docname, labelid) @@ -890,9 +903,10 @@ """Utility: Cut a TOC at a specified depth.""" for subnode in node.children[:]: if isinstance(subnode, (addnodes.compact_paragraph, nodes.list_item)): + subnode['classes'].append('toctree-l%d' % (depth-1)) _walk_depth(subnode, depth, maxdepth, titleoverrides) elif isinstance(subnode, nodes.bullet_list): - if depth > maxdepth: + if maxdepth > 0 and depth > maxdepth: subnode.parent.replace(subnode, []) else: _walk_depth(subnode, depth+1, maxdepth, titleoverrides) @@ -946,9 +960,8 @@ newnode = addnodes.compact_paragraph('', '', *tocentries) newnode['toctree'] = True - # prune the tree to maxdepth and replace titles - if maxdepth > 0 and prune: - _walk_depth(newnode, 1, maxdepth, titleoverrides) + # prune the tree to maxdepth and replace titles, also set level classes + _walk_depth(newnode, 1, prune and maxdepth or 0, titleoverrides) # replace titles, if needed, and set the target paths in the # toctrees (they are not known at TOC generation time) for refnode in newnode.traverse(nodes.reference): @@ -964,7 +977,7 @@ 'meth', 'cfunc', 'cmember', 'cdata', 'ctype', 'cmacro')) def resolve_references(self, doctree, fromdocname, builder): - reftarget_roles = set(('token', 'term', 'option', 'citation')) + reftarget_roles = set(('token', 'term', 'citation')) # add all custom xref types too reftarget_roles.update(i[0] for i in additional_xref_types.values()) @@ -1024,6 +1037,19 @@ newnode['refuri'] = builder.get_relative_uri( fromdocname, docname) + '#' + labelid newnode.append(contnode) + elif typ == 'option': + progname = node['refprogram'] + docname, labelid = self.progoptions.get((progname, target), ('', '')) + if not docname: + newnode = contnode + else: + newnode = nodes.reference('', '') + if docname == fromdocname: + newnode['refid'] = labelid + else: + newnode['refuri'] = builder.get_relative_uri( + fromdocname, docname) + '#' + labelid + newnode.append(contnode) elif typ in reftarget_roles: docname, labelid = self.reftargets.get((typ, target), ('', '')) if not docname: @@ -1045,10 +1071,6 @@ elif typ == 'mod': docname, synopsis, platform, deprecated = \ self.modules.get(target, ('','','', '')) - # just link to an anchor if there are multiple modules in one file - # because the anchor is generally below the heading which is ugly - # but can't be helped easily - anchor = '' if not docname: newnode = builder.app.emit_firstresult('missing-reference', self, node, contnode) @@ -1058,11 +1080,9 @@ # don't link to self newnode = contnode else: - if len(self.filemodules[docname]) > 1: - anchor = '#' + 'module-' + target newnode = nodes.reference('', '') - newnode['refuri'] = ( - builder.get_relative_uri(fromdocname, docname) + anchor) + newnode['refuri'] = builder.get_relative_uri( + fromdocname, docname) + '#module-' + target newnode['reftitle'] = '%s%s%s' % ( (platform and '(%s) ' % platform), synopsis, (deprecated and ' (deprecated)' or '')) @@ -1117,25 +1137,42 @@ pass for fn, entries in self.indexentries.iteritems(): - # new entry types must be listed in directives.py! + # new entry types must be listed in directives/other.py! for type, string, tid, alias in entries: if type == 'single': try: entry, subentry = string.split(';', 1) except ValueError: entry, subentry = string, '' + if not entry: + self.warn(fn, 'invalid index entry %r' % string) + continue add_entry(entry.strip(), subentry.strip()) elif type == 'pair': - first, second = map(lambda x: x.strip(), string.split(';', 1)) + try: + first, second = map(lambda x: x.strip(), + string.split(';', 1)) + if not first or not second: + raise ValueError + except ValueError: + self.warn(fn, 'invalid pair index entry %r' % string) + continue add_entry(first, second) add_entry(second, first) elif type == 'triple': - first, second, third = map(lambda x: x.strip(), string.split(';', 2)) + try: + first, second, third = map(lambda x: x.strip(), + string.split(';', 2)) + if not first or not second or not third: + raise ValueError + except ValueError: + self.warn(fn, 'invalid triple index entry %r' % string) + continue add_entry(first, second+' '+third) add_entry(second, third+', '+first) add_entry(third, first+' '+second) else: - self.warn(fn, "unknown index entry type %r" % type) + self.warn(fn, 'unknown index entry type %r' % type) newlist = new.items() newlist.sort(key=lambda t: t[0].lower()) Modified: doctools/trunk/sphinx/ext/autodoc.py ============================================================================== --- doctools/trunk/sphinx/ext/autodoc.py (original) +++ doctools/trunk/sphinx/ext/autodoc.py Fri Dec 5 20:10:41 2008 @@ -22,7 +22,7 @@ from docutils.parsers.rst import directives from docutils.statemachine import ViewList -from sphinx.util import rpartition +from sphinx.util import rpartition, nested_parse_with_titles from sphinx.directives.desc import py_sig_re try: @@ -541,7 +541,8 @@ continue if what == 'module': - if isinstance(member, types.FunctionType): + if isinstance(member, (types.FunctionType, + types.BuiltinFunctionType)): memberwhat = 'function' elif isinstance(member, types.ClassType) or \ isinstance(member, type): @@ -600,14 +601,7 @@ state.memo.reporter = AutodocReporter(generator.result, state.memo.reporter) if dirname == 'automodule': node = nodes.section() - # hack around title style bookkeeping - surrounding_title_styles = state.memo.title_styles - surrounding_section_level = state.memo.section_level - state.memo.title_styles = [] - state.memo.section_level = 0 - state.nested_parse(generator.result, 0, node, match_titles=1) - state.memo.title_styles = surrounding_title_styles - state.memo.section_level = surrounding_section_level + nested_parse_with_titles(state, generator.result, node) else: node = nodes.paragraph() state.nested_parse(generator.result, 0, node) Modified: doctools/trunk/sphinx/ext/pngmath.py ============================================================================== --- doctools/trunk/sphinx/ext/pngmath.py (original) +++ doctools/trunk/sphinx/ext/pngmath.py Fri Dec 5 20:10:41 2008 @@ -75,9 +75,11 @@ """ use_preview = self.builder.config.pngmath_use_preview - shasum = "%s.png" % sha(math).hexdigest() + shasum = "%s.png" % sha(math.encode('utf-8')).hexdigest() relfn = posixpath.join(self.builder.imgpath, 'math', shasum) outfn = path.join(self.builder.outdir, '_images', 'math', shasum) + if path.isfile(outfn): + return relfn, self.builder.env._pngmath_depth.get(shasum, None) latex = DOC_HEAD + self.builder.config.pngmath_latex_preamble latex += (use_preview and DOC_BODY_PREVIEW or DOC_BODY) % math @@ -156,10 +158,15 @@ m = depth_re.match(line) if m: depth = int(m.group(1)) + self.builder.env._pngmath_depth[shasum] = depth break return relfn, depth +def ensure_depthcache(app, env): + if not hasattr(env, '_pngmath_depth'): + env._pngmath_depth = {} + def cleanup_tempdir(app, exc): if exc: return @@ -171,9 +178,16 @@ pass def html_visit_math(self, node): - fname, depth = render_math(self, '$'+node['latex']+'$') - self.body.append('%s' % - (fname, self.encode(node['latex']), + try: + fname, depth = render_math(self, '$'+node['latex']+'$') + except MathExtError, exc: + sm = nodes.system_message(str(exc), type='WARNING', level=2, + backrefs=[], source=node['latex']) + sm.walkabout(self) + self.builder.warn('display latex %r: ' % node['latex'] + str(exc)) + raise nodes.SkipNode + self.body.append('%s' % + (fname, self.encode(node['latex']).strip(), depth and 'style="vertical-align: %dpx" ' % (-depth) or '')) raise nodes.SkipNode @@ -182,13 +196,20 @@ latex = node['latex'] else: latex = wrap_displaymath(node['latex'], None) - fname, depth = render_math(self, latex) + try: + fname, depth = render_math(self, latex) + except MathExtError, exc: + sm = nodes.system_message(str(exc), type='WARNING', level=2, + backrefs=[], source=node['latex']) + sm.walkabout(self) + self.builder.warn('inline latex %r: ' % node['latex'] + str(exc)) + raise nodes.SkipNode self.body.append(self.starttag(node, 'div', CLASS='math')) self.body.append('

') if node['number']: self.body.append('(%s)' % node['number']) self.body.append('%s\n' % - (fname, self.encode(node['latex']))) + (fname, self.encode(node['latex']).strip())) self.body.append('

') raise nodes.SkipNode @@ -198,6 +219,7 @@ app.add_config_value('pngmath_dvipng', 'dvipng', False) app.add_config_value('pngmath_latex', 'latex', False) app.add_config_value('pngmath_use_preview', False, False) - app.add_config_value('pngmath_dvipng_args', [], False) + app.add_config_value('pngmath_dvipng_args', ['-gamma 1.5', '-D 110'], False) app.add_config_value('pngmath_latex_preamble', '', False) + app.connect('env-updated', ensure_depthcache) app.connect('build-finished', cleanup_tempdir) Added: doctools/trunk/sphinx/ext/todo.py ============================================================================== --- (empty file) +++ doctools/trunk/sphinx/ext/todo.py Fri Dec 5 20:10:41 2008 @@ -0,0 +1,123 @@ +# -*- coding: utf-8 -*- +""" + sphinx.ext.todo + ~~~~~~~~~~~~~~~ + + Allow todos to be inserted into your documentation. Inclusion of todos can + be switched of by a configuration variable. The todolist directive collects + all todos of your project and lists them along with a backlink to the + original location. + + :copyright: 2008 Daniel B?ltmann. + :license: BSD. +""" + +from docutils import nodes + +from sphinx.util.compat import make_admonition + +class todo_node(nodes.Admonition, nodes.Element): pass +class todolist(nodes.General, nodes.Element): pass + + +def todo_directive(name, arguments, options, content, lineno, + content_offset, block_text, state, state_machine): + env = state.document.settings.env + + targetid = "todo-%s" % env.index_num + env.index_num += 1 + targetnode = nodes.target('', '', ids=[targetid]) + + ad = make_admonition(todo_node, name, [_('Todo')], options, content, lineno, + content_offset, block_text, state, state_machine) + + # Attach a list of all todos to the environment, + # the todolist works with the collected todo nodes + if not hasattr(env, 'todo_all_todos'): + env.todo_all_todos = [] + env.todo_all_todos.append({ + 'docname': env.docname, + 'lineno': lineno, + 'todo': ad[0].deepcopy(), + 'target': targetnode, + }) + + return [targetnode] + ad + + +def todolist_directive(name, arguments, options, content, lineno, + content_offset, block_text, state, state_machine): + # Simply insert an empty todolist node which will be replaced later + # when process_todo_nodes is called + return [todolist('')] + + +def process_todo_nodes(app, doctree, fromdocname): + if not app.config['todo_include_todos']: + for node in doctree.traverse(todo_node): + node.parent.remove(node) + + # Replace all todolist nodes with a list of the collected todos. + # Augment each todo with a backlink to the original location. + env = app.builder.env + + for node in doctree.traverse(todolist): + if not app.config['todo_include_todos']: + node.replace_self([]) + continue + + content = [] + + for todo_info in env.todo_all_todos: + para = nodes.paragraph() + filename = env.doc2path(todo_info['docname'], base=None) + description = ( + _('(The original entry is located in %s, line %d and can be found ') % + (filename, todo_info['lineno'])) + para += nodes.Text(description, description) + + # Create a reference + newnode = nodes.reference('', '') + innernode = nodes.emphasis(_('here'), _('here')) + newnode['refdocname'] = todo_info['docname'] + newnode['refuri'] = app.builder.get_relative_uri( + fromdocname, todo_info['docname']) + newnode['refuri'] += '#' + todo_info['target']['refid'] + newnode.append(innernode) + para += newnode + para += nodes.Text('.)', '.)') + + # Insert into the todolist + content.append(todo_info['todo']) + content.append(para) + + node.replace_self(content) + + +def purge_todos(app, env, docname): + if not hasattr(env, 'todo_all_todos'): + return + env.todo_all_todos = [todo for todo in env.todo_all_todos + if todo['docname'] != docname] + + +def visit_todo_node(self, node): + self.visit_admonition(node) + +def depart_todo_node(self, node): + self.depart_admonition(node) + +def setup(app): + app.add_config_value('todo_include_todos', False, False) + + app.add_node(todolist) + app.add_node(todo_node, + html=(visit_todo_node, depart_todo_node), + latex=(visit_todo_node, depart_todo_node), + text=(visit_todo_node, depart_todo_node)) + + app.add_directive('todo', todo_directive, 1, (0, 0, 1)) + app.add_directive('todolist', todolist_directive, 0, (0, 0, 0)) + app.connect('doctree-resolved', process_todo_nodes) + app.connect('env-purge-doc', purge_todos) + Modified: doctools/trunk/sphinx/htmlhelp.py ============================================================================== --- doctools/trunk/sphinx/htmlhelp.py (original) +++ doctools/trunk/sphinx/htmlhelp.py Fri Dec 5 20:10:41 2008 @@ -55,6 +55,7 @@ project_template = '''\ [OPTIONS] Binary TOC=Yes +Binary Index=No Compiled file=%(outname)s.chm Contents file=%(outname)s.hhc Default Window=%(outname)s @@ -191,12 +192,21 @@ try: f.write('
    \n') def write_index(title, refs, subitems): - if refs: - f.write('
  • ') - item = object_sitemap % (cgi.escape(title), refs[0]) + def write_param(name, value): + item = ' \n' % (name, value) f.write(item.encode('ascii', 'xmlcharrefreplace')) - for ref in refs[1:]: - f.write(object_sitemap % ('[Link]', ref)) + title = cgi.escape(title) + f.write('
  • \n') + write_param('Keyword', title) + if len(refs) == 0: + write_param('See Also', title) + elif len(refs) == 1: + write_param('Local', refs[0]) + else: + for i, ref in enumerate(refs): + write_param('Name', '[%d] %s' % (i, ref)) # XXX: better title? + write_param('Local', ref) + f.write('\n') if subitems: f.write('
      ') for subitem in subitems: Modified: doctools/trunk/sphinx/htmlwriter.py ============================================================================== --- doctools/trunk/sphinx/htmlwriter.py (original) +++ doctools/trunk/sphinx/htmlwriter.py Fri Dec 5 20:10:41 2008 @@ -194,11 +194,8 @@ if node.has_key('linenos'): linenos = node['linenos'] highlighted = self.highlighter.highlight_block(node.rawsource, lang, linenos) - starttag = self.starttag(node, 'div', suffix='') - if starttag != '
      ': - self.body.append(starttag + highlighted + '
      \n') - else: - self.body.append(highlighted) + starttag = self.starttag(node, 'div', suffix='', CLASS='highlight-%s' % lang) + self.body.append(starttag + highlighted + '\n') raise nodes.SkipNode def visit_doctest_block(self, node): Modified: doctools/trunk/sphinx/latexwriter.py ============================================================================== --- doctools/trunk/sphinx/latexwriter.py (original) +++ doctools/trunk/sphinx/latexwriter.py Fri Dec 5 20:10:41 2008 @@ -15,7 +15,6 @@ import re import sys from os import path -from time import strftime from docutils import nodes, writers from docutils.writers.latex2e import Babel @@ -23,6 +22,7 @@ from sphinx import addnodes from sphinx import highlighting from sphinx.locale import admonitionlabels, versionlabels +from sphinx.util import ustrftime from sphinx.util.texescape import tex_escape_map from sphinx.util.smartypants import educateQuotesLatex @@ -90,10 +90,14 @@ class ExtBabel(Babel): def get_shorthandoff(self): - if self.language == 'de': + shortlang = self.language.split('_')[0] + if shortlang in ('de', 'sl', 'pt', 'es', 'nl', 'pl'): return '\\shorthandoff{"}' return '' + _ISO639_TO_BABEL = Babel._ISO639_TO_BABEL.copy() + _ISO639_TO_BABEL['sl'] = 'slovene' + class Table(object): def __init__(self): @@ -102,6 +106,7 @@ self.colspec = None self.had_head = False self.has_verbatim = False + self.caption = None class Desc(object): @@ -161,7 +166,7 @@ 'pointsize': builder.config.latex_font_size, # if empty, the title is set to the first section title 'title': document.settings.title, - 'date': strftime(builder.config.today_fmt or _('%B %d, %Y')), + 'date': ustrftime(builder.config.today_fmt or _('%B %d, %Y')), 'release': builder.config.release, 'author': document.settings.author, 'releasename': _('Release'), @@ -174,7 +179,12 @@ path.basename(builder.config.latex_logo) if builder.config.language: babel = ExtBabel(builder.config.language) - self.elements['classoptions'] += ',' + babel.get_language() + lang = babel.get_language() + if lang: + self.elements['classoptions'] += ',' + babel.get_language() + else: + self.builder.warn('no Babel option known for language %r' % + builder.config.language) self.elements['shorthandoff'] = babel.get_shorthandoff() self.elements['fncychap'] = '\\usepackage[Sonny]{fncychap}' else: @@ -211,6 +221,7 @@ self.first_document = 1 self.this_is_the_title = 1 self.literal_whitespace = 0 + self.no_contractions = 0 def astext(self): return (HEADER % self.elements + self.highlighter.get_stylesheet() + @@ -330,7 +341,8 @@ pass def visit_title(self, node): - if isinstance(node.parent, addnodes.seealso): + parent = node.parent + if isinstance(parent, addnodes.seealso): # the environment already handles this raise nodes.SkipNode elif self.this_is_the_title: @@ -342,17 +354,28 @@ self.elements['title'] = node.astext().translate(tex_escape_map) self.this_is_the_title = 0 raise nodes.SkipNode - elif isinstance(node.parent, nodes.section): - self.body.append(r'\%s{' % self.sectionnames[self.sectionlevel]) + elif isinstance(parent, nodes.section): + try: + self.body.append(r'\%s{' % self.sectionnames[self.sectionlevel]) + except IndexError: + from sphinx.application import SphinxError + raise SphinxError('too many nesting section levels for LaTeX, ' + 'at heading: %s' % node.astext()) self.context.append('}\n') - elif isinstance(node.parent, (nodes.topic, nodes.sidebar, nodes.admonition)): + elif isinstance(parent, (nodes.topic, nodes.sidebar)): self.body.append(r'\textbf{') self.context.append('}\n\n\medskip\n\n') + elif isinstance(parent, nodes.Admonition): + self.body.append('{') + self.context.append('}\n') + elif isinstance(parent, nodes.table): + self.table.caption = self.encode(node.astext()) + raise nodes.SkipNode else: - self.builder.warn('encountered title node not in section, topic, admonition' - ' or sidebar') + self.builder.warn('encountered title node not in section, topic, ' + 'table, admonition or sidebar') self.body.append('\\textbf{') - self.context.append('}') + self.context.append('}\n') self.in_title = 1 def depart_title(self, node): self.in_title = 0 @@ -492,7 +515,7 @@ self.body.append("}\\\\") def visit_desc_content(self, node): - if node.children and isinstance(node.children[0], addnodes.desc): + if node.children and not isinstance(node.children[0], nodes.paragraph): # avoid empty desc environment which causes a formatting bug self.body.append('~') def depart_desc_content(self, node): @@ -535,6 +558,9 @@ self.body = self.tablebody def depart_table(self, node): self.body = self._body + if self.table.caption is not None: + self.body.append('\n\\begin{threeparttable}\n' + '\\caption{%s}\n' % self.table.caption) if self.table.has_verbatim: self.body.append('\n\\begin{tabular}') else: @@ -553,6 +579,8 @@ self.body.append('\\end{tabular}\n\n') else: self.body.append('\\end{tabulary}\n\n') + if self.table.caption is not None: + self.body.append('\\end{threeparttable}\n\n') self.table = None self.tablebody = None @@ -698,9 +726,9 @@ return width_str res = width_str amount, unit = match.groups()[:2] - if unit == "px": - # LaTeX does not know pixels but points - res = "%spt" % amount + if not unit or unit == "px": + # pixels: let LaTeX alone + return None elif unit == "%": res = "%.3f\\linewidth" % (float(amount) / 100.0) return res @@ -717,11 +745,12 @@ pre.append('\\scalebox{%f}{' % (attrs['scale'] / 100.0,)) post.append('}') if attrs.has_key('width'): - include_graphics_options.append('width=%s' % ( - self.latex_image_length(attrs['width']), )) + w = self.latex_image_length(attrs['width']) + if w: + include_graphics_options.append('width=%s' % w) if attrs.has_key('height'): - include_graphics_options.append('height=%s' % ( - self.latex_image_length(attrs['height']), )) + h = self.latex_image_length(attrs['height']) + include_graphics_options.append('height=%s' % h) if attrs.has_key('align'): align_prepost = { # By default latex aligns the top of an image. @@ -788,9 +817,9 @@ self.body.append('}') def visit_admonition(self, node): - self.body.append('\n\\begin{quote}') + self.body.append('\n\\begin{notice}{note}') def depart_admonition(self, node): - self.body.append('\\end{quote}\n') + self.body.append('\\end{notice}\n') def _make_visit_admonition(name): def visit_admonition(self, node): @@ -863,10 +892,16 @@ self.body.append(r'\index{%s}' % scre.sub('!', self.encode(string))) elif type == 'pair': parts = tuple(self.encode(x.strip()) for x in string.split(';', 1)) - self.body.append(r'\indexii{%s}{%s}' % parts) + try: + self.body.append(r'\indexii{%s}{%s}' % parts) + except TypeError: + self.builder.warn('invalid pair index entry %r' % string) elif type == 'triple': parts = tuple(self.encode(x.strip()) for x in string.split(';', 2)) - self.body.append(r'\indexiii{%s}{%s}{%s}' % parts) + try: + self.body.append(r'\indexiii{%s}{%s}{%s}' % parts) + except TypeError: + self.builder.warn('invalid triple index entry %r' % string) else: self.builder.warn('unknown index entry type %s found' % type) raise nodes.SkipNode @@ -911,8 +946,10 @@ def visit_literal_emphasis(self, node): self.body.append(r'\emph{\texttt{') + self.no_contractions += 1 def depart_literal_emphasis(self, node): self.body.append('}}') + self.no_contractions -= 1 def visit_strong(self, node): self.body.append(r'\textbf{') @@ -1010,7 +1047,10 @@ # no output in this line -- add a nonbreaking space, else the # \\ command will give an error self.body.append('~') - self.body.append('\\\\\n') + if self.table is not None: + self.body.append('\\newline\n') + else: + self.body.append('\\\\\n') def visit_block_quote(self, node): # If the block quote contains a single object and that object @@ -1070,7 +1110,7 @@ def visit_option_string(self, node): ostring = node.astext() - self.body.append(self.encode(ostring.replace('--', u'-?-'))) + self.body.append(self.encode(ostring.replace('--', u'-{-}'))) raise nodes.SkipNode def visit_description(self, node): @@ -1122,6 +1162,8 @@ # Insert a blank before the newline, to avoid # ! LaTeX Error: There's no line here to end. text = text.replace(u'\n', u'~\\\\\n').replace(u' ', u'~') + if self.no_contractions: + text = text.replace('--', u'-{-}') return text def visit_Text(self, node): Modified: doctools/trunk/sphinx/linkcheck.py ============================================================================== --- doctools/trunk/sphinx/linkcheck.py (original) +++ doctools/trunk/sphinx/linkcheck.py Fri Dec 5 20:10:41 2008 @@ -84,20 +84,25 @@ self.good.add(uri) elif r == 2: self.info(' - ' + red('broken: ') + s) - self.broken[uri] = (r, s) self.write_entry('broken', docname, lineno, uri + ': ' + s) + self.broken[uri] = (r, s) + if self.app.quiet: + self.warn('%s:%s: broken link: %s' % (docname, lineno, uri)) else: self.info(' - ' + purple('redirected') + ' to ' + s) - self.redirected[uri] = (r, s) self.write_entry('redirected', docname, lineno, uri + ' to ' + s) - + self.redirected[uri] = (r, s) elif len(uri) == 0 or uri[0:7] == 'mailto:' or uri[0:4] == 'ftp:': return else: - self.info(uri + ' - ' + red('malformed!')) + self.warn(uri + ' - ' + red('malformed!')) self.write_entry('malformed', docname, lineno, uri) + if self.app.quiet: + self.warn('%s:%s: malformed link: %s' % (docname, lineno, uri)) + self.app.statuscode = 1 - return + if self.broken: + self.app.statuscode = 1 def write_entry(self, what, docname, line, uri): output = open(path.join(self.outdir, 'output.txt'), 'a') Modified: doctools/trunk/sphinx/locale/cs/LC_MESSAGES/sphinx.js ============================================================================== --- doctools/trunk/sphinx/locale/cs/LC_MESSAGES/sphinx.js (original) +++ doctools/trunk/sphinx/locale/cs/LC_MESSAGES/sphinx.js Fri Dec 5 20:10:41 2008 @@ -1 +1 @@ -Documentation.addTranslations({"locale": "cs", "plural_expr": "(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2)", "messages": {"Search Results": "V\u00fdsledky hled\u00e1n\u00ed", "Your search did not match any documents. Please make sure that all words are spelled correctly and that you've selected enough categories.": "", "Getting search index...": "", "Permalink to this headline": "Trval\u00fd odkaz na tento nadpis", "Searching": "hledej", "Permalink to this definition": "Trval\u00fd odkaz na tuto definici", "Hide Search Matches": "", "Search finished, found %s page(s) matching the search query.": ""}}); \ No newline at end of file +Documentation.addTranslations({"locale": "cs", "plural_expr": "(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2)", "messages": {"module, in ": "modul", "Preparing search...": "", "Your search did not match any documents. Please make sure that all words are spelled correctly and that you've selected enough categories.": "", "Search finished, found %s page(s) matching the search query.": "", ", in ": "", "Permalink to this headline": "Trval\u00fd odkaz na tento nadpis", "Searching": "hledej", "Permalink to this definition": "Trval\u00fd odkaz na tuto definici", "Hide Search Matches": "", "Search Results": "V\u00fdsledky hled\u00e1n\u00ed"}}); \ No newline at end of file Modified: doctools/trunk/sphinx/locale/cs/LC_MESSAGES/sphinx.mo ============================================================================== Binary files doctools/trunk/sphinx/locale/cs/LC_MESSAGES/sphinx.mo (original) and doctools/trunk/sphinx/locale/cs/LC_MESSAGES/sphinx.mo Fri Dec 5 20:10:41 2008 differ Modified: doctools/trunk/sphinx/locale/cs/LC_MESSAGES/sphinx.po ============================================================================== --- doctools/trunk/sphinx/locale/cs/LC_MESSAGES/sphinx.po (original) +++ doctools/trunk/sphinx/locale/cs/LC_MESSAGES/sphinx.po Fri Dec 5 20:10:41 2008 @@ -8,7 +8,7 @@ "Project-Id-Version: Sphinx 0.5\n" "Report-Msgid-Bugs-To: EMAIL at ADDRESS\n" "POT-Creation-Date: 2008-08-10 11:43+0000\n" -"PO-Revision-Date: 2008-09-06 19:10+0200\n" +"PO-Revision-Date: 2008-11-27 18:40+0100\n" "Last-Translator: Pavel Kosina \n" "Language-Team: Pavel Kosina \n" "Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && " @@ -16,225 +16,255 @@ "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=utf-8\n" "Content-Transfer-Encoding: 8bit\n" -"Generated-By: Babel 0.9.3\n" +"Generated-By: Babel 0.9.4\n" -#: sphinx/builder.py:391 +#: sphinx/builder.py:408 #, python-format msgid "%b %d, %Y" msgstr "%d.%m.%Y" -#: sphinx/builder.py:410 sphinx/templates/defindex.html:21 +#: sphinx/builder.py:427 sphinx/templates/defindex.html:21 msgid "General Index" msgstr "Rejst??k index?" -#: sphinx/builder.py:410 +#: sphinx/builder.py:427 msgid "index" msgstr "index" -#: sphinx/builder.py:412 sphinx/htmlhelp.py:155 +#: sphinx/builder.py:429 sphinx/htmlhelp.py:156 #: sphinx/templates/defindex.html:19 sphinx/templates/modindex.html:2 #: sphinx/templates/modindex.html:13 msgid "Global Module Index" msgstr "Rejst??k modul?" -#: sphinx/builder.py:412 +#: sphinx/builder.py:429 msgid "modules" msgstr "moduly" -#: sphinx/builder.py:448 +#: sphinx/builder.py:466 msgid "next" msgstr "dal??" -#: sphinx/builder.py:455 +#: sphinx/builder.py:473 msgid "previous" msgstr "p?edchoz?" -#: sphinx/builder.py:1092 +#: sphinx/builder.py:1054 +msgid " (in " +msgstr "" + +#: sphinx/builder.py:1129 msgid "Builtins" msgstr "Vestav?n? funkce" -#: sphinx/builder.py:1094 +#: sphinx/builder.py:1131 msgid "Module level" msgstr "?rove? modul?" -#: sphinx/environment.py:108 sphinx/latexwriter.py:129 +#: sphinx/environment.py:102 sphinx/latexwriter.py:169 #, python-format msgid "%B %d, %Y" msgstr "%d.%m.%Y" -#: sphinx/htmlwriter.py:73 sphinx/static/doctools.js:143 +#: sphinx/environment.py:291 sphinx/latexwriter.py:175 +#: sphinx/templates/genindex-single.html:2 +#: sphinx/templates/genindex-split.html:2 +#: sphinx/templates/genindex-split.html:5 sphinx/templates/genindex.html:2 +#: sphinx/templates/genindex.html:5 sphinx/templates/genindex.html:48 +#: sphinx/templates/layout.html:130 +msgid "Index" +msgstr "Index" + +#: sphinx/environment.py:292 sphinx/latexwriter.py:174 +#, fuzzy +msgid "Module Index" +msgstr "Rejst??k modul?" + +#: sphinx/environment.py:293 sphinx/templates/defindex.html:16 +#, fuzzy +msgid "Search Page" +msgstr "Vyhled?vac? str?nka" + +#: sphinx/htmlwriter.py:79 sphinx/static/doctools.js:145 msgid "Permalink to this definition" msgstr "Trval? odkaz na tuto definici" -#: sphinx/htmlwriter.py:379 sphinx/static/doctools.js:136 +#: sphinx/htmlwriter.py:399 sphinx/static/doctools.js:139 msgid "Permalink to this headline" msgstr "Trval? odkaz na tento nadpis" -#: sphinx/latexwriter.py:143 +#: sphinx/latexwriter.py:172 msgid "Release" msgstr "Vyd?n?" -#: sphinx/latexwriter.py:188 -msgid "Module index" -msgstr "Rejst??k modul?" - -#: sphinx/latexwriter.py:190 sphinx/templates/genindex-single.html:2 -#: sphinx/templates/genindex-split.html:2 -#: sphinx/templates/genindex-split.html:5 sphinx/templates/genindex.html:2 -#: sphinx/templates/genindex.html:5 sphinx/templates/genindex.html:48 -msgid "Index" -msgstr "Index" - -#: sphinx/roles.py:52 sphinx/directives/desc.py:514 +#: sphinx/roles.py:53 sphinx/directives/desc.py:537 #, python-format msgid "environment variable; %s" msgstr "promm?n? prost?ed?, %s" -#: sphinx/roles.py:59 +#: sphinx/roles.py:60 #, python-format msgid "Python Enhancement Proposals!PEP %s" msgstr "Python Enhancement Proposals!PEP %s" -#: sphinx/textwriter.py:151 +#: sphinx/textwriter.py:166 #, python-format msgid "Platform: %s" msgstr "Platforma: %s" -#: sphinx/textwriter.py:353 +#: sphinx/textwriter.py:422 msgid "[image]" msgstr "[obr?zek]" -#: sphinx/directives/desc.py:26 +#: sphinx/directives/desc.py:25 #, python-format msgid "%s() (built-in function)" msgstr "%s() (vestav?n? funkce)" -#: sphinx/directives/desc.py:27 sphinx/directives/desc.py:41 -#: sphinx/directives/desc.py:53 +#: sphinx/directives/desc.py:26 sphinx/directives/desc.py:42 +#: sphinx/directives/desc.py:54 #, python-format msgid "%s() (in module %s)" msgstr "%s() (v modulu %s)" -#: sphinx/directives/desc.py:30 +#: sphinx/directives/desc.py:29 #, python-format msgid "%s (built-in variable)" msgstr "%s() (vestav?n? prom?nn?)" -#: sphinx/directives/desc.py:31 sphinx/directives/desc.py:65 +#: sphinx/directives/desc.py:30 sphinx/directives/desc.py:66 #, python-format msgid "%s (in module %s)" msgstr "%s() (v modulu %s)" #: sphinx/directives/desc.py:33 +#, fuzzy, python-format +msgid "%s (built-in class)" +msgstr "%s() (vestav?n? prom?nn?)" + +#: sphinx/directives/desc.py:34 #, python-format msgid "%s (class in %s)" msgstr "%s() (t??da v %s)" -#: sphinx/directives/desc.py:45 +#: sphinx/directives/desc.py:46 #, python-format msgid "%s() (%s.%s method)" msgstr "%s() (metoda %s.%s)" -#: sphinx/directives/desc.py:47 +#: sphinx/directives/desc.py:48 #, python-format msgid "%s() (%s method)" msgstr "%s() (metoda %s)" -#: sphinx/directives/desc.py:57 +#: sphinx/directives/desc.py:58 #, python-format msgid "%s() (%s.%s static method)" msgstr "%s() (statick? metoda %s.%s)" -#: sphinx/directives/desc.py:59 +#: sphinx/directives/desc.py:60 #, python-format msgid "%s() (%s static method)" msgstr "%s() (statick? metoda %s)" -#: sphinx/directives/desc.py:69 +#: sphinx/directives/desc.py:70 #, python-format msgid "%s (%s.%s attribute)" msgstr "%s() (atribut %s.%s)" -#: sphinx/directives/desc.py:71 +#: sphinx/directives/desc.py:72 #, python-format msgid "%s (%s attribute)" msgstr "%s() (atribut %s)" -#: sphinx/directives/desc.py:73 +#: sphinx/directives/desc.py:74 #, python-format msgid "%s (C function)" msgstr "%s (C funkce)" -#: sphinx/directives/desc.py:75 +#: sphinx/directives/desc.py:76 #, python-format msgid "%s (C member)" msgstr "%s (?len C)" -#: sphinx/directives/desc.py:77 +#: sphinx/directives/desc.py:78 #, python-format msgid "%s (C macro)" msgstr "%s (C makro)" -#: sphinx/directives/desc.py:79 +#: sphinx/directives/desc.py:80 #, python-format msgid "%s (C type)" msgstr "%s (C typ)" -#: sphinx/directives/desc.py:81 +#: sphinx/directives/desc.py:82 #, python-format msgid "%s (C variable)" msgstr "%s (C prom?nn?)" -#: sphinx/directives/desc.py:99 +#: sphinx/directives/desc.py:100 msgid "Raises" msgstr "Vyvol?" -#: sphinx/directives/desc.py:103 +#: sphinx/directives/desc.py:104 msgid "Variable" msgstr "Prom?nn?" -#: sphinx/directives/desc.py:106 +#: sphinx/directives/desc.py:107 msgid "Returns" msgstr "Vrac?" -#: sphinx/directives/desc.py:113 +#: sphinx/directives/desc.py:116 msgid "Return type" msgstr "Typ navr?cen? hodnoty" -#: sphinx/directives/desc.py:140 +#: sphinx/directives/desc.py:143 msgid "Parameters" msgstr "Parametry" -#: sphinx/directives/desc.py:402 -#, python-format -msgid "command line option; %s" -msgstr "parametry p??kazov?ho ??dku; %s" +#: sphinx/directives/desc.py:423 +#, fuzzy, python-format +msgid "%scommand line option; %s" +msgstr "%sparametry p??kazov?ho ??dku; %s" -#: sphinx/directives/other.py:102 +#: sphinx/directives/other.py:101 msgid "Platforms: " msgstr "Platformy: " -#: sphinx/directives/other.py:107 +#: sphinx/directives/other.py:106 #, python-format msgid "%s (module)" msgstr "%s (module)" -#: sphinx/directives/other.py:147 +#: sphinx/directives/other.py:146 msgid "Section author: " msgstr "Autor sekce: " -#: sphinx/directives/other.py:149 +#: sphinx/directives/other.py:148 msgid "Module author: " msgstr "Autor modulu: " -#: sphinx/directives/other.py:151 +#: sphinx/directives/other.py:150 msgid "Author: " msgstr "Autor: " -#: sphinx/directives/other.py:233 +#: sphinx/directives/other.py:246 msgid "See also" msgstr "Viz tak?" +#: sphinx/ext/todo.py:31 +msgid "Todo" +msgstr "" + +#: sphinx/ext/todo.py:75 +#, python-format +msgid "(The original entry is located in %s, line %d and can be found " +msgstr "" + +#: sphinx/ext/todo.py:81 +msgid "here" +msgstr "" + #: sphinx/locale/__init__.py:15 msgid "Attention" msgstr "V?straha" @@ -318,30 +348,39 @@ msgid "built-in function" msgstr "vestav?n? funkce" -#: sphinx/static/doctools.js:172 +#: sphinx/static/doctools.js:174 msgid "Hide Search Matches" msgstr "" -#: sphinx/static/searchtools.js:242 +#: sphinx/static/searchtools.js:274 #, fuzzy msgid "Searching" msgstr "hledej" -#: sphinx/static/searchtools.js:246 -msgid "Getting search index..." +#: sphinx/static/searchtools.js:279 +msgid "Preparing search..." +msgstr "" + +#: sphinx/static/searchtools.js:338 +#, fuzzy +msgid "module, in " +msgstr "modul" + +#: sphinx/static/searchtools.js:347 +msgid ", in " msgstr "" -#: sphinx/static/searchtools.js:384 sphinx/templates/search.html:18 +#: sphinx/static/searchtools.js:447 sphinx/templates/search.html:18 msgid "Search Results" msgstr "V?sledky hled?n?" -#: sphinx/static/searchtools.js:386 +#: sphinx/static/searchtools.js:449 msgid "" "Your search did not match any documents. Please make sure that all words " "are spelled correctly and that you've selected enough categories." msgstr "" -#: sphinx/static/searchtools.js:389 +#: sphinx/static/searchtools.js:451 #, python-format msgid "Search finished, found %s page(s) matching the search query." msgstr "" @@ -362,10 +401,6 @@ msgid "lists all sections and subsections" msgstr "seznam v?ech sekc? a podsekc?" -#: sphinx/templates/defindex.html:16 -msgid "Search page" -msgstr "Vyhled?vac? str?nka" - #: sphinx/templates/defindex.html:17 msgid "search this documentation" msgstr "prohledej tuto dokumentaci" @@ -449,23 +484,15 @@ msgid "Enter a module, class or function name." msgstr "Zadej jm?no modulu, t??dy nebo funkce." -#: sphinx/templates/layout.html:118 +#: sphinx/templates/layout.html:119 #, python-format msgid "Search within %(docstitle)s" msgstr "Hled?n? uvnit? %(docstitle)s" -#: sphinx/templates/layout.html:127 +#: sphinx/templates/layout.html:128 msgid "About these documents" msgstr "O t?chto dokumentech" -#: sphinx/templates/layout.html:129 -msgid "Global table of contents" -msgstr "Celkov? obsah" - -#: sphinx/templates/layout.html:130 -msgid "Global index" -msgstr "Celkov? index" - #: sphinx/templates/layout.html:131 sphinx/templates/search.html:2 #: sphinx/templates/search.html:5 msgid "Search" @@ -527,11 +554,12 @@ "nepovedlo se." #: sphinx/templates/search.html:7 +#, fuzzy msgid "" "From here you can search these documents. Enter your search\n" " words into the box below and click \"search\". Note that the search\n" " function will automatically search for all of the words. Pages\n" -" containing less words won't appear in the result list." +" containing fewer words won't appear in the result list." msgstr "" "Toto je vyhled?vac? str?nka. Zadejte kl??ov? slova do pole n??e a " "klikn?te na \"hledej\". \n" Modified: doctools/trunk/sphinx/locale/de/LC_MESSAGES/sphinx.js ============================================================================== --- doctools/trunk/sphinx/locale/de/LC_MESSAGES/sphinx.js (original) +++ doctools/trunk/sphinx/locale/de/LC_MESSAGES/sphinx.js Fri Dec 5 20:10:41 2008 @@ -1 +1 @@ -Documentation.addTranslations({"locale": "de", "plural_expr": "(n != 1)", "messages": {"Search Results": "Suchergebnisse", "Your search did not match any documents. Please make sure that all words are spelled correctly and that you've selected enough categories.": "Es wurden keine Dokumente gefunden. Haben Sie alle Suchworte richtig geschrieben und gen\u00fcgend Kategorien ausgew\u00e4hlt?", "Getting search index...": "Suchindex wird geladen...", "Permalink to this headline": "Permalink zu dieser \u00dcberschrift", "Searching": "Suchen...", "Permalink to this definition": "Permalink zu dieser Definition", "Hide Search Matches": "Suchergebnisse ausblenden", "Search finished, found %s page(s) matching the search query.": "Suche beendet, %s Seite(n) mit Ergebnissen wurden gefunden."}}); \ No newline at end of file +Documentation.addTranslations({"locale": "de", "plural_expr": "(n != 1)", "messages": {"module, in ": "Modul, in ", "Preparing search...": "Suche wird vorbereitet...", "Your search did not match any documents. Please make sure that all words are spelled correctly and that you've selected enough categories.": "Es wurden keine Dokumente gefunden. Haben Sie alle Suchworte richtig geschrieben und gen\u00fcgend Kategorien ausgew\u00e4hlt?", "Search finished, found %s page(s) matching the search query.": "Suche beendet, %s Seite(n) mit Ergebnissen wurden gefunden.", ", in ": "", "Permalink to this headline": "Permalink zu dieser \u00dcberschrift", "Searching": "Suchen...", "Permalink to this definition": "Permalink zu dieser Definition", "Hide Search Matches": "Suchergebnisse ausblenden", "Search Results": "Suchergebnisse"}}); \ No newline at end of file Modified: doctools/trunk/sphinx/locale/de/LC_MESSAGES/sphinx.mo ============================================================================== Binary files. No diff available. Modified: doctools/trunk/sphinx/locale/de/LC_MESSAGES/sphinx.po ============================================================================== --- doctools/trunk/sphinx/locale/de/LC_MESSAGES/sphinx.po (original) +++ doctools/trunk/sphinx/locale/de/LC_MESSAGES/sphinx.po Fri Dec 5 20:10:41 2008 @@ -7,232 +7,260 @@ "Project-Id-Version: PROJECT VERSION\n" "Report-Msgid-Bugs-To: EMAIL at ADDRESS\n" "POT-Creation-Date: 2008-08-07 21:40+0200\n" -"PO-Revision-Date: 2008-09-06 19:13+0200\n" +"PO-Revision-Date: 2008-11-27 18:40+0100\n" "Last-Translator: Horst Gutmann \n" "Language-Team: de \n" "Plural-Forms: nplurals=2; plural=(n != 1)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=utf-8\n" "Content-Transfer-Encoding: 8bit\n" -"Generated-By: Babel 0.9.3\n" +"Generated-By: Babel 0.9.4\n" -#: sphinx/builder.py:391 +#: sphinx/builder.py:408 #, python-format msgid "%b %d, %Y" msgstr "%d. %m. %Y" -#: sphinx/builder.py:410 sphinx/templates/defindex.html:21 +#: sphinx/builder.py:427 sphinx/templates/defindex.html:21 msgid "General Index" msgstr "Allgemeiner Index" -#: sphinx/builder.py:410 +#: sphinx/builder.py:427 msgid "index" msgstr "Index" -#: sphinx/builder.py:412 sphinx/htmlhelp.py:155 +#: sphinx/builder.py:429 sphinx/htmlhelp.py:156 #: sphinx/templates/defindex.html:19 sphinx/templates/modindex.html:2 #: sphinx/templates/modindex.html:13 msgid "Global Module Index" msgstr "Globaler Modulindex" -#: sphinx/builder.py:412 +#: sphinx/builder.py:429 msgid "modules" msgstr "Module" -#: sphinx/builder.py:448 +#: sphinx/builder.py:466 msgid "next" msgstr "weiter" -#: sphinx/builder.py:455 +#: sphinx/builder.py:473 msgid "previous" msgstr "zur?ck" -#: sphinx/builder.py:1092 +#: sphinx/builder.py:1054 +msgid " (in " +msgstr "" + +#: sphinx/builder.py:1129 msgid "Builtins" msgstr "Builtins" -#: sphinx/builder.py:1094 +#: sphinx/builder.py:1131 msgid "Module level" msgstr "Modulebene" -#: sphinx/environment.py:108 sphinx/latexwriter.py:129 +#: sphinx/environment.py:102 sphinx/latexwriter.py:169 #, python-format msgid "%B %d, %Y" msgstr "%d. %m. %Y" -#: sphinx/htmlwriter.py:73 sphinx/static/doctools.js:143 +#: sphinx/environment.py:291 sphinx/latexwriter.py:175 +#: sphinx/templates/genindex-single.html:2 +#: sphinx/templates/genindex-split.html:2 +#: sphinx/templates/genindex-split.html:5 sphinx/templates/genindex.html:2 +#: sphinx/templates/genindex.html:5 sphinx/templates/genindex.html:48 +#: sphinx/templates/layout.html:130 +msgid "Index" +msgstr "Stichwortverzeichnis" + +#: sphinx/environment.py:292 sphinx/latexwriter.py:174 +msgid "Module Index" +msgstr "Modulindex" + +#: sphinx/environment.py:293 sphinx/templates/defindex.html:16 +msgid "Search Page" +msgstr "Suche" + +#: sphinx/htmlwriter.py:79 sphinx/static/doctools.js:145 msgid "Permalink to this definition" msgstr "Permalink zu dieser Definition" -#: sphinx/htmlwriter.py:379 sphinx/static/doctools.js:136 +#: sphinx/htmlwriter.py:399 sphinx/static/doctools.js:139 msgid "Permalink to this headline" msgstr "Permalink zu dieser ?berschrift" -#: sphinx/latexwriter.py:143 +#: sphinx/latexwriter.py:172 msgid "Release" msgstr "Release" -#: sphinx/latexwriter.py:188 -msgid "Module index" -msgstr "Modulindex" - -#: sphinx/latexwriter.py:190 sphinx/templates/genindex-single.html:2 -#: sphinx/templates/genindex-split.html:2 -#: sphinx/templates/genindex-split.html:5 sphinx/templates/genindex.html:2 -#: sphinx/templates/genindex.html:5 sphinx/templates/genindex.html:48 -msgid "Index" -msgstr "Stichwortverzeichnis" - -#: sphinx/roles.py:52 sphinx/directives/desc.py:514 +#: sphinx/roles.py:53 sphinx/directives/desc.py:537 #, python-format msgid "environment variable; %s" msgstr "Umgebungsvariable; %s" -#: sphinx/roles.py:59 +#: sphinx/roles.py:60 #, python-format msgid "Python Enhancement Proposals!PEP %s" msgstr "Python Enhancement Proposals!PEP %s" -#: sphinx/textwriter.py:151 +#: sphinx/textwriter.py:166 #, python-format msgid "Platform: %s" msgstr "Plattform: %s" -#: sphinx/textwriter.py:353 +#: sphinx/textwriter.py:422 msgid "[image]" msgstr "[Bild]" -#: sphinx/directives/desc.py:26 +#: sphinx/directives/desc.py:25 #, python-format msgid "%s() (built-in function)" msgstr "%s() (eingebaute Funktion)" -#: sphinx/directives/desc.py:27 sphinx/directives/desc.py:41 -#: sphinx/directives/desc.py:53 +#: sphinx/directives/desc.py:26 sphinx/directives/desc.py:42 +#: sphinx/directives/desc.py:54 #, python-format msgid "%s() (in module %s)" msgstr "%s() (in Modul %s)" -#: sphinx/directives/desc.py:30 +#: sphinx/directives/desc.py:29 #, python-format msgid "%s (built-in variable)" msgstr "%s (eingebaute Variable)" -#: sphinx/directives/desc.py:31 sphinx/directives/desc.py:65 +#: sphinx/directives/desc.py:30 sphinx/directives/desc.py:66 #, python-format msgid "%s (in module %s)" msgstr "%s (in Modul %s)" #: sphinx/directives/desc.py:33 #, python-format +msgid "%s (built-in class)" +msgstr "%s (eingebaute Klasse)" + +#: sphinx/directives/desc.py:34 +#, python-format msgid "%s (class in %s)" msgstr "%s (Klasse in %s)" -#: sphinx/directives/desc.py:45 +#: sphinx/directives/desc.py:46 #, python-format msgid "%s() (%s.%s method)" msgstr "%s() (Methode von %s.%s)" -#: sphinx/directives/desc.py:47 +#: sphinx/directives/desc.py:48 #, python-format msgid "%s() (%s method)" msgstr "%s() (Methode von %s)" -#: sphinx/directives/desc.py:57 +#: sphinx/directives/desc.py:58 #, python-format msgid "%s() (%s.%s static method)" msgstr "%s() (statische Methode von %s.%s)" -#: sphinx/directives/desc.py:59 +#: sphinx/directives/desc.py:60 #, python-format msgid "%s() (%s static method)" msgstr "%s() (statische Methode von %s)" -#: sphinx/directives/desc.py:69 +#: sphinx/directives/desc.py:70 #, python-format msgid "%s (%s.%s attribute)" msgstr "%s (Attribut von %s.%s)" -#: sphinx/directives/desc.py:71 +#: sphinx/directives/desc.py:72 #, python-format msgid "%s (%s attribute)" msgstr "%s (Attribut von %s)" -#: sphinx/directives/desc.py:73 +#: sphinx/directives/desc.py:74 #, python-format msgid "%s (C function)" msgstr "%s (C-Funktion)" -#: sphinx/directives/desc.py:75 +#: sphinx/directives/desc.py:76 #, python-format msgid "%s (C member)" msgstr "%s (C-Member)" -#: sphinx/directives/desc.py:77 +#: sphinx/directives/desc.py:78 #, python-format msgid "%s (C macro)" msgstr "%s (C-Makro)" -#: sphinx/directives/desc.py:79 +#: sphinx/directives/desc.py:80 #, python-format msgid "%s (C type)" msgstr "%s (C-Typ)" -#: sphinx/directives/desc.py:81 +#: sphinx/directives/desc.py:82 #, python-format msgid "%s (C variable)" msgstr "%s (C-Variable)" -#: sphinx/directives/desc.py:99 +#: sphinx/directives/desc.py:100 msgid "Raises" msgstr "Verursacht:" -#: sphinx/directives/desc.py:103 +#: sphinx/directives/desc.py:104 msgid "Variable" msgstr "Variable" -#: sphinx/directives/desc.py:106 +#: sphinx/directives/desc.py:107 msgid "Returns" msgstr "R?ckgabe" -#: sphinx/directives/desc.py:113 +#: sphinx/directives/desc.py:116 msgid "Return type" msgstr "R?ckgabetyp" -#: sphinx/directives/desc.py:140 +#: sphinx/directives/desc.py:143 msgid "Parameters" msgstr "Parameter" -#: sphinx/directives/desc.py:402 +#: sphinx/directives/desc.py:423 #, python-format -msgid "command line option; %s" -msgstr "Kommandozeilenoption; %s" +msgid "%scommand line option; %s" +msgstr "%sKommandozeilenoption; %s" -#: sphinx/directives/other.py:102 +#: sphinx/directives/other.py:101 msgid "Platforms: " msgstr "Plattformen: " -#: sphinx/directives/other.py:107 +#: sphinx/directives/other.py:106 #, python-format msgid "%s (module)" msgstr "%s (Modul)" -#: sphinx/directives/other.py:147 +#: sphinx/directives/other.py:146 msgid "Section author: " msgstr "Autor des Abschnitts: " -#: sphinx/directives/other.py:149 +#: sphinx/directives/other.py:148 msgid "Module author: " msgstr "Autor des Moduls: " -#: sphinx/directives/other.py:151 +#: sphinx/directives/other.py:150 msgid "Author: " msgstr "Autor: " -#: sphinx/directives/other.py:233 +#: sphinx/directives/other.py:246 msgid "See also" msgstr "Siehe auch" +#: sphinx/ext/todo.py:31 +msgid "Todo" +msgstr "" + +#: sphinx/ext/todo.py:75 +#, python-format +msgid "(The original entry is located in %s, line %d and can be found " +msgstr "" + +#: sphinx/ext/todo.py:81 +msgid "here" +msgstr "" + #: sphinx/locale/__init__.py:15 msgid "Attention" msgstr "Achtung" @@ -316,30 +344,39 @@ msgid "built-in function" msgstr "eingebaute Funktion" -#: sphinx/static/doctools.js:172 +#: sphinx/static/doctools.js:174 msgid "Hide Search Matches" msgstr "Suchergebnisse ausblenden" -#: sphinx/static/searchtools.js:242 -#, fuzzy +#: sphinx/static/searchtools.js:274 msgid "Searching" msgstr "Suchen..." -#: sphinx/static/searchtools.js:246 -msgid "Getting search index..." -msgstr "Suchindex wird geladen..." +#: sphinx/static/searchtools.js:279 +msgid "Preparing search..." +msgstr "Suche wird vorbereitet..." + +#: sphinx/static/searchtools.js:338 +msgid "module, in " +msgstr "Modul, in " + +#: sphinx/static/searchtools.js:347 +msgid ", in " +msgstr "" -#: sphinx/static/searchtools.js:384 sphinx/templates/search.html:18 +#: sphinx/static/searchtools.js:447 sphinx/templates/search.html:18 msgid "Search Results" msgstr "Suchergebnisse" -#: sphinx/static/searchtools.js:386 +#: sphinx/static/searchtools.js:449 msgid "" "Your search did not match any documents. Please make sure that all words " "are spelled correctly and that you've selected enough categories." -msgstr "Es wurden keine Dokumente gefunden. Haben Sie alle Suchworte richtig geschrieben und gen?gend Kategorien ausgew?hlt?" +msgstr "" +"Es wurden keine Dokumente gefunden. Haben Sie alle Suchworte richtig " +"geschrieben und gen?gend Kategorien ausgew?hlt?" -#: sphinx/static/searchtools.js:389 +#: sphinx/static/searchtools.js:451 #, python-format msgid "Search finished, found %s page(s) matching the search query." msgstr "Suche beendet, %s Seite(n) mit Ergebnissen wurden gefunden." @@ -360,10 +397,6 @@ msgid "lists all sections and subsections" msgstr "Liste aller Kapitel und Unterkapitel" -#: sphinx/templates/defindex.html:16 -msgid "Search page" -msgstr "Suche" - #: sphinx/templates/defindex.html:17 msgid "search this documentation" msgstr "Durchsuche diese Dokumentation" @@ -447,23 +480,15 @@ msgid "Enter a module, class or function name." msgstr "Gib einen Modul-, Klassen- oder Funktionsnamen an." -#: sphinx/templates/layout.html:118 +#: sphinx/templates/layout.html:119 #, python-format msgid "Search within %(docstitle)s" msgstr "Suche in %(docstitle)s" -#: sphinx/templates/layout.html:127 +#: sphinx/templates/layout.html:128 msgid "About these documents" msgstr "?ber diese Dokumentation" -#: sphinx/templates/layout.html:129 -msgid "Global table of contents" -msgstr "Globales Inhaltsverzeichnis" - -#: sphinx/templates/layout.html:130 -msgid "Global index" -msgstr "Globale Stichwortverzeichnis" - #: sphinx/templates/layout.html:131 sphinx/templates/search.html:2 #: sphinx/templates/search.html:5 msgid "Search" @@ -525,11 +550,12 @@ "dieser Seite umzuleiten, aber dies muss nicht die richtige Seite sein." #: sphinx/templates/search.html:7 +#, fuzzy msgid "" "From here you can search these documents. Enter your search\n" " words into the box below and click \"search\". Note that the search\n" " function will automatically search for all of the words. Pages\n" -" containing less words won't appear in the result list." +" containing fewer words won't appear in the result list." msgstr "" "Von hier aus kannst du die Dokumentation durchsuchen. Gib deine " "Suchbegriffe in das untenstehende Feld ein und klicke auf \"suchen\". " Modified: doctools/trunk/sphinx/locale/es/LC_MESSAGES/sphinx.js ============================================================================== --- doctools/trunk/sphinx/locale/es/LC_MESSAGES/sphinx.js (original) +++ doctools/trunk/sphinx/locale/es/LC_MESSAGES/sphinx.js Fri Dec 5 20:10:41 2008 @@ -1 +1 @@ -Documentation.addTranslations({"locale": "es", "plural_expr": "(n != 1)", "messages": {"Search Results": "Resultados de la b\u00fasqueda", "Preparing search...": "Preparando la b\u00fasqueda", "Your search did not match any documents. Please make sure that all words are spelled correctly and that you've selected enough categories.": "La b\u00fasqueda no dio ning\u00fan resultado. Por favor aseg\u00farese que escribi\u00f3 todas las palabras correctamente y que ha seleccionado suficientes categor\u00edas", "Search finished, found %s page(s) matching the search query.": "B\u00fasqueda finalizada, se han encontrado %s p\u00e1gina(s) que concuerdan con su consulta", "Permalink to this headline": "Enlazar permanentemente con este t\u00edtulo", "Searching": "Buscando", "Permalink to this definition": "Enlazar permanentemente con esta definici\u00f3n", "Hide Search Matches": "Coincidencias de la b\u00fasqueda"}}); \ No newline at end of file +Documentation.addTranslations({"locale": "es", "plural_expr": "(n != 1)", "messages": {"module, in ": "m\u00f3dulo", "Preparing search...": "Preparando la b\u00fasqueda", "Your search did not match any documents. Please make sure that all words are spelled correctly and that you've selected enough categories.": "La b\u00fasqueda no dio ning\u00fan resultado. Por favor aseg\u00farese que escribi\u00f3 todas las palabras correctamente y que ha seleccionado suficientes categor\u00edas", "Search finished, found %s page(s) matching the search query.": "B\u00fasqueda finalizada, se han encontrado %s p\u00e1gina(s) que concuerdan con su consulta", ", in ": "", "Permalink to this headline": "Enlazar permanentemente con este t\u00edtulo", "Searching": "Buscando", "Permalink to this definition": "Enlazar permanentemente con esta definici\u00f3n", "Hide Search Matches": "Coincidencias de la b\u00fasqueda", "Search Results": "Resultados de la b\u00fasqueda"}}); \ No newline at end of file Modified: doctools/trunk/sphinx/locale/es/LC_MESSAGES/sphinx.mo ============================================================================== Binary files. No diff available. Modified: doctools/trunk/sphinx/locale/es/LC_MESSAGES/sphinx.po ============================================================================== --- doctools/trunk/sphinx/locale/es/LC_MESSAGES/sphinx.po (original) +++ doctools/trunk/sphinx/locale/es/LC_MESSAGES/sphinx.po Fri Dec 5 20:10:41 2008 @@ -1,4 +1,4 @@ -# Translations template for Sphinx. +# Spanish translations for Sphinx. # Copyright (C) 2008 ORGANIZATION # This file is distributed under the same license as the Sphinx project. # FIRST AUTHOR , 2008. @@ -8,240 +8,264 @@ "Project-Id-Version: Sphinx 0.5\n" "Report-Msgid-Bugs-To: guillem at torroja.dmt.upm.es\n" "POT-Creation-Date: 2008-09-11 23:58+0200\n" -"PO-Revision-Date: 2008-10-23 22:11+0200\n" +"PO-Revision-Date: 2008-11-27 18:40+0100\n" "Last-Translator: Guillem Borrell \n" -"Language-Team: LANGUAGE \n" +"Language-Team: es \n" +"Plural-Forms: nplurals=2; plural=(n != 1)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=utf-8\n" "Content-Transfer-Encoding: 8bit\n" -"Generated-By: Babel 0.9.3\n" +"Generated-By: Babel 0.9.4\n" -#: sphinx/builder.py:400 +#: sphinx/builder.py:408 #, python-format msgid "%b %d, %Y" msgstr "%d %b, %Y" -#: sphinx/builder.py:419 sphinx/templates/defindex.html:21 +#: sphinx/builder.py:427 sphinx/templates/defindex.html:21 msgid "General Index" msgstr "?ndice General" -#: sphinx/builder.py:419 +#: sphinx/builder.py:427 msgid "index" msgstr "?ndice" -#: sphinx/builder.py:421 sphinx/htmlhelp.py:155 +#: sphinx/builder.py:429 sphinx/htmlhelp.py:156 #: sphinx/templates/defindex.html:19 sphinx/templates/modindex.html:2 #: sphinx/templates/modindex.html:13 msgid "Global Module Index" msgstr "?ndice Global de M?dulos" -#: sphinx/builder.py:421 +#: sphinx/builder.py:429 msgid "modules" msgstr "m?dulos" -#: sphinx/builder.py:457 +#: sphinx/builder.py:466 msgid "next" msgstr "siguiente" -#: sphinx/builder.py:464 +#: sphinx/builder.py:473 msgid "previous" msgstr "anterior" -#: sphinx/builder.py:1108 +#: sphinx/builder.py:1054 +msgid " (in " +msgstr "" + +#: sphinx/builder.py:1129 #, fuzzy msgid "Builtins" msgstr "Funciones de base" -#: sphinx/builder.py:1110 +#: sphinx/builder.py:1131 #, fuzzy msgid "Module level" msgstr "M?dulos" -#: sphinx/environment.py:107 sphinx/latexwriter.py:129 -#, python-format, fuzzy +#: sphinx/environment.py:102 sphinx/latexwriter.py:169 +#, fuzzy, python-format msgid "%B %d, %Y" msgstr "%d de %B de %Y" -#: sphinx/environment.py:270 sphinx/latexwriter.py:190 +#: sphinx/environment.py:291 sphinx/latexwriter.py:175 #: sphinx/templates/genindex-single.html:2 #: sphinx/templates/genindex-split.html:2 #: sphinx/templates/genindex-split.html:5 sphinx/templates/genindex.html:2 #: sphinx/templates/genindex.html:5 sphinx/templates/genindex.html:48 +#: sphinx/templates/layout.html:130 msgid "Index" msgstr "?ndice" -#: sphinx/environment.py:271 sphinx/latexwriter.py:188 +#: sphinx/environment.py:292 sphinx/latexwriter.py:174 msgid "Module Index" msgstr "?ndice de M?dulos" -#: sphinx/environment.py:272 sphinx/templates/defindex.html:16 +#: sphinx/environment.py:293 sphinx/templates/defindex.html:16 msgid "Search Page" msgstr "P?gina de B?squeda" -#: sphinx/htmlwriter.py:73 sphinx/static/doctools.js:145 +#: sphinx/htmlwriter.py:79 sphinx/static/doctools.js:145 msgid "Permalink to this definition" msgstr "Enlazar permanentemente con esta definici?n" -#: sphinx/htmlwriter.py:375 sphinx/static/doctools.js:139 +#: sphinx/htmlwriter.py:399 sphinx/static/doctools.js:139 msgid "Permalink to this headline" msgstr "Enlazar permanentemente con este t?tulo" -#: sphinx/latexwriter.py:143 +#: sphinx/latexwriter.py:172 #, fuzzy msgid "Release" msgstr "Versi?n" -#: sphinx/roles.py:52 sphinx/directives/desc.py:514 +#: sphinx/roles.py:53 sphinx/directives/desc.py:537 #, python-format msgid "environment variable; %s" msgstr "variables de entorno; %s" -#: sphinx/roles.py:59 +#: sphinx/roles.py:60 #, python-format msgid "Python Enhancement Proposals!PEP %s" msgstr "Python Enhancement Proposals!PEP %s" -#: sphinx/textwriter.py:151 +#: sphinx/textwriter.py:166 #, python-format msgid "Platform: %s" msgstr "Plataforma: %s" -#: sphinx/textwriter.py:353 +#: sphinx/textwriter.py:422 msgid "[image]" msgstr "[imagen]" -#: sphinx/directives/desc.py:26 -#, python-format, fuzzy +#: sphinx/directives/desc.py:25 +#, fuzzy, python-format msgid "%s() (built-in function)" msgstr "%s() (funci?n de base)" -#: sphinx/directives/desc.py:27 sphinx/directives/desc.py:41 -#: sphinx/directives/desc.py:53 +#: sphinx/directives/desc.py:26 sphinx/directives/desc.py:42 +#: sphinx/directives/desc.py:54 #, python-format msgid "%s() (in module %s)" msgstr "%s() (en el m?dulo %s)" -#: sphinx/directives/desc.py:30 -#, python-format, fuzzy +#: sphinx/directives/desc.py:29 +#, fuzzy, python-format msgid "%s (built-in variable)" msgstr "%s (variable de base)" -#: sphinx/directives/desc.py:31 sphinx/directives/desc.py:65 +#: sphinx/directives/desc.py:30 sphinx/directives/desc.py:66 #, python-format msgid "%s (in module %s)" msgstr "%s (en el m?dulo %s)" #: sphinx/directives/desc.py:33 +#, fuzzy, python-format +msgid "%s (built-in class)" +msgstr "%s (variable de base)" + +#: sphinx/directives/desc.py:34 #, python-format msgid "%s (class in %s)" msgstr "%s (clase en %s)" -#: sphinx/directives/desc.py:45 +#: sphinx/directives/desc.py:46 #, python-format msgid "%s() (%s.%s method)" msgstr "%s() (%s.%s m?todo)" -#: sphinx/directives/desc.py:47 +#: sphinx/directives/desc.py:48 #, python-format msgid "%s() (%s method)" msgstr "%s() (%s m?todo)" -#: sphinx/directives/desc.py:57 +#: sphinx/directives/desc.py:58 #, python-format msgid "%s() (%s.%s static method)" msgstr "%s() (%s.%s m?todo est?tico)" -#: sphinx/directives/desc.py:59 +#: sphinx/directives/desc.py:60 #, python-format msgid "%s() (%s static method)" msgstr "%s() (%s m?todo est?tico)" -#: sphinx/directives/desc.py:69 +#: sphinx/directives/desc.py:70 #, python-format msgid "%s (%s.%s attribute)" msgstr "%s (%s.%s atributo)" -#: sphinx/directives/desc.py:71 +#: sphinx/directives/desc.py:72 #, python-format msgid "%s (%s attribute)" msgstr "%s (%s atributo)" -#: sphinx/directives/desc.py:73 +#: sphinx/directives/desc.py:74 #, python-format msgid "%s (C function)" msgstr "%s (funci?n C)" -#: sphinx/directives/desc.py:75 +#: sphinx/directives/desc.py:76 #, python-format msgid "%s (C member)" msgstr "%s (miembro C)" -#: sphinx/directives/desc.py:77 +#: sphinx/directives/desc.py:78 #, python-format msgid "%s (C macro)" msgstr "%s (macro C)" -#: sphinx/directives/desc.py:79 +#: sphinx/directives/desc.py:80 #, python-format msgid "%s (C type)" msgstr "%s (tipo C)" -#: sphinx/directives/desc.py:81 +#: sphinx/directives/desc.py:82 #, python-format msgid "%s (C variable)" msgstr "%s (variable C)" -#: sphinx/directives/desc.py:99 +#: sphinx/directives/desc.py:100 msgid "Raises" msgstr "Muestra" -#: sphinx/directives/desc.py:103 +#: sphinx/directives/desc.py:104 msgid "Variable" msgstr "Variable" -#: sphinx/directives/desc.py:106 +#: sphinx/directives/desc.py:107 msgid "Returns" msgstr "Devuelve" -#: sphinx/directives/desc.py:113 +#: sphinx/directives/desc.py:116 #, fuzzy msgid "Return type" msgstr "Tipo del argumento devuelto" -#: sphinx/directives/desc.py:140 +#: sphinx/directives/desc.py:143 msgid "Parameters" msgstr "Par?metros" -#: sphinx/directives/desc.py:402 -#, python-format -msgid "command line option; %s" -msgstr "Opciones en l?nea de comandos; %s" +#: sphinx/directives/desc.py:423 +#, fuzzy, python-format +msgid "%scommand line option; %s" +msgstr "%sOpciones en l?nea de comandos; %s" -#: sphinx/directives/other.py:102 +#: sphinx/directives/other.py:101 msgid "Platforms: " msgstr "Plataformas:" -#: sphinx/directives/other.py:107 +#: sphinx/directives/other.py:106 #, python-format msgid "%s (module)" msgstr "%s (m?dulo)" -#: sphinx/directives/other.py:147 +#: sphinx/directives/other.py:146 msgid "Section author: " msgstr "Autor de la secci?n" -#: sphinx/directives/other.py:149 +#: sphinx/directives/other.py:148 msgid "Module author: " msgstr "Autor del m?dulo" -#: sphinx/directives/other.py:151 +#: sphinx/directives/other.py:150 msgid "Author: " msgstr "Autor:" -#: sphinx/directives/other.py:233 +#: sphinx/directives/other.py:246 msgid "See also" msgstr "Ver tambi?n" +#: sphinx/ext/todo.py:31 +msgid "Todo" +msgstr "" + +#: sphinx/ext/todo.py:75 +#, python-format +msgid "(The original entry is located in %s, line %d and can be found " +msgstr "" + +#: sphinx/ext/todo.py:81 +msgid "here" +msgstr "" + #: sphinx/locale/__init__.py:15 msgid "Attention" msgstr "Atenci?n" @@ -339,20 +363,34 @@ msgid "Preparing search..." msgstr "Preparando la b?squeda" -#: sphinx/static/searchtools.js:401 sphinx/templates/search.html:18 +#: sphinx/static/searchtools.js:338 +#, fuzzy +msgid "module, in " +msgstr "m?dulo" + +#: sphinx/static/searchtools.js:347 +msgid ", in " +msgstr "" + +#: sphinx/static/searchtools.js:447 sphinx/templates/search.html:18 msgid "Search Results" msgstr "Resultados de la b?squeda" -#: sphinx/static/searchtools.js:403 +#: sphinx/static/searchtools.js:449 msgid "" "Your search did not match any documents. Please make sure that all words " "are spelled correctly and that you've selected enough categories." -msgstr "La b?squeda no dio ning?n resultado. Por favor aseg?rese que escribi? todas las palabras correctamente y que ha seleccionado suficientes categor?as" +msgstr "" +"La b?squeda no dio ning?n resultado. Por favor aseg?rese que escribi? " +"todas las palabras correctamente y que ha seleccionado suficientes " +"categor?as" -#: sphinx/static/searchtools.js:405 +#: sphinx/static/searchtools.js:451 #, python-format msgid "Search finished, found %s page(s) matching the search query." -msgstr "B?squeda finalizada, se han encontrado %s p?gina(s) que concuerdan con su consulta" +msgstr "" +"B?squeda finalizada, se han encontrado %s p?gina(s) que concuerdan con su" +" consulta" #: sphinx/templates/defindex.html:2 msgid "Overview" @@ -453,23 +491,15 @@ msgid "Enter a module, class or function name." msgstr "Introducir en nombre de un m?dulo, clase o funci?n" -#: sphinx/templates/layout.html:118 +#: sphinx/templates/layout.html:119 #, python-format msgid "Search within %(docstitle)s" msgstr "Buscar en %(docstitle)s" -#: sphinx/templates/layout.html:127 +#: sphinx/templates/layout.html:128 msgid "About these documents" msgstr "Sobre este documento" -#: sphinx/templates/layout.html:129 -msgid "Global table of contents" -msgstr "?ndice General" - -#: sphinx/templates/layout.html:130 -msgid "Global index" -msgstr "?ndice Global" - #: sphinx/templates/layout.html:131 sphinx/templates/search.html:2 #: sphinx/templates/search.html:5 msgid "Search" @@ -499,7 +529,9 @@ msgid "" "Created using Sphinx " "%(sphinx_version)s." -msgstr "Creado con Sphinx %(sphinx_version)s." +msgstr "" +"Creado con Sphinx " +"%(sphinx_version)s." #: sphinx/templates/modindex.html:15 msgid "Most popular modules:" @@ -523,15 +555,23 @@ "Note: You requested an out-of-date URL from this server." " We've tried to redirect you to the new location of this page, but it may" " not be the right one." -msgstr "Nota: Has solicitado una direcci?n desactualizada a este servidor. Hemos intentado redirigirte a la nueva direcci?n de la misma p?gina pero puede no ser la correcta." +msgstr "" +"Nota: Has solicitado una direcci?n desactualizada a este" +" servidor. Hemos intentado redirigirte a la nueva direcci?n de la misma " +"p?gina pero puede no ser la correcta." #: sphinx/templates/search.html:7 +#, fuzzy msgid "" "From here you can search these documents. Enter your search\n" " words into the box below and click \"search\". Note that the search\n" " function will automatically search for all of the words. Pages\n" -" containing less words won't appear in the result list." -msgstr "Este es el di?logo de b?squeda. Introduce los t?rminos en el di?logo siguiente y pulsa \"buscar\". El asistente buscar? autom?ticamente todas las palabras. Las p?ginas que contengan menos palabras no aparecer?n en la lista de resultados." +" containing fewer words won't appear in the result list." +msgstr "" +"Este es el di?logo de b?squeda. Introduce los t?rminos en el di?logo " +"siguiente y pulsa \"buscar\". El asistente buscar? autom?ticamente todas" +" las palabras. Las p?ginas que contengan menos palabras no aparecer?n en" +" la lista de resultados." #: sphinx/templates/search.html:14 msgid "search" Modified: doctools/trunk/sphinx/locale/fr/LC_MESSAGES/sphinx.js ============================================================================== --- doctools/trunk/sphinx/locale/fr/LC_MESSAGES/sphinx.js (original) +++ doctools/trunk/sphinx/locale/fr/LC_MESSAGES/sphinx.js Fri Dec 5 20:10:41 2008 @@ -1 +1 @@ -Documentation.addTranslations({"locale": "fr", "plural_expr": "(n > 1)", "messages": {"Search Results": "R\u00e9sultats de la recherche", "Your search did not match any documents. Please make sure that all words are spelled correctly and that you've selected enough categories.": "", "Getting search index...": "", "Permalink to this headline": "Lien permanent vers ce titre", "Searching": "rechercher", "Permalink to this definition": "Lien permanent vers cette d\u00e9finition", "Hide Search Matches": "", "Search finished, found %s page(s) matching the search query.": ""}}); \ No newline at end of file +Documentation.addTranslations({"locale": "fr", "plural_expr": "(n > 1)", "messages": {"module, in ": "module, dans", "Preparing search...": "Pr\u00e9paration de la recherche...", "Your search did not match any documents. Please make sure that all words are spelled correctly and that you've selected enough categories.": "Votre recherche ne correspond \u00e0 aucun document. V\u00e9rifiez l'orthographe des termes de recherche et que vous avez s\u00e9lectionn\u00e9 suffisamment de cat\u00e9gories.", "Search finished, found %s page(s) matching the search query.": "La recherche est termin\u00e9e, %s page(s) correspond(ent) \u00e0 la requ\u00eate.", ", in ": ", dans", "Permalink to this headline": "Lien permanent vers ce titre", "Searching": "En cours de recherche", "Permalink to this definition": "Lien permanent vers cette d\u00e9finition", "Hide Search Matches": "Cacher les r\u00e9sultats de la recherche", "Search Results": "R\u00e9sultats de la recherche"}}); \ No newline at end of file Modified: doctools/trunk/sphinx/locale/fr/LC_MESSAGES/sphinx.mo ============================================================================== Binary files. No diff available. Modified: doctools/trunk/sphinx/locale/fr/LC_MESSAGES/sphinx.po ============================================================================== --- doctools/trunk/sphinx/locale/fr/LC_MESSAGES/sphinx.po (original) +++ doctools/trunk/sphinx/locale/fr/LC_MESSAGES/sphinx.po Fri Dec 5 20:10:41 2008 @@ -2,240 +2,267 @@ # Copyright (C) 2008 ORGANIZATION # This file is distributed under the same license as the Sphinx project. # David Larlet , 2008. +# Sebastien Douche , 2008. # msgid "" msgstr "" "Project-Id-Version: Sphinx 0.5\n" "Report-Msgid-Bugs-To: larlet at gmail.com\n" "POT-Creation-Date: 2008-08-08 12:39+0000\n" -"PO-Revision-Date: 2008-09-06 19:10+0200\n" -"Last-Translator: David Larlet \n" -"Language-Team: fr \n" +"PO-Revision-Date: 2008-11-27 18:40+0100\n" +"Last-Translator: S?bastien Douche \n" +"Language-Team: French Translation Team \n" "Plural-Forms: nplurals=2; plural=(n > 1)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=utf-8\n" "Content-Transfer-Encoding: 8bit\n" -"Generated-By: Babel 0.9.3\n" +"Generated-By: Babel 0.9.4\n" -#: sphinx/builder.py:391 +#: sphinx/builder.py:408 #, python-format msgid "%b %d, %Y" msgstr "%d %b %Y" -#: sphinx/builder.py:410 sphinx/templates/defindex.html:21 +#: sphinx/builder.py:427 sphinx/templates/defindex.html:21 msgid "General Index" msgstr "Index g?n?ral" -#: sphinx/builder.py:410 +#: sphinx/builder.py:427 msgid "index" msgstr "index" -#: sphinx/builder.py:412 sphinx/htmlhelp.py:155 +#: sphinx/builder.py:429 sphinx/htmlhelp.py:156 #: sphinx/templates/defindex.html:19 sphinx/templates/modindex.html:2 #: sphinx/templates/modindex.html:13 msgid "Global Module Index" msgstr "Index g?n?ral des modules" -#: sphinx/builder.py:412 +#: sphinx/builder.py:429 msgid "modules" msgstr "modules" -#: sphinx/builder.py:448 +#: sphinx/builder.py:466 msgid "next" msgstr "suivant" -#: sphinx/builder.py:455 +#: sphinx/builder.py:473 msgid "previous" msgstr "pr?c?dent" -#: sphinx/builder.py:1092 +#: sphinx/builder.py:1054 +msgid " (in " +msgstr "(dans" + +#: sphinx/builder.py:1129 msgid "Builtins" msgstr "Fonctions de base" -#: sphinx/builder.py:1094 -#, fuzzy +#: sphinx/builder.py:1131 msgid "Module level" -msgstr "Modules" +msgstr "Module" -#: sphinx/environment.py:108 sphinx/latexwriter.py:129 +#: sphinx/environment.py:102 sphinx/latexwriter.py:169 #, python-format msgid "%B %d, %Y" msgstr "%d %B %Y" -#: sphinx/htmlwriter.py:73 sphinx/static/doctools.js:143 +#: sphinx/environment.py:291 sphinx/latexwriter.py:175 +#: sphinx/templates/genindex-single.html:2 +#: sphinx/templates/genindex-split.html:2 +#: sphinx/templates/genindex-split.html:5 sphinx/templates/genindex.html:2 +#: sphinx/templates/genindex.html:5 sphinx/templates/genindex.html:48 +#: sphinx/templates/layout.html:130 +msgid "Index" +msgstr "Index" + +#: sphinx/environment.py:292 sphinx/latexwriter.py:174 +msgid "Module Index" +msgstr "Index du module" + +#: sphinx/environment.py:293 sphinx/templates/defindex.html:16 +msgid "Search Page" +msgstr "Page de recherche" + +#: sphinx/htmlwriter.py:79 sphinx/static/doctools.js:145 msgid "Permalink to this definition" msgstr "Lien permanent vers cette d?finition" -#: sphinx/htmlwriter.py:379 sphinx/static/doctools.js:136 +#: sphinx/htmlwriter.py:399 sphinx/static/doctools.js:139 msgid "Permalink to this headline" msgstr "Lien permanent vers ce titre" -#: sphinx/latexwriter.py:143 +#: sphinx/latexwriter.py:172 msgid "Release" -msgstr "Release" - -#: sphinx/latexwriter.py:188 -#, fuzzy -msgid "Module index" -msgstr "Index g?n?ral des modules" +msgstr "Version" -#: sphinx/latexwriter.py:190 sphinx/templates/genindex-single.html:2 -#: sphinx/templates/genindex-split.html:2 -#: sphinx/templates/genindex-split.html:5 sphinx/templates/genindex.html:2 -#: sphinx/templates/genindex.html:5 sphinx/templates/genindex.html:48 -msgid "Index" -msgstr "Index" - -#: sphinx/roles.py:52 sphinx/directives/desc.py:514 +#: sphinx/roles.py:53 sphinx/directives/desc.py:537 #, python-format msgid "environment variable; %s" msgstr "variable d'environnement; %s" -#: sphinx/roles.py:59 +#: sphinx/roles.py:60 #, python-format msgid "Python Enhancement Proposals!PEP %s" msgstr "Python Enhancement Proposals!PEP %s" -#: sphinx/textwriter.py:151 +#: sphinx/textwriter.py:166 #, python-format msgid "Platform: %s" -msgstr "Plateforme: %s" +msgstr "Plateforme : %s" -#: sphinx/textwriter.py:353 +#: sphinx/textwriter.py:422 msgid "[image]" msgstr "[image]" -#: sphinx/directives/desc.py:26 +#: sphinx/directives/desc.py:25 #, python-format msgid "%s() (built-in function)" msgstr "%s() (fonction de base)" -#: sphinx/directives/desc.py:27 sphinx/directives/desc.py:41 -#: sphinx/directives/desc.py:53 +#: sphinx/directives/desc.py:26 sphinx/directives/desc.py:42 +#: sphinx/directives/desc.py:54 #, python-format msgid "%s() (in module %s)" msgstr "%s() (dans le module %s)" -#: sphinx/directives/desc.py:30 +#: sphinx/directives/desc.py:29 #, python-format msgid "%s (built-in variable)" msgstr "%s (variable de base)" -#: sphinx/directives/desc.py:31 sphinx/directives/desc.py:65 +#: sphinx/directives/desc.py:30 sphinx/directives/desc.py:66 #, python-format msgid "%s (in module %s)" msgstr "%s (dans le module %s)" #: sphinx/directives/desc.py:33 #, python-format +msgid "%s (built-in class)" +msgstr "%s (classe de base)" + +#: sphinx/directives/desc.py:34 +#, python-format msgid "%s (class in %s)" msgstr "%s (classe dans %s)" -#: sphinx/directives/desc.py:45 +#: sphinx/directives/desc.py:46 #, python-format msgid "%s() (%s.%s method)" msgstr "%s() (m?thode %s.%s)" -#: sphinx/directives/desc.py:47 +#: sphinx/directives/desc.py:48 #, python-format msgid "%s() (%s method)" msgstr "%s() (m?thode %s)" -#: sphinx/directives/desc.py:57 +#: sphinx/directives/desc.py:58 #, python-format msgid "%s() (%s.%s static method)" msgstr "%s() (m?thode statique %s.%s)" -#: sphinx/directives/desc.py:59 +#: sphinx/directives/desc.py:60 #, python-format msgid "%s() (%s static method)" msgstr "%s() (m?thode statique %s)" -#: sphinx/directives/desc.py:69 +#: sphinx/directives/desc.py:70 #, python-format msgid "%s (%s.%s attribute)" msgstr "%s (attribut %s.%s)" -#: sphinx/directives/desc.py:71 +#: sphinx/directives/desc.py:72 #, python-format msgid "%s (%s attribute)" msgstr "%s (attribut %s)" -#: sphinx/directives/desc.py:73 +#: sphinx/directives/desc.py:74 #, python-format msgid "%s (C function)" msgstr "%s (fonction C)" -#: sphinx/directives/desc.py:75 +#: sphinx/directives/desc.py:76 #, python-format msgid "%s (C member)" msgstr "%s (membre C)" -#: sphinx/directives/desc.py:77 +#: sphinx/directives/desc.py:78 #, python-format msgid "%s (C macro)" msgstr "%s (macro C)" -#: sphinx/directives/desc.py:79 +#: sphinx/directives/desc.py:80 #, python-format msgid "%s (C type)" msgstr "%s (type C)" -#: sphinx/directives/desc.py:81 +#: sphinx/directives/desc.py:82 #, python-format msgid "%s (C variable)" msgstr "%s (variable C)" -#: sphinx/directives/desc.py:99 +#: sphinx/directives/desc.py:100 msgid "Raises" msgstr "L?ve" -#: sphinx/directives/desc.py:103 +#: sphinx/directives/desc.py:104 msgid "Variable" msgstr "Variable" -#: sphinx/directives/desc.py:106 +#: sphinx/directives/desc.py:107 msgid "Returns" msgstr "Retourne" -#: sphinx/directives/desc.py:113 +#: sphinx/directives/desc.py:116 msgid "Return type" msgstr "Type retourn?" -#: sphinx/directives/desc.py:140 +#: sphinx/directives/desc.py:143 msgid "Parameters" msgstr "Param?tres" -#: sphinx/directives/desc.py:402 +#: sphinx/directives/desc.py:423 #, python-format -msgid "command line option; %s" -msgstr "option de ligne de commande; %s" +msgid "%scommand line option; %s" +msgstr "%soption de ligne de commande; %s" -#: sphinx/directives/other.py:102 +#: sphinx/directives/other.py:101 msgid "Platforms: " msgstr "Plateformes : " -#: sphinx/directives/other.py:107 -#, fuzzy, python-format +#: sphinx/directives/other.py:106 +#, python-format msgid "%s (module)" msgstr "%s (module)" -#: sphinx/directives/other.py:147 +#: sphinx/directives/other.py:146 msgid "Section author: " msgstr "Auteur de la section : " -#: sphinx/directives/other.py:149 +#: sphinx/directives/other.py:148 msgid "Module author: " msgstr "Auteur du module : " -#: sphinx/directives/other.py:151 +#: sphinx/directives/other.py:150 msgid "Author: " msgstr "Auteur : " -#: sphinx/directives/other.py:233 +#: sphinx/directives/other.py:246 msgid "See also" msgstr "Voir aussi" +#: sphinx/ext/todo.py:31 +msgid "Todo" +msgstr "A faire" + +#: sphinx/ext/todo.py:75 +#, python-format +msgid "(The original entry is located in %s, line %d and can be found " +msgstr "(L'entr?e orginale se trouve dans %s, ? la ligne %d et peut ?tre trouv?" + +#: sphinx/ext/todo.py:81 +msgid "here" +msgstr "ici" + #: sphinx/locale/__init__.py:15 msgid "Attention" msgstr "Attention" @@ -319,33 +346,43 @@ msgid "built-in function" msgstr "fonction de base" -#: sphinx/static/doctools.js:172 +#: sphinx/static/doctools.js:174 msgid "Hide Search Matches" -msgstr "" +msgstr "Cacher les r?sultats de la recherche" -#: sphinx/static/searchtools.js:242 -#, fuzzy +#: sphinx/static/searchtools.js:274 msgid "Searching" -msgstr "rechercher" +msgstr "En cours de recherche" -#: sphinx/static/searchtools.js:246 -msgid "Getting search index..." -msgstr "" +#: sphinx/static/searchtools.js:279 +msgid "Preparing search..." +msgstr "Pr?paration de la recherche..." + +#: sphinx/static/searchtools.js:338 +msgid "module, in " +msgstr "module, dans" -#: sphinx/static/searchtools.js:384 sphinx/templates/search.html:18 +#: sphinx/static/searchtools.js:347 +msgid ", in " +msgstr ", dans" + +#: sphinx/static/searchtools.js:447 sphinx/templates/search.html:18 msgid "Search Results" msgstr "R?sultats de la recherche" -#: sphinx/static/searchtools.js:386 +#: sphinx/static/searchtools.js:449 msgid "" "Your search did not match any documents. Please make sure that all words " "are spelled correctly and that you've selected enough categories." msgstr "" +"Votre recherche ne correspond ? aucun document. V?rifiez l'orthographe " +"des termes de recherche et que vous avez s?lectionn? suffisamment de " +"cat?gories." -#: sphinx/static/searchtools.js:389 +#: sphinx/static/searchtools.js:451 #, python-format msgid "Search finished, found %s page(s) matching the search query." -msgstr "" +msgstr "La recherche est termin?e, %s page(s) correspond(ent) ? la requ?te." #: sphinx/templates/defindex.html:2 msgid "Overview" @@ -363,10 +400,6 @@ msgid "lists all sections and subsections" msgstr "lister l'ensemble des sections et sous-sections" -#: sphinx/templates/defindex.html:16 -msgid "Search page" -msgstr "Page de recherche" - #: sphinx/templates/defindex.html:17 msgid "search this documentation" msgstr "rechercher dans cette documentation" @@ -450,23 +483,15 @@ msgid "Enter a module, class or function name." msgstr "Saisissez un nom de module, classe ou fonction." -#: sphinx/templates/layout.html:118 +#: sphinx/templates/layout.html:119 #, python-format msgid "Search within %(docstitle)s" msgstr "Recherchez dans %(docstitle)s" -#: sphinx/templates/layout.html:127 +#: sphinx/templates/layout.html:128 msgid "About these documents" msgstr "? propos de ces documents" -#: sphinx/templates/layout.html:129 -msgid "Global table of contents" -msgstr "Table des mati?res g?n?rale" - -#: sphinx/templates/layout.html:130 -msgid "Global index" -msgstr "Index g?n?ral" - #: sphinx/templates/layout.html:131 sphinx/templates/search.html:2 #: sphinx/templates/search.html:5 msgid "Search" @@ -528,11 +553,12 @@ "cette page, mais ce n'est peut-?tre pas la bonne." #: sphinx/templates/search.html:7 +#, fuzzy msgid "" "From here you can search these documents. Enter your search\n" " words into the box below and click \"search\". Note that the search\n" " function will automatically search for all of the words. Pages\n" -" containing less words won't appear in the result list." +" containing fewer words won't appear in the result list." msgstr "" "Vous pouvez effectuer une recherche au sein des documents. Saisissez les " "termes\n" Modified: doctools/trunk/sphinx/locale/ja/LC_MESSAGES/sphinx.js ============================================================================== --- doctools/trunk/sphinx/locale/ja/LC_MESSAGES/sphinx.js (original) +++ doctools/trunk/sphinx/locale/ja/LC_MESSAGES/sphinx.js Fri Dec 5 20:10:41 2008 @@ -1 +1 @@ -Documentation.addTranslations({"locale": "ja", "plural_expr": "0", "messages": {"Search Results": "\u691c\u7d22\u7d50\u679c", "Preparing search...": "\u691c\u7d22\u306e\u6e96\u5099\u4e2d...", "Your search did not match any documents. Please make sure that all words are spelled correctly and that you've selected enough categories.": "\u691c\u7d22\u6761\u4ef6\u306b\u4e00\u81f4\u3059\u308b\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u306f\u3042\u308a\u307e\u305b\u3093\u3067\u3057\u305f\u3002\u691c\u7d22\u3057\u305f\u3044\u8a00\u8449\u3092\u6b63\u3057\u3044\u3064\u3065\u308a\u3067\u5165\u529b\u3057\u3066\u3044\u308b\u304b\u78ba\u8a8d\u3057\u3066\u304f\u3060\u3055\u3044\u3002\u307e\u305f\u3001\u6b63\u3057\u3044\u30ab\u30c6\u30b4\u30ea\u306e\u691c\u7d22\u3092\u884c\u3063\u3066\u3044\u308b\u304b\u78ba\u8a8d\u3057\u3066\u304f\u3060\u3055\u3044\u3002", "Search finished, found %s page(s) matching the search query.": "\u691c\u7d22\u304c\u7d42\u4e86\u3057\u3001\u6761\u4ef6\u306b\u4e00\u81f4\u3059\u308b\u30da\u30fc\u30b8\u304c %s \u500b\u307f\u3064\u304b\u308a\u307e\u3057\u305f\u3002", "Permalink to this headline": "\u3053\u306e\u30d8\u30c3\u30c9\u30e9\u30a4\u30f3\u3078\u306e\u30d1\u30fc\u30de\u30ea\u30f3\u30af", "Searching": "\u691c\u7d22\u4e2d", "Permalink to this definition": "\u3053\u306e\u5b9a\u7fa9\u3078\u306e\u30d1\u30fc\u30de\u30ea\u30f3\u30af", "Hide Search Matches": "\u691c\u7d22\u7d50\u679c\u3092\u96a0\u3059"}}); \ No newline at end of file +Documentation.addTranslations({"locale": "ja", "plural_expr": "0", "messages": {"module, in ": "\u30e2\u30b8\u30e5\u30fc\u30eb", "Preparing search...": "\u691c\u7d22\u306e\u6e96\u5099\u4e2d...", "Your search did not match any documents. Please make sure that all words are spelled correctly and that you've selected enough categories.": "\u691c\u7d22\u6761\u4ef6\u306b\u4e00\u81f4\u3059\u308b\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u306f\u3042\u308a\u307e\u305b\u3093\u3067\u3057\u305f\u3002\u691c\u7d22\u3057\u305f\u3044\u8a00\u8449\u3092\u6b63\u3057\u3044\u3064\u3065\u308a\u3067\u5165\u529b\u3057\u3066\u3044\u308b\u304b\u78ba\u8a8d\u3057\u3066\u304f\u3060\u3055\u3044\u3002\u307e\u305f\u3001\u6b63\u3057\u3044\u30ab\u30c6\u30b4\u30ea\u306e\u691c\u7d22\u3092\u884c\u3063\u3066\u3044\u308b\u304b\u78ba\u8a8d\u3057\u3066\u304f\u3060\u3055\u3044\u3002", "Search finished, found %s page(s) matching the search query.": "\u691c\u7d22\u304c\u7d42\u4e86\u3057\u3001\u6761\u4ef6\u306b\u4e00\u81f4\u3059\u308b\u30da\u30fc\u30b8\u304c %s \u500b\u307f\u3064\u304b\u308a\u307e\u3057\u305f\u3002", ", in ": "", "Permalink to this headline": "\u3053\u306e\u30d8\u30c3\u30c9\u30e9\u30a4\u30f3\u3078\u306e\u30d1\u30fc\u30de\u30ea\u30f3\u30af", "Searching": "\u691c\u7d22\u4e2d", "Permalink to this definition": "\u3053\u306e\u5b9a\u7fa9\u3078\u306e\u30d1\u30fc\u30de\u30ea\u30f3\u30af", "Hide Search Matches": "\u691c\u7d22\u7d50\u679c\u3092\u96a0\u3059", "Search Results": "\u691c\u7d22\u7d50\u679c"}}); \ No newline at end of file Modified: doctools/trunk/sphinx/locale/ja/LC_MESSAGES/sphinx.mo ============================================================================== Binary files. No diff available. Modified: doctools/trunk/sphinx/locale/ja/LC_MESSAGES/sphinx.po ============================================================================== --- doctools/trunk/sphinx/locale/ja/LC_MESSAGES/sphinx.po (original) +++ doctools/trunk/sphinx/locale/ja/LC_MESSAGES/sphinx.po Fri Dec 5 20:10:41 2008 @@ -3,244 +3,265 @@ # This file is distributed under the same license as the Sphinx project. # Yasushi Masuda , 2008. # -# msgid "" msgstr "" "Project-Id-Version: Sphinx 0.5\n" "Report-Msgid-Bugs-To: EMAIL at ADDRESS\n" "POT-Creation-Date: 2008-09-11 23:58+0200\n" -"PO-Revision-Date: 2008-09-17 12:00:00+0900\n" +"PO-Revision-Date: 2008-11-27 18:40+0100\n" "Last-Translator: Yasushi MASUDA \n" "Language-Team: ja \n" +"Plural-Forms: nplurals=1; plural=0\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=utf-8\n" "Content-Transfer-Encoding: 8bit\n" -"Generated-By: Babel 0.9.3\n" +"Generated-By: Babel 0.9.4\n" -#: sphinx/builder.py:400 +#: sphinx/builder.py:408 #, python-format msgid "%b %d, %Y" msgstr "%Y ? %m ? %d ?" -#: sphinx/builder.py:419 sphinx/templates/defindex.html:21 +#: sphinx/builder.py:427 sphinx/templates/defindex.html:21 msgid "General Index" msgstr "????" -#: sphinx/builder.py:419 +#: sphinx/builder.py:427 msgid "index" msgstr "??" - -#: sphinx/builder.py:421 sphinx/htmlhelp.py:155 +#: sphinx/builder.py:429 sphinx/htmlhelp.py:156 #: sphinx/templates/defindex.html:19 sphinx/templates/modindex.html:2 #: sphinx/templates/modindex.html:13 msgid "Global Module Index" msgstr "????????" -#: sphinx/builder.py:421 +#: sphinx/builder.py:429 msgid "modules" msgstr "?????" -#: sphinx/builder.py:457 +#: sphinx/builder.py:466 msgid "next" msgstr "??" -#: sphinx/builder.py:464 +#: sphinx/builder.py:473 msgid "previous" msgstr "??" -#: sphinx/builder.py:1108 +#: sphinx/builder.py:1054 +msgid " (in " +msgstr "" + +#: sphinx/builder.py:1129 msgid "Builtins" msgstr "????" -#: sphinx/builder.py:1110 +#: sphinx/builder.py:1131 msgid "Module level" msgstr "????????" - -#: sphinx/environment.py:107 sphinx/latexwriter.py:129 +#: sphinx/environment.py:102 sphinx/latexwriter.py:169 #, python-format msgid "%B %d, %Y" msgstr "%Y ? %m ? %d ?" -#: sphinx/environment.py:270 sphinx/latexwriter.py:190 +#: sphinx/environment.py:291 sphinx/latexwriter.py:175 #: sphinx/templates/genindex-single.html:2 #: sphinx/templates/genindex-split.html:2 #: sphinx/templates/genindex-split.html:5 sphinx/templates/genindex.html:2 #: sphinx/templates/genindex.html:5 sphinx/templates/genindex.html:48 +#: sphinx/templates/layout.html:130 msgid "Index" msgstr "??" -#: sphinx/environment.py:271 sphinx/latexwriter.py:188 +#: sphinx/environment.py:292 sphinx/latexwriter.py:174 msgid "Module Index" msgstr "???????" -#: sphinx/environment.py:272 sphinx/templates/defindex.html:16 +#: sphinx/environment.py:293 sphinx/templates/defindex.html:16 msgid "Search Page" msgstr "?????" -#: sphinx/htmlwriter.py:73 sphinx/static/doctools.js:145 +#: sphinx/htmlwriter.py:79 sphinx/static/doctools.js:145 msgid "Permalink to this definition" msgstr "????????????" -#: sphinx/htmlwriter.py:375 sphinx/static/doctools.js:139 +#: sphinx/htmlwriter.py:399 sphinx/static/doctools.js:139 msgid "Permalink to this headline" msgstr "????????????????" -#: sphinx/latexwriter.py:143 +#: sphinx/latexwriter.py:172 msgid "Release" msgstr "????" -#: sphinx/roles.py:52 sphinx/directives/desc.py:514 +#: sphinx/roles.py:53 sphinx/directives/desc.py:537 #, python-format msgid "environment variable; %s" msgstr "????; %s" -#: sphinx/roles.py:59 +#: sphinx/roles.py:60 #, python-format msgid "Python Enhancement Proposals!PEP %s" msgstr "Python Enhancement Proposals!PEP %s" -#: sphinx/textwriter.py:151 +#: sphinx/textwriter.py:166 #, python-format msgid "Platform: %s" msgstr "????????: %s" -#: sphinx/textwriter.py:353 +#: sphinx/textwriter.py:422 msgid "[image]" msgstr "[??]" -#: sphinx/directives/desc.py:26 +#: sphinx/directives/desc.py:25 #, python-format msgid "%s() (built-in function)" msgstr "%s() (??????)" -#: sphinx/directives/desc.py:27 sphinx/directives/desc.py:41 -#: sphinx/directives/desc.py:53 +#: sphinx/directives/desc.py:26 sphinx/directives/desc.py:42 +#: sphinx/directives/desc.py:54 #, python-format msgid "%s() (in module %s)" msgstr "%s() (%s ?????)" -#: sphinx/directives/desc.py:30 +#: sphinx/directives/desc.py:29 #, python-format msgid "%s (built-in variable)" msgstr "%s (??????)" -#: sphinx/directives/desc.py:31 sphinx/directives/desc.py:65 +#: sphinx/directives/desc.py:30 sphinx/directives/desc.py:66 #, python-format msgid "%s (in module %s)" msgstr "%s (%s ?????)" #: sphinx/directives/desc.py:33 +#, fuzzy, python-format +msgid "%s (built-in class)" +msgstr "%s (??????)" + +#: sphinx/directives/desc.py:34 #, python-format msgid "%s (class in %s)" msgstr "%s (%s ????)" -#: sphinx/directives/desc.py:45 +#: sphinx/directives/desc.py:46 #, python-format msgid "%s() (%s.%s method)" msgstr "%s() (%s.%s ?????)" -#: sphinx/directives/desc.py:47 +#: sphinx/directives/desc.py:48 #, python-format msgid "%s() (%s method)" msgstr "%s() (%s ?????)" -#: sphinx/directives/desc.py:57 +#: sphinx/directives/desc.py:58 #, python-format msgid "%s() (%s.%s static method)" msgstr "%s() (%s.%s ???????)" -#: sphinx/directives/desc.py:59 +#: sphinx/directives/desc.py:60 #, python-format msgid "%s() (%s static method)" msgstr "%s() (%s ???????)" -#: sphinx/directives/desc.py:69 +#: sphinx/directives/desc.py:70 #, python-format msgid "%s (%s.%s attribute)" msgstr "%s (%s.%s ???)" -#: sphinx/directives/desc.py:71 +#: sphinx/directives/desc.py:72 #, python-format msgid "%s (%s attribute)" msgstr "%s (%s ???)" -#: sphinx/directives/desc.py:73 +#: sphinx/directives/desc.py:74 #, python-format msgid "%s (C function)" msgstr "%s (C ???)" -#: sphinx/directives/desc.py:75 +#: sphinx/directives/desc.py:76 #, python-format msgid "%s (C member)" msgstr "%s (C ??????)" -#: sphinx/directives/desc.py:77 +#: sphinx/directives/desc.py:78 #, python-format msgid "%s (C macro)" msgstr "%s (C ????)" -#: sphinx/directives/desc.py:79 +#: sphinx/directives/desc.py:80 #, python-format msgid "%s (C type)" msgstr "%s (C ?????)" -#: sphinx/directives/desc.py:81 +#: sphinx/directives/desc.py:82 #, python-format msgid "%s (C variable)" msgstr "%s (C ???)" -#: sphinx/directives/desc.py:99 +#: sphinx/directives/desc.py:100 msgid "Raises" msgstr "??" -#: sphinx/directives/desc.py:103 +#: sphinx/directives/desc.py:104 msgid "Variable" msgstr "??" -#: sphinx/directives/desc.py:106 +#: sphinx/directives/desc.py:107 msgid "Returns" msgstr "???" -#: sphinx/directives/desc.py:113 +#: sphinx/directives/desc.py:116 msgid "Return type" msgstr "?????" -#: sphinx/directives/desc.py:140 +#: sphinx/directives/desc.py:143 msgid "Parameters" msgstr "????" -#: sphinx/directives/desc.py:402 -#, python-format -msgid "command line option; %s" -msgstr "????????????; %s" +#: sphinx/directives/desc.py:423 +#, fuzzy, python-format +msgid "%scommand line option; %s" +msgstr "%s????????????; %s" -#: sphinx/directives/other.py:102 +#: sphinx/directives/other.py:101 msgid "Platforms: " msgstr "????????: " -#: sphinx/directives/other.py:107 +#: sphinx/directives/other.py:106 #, python-format msgid "%s (module)" msgstr "%s (?????)" -#: sphinx/directives/other.py:147 +#: sphinx/directives/other.py:146 msgid "Section author: " msgstr "??????: " -#: sphinx/directives/other.py:149 +#: sphinx/directives/other.py:148 msgid "Module author: " msgstr "????????: " -#: sphinx/directives/other.py:151 +#: sphinx/directives/other.py:150 msgid "Author: " msgstr "??: " -#: sphinx/directives/other.py:233 +#: sphinx/directives/other.py:246 msgid "See also" msgstr "??" +#: sphinx/ext/todo.py:31 +msgid "Todo" +msgstr "" + +#: sphinx/ext/todo.py:75 +#, python-format +msgid "(The original entry is located in %s, line %d and can be found " +msgstr "" + +#: sphinx/ext/todo.py:81 +msgid "here" +msgstr "" + #: sphinx/locale/__init__.py:15 msgid "Attention" msgstr "??" @@ -336,20 +357,26 @@ msgid "Preparing search..." msgstr "??????..." -#: sphinx/static/searchtools.js:401 sphinx/templates/search.html:18 +#: sphinx/static/searchtools.js:338 +#, fuzzy +msgid "module, in " +msgstr "?????" + +#: sphinx/static/searchtools.js:347 +msgid ", in " +msgstr "" + +#: sphinx/static/searchtools.js:447 sphinx/templates/search.html:18 msgid "Search Results" msgstr "????" -#: sphinx/static/searchtools.js:403 +#: sphinx/static/searchtools.js:449 msgid "" "Your search did not match any documents. Please make sure that all words " "are spelled correctly and that you've selected enough categories." -msgstr "" -"?????????????????????????????????" -"?????????????????????????????????" -"???????????????????" +msgstr "?????????????????????????????????????????????????????????????????????????????????????" -#: sphinx/static/searchtools.js:405 +#: sphinx/static/searchtools.js:451 #, python-format msgid "Search finished, found %s page(s) matching the search query." msgstr "?????????????????? %s ?????????" @@ -453,23 +480,15 @@ msgid "Enter a module, class or function name." msgstr "?????????????????????????" -#: sphinx/templates/layout.html:118 +#: sphinx/templates/layout.html:119 #, python-format msgid "Search within %(docstitle)s" msgstr "%(docstitle)s ????" -#: sphinx/templates/layout.html:127 +#: sphinx/templates/layout.html:128 msgid "About these documents" msgstr "????????????" -#: sphinx/templates/layout.html:129 -msgid "Global table of contents" -msgstr "???" - -#: sphinx/templates/layout.html:130 -msgid "Global index" -msgstr "????" - #: sphinx/templates/layout.html:131 sphinx/templates/search.html:2 #: sphinx/templates/search.html:5 msgid "Search" @@ -526,21 +545,17 @@ " We've tried to redirect you to the new location of this page, but it may" " not be the right one." msgstr "" -"??: ?????????????????? URL ???" -"????????????? URL ???????????????" -"??????????????????????????????" +"??: ?????????????????? URL ???????????????? URL " +"?????????????????????????????????????????????" #: sphinx/templates/search.html:7 +#, fuzzy msgid "" "From here you can search these documents. Enter your search\n" " words into the box below and click \"search\". Note that the search\n" " function will automatically search for all of the words. Pages\n" -" containing less words won't appear in the result list." -msgstr "" -"????????????????????????????????????" -"???????????????????????????????????" -"??????????????????????????????????" -"?????????????????" +" containing fewer words won't appear in the result list." +msgstr "??????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????" #: sphinx/templates/search.html:14 msgid "search" Added: doctools/trunk/sphinx/locale/nl/LC_MESSAGES/sphinx.js ============================================================================== --- (empty file) +++ doctools/trunk/sphinx/locale/nl/LC_MESSAGES/sphinx.js Fri Dec 5 20:10:41 2008 @@ -0,0 +1 @@ +Documentation.addTranslations({"locale": "nl", "plural_expr": "(n != 1)", "messages": {"module, in ": "module", "Preparing search...": "Het zoeken wordt voorbereid", "Your search did not match any documents. Please make sure that all words are spelled correctly and that you've selected enough categories.": "Uw zoekopdracht leverde geen resultaten op. Controleer of alle woordencorrect gespeld zijn en dat u genoeg categori\u00ebn hebt geselecteerd.", "Search finished, found %s page(s) matching the search query.": "Zoeken voltooid, %s pagina(s) gevonden.", ", in ": "", "Permalink to this headline": "Permanente link naar deze titel", "Searching": "Zoeken", "Permalink to this definition": "Permanente link naar deze definitie", "Hide Search Matches": "Zoekresultaten verbergen", "Search Results": "Zoekresultaten"}}); \ No newline at end of file Added: doctools/trunk/sphinx/locale/nl/LC_MESSAGES/sphinx.mo ============================================================================== Binary file. No diff available. Added: doctools/trunk/sphinx/locale/nl/LC_MESSAGES/sphinx.po ============================================================================== --- (empty file) +++ doctools/trunk/sphinx/locale/nl/LC_MESSAGES/sphinx.po Fri Dec 5 20:10:41 2008 @@ -0,0 +1,603 @@ +# Copyright (C) 2008 ORGANIZATION +# This file is distributed under the same license as the Sphinx project. +# FIRST AUTHOR , 2008. +# +msgid "" +msgstr "" +"Project-Id-Version: Sphinx 0.5\n" +"Report-Msgid-Bugs-To: EMAIL at ADDRESS\n" +"POT-Creation-Date: 2008-09-11 23:58+0200\n" +"PO-Revision-Date: 2008-11-27 18:40+0100\n" +"Last-Translator: FULL NAME \n" +"Language-Team: nl \n" +"Plural-Forms: nplurals=2; plural=(n != 1)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Generated-By: Babel 0.9.4\n" + +#: sphinx/builder.py:408 +#, python-format +msgid "%b %d, %Y" +msgstr "%d.%b.%Y" + +#: sphinx/builder.py:427 sphinx/templates/defindex.html:21 +msgid "General Index" +msgstr "Algemene index" + +#: sphinx/builder.py:427 +msgid "index" +msgstr "Index" + +#: sphinx/builder.py:429 sphinx/htmlhelp.py:156 +#: sphinx/templates/defindex.html:19 sphinx/templates/modindex.html:2 +#: sphinx/templates/modindex.html:13 +msgid "Global Module Index" +msgstr "Globale Module-index" + +#: sphinx/builder.py:429 +msgid "modules" +msgstr "modules" + +#: sphinx/builder.py:466 +msgid "next" +msgstr "volgende" + +#: sphinx/builder.py:473 +msgid "previous" +msgstr "vorige" + +#: sphinx/builder.py:1054 +msgid " (in " +msgstr "" + +#: sphinx/builder.py:1129 +msgid "Builtins" +msgstr "Builtins" + +#: sphinx/builder.py:1131 +msgid "Module level" +msgstr "Moduleniveau" + +#: sphinx/environment.py:102 sphinx/latexwriter.py:169 +#, python-format +msgid "%B %d, %Y" +msgstr "%d. %B %Y" + +#: sphinx/environment.py:291 sphinx/latexwriter.py:175 +#: sphinx/templates/genindex-single.html:2 +#: sphinx/templates/genindex-split.html:2 +#: sphinx/templates/genindex-split.html:5 sphinx/templates/genindex.html:2 +#: sphinx/templates/genindex.html:5 sphinx/templates/genindex.html:48 +#: sphinx/templates/layout.html:130 +msgid "Index" +msgstr "Index" + +#: sphinx/environment.py:292 sphinx/latexwriter.py:174 +msgid "Module Index" +msgstr "Module-index" + +#: sphinx/environment.py:293 sphinx/templates/defindex.html:16 +msgid "Search Page" +msgstr "Zoekpagina" + +#: sphinx/htmlwriter.py:79 sphinx/static/doctools.js:145 +msgid "Permalink to this definition" +msgstr "Permanente link naar deze definitie" + +#: sphinx/htmlwriter.py:399 sphinx/static/doctools.js:139 +msgid "Permalink to this headline" +msgstr "Permanente link naar deze titel" + +#: sphinx/latexwriter.py:172 +msgid "Release" +msgstr "Release" + +#: sphinx/roles.py:53 sphinx/directives/desc.py:537 +#, python-format +msgid "environment variable; %s" +msgstr "Omgevingsvariabele; %s" + +#: sphinx/roles.py:60 +#, python-format +msgid "Python Enhancement Proposals!PEP %s" +msgstr "Python Enhancement Proposals!PEP %s" + +#: sphinx/textwriter.py:166 +#, python-format +msgid "Platform: %s" +msgstr "Platform: %s" + +#: sphinx/textwriter.py:422 +msgid "[image]" +msgstr "[afbeelding]" + +#: sphinx/directives/desc.py:25 +#, python-format +msgid "%s() (built-in function)" +msgstr "%s() (ge?ntegreerde functie)" + +#: sphinx/directives/desc.py:26 sphinx/directives/desc.py:42 +#: sphinx/directives/desc.py:54 +#, python-format +msgid "%s() (in module %s)" +msgstr "%s() (in module %s)" + +#: sphinx/directives/desc.py:29 +#, python-format +msgid "%s (built-in variable)" +msgstr "%s (ge?ntegreerde variabele)" + +#: sphinx/directives/desc.py:30 sphinx/directives/desc.py:66 +#, python-format +msgid "%s (in module %s)" +msgstr "%s (in module %s)" + +#: sphinx/directives/desc.py:33 +#, fuzzy, python-format +msgid "%s (built-in class)" +msgstr "%s (ge?ntegreerde variabele)" + +#: sphinx/directives/desc.py:34 +#, python-format +msgid "%s (class in %s)" +msgstr "%s (klasse in %s)" + +#: sphinx/directives/desc.py:46 +#, python-format +msgid "%s() (%s.%s method)" +msgstr "%s() (%s.%s methode)" + +#: sphinx/directives/desc.py:48 +#, python-format +msgid "%s() (%s method)" +msgstr "%s() (%s methode)" + +#: sphinx/directives/desc.py:58 +#, python-format +msgid "%s() (%s.%s static method)" +msgstr "%s() (%s.%s statische methode)" + +#: sphinx/directives/desc.py:60 +#, python-format +msgid "%s() (%s static method)" +msgstr "%s() (%s statische methode)" + +#: sphinx/directives/desc.py:70 +#, python-format +msgid "%s (%s.%s attribute)" +msgstr "%s (%s.%s attribuut)" + +#: sphinx/directives/desc.py:72 +#, python-format +msgid "%s (%s attribute)" +msgstr "%s (%s attribuut)" + +#: sphinx/directives/desc.py:74 +#, python-format +msgid "%s (C function)" +msgstr "%s (C-functie)" + +#: sphinx/directives/desc.py:76 +#, python-format +msgid "%s (C member)" +msgstr "%s (C member)" + +#: sphinx/directives/desc.py:78 +#, python-format +msgid "%s (C macro)" +msgstr "%s (C-macro)" + +#: sphinx/directives/desc.py:80 +#, python-format +msgid "%s (C type)" +msgstr "%s (C type)" + +#: sphinx/directives/desc.py:82 +#, python-format +msgid "%s (C variable)" +msgstr "%s (C-variabele)" + +#: sphinx/directives/desc.py:100 +msgid "Raises" +msgstr "Veroorzaakt" + +#: sphinx/directives/desc.py:104 +msgid "Variable" +msgstr "Variabele" + +#: sphinx/directives/desc.py:107 +msgid "Returns" +msgstr "Returns" + +#: sphinx/directives/desc.py:116 +msgid "Return type" +msgstr "Return type" + +#: sphinx/directives/desc.py:143 +msgid "Parameters" +msgstr "Parameters" + +#: sphinx/directives/desc.py:423 +#, fuzzy, python-format +msgid "%scommand line option; %s" +msgstr "%scommandolijn optie; %s" + +#: sphinx/directives/other.py:101 +msgid "Platforms: " +msgstr "Platformen: " + +#: sphinx/directives/other.py:106 +#, python-format +msgid "%s (module)" +msgstr "%s (module)" + +#: sphinx/directives/other.py:146 +msgid "Section author: " +msgstr "Auteur van deze sectie: " + +#: sphinx/directives/other.py:148 +msgid "Module author: " +msgstr "Auteur van deze module: " + +#: sphinx/directives/other.py:150 +msgid "Author: " +msgstr "Auteur: " + +#: sphinx/directives/other.py:246 +msgid "See also" +msgstr "Zie ook" + +#: sphinx/ext/todo.py:31 +msgid "Todo" +msgstr "" + +#: sphinx/ext/todo.py:75 +#, python-format +msgid "(The original entry is located in %s, line %d and can be found " +msgstr "" + +#: sphinx/ext/todo.py:81 +msgid "here" +msgstr "" + +#: sphinx/locale/__init__.py:15 +msgid "Attention" +msgstr "Let op!" + +#: sphinx/locale/__init__.py:16 +msgid "Caution" +msgstr "Pas op!" + +#: sphinx/locale/__init__.py:17 +msgid "Danger" +msgstr "Gevaar" + +#: sphinx/locale/__init__.py:18 +msgid "Error" +msgstr "Fout" + +#: sphinx/locale/__init__.py:19 +msgid "Hint" +msgstr "Hint" + +#: sphinx/locale/__init__.py:20 +msgid "Important" +msgstr "Belangrijk" + +#: sphinx/locale/__init__.py:21 +msgid "Note" +msgstr "Notitie" + +#: sphinx/locale/__init__.py:22 +msgid "See Also" +msgstr "Zie Ook" + +#: sphinx/locale/__init__.py:23 +msgid "Tip" +msgstr "Tip" + +#: sphinx/locale/__init__.py:24 +msgid "Warning" +msgstr "Waarschuwing" + +#: sphinx/locale/__init__.py:28 +#, python-format +msgid "New in version %s" +msgstr "Nieuw in versie %s" + +#: sphinx/locale/__init__.py:29 +#, python-format +msgid "Changed in version %s" +msgstr "Veranderd in versie %s" + +#: sphinx/locale/__init__.py:30 +#, python-format +msgid "Deprecated since version %s" +msgstr "Verouderd sinds versie %s" + +#: sphinx/locale/__init__.py:34 +msgid "module" +msgstr "module" + +#: sphinx/locale/__init__.py:35 +msgid "keyword" +msgstr "trefwoord" + +#: sphinx/locale/__init__.py:36 +msgid "operator" +msgstr "operator" + +#: sphinx/locale/__init__.py:37 +msgid "object" +msgstr "object" + +#: sphinx/locale/__init__.py:38 +msgid "exception" +msgstr "foutmelding" + +#: sphinx/locale/__init__.py:39 +msgid "statement" +msgstr "statement" + +#: sphinx/locale/__init__.py:40 +msgid "built-in function" +msgstr "ge?ntegreerde functie" + +#: sphinx/static/doctools.js:174 +msgid "Hide Search Matches" +msgstr "Zoekresultaten verbergen" + +#: sphinx/static/searchtools.js:274 +msgid "Searching" +msgstr "Zoeken" + +#: sphinx/static/searchtools.js:279 +msgid "Preparing search..." +msgstr "Het zoeken wordt voorbereid" + +#: sphinx/static/searchtools.js:338 +#, fuzzy +msgid "module, in " +msgstr "module" + +#: sphinx/static/searchtools.js:347 +msgid ", in " +msgstr "" + +#: sphinx/static/searchtools.js:447 sphinx/templates/search.html:18 +msgid "Search Results" +msgstr "Zoekresultaten" + +#: sphinx/static/searchtools.js:449 +msgid "" +"Your search did not match any documents. Please make sure that all words " +"are spelled correctly and that you've selected enough categories." +msgstr "" +"Uw zoekopdracht leverde geen resultaten op. Controleer of alle " +"woordencorrect gespeld zijn en dat u genoeg categori?n hebt geselecteerd." + +#: sphinx/static/searchtools.js:451 +#, python-format +msgid "Search finished, found %s page(s) matching the search query." +msgstr "Zoeken voltooid, %s pagina(s) gevonden." + +#: sphinx/templates/defindex.html:2 +msgid "Overview" +msgstr "Overzicht" + +#: sphinx/templates/defindex.html:11 +msgid "Indices and tables:" +msgstr "Indices en tabellen:" + +#: sphinx/templates/defindex.html:14 +msgid "Complete Table of Contents" +msgstr "Volledige inhoudstafel" + +#: sphinx/templates/defindex.html:15 +msgid "lists all sections and subsections" +msgstr "geeft alle secties en subsecties weer" + +#: sphinx/templates/defindex.html:17 +msgid "search this documentation" +msgstr "zoeken in deze documentatie" + +#: sphinx/templates/defindex.html:20 +msgid "quick access to all modules" +msgstr "sneltoegang naar alle modules" + +#: sphinx/templates/defindex.html:22 +msgid "all functions, classes, terms" +msgstr "alle functies, klasses en begrippen" + +#: sphinx/templates/genindex-single.html:5 +#, python-format +msgid "Index – %(key)s" +msgstr "Index – %(key)s" + +#: sphinx/templates/genindex-single.html:44 +#: sphinx/templates/genindex-split.html:14 +#: sphinx/templates/genindex-split.html:27 sphinx/templates/genindex.html:54 +msgid "Full index on one page" +msgstr "Volledige index op een pagina" + +#: sphinx/templates/genindex-split.html:7 +msgid "Index pages by letter" +msgstr "Index pagineerd per letter" + +#: sphinx/templates/genindex-split.html:15 +msgid "can be huge" +msgstr "kan heel groot zijn" + +#: sphinx/templates/layout.html:9 +msgid "Navigation" +msgstr "Navigatie" + +#: sphinx/templates/layout.html:40 +msgid "Table Of Contents" +msgstr "Inhoudstafel" + +#: sphinx/templates/layout.html:46 +msgid "Previous topic" +msgstr "Vorig onderwerp" + +#: sphinx/templates/layout.html:47 +msgid "previous chapter" +msgstr "Vorig hoofdstuk" + +#: sphinx/templates/layout.html:50 +msgid "Next topic" +msgstr "Volgend onderwerp" + +#: sphinx/templates/layout.html:51 +msgid "next chapter" +msgstr "volgend hoofdstuk" + +#: sphinx/templates/layout.html:55 +msgid "This Page" +msgstr "Deze Pagina" + +#: sphinx/templates/layout.html:59 +msgid "Suggest Change" +msgstr "Wijziging Voorstellen" + +#: sphinx/templates/layout.html:60 sphinx/templates/layout.html:62 +msgid "Show Source" +msgstr "Broncode weergeven" + +#: sphinx/templates/layout.html:71 +msgid "Quick search" +msgstr "Snel zoeken" + +#: sphinx/templates/layout.html:71 +msgid "Keyword search" +msgstr "Trefwoord opzoeken" + +#: sphinx/templates/layout.html:73 +msgid "Go" +msgstr "Go" + +#: sphinx/templates/layout.html:78 +msgid "Enter a module, class or function name." +msgstr "Geef de naam van een module, klasse of functie." + +#: sphinx/templates/layout.html:119 +#, python-format +msgid "Search within %(docstitle)s" +msgstr "Zoeken in %(docstitle)s" + +#: sphinx/templates/layout.html:128 +msgid "About these documents" +msgstr "Over deze documenten" + +#: sphinx/templates/layout.html:131 sphinx/templates/search.html:2 +#: sphinx/templates/search.html:5 +msgid "Search" +msgstr "Zoeken" + +#: sphinx/templates/layout.html:133 +msgid "Copyright" +msgstr "Copyright" + +#: sphinx/templates/layout.html:178 +#, python-format +msgid "© Copyright %(copyright)s." +msgstr "© Copyright %(copyright)s." + +#: sphinx/templates/layout.html:180 +#, python-format +msgid "© Copyright %(copyright)s." +msgstr "© Copyright %(copyright)s." + +#: sphinx/templates/layout.html:183 +#, python-format +msgid "Last updated on %(last_updated)s." +msgstr "Laatste aanpassing op %(last_updated)s." + +#: sphinx/templates/layout.html:186 +#, python-format +msgid "" +"Created using Sphinx " +"%(sphinx_version)s." +msgstr "" +"Aangemaakt met Sphinx " +"%(sphinx_version)s." + +#: sphinx/templates/modindex.html:15 +msgid "Most popular modules:" +msgstr "Populairste modules:" + +#: sphinx/templates/modindex.html:24 +msgid "Show modules only available on these platforms" +msgstr "Enkel modules weergeven die op deze platformen beschikbaar zijn" + +#: sphinx/templates/modindex.html:56 +msgid "Deprecated" +msgstr "Verouderd" + +#: sphinx/templates/opensearch.xml:4 +#, python-format +msgid "Search %(docstitle)s" +msgstr "Zoeken %(docstitle)s" + +#: sphinx/templates/page.html:8 +msgid "" +"Note: You requested an out-of-date URL from this server." +" We've tried to redirect you to the new location of this page, but it may" +" not be the right one." +msgstr "" +"Opgelet: U heeft een verouderde URL aangevraagd op deze " +"server. Wij hebben probeerd u door te verwijzen naar de nieuwe locatie " +"van deze pagina, maar dat is misschien niet gelukt." + +#: sphinx/templates/search.html:7 +#, fuzzy +msgid "" +"From here you can search these documents. Enter your search\n" +" words into the box below and click \"search\". Note that the search\n" +" function will automatically search for all of the words. Pages\n" +" containing fewer words won't appear in the result list." +msgstr "" +"Hier kan u de documenten doorzoeken. Geef enkele trefwoorden\n" +" in het veld hieronder en klik \"zoeken\". Merk op dat de zoekfunctie" +"\n" +" steeds naar alle woorden zoekt. Pagina's die minder woorden bevatten" +"\n" +" zullen niet tussen de resultaten verschijnen." + +#: sphinx/templates/search.html:14 +msgid "search" +msgstr "zoeken" + +#: sphinx/templates/search.html:20 +msgid "Your search did not match any results." +msgstr "Uw zoekopdracht leverde geen resultaten op." + +#: sphinx/templates/changes/frameset.html:5 +#: sphinx/templates/changes/versionchanges.html:12 +#, python-format +msgid "Changes in Version %(version)s — %(docstitle)s" +msgstr "Veranderingen in versie %(version)s — %(docstitle)s" + +#: sphinx/templates/changes/rstsource.html:5 +#, python-format +msgid "%(filename)s — %(docstitle)s" +msgstr "%(filename)s — %(docstitle)s" + +#: sphinx/templates/changes/versionchanges.html:17 +#, python-format +msgid "Automatically generated list of changes in version %(version)s" +msgstr "Automatisch genereerde lijst van veranderingen in versie %(version)s" + +#: sphinx/templates/changes/versionchanges.html:18 +msgid "Library changes" +msgstr "Veranderingen in de bibliotheek" + +#: sphinx/templates/changes/versionchanges.html:23 +msgid "C API changes" +msgstr "Veranderingen in de C-API" + +#: sphinx/templates/changes/versionchanges.html:25 +msgid "Other changes" +msgstr "Andere veranderingen" + Modified: doctools/trunk/sphinx/locale/pl/LC_MESSAGES/sphinx.js ============================================================================== --- doctools/trunk/sphinx/locale/pl/LC_MESSAGES/sphinx.js (original) +++ doctools/trunk/sphinx/locale/pl/LC_MESSAGES/sphinx.js Fri Dec 5 20:10:41 2008 @@ -1 +1 @@ -Documentation.addTranslations({"locale": "pl", "plural_expr": "(n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2)", "messages": {"Search Results": "Wyniki wyszukiwania", "Preparing search...": "Przygotowanie wyszukiwania...", "Your search did not match any documents. Please make sure that all words are spelled correctly and that you've selected enough categories.": "Nie znaleziono \u017cadnych pasuj\u0105cych dokument\u00f3w. Upewnij si\u0119, \u017ce wszystkie s\u0142owa s\u0105 poprawnie wpisane i \u017ce wybra\u0142e\u015b wystarczaj\u0105c\u0105liczb\u0119 kategorii.", "Search finished, found %s page(s) matching the search query.": "Przeszukiwanie zako\u0144czone, znaleziono %s pasuj\u0105cych stron.", "Permalink to this headline": "Sta\u0142y odno\u015bnik do tego nag\u0142\u00f3wka", "Searching": "Wyszukiwanie", "Permalink to this definition": "Sta\u0142y odno\u015bnik do tej definicji", "Hide Search Matches": "Ukryj wyniki wyszukiwania"}}); \ No newline at end of file +Documentation.addTranslations({"locale": "pl", "plural_expr": "(n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2)", "messages": {"module, in ": "modu\u0142", "Preparing search...": "Przygotowanie wyszukiwania...", "Your search did not match any documents. Please make sure that all words are spelled correctly and that you've selected enough categories.": "Nie znaleziono \u017cadnych pasuj\u0105cych dokument\u00f3w. Upewnij si\u0119, \u017ce wszystkie s\u0142owa s\u0105 poprawnie wpisane i \u017ce wybra\u0142e\u015b wystarczaj\u0105c\u0105liczb\u0119 kategorii.", "Search finished, found %s page(s) matching the search query.": "Przeszukiwanie zako\u0144czone, znaleziono %s pasuj\u0105cych stron.", ", in ": "", "Permalink to this headline": "Sta\u0142y odno\u015bnik do tego nag\u0142\u00f3wka", "Searching": "Wyszukiwanie", "Permalink to this definition": "Sta\u0142y odno\u015bnik do tej definicji", "Hide Search Matches": "Ukryj wyniki wyszukiwania", "Search Results": "Wyniki wyszukiwania"}}); \ No newline at end of file Modified: doctools/trunk/sphinx/locale/pl/LC_MESSAGES/sphinx.mo ============================================================================== Binary files. No diff available. Modified: doctools/trunk/sphinx/locale/pl/LC_MESSAGES/sphinx.po ============================================================================== --- doctools/trunk/sphinx/locale/pl/LC_MESSAGES/sphinx.po (original) +++ doctools/trunk/sphinx/locale/pl/LC_MESSAGES/sphinx.po Fri Dec 5 20:10:41 2008 @@ -1,9 +1,10 @@ + msgid "" msgstr "" "Project-Id-Version: Sphinx 0.5\n" "Report-Msgid-Bugs-To: EMAIL at ADDRESS\n" "POT-Creation-Date: 2008-08-10 11:43+0000\n" -"PO-Revision-Date: 2008-09-16 15:47+0100\n" +"PO-Revision-Date: 2008-11-27 18:40+0100\n" "Last-Translator: Micha? Kandulski \n" "Language-Team: \n" "Plural-Forms: nplurals=3; plural=(n==1 ? 0 : n%10>=2 && n%10<=4 && " @@ -11,244 +12,253 @@ "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=utf-8\n" "Content-Transfer-Encoding: 8bit\n" -"Generated-By: Babel 0.9.3\n" +"Generated-By: Babel 0.9.4\n" -#: sphinx/builder.py:400 +#: sphinx/builder.py:408 #, python-format msgid "%b %d, %Y" msgstr "%b %d %Y" -#: sphinx/builder.py:419 -#: sphinx/templates/defindex.html:21 +#: sphinx/builder.py:427 sphinx/templates/defindex.html:21 msgid "General Index" msgstr "Indeks og?lny" -#: sphinx/builder.py:419 +#: sphinx/builder.py:427 msgid "index" msgstr "indeks" -#: sphinx/builder.py:421 -#: sphinx/htmlhelp.py:155 -#: sphinx/templates/defindex.html:19 -#: sphinx/templates/modindex.html:2 +#: sphinx/builder.py:429 sphinx/htmlhelp.py:156 +#: sphinx/templates/defindex.html:19 sphinx/templates/modindex.html:2 #: sphinx/templates/modindex.html:13 msgid "Global Module Index" msgstr "Indeks modu??w" -#: sphinx/builder.py:421 +#: sphinx/builder.py:429 msgid "modules" msgstr "modu?y" -#: sphinx/builder.py:457 +#: sphinx/builder.py:466 msgid "next" msgstr "dalej" -#: sphinx/builder.py:464 +#: sphinx/builder.py:473 msgid "previous" msgstr "wstecz" -#: sphinx/builder.py:1108 +#: sphinx/builder.py:1054 +msgid " (in " +msgstr "" + +#: sphinx/builder.py:1129 msgid "Builtins" msgstr "Wbudowane" -#: sphinx/builder.py:1110 +#: sphinx/builder.py:1131 msgid "Module level" msgstr "Poziom modu?u" -#: sphinx/environment.py:107 -#: sphinx/latexwriter.py:129 +#: sphinx/environment.py:102 sphinx/latexwriter.py:169 #, python-format msgid "%B %d, %Y" msgstr "%B %d %Y" -#: sphinx/environment.py:270 -#: sphinx/latexwriter.py:190 +#: sphinx/environment.py:291 sphinx/latexwriter.py:175 #: sphinx/templates/genindex-single.html:2 #: sphinx/templates/genindex-split.html:2 -#: sphinx/templates/genindex-split.html:5 -#: sphinx/templates/genindex.html:2 -#: sphinx/templates/genindex.html:5 -#: sphinx/templates/genindex.html:48 +#: sphinx/templates/genindex-split.html:5 sphinx/templates/genindex.html:2 +#: sphinx/templates/genindex.html:5 sphinx/templates/genindex.html:48 +#: sphinx/templates/layout.html:130 msgid "Index" msgstr "Indeks" -#: sphinx/environment.py:271 -#: sphinx/latexwriter.py:188 +#: sphinx/environment.py:292 sphinx/latexwriter.py:174 msgid "Module Index" msgstr "Indeks modu??w" -#: sphinx/environment.py:272 -#: sphinx/templates/defindex.html:16 +#: sphinx/environment.py:293 sphinx/templates/defindex.html:16 msgid "Search Page" msgstr "Wyszukiwanie" -#: sphinx/htmlwriter.py:73 -#: sphinx/static/doctools.js:145 +#: sphinx/htmlwriter.py:79 sphinx/static/doctools.js:145 msgid "Permalink to this definition" msgstr "Sta?y odno?nik do tej definicji" -#: sphinx/htmlwriter.py:375 -#: sphinx/static/doctools.js:139 +#: sphinx/htmlwriter.py:399 sphinx/static/doctools.js:139 msgid "Permalink to this headline" msgstr "Sta?y odno?nik do tego nag??wka" -#: sphinx/latexwriter.py:143 +#: sphinx/latexwriter.py:172 msgid "Release" msgstr "Wydanie" -#: sphinx/roles.py:52 -#: sphinx/directives/desc.py:514 +#: sphinx/roles.py:53 sphinx/directives/desc.py:537 #, python-format msgid "environment variable; %s" msgstr "zmienna ?rodowiskowa; %s" -#: sphinx/roles.py:59 +#: sphinx/roles.py:60 #, python-format msgid "Python Enhancement Proposals!PEP %s" msgstr "Python Enhancement Proposals!PEP %s" -#: sphinx/textwriter.py:151 +#: sphinx/textwriter.py:166 #, python-format msgid "Platform: %s" msgstr "Platforma: %s" -#: sphinx/textwriter.py:353 +#: sphinx/textwriter.py:422 msgid "[image]" msgstr "[obrazek]" -#: sphinx/directives/desc.py:26 +#: sphinx/directives/desc.py:25 #, python-format msgid "%s() (built-in function)" msgstr "%s() (funkcja wbudowana)" -#: sphinx/directives/desc.py:27 -#: sphinx/directives/desc.py:41 -#: sphinx/directives/desc.py:53 +#: sphinx/directives/desc.py:26 sphinx/directives/desc.py:42 +#: sphinx/directives/desc.py:54 #, python-format msgid "%s() (in module %s)" msgstr "%s() (w module %s)" -#: sphinx/directives/desc.py:30 +#: sphinx/directives/desc.py:29 #, python-format msgid "%s (built-in variable)" msgstr "%s (zmienna wbudowana)" -#: sphinx/directives/desc.py:31 -#: sphinx/directives/desc.py:65 +#: sphinx/directives/desc.py:30 sphinx/directives/desc.py:66 #, python-format msgid "%s (in module %s)" msgstr "%s (w module %s)" #: sphinx/directives/desc.py:33 +#, fuzzy, python-format +msgid "%s (built-in class)" +msgstr "%s (zmienna wbudowana)" + +#: sphinx/directives/desc.py:34 #, python-format msgid "%s (class in %s)" msgstr "%s (w klasie %s)" -#: sphinx/directives/desc.py:45 +#: sphinx/directives/desc.py:46 #, python-format msgid "%s() (%s.%s method)" msgstr "%s() (%s.%s metoda)" -#: sphinx/directives/desc.py:47 +#: sphinx/directives/desc.py:48 #, python-format msgid "%s() (%s method)" msgstr "%s() (%s metoda)" -#: sphinx/directives/desc.py:57 +#: sphinx/directives/desc.py:58 #, python-format msgid "%s() (%s.%s static method)" msgstr "%s() (%s.%s statyczna metoda)" -#: sphinx/directives/desc.py:59 +#: sphinx/directives/desc.py:60 #, python-format msgid "%s() (%s static method)" msgstr "%s() (%s statyczna metoda)" -#: sphinx/directives/desc.py:69 +#: sphinx/directives/desc.py:70 #, python-format msgid "%s (%s.%s attribute)" msgstr "%s (%s.%s atrybut)" -#: sphinx/directives/desc.py:71 +#: sphinx/directives/desc.py:72 #, python-format msgid "%s (%s attribute)" msgstr "%s (%s atrybut)" -#: sphinx/directives/desc.py:73 +#: sphinx/directives/desc.py:74 #, python-format msgid "%s (C function)" msgstr "%s (funkcja C)" -#: sphinx/directives/desc.py:75 +#: sphinx/directives/desc.py:76 #, python-format msgid "%s (C member)" msgstr "%s (pole C)" -#: sphinx/directives/desc.py:77 +#: sphinx/directives/desc.py:78 #, python-format msgid "%s (C macro)" msgstr "%s (makro C)" -#: sphinx/directives/desc.py:79 +#: sphinx/directives/desc.py:80 #, python-format msgid "%s (C type)" msgstr "%s (typ C)" -#: sphinx/directives/desc.py:81 +#: sphinx/directives/desc.py:82 #, python-format msgid "%s (C variable)" msgstr "%s (zmienna C)" -#: sphinx/directives/desc.py:99 +#: sphinx/directives/desc.py:100 msgid "Raises" msgstr "Wyrzuca" -#: sphinx/directives/desc.py:103 +#: sphinx/directives/desc.py:104 msgid "Variable" msgstr "Zmienna" -#: sphinx/directives/desc.py:106 +#: sphinx/directives/desc.py:107 msgid "Returns" msgstr "Zwraca" -#: sphinx/directives/desc.py:113 +#: sphinx/directives/desc.py:116 msgid "Return type" msgstr "Typ zwracany" -#: sphinx/directives/desc.py:140 +#: sphinx/directives/desc.py:143 msgid "Parameters" msgstr "Parametry" -#: sphinx/directives/desc.py:402 -#, python-format -msgid "command line option; %s" -msgstr "opcja linii komend; %s" +#: sphinx/directives/desc.py:423 +#, fuzzy, python-format +msgid "%scommand line option; %s" +msgstr "%sopcja linii komend; %s" -#: sphinx/directives/other.py:102 +#: sphinx/directives/other.py:101 msgid "Platforms: " msgstr "Platformy: " -#: sphinx/directives/other.py:107 +#: sphinx/directives/other.py:106 #, python-format msgid "%s (module)" msgstr "%s (modu?)" -#: sphinx/directives/other.py:147 +#: sphinx/directives/other.py:146 msgid "Section author: " msgstr "Autor rozdzia?u: " -#: sphinx/directives/other.py:149 +#: sphinx/directives/other.py:148 msgid "Module author: " msgstr "Autor modu?u: " -#: sphinx/directives/other.py:151 +#: sphinx/directives/other.py:150 msgid "Author: " msgstr "Autor: " -#: sphinx/directives/other.py:233 +#: sphinx/directives/other.py:246 msgid "See also" msgstr "Zobacz tak?e" +#: sphinx/ext/todo.py:31 +msgid "Todo" +msgstr "" + +#: sphinx/ext/todo.py:75 +#, python-format +msgid "(The original entry is located in %s, line %d and can be found " +msgstr "" + +#: sphinx/ext/todo.py:81 +msgid "here" +msgstr "" + #: sphinx/locale/__init__.py:15 msgid "Attention" msgstr "Uwaga" @@ -344,21 +354,28 @@ msgid "Preparing search..." msgstr "Przygotowanie wyszukiwania..." -#: sphinx/static/searchtools.js:401 -#: sphinx/templates/search.html:18 +#: sphinx/static/searchtools.js:338 +#, fuzzy +msgid "module, in " +msgstr "modu?" + +#: sphinx/static/searchtools.js:347 +msgid ", in " +msgstr "" + +#: sphinx/static/searchtools.js:447 sphinx/templates/search.html:18 msgid "Search Results" msgstr "Wyniki wyszukiwania" -#: sphinx/static/searchtools.js:403 +#: sphinx/static/searchtools.js:449 msgid "" "Your search did not match any documents. Please make sure that all words " "are spelled correctly and that you've selected enough categories." msgstr "" -"Nie znaleziono ?adnych pasuj?cych dokument?w. Upewnij si?, ?e " -"wszystkie s?owa s? poprawnie wpisane i ?e wybra?e? wystarczaj?c?" -"liczb? kategorii." +"Nie znaleziono ?adnych pasuj?cych dokument?w. Upewnij si?, ?e wszystkie " +"s?owa s? poprawnie wpisane i ?e wybra?e? wystarczaj?c?liczb? kategorii." -#: sphinx/static/searchtools.js:405 +#: sphinx/static/searchtools.js:451 #, python-format msgid "Search finished, found %s page(s) matching the search query." msgstr "Przeszukiwanie zako?czone, znaleziono %s pasuj?cych stron." @@ -398,8 +415,7 @@ #: sphinx/templates/genindex-single.html:44 #: sphinx/templates/genindex-split.html:14 -#: sphinx/templates/genindex-split.html:27 -#: sphinx/templates/genindex.html:54 +#: sphinx/templates/genindex-split.html:27 sphinx/templates/genindex.html:54 msgid "Full index on one page" msgstr "Ca?y indeks na jednej stronie" @@ -443,8 +459,7 @@ msgid "Suggest Change" msgstr "Zasugeruj zmian?" -#: sphinx/templates/layout.html:60 -#: sphinx/templates/layout.html:62 +#: sphinx/templates/layout.html:60 sphinx/templates/layout.html:62 msgid "Show Source" msgstr "Poka? ?r?d?o" @@ -464,25 +479,16 @@ msgid "Enter a module, class or function name." msgstr "Wprowad? nazw? modu?u, klasy lub funkcji." -#: sphinx/templates/layout.html:118 +#: sphinx/templates/layout.html:119 #, python-format msgid "Search within %(docstitle)s" msgstr "Szukaj po?r?d %(docstitle)s" -#: sphinx/templates/layout.html:127 +#: sphinx/templates/layout.html:128 msgid "About these documents" msgstr "O tych dokumentach" -#: sphinx/templates/layout.html:129 -msgid "Global table of contents" -msgstr "Globalny spis tre?ci" - -#: sphinx/templates/layout.html:130 -msgid "Global index" -msgstr "Globalny indeks" - -#: sphinx/templates/layout.html:131 -#: sphinx/templates/search.html:2 +#: sphinx/templates/layout.html:131 sphinx/templates/search.html:2 #: sphinx/templates/search.html:5 msgid "Search" msgstr "Szukaj" @@ -538,22 +544,23 @@ " We've tried to redirect you to the new location of this page, but it may" " not be the right one." msgstr "" -"Uwaga: Za??dano przedawnionego URL'a z tego serwera." -" Nast?pi?a pr?ba przekierowania do nowej lokalizacji, ale mo?e ona " -"by? niew?a?ciwa." +"Uwaga: Za??dano przedawnionego URL'a z tego serwera. " +"Nast?pi?a pr?ba przekierowania do nowej lokalizacji, ale mo?e ona by? " +"niew?a?ciwa." #: sphinx/templates/search.html:7 +#, fuzzy msgid "" "From here you can search these documents. Enter your search\n" " words into the box below and click \"search\". Note that the search\n" " function will automatically search for all of the words. Pages\n" -" containing less words won't appear in the result list." +" containing fewer words won't appear in the result list." msgstr "" "St?d mo?esz przeszuka? dokumentacj?. Wprowad? szukane\n" " s?owa w poni?szym okienku i kliknij \"Szukaj\". Zwr?? uwag?, ?e\n" -" funkcja szukaj?ca b?dzie automatycznie szuka?a wszystkich s??w. " -" Strony nie zawieraj?ce wszystkich s??w nie znajd? si? na wynikowej " -" li?cie." +" funkcja szukaj?ca b?dzie automatycznie szuka?a wszystkich s??w. " +"Strony nie zawieraj?ce wszystkich s??w nie znajd? si? na wynikowej " +"li?cie." #: sphinx/templates/search.html:14 msgid "search" Added: doctools/trunk/sphinx/locale/pt_BR/LC_MESSAGES/sphinx.js ============================================================================== --- (empty file) +++ doctools/trunk/sphinx/locale/pt_BR/LC_MESSAGES/sphinx.js Fri Dec 5 20:10:41 2008 @@ -0,0 +1 @@ +Documentation.addTranslations({"locale": "pt_BR", "plural_expr": "(n > 1)", "messages": {"module, in ": "m\u00f3dulo, em ", "Preparing search...": "Preparando pesquisa...", "Your search did not match any documents. Please make sure that all words are spelled correctly and that you've selected enough categories.": "Sua pesquisa n\u00e3o encontrou nenhum documento. Por favor assegure-se de que todas as palavras foram digitadas corretamente e de que voc\u00ea tenha selecionado o m\u00ednimo de categorias.", "Search finished, found %s page(s) matching the search query.": "Pesquisa finalizada, foram encontrada(s) %s p\u00e1gina(s) que conferem com o crit\u00e9rio de pesquisa.", ", in ": ", em ", "Permalink to this headline": "Link permanente para este t\u00edtulo", "Searching": "Pesquisando", "Permalink to this definition": "Link permanente para esta defini\u00e7\u00e3o", "Hide Search Matches": "Esconder Resultados da Pesquisa", "Search Results": "Resultados da Pesquisa"}}); \ No newline at end of file Added: doctools/trunk/sphinx/locale/pt_BR/LC_MESSAGES/sphinx.mo ============================================================================== Binary file. No diff available. Added: doctools/trunk/sphinx/locale/pt_BR/LC_MESSAGES/sphinx.po ============================================================================== --- (empty file) +++ doctools/trunk/sphinx/locale/pt_BR/LC_MESSAGES/sphinx.po Fri Dec 5 20:10:41 2008 @@ -0,0 +1,606 @@ +# Portuguese (Brazil) translations for Sphinx. +# Copyright (C) 2008 ORGANIZATION +# This file is distributed under the same license as the Sphinx project. +# FIRST AUTHOR , 2008. +# +msgid "" +msgstr "" +"Project-Id-Version: Sphinx 0.5\n" +"Report-Msgid-Bugs-To: roger.demetrescu at gmail.com\n" +"POT-Creation-Date: 2008-11-09 19:46+0100\n" +"PO-Revision-Date: 2008-11-27 18:40+0100\n" +"Last-Translator: Roger Demetrescu \n" +"Language-Team: pt_BR \n" +"Plural-Forms: nplurals=2; plural=(n > 1)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Generated-By: Babel 0.9.4\n" + +#: sphinx/builder.py:408 +#, python-format +msgid "%b %d, %Y" +msgstr "%d/%m/%Y" + +#: sphinx/builder.py:427 sphinx/templates/defindex.html:21 +msgid "General Index" +msgstr "?ndice Geral" + +#: sphinx/builder.py:427 +msgid "index" +msgstr "?ndice" + +#: sphinx/builder.py:429 sphinx/htmlhelp.py:156 +#: sphinx/templates/defindex.html:19 sphinx/templates/modindex.html:2 +#: sphinx/templates/modindex.html:13 +msgid "Global Module Index" +msgstr "?ndice Global de M?dulos" + +#: sphinx/builder.py:429 +msgid "modules" +msgstr "m?dulos" + +#: sphinx/builder.py:466 +msgid "next" +msgstr "pr?ximo" + +#: sphinx/builder.py:473 +msgid "previous" +msgstr "anterior" + +#: sphinx/builder.py:1054 +msgid " (in " +msgstr " (em " + +#: sphinx/builder.py:1129 +msgid "Builtins" +msgstr "Internos" + +#: sphinx/builder.py:1131 +msgid "Module level" +msgstr "M?dulo" + +#: sphinx/environment.py:102 sphinx/latexwriter.py:169 +#, python-format +msgid "%B %d, %Y" +msgstr "%d/%m/%Y" + +#: sphinx/environment.py:291 sphinx/latexwriter.py:175 +#: sphinx/templates/genindex-single.html:2 +#: sphinx/templates/genindex-split.html:2 +#: sphinx/templates/genindex-split.html:5 sphinx/templates/genindex.html:2 +#: sphinx/templates/genindex.html:5 sphinx/templates/genindex.html:48 +#: sphinx/templates/layout.html:130 +msgid "Index" +msgstr "?ndice" + +#: sphinx/environment.py:292 sphinx/latexwriter.py:174 +msgid "Module Index" +msgstr "?ndice do M?dulo" + +#: sphinx/environment.py:293 sphinx/templates/defindex.html:16 +msgid "Search Page" +msgstr "P?gina de Pesquisa" + +#: sphinx/htmlwriter.py:79 sphinx/static/doctools.js:145 +msgid "Permalink to this definition" +msgstr "Link permanente para esta defini??o" + +#: sphinx/htmlwriter.py:399 sphinx/static/doctools.js:139 +msgid "Permalink to this headline" +msgstr "Link permanente para este t?tulo" + +#: sphinx/latexwriter.py:172 +msgid "Release" +msgstr "Vers?o" + +#: sphinx/roles.py:53 sphinx/directives/desc.py:537 +#, python-format +msgid "environment variable; %s" +msgstr "v?riavel de ambiente; %s" + +#: sphinx/roles.py:60 +#, python-format +msgid "Python Enhancement Proposals!PEP %s" +msgstr "Python Enhancement Proposals!PEP %s" + +#: sphinx/textwriter.py:166 +#, python-format +msgid "Platform: %s" +msgstr "Plataforma: %s" + +#: sphinx/textwriter.py:422 +msgid "[image]" +msgstr "[imagem]" + +#: sphinx/directives/desc.py:25 +#, python-format +msgid "%s() (built-in function)" +msgstr "%s() (fun??o interna)" + +#: sphinx/directives/desc.py:26 sphinx/directives/desc.py:42 +#: sphinx/directives/desc.py:54 +#, python-format +msgid "%s() (in module %s)" +msgstr "%s() (no m?dulo %s)" + +#: sphinx/directives/desc.py:29 +#, python-format +msgid "%s (built-in variable)" +msgstr "%s (vari?vel interna)" + +#: sphinx/directives/desc.py:30 sphinx/directives/desc.py:66 +#, python-format +msgid "%s (in module %s)" +msgstr "%s (no m?dulo %s)" + +#: sphinx/directives/desc.py:33 +#, python-format +msgid "%s (built-in class)" +msgstr "%s (classe interna)" + +#: sphinx/directives/desc.py:34 +#, python-format +msgid "%s (class in %s)" +msgstr "%s (classe em %s)" + +#: sphinx/directives/desc.py:46 +#, python-format +msgid "%s() (%s.%s method)" +msgstr "%s() (m?todo %s.%s)" + +#: sphinx/directives/desc.py:48 +#, python-format +msgid "%s() (%s method)" +msgstr "%s() (m?todo %s)" + +#: sphinx/directives/desc.py:58 +#, python-format +msgid "%s() (%s.%s static method)" +msgstr "%s() (m?todo est?tico %s.%s)" + +#: sphinx/directives/desc.py:60 +#, python-format +msgid "%s() (%s static method)" +msgstr "%s() (m?todo est?tico %s)" + +#: sphinx/directives/desc.py:70 +#, python-format +msgid "%s (%s.%s attribute)" +msgstr "%s (atributo %s.%s)" + +#: sphinx/directives/desc.py:72 +#, python-format +msgid "%s (%s attribute)" +msgstr "%s (atributo %s)" + +#: sphinx/directives/desc.py:74 +#, python-format +msgid "%s (C function)" +msgstr "%s (fun??o C)" + +#: sphinx/directives/desc.py:76 +#, python-format +msgid "%s (C member)" +msgstr "%s (membro C)" + +#: sphinx/directives/desc.py:78 +#, python-format +msgid "%s (C macro)" +msgstr "%s (macro C)" + +#: sphinx/directives/desc.py:80 +#, python-format +msgid "%s (C type)" +msgstr "%s (tipo C)" + +#: sphinx/directives/desc.py:82 +#, python-format +msgid "%s (C variable)" +msgstr "%s (vari?vel C)" + +#: sphinx/directives/desc.py:100 +msgid "Raises" +msgstr "Levanta" + +#: sphinx/directives/desc.py:104 +msgid "Variable" +msgstr "Vari?vel" + +#: sphinx/directives/desc.py:107 +msgid "Returns" +msgstr "Retorna" + +#: sphinx/directives/desc.py:116 +msgid "Return type" +msgstr "Tipo de retorno" + +#: sphinx/directives/desc.py:143 +msgid "Parameters" +msgstr "Par?metros" + +#: sphinx/directives/desc.py:423 +#, python-format +msgid "%scommand line option; %s" +msgstr "%sop??o de linha de comando; %s" + +#: sphinx/directives/other.py:101 +msgid "Platforms: " +msgstr "Plataformas: " + +#: sphinx/directives/other.py:106 +#, python-format +msgid "%s (module)" +msgstr "%s (m?dulo)" + +#: sphinx/directives/other.py:146 +msgid "Section author: " +msgstr "Autor da se??o: " + +#: sphinx/directives/other.py:148 +msgid "Module author: " +msgstr "Autor do m?dulo: " + +#: sphinx/directives/other.py:150 +msgid "Author: " +msgstr "Autor: " + +#: sphinx/directives/other.py:246 +msgid "See also" +msgstr "Veja tamb?m" + +#: sphinx/ext/todo.py:31 +msgid "Todo" +msgstr "Por fazer" + +#: sphinx/ext/todo.py:75 +#, python-format +msgid "(The original entry is located in %s, line %d and can be found " +msgstr "(A entrada original est? localizada em %s, linha %d e pode ser encontrada " + +#: sphinx/ext/todo.py:81 +msgid "here" +msgstr "aqui" + +#: sphinx/locale/__init__.py:15 +msgid "Attention" +msgstr "Aten??o" + +#: sphinx/locale/__init__.py:16 +msgid "Caution" +msgstr "Cuidado" + +#: sphinx/locale/__init__.py:17 +msgid "Danger" +msgstr "Perigo" + +#: sphinx/locale/__init__.py:18 +msgid "Error" +msgstr "Erro" + +#: sphinx/locale/__init__.py:19 +msgid "Hint" +msgstr "Dica" + +#: sphinx/locale/__init__.py:20 +msgid "Important" +msgstr "Importante" + +#: sphinx/locale/__init__.py:21 +msgid "Note" +msgstr "Nota" + +#: sphinx/locale/__init__.py:22 +msgid "See Also" +msgstr "Veja Tamb?m" + +#: sphinx/locale/__init__.py:23 +msgid "Tip" +msgstr "Dica" + +#: sphinx/locale/__init__.py:24 +msgid "Warning" +msgstr "Aviso" + +#: sphinx/locale/__init__.py:28 +#, python-format +msgid "New in version %s" +msgstr "Novo na vers?o %s" + +#: sphinx/locale/__init__.py:29 +#, python-format +msgid "Changed in version %s" +msgstr "Alterado na vers?o %s" + +#: sphinx/locale/__init__.py:30 +#, python-format +msgid "Deprecated since version %s" +msgstr "Obsoleto desde a vers?o %s" + +#: sphinx/locale/__init__.py:34 +msgid "module" +msgstr "m?dulo" + +#: sphinx/locale/__init__.py:35 +msgid "keyword" +msgstr "palavra-chave" + +#: sphinx/locale/__init__.py:36 +msgid "operator" +msgstr "operador" + +#: sphinx/locale/__init__.py:37 +msgid "object" +msgstr "objeto" + +#: sphinx/locale/__init__.py:38 +msgid "exception" +msgstr "exce??o" + +#: sphinx/locale/__init__.py:39 +msgid "statement" +msgstr "comando" + +#: sphinx/locale/__init__.py:40 +msgid "built-in function" +msgstr "fun??o interna" + +#: sphinx/static/doctools.js:174 +msgid "Hide Search Matches" +msgstr "Esconder Resultados da Pesquisa" + +#: sphinx/static/searchtools.js:274 +msgid "Searching" +msgstr "Pesquisando" + +#: sphinx/static/searchtools.js:279 +msgid "Preparing search..." +msgstr "Preparando pesquisa..." + +#: sphinx/static/searchtools.js:338 +msgid "module, in " +msgstr "m?dulo, em " + +#: sphinx/static/searchtools.js:347 +msgid ", in " +msgstr ", em " + +#: sphinx/static/searchtools.js:447 sphinx/templates/search.html:18 +msgid "Search Results" +msgstr "Resultados da Pesquisa" + +#: sphinx/static/searchtools.js:449 +msgid "" +"Your search did not match any documents. Please make sure that all words " +"are spelled correctly and that you've selected enough categories." +msgstr "" +"Sua pesquisa n?o encontrou nenhum documento. Por favor assegure-se de que" +" todas as palavras foram digitadas corretamente e de que voc? tenha " +"selecionado o m?nimo de categorias." + +#: sphinx/static/searchtools.js:451 +#, python-format +msgid "Search finished, found %s page(s) matching the search query." +msgstr "" +"Pesquisa finalizada, foram encontrada(s) %s p?gina(s) que conferem com o " +"crit?rio de pesquisa." + +#: sphinx/templates/defindex.html:2 +msgid "Overview" +msgstr "Vis?o geral" + +#: sphinx/templates/defindex.html:11 +msgid "Indices and tables:" +msgstr "?ndices e tabelas:" + +#: sphinx/templates/defindex.html:14 +msgid "Complete Table of Contents" +msgstr "Tabela de Conte?do Completa" + +#: sphinx/templates/defindex.html:15 +msgid "lists all sections and subsections" +msgstr "Lista todas se??es e subse??es" + +#: sphinx/templates/defindex.html:17 +msgid "search this documentation" +msgstr "Pesquisar esta documenta??o" + +#: sphinx/templates/defindex.html:20 +msgid "quick access to all modules" +msgstr "acesso r?pido para todos os m?dulos" + +#: sphinx/templates/defindex.html:22 +msgid "all functions, classes, terms" +msgstr "todas fun??es, classes, termos" + +#: sphinx/templates/genindex-single.html:5 +#, python-format +msgid "Index – %(key)s" +msgstr "?ndice – %(key)s" + +#: sphinx/templates/genindex-single.html:44 +#: sphinx/templates/genindex-split.html:14 +#: sphinx/templates/genindex-split.html:27 sphinx/templates/genindex.html:54 +msgid "Full index on one page" +msgstr "?ndice completo em uma p?gina" + +#: sphinx/templates/genindex-split.html:7 +msgid "Index pages by letter" +msgstr "Paginas de ?ndice por letra" + +#: sphinx/templates/genindex-split.html:15 +msgid "can be huge" +msgstr "pode ser enorme" + +#: sphinx/templates/layout.html:9 +msgid "Navigation" +msgstr "Navega??o" + +#: sphinx/templates/layout.html:40 +msgid "Table Of Contents" +msgstr "Tabela de Conte?do" + +#: sphinx/templates/layout.html:46 +msgid "Previous topic" +msgstr "T?pico anterior" + +#: sphinx/templates/layout.html:47 +msgid "previous chapter" +msgstr "cap?tulo anterior" + +#: sphinx/templates/layout.html:50 +msgid "Next topic" +msgstr "Pr?ximo t?pico" + +#: sphinx/templates/layout.html:51 +msgid "next chapter" +msgstr "pr?ximo cap?tulo" + +#: sphinx/templates/layout.html:55 +msgid "This Page" +msgstr "Esta P?gina" + +#: sphinx/templates/layout.html:59 +msgid "Suggest Change" +msgstr "Sugerir Altera??o" + +#: sphinx/templates/layout.html:60 sphinx/templates/layout.html:62 +msgid "Show Source" +msgstr "Exibir Fonte" + +#: sphinx/templates/layout.html:71 +msgid "Quick search" +msgstr "Pesquisa r?pida" + +#: sphinx/templates/layout.html:71 +msgid "Keyword search" +msgstr "Pesquisa de palavras-chave" + +#: sphinx/templates/layout.html:73 +msgid "Go" +msgstr "Ir" + +#: sphinx/templates/layout.html:78 +msgid "Enter a module, class or function name." +msgstr "Informe o nome de um m?dulo, classe ou fun??o." + +#: sphinx/templates/layout.html:119 +#, python-format +msgid "Search within %(docstitle)s" +msgstr "Pesquisar dentro de %(docstitle)s" + +#: sphinx/templates/layout.html:128 +msgid "About these documents" +msgstr "Sobre estes documentos" + +#: sphinx/templates/layout.html:131 sphinx/templates/search.html:2 +#: sphinx/templates/search.html:5 +msgid "Search" +msgstr "Pesquisar" + +#: sphinx/templates/layout.html:133 +msgid "Copyright" +msgstr "Copyright" + +#: sphinx/templates/layout.html:178 +#, python-format +msgid "© Copyright %(copyright)s." +msgstr "© Copyright %(copyright)s." + +#: sphinx/templates/layout.html:180 +#, python-format +msgid "© Copyright %(copyright)s." +msgstr "© Copyright %(copyright)s." + +#: sphinx/templates/layout.html:183 +#, python-format +msgid "Last updated on %(last_updated)s." +msgstr "?ltima atualiza??o em %(last_updated)s." + +#: sphinx/templates/layout.html:186 +#, python-format +msgid "" +"Created using Sphinx " +"%(sphinx_version)s." +msgstr "" +"Criado com Sphinx " +"%(sphinx_version)s." + +#: sphinx/templates/modindex.html:15 +msgid "Most popular modules:" +msgstr "M?dulos mais populares:" + +#: sphinx/templates/modindex.html:24 +msgid "Show modules only available on these platforms" +msgstr "Exibir somente m?dulos dispon?veis nestas plataformas" + +#: sphinx/templates/modindex.html:56 +msgid "Deprecated" +msgstr "Obsoleto" + +#: sphinx/templates/opensearch.xml:4 +#, python-format +msgid "Search %(docstitle)s" +msgstr "Pesquisar em %(docstitle)s" + +#: sphinx/templates/page.html:8 +msgid "" +"Note: You requested an out-of-date URL from this server." +" We've tried to redirect you to the new location of this page, but it may" +" not be the right one." +msgstr "" +"Nota: Voc? requisitou uma URL desatualizada deste " +"servidor. Tentamos redirecion?-lo para um novo endere?o desta p?gina, " +"por?m ? poss?vel que o mesmo n?o seja o correto." + +#: sphinx/templates/search.html:7 +#, fuzzy +msgid "" +"From here you can search these documents. Enter your search\n" +" words into the box below and click \"search\". Note that the search\n" +" function will automatically search for all of the words. Pages\n" +" containing fewer words won't appear in the result list." +msgstr "" +"A partir daqui voc? pode pesquisar estes documentos. Preencha suas \n" +" palavras de pesquisa na caixa abaixo e clique em \"pesquisar\". " +"Observe que a fun??o de pesquisa\n" +" ir? pesquisar automaticamente por todas as palavras.\n" +" P?ginas contendo menos palavras n?o ir?o aparecer na lista de " +"resultado." + +#: sphinx/templates/search.html:14 +msgid "search" +msgstr "pesquisar" + +#: sphinx/templates/search.html:20 +msgid "Your search did not match any results." +msgstr "Sua pesquisa n?o encontrou nenhum resultado." + +#: sphinx/templates/changes/frameset.html:5 +#: sphinx/templates/changes/versionchanges.html:12 +#, python-format +msgid "Changes in Version %(version)s — %(docstitle)s" +msgstr "Altera??es na Vers?o%(version)s — %(docstitle)s" + +#: sphinx/templates/changes/rstsource.html:5 +#, python-format +msgid "%(filename)s — %(docstitle)s" +msgstr "%(filename)s — %(docstitle)s" + +#: sphinx/templates/changes/versionchanges.html:17 +#, python-format +msgid "Automatically generated list of changes in version %(version)s" +msgstr "Lista de altera??es na vers?o %(version)s gerada automaticamente" + +#: sphinx/templates/changes/versionchanges.html:18 +msgid "Library changes" +msgstr "Altera??es na biblioteca" + +#: sphinx/templates/changes/versionchanges.html:23 +msgid "C API changes" +msgstr "Altera??es na API C" + +#: sphinx/templates/changes/versionchanges.html:25 +msgid "Other changes" +msgstr "Outras altera??es" + Added: doctools/trunk/sphinx/locale/sl/LC_MESSAGES/sphinx.js ============================================================================== --- (empty file) +++ doctools/trunk/sphinx/locale/sl/LC_MESSAGES/sphinx.js Fri Dec 5 20:10:41 2008 @@ -0,0 +1 @@ +Documentation.addTranslations({"locale": "sl", "plural_expr": "0", "messages": {"module, in ": "modul, v ", "Preparing search...": "Pripravljam iskanje...", "Your search did not match any documents. Please make sure that all words are spelled correctly and that you've selected enough categories.": "Za va\u0161e iskanje ni rezultatov. Prosimo preglejte ali so vse besede pravilno \u010drkovane in ali ste izbrali dovolj kategorij.", "Search finished, found %s page(s) matching the search query.": "Iskanje kon\u010dano, najdeno %s strani, ki ustrezajo iskalnemu nizu.", ", in ": ", v ", "Permalink to this headline": "Povezava na naslov", "Searching": "I\u0161\u010dem", "Permalink to this definition": "Povezava na to definicijo", "Hide Search Matches": "Skrij Resultate Iskanja", "Search Results": "Rezultati Iskanja"}}); \ No newline at end of file Added: doctools/trunk/sphinx/locale/sl/LC_MESSAGES/sphinx.mo ============================================================================== Binary file. No diff available. Added: doctools/trunk/sphinx/locale/sl/LC_MESSAGES/sphinx.po ============================================================================== --- (empty file) +++ doctools/trunk/sphinx/locale/sl/LC_MESSAGES/sphinx.po Fri Dec 5 20:10:41 2008 @@ -0,0 +1,597 @@ + +msgid "" +msgstr "" +"Project-Id-Version: Sphinx\n" +"Report-Msgid-Bugs-To: EMAIL at ADDRESS\n" +"POT-Creation-Date: 2008-09-11 23:58+0200\n" +"PO-Revision-Date: 2008-11-27 18:40+0100\n" +"Last-Translator: Rok Garbas \n" +"Language-Team: Rok Garbas \n" +"Plural-Forms: nplurals=1; plural=0\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Generated-By: Babel 0.9.4\n" + +#: sphinx/builder.py:408 +#, python-format +msgid "%b %d, %Y" +msgstr "%d %b, %Y" + +#: sphinx/builder.py:427 sphinx/templates/defindex.html:21 +msgid "General Index" +msgstr "Splo?ni abecedni seznam" + +#: sphinx/builder.py:427 +msgid "index" +msgstr "abecedni seznam" + +#: sphinx/builder.py:429 sphinx/htmlhelp.py:156 +#: sphinx/templates/defindex.html:19 sphinx/templates/modindex.html:2 +#: sphinx/templates/modindex.html:13 +msgid "Global Module Index" +msgstr "Splo?en Seznam Modulov" + +#: sphinx/builder.py:429 +msgid "modules" +msgstr "Moduli" + +#: sphinx/builder.py:466 +msgid "next" +msgstr "naprej" + +#: sphinx/builder.py:473 +msgid "previous" +msgstr "nazaj" + +#: sphinx/builder.py:1054 +msgid " (in " +msgstr "(v " + +#: sphinx/builder.py:1129 +msgid "Builtins" +msgstr "Vgrajeni deli" + +#: sphinx/builder.py:1131 +msgid "Module level" +msgstr "Nivo modula" + +#: sphinx/environment.py:102 sphinx/latexwriter.py:169 +#, python-format +msgid "%B %d, %Y" +msgstr "%d %B, %Y" + +#: sphinx/environment.py:291 sphinx/latexwriter.py:175 +#: sphinx/templates/genindex-single.html:2 +#: sphinx/templates/genindex-split.html:2 +#: sphinx/templates/genindex-split.html:5 sphinx/templates/genindex.html:2 +#: sphinx/templates/genindex.html:5 sphinx/templates/genindex.html:48 +#: sphinx/templates/layout.html:130 +msgid "Index" +msgstr "Abecedni seznam" + +#: sphinx/environment.py:292 sphinx/latexwriter.py:174 +msgid "Module Index" +msgstr "Seznam modulov" + +#: sphinx/environment.py:293 sphinx/templates/defindex.html:16 +msgid "Search Page" +msgstr "Iskalna stran" + +#: sphinx/htmlwriter.py:79 sphinx/static/doctools.js:145 +msgid "Permalink to this definition" +msgstr "Povezava na to definicijo" + +#: sphinx/htmlwriter.py:399 sphinx/static/doctools.js:139 +msgid "Permalink to this headline" +msgstr "Povezava na naslov" + +#: sphinx/latexwriter.py:172 +msgid "Release" +msgstr "Izdaja" + +#: sphinx/roles.py:53 sphinx/directives/desc.py:537 +#, python-format +msgid "environment variable; %s" +msgstr "globalna spremenljivka; %s" + +#: sphinx/roles.py:60 +#, python-format +msgid "Python Enhancement Proposals!PEP %s" +msgstr "Python Enhancement Proposals!PEP %s" + +#: sphinx/textwriter.py:166 +#, python-format +msgid "Platform: %s" +msgstr "Platforma: %s" + +#: sphinx/textwriter.py:422 +msgid "[image]" +msgstr "[slika]" + +#: sphinx/directives/desc.py:25 +#, python-format +msgid "%s() (built-in function)" +msgstr "%s() (vgrajene funkcije)" + +#: sphinx/directives/desc.py:26 sphinx/directives/desc.py:42 +#: sphinx/directives/desc.py:54 +#, python-format +msgid "%s() (in module %s)" +msgstr "%s() (v modulu %s)" + +#: sphinx/directives/desc.py:29 +#, python-format +msgid "%s (built-in variable)" +msgstr "%s (vgrajene spremenljivke)" + +#: sphinx/directives/desc.py:30 sphinx/directives/desc.py:66 +#, python-format +msgid "%s (in module %s)" +msgstr "%s (v modulu %s)" + +#: sphinx/directives/desc.py:33 +#, python-format +msgid "%s (built-in class)" +msgstr "%s (vgrajen razred)" + +#: sphinx/directives/desc.py:34 +#, python-format +msgid "%s (class in %s)" +msgstr "%s (razred v %s)" + +#: sphinx/directives/desc.py:46 +#, python-format +msgid "%s() (%s.%s method)" +msgstr "%s() (%s.%s metoda)" + +#: sphinx/directives/desc.py:48 +#, python-format +msgid "%s() (%s method)" +msgstr "%s() (%s metoda)" + +#: sphinx/directives/desc.py:58 +#, python-format +msgid "%s() (%s.%s static method)" +msgstr "%s() (%s.%s stati?na metoda)" + +#: sphinx/directives/desc.py:60 +#, python-format +msgid "%s() (%s static method)" +msgstr "%s() (%s stati?na metoda)" + +#: sphinx/directives/desc.py:70 +#, python-format +msgid "%s (%s.%s attribute)" +msgstr "%s (%s.%s atribut)" + +#: sphinx/directives/desc.py:72 +#, python-format +msgid "%s (%s attribute)" +msgstr "%s (%s atribut)" + +#: sphinx/directives/desc.py:74 +#, python-format +msgid "%s (C function)" +msgstr "%s (C funkcija)" + +#: sphinx/directives/desc.py:76 +#, python-format +msgid "%s (C member)" +msgstr "%s (C ?lan)" + +#: sphinx/directives/desc.py:78 +#, python-format +msgid "%s (C macro)" +msgstr "%s (C makro)" + +#: sphinx/directives/desc.py:80 +#, python-format +msgid "%s (C type)" +msgstr "%s (C tip)" + +#: sphinx/directives/desc.py:82 +#, python-format +msgid "%s (C variable)" +msgstr "%s (C spremenljivka)" + +#: sphinx/directives/desc.py:100 +msgid "Raises" +msgstr "Javi" + +#: sphinx/directives/desc.py:104 +msgid "Variable" +msgstr "Spremenljivka" + +#: sphinx/directives/desc.py:107 +msgid "Returns" +msgstr "Vrne" + +#: sphinx/directives/desc.py:116 +msgid "Return type" +msgstr "Vrne tip" + +#: sphinx/directives/desc.py:143 +msgid "Parameters" +msgstr "Parametri" + +#: sphinx/directives/desc.py:423 +#, python-format +msgid "%scommand line option; %s" +msgstr "%sopcija komandne linije; %s" + +#: sphinx/directives/other.py:101 +msgid "Platforms: " +msgstr "Platforma:" + +#: sphinx/directives/other.py:106 +#, python-format +msgid "%s (module)" +msgstr "%s (modul)" + +#: sphinx/directives/other.py:146 +msgid "Section author: " +msgstr "Avtor sekcije:" + +#: sphinx/directives/other.py:148 +msgid "Module author: " +msgstr "Avtor modula:" + +#: sphinx/directives/other.py:150 +msgid "Author: " +msgstr "Avtor:" + +#: sphinx/directives/other.py:246 +msgid "See also" +msgstr "Poglej tudi" + +#: sphinx/ext/todo.py:31 +msgid "Todo" +msgstr "Naredi" + +#: sphinx/ext/todo.py:75 +#, python-format +msgid "(The original entry is located in %s, line %d and can be found " +msgstr "(Originalen vnos se nahajana v %s, vrstica %d in jo je mo? poiskati " + +#: sphinx/ext/todo.py:81 +msgid "here" +msgstr "tukaj" + +#: sphinx/locale/__init__.py:15 +msgid "Attention" +msgstr "Pozor" + +#: sphinx/locale/__init__.py:16 +msgid "Caution" +msgstr "Previdno" + +#: sphinx/locale/__init__.py:17 +msgid "Danger" +msgstr "Navarno" + +#: sphinx/locale/__init__.py:18 +msgid "Error" +msgstr "Napaka" + +#: sphinx/locale/__init__.py:19 +msgid "Hint" +msgstr "Nasvet" + +#: sphinx/locale/__init__.py:20 +msgid "Important" +msgstr "Pomembno" + +#: sphinx/locale/__init__.py:21 +msgid "Note" +msgstr "Opomba" + +#: sphinx/locale/__init__.py:22 +msgid "See Also" +msgstr "Poglej Tudi" + +#: sphinx/locale/__init__.py:23 +msgid "Tip" +msgstr "Nasvet" + +#: sphinx/locale/__init__.py:24 +msgid "Warning" +msgstr "Opozorilo" + +#: sphinx/locale/__init__.py:28 +#, python-format +msgid "New in version %s" +msgstr "Novo v verziji %s" + +#: sphinx/locale/__init__.py:29 +#, python-format +msgid "Changed in version %s" +msgstr "Spemenjeno v verziji %s" + +#: sphinx/locale/__init__.py:30 +#, python-format +msgid "Deprecated since version %s" +msgstr "Zastarelo od verzije %s" + +#: sphinx/locale/__init__.py:34 +msgid "module" +msgstr "modul" + +#: sphinx/locale/__init__.py:35 +msgid "keyword" +msgstr "kllu?na beseda" + +#: sphinx/locale/__init__.py:36 +msgid "operator" +msgstr "operator" + +#: sphinx/locale/__init__.py:37 +msgid "object" +msgstr "objekt" + +#: sphinx/locale/__init__.py:38 +msgid "exception" +msgstr "izjema" + +#: sphinx/locale/__init__.py:39 +msgid "statement" +msgstr "izjava" + +#: sphinx/locale/__init__.py:40 +msgid "built-in function" +msgstr "vgrajene funkcije" + +#: sphinx/static/doctools.js:174 +msgid "Hide Search Matches" +msgstr "Skrij Resultate Iskanja" + +#: sphinx/static/searchtools.js:274 +msgid "Searching" +msgstr "I??em" + +#: sphinx/static/searchtools.js:279 +msgid "Preparing search..." +msgstr "Pripravljam iskanje..." + +#: sphinx/static/searchtools.js:338 +msgid "module, in " +msgstr "modul, v " + +#: sphinx/static/searchtools.js:347 +msgid ", in " +msgstr ", v " + +#: sphinx/static/searchtools.js:447 sphinx/templates/search.html:18 +msgid "Search Results" +msgstr "Rezultati Iskanja" + +#: sphinx/static/searchtools.js:449 +msgid "" +"Your search did not match any documents. Please make sure that all words " +"are spelled correctly and that you've selected enough categories." +msgstr "" +"Za va?e iskanje ni rezultatov. Prosimo preglejte ali so vse besede " +"pravilno ?rkovane in ali ste izbrali dovolj kategorij." + +#: sphinx/static/searchtools.js:451 +#, python-format +msgid "Search finished, found %s page(s) matching the search query." +msgstr "Iskanje kon?ano, najdeno %s strani, ki ustrezajo iskalnemu nizu." + +#: sphinx/templates/defindex.html:2 +msgid "Overview" +msgstr "Pregled" + +#: sphinx/templates/defindex.html:11 +msgid "Indices and tables:" +msgstr "Kazalo in tabele:" + +#: sphinx/templates/defindex.html:14 +msgid "Complete Table of Contents" +msgstr "Popoln Seznam Vsebine" + +#: sphinx/templates/defindex.html:15 +msgid "lists all sections and subsections" +msgstr "prikazi vse sekcije in podsekcije" + +#: sphinx/templates/defindex.html:17 +msgid "search this documentation" +msgstr "is?i po dokumentaciji" + +#: sphinx/templates/defindex.html:20 +msgid "quick access to all modules" +msgstr "hiter dostop do vseh modulov" + +#: sphinx/templates/defindex.html:22 +msgid "all functions, classes, terms" +msgstr "vse funkcije, rezredi, termini" + +#: sphinx/templates/genindex-single.html:5 +#, python-format +msgid "Index – %(key)s" +msgstr "Seznam – %(key)s" + +#: sphinx/templates/genindex-single.html:44 +#: sphinx/templates/genindex-split.html:14 +#: sphinx/templates/genindex-split.html:27 sphinx/templates/genindex.html:54 +msgid "Full index on one page" +msgstr "Poln indeks na eni strani" + +#: sphinx/templates/genindex-split.html:7 +msgid "Index pages by letter" +msgstr "Indeksiraj strani po ?rki" + +#: sphinx/templates/genindex-split.html:15 +msgid "can be huge" +msgstr "lahko je veliko" + +#: sphinx/templates/layout.html:9 +msgid "Navigation" +msgstr "Navigacija" + +#: sphinx/templates/layout.html:40 +msgid "Table Of Contents" +msgstr "Seznam Vsebine" + +#: sphinx/templates/layout.html:46 +msgid "Previous topic" +msgstr "Prej?nja tema" + +#: sphinx/templates/layout.html:47 +msgid "previous chapter" +msgstr "prej?nje poglavje" + +#: sphinx/templates/layout.html:50 +msgid "Next topic" +msgstr "Naslednja tema" + +#: sphinx/templates/layout.html:51 +msgid "next chapter" +msgstr "naslednje poglavje" + +#: sphinx/templates/layout.html:55 +msgid "This Page" +msgstr "Ta stran" + +#: sphinx/templates/layout.html:59 +msgid "Suggest Change" +msgstr "Predlagaj spremembo" + +#: sphinx/templates/layout.html:60 sphinx/templates/layout.html:62 +msgid "Show Source" +msgstr "Prika?i izvorno kodo" + +#: sphinx/templates/layout.html:71 +msgid "Quick search" +msgstr "Hitro iskanje" + +#: sphinx/templates/layout.html:71 +msgid "Keyword search" +msgstr "Iskanje po klju?niih besedah" + +#: sphinx/templates/layout.html:73 +msgid "Go" +msgstr "Potrdi" + +#: sphinx/templates/layout.html:78 +msgid "Enter a module, class or function name." +msgstr "Vnesi ime mudla, razreda ali funkcije." + +#: sphinx/templates/layout.html:119 +#, python-format +msgid "Search within %(docstitle)s" +msgstr "I??i med %(docstitle)s" + +#: sphinx/templates/layout.html:128 +msgid "About these documents" +msgstr "O teh dokumentih" + +#: sphinx/templates/layout.html:131 sphinx/templates/search.html:2 +#: sphinx/templates/search.html:5 +msgid "Search" +msgstr "I??i" + +#: sphinx/templates/layout.html:133 +msgid "Copyright" +msgstr "Vse pravice pridr?ane" + +#: sphinx/templates/layout.html:178 +#, python-format +msgid "© Copyright %(copyright)s." +msgstr "© Vse pravice pridr?ane %(copyright)s." + +#: sphinx/templates/layout.html:180 +#, python-format +msgid "© Copyright %(copyright)s." +msgstr "© Vse pravice pridr?ane %(copyright)s." + +#: sphinx/templates/layout.html:183 +#, python-format +msgid "Last updated on %(last_updated)s." +msgstr "Zadnji? posodobljeno na %(last_updated)s." + +#: sphinx/templates/layout.html:186 +#, python-format +msgid "" +"Created using Sphinx " +"%(sphinx_version)s." +msgstr "" +"Narejeno s Sphinx " +"%(sphinx_version)s." + +#: sphinx/templates/modindex.html:15 +msgid "Most popular modules:" +msgstr "Najbolj popularni moduli:" + +#: sphinx/templates/modindex.html:24 +msgid "Show modules only available on these platforms" +msgstr "Prika?i module na razpolago na platformah" + +#: sphinx/templates/modindex.html:56 +msgid "Deprecated" +msgstr "Zastarelo" + +#: sphinx/templates/opensearch.xml:4 +#, python-format +msgid "Search %(docstitle)s" +msgstr "I??i %(docstitle)s" + +#: sphinx/templates/page.html:8 +msgid "" +"Note: You requested an out-of-date URL from this server." +" We've tried to redirect you to the new location of this page, but it may" +" not be the right one." +msgstr "" +"Opomba: Va? zahtevek za URL s tega streznika je " +"zastaral. Posku?ali smo vas preusmeriti na novo lokacijo, vendar utegne " +"biti napa?na." + +#: sphinx/templates/search.html:7 +#, fuzzy +msgid "" +"From here you can search these documents. Enter your search\n" +" words into the box below and click \"search\". Note that the search\n" +" function will automatically search for all of the words. Pages\n" +" containing fewer words won't appear in the result list." +msgstr "" +"O tukaj lahko is?ete dokumente. Vnesite iskalni\n" +" niz v polje spodaj in pritisnite \"i??i\". Spro?eno iskanje\n" +" bo iskalo po vseh besedah v iskalnem nizu. Strani, ki ne\n" +" vsebujejo vseh besed ne bodo prikazane na seznamu rezultatov." + +#: sphinx/templates/search.html:14 +msgid "search" +msgstr "i??i" + +#: sphinx/templates/search.html:20 +msgid "Your search did not match any results." +msgstr "Va?e iskanje ni imelo nobenega zadetka." + +#: sphinx/templates/changes/frameset.html:5 +#: sphinx/templates/changes/versionchanges.html:12 +#, python-format +msgid "Changes in Version %(version)s — %(docstitle)s" +msgstr "Spremembe v Verziji %(version)s — %(docstitle)s" + +#: sphinx/templates/changes/rstsource.html:5 +#, python-format +msgid "%(filename)s — %(docstitle)s" +msgstr "%(filename)s — %(docstitle)s" + +#: sphinx/templates/changes/versionchanges.html:17 +#, python-format +msgid "Automatically generated list of changes in version %(version)s" +msgstr "Avtomatsko generiran seznam sprememb v verziji %(version)s" + +#: sphinx/templates/changes/versionchanges.html:18 +msgid "Library changes" +msgstr "Spremembe knji?nice" + +#: sphinx/templates/changes/versionchanges.html:23 +msgid "C API changes" +msgstr "C API spremembe" + +#: sphinx/templates/changes/versionchanges.html:25 +msgid "Other changes" +msgstr "Ostale spremembe" + Modified: doctools/trunk/sphinx/locale/sphinx.pot ============================================================================== --- doctools/trunk/sphinx/locale/sphinx.pot (original) +++ doctools/trunk/sphinx/locale/sphinx.pot Fri Dec 5 20:10:41 2008 @@ -8,237 +8,260 @@ msgstr "" "Project-Id-Version: Sphinx 0.5\n" "Report-Msgid-Bugs-To: EMAIL at ADDRESS\n" -"POT-Creation-Date: 2008-09-11 23:58+0200\n" +"POT-Creation-Date: 2008-11-27 18:39+0100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=utf-8\n" "Content-Transfer-Encoding: 8bit\n" -"Generated-By: Babel 0.9.3\n" +"Generated-By: Babel 0.9.4\n" -#: sphinx/builder.py:400 +#: sphinx/builder.py:408 #, python-format msgid "%b %d, %Y" msgstr "" -#: sphinx/builder.py:419 sphinx/templates/defindex.html:21 +#: sphinx/builder.py:427 sphinx/templates/defindex.html:21 msgid "General Index" msgstr "" -#: sphinx/builder.py:419 +#: sphinx/builder.py:427 msgid "index" msgstr "" -#: sphinx/builder.py:421 sphinx/htmlhelp.py:155 +#: sphinx/builder.py:429 sphinx/htmlhelp.py:156 #: sphinx/templates/defindex.html:19 sphinx/templates/modindex.html:2 #: sphinx/templates/modindex.html:13 msgid "Global Module Index" msgstr "" -#: sphinx/builder.py:421 +#: sphinx/builder.py:429 msgid "modules" msgstr "" -#: sphinx/builder.py:457 +#: sphinx/builder.py:466 msgid "next" msgstr "" -#: sphinx/builder.py:464 +#: sphinx/builder.py:473 msgid "previous" msgstr "" -#: sphinx/builder.py:1108 +#: sphinx/builder.py:1054 +msgid " (in " +msgstr "" + +#: sphinx/builder.py:1129 msgid "Builtins" msgstr "" -#: sphinx/builder.py:1110 +#: sphinx/builder.py:1131 msgid "Module level" msgstr "" -#: sphinx/environment.py:107 sphinx/latexwriter.py:129 +#: sphinx/environment.py:102 sphinx/latexwriter.py:169 #, python-format msgid "%B %d, %Y" msgstr "" -#: sphinx/environment.py:270 sphinx/latexwriter.py:190 +#: sphinx/environment.py:291 sphinx/latexwriter.py:175 #: sphinx/templates/genindex-single.html:2 #: sphinx/templates/genindex-split.html:2 #: sphinx/templates/genindex-split.html:5 sphinx/templates/genindex.html:2 #: sphinx/templates/genindex.html:5 sphinx/templates/genindex.html:48 +#: sphinx/templates/layout.html:130 msgid "Index" msgstr "" -#: sphinx/environment.py:271 sphinx/latexwriter.py:188 +#: sphinx/environment.py:292 sphinx/latexwriter.py:174 msgid "Module Index" msgstr "" -#: sphinx/environment.py:272 sphinx/templates/defindex.html:16 +#: sphinx/environment.py:293 sphinx/templates/defindex.html:16 msgid "Search Page" msgstr "" -#: sphinx/htmlwriter.py:73 sphinx/static/doctools.js:145 +#: sphinx/htmlwriter.py:79 sphinx/static/doctools.js:145 msgid "Permalink to this definition" msgstr "" -#: sphinx/htmlwriter.py:375 sphinx/static/doctools.js:139 +#: sphinx/htmlwriter.py:399 sphinx/static/doctools.js:139 msgid "Permalink to this headline" msgstr "" -#: sphinx/latexwriter.py:143 +#: sphinx/latexwriter.py:172 msgid "Release" msgstr "" -#: sphinx/roles.py:52 sphinx/directives/desc.py:514 +#: sphinx/roles.py:53 sphinx/directives/desc.py:537 #, python-format msgid "environment variable; %s" msgstr "" -#: sphinx/roles.py:59 +#: sphinx/roles.py:60 #, python-format msgid "Python Enhancement Proposals!PEP %s" msgstr "" -#: sphinx/textwriter.py:151 +#: sphinx/textwriter.py:166 #, python-format msgid "Platform: %s" msgstr "" -#: sphinx/textwriter.py:353 +#: sphinx/textwriter.py:422 msgid "[image]" msgstr "" -#: sphinx/directives/desc.py:26 +#: sphinx/directives/desc.py:25 #, python-format msgid "%s() (built-in function)" msgstr "" -#: sphinx/directives/desc.py:27 sphinx/directives/desc.py:41 -#: sphinx/directives/desc.py:53 +#: sphinx/directives/desc.py:26 sphinx/directives/desc.py:42 +#: sphinx/directives/desc.py:54 #, python-format msgid "%s() (in module %s)" msgstr "" -#: sphinx/directives/desc.py:30 +#: sphinx/directives/desc.py:29 #, python-format msgid "%s (built-in variable)" msgstr "" -#: sphinx/directives/desc.py:31 sphinx/directives/desc.py:65 +#: sphinx/directives/desc.py:30 sphinx/directives/desc.py:66 #, python-format msgid "%s (in module %s)" msgstr "" #: sphinx/directives/desc.py:33 #, python-format +msgid "%s (built-in class)" +msgstr "" + +#: sphinx/directives/desc.py:34 +#, python-format msgid "%s (class in %s)" msgstr "" -#: sphinx/directives/desc.py:45 +#: sphinx/directives/desc.py:46 #, python-format msgid "%s() (%s.%s method)" msgstr "" -#: sphinx/directives/desc.py:47 +#: sphinx/directives/desc.py:48 #, python-format msgid "%s() (%s method)" msgstr "" -#: sphinx/directives/desc.py:57 +#: sphinx/directives/desc.py:58 #, python-format msgid "%s() (%s.%s static method)" msgstr "" -#: sphinx/directives/desc.py:59 +#: sphinx/directives/desc.py:60 #, python-format msgid "%s() (%s static method)" msgstr "" -#: sphinx/directives/desc.py:69 +#: sphinx/directives/desc.py:70 #, python-format msgid "%s (%s.%s attribute)" msgstr "" -#: sphinx/directives/desc.py:71 +#: sphinx/directives/desc.py:72 #, python-format msgid "%s (%s attribute)" msgstr "" -#: sphinx/directives/desc.py:73 +#: sphinx/directives/desc.py:74 #, python-format msgid "%s (C function)" msgstr "" -#: sphinx/directives/desc.py:75 +#: sphinx/directives/desc.py:76 #, python-format msgid "%s (C member)" msgstr "" -#: sphinx/directives/desc.py:77 +#: sphinx/directives/desc.py:78 #, python-format msgid "%s (C macro)" msgstr "" -#: sphinx/directives/desc.py:79 +#: sphinx/directives/desc.py:80 #, python-format msgid "%s (C type)" msgstr "" -#: sphinx/directives/desc.py:81 +#: sphinx/directives/desc.py:82 #, python-format msgid "%s (C variable)" msgstr "" -#: sphinx/directives/desc.py:99 +#: sphinx/directives/desc.py:100 msgid "Raises" msgstr "" -#: sphinx/directives/desc.py:103 +#: sphinx/directives/desc.py:104 msgid "Variable" msgstr "" -#: sphinx/directives/desc.py:106 +#: sphinx/directives/desc.py:107 msgid "Returns" msgstr "" -#: sphinx/directives/desc.py:113 +#: sphinx/directives/desc.py:116 msgid "Return type" msgstr "" -#: sphinx/directives/desc.py:140 +#: sphinx/directives/desc.py:143 msgid "Parameters" msgstr "" -#: sphinx/directives/desc.py:402 +#: sphinx/directives/desc.py:423 #, python-format -msgid "command line option; %s" +msgid "%scommand line option; %s" msgstr "" -#: sphinx/directives/other.py:102 +#: sphinx/directives/other.py:101 msgid "Platforms: " msgstr "" -#: sphinx/directives/other.py:107 +#: sphinx/directives/other.py:106 #, python-format msgid "%s (module)" msgstr "" -#: sphinx/directives/other.py:147 +#: sphinx/directives/other.py:146 msgid "Section author: " msgstr "" -#: sphinx/directives/other.py:149 +#: sphinx/directives/other.py:148 msgid "Module author: " msgstr "" -#: sphinx/directives/other.py:151 +#: sphinx/directives/other.py:150 msgid "Author: " msgstr "" -#: sphinx/directives/other.py:233 +#: sphinx/directives/other.py:246 msgid "See also" msgstr "" +#: sphinx/ext/todo.py:31 +msgid "Todo" +msgstr "" + +#: sphinx/ext/todo.py:75 +#, python-format +msgid "(The original entry is located in %s, line %d and can be found " +msgstr "" + +#: sphinx/ext/todo.py:81 +msgid "here" +msgstr "" + #: sphinx/locale/__init__.py:15 msgid "Attention" msgstr "" @@ -334,17 +357,25 @@ msgid "Preparing search..." msgstr "" -#: sphinx/static/searchtools.js:401 sphinx/templates/search.html:18 +#: sphinx/static/searchtools.js:338 +msgid "module, in " +msgstr "" + +#: sphinx/static/searchtools.js:347 +msgid ", in " +msgstr "" + +#: sphinx/static/searchtools.js:447 sphinx/templates/search.html:18 msgid "Search Results" msgstr "" -#: sphinx/static/searchtools.js:403 +#: sphinx/static/searchtools.js:449 msgid "" "Your search did not match any documents. Please make sure that all words " "are spelled correctly and that you've selected enough categories." msgstr "" -#: sphinx/static/searchtools.js:405 +#: sphinx/static/searchtools.js:451 #, python-format msgid "Search finished, found %s page(s) matching the search query." msgstr "" @@ -448,23 +479,15 @@ msgid "Enter a module, class or function name." msgstr "" -#: sphinx/templates/layout.html:118 +#: sphinx/templates/layout.html:119 #, python-format msgid "Search within %(docstitle)s" msgstr "" -#: sphinx/templates/layout.html:127 +#: sphinx/templates/layout.html:128 msgid "About these documents" msgstr "" -#: sphinx/templates/layout.html:129 -msgid "Global table of contents" -msgstr "" - -#: sphinx/templates/layout.html:130 -msgid "Global index" -msgstr "" - #: sphinx/templates/layout.html:131 sphinx/templates/search.html:2 #: sphinx/templates/search.html:5 msgid "Search" @@ -525,7 +548,7 @@ "From here you can search these documents. Enter your search\n" " words into the box below and click \"search\". Note that the search\n" " function will automatically search for all of the words. Pages\n" -" containing less words won't appear in the result list." +" containing fewer words won't appear in the result list." msgstr "" #: sphinx/templates/search.html:14 Added: doctools/trunk/sphinx/locale/zh_TW/LC_MESSAGES/sphinx.js ============================================================================== --- (empty file) +++ doctools/trunk/sphinx/locale/zh_TW/LC_MESSAGES/sphinx.js Fri Dec 5 20:10:41 2008 @@ -0,0 +1 @@ +Documentation.addTranslations({"locale": "zh_TW", "plural_expr": "0", "messages": {"module, in ": "", "Preparing search...": "\u6e96\u5099\u641c\u5c0b...", "Your search did not match any documents. Please make sure that all words are spelled correctly and that you've selected enough categories.": "", "Search finished, found %s page(s) matching the search query.": "", ", in ": "", "Permalink to this headline": "", "Searching": "\u641c\u5c0b\u4e2d", "Permalink to this definition": "", "Hide Search Matches": "", "Search Results": "\u641c\u5c0b\u7d50\u679c"}}); \ No newline at end of file Added: doctools/trunk/sphinx/locale/zh_TW/LC_MESSAGES/sphinx.mo ============================================================================== Binary file. No diff available. Added: doctools/trunk/sphinx/locale/zh_TW/LC_MESSAGES/sphinx.po ============================================================================== --- (empty file) +++ doctools/trunk/sphinx/locale/zh_TW/LC_MESSAGES/sphinx.po Fri Dec 5 20:10:41 2008 @@ -0,0 +1,598 @@ +# Chinese (Taiwan) translations for Sphinx. +# Copyright (C) 2008 ORGANIZATION +# This file is distributed under the same license as the Sphinx project. +# Fred Lin , 2008. +# +msgid "" +msgstr "" +"Project-Id-Version: Sphinx 0.5\n" +"Report-Msgid-Bugs-To: EMAIL at ADDRESS\n" +"POT-Creation-Date: 2008-11-09 19:46+0100\n" +"PO-Revision-Date: 2008-11-27 18:40+0100\n" +"Last-Translator: Fred Lin \n" +"Language-Team: tw \n" +"Plural-Forms: nplurals=1; plural=0\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Generated-By: Babel 0.9.4\n" + +#: sphinx/builder.py:408 +#, python-format +msgid "%b %d, %Y" +msgstr "%Y ? %m ? %d ?" + +#: sphinx/builder.py:427 sphinx/templates/defindex.html:21 +msgid "General Index" +msgstr "???" + +#: sphinx/builder.py:427 +msgid "index" +msgstr "??" + +#: sphinx/builder.py:429 sphinx/htmlhelp.py:156 +#: sphinx/templates/defindex.html:19 sphinx/templates/modindex.html:2 +#: sphinx/templates/modindex.html:13 +msgid "Global Module Index" +msgstr "" + +#: sphinx/builder.py:429 +msgid "modules" +msgstr "??" + +#: sphinx/builder.py:466 +msgid "next" +msgstr "???" + +#: sphinx/builder.py:473 +msgid "previous" +msgstr "???" + +#: sphinx/builder.py:1054 +msgid " (in " +msgstr "" + +#: sphinx/builder.py:1129 +msgid "Builtins" +msgstr "" + +#: sphinx/builder.py:1131 +msgid "Module level" +msgstr "" + +#: sphinx/environment.py:102 sphinx/latexwriter.py:169 +#, python-format +msgid "%B %d, %Y" +msgstr "%Y ? %m ? %d ?" + +#: sphinx/environment.py:291 sphinx/latexwriter.py:175 +#: sphinx/templates/genindex-single.html:2 +#: sphinx/templates/genindex-split.html:2 +#: sphinx/templates/genindex-split.html:5 sphinx/templates/genindex.html:2 +#: sphinx/templates/genindex.html:5 sphinx/templates/genindex.html:48 +#: sphinx/templates/layout.html:130 +msgid "Index" +msgstr "??" + +#: sphinx/environment.py:292 sphinx/latexwriter.py:174 +msgid "Module Index" +msgstr "????" + +#: sphinx/environment.py:293 sphinx/templates/defindex.html:16 +msgid "Search Page" +msgstr "????" + +#: sphinx/htmlwriter.py:79 sphinx/static/doctools.js:145 +msgid "Permalink to this definition" +msgstr "" + +#: sphinx/htmlwriter.py:399 sphinx/static/doctools.js:139 +msgid "Permalink to this headline" +msgstr "" + +#: sphinx/latexwriter.py:172 +msgid "Release" +msgstr "??" + +#: sphinx/roles.py:53 sphinx/directives/desc.py:537 +#, python-format +msgid "environment variable; %s" +msgstr "????; %s" + +#: sphinx/roles.py:60 +#, python-format +msgid "Python Enhancement Proposals!PEP %s" +msgstr "Python ????!PEP %s" + +#: sphinx/textwriter.py:166 +#, python-format +msgid "Platform: %s" +msgstr "???%s" + +#: sphinx/textwriter.py:422 +msgid "[image]" +msgstr "[??]" + +#: sphinx/directives/desc.py:25 +#, python-format +msgid "%s() (built-in function)" +msgstr "%s() (????)" + +#: sphinx/directives/desc.py:26 sphinx/directives/desc.py:42 +#: sphinx/directives/desc.py:54 +#, python-format +msgid "%s() (in module %s)" +msgstr "%s() (? %s ???)" + +#: sphinx/directives/desc.py:29 +#, python-format +msgid "%s (built-in variable)" +msgstr "%s (????)" + +#: sphinx/directives/desc.py:30 sphinx/directives/desc.py:66 +#, python-format +msgid "%s (in module %s)" +msgstr "%s() (? %s ???)" + +#: sphinx/directives/desc.py:33 +#, python-format +msgid "%s (built-in class)" +msgstr "%s (????)" + +#: sphinx/directives/desc.py:34 +#, python-format +msgid "%s (class in %s)" +msgstr "" + +#: sphinx/directives/desc.py:46 +#, python-format +msgid "%s() (%s.%s method)" +msgstr "%s() (%s.%s ??)" + +#: sphinx/directives/desc.py:48 +#, python-format +msgid "%s() (%s method)" +msgstr "%s() (%s ??)" + +#: sphinx/directives/desc.py:58 +#, python-format +msgid "%s() (%s.%s static method)" +msgstr "%s() (%s.%s ????)" + +#: sphinx/directives/desc.py:60 +#, python-format +msgid "%s() (%s static method)" +msgstr "%s() (%s ????)" + +#: sphinx/directives/desc.py:70 +#, python-format +msgid "%s (%s.%s attribute)" +msgstr "%s (%s.%s ??)" + +#: sphinx/directives/desc.py:72 +#, python-format +msgid "%s (%s attribute)" +msgstr "%s (%s ??)" + +#: sphinx/directives/desc.py:74 +#, python-format +msgid "%s (C function)" +msgstr "%s (C ??)" + +#: sphinx/directives/desc.py:76 +#, python-format +msgid "%s (C member)" +msgstr "%s (C ??)" + +#: sphinx/directives/desc.py:78 +#, python-format +msgid "%s (C macro)" +msgstr "%s (C ??)" + +#: sphinx/directives/desc.py:80 +#, python-format +msgid "%s (C type)" +msgstr "%s (C ??)" + +#: sphinx/directives/desc.py:82 +#, python-format +msgid "%s (C variable)" +msgstr "%s (C ??)" + +#: sphinx/directives/desc.py:100 +msgid "Raises" +msgstr "" + +#: sphinx/directives/desc.py:104 +msgid "Variable" +msgstr "??" + +#: sphinx/directives/desc.py:107 +msgid "Returns" +msgstr "??" + +#: sphinx/directives/desc.py:116 +msgid "Return type" +msgstr "????" + +#: sphinx/directives/desc.py:143 +msgid "Parameters" +msgstr "??" + +#: sphinx/directives/desc.py:423 +#, python-format +msgid "%scommand line option; %s" +msgstr "%s?????; %s" + +#: sphinx/directives/other.py:101 +msgid "Platforms: " +msgstr "??" + +#: sphinx/directives/other.py:106 +#, python-format +msgid "%s (module)" +msgstr "%s (??)" + +#: sphinx/directives/other.py:146 +msgid "Section author: " +msgstr "Section ???" + +#: sphinx/directives/other.py:148 +msgid "Module author: " +msgstr "?????" + +#: sphinx/directives/other.py:150 +msgid "Author: " +msgstr "???" + +#: sphinx/directives/other.py:246 +msgid "See also" +msgstr "" + +#: sphinx/ext/todo.py:31 +msgid "Todo" +msgstr "??" + +#: sphinx/ext/todo.py:75 +#, python-format +msgid "(The original entry is located in %s, line %d and can be found " +msgstr "" + +#: sphinx/ext/todo.py:81 +msgid "here" +msgstr "" + +#: sphinx/locale/__init__.py:15 +msgid "Attention" +msgstr "??" + +#: sphinx/locale/__init__.py:16 +msgid "Caution" +msgstr "??" + +#: sphinx/locale/__init__.py:17 +msgid "Danger" +msgstr "??" + +#: sphinx/locale/__init__.py:18 +msgid "Error" +msgstr "??" + +#: sphinx/locale/__init__.py:19 +msgid "Hint" +msgstr "??" + +#: sphinx/locale/__init__.py:20 +msgid "Important" +msgstr "??" + +#: sphinx/locale/__init__.py:21 +msgid "Note" +msgstr "??" + +#: sphinx/locale/__init__.py:22 +msgid "See Also" +msgstr "" + +#: sphinx/locale/__init__.py:23 +msgid "Tip" +msgstr "???" + +#: sphinx/locale/__init__.py:24 +msgid "Warning" +msgstr "??" + +#: sphinx/locale/__init__.py:28 +#, python-format +msgid "New in version %s" +msgstr "%s ????" + +#: sphinx/locale/__init__.py:29 +#, python-format +msgid "Changed in version %s" +msgstr "? %s ???" + +#: sphinx/locale/__init__.py:30 +#, python-format +msgid "Deprecated since version %s" +msgstr "%s ?????" + +#: sphinx/locale/__init__.py:34 +msgid "module" +msgstr "??" + +#: sphinx/locale/__init__.py:35 +msgid "keyword" +msgstr "???" + +#: sphinx/locale/__init__.py:36 +msgid "operator" +msgstr "???" + +#: sphinx/locale/__init__.py:37 +msgid "object" +msgstr "??" + +#: sphinx/locale/__init__.py:38 +msgid "exception" +msgstr "??" + +#: sphinx/locale/__init__.py:39 +msgid "statement" +msgstr "" + +#: sphinx/locale/__init__.py:40 +msgid "built-in function" +msgstr "????" + +#: sphinx/static/doctools.js:174 +msgid "Hide Search Matches" +msgstr "" + +#: sphinx/static/searchtools.js:274 +msgid "Searching" +msgstr "???" + +#: sphinx/static/searchtools.js:279 +msgid "Preparing search..." +msgstr "????..." + +#: sphinx/static/searchtools.js:338 +msgid "module, in " +msgstr "" + +#: sphinx/static/searchtools.js:347 +msgid ", in " +msgstr "" + +#: sphinx/static/searchtools.js:447 sphinx/templates/search.html:18 +msgid "Search Results" +msgstr "????" + +#: sphinx/static/searchtools.js:449 +msgid "" +"Your search did not match any documents. Please make sure that all words " +"are spelled correctly and that you've selected enough categories." +msgstr "" + +#: sphinx/static/searchtools.js:451 +#, python-format +msgid "Search finished, found %s page(s) matching the search query." +msgstr "" + +#: sphinx/templates/defindex.html:2 +msgid "Overview" +msgstr "" + +#: sphinx/templates/defindex.html:11 +msgid "Indices and tables:" +msgstr "" + +#: sphinx/templates/defindex.html:14 +msgid "Complete Table of Contents" +msgstr "" + +#: sphinx/templates/defindex.html:15 +msgid "lists all sections and subsections" +msgstr "" + +#: sphinx/templates/defindex.html:17 +msgid "search this documentation" +msgstr "" + +#: sphinx/templates/defindex.html:20 +msgid "quick access to all modules" +msgstr "" + +#: sphinx/templates/defindex.html:22 +msgid "all functions, classes, terms" +msgstr "" + +#: sphinx/templates/genindex-single.html:5 +#, python-format +msgid "Index – %(key)s" +msgstr "" + +#: sphinx/templates/genindex-single.html:44 +#: sphinx/templates/genindex-split.html:14 +#: sphinx/templates/genindex-split.html:27 sphinx/templates/genindex.html:54 +msgid "Full index on one page" +msgstr "" + +#: sphinx/templates/genindex-split.html:7 +msgid "Index pages by letter" +msgstr "" + +#: sphinx/templates/genindex-split.html:15 +msgid "can be huge" +msgstr "" + +#: sphinx/templates/layout.html:9 +msgid "Navigation" +msgstr "??" + +#: sphinx/templates/layout.html:40 +msgid "Table Of Contents" +msgstr "????" + +#: sphinx/templates/layout.html:46 +msgid "Previous topic" +msgstr "?????" + +#: sphinx/templates/layout.html:47 +msgid "previous chapter" +msgstr "???" + +#: sphinx/templates/layout.html:50 +msgid "Next topic" +msgstr "?????" + +#: sphinx/templates/layout.html:51 +msgid "next chapter" +msgstr "???" + +#: sphinx/templates/layout.html:55 +msgid "This Page" +msgstr "??" + +#: sphinx/templates/layout.html:59 +msgid "Suggest Change" +msgstr "" + +#: sphinx/templates/layout.html:60 sphinx/templates/layout.html:62 +msgid "Show Source" +msgstr "?????" + +#: sphinx/templates/layout.html:71 +msgid "Quick search" +msgstr "????" + +#: sphinx/templates/layout.html:71 +msgid "Keyword search" +msgstr "?????" + +#: sphinx/templates/layout.html:73 +msgid "Go" +msgstr "" + +#: sphinx/templates/layout.html:78 +msgid "Enter a module, class or function name." +msgstr "????????????????." + +#: sphinx/templates/layout.html:119 +#, python-format +msgid "Search within %(docstitle)s" +msgstr "? %(docstitle)s ???" + +#: sphinx/templates/layout.html:128 +msgid "About these documents" +msgstr "" + +#: sphinx/templates/layout.html:131 sphinx/templates/search.html:2 +#: sphinx/templates/search.html:5 +msgid "Search" +msgstr "??" + +#: sphinx/templates/layout.html:133 +msgid "Copyright" +msgstr "????" + +#: sphinx/templates/layout.html:178 +#, python-format +msgid "© Copyright %(copyright)s." +msgstr "" + +#: sphinx/templates/layout.html:180 +#, python-format +msgid "© Copyright %(copyright)s." +msgstr "" + +#: sphinx/templates/layout.html:183 +#, python-format +msgid "Last updated on %(last_updated)s." +msgstr "??????? %(last_updated)s." + +#: sphinx/templates/layout.html:186 +#, python-format +msgid "" +"Created using Sphinx " +"%(sphinx_version)s." +msgstr "" + +#: sphinx/templates/modindex.html:15 +msgid "Most popular modules:" +msgstr "" + +#: sphinx/templates/modindex.html:24 +msgid "Show modules only available on these platforms" +msgstr "" + +#: sphinx/templates/modindex.html:56 +msgid "Deprecated" +msgstr "???" + +#: sphinx/templates/opensearch.xml:4 +#, python-format +msgid "Search %(docstitle)s" +msgstr "?? %(docstitle)s" + +#: sphinx/templates/page.html:8 +msgid "" +"Note: You requested an out-of-date URL from this server." +" We've tried to redirect you to the new location of this page, but it may" +" not be the right one." +msgstr "" + +#: sphinx/templates/search.html:7 +msgid "" +"From here you can search these documents. Enter your search\n" +" words into the box below and click \"search\". Note that the search\n" +" function will automatically search for all of the words. Pages\n" +" containing fewer words won't appear in the result list." +msgstr "" + +#: sphinx/templates/search.html:14 +msgid "search" +msgstr "??" + +#: sphinx/templates/search.html:20 +msgid "Your search did not match any results." +msgstr "" + +#: sphinx/templates/changes/frameset.html:5 +#: sphinx/templates/changes/versionchanges.html:12 +#, python-format +msgid "Changes in Version %(version)s — %(docstitle)s" +msgstr "" + +#: sphinx/templates/changes/rstsource.html:5 +#, python-format +msgid "%(filename)s — %(docstitle)s" +msgstr "" + +#: sphinx/templates/changes/versionchanges.html:17 +#, python-format +msgid "Automatically generated list of changes in version %(version)s" +msgstr "" + +#: sphinx/templates/changes/versionchanges.html:18 +msgid "Library changes" +msgstr "" + +#: sphinx/templates/changes/versionchanges.html:23 +msgid "C API changes" +msgstr "C API ??" + +#: sphinx/templates/changes/versionchanges.html:25 +msgid "Other changes" +msgstr "?????" + +#~ msgid "" +#~ "From here you can search these documents. Enter your search\n" +#~ " words into the box below and" +#~ " click \"search\". Note that the " +#~ "search\n" +#~ " function will automatically search for all of the words. Pages\n" +#~ " containing less words won't appear in the result list." +#~ msgstr "" + Modified: doctools/trunk/sphinx/quickstart.py ============================================================================== --- doctools/trunk/sphinx/quickstart.py (original) +++ doctools/trunk/sphinx/quickstart.py Fri Dec 5 20:10:41 2008 @@ -32,6 +32,9 @@ # The contents of this file are pickled, so don't put values in the namespace # that aren't pickleable (module imports are okay, they're removed automatically). # +# Note that not all possible configuration values are present in this +# autogenerated file. +# # All configuration values have a default; values that are commented out # serve to show the default. @@ -509,12 +512,15 @@ print bold('Finished: An initial directory structure has been created.') print ''' You should now populate your master file %s and create other documentation -source files. Use the sphinx-build script to build the docs, like so: -''' % masterfile + (create_makefile and ''' - make -''' or ''' - sphinx-build -b %s %s -''' % (srcdir, builddir)) +source files. ''' % masterfile + (create_makefile and '''\ +Use the Makefile to build the docs, like so: + make builder +''' or '''\ +Use the sphinx-build command to build the docs, like so: + sphinx-build -b builder %s %s +''' % (srcdir, builddir)) + '''\ +where "builder" is one of the supported builders, e.g. html, latex or linkcheck. +''' def main(argv=sys.argv): Modified: doctools/trunk/sphinx/roles.py ============================================================================== --- doctools/trunk/sphinx/roles.py (original) +++ doctools/trunk/sphinx/roles.py Fri Dec 5 20:10:41 2008 @@ -15,9 +15,8 @@ from docutils.parsers.rst import roles from sphinx import addnodes +from sphinx.util import ws_re, caption_ref_re -ws_re = re.compile(r'\s+') -caption_ref_re = re.compile(r'^([^<]+?)\s*<(.+)>$') generic_docroles = { 'command' : nodes.strong, @@ -143,7 +142,7 @@ # fallback: everything after '<' is the target target = text[brace+1:] title = text[:brace] - # special target for Python object cross-references + # special target for Python object cross-references if typ in ('data', 'exc', 'func', 'class', 'const', 'attr', 'meth', 'mod', 'obj'): # fix-up parentheses in link title if titleistarget: @@ -166,9 +165,17 @@ target = target[1:] pnode['refspecific'] = True # some other special cases for the target - elif typ == 'option' and target[0] in '-/': - # strip option marker from target - target = target[1:] + elif typ == 'option': + program = env.currprogram + if titleistarget: + if ' ' in title and not (title.startswith('/') or title.startswith('-')): + program, target = re.split(' (?=-|--|/)', title, 1) + program = ws_re.sub('-', program) + target = target.strip() + elif ' ' in target: + program, target = re.split(' (?=-|--|/)', target, 1) + program = ws_re.sub('-', program) + pnode['refprogram'] = program elif typ == 'term': # normalize whitespace in definition terms (if the term reference is # broken over a line, a newline will be in target) @@ -217,21 +224,21 @@ 'obj': xfileref_role, 'cfunc' : xfileref_role, 'cmember': xfileref_role, - 'cdata' : xfileref_role, - 'ctype' : xfileref_role, - 'cmacro' : xfileref_role, + 'cdata': xfileref_role, + 'ctype': xfileref_role, + 'cmacro': xfileref_role, - 'mod' : xfileref_role, + 'mod': xfileref_role, 'keyword': xfileref_role, 'ref': xfileref_role, - 'token' : xfileref_role, + 'token': xfileref_role, 'term': xfileref_role, 'option': xfileref_role, - 'menuselection' : menusel_role, - 'file' : emph_literal_role, - 'samp' : emph_literal_role, + 'menuselection': menusel_role, + 'file': emph_literal_role, + 'samp': emph_literal_role, } for rolename, func in specific_docroles.iteritems(): Modified: doctools/trunk/sphinx/static/default.css ============================================================================== --- doctools/trunk/sphinx/static/default.css (original) +++ doctools/trunk/sphinx/static/default.css Fri Dec 5 20:10:41 2008 @@ -225,216 +225,6 @@ font-weight: bold; } -/* :::: INLINE COMMENTS :::: */ - -div.inlinecomments { - position: absolute; - right: 20px; -} - -div.inlinecomments a.bubble { - display: block; - float: right; - background-image: url(style/comment.png); - background-repeat: no-repeat; - width: 25px; - height: 25px; - text-align: center; - padding-top: 3px; - font-size: 0.9em; - line-height: 14px; - font-weight: bold; - color: black; -} - -div.inlinecomments a.bubble span { - display: none; -} - -div.inlinecomments a.emptybubble { - background-image: url(style/nocomment.png); -} - -div.inlinecomments a.bubble:hover { - background-image: url(style/hovercomment.png); - text-decoration: none; - color: #3ca0a4; -} - -div.inlinecomments div.comments { - float: right; - margin: 25px 5px 0 0; - max-width: 50em; - min-width: 30em; - border: 1px solid #2eabb0; - background-color: #f2fbfd; - z-index: 150; -} - -div#comments { - border: 1px solid #2eabb0; - margin-top: 20px; -} - -div#comments div.nocomments { - padding: 10px; - font-weight: bold; -} - -div.inlinecomments div.comments h3, -div#comments h3 { - margin: 0; - padding: 0; - background-color: #2eabb0; - color: white; - border: none; - padding: 3px; -} - -div.inlinecomments div.comments div.actions { - padding: 4px; - margin: 0; - border-top: none; -} - -div#comments div.comment { - margin: 10px; - border: 1px solid #2eabb0; -} - -div.inlinecomments div.comment h4, -div.commentwindow div.comment h4, -div#comments div.comment h4 { - margin: 10px 0 0 0; - background-color: #2eabb0; - color: white; - border: none; - padding: 1px 4px 1px 4px; -} - -div#comments div.comment h4 { - margin: 0; -} - -div#comments div.comment h4 a { - color: #d5f4f4; -} - -div.inlinecomments div.comment div.text, -div.commentwindow div.comment div.text, -div#comments div.comment div.text { - margin: -5px 0 -5px 0; - padding: 0 10px 0 10px; -} - -div.inlinecomments div.comment div.meta, -div.commentwindow div.comment div.meta, -div#comments div.comment div.meta { - text-align: right; - padding: 2px 10px 2px 0; - font-size: 95%; - color: #538893; - border-top: 1px solid #cbe7e5; - background-color: #e0f6f4; -} - -div.commentwindow { - position: absolute; - width: 500px; - border: 1px solid #cbe7e5; - background-color: #f2fbfd; - display: none; - z-index: 130; -} - -div.commentwindow h3 { - margin: 0; - background-color: #2eabb0; - color: white; - border: none; - padding: 5px; - font-size: 1.5em; - cursor: pointer; -} - -div.commentwindow div.actions { - margin: 10px -10px 0 -10px; - padding: 4px 10px 4px 10px; - color: #538893; -} - -div.commentwindow div.actions input { - border: 1px solid #2eabb0; - background-color: white; - color: #135355; - cursor: pointer; -} - -div.commentwindow div.form { - padding: 0 10px 0 10px; -} - -div.commentwindow div.form input, -div.commentwindow div.form textarea { - border: 1px solid #3c9ea2; - background-color: white; - color: black; -} - -div.commentwindow div.error { - margin: 10px 5px 10px 5px; - background-color: #fbe5dc; - display: none; -} - -div.commentwindow div.form textarea { - width: 99%; -} - -div.commentwindow div.preview { - margin: 10px 0 10px 0; - background-color: #70d0d4; - padding: 0 1px 1px 25px; -} - -div.commentwindow div.preview h4 { - margin: 0 0 -5px -20px; - padding: 4px 0 0 4px; - color: white; - font-size: 1.3em; -} - -div.commentwindow div.preview div.comment { - background-color: #f2fbfd; -} - -div.commentwindow div.preview div.comment h4 { - margin: 10px 0 0 0!important; - padding: 1px 4px 1px 4px!important; - font-size: 1.2em; -} - -/* :::: SUGGEST CHANGES :::: */ -div#suggest-changes-box input, div#suggest-changes-box textarea { - border: 1px solid #ccc; - background-color: white; - color: black; -} - -div#suggest-changes-box textarea { - width: 99%; - height: 400px; -} - - -/* :::: PREVIEW :::: */ -div.preview { - background-image: url(style/preview.png); - padding: 0 20px 20px 20px; - margin-bottom: 30px; -} - - /* :::: INDEX PAGE :::: */ table.contentstable { @@ -587,12 +377,27 @@ font-weight: bold; } +/* Sidebars */ + +div.sidebar { + margin: 0 0 0.5em 1em; + border: 1px solid #ddb; + padding: 7px 7px 0 7px; + background-color: #ffe; + width: 40%; + float: right; +} + +p.sidebar-title { + font-weight: bold; +} + /* "Topics" */ div.topic { background-color: #eee; border: 1px solid #ccc; - padding: 0 7px 0 7px; + padding: 7px 7px 0 7px; margin: 10px 0 10px 0; } @@ -817,7 +622,11 @@ border: 3px solid red; } -div.math { +img.math { + vertical-align: middle; +} + +div.math p { text-align: center; } Modified: doctools/trunk/sphinx/static/sphinxdoc.css ============================================================================== --- doctools/trunk/sphinx/static/sphinxdoc.css (original) +++ doctools/trunk/sphinx/static/sphinxdoc.css Fri Dec 5 20:10:41 2008 @@ -263,6 +263,39 @@ font-weight: bold; } +div.sidebar { + margin: 0 0 0.5em 1em; + border: 1px solid #ddb; + padding: 7px 7px 0 7px; + background-color: #ffe; + width: 40%; + float: right; +} + +div.quotebar { + background-color: #f8f8f8; + max-width: 250px; + float: right; + padding: 2px 7px; + border: 1px solid #ccc; +} + +p.sidebar-title { + font-weight: bold; +} + +div.topic { + background-color: #f8f8f8; + border: 1px solid #ccc; + padding: 7px 7px 0 7px; + margin: 10px 0 10px 0; +} + +p.topic-title { + font-size: 1.1em; + font-weight: bold; +} + h1 { margin: 0; padding: 0.7em 0 0.3em 0; @@ -507,6 +540,10 @@ font-weight: bold; } +img.math { + vertical-align: center; +} + div.math { text-align: center; } Modified: doctools/trunk/sphinx/templates/changes/frameset.html ============================================================================== --- doctools/trunk/sphinx/templates/changes/frameset.html (original) +++ doctools/trunk/sphinx/templates/changes/frameset.html Fri Dec 5 20:10:41 2008 @@ -2,7 +2,7 @@ "http://www.w3.org/TR/html4/frameset.dtd"> - {% trans version=version, docstitle=docstitle %}Changes in Version {{ version }} — {{ docstitle }}{% endtrans %} + {% trans version=version|e, docstitle=docstitle|e %}Changes in Version {{ version }} — {{ docstitle }}{% endtrans %} Modified: doctools/trunk/sphinx/templates/changes/rstsource.html ============================================================================== --- doctools/trunk/sphinx/templates/changes/rstsource.html (original) +++ doctools/trunk/sphinx/templates/changes/rstsource.html Fri Dec 5 20:10:41 2008 @@ -2,7 +2,7 @@ "http://www.w3.org/TR/html4/loose.dtd"> - {% trans filename=filename, docstitle=docstitle %}{{ filename }} — {{ docstitle }}{% endtrans %} + {% trans filename=filename, docstitle=docstitle|e %}{{ filename }} — {{ docstitle }}{% endtrans %} Modified: doctools/trunk/sphinx/templates/changes/versionchanges.html ============================================================================== --- doctools/trunk/sphinx/templates/changes/versionchanges.html (original) +++ doctools/trunk/sphinx/templates/changes/versionchanges.html Fri Dec 5 20:10:41 2008 @@ -9,12 +9,12 @@ - {% trans version=version, docstitle=docstitle %}Changes in Version {{ version }} — {{ docstitle }}{% endtrans %} + {% trans version=version|e, docstitle=docstitle|e %}Changes in Version {{ version }} — {{ docstitle }}{% endtrans %}
      -

      {% trans version=version %}Automatically generated list of changes in version {{ version }}{% endtrans %}

      +

      {% trans version=version|e %}Automatically generated list of changes in version {{ version }}{% endtrans %}

      {{ _('Library changes') }}

      {% for modname, changes in libchanges %}

      {{ modname }}

      Modified: doctools/trunk/sphinx/templates/defindex.html ============================================================================== --- doctools/trunk/sphinx/templates/defindex.html (original) +++ doctools/trunk/sphinx/templates/defindex.html Fri Dec 5 20:10:41 2008 @@ -1,11 +1,11 @@ {% extends "layout.html" %} {% set title = _('Overview') %} {% block body %} -

      {{ docstitle }}

      +

      {{ docstitle|e }}

      Welcome! This is - {% block description %}the documentation for {{ project }} - {{ release }}{% if last_updated %}, last updated {{ last_updated }}{% endif %}{% endblock %}. + {% block description %}the documentation for {{ project|e }} + {{ release|e }}{% if last_updated %}, last updated {{ last_updated|e }}{% endif %}{% endblock %}.

      {% block tables %}

      {{ _('Indices and tables:') }}

      Modified: doctools/trunk/sphinx/templates/layout.html ============================================================================== --- doctools/trunk/sphinx/templates/layout.html (original) +++ doctools/trunk/sphinx/templates/layout.html Fri Dec 5 20:10:41 2008 @@ -15,12 +15,12 @@ {%- if not loop.first %}{{ reldelim2 }}{% endif %} {%- endfor %} {%- block rootrellink %} -
    • {{ shorttitle }}{{ reldelim1 }}
    • +
    • {{ shorttitle|e }}{{ reldelim1 }}
    • {%- endblock %} {%- for parent in parents %}
    • {{ parent.title }}{{ reldelim1 }}
    • {%- endfor %} - {%- block relbaritems %}{% endblock %} + {%- block relbaritems %} {% endblock %}
    {%- endmacro %} @@ -89,7 +89,7 @@ {{ metatags }} {%- if builder != 'htmlhelp' %} - {%- set titlesuffix = " — " + docstitle %} + {%- set titlesuffix = " — " + docstitle|e %} {%- endif %} {{ title|striptags }}{{ titlesuffix }} {%- if builder == 'web' %} @@ -106,7 +106,7 @@