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
7af9f4da
Commit
7af9f4da
authored
May 12, 2003
by
Fred Drake
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add a specific mention of the term "operator overloading" and add an
index entry. Suggested to python-docs.
parent
24b2bc36
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
1 deletion
+4
-1
Doc/ref/ref3.tex
Doc/ref/ref3.tex
+4
-1
No files found.
Doc/ref/ref3.tex
View file @
7af9f4da
...
...
@@ -939,7 +939,10 @@ with regular slices.
A class can implement certain operations that are invoked by special
syntax (such as arithmetic operations or subscripting and slicing) by
defining methods with special names. For instance, if a class defines
defining methods with special names.
\indexii
{
operator
}{
overloading
}
This is Python's approach to
\dfn
{
operator overloading
}
, allowing
classes to define their own behavior with respect to language
operators. For instance, if a class defines
a method named
\method
{__
getitem
__
()
}
, and
\code
{
x
}
is an instance of
this class, then
\code
{
x[i]
}
is equivalent to
\code
{
x.
__
getitem
__
(i)
}
. Except where mentioned, attempts to execute
...
...
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