Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
740ba6ea
Commit
740ba6ea
authored
Dec 07, 2001
by
Fred Drake
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add change notes where im_class is discussed, since the exact meaning changes
with Python 2.2.
parent
b4f33d08
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
60 additions
and
49 deletions
+60
-49
Doc/lib/libinspect.tex
Doc/lib/libinspect.tex
+58
-49
Doc/ref/ref3.tex
Doc/ref/ref3.tex
+2
-0
No files found.
Doc/lib/libinspect.tex
View file @
740ba6ea
...
...
@@ -30,62 +30,71 @@ provided as convenient choices for the second argument to
\function
{
getmembers()
}
. They also help you determine when
you can expect to find the following special attributes:
\begin{tablei
ii}
{
c|l|l
}{}{
Type
}{
Attribute
}{
Description
}
\linei
ii
{
module
}{__
doc
__}{
documentation string
}
\linei
ii
{}{__
file
__}{
filename (missing for built-in modules)
}
\begin{tablei
v}
{
c|l|l|c
}{}{
Type
}{
Attribute
}{
Description
}{
Notes
}
\linei
v
{
module
}{__
doc
__}{
documentation string
}{
}
\linei
v
{}{__
file
__}{
filename (missing for built-in modules)
}{
}
\hline
\linei
ii
{
class
}{__
doc
__}{
documentation string
}
\linei
ii
{}{__
module
__}{
name of module in which this class was defined
}
\linei
v
{
class
}{__
doc
__}{
documentation string
}{
}
\linei
v
{}{__
module
__}{
name of module in which this class was defined
}{
}
\hline
\linei
ii
{
method
}{__
doc
__}{
documentation string
}
\linei
ii
{}{__
name
__}{
name with which this method was defined
}
\linei
ii
{}{
im
_
class
}{
class object that asked for this method
}
\linei
ii
{}{
im
_
func
}{
function object containing implementation of method
}
\linei
ii
{}{
im
_
self
}{
instance to which this method is bound, or
\code
{
None
}
}
\linei
v
{
method
}{__
doc
__}{
documentation string
}{
}
\linei
v
{}{__
name
__}{
name with which this method was defined
}{
}
\linei
v
{}{
im
_
class
}{
class object that asked for this method
}{
(1)
}
\linei
v
{}{
im
_
func
}{
function object containing implementation of method
}{
}
\linei
v
{}{
im
_
self
}{
instance to which this method is bound, or
\code
{
None
}}{
}
\hline
\linei
ii
{
function
}{__
doc
__}{
documentation string
}
\linei
ii
{}{__
name
__}{
name with which this function was defined
}
\linei
ii
{}{
func
_
code
}{
code object containing compiled function bytecode
}
\linei
ii
{}{
func
_
defaults
}{
tuple of any default values for arguments
}
\linei
ii
{}{
func
_
doc
}{
(same as
__
doc
__
)
}
\linei
ii
{}{
func
_
globals
}{
global namespace in which this function was defined
}
\linei
ii
{}{
func
_
name
}{
(same as
__
name
__
)
}
\linei
v
{
function
}{__
doc
__}{
documentation string
}{
}
\linei
v
{}{__
name
__}{
name with which this function was defined
}{
}
\linei
v
{}{
func
_
code
}{
code object containing compiled function bytecode
}{
}
\linei
v
{}{
func
_
defaults
}{
tuple of any default values for arguments
}{
}
\linei
v
{}{
func
_
doc
}{
(same as
__
doc
__
)
}{
}
\linei
v
{}{
func
_
globals
}{
global namespace in which this function was defined
}{
}
\linei
v
{}{
func
_
name
}{
(same as
__
name
__
)
}{
}
\hline
\linei
ii
{
traceback
}{
tb
_
frame
}{
frame object at this level
}
\linei
ii
{}{
tb
_
lasti
}{
index of last attempted instruction in bytecode
}
\linei
ii
{}{
tb
_
lineno
}{
current line number in Python source code
}
\linei
ii
{}{
tb
_
next
}{
next inner traceback object (called by this level)
}
\linei
v
{
traceback
}{
tb
_
frame
}{
frame object at this level
}{
}
\linei
v
{}{
tb
_
lasti
}{
index of last attempted instruction in bytecode
}{
}
\linei
v
{}{
tb
_
lineno
}{
current line number in Python source code
}{
}
\linei
v
{}{
tb
_
next
}{
next inner traceback object (called by this level)
}{
}
\hline
\linei
ii
{
frame
}{
f
_
back
}{
next outer frame object (this frame's caller)
}
\linei
ii
{}{
f
_
builtins
}{
built-in namespace seen by this frame
}
\linei
ii
{}{
f
_
code
}{
code object being executed in this frame
}
\linei
ii
{}{
f
_
exc
_
traceback
}{
traceback if raised in this frame, or
\code
{
None
}
}
\linei
ii
{}{
f
_
exc
_
type
}{
exception type if raised in this frame, or
\code
{
None
}
}
\linei
ii
{}{
f
_
exc
_
value
}{
exception value if raised in this frame, or
\code
{
None
}
}
\linei
ii
{}{
f
_
globals
}{
global namespace seen by this frame
}
\linei
ii
{}{
f
_
lasti
}{
index of last attempted instruction in bytecode
}
\linei
ii
{}{
f
_
lineno
}{
current line number in Python source code
}
\linei
ii
{}{
f
_
locals
}{
local namespace seen by this frame
}
\linei
ii
{}{
f
_
restricted
}{
0 or 1 if frame is in restricted execution mode
}
\linei
ii
{}{
f
_
trace
}{
tracing function for this frame, or
\code
{
None
}
}
\linei
v
{
frame
}{
f
_
back
}{
next outer frame object (this frame's caller)
}{
}
\linei
v
{}{
f
_
builtins
}{
built-in namespace seen by this frame
}{
}
\linei
v
{}{
f
_
code
}{
code object being executed in this frame
}{
}
\linei
v
{}{
f
_
exc
_
traceback
}{
traceback if raised in this frame, or
\code
{
None
}}{
}
\linei
v
{}{
f
_
exc
_
type
}{
exception type if raised in this frame, or
\code
{
None
}}{
}
\linei
v
{}{
f
_
exc
_
value
}{
exception value if raised in this frame, or
\code
{
None
}}{
}
\linei
v
{}{
f
_
globals
}{
global namespace seen by this frame
}{
}
\linei
v
{}{
f
_
lasti
}{
index of last attempted instruction in bytecode
}{
}
\linei
v
{}{
f
_
lineno
}{
current line number in Python source code
}{
}
\linei
v
{}{
f
_
locals
}{
local namespace seen by this frame
}{
}
\linei
v
{}{
f
_
restricted
}{
0 or 1 if frame is in restricted execution mode
}{
}
\linei
v
{}{
f
_
trace
}{
tracing function for this frame, or
\code
{
None
}}{
}
\hline
\linei
ii
{
code
}{
co
_
argcount
}{
number of arguments (not including * or ** args)
}
\linei
ii
{}{
co
_
code
}{
string of raw compiled bytecode
}
\linei
ii
{}{
co
_
consts
}{
tuple of constants used in the bytecode
}
\linei
ii
{}{
co
_
filename
}{
name of file in which this code object was created
}
\linei
ii
{}{
co
_
firstlineno
}{
number of first line in Python source code
}
\linei
ii
{}{
co
_
flags
}{
bitmap: 1=optimized
\code
{
|
}
2=newlocals
\code
{
|
}
4=*arg
\code
{
|
}
8=**arg
}
\linei
ii
{}{
co
_
lnotab
}{
encoded mapping of line numbers to bytecode indices
}
\linei
ii
{}{
co
_
name
}{
name with which this code object was defined
}
\linei
ii
{}{
co
_
names
}{
tuple of names of local variables
}
\linei
ii
{}{
co
_
nlocals
}{
number of local variables
}
\linei
ii
{}{
co
_
stacksize
}{
virtual machine stack space required
}
\linei
ii
{}{
co
_
varnames
}{
tuple of names of arguments and local variables
}
\linei
v
{
code
}{
co
_
argcount
}{
number of arguments (not including * or ** args)
}{
}
\linei
v
{}{
co
_
code
}{
string of raw compiled bytecode
}{
}
\linei
v
{}{
co
_
consts
}{
tuple of constants used in the bytecode
}{
}
\linei
v
{}{
co
_
filename
}{
name of file in which this code object was created
}{
}
\linei
v
{}{
co
_
firstlineno
}{
number of first line in Python source code
}{
}
\linei
v
{}{
co
_
flags
}{
bitmap: 1=optimized
\code
{
|
}
2=newlocals
\code
{
|
}
4=*arg
\code
{
|
}
8=**arg
}{
}
\linei
v
{}{
co
_
lnotab
}{
encoded mapping of line numbers to bytecode indices
}{
}
\linei
v
{}{
co
_
name
}{
name with which this code object was defined
}{
}
\linei
v
{}{
co
_
names
}{
tuple of names of local variables
}{
}
\linei
v
{}{
co
_
nlocals
}{
number of local variables
}{
}
\linei
v
{}{
co
_
stacksize
}{
virtual machine stack space required
}{
}
\linei
v
{}{
co
_
varnames
}{
tuple of names of arguments and local variables
}{
}
\hline
\lineiii
{
builtin
}{__
doc
__}{
documentation string
}
\lineiii
{}{__
name
__}{
original name of this function or method
}
\lineiii
{}{__
self
__}{
instance to which a method is bound, or
\code
{
None
}}
\end{tableiii}
\lineiv
{
builtin
}{__
doc
__}{
documentation string
}{}
\lineiv
{}{__
name
__}{
original name of this function or method
}{}
\lineiv
{}{__
self
__}{
instance to which a method is bound, or
\code
{
None
}}{}
\end{tableiv}
\noindent
Note:
\begin{description}
\item
[(1)]
\versionchanged
[
\member
{
im
_
class
}
used to refer to the class that
defined the method]
{
2.2
}
\end{description}
\begin{funcdesc}
{
getmembers
}{
object
\optional
{
, predicate
}}
Return all the members of an object in a list of (name, value) pairs
...
...
Doc/ref/ref3.tex
View file @
740ba6ea
...
...
@@ -452,6 +452,8 @@ or the class that asked for the method for unbound methods);
\member
{__
doc
__}
is the method's documentation (same as
\code
{
im
_
func.
__
doc
__}
);
\member
{__
name
__}
is the method name (same as
\code
{
im
_
func.
__
name
__}
).
\versionchanged
[
\member
{
im
_
self
}
used to refer to the class that
defined the method]
{
2.2
}
\withsubitem
{
(method attribute)
}{
\ttindex
{
im
_
func
}
\ttindex
{
im
_
self
}}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment