diff options
author | Tim Peters <tim.peters@gmail.com> | 2001-09-22 06:10:55 (GMT) |
---|---|---|
committer | Tim Peters <tim.peters@gmail.com> | 2001-09-22 06:10:55 (GMT) |
commit | e0b2d7ac9aea548d0bee1cdabd5d7b1254a6569d (patch) | |
tree | 277d3df4bdf475df490eb652e387707951c945ab /Doc | |
parent | c377b16d12ba325bb108eca575447d66f19294c0 (diff) | |
download | cpython-e0b2d7ac9aea548d0bee1cdabd5d7b1254a6569d.zip cpython-e0b2d7ac9aea548d0bee1cdabd5d7b1254a6569d.tar.gz cpython-e0b2d7ac9aea548d0bee1cdabd5d7b1254a6569d.tar.bz2 |
Add a function to compute a class's method resolution order. This is
easy for 2.2 new-style classes, but trickier for classic classes, and
different approaches are needed "depending". The function will allow
later code to treat all flavors of classes uniformly.
Diffstat (limited to 'Doc')
-rw-r--r-- | Doc/lib/libinspect.tex | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/Doc/lib/libinspect.tex b/Doc/lib/libinspect.tex index e5ec9ca..24a181a 100644 --- a/Doc/lib/libinspect.tex +++ b/Doc/lib/libinspect.tex @@ -238,7 +238,7 @@ you can expect to find the following special attributes: \begin{funcdesc}{formatargspec}{args\optional{, varargs, varkw, defaults, argformat, varargsformat, varkwformat, defaultformat}} - + Format a pretty argument spec from the four values returned by \function{getargspec()}. The other four arguments are the corresponding optional formatting functions that are called to turn @@ -253,6 +253,14 @@ you can expect to find the following special attributes: names and values into strings. \end{funcdesc} +\begin{funcdesc}{getmro}{cls} + Return a tuple of class cls's base classes, including cls, in + method resolution order. No class appears more than once in this tuple. + Note that the method resolution order depends on cls's type. Unless a + very peculiar user-defined metatype is in use, cls will be the first + element of the tuple. +\end{funcdesc} + \subsection{The interpreter stack \label{inspect-stack}} |