Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit f9d5803

Browse files
committed
Add change notes where im_class is discussed, since the exact meaning changes
with Python 2.2.
1 parent b62f0e1 commit f9d5803

2 files changed

Lines changed: 60 additions & 49 deletions

File tree

Doc/lib/libinspect.tex

Lines changed: 58 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -30,62 +30,71 @@ \subsection{Types and members
3030
\function{getmembers()}. They also help you determine when
3131
you can expect to find the following special attributes:
3232

33-
\begin{tableiii}{c|l|l}{}{Type}{Attribute}{Description}
34-
\lineiii{module}{__doc__}{documentation string}
35-
\lineiii{}{__file__}{filename (missing for built-in modules)}
33+
\begin{tableiv}{c|l|l|c}{}{Type}{Attribute}{Description}{Notes}
34+
\lineiv{module}{__doc__}{documentation string}{}
35+
\lineiv{}{__file__}{filename (missing for built-in modules)}{}
3636
\hline
37-
\lineiii{class}{__doc__}{documentation string}
38-
\lineiii{}{__module__}{name of module in which this class was defined}
37+
\lineiv{class}{__doc__}{documentation string}{}
38+
\lineiv{}{__module__}{name of module in which this class was defined}{}
3939
\hline
40-
\lineiii{method}{__doc__}{documentation string}
41-
\lineiii{}{__name__}{name with which this method was defined}
42-
\lineiii{}{im_class}{class object that asked for this method}
43-
\lineiii{}{im_func}{function object containing implementation of method}
44-
\lineiii{}{im_self}{instance to which this method is bound, or \code{None}}
40+
\lineiv{method}{__doc__}{documentation string}{}
41+
\lineiv{}{__name__}{name with which this method was defined}{}
42+
\lineiv{}{im_class}{class object that asked for this method}{(1)}
43+
\lineiv{}{im_func}{function object containing implementation of method}{}
44+
\lineiv{}{im_self}{instance to which this method is bound, or \code{None}}{}
4545
\hline
46-
\lineiii{function}{__doc__}{documentation string}
47-
\lineiii{}{__name__}{name with which this function was defined}
48-
\lineiii{}{func_code}{code object containing compiled function bytecode}
49-
\lineiii{}{func_defaults}{tuple of any default values for arguments}
50-
\lineiii{}{func_doc}{(same as __doc__)}
51-
\lineiii{}{func_globals}{global namespace in which this function was defined}
52-
\lineiii{}{func_name}{(same as __name__)}
46+
\lineiv{function}{__doc__}{documentation string}{}
47+
\lineiv{}{__name__}{name with which this function was defined}{}
48+
\lineiv{}{func_code}{code object containing compiled function bytecode}{}
49+
\lineiv{}{func_defaults}{tuple of any default values for arguments}{}
50+
\lineiv{}{func_doc}{(same as __doc__)}{}
51+
\lineiv{}{func_globals}{global namespace in which this function was defined}{}
52+
\lineiv{}{func_name}{(same as __name__)}{}
5353
\hline
54-
\lineiii{traceback}{tb_frame}{frame object at this level}
55-
\lineiii{}{tb_lasti}{index of last attempted instruction in bytecode}
56-
\lineiii{}{tb_lineno}{current line number in Python source code}
57-
\lineiii{}{tb_next}{next inner traceback object (called by this level)}
54+
\lineiv{traceback}{tb_frame}{frame object at this level}{}
55+
\lineiv{}{tb_lasti}{index of last attempted instruction in bytecode}{}
56+
\lineiv{}{tb_lineno}{current line number in Python source code}{}
57+
\lineiv{}{tb_next}{next inner traceback object (called by this level)}{}
5858
\hline
59-
\lineiii{frame}{f_back}{next outer frame object (this frame's caller)}
60-
\lineiii{}{f_builtins}{built-in namespace seen by this frame}
61-
\lineiii{}{f_code}{code object being executed in this frame}
62-
\lineiii{}{f_exc_traceback}{traceback if raised in this frame, or \code{None}}
63-
\lineiii{}{f_exc_type}{exception type if raised in this frame, or \code{None}}
64-
\lineiii{}{f_exc_value}{exception value if raised in this frame, or \code{None}}
65-
\lineiii{}{f_globals}{global namespace seen by this frame}
66-
\lineiii{}{f_lasti}{index of last attempted instruction in bytecode}
67-
\lineiii{}{f_lineno}{current line number in Python source code}
68-
\lineiii{}{f_locals}{local namespace seen by this frame}
69-
\lineiii{}{f_restricted}{0 or 1 if frame is in restricted execution mode}
70-
\lineiii{}{f_trace}{tracing function for this frame, or \code{None}}
59+
\lineiv{frame}{f_back}{next outer frame object (this frame's caller)}{}
60+
\lineiv{}{f_builtins}{built-in namespace seen by this frame}{}
61+
\lineiv{}{f_code}{code object being executed in this frame}{}
62+
\lineiv{}{f_exc_traceback}{traceback if raised in this frame, or \code{None}}{}
63+
\lineiv{}{f_exc_type}{exception type if raised in this frame, or \code{None}}{}
64+
\lineiv{}{f_exc_value}{exception value if raised in this frame, or \code{None}}{}
65+
\lineiv{}{f_globals}{global namespace seen by this frame}{}
66+
\lineiv{}{f_lasti}{index of last attempted instruction in bytecode}{}
67+
\lineiv{}{f_lineno}{current line number in Python source code}{}
68+
\lineiv{}{f_locals}{local namespace seen by this frame}{}
69+
\lineiv{}{f_restricted}{0 or 1 if frame is in restricted execution mode}{}
70+
\lineiv{}{f_trace}{tracing function for this frame, or \code{None}}{}
7171
\hline
72-
\lineiii{code}{co_argcount}{number of arguments (not including * or ** args)}
73-
\lineiii{}{co_code}{string of raw compiled bytecode}
74-
\lineiii{}{co_consts}{tuple of constants used in the bytecode}
75-
\lineiii{}{co_filename}{name of file in which this code object was created}
76-
\lineiii{}{co_firstlineno}{number of first line in Python source code}
77-
\lineiii{}{co_flags}{bitmap: 1=optimized \code{|} 2=newlocals \code{|} 4=*arg \code{|} 8=**arg}
78-
\lineiii{}{co_lnotab}{encoded mapping of line numbers to bytecode indices}
79-
\lineiii{}{co_name}{name with which this code object was defined}
80-
\lineiii{}{co_names}{tuple of names of local variables}
81-
\lineiii{}{co_nlocals}{number of local variables}
82-
\lineiii{}{co_stacksize}{virtual machine stack space required}
83-
\lineiii{}{co_varnames}{tuple of names of arguments and local variables}
72+
\lineiv{code}{co_argcount}{number of arguments (not including * or ** args)}{}
73+
\lineiv{}{co_code}{string of raw compiled bytecode}{}
74+
\lineiv{}{co_consts}{tuple of constants used in the bytecode}{}
75+
\lineiv{}{co_filename}{name of file in which this code object was created}{}
76+
\lineiv{}{co_firstlineno}{number of first line in Python source code}{}
77+
\lineiv{}{co_flags}{bitmap: 1=optimized \code{|} 2=newlocals \code{|} 4=*arg \code{|} 8=**arg}{}
78+
\lineiv{}{co_lnotab}{encoded mapping of line numbers to bytecode indices}{}
79+
\lineiv{}{co_name}{name with which this code object was defined}{}
80+
\lineiv{}{co_names}{tuple of names of local variables}{}
81+
\lineiv{}{co_nlocals}{number of local variables}{}
82+
\lineiv{}{co_stacksize}{virtual machine stack space required}{}
83+
\lineiv{}{co_varnames}{tuple of names of arguments and local variables}{}
8484
\hline
85-
\lineiii{builtin}{__doc__}{documentation string}
86-
\lineiii{}{__name__}{original name of this function or method}
87-
\lineiii{}{__self__}{instance to which a method is bound, or \code{None}}
88-
\end{tableiii}
85+
\lineiv{builtin}{__doc__}{documentation string}{}
86+
\lineiv{}{__name__}{original name of this function or method}{}
87+
\lineiv{}{__self__}{instance to which a method is bound, or \code{None}}{}
88+
\end{tableiv}
89+
90+
\noindent
91+
Note:
92+
\begin{description}
93+
\item[(1)]
94+
\versionchanged[\member{im_class} used to refer to the class that
95+
defined the method]{2.2}
96+
\end{description}
97+
8998

9099
\begin{funcdesc}{getmembers}{object\optional{, predicate}}
91100
Return all the members of an object in a list of (name, value) pairs

Doc/ref/ref3.tex

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -452,6 +452,8 @@ \section{The standard type hierarchy\label{types}}
452452
\member{__doc__} is the method's documentation (same as
453453
\code{im_func.__doc__}); \member{__name__} is the method name (same as
454454
\code{im_func.__name__}).
455+
\versionchanged[\member{im_self} used to refer to the class that
456+
defined the method]{2.2}
455457
\withsubitem{(method attribute)}{
456458
\ttindex{im_func}
457459
\ttindex{im_self}}

0 commit comments

Comments
 (0)