mirror of
https://github.com/python/cpython.git
synced 2025-09-28 19:25:27 +00:00
Closes #27210: Merge with 3.5
This commit is contained in:
commit
11328fc480
3 changed files with 9 additions and 11 deletions
|
@ -170,8 +170,7 @@ diffs. For comparing directories and files, see also, the :mod:`filecmp` module.
|
||||||
|
|
||||||
>>> s1 = ['bacon\n', 'eggs\n', 'ham\n', 'guido\n']
|
>>> s1 = ['bacon\n', 'eggs\n', 'ham\n', 'guido\n']
|
||||||
>>> s2 = ['python\n', 'eggy\n', 'hamster\n', 'guido\n']
|
>>> s2 = ['python\n', 'eggy\n', 'hamster\n', 'guido\n']
|
||||||
>>> for line in context_diff(s1, s2, fromfile='before.py', tofile='after.py'):
|
>>> sys.stdout.writelines(context_diff(s1, s2, fromfile='before.py', tofile='after.py'))
|
||||||
... sys.stdout.write(line) # doctest: +NORMALIZE_WHITESPACE
|
|
||||||
*** before.py
|
*** before.py
|
||||||
--- after.py
|
--- after.py
|
||||||
***************
|
***************
|
||||||
|
@ -209,7 +208,7 @@ diffs. For comparing directories and files, see also, the :mod:`filecmp` module.
|
||||||
>>> import keyword
|
>>> import keyword
|
||||||
>>> get_close_matches('wheel', keyword.kwlist)
|
>>> get_close_matches('wheel', keyword.kwlist)
|
||||||
['while']
|
['while']
|
||||||
>>> get_close_matches('apple', keyword.kwlist)
|
>>> get_close_matches('pineapple', keyword.kwlist)
|
||||||
[]
|
[]
|
||||||
>>> get_close_matches('accept', keyword.kwlist)
|
>>> get_close_matches('accept', keyword.kwlist)
|
||||||
['except']
|
['except']
|
||||||
|
@ -303,8 +302,7 @@ diffs. For comparing directories and files, see also, the :mod:`filecmp` module.
|
||||||
|
|
||||||
>>> s1 = ['bacon\n', 'eggs\n', 'ham\n', 'guido\n']
|
>>> s1 = ['bacon\n', 'eggs\n', 'ham\n', 'guido\n']
|
||||||
>>> s2 = ['python\n', 'eggy\n', 'hamster\n', 'guido\n']
|
>>> s2 = ['python\n', 'eggy\n', 'hamster\n', 'guido\n']
|
||||||
>>> for line in unified_diff(s1, s2, fromfile='before.py', tofile='after.py'):
|
>>> sys.stdout.writelines(unified_diff(s1, s2, fromfile='before.py', tofile='after.py'))
|
||||||
... sys.stdout.write(line) # doctest: +NORMALIZE_WHITESPACE
|
|
||||||
--- before.py
|
--- before.py
|
||||||
+++ after.py
|
+++ after.py
|
||||||
@@ -1,4 +1,4 @@
|
@@ -1,4 +1,4 @@
|
||||||
|
|
|
@ -57,7 +57,7 @@ The module defines the following items:
|
||||||
>>> with FTP("ftp1.at.proftpd.org") as ftp:
|
>>> with FTP("ftp1.at.proftpd.org") as ftp:
|
||||||
... ftp.login()
|
... ftp.login()
|
||||||
... ftp.dir()
|
... ftp.dir()
|
||||||
...
|
... # doctest: +SKIP
|
||||||
'230 Anonymous login ok, restrictions apply.'
|
'230 Anonymous login ok, restrictions apply.'
|
||||||
dr-xr-xr-x 9 ftp ftp 154 May 6 10:43 .
|
dr-xr-xr-x 9 ftp ftp 154 May 6 10:43 .
|
||||||
dr-xr-xr-x 9 ftp ftp 154 May 6 10:43 ..
|
dr-xr-xr-x 9 ftp ftp 154 May 6 10:43 ..
|
||||||
|
|
|
@ -75,7 +75,7 @@ The module itself defines the following classes:
|
||||||
>>> from nntplib import NNTP
|
>>> from nntplib import NNTP
|
||||||
>>> with NNTP('news.gmane.org') as n:
|
>>> with NNTP('news.gmane.org') as n:
|
||||||
... n.group('gmane.comp.python.committers')
|
... n.group('gmane.comp.python.committers')
|
||||||
...
|
... # doctest: +SKIP
|
||||||
('211 1755 1 1755 gmane.comp.python.committers', 1755, 1, 1755, 'gmane.comp.python.committers')
|
('211 1755 1 1755 gmane.comp.python.committers', 1755, 1, 1755, 'gmane.comp.python.committers')
|
||||||
>>>
|
>>>
|
||||||
|
|
||||||
|
@ -261,9 +261,9 @@ tuples or objects that the method normally returns will be empty.
|
||||||
|
|
||||||
>>> from datetime import date, timedelta
|
>>> from datetime import date, timedelta
|
||||||
>>> resp, groups = s.newgroups(date.today() - timedelta(days=3))
|
>>> resp, groups = s.newgroups(date.today() - timedelta(days=3))
|
||||||
>>> len(groups)
|
>>> len(groups) # doctest: +SKIP
|
||||||
85
|
85
|
||||||
>>> groups[0]
|
>>> groups[0] # doctest: +SKIP
|
||||||
GroupInfo(group='gmane.network.tor.devel', last='4', first='1', flag='m')
|
GroupInfo(group='gmane.network.tor.devel', last='4', first='1', flag='m')
|
||||||
|
|
||||||
|
|
||||||
|
@ -312,9 +312,9 @@ tuples or objects that the method normally returns will be empty.
|
||||||
is a dictionary mapping group names to textual descriptions.
|
is a dictionary mapping group names to textual descriptions.
|
||||||
|
|
||||||
>>> resp, descs = s.descriptions('gmane.comp.python.*')
|
>>> resp, descs = s.descriptions('gmane.comp.python.*')
|
||||||
>>> len(descs)
|
>>> len(descs) # doctest: +SKIP
|
||||||
295
|
295
|
||||||
>>> descs.popitem()
|
>>> descs.popitem() # doctest: +SKIP
|
||||||
('gmane.comp.python.bio.general', 'BioPython discussion list (Moderated)')
|
('gmane.comp.python.bio.general', 'BioPython discussion list (Moderated)')
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue