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
7a5e80e8
Commit
7a5e80e8
authored
Feb 27, 2001
by
Barry Warsaw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Updates to describe function attributes.
parent
d4614e83
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
4 deletions
+12
-4
Doc/ref/ref3.tex
Doc/ref/ref3.tex
+12
-4
No files found.
Doc/ref/ref3.tex
View file @
7a5e80e8
...
...
@@ -415,9 +415,12 @@ have a default value; \member{func_code} is the code object representing
the compiled function body;
\member
{
func
_
globals
}
is (a reference to)
the dictionary that holds the function's global variables --- it
defines the global namespace of the module in which the function was
defined.
Of these,
\member
{
func
_
code
}
,
\member
{
func
_
defaults
}
and
\member
{
func
_
doc
}
(and this
\member
{__
doc
__}
) may be writable; the
defined;
\member
{
func
_
dict
}
or
\member
{__
dict
__}
contains the
namespace supporting arbitrary function attributes.
Of these,
\member
{
func
_
code
}
,
\member
{
func
_
defaults
}
,
\member
{
func
_
doc
}
/
\member
{__
doc
__}
, and
\member
{
func
_
dict
}
/
\member
{__
dict
__}
may be writable; the
others can never be changed.
Additional information about a function's definition can be
retrieved from its code object; see the description of internal types
...
...
@@ -426,9 +429,11 @@ below.
\ttindex
{
func
_
doc
}
\ttindex
{__
doc
__}
\ttindex
{__
name
__}
\ttindex
{__
dict
__}
\ttindex
{
func
_
defaults
}
\ttindex
{
func
_
code
}
\ttindex
{
func
_
globals
}}
\ttindex
{
func
_
globals
}
\ttindex
{
func
_
dict
}}
\indexii
{
global
}{
namespace
}
\item
[User-defined methods]
...
...
@@ -449,6 +454,9 @@ base class of the class of which \member{im_self} is an instance);
\ttindex
{
im
_
func
}
\ttindex
{
im
_
self
}}
Methods also support accessing (but not setting) the arbitrary
function attributes on the underlying function object.
User-defined method objects are created in two ways: when getting an
attribute of a class that is a user-defined function object, or when
getting an attribute of a class instance that is a user-defined
...
...
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