Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 2021100

Browse files
committed
Merged revisions 76259,76326,76376-76377,76430,76471,76517 via svnmerge from
svn+ssh://[email protected]/python/trunk ................ r76259 | georg.brandl | 2009-11-14 05:50:51 -0600 (Sat, 14 Nov 2009) | 1 line Fix terminology. ................ r76326 | georg.brandl | 2009-11-16 10:44:05 -0600 (Mon, 16 Nov 2009) | 1 line #7302: fix link. ................ r76376 | georg.brandl | 2009-11-18 13:39:14 -0600 (Wed, 18 Nov 2009) | 1 line upcase Python ................ r76377 | georg.brandl | 2009-11-18 14:05:15 -0600 (Wed, 18 Nov 2009) | 1 line Fix markup. ................ r76430 | r.david.murray | 2009-11-20 07:29:43 -0600 (Fri, 20 Nov 2009) | 2 lines Issue 7363: fix indentation in socketserver udpserver example. ................ r76471 | georg.brandl | 2009-11-23 13:53:19 -0600 (Mon, 23 Nov 2009) | 1 line #7345: fix arguments of formatyear(). ................ r76517 | benjamin.peterson | 2009-11-25 12:16:46 -0600 (Wed, 25 Nov 2009) | 29 lines Merged revisions 76160-76161,76250,76252,76447,76506 via svnmerge from svn+ssh://[email protected]/sandbox/trunk/2to3/lib2to3 ........ r76160 | benjamin.peterson | 2009-11-08 18:53:48 -0600 (Sun, 08 Nov 2009) | 1 line undeprecate the -p option; it's useful for converting python3 sources ........ r76161 | benjamin.peterson | 2009-11-08 19:05:37 -0600 (Sun, 08 Nov 2009) | 1 line simplify condition ........ r76250 | benjamin.peterson | 2009-11-13 16:56:48 -0600 (Fri, 13 Nov 2009) | 1 line fix handling of a utf-8 bom #7313 ........ r76252 | benjamin.peterson | 2009-11-13 16:58:36 -0600 (Fri, 13 Nov 2009) | 1 line remove pdb turd ........ r76447 | benjamin.peterson | 2009-11-22 18:17:40 -0600 (Sun, 22 Nov 2009) | 1 line #7375 fix nested transformations in fix_urllib ........ r76506 | benjamin.peterson | 2009-11-24 18:34:31 -0600 (Tue, 24 Nov 2009) | 1 line use generator expressions in any() ........ ................
1 parent a591cde commit 2021100

16 files changed

Lines changed: 80 additions & 63 deletions

Doc/library/calendar.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ it's the base calendar for all computations.
123123
Print a month's calendar as returned by :meth:`formatmonth`.
124124

125125

126-
.. method:: formatyear(theyear, themonth, w=2, l=1, c=6, m=3)
126+
.. method:: formatyear(theyear, w=2, l=1, c=6, m=3)
127127

128128
Return a *m*-column calendar for an entire year as a multi-line string.
129129
Optional parameters *w*, *l*, and *c* are for date column width, lines per
@@ -152,7 +152,7 @@ it's the base calendar for all computations.
152152
used.
153153

154154

155-
.. method:: formatyear(theyear, themonth, width=3)
155+
.. method:: formatyear(theyear, width=3)
156156

157157
Return a year's calendar as an HTML table. *width* (defaulting to 3)
158158
specifies the number of months per row.

Doc/library/functions.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ are always available. They are listed here in alphabetical order.
176176

177177
.. note::
178178

179-
When compiling a string with multi-line statements in ``'single'`` or
179+
When compiling a string with multi-line code in ``'single'`` or
180180
``'eval'`` mode, input must be terminated by at least one newline
181181
character. This is to facilitate detection of incomplete and complete
182182
statements in the :mod:`code` module.

Doc/library/socketserver.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -446,9 +446,9 @@ This is the server side::
446446
socket.sendto(data.upper(), self.client_address)
447447

448448
if __name__ == "__main__":
449-
HOST, PORT = "localhost", 9999
450-
server = socketserver.UDPServer((HOST, PORT), MyUDPHandler)
451-
server.serve_forever()
449+
HOST, PORT = "localhost", 9999
450+
server = socketserver.UDPServer((HOST, PORT), MyUDPHandler)
451+
server.serve_forever()
452452

453453
This is the client side::
454454

