mirror of
https://github.com/python/cpython.git
synced 2025-11-13 07:26:31 +00:00
update doctests
This commit is contained in:
parent
199b78d41a
commit
439e17fb0b
2 changed files with 11 additions and 10 deletions
|
|
@ -251,7 +251,7 @@ in the top-level :mod:`email` package namespace.
|
||||||
Here's an example of how you might use this at an interactive Python prompt::
|
Here's an example of how you might use this at an interactive Python prompt::
|
||||||
|
|
||||||
>>> import email
|
>>> import email
|
||||||
>>> msg = email.message_from_string(myString)
|
>>> msg = email.message_from_string(myString) # doctest: +SKIP
|
||||||
|
|
||||||
|
|
||||||
Additional notes
|
Additional notes
|
||||||
|
|
|
||||||
|
|
@ -305,17 +305,18 @@ are always available. They are listed here in alphabetical order.
|
||||||
|
|
||||||
>>> import struct
|
>>> import struct
|
||||||
>>> dir() # show the names in the module namespace
|
>>> dir() # show the names in the module namespace
|
||||||
['__builtins__', '__doc__', '__name__', 'struct']
|
['__builtins__', '__name__', 'struct']
|
||||||
>>> dir(struct) # show the names in the struct module
|
>>> dir(struct) # show the names in the struct module # doctest: +SKIP
|
||||||
['Struct', '__builtins__', '__doc__', '__file__', '__name__',
|
['Struct', '__all__', '__builtins__', '__cached__', '__doc__', '__file__',
|
||||||
'__package__', '_clearcache', 'calcsize', 'error', 'pack', 'pack_into',
|
'__initializing__', '__loader__', '__name__', '__package__',
|
||||||
|
'_clearcache', 'calcsize', 'error', 'pack', 'pack_into',
|
||||||
'unpack', 'unpack_from']
|
'unpack', 'unpack_from']
|
||||||
>>> class Shape(object):
|
>>> class Shape(object):
|
||||||
def __dir__(self):
|
... def __dir__(self):
|
||||||
return ['area', 'perimeter', 'location']
|
... return ['area', 'perimeter', 'location']
|
||||||
>>> s = Shape()
|
>>> s = Shape()
|
||||||
>>> dir(s)
|
>>> dir(s)
|
||||||
['area', 'perimeter', 'location']
|
['area', 'location', 'perimeter']
|
||||||
|
|
||||||
.. note::
|
.. note::
|
||||||
|
|
||||||
|
|
@ -614,9 +615,9 @@ are always available. They are listed here in alphabetical order.
|
||||||
to a string (stripping a trailing newline), and returns that. When EOF is
|
to a string (stripping a trailing newline), and returns that. When EOF is
|
||||||
read, :exc:`EOFError` is raised. Example::
|
read, :exc:`EOFError` is raised. Example::
|
||||||
|
|
||||||
>>> s = input('--> ')
|
>>> s = input('--> ') # doctest: +SKIP
|
||||||
--> Monty Python's Flying Circus
|
--> Monty Python's Flying Circus
|
||||||
>>> s
|
>>> s # doctest: +SKIP
|
||||||
"Monty Python's Flying Circus"
|
"Monty Python's Flying Circus"
|
||||||
|
|
||||||
If the :mod:`readline` module was loaded, then :func:`input` will use it
|
If the :mod:`readline` module was loaded, then :func:`input` will use it
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue