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