@@ -613,6 +613,9 @@ PEP 3137: The memoryview Object
613613The :class: `memoryview ` object provides a view of another object's
614614memory content that matches the :class: `bytes ` type's interface.
615615
616+ .. doctest ::
617+ :options: +SKIP
618+
616619 >>> import string
617620 >>> m = memoryview (string.letters)
618621 >>> m
@@ -628,6 +631,9 @@ memory content that matches the :class:`bytes` type's interface.
628631The content of the view can be converted to a string of bytes or
629632a list of integers:
630633
634+ .. doctest ::
635+ :options: +SKIP
636+
631637 >>> m2.tobytes()
632638 'abcdefghijklmnopqrstuvwxyz'
633639 >>> m2.tolist()
@@ -637,6 +643,9 @@ a list of integers:
637643:class: `memoryview ` objects allow modifying the underlying object if
638644it's a mutable object.
639645
646+ .. doctest ::
647+ :options: +SKIP
648+
640649 >>> m2[0 ] = 75
641650 Traceback (most recent call last):
642651 File "<stdin>", line 1, in <module>
@@ -671,6 +680,9 @@ Some smaller changes made to the core Python language are:
671680 ``{} `` continues to represent an empty dictionary; use
672681 ``set() `` for an empty set.
673682
683+ .. doctest ::
684+ :options: +SKIP
685+
674686 >>> {1 , 2 , 3 , 4 , 5 }
675687 set([1, 2, 3, 4, 5])
676688 >>> set () # empty set
@@ -684,6 +696,9 @@ Some smaller changes made to the core Python language are:
684696 3.x, generalizing list/generator comprehensions to use
685697 the literal syntax for sets and dictionaries.
686698
699+ .. doctest ::
700+ :options: +SKIP
701+
687702 >>> {x: x* x for x in range (6 )}
688703 {0: 0, 1: 1, 2: 4, 3: 9, 4: 16, 5: 25}
689704 >>> {(' a' * x) for x in range (6 )}
@@ -1052,7 +1067,7 @@ changes, or look through the Subversion logs for all the details.
10521067 >>> for letter in ' here is a sample of english text' :
10531068 ... c[letter] += 1
10541069 ...
1055- >>> c
1070+ >>> c # doctest: +SKIP
10561071 Counter({' ': 6, 'e': 5, 's': 3, 'a': 2, 'i': 2, 'h': 2,
10571072 'l': 2, 't': 2, 'g': 1, 'f': 1, 'm': 1, 'o': 1, 'n': 1,
10581073 'p': 1, 'r': 1, 'x': 1})
@@ -1638,12 +1653,18 @@ changes, or look through the Subversion logs for all the details.
16381653 worked around the old behaviour. For example, Python 2.6.4 or 2.5
16391654 will return the following:
16401655
1656+ .. doctest ::
1657+ :options: +SKIP
1658+
16411659 >>> import urlparse
16421660 >>> urlparse.urlsplit(' invented://host/filename?query' )
16431661 ('invented', '', '//host/filename?query', '', '')
16441662
16451663 Python 2.7 (and Python 2.6.5) will return:
16461664
1665+ .. doctest ::
1666+ :options: +SKIP
1667+
16471668 >>> import urlparse
16481669 >>> urlparse.urlsplit(' invented://host/filename?query' )
16491670 ('invented', 'host', '/filename?query', '', '')
@@ -1652,7 +1673,10 @@ changes, or look through the Subversion logs for all the details.
16521673 returns a named tuple instead of a standard tuple.)
16531674
16541675 The :mod: `urlparse ` module also supports IPv6 literal addresses as defined by
1655- :rfc: `2732 ` (contributed by Senthil Kumaran; :issue: `2987 `). ::
1676+ :rfc: `2732 ` (contributed by Senthil Kumaran; :issue: `2987 `).
1677+
1678+ .. doctest ::
1679+ :options: +SKIP
16561680
16571681 >>> urlparse.urlparse(' http://[1080::8:800:200C:417A]/foo' )
16581682 ParseResult(scheme='http', netloc='[1080::8:800:200C:417A]',
@@ -2475,12 +2499,18 @@ In the standard library:
24752499 worked around the old behaviour. For example, Python 2.6.4 or 2.5
24762500 will return the following:
24772501
2502+ .. doctest ::
2503+ :options: +SKIP
2504+
24782505 >>> import urlparse
24792506 >>> urlparse.urlsplit(' invented://host/filename?query' )
24802507 ('invented', '', '//host/filename?query', '', '')
24812508
24822509 Python 2.7 (and Python 2.6.5) will return:
24832510
2511+ .. doctest ::
2512+ :options: +SKIP
2513+
24842514 >>> import urlparse
24852515 >>> urlparse.urlsplit(' invented://host/filename?query' )
24862516 ('invented', 'host', '/filename?query', '', '')
0 commit comments