From 310337f82883f6b9e474757d303238af171ba1b4 Mon Sep 17 00:00:00 2001 From: Georg Brandl Date: Sun, 6 Mar 2011 10:48:43 +0100 Subject: [PATCH 1/9] #11400: remove reference to pre-1.5 assignment behavior. --- Doc/reference/simple_stmts.rst | 3 --- 1 file changed, 3 deletions(-) diff --git a/Doc/reference/simple_stmts.rst b/Doc/reference/simple_stmts.rst index 30861d4c682..722ee7725e5 100644 --- a/Doc/reference/simple_stmts.rst +++ b/Doc/reference/simple_stmts.rst @@ -119,9 +119,6 @@ square brackets, is recursively defined as follows. * If the target list is a comma-separated list of targets: The object must be an iterable with the same number of items as there are targets in the target list, and the items are assigned, from left to right, to the corresponding targets. - (This rule is relaxed as of Python 1.5; in earlier versions, the object had to - be a tuple. Since strings are sequences, an assignment like ``a, b = "xy"`` is - now legal as long as the string has the right length.) * If the target list contains one target prefixed with an asterisk, called a "starred" target: The object must be a sequence with at least as many items From e32acd0d79b1a82f8364a51cbe4c37ccb5485021 Mon Sep 17 00:00:00 2001 From: Georg Brandl Date: Sun, 6 Mar 2011 10:51:18 +0100 Subject: [PATCH 2/9] #11337: remove unreferenced footnote. --- Doc/reference/simple_stmts.rst | 7 ------- 1 file changed, 7 deletions(-) diff --git a/Doc/reference/simple_stmts.rst b/Doc/reference/simple_stmts.rst index 722ee7725e5..548e0a9ef79 100644 --- a/Doc/reference/simple_stmts.rst +++ b/Doc/reference/simple_stmts.rst @@ -986,10 +986,3 @@ pre-existing bindings in the local scope. :pep:`3104` - Access to Names in Outer Scopes The specification for the :keyword:`nonlocal` statement. - - -.. rubric:: Footnotes - -.. [#] It may occur within an :keyword:`except` or :keyword:`else` clause. The - restriction on occurring in the :keyword:`try` clause is implementor's - laziness and will eventually be lifted. From da2271939a3a6d7922390750c09f4029da2f0b6f Mon Sep 17 00:00:00 2001 From: Georg Brandl Date: Sun, 6 Mar 2011 10:53:55 +0100 Subject: [PATCH 3/9] #11392: you can trust the computer, but you have to know what it does. --- Doc/library/turtle.rst | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Doc/library/turtle.rst b/Doc/library/turtle.rst index d424b43ee59..1fe9699f962 100644 --- a/Doc/library/turtle.rst +++ b/Doc/library/turtle.rst @@ -2290,9 +2290,11 @@ The demoscripts are: | bytedesign | complex classical | :func:`tracer`, delay,| | | turtlegraphics pattern | :func:`update` | +----------------+------------------------------+-----------------------+ -| chaos | graphs verhust dynamics, | world coordinates | -| | proves that you must not | | -| | trust computers' computations| | +| chaos | graphs Verhulst dynamics, | world coordinates | +| | shows that computer's | | +| | computations can generate | | +| | results sometimes against the| | +| | common sense expectations | | +----------------+------------------------------+-----------------------+ | clock | analog clock showing time | turtles as clock's | | | of your computer | hands, ontimer | From 3640e18d90098a37d8cb841ec145a9c9e0d54f5b Mon Sep 17 00:00:00 2001 From: Georg Brandl Date: Sun, 6 Mar 2011 10:56:18 +0100 Subject: [PATCH 4/9] #11405: do not reference the string module again for its deprecated functions, only for Template class. --- Doc/tutorial/inputoutput.rst | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/Doc/tutorial/inputoutput.rst b/Doc/tutorial/inputoutput.rst index 84e83b5d7dd..c570e27002b 100644 --- a/Doc/tutorial/inputoutput.rst +++ b/Doc/tutorial/inputoutput.rst @@ -19,18 +19,16 @@ the :func:`print` function. (A third way is using the :meth:`write` method of file objects; the standard output file can be referenced as ``sys.stdout``. See the Library Reference for more information on this.) -.. index:: module: string - Often you'll want more control over the formatting of your output than simply printing space-separated values. There are two ways to format your output; the first way is to do all the string handling yourself; using string slicing and concatenation operations you can create any layout you can imagine. The -standard module :mod:`string` contains some useful operations for padding +string type has some methods that perform useful operations for padding strings to a given column width; these will be discussed shortly. The second way is to use the :meth:`str.format` method. -The :mod:`string` module contains a class Template which offers yet another way -to substitute values into strings. +The :mod:`string` module contains a :class:`~string.Template` class which offers +yet another way to substitute values into strings. One question remains, of course: how do you convert values to strings? Luckily, Python has ways to convert any value to a string: pass it to the :func:`repr` From 12a6153aeed41b6ef6bea93fa62427a3c5f7de56 Mon Sep 17 00:00:00 2001 From: Georg Brandl Date: Sun, 6 Mar 2011 10:57:52 +0100 Subject: [PATCH 5/9] #11373: fix spelling. --- Doc/library/stdtypes.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Doc/library/stdtypes.rst b/Doc/library/stdtypes.rst index 2e8b7724659..1b7d5ec9496 100644 --- a/Doc/library/stdtypes.rst +++ b/Doc/library/stdtypes.rst @@ -2102,7 +2102,7 @@ copying. Memory is generally interpreted as simple bytes. .. class:: memoryview(obj) Create a :class:`memoryview` that references *obj*. *obj* must support the - buffer protocol. Builtin objects that support the buffer protocol include + buffer protocol. Built-in objects that support the buffer protocol include :class:`bytes` and :class:`bytearray`. A :class:`memoryview` has the notion of an *element*, which is the From 45ec333c72aaea21e95271c3b415679a2f79f269 Mon Sep 17 00:00:00 2001 From: Georg Brandl Date: Sun, 6 Mar 2011 11:05:03 +0100 Subject: [PATCH 6/9] #11227: use Host header in asyncore example. --- Doc/library/asyncore.rst | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Doc/library/asyncore.rst b/Doc/library/asyncore.rst index eca4d1b10e4..b6fe2bbea2a 100644 --- a/Doc/library/asyncore.rst +++ b/Doc/library/asyncore.rst @@ -263,7 +263,8 @@ implement its socket handling:: asyncore.dispatcher.__init__(self) self.create_socket(socket.AF_INET, socket.SOCK_STREAM) self.connect( (host, 80) ) - self.buffer = bytes('GET %s HTTP/1.0\r\n\r\n' % path, 'ascii') + self.buffer = bytes('GET %s HTTP/1.0\r\nHost: %s\r\n\r\n' % + (path, host), 'ascii') def handle_connect(self): pass From a2388be2af60e6eac4df5ae6bcce1658fd4cd276 Mon Sep 17 00:00:00 2001 From: Georg Brandl Date: Sun, 6 Mar 2011 11:07:11 +0100 Subject: [PATCH 7/9] #11239: add } to list of metacharacters (it is only a metacharacter sometimes, ie. when closing a {n,m} group, but so is ]. --- Doc/howto/regex.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Doc/howto/regex.rst b/Doc/howto/regex.rst index 8f39eeb5264..07a8b561d01 100644 --- a/Doc/howto/regex.rst +++ b/Doc/howto/regex.rst @@ -76,7 +76,7 @@ devoted to discussing various metacharacters and what they do. Here's a complete list of the metacharacters; their meanings will be discussed in the rest of this HOWTO. :: - . ^ $ * + ? { [ ] \ | ( ) + . ^ $ * + ? { } [ ] \ | ( ) The first metacharacters we'll look at are ``[`` and ``]``. They're used for specifying a character class, which is a set of characters that you wish to From 931e5c1038d483469a29e2fb8c89298ffb449f01 Mon Sep 17 00:00:00 2001 From: Georg Brandl Date: Sun, 6 Mar 2011 11:08:35 +0100 Subject: [PATCH 8/9] #11292: add missing A_REVERSE to curses attribute table. --- Doc/library/curses.rst | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Doc/library/curses.rst b/Doc/library/curses.rst index f9ba0d624b2..6d2baa0f992 100644 --- a/Doc/library/curses.rst +++ b/Doc/library/curses.rst @@ -1173,6 +1173,9 @@ Several constants are available to specify character cell attributes: +------------------+-------------------------------+ | ``A_NORMAL`` | Normal attribute. | +------------------+-------------------------------+ +| ``A_REVERSE`` | Reverse background and | +| | foreground colors. | ++------------------+-------------------------------+ | ``A_STANDOUT`` | Standout mode. | +------------------+-------------------------------+ | ``A_UNDERLINE`` | Underline mode. | From 1d0a0f50606835198b0e1935a9761f3c95fef350 Mon Sep 17 00:00:00 2001 From: Georg Brandl Date: Sun, 6 Mar 2011 11:09:51 +0100 Subject: [PATCH 9/9] #11294: add missing ERA_T_FMT to locale docs. --- Doc/library/locale.rst | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/Doc/library/locale.rst b/Doc/library/locale.rst index 9581186a938..5b2941eba58 100644 --- a/Doc/library/locale.rst +++ b/Doc/library/locale.rst @@ -161,7 +161,7 @@ The :mod:`locale` module defines the following exception and functions: .. data:: D_T_FMT Get a string that can be used as a format string for :func:`strftime` to - represent time and date in a locale-specific way. + represent date and time in a locale-specific way. .. data:: D_FMT @@ -246,12 +246,17 @@ The :mod:`locale` module defines the following exception and functions: .. data:: ERA_D_T_FMT - Get a format string for :func:`strftime` to represent dates and times in a + Get a format string for :func:`strftime` to represent date and time in a locale-specific era-based way. .. data:: ERA_D_FMT - Get a format string for :func:`strftime` to represent time in a + Get a format string for :func:`strftime` to represent a date in a + locale-specific era-based way. + + .. data:: ERA_T_FMT + + Get a format string for :func:`strftime` to represent a time in a locale-specific era-based way. .. data:: ALT_DIGITS