]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
#4517: add "special method" glossary entry and clarify when __getattribute__ is bypassed.
authorGeorg Brandl <georg@python.org>
Fri, 5 Dec 2008 15:29:39 +0000 (15:29 +0000)
committerGeorg Brandl <georg@python.org>
Fri, 5 Dec 2008 15:29:39 +0000 (15:29 +0000)
Doc/glossary.rst
Doc/reference/datamodel.rst

index 7a87dd5b2e85db699ada50bed54f58d46c251a91..f3d86c3e0572ca17c59528497657fac712a06821 100644 (file)
@@ -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
index 4dcc96f6a6e3e6bd8238b8fd6a03988762f474b8..068f0fdae281b6d16874864c62c6a028d990fe1d 100644 (file)
@@ -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):