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
0dc1ed11
Commit
0dc1ed11
authored
Apr 01, 2006
by
Georg Brandl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bug #1462278: small fix in documentation of __op__ vs __rop__ methods
parent
15aaecaf
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
8 deletions
+9
-8
Doc/ref/ref3.tex
Doc/ref/ref3.tex
+9
-8
No files found.
Doc/ref/ref3.tex
View file @
0dc1ed11
...
...
@@ -2057,14 +2057,15 @@ exception is raised. But see the following exception:
\item
Exception to the previous item: if the left operand is an instance of
a built-in type or a new-style class, and the right operand is an
instance of a proper subclass of that type or class, the right
operand's
\method
{__
rop
__
()
}
method is tried
\emph
{
before
}
the left
operand's
\method
{__
op
__
()
}
method. This is done so that a subclass can
completely override binary operators. Otherwise, the left operand's
__
op
__
method would always accept the right operand: when an instance
of a given class is expected, an instance of a subclass of that class
is always acceptable.
a built-in type or a new-style class, and the right operand is an instance
of a proper subclass of that type or class and overrides the base's
\method
{__
rop
__
()
}
method, the right operand's
\method
{__
rop
__
()
}
method
is tried
\emph
{
before
}
the left operand's
\method
{__
op
__
()
}
method.
This is done so that a subclass can completely override binary operators.
Otherwise, the left operand's
\method
{__
op
__
()
}
method would always
accept the right operand: when an instance of a given class is expected,
an instance of a subclass of that class is always acceptable.
\item
...
...
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