diff options
author | Fred Drake <fdrake@acm.org> | 1999-07-22 19:21:45 (GMT) |
---|---|---|
committer | Fred Drake <fdrake@acm.org> | 1999-07-22 19:21:45 (GMT) |
commit | de5d5ce7bcadcceafc3cb847315140d7d473b704 (patch) | |
tree | 220c0286ae3aa4664c3f5950edbb824e92ae106a /Doc/lib/libfuncs.tex | |
parent | 06c5a8b52e135a32ab8fb666927098a39a9951a8 (diff) | |
download | cpython-de5d5ce7bcadcceafc3cb847315140d7d473b704.zip cpython-de5d5ce7bcadcceafc3cb847315140d7d473b704.tar.gz cpython-de5d5ce7bcadcceafc3cb847315140d7d473b704.tar.bz2 |
Update getattr() description to document the optional third
parameter. Thanks to Barry Warsaw for pointing out the oversight.
Diffstat (limited to 'Doc/lib/libfuncs.tex')
-rw-r--r-- | Doc/lib/libfuncs.tex | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/Doc/lib/libfuncs.tex b/Doc/lib/libfuncs.tex index 73aa5d4..0506690 100644 --- a/Doc/lib/libfuncs.tex +++ b/Doc/lib/libfuncs.tex @@ -259,11 +259,13 @@ removed. and is known to vary. \end{funcdesc} -\begin{funcdesc}{getattr}{object, name} - The arguments are an object and a string. The string must be the - name of one of the object's attributes. The result is the value of - that attribute. For example, \code{getattr(\var{x}, - '\var{foobar}')} is equivalent to \code{\var{x}.\var{foobar}}. +\begin{funcdesc}{getattr}{object, name\optional{, default}} + Return the value of the named attributed of \var{object}. \var{name} + must be a string. If the string is the name of one of the object's + attributes, the result is the value of that attribute. For example, + \code{getattr(x, 'foobar')} is equivalent to \code{x.foobar}. If the + named attribute does not exist, \var{default} is returned if provided, + otherwise \exception{AttributeError} is raised. \end{funcdesc} \begin{funcdesc}{globals}{} |