diff options
author | Georg Brandl <georg@python.org> | 2011-01-09 08:04:37 (GMT) |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2011-01-09 08:04:37 (GMT) |
commit | cbb2e49c3cddd9c191b175877a91e73c5fdea47d (patch) | |
tree | d183b37d2a74a741f22072ac4c45a963dc2763f5 /Doc/library | |
parent | c40e921d62e053b4ba21ae04ad13172195ebeef5 (diff) | |
download | cpython-cbb2e49c3cddd9c191b175877a91e73c5fdea47d.zip cpython-cbb2e49c3cddd9c191b175877a91e73c5fdea47d.tar.gz cpython-cbb2e49c3cddd9c191b175877a91e73c5fdea47d.tar.bz2 |
Hand-port parts of r87789.
Diffstat (limited to 'Doc/library')
-rw-r--r-- | Doc/library/inspect.rst | 39 |
1 files changed, 20 insertions, 19 deletions
diff --git a/Doc/library/inspect.rst b/Doc/library/inspect.rst index 5277e41..850ff08 100644 --- a/Doc/library/inspect.rst +++ b/Doc/library/inspect.rst @@ -234,14 +234,14 @@ Note: Return a tuple of values that describe how Python will interpret the file identified by *path* if it is a module, or ``None`` if it would not be - identified as a module. The return tuple is ``(name, suffix, mode, mtype)``, - where *name* is the name of the module without the name of any enclosing - package, *suffix* is the trailing part of the file name (which may not be a - dot-delimited extension), *mode* is the :func:`open` mode that would be used - (``'r'`` or ``'rb'``), and *mtype* is an integer giving the type of the - module. *mtype* will have a value which can be compared to the constants - defined in the :mod:`imp` module; see the documentation for that module for - more information on module types. + identified as a module. The return tuple is ``(name, suffix, mode, + module_type)``, where *name* is the name of the module without the name of + any enclosing package, *suffix* is the trailing part of the file name (which + may not be a dot-delimited extension), *mode* is the :func:`open` mode that + would be used (``'r'`` or ``'rb'``), and *module_type* is an integer giving + the type of the module. *module_type* will have a value which can be + compared to the constants defined in the :mod:`imp` module; see the + documentation for that module for more information on module types. .. versionchanged:: 2.6 Returns a :term:`named tuple` ``ModuleInfo(name, suffix, mode, @@ -464,12 +464,13 @@ Classes and functions .. function:: getargspec(func) - Get the names and default values of a Python function's arguments. A tuple of four - things is returned: ``(args, varargs, varkw, defaults)``. *args* is a list of - the argument names (it may contain nested lists). *varargs* and *varkw* are the - names of the ``*`` and ``**`` arguments or ``None``. *defaults* is a tuple of - default argument values or None if there are no default arguments; if this tuple - has *n* elements, they correspond to the last *n* elements listed in *args*. + Get the names and default values of a Python function's arguments. A tuple of + four things is returned: ``(args, varargs, keywords, defaults)``. *args* is a + list of the argument names (it may contain nested lists). *varargs* and + *keywords* are the names of the ``*`` and ``**`` arguments or + ``None``. *defaults* is a tuple of default argument values or None if there + are no default arguments; if this tuple has *n* elements, they correspond to + the last *n* elements listed in *args*. .. versionchanged:: 2.6 Returns a :term:`named tuple` ``ArgSpec(args, varargs, keywords, @@ -478,11 +479,11 @@ Classes and functions .. function:: getargvalues(frame) - Get information about arguments passed into a particular frame. A tuple of four - things is returned: ``(args, varargs, varkw, locals)``. *args* is a list of the - argument names (it may contain nested lists). *varargs* and *varkw* are the - names of the ``*`` and ``**`` arguments or ``None``. *locals* is the locals - dictionary of the given frame. + Get information about arguments passed into a particular frame. A tuple of + four things is returned: ``(args, varargs, keywords, locals)``. *args* is a + list of the argument names (it may contain nested lists). *varargs* and + *keywords* are the names of the ``*`` and ``**`` arguments or ``None``. + *locals* is the locals dictionary of the given frame. .. versionchanged:: 2.6 Returns a :term:`named tuple` ``ArgInfo(args, varargs, keywords, |