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

Skip to content

Commit cb40ba1

Browse files
committed
SF bug #805304: super instances don't support item assignment
Document a nuance of super(). It is designed to work well with dotted attribute lookup but not with equivalent implicit lookups using operators or statements.
1 parent 6c06cd5 commit cb40ba1

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

Doc/lib/libfuncs.tex

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -996,6 +996,12 @@ \section{Built-in Functions \label{built-in-funcs}}
996996
def meth(self, arg):
997997
super(C, self).meth(arg)
998998
\end{verbatim}
999+
1000+
Note that \function{super} is implemented as part of the binding process for
1001+
explicit dotted attribute lookups such as
1002+
\samp{super(C, self).__getitem__(name)}. Accordingly, \function{super} is
1003+
undefined for implicit lookups using statements or operators such as
1004+
\samp{super(C, self)[name]}.
9991005
\versionadded{2.2}
10001006
\end{funcdesc}
10011007

0 commit comments

Comments
 (0)