Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 9415309

Browse files
committed
Closes SF patch: 552468.
Type class unification invalidated the statement: x.__getitem__[i] is not equivalent to x[i].
1 parent 59518b0 commit 9415309

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

Doc/ref/ref3.tex

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -897,10 +897,8 @@ \section{Special method names\label{specialnames}}
897897
defining methods with special names. For instance, if a class defines
898898
a method named \method{__getitem__()}, and \code{x} is an instance of
899899
this class, then \code{x[i]} is equivalent to
900-
\code{x.__getitem__(i)}. (The reverse is not true --- if \code{x} is
901-
a list object, \code{x.__getitem__(i)} is not equivalent to
902-
\code{x[i]}.) Except where mentioned, attempts to execute an
903-
operation raise an exception when no appropriate method is defined.
900+
\code{x.__getitem__(i)}. Except where mentioned, attempts to execute
901+
an operation raise an exception when no appropriate method is defined.
904902
\withsubitem{(mapping object method)}{\ttindex{__getitem__()}}
905903

906904
When implementing a class that emulates any built-in type, it is

0 commit comments

Comments
 (0)