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

Skip to content

Commit 0df7979

Browse files
committed
#4000: fix several 2.x atavisms.
1 parent b186f34 commit 0df7979

4 files changed

Lines changed: 9 additions & 9 deletions

File tree

Doc/howto/functional.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,9 @@ output must only depend on its input.
6969
Some languages are very strict about purity and don't even have assignment
7070
statements such as ``a=3`` or ``c = a + b``, but it's difficult to avoid all
7171
side effects. Printing to the screen or writing to a disk file are side
72-
effects, for example. For example, in Python a ``print`` statement or a
73-
``time.sleep(1)`` both return no useful value; they're only called for their
74-
side effects of sending some text to the screen or pausing execution for a
72+
effects, for example. For example, in Python a call to the :func:`print` or
73+
:func:`time.sleep` function both return no useful value; they're only called for
74+
their side effects of sending some text to the screen or pausing execution for a
7575
second.
7676

7777
Python programs written in functional style usually won't go to the extreme of
@@ -1031,8 +1031,8 @@ value and an iterator for the elements with that key.
10311031
...
10321032
]
10331033

1034-
def get_state ((city, state)):
1035-
return state
1034+
def get_state (city_state):
1035+
return city_state[1]
10361036

10371037
itertools.groupby(city_list, get_state) =>
10381038
('AL', iterator-1),

Doc/library/collections.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -632,7 +632,7 @@ a fixed-width print format:
632632
... def __str__(self):
633633
... return 'Point: x=%6.3f y=%6.3f hypot=%6.3f' % (self.x, self.y, self.hypot)
634634

635-
>>> for p in Point(3, 4), Point(14, 5/7.):
635+
>>> for p in Point(3, 4), Point(14, 5/7):
636636
... print(p)
637637
Point: x= 3.000 y= 4.000 hypot= 5.000
638638
Point: x=14.000 y= 0.714 hypot=14.018

Doc/library/reprlib.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ for file objects could be added::
126126
if obj.name in ['<stdin>', '<stdout>', '<stderr>']:
127127
return obj.name
128128
else:
129-
return `obj`
129+
return repr(obj)
130130

131131
aRepr = MyRepr()
132132
print aRepr.repr(sys.stdin) # prints '<stdin>'

Doc/reference/lexical_analysis.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -676,8 +676,8 @@ Delimiters
676676

677677
The following tokens serve as delimiters in the grammar::
678678

679-
( ) [ ] { } @
680-
, : . ` = ;
679+
( ) [ ] { }
680+
, : . ; @ =
681681
+= -= *= /= //= %=
682682
&= |= ^= >>= <<= **=
683683

0 commit comments

Comments
 (0)