Doc/library/string.rst

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -521,13 +521,12 @@ these rules. The methods of :class:`Template` are:
521521
templates containing dangling delimiters, unmatched braces, or
522522
placeholders that are not valid Python identifiers.
523523

524-
:class:`Template` instances also provide one public data attribute:
524+
:class:`Template` instances also provide one public data attribute:
525525

526+
.. attribute:: template
526527

527-
.. attribute:: string.template
528-
529-
This is the object passed to the constructor's *template* argument. In general,
530-
you shouldn't change it, but read-only access is not enforced.
528+
This is the object passed to the constructor's *template* argument. In
529+
general, you shouldn't change it, but read-only access is not enforced.
531530

532531
Here is an example of how to use a Template:
533532

Doc/library/xml.dom.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ implementations are free to support the strict mapping from IDL). See section
7676
`Document Object Model (DOM) Level 1 Specification <http://www.w3.org/TR/REC-DOM-Level-1/>`_
7777
The W3C recommendation for the DOM supported by :mod:`xml.dom.minidom`.
7878

79-
`Python Language Mapping Specification <http://www.omg.org/docs/formal/02-11-05.pdf>`_
79+
`Python Language Mapping Specification <http://www.omg.org/spec/PYTH/1.2/PDF>`_
8080
This specifies the mapping from OMG IDL to Python.
8181

8282

Doc/library/zipfile.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ documentation). It can handle ZIP files that use the ZIP64 extensions
1919
(that is ZIP files that are more than 4 GByte in size). It supports
2020
decryption of encrypted files in ZIP archives, but it currently cannot
2121
create an encrypted file. Decryption is extremely slow as it is
22-
implemented in native python rather than C.
22+
implemented in native Python rather than C.
2323

2424
For other archive formats, see the :mod:`bz2`, :mod:`gzip`, and
2525
:mod:`tarfile` modules.

Lib/lib2to3/fixes/fix_imports.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ def match(self, node):
108108
# Module usage could be in the trailer of an attribute lookup, so we
109109
# might have nested matches when "bare_with_attr" is present.
110110
if "bare_with_attr" not in results and \
111-
any([match(obj) for obj in attr_chain(node, "parent")]):
111+
any(match(obj) for obj in attr_chain(node, "parent")):
112112
return False
113113
return results
114114
return False

Lib/lib2to3/fixes/fix_next.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,4 +99,4 @@ def find_assign(node):
9999
def is_subtree(root, node):
100100
if root == node:
101101
return True
102-
return any([is_subtree(c, node) for c in root.children])
102+
return any(is_subtree(c, node) for c in root.children)

Lib/lib2to3/fixes/fix_renames.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ def match(self, node):
4949
match = super(FixRenames, self).match
5050
results = match(node)
5151
if results:
52-
if any([match(obj) for obj in attr_chain(node, "parent")]):
52+
if any(match(obj) for obj in attr_chain(node, "parent")):
5353
return False
5454
return results
5555
return False

Lib/lib2to3/fixes/fix_urllib.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,8 @@ def build_pattern():
6363
yield """import_name< 'import'
6464
dotted_as_name< module_as=%r 'as' any > >
6565
""" % old_module
66-
yield """power< module_dot=%r trailer< '.' member=%s > any* >
66+
# bare_with_attr has a special significance for FixImports.match().
67+
yield """power< bare_with_attr=%r trailer< '.' member=%s > any* >
6768
""" % (old_module, members)
6869

6970

@@ -150,12 +151,11 @@ def transform_member(self, node, results):
150151

151152
def transform_dot(self, node, results):
152153
"""Transform for calls to module members in code."""
153-
module_dot = results.get('module_dot')
154+
module_dot = results.get('bare_with_attr')
154155
member = results.get('member')
155-
# this may be a list of length one, or just a node
156+
new_name = None
156157
if isinstance(member, list):
157158
member = member[0]
158-
new_name = None
159159
for change in MAPPING[module_dot.value]:
160160
if member.value in change[1]:
161161
new_name = change[0]
@@ -171,7 +171,7 @@ def transform(self, node, results):
171171
self.transform_import(node, results)
172172
elif results.get('mod_member'):
173173
self.transform_member(node, results)
174-
elif results.get('module_dot'):
174+
elif results.get('bare_with_attr'):
175175
self.transform_dot(node, results)
176176
# Renaming and star imports are not supported for these modules.
177177
elif results.get('module_star'):

0 commit comments

Comments
 (0)