@@ -273,7 +273,7 @@ attributes (see :ref:`import-mod-attrs` for module attributes):
273
273
274
274
:func: `getmembers ` will only return class attributes defined in the
275
275
metaclass when the argument is a class and those attributes have been
276
- listed in the metaclass' custom :meth: `__dir__ `.
276
+ listed in the metaclass' custom :meth: `~object. __dir__ `.
277
277
278
278
279
279
.. function :: getmembers_static(object[, predicate])
@@ -466,12 +466,13 @@ attributes (see :ref:`import-mod-attrs` for module attributes):
466
466
has a :meth: `~object.__get__ ` method but not a :meth: `~object.__set__ `
467
467
method, but beyond that the set of attributes varies. A
468
468
:attr: `~definition.__name__ ` attribute is usually
469
- sensible, and :attr: `__doc__ ` often is.
469
+ sensible, and :attr: `! __doc__ ` often is.
470
470
471
471
Methods implemented via descriptors that also pass one of the other tests
472
472
return ``False `` from the :func: `ismethoddescriptor ` test, simply because the
473
473
other tests promise more -- you can, e.g., count on having the
474
- :attr: `__func__ ` attribute (etc) when an object passes :func: `ismethod `.
474
+ :ref: `__func__ <instance-methods >` attribute (etc) when an object passes
475
+ :func: `ismethod `.
475
476
476
477
477
478
.. function :: isdatadescriptor(object)
@@ -482,7 +483,7 @@ attributes (see :ref:`import-mod-attrs` for module attributes):
482
483
Examples are properties (defined in Python), getsets, and members. The
483
484
latter two are defined in C and there are more specific tests available for
484
485
those types, which is robust across Python implementations. Typically, data
485
- descriptors will also have :attr: `~definition.__name__ ` and :attr: `__doc__ ` attributes
486
+ descriptors will also have :attr: `~definition.__name__ ` and :attr: `! __doc__ ` attributes
486
487
(properties, getsets, and members have both of these attributes), but this is
487
488
not guaranteed.
488
489
@@ -1401,7 +1402,8 @@ Fetching attributes statically
1401
1402
1402
1403
Both :func: `getattr ` and :func: `hasattr ` can trigger code execution when
1403
1404
fetching or checking for the existence of attributes. Descriptors, like
1404
- properties, will be invoked and :meth: `__getattr__ ` and :meth: `__getattribute__ `
1405
+ properties, will be invoked and :meth: `~object.__getattr__ ` and
1406
+ :meth: `~object.__getattribute__ `
1405
1407
may be called.
1406
1408
1407
1409
For cases where you want passive introspection, like documentation tools, this
@@ -1411,7 +1413,8 @@ but avoids executing code when it fetches attributes.
1411
1413
.. function :: getattr_static(obj, attr, default=None)
1412
1414
1413
1415
Retrieve attributes without triggering dynamic lookup via the
1414
- descriptor protocol, :meth: `__getattr__ ` or :meth: `__getattribute__ `.
1416
+ descriptor protocol, :meth: `~object.__getattr__ `
1417
+ or :meth: `~object.__getattribute__ `.
1415
1418
1416
1419
Note: this function may not be able to retrieve all attributes
1417
1420
that getattr can fetch (like dynamically created attributes)
0 commit comments