File tree Expand file tree Collapse file tree 1 file changed +12
-6
lines changed Expand file tree Collapse file tree 1 file changed +12
-6
lines changed Original file line number Diff line number Diff line change @@ -823,12 +823,18 @@ An attribute reference is a primary followed by a period and a name:
823823
824824The primary must evaluate to an object of a type that supports attribute
825825references, which most objects do. This object is then asked to produce the
826- attribute whose name is the identifier. This production can be customized by
827- overriding the :meth: `__getattr__ ` method. If this attribute is not available,
828- the exception :exc: `AttributeError ` is raised. Otherwise, the type and value of
829- the object produced is determined by the object. Multiple evaluations of the
830- same attribute reference may yield different objects.
831-
826+ attribute whose name is the identifier. The type and value produced is
827+ determined by the object. Multiple evaluations of the same attribute
828+ reference may yield different objects.
829+
830+ This production can be customized by overriding the
831+ :meth: `~object.__getattribute__ ` method or the :meth: `~object.__getattr__ `
832+ method. The :meth: `!__getattribute__ ` method is called first and either
833+ returns a value or raises :exc: `AttributeError ` if the attribute is not
834+ available.
835+
836+ If an :exc: `AttributeError ` is raised and the object has a :meth: `!__getattr__ `
837+ method, that method is called as a fallback.
832838
833839.. _subscriptions :
834840
You can’t perform that action at this time.
0 commit comments