mirror of
https://github.com/python/cpython.git
synced 2025-09-26 18:29:57 +00:00
[merge from 3.5] - issue27202 - Fix the mistake in changesets 70af472451cb (3.5) and 2bb806539ca6 (3.6)
exclude_patterns in Sphinx conf.py will exclude the .rsts from the build. It was incorrect exclude 2.x rsts in that. This fix contributed again Jelle Zijlstra, excludes doctests in whatsnew/2.7.rst from being exercised by using doctests skip option.
This commit is contained in:
commit
1b749c5ef6
2 changed files with 34 additions and 5 deletions
|
@ -36,9 +36,8 @@ highlight_language = 'python3'
|
||||||
# Require Sphinx 1.2 for build.
|
# Require Sphinx 1.2 for build.
|
||||||
needs_sphinx = '1.2'
|
needs_sphinx = '1.2'
|
||||||
|
|
||||||
# Ignore any .rst files in the venv/ directory, and don't attempt to run tests
|
# Ignore any .rst files in the venv/ directory.
|
||||||
# in the 2.x release notes.
|
exclude_patterns = ['venv/*']
|
||||||
exclude_patterns = ['venv/*', 'whatsnew/2.*.rst']
|
|
||||||
|
|
||||||
|
|
||||||
# Options for HTML output
|
# Options for HTML output
|
||||||
|
|
|
@ -613,6 +613,9 @@ PEP 3137: The memoryview Object
|
||||||
The :class:`memoryview` object provides a view of another object's
|
The :class:`memoryview` object provides a view of another object's
|
||||||
memory content that matches the :class:`bytes` type's interface.
|
memory content that matches the :class:`bytes` type's interface.
|
||||||
|
|
||||||
|
.. doctest::
|
||||||
|
:options: +SKIP
|
||||||
|
|
||||||
>>> import string
|
>>> import string
|
||||||
>>> m = memoryview(string.letters)
|
>>> m = memoryview(string.letters)
|
||||||
>>> m
|
>>> m
|
||||||
|
@ -628,6 +631,9 @@ memory content that matches the :class:`bytes` type's interface.
|
||||||
The content of the view can be converted to a string of bytes or
|
The content of the view can be converted to a string of bytes or
|
||||||
a list of integers:
|
a list of integers:
|
||||||
|
|
||||||
|
.. doctest::
|
||||||
|
:options: +SKIP
|
||||||
|
|
||||||
>>> m2.tobytes()
|
>>> m2.tobytes()
|
||||||
'abcdefghijklmnopqrstuvwxyz'
|
'abcdefghijklmnopqrstuvwxyz'
|
||||||
>>> m2.tolist()
|
>>> m2.tolist()
|
||||||
|
@ -637,6 +643,9 @@ a list of integers:
|
||||||
:class:`memoryview` objects allow modifying the underlying object if
|
:class:`memoryview` objects allow modifying the underlying object if
|
||||||
it's a mutable object.
|
it's a mutable object.
|
||||||
|
|
||||||
|
.. doctest::
|
||||||
|
:options: +SKIP
|
||||||
|
|
||||||
>>> m2[0] = 75
|
>>> m2[0] = 75
|
||||||
Traceback (most recent call last):
|
Traceback (most recent call last):
|
||||||
File "<stdin>", line 1, in <module>
|
File "<stdin>", line 1, in <module>
|
||||||
|
@ -671,6 +680,9 @@ Some smaller changes made to the core Python language are:
|
||||||
``{}`` continues to represent an empty dictionary; use
|
``{}`` continues to represent an empty dictionary; use
|
||||||
``set()`` for an empty set.
|
``set()`` for an empty set.
|
||||||
|
|
||||||
|
.. doctest::
|
||||||
|
:options: +SKIP
|
||||||
|
|
||||||
>>> {1, 2, 3, 4, 5}
|
>>> {1, 2, 3, 4, 5}
|
||||||
set([1, 2, 3, 4, 5])
|
set([1, 2, 3, 4, 5])
|
||||||
>>> set() # empty set
|
>>> set() # empty set
|
||||||
|
@ -684,6 +696,9 @@ Some smaller changes made to the core Python language are:
|
||||||
3.x, generalizing list/generator comprehensions to use
|
3.x, generalizing list/generator comprehensions to use
|
||||||
the literal syntax for sets and dictionaries.
|
the literal syntax for sets and dictionaries.
|
||||||
|
|
||||||
|
.. doctest::
|
||||||
|
:options: +SKIP
|
||||||
|
|
||||||
>>> {x: x*x for x in range(6)}
|
>>> {x: x*x for x in range(6)}
|
||||||
{0: 0, 1: 1, 2: 4, 3: 9, 4: 16, 5: 25}
|
{0: 0, 1: 1, 2: 4, 3: 9, 4: 16, 5: 25}
|
||||||
>>> {('a'*x) for x in range(6)}
|
>>> {('a'*x) for x in range(6)}
|
||||||
|
@ -1052,7 +1067,7 @@ changes, or look through the Subversion logs for all the details.
|
||||||
>>> for letter in 'here is a sample of english text':
|
>>> for letter in 'here is a sample of english text':
|
||||||
... c[letter] += 1
|
... c[letter] += 1
|
||||||
...
|
...
|
||||||
>>> c
|
>>> c # doctest: +SKIP
|
||||||
Counter({' ': 6, 'e': 5, 's': 3, 'a': 2, 'i': 2, 'h': 2,
|
Counter({' ': 6, 'e': 5, 's': 3, 'a': 2, 'i': 2, 'h': 2,
|
||||||
'l': 2, 't': 2, 'g': 1, 'f': 1, 'm': 1, 'o': 1, 'n': 1,
|
'l': 2, 't': 2, 'g': 1, 'f': 1, 'm': 1, 'o': 1, 'n': 1,
|
||||||
'p': 1, 'r': 1, 'x': 1})
|
'p': 1, 'r': 1, 'x': 1})
|
||||||
|
@ -1638,12 +1653,18 @@ changes, or look through the Subversion logs for all the details.
|
||||||
worked around the old behaviour. For example, Python 2.6.4 or 2.5
|
worked around the old behaviour. For example, Python 2.6.4 or 2.5
|
||||||
will return the following:
|
will return the following:
|
||||||
|
|
||||||
|
.. doctest::
|
||||||
|
:options: +SKIP
|
||||||
|
|
||||||
>>> import urlparse
|
>>> import urlparse
|
||||||
>>> urlparse.urlsplit('invented://host/filename?query')
|
>>> urlparse.urlsplit('invented://host/filename?query')
|
||||||
('invented', '', '//host/filename?query', '', '')
|
('invented', '', '//host/filename?query', '', '')
|
||||||
|
|
||||||
Python 2.7 (and Python 2.6.5) will return:
|
Python 2.7 (and Python 2.6.5) will return:
|
||||||
|
|
||||||
|
.. doctest::
|
||||||
|
:options: +SKIP
|
||||||
|
|
||||||
>>> import urlparse
|
>>> import urlparse
|
||||||
>>> urlparse.urlsplit('invented://host/filename?query')
|
>>> urlparse.urlsplit('invented://host/filename?query')
|
||||||
('invented', 'host', '/filename?query', '', '')
|
('invented', 'host', '/filename?query', '', '')
|
||||||
|
@ -1652,7 +1673,10 @@ changes, or look through the Subversion logs for all the details.
|
||||||
returns a named tuple instead of a standard tuple.)
|
returns a named tuple instead of a standard tuple.)
|
||||||
|
|
||||||
The :mod:`urlparse` module also supports IPv6 literal addresses as defined by
|
The :mod:`urlparse` module also supports IPv6 literal addresses as defined by
|
||||||
:rfc:`2732` (contributed by Senthil Kumaran; :issue:`2987`). ::
|
:rfc:`2732` (contributed by Senthil Kumaran; :issue:`2987`).
|
||||||
|
|
||||||
|
.. doctest::
|
||||||
|
:options: +SKIP
|
||||||
|
|
||||||
>>> urlparse.urlparse('http://[1080::8:800:200C:417A]/foo')
|
>>> urlparse.urlparse('http://[1080::8:800:200C:417A]/foo')
|
||||||
ParseResult(scheme='http', netloc='[1080::8:800:200C:417A]',
|
ParseResult(scheme='http', netloc='[1080::8:800:200C:417A]',
|
||||||
|
@ -2475,12 +2499,18 @@ In the standard library:
|
||||||
worked around the old behaviour. For example, Python 2.6.4 or 2.5
|
worked around the old behaviour. For example, Python 2.6.4 or 2.5
|
||||||
will return the following:
|
will return the following:
|
||||||
|
|
||||||
|
.. doctest::
|
||||||
|
:options: +SKIP
|
||||||
|
|
||||||
>>> import urlparse
|
>>> import urlparse
|
||||||
>>> urlparse.urlsplit('invented://host/filename?query')
|
>>> urlparse.urlsplit('invented://host/filename?query')
|
||||||
('invented', '', '//host/filename?query', '', '')
|
('invented', '', '//host/filename?query', '', '')
|
||||||
|
|
||||||
Python 2.7 (and Python 2.6.5) will return:
|
Python 2.7 (and Python 2.6.5) will return:
|
||||||
|
|
||||||
|
.. doctest::
|
||||||
|
:options: +SKIP
|
||||||
|
|
||||||
>>> import urlparse
|
>>> import urlparse
|
||||||
>>> urlparse.urlsplit('invented://host/filename?query')
|
>>> urlparse.urlsplit('invented://host/filename?query')
|
||||||
('invented', 'host', '/filename?query', '', '')
|
('invented', 'host', '/filename?query', '', '')
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue