453453
454454 These represent a mutable set. They are created by the built-in :func: `set `
455455 constructor and can be modified afterwards by several methods, such as
456- :meth: `~set .add `.
456+ :meth: `~add <frozenset .add> `.
457457
458458
459459Frozen sets
@@ -1272,7 +1272,7 @@ Special attributes
12721272 * - .. attribute:: type.__firstlineno__
12731273 - The line number of the first line of the class definition,
12741274 including decorators.
1275- Setting the :attr: `__module__ ` attribute removes the
1275+ Setting the :attr: `~type. __module__ ` attribute removes the
12761276 :attr: `!__firstlineno__ ` item from the type's dictionary.
12771277
12781278 .. versionadded :: 3.13
@@ -2351,6 +2351,9 @@ Customizing module attribute access
23512351 single: __dir__ (module attribute)
23522352 single: __class__ (module attribute)
23532353
2354+ .. method :: module.__getattr__
2355+ module.__dir__
2356+
23542357Special names ``__getattr__ `` and ``__dir__ `` can be also used to customize
23552358access to module attributes. The ``__getattr__ `` function at the module level
23562359should accept one argument which is the name of an attribute and return the
@@ -2364,6 +2367,8 @@ The ``__dir__`` function should accept no arguments, and return an iterable of
23642367strings that represents the names accessible on module. If present, this
23652368function overrides the standard :func: `dir ` search on a module.
23662369
2370+ .. attribute :: module.__class__
2371+
23672372For a more fine grained customization of the module behavior (setting
23682373attributes, properties, etc.), one can set the ``__class__ `` attribute of
23692374a module object to a subclass of :class: `types.ModuleType `. For example::
@@ -2685,7 +2690,7 @@ class defining the method.
26852690 .. versionadded :: 3.6
26862691
26872692
2688- When a class is created, :meth: `type.__new__ ` scans the class variables
2693+ When a class is created, :meth: `! type.__new__ ` scans the class variables
26892694and makes callbacks to those with a :meth: `~object.__set_name__ ` hook.
26902695
26912696.. method :: object.__set_name__(self, owner, name)
0 commit comments