mirror of
https://github.com/python/cpython.git
synced 2025-08-01 15:43:13 +00:00
#4517: add "special method" glossary entry and clarify when __getattribute__ is bypassed.
This commit is contained in:
parent
fe879e8a23
commit
9a05373145
2 changed files with 7 additions and 1 deletions
|
@ -498,6 +498,12 @@ Glossary
|
|||
(subscript) notation uses :class:`slice` objects internally (or in older
|
||||
versions, :meth:`__getslice__` and :meth:`__setslice__`).
|
||||
|
||||
special method
|
||||
A method that is called implicitly by Python to execute a certain
|
||||
operation on a type, such as addition. Such methods have names starting
|
||||
and ending with double underscores. Special methods are documented in
|
||||
:ref:`specialnames`.
|
||||
|
||||
statement
|
||||
A statement is part of a suite (a "block" of code). A statement is either
|
||||
an :term:`expression` or a one of several constructs with a keyword, such
|
||||
|
|
|
@ -2370,7 +2370,7 @@ the instance when looking up special methods::
|
|||
True
|
||||
|
||||
In addition to bypassing any instance attributes in the interest of
|
||||
correctness, implicit special method lookup may also bypass the
|
||||
correctness, implicit special method lookup generally also bypasses the
|
||||
:meth:`__getattribute__` method even of the object's metaclass::
|
||||
|
||||
>>> class Meta(type):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue