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
18d8d5a7
Commit
18d8d5a7
authored
Sep 18, 2001
by
Fred Drake
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix minor usage and consistency nits.
parent
624c8af7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
4 deletions
+5
-4
Doc/ref/ref3.tex
Doc/ref/ref3.tex
+5
-4
No files found.
Doc/ref/ref3.tex
View file @
18d8d5a7
...
...
@@ -1145,9 +1145,10 @@ multiplication (meaning repetition) by defining the methods
\method
{__
mul
__
()
}
,
\method
{__
rmul
__
()
}
and
\method
{__
imul
__
()
}
described
below; they should not define
\method
{__
coerce
__
()
}
or other numerical
operators. It is recommended that both mappings and sequences
implement the
\method
{__
contains
__}
, to allow efficient use of the
\code
{
in
}
operator; for mappings,
\code
{
in
}
should be equivalent of
\method
{
has
_
key()
}
; for sequences, it should search through the values.
implement the
\method
{__
contains
__
()
}
method to allow efficient use of
the
\code
{
in
}
operator; for mappings,
\code
{
in
}
should be equivalent
of
\method
{
has
_
key()
}
; for sequences, it should search through the
values.
\withsubitem
{
(mapping object method)
}{
\ttindex
{
keys()
}
\ttindex
{
values()
}
...
...
@@ -1310,7 +1311,7 @@ the \method{__*item__()} methods.
Calling
\code
{
max(0, i)
}
conveniently returns the proper value.
The membership test operators (
\keyword
{
in
}
and
\keyword
{
not in
}
) are
normally implemented as
iteration loop
through the sequence. However,
normally implemented as
an iteration
through the sequence. However,
sequence objects can supply the following special method with a more
efficient implementation:
...
...
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