Fix grammar nits
This commit is contained in:
parent
99b1665d94
commit
d85cbb9264
|
@ -12,7 +12,7 @@ Post-History: 09-Sep-2017
|
||||||
Abstract
|
Abstract
|
||||||
========
|
========
|
||||||
|
|
||||||
It is proposed to support ``__getattr__`` function defined on modules to
|
It is proposed to support a ``__getattr__`` function defined on modules to
|
||||||
provide basic customization of module attribute access.
|
provide basic customization of module attribute access.
|
||||||
|
|
||||||
|
|
||||||
|
@ -22,7 +22,7 @@ Rationale
|
||||||
It is sometimes convenient to customize or otherwise have control over
|
It is sometimes convenient to customize or otherwise have control over
|
||||||
access to module attributes. A typical example is managing deprecation
|
access to module attributes. A typical example is managing deprecation
|
||||||
warnings. Typical workarounds are assigning ``__class__`` of a module object
|
warnings. Typical workarounds are assigning ``__class__`` of a module object
|
||||||
to a custom subclass of ``types.ModuleType`` or substituting ``sys.modules``
|
to a custom subclass of ``types.ModuleType`` or replacing the ``sys.modules``
|
||||||
item with a custom wrapper instance. It would be convenient to simplify this
|
item with a custom wrapper instance. It would be convenient to simplify this
|
||||||
procedure by recognizing ``__getattr__`` defined directly in a module that
|
procedure by recognizing ``__getattr__`` defined directly in a module that
|
||||||
would act like a normal ``__getattr__`` method, except that it will be defined
|
would act like a normal ``__getattr__`` method, except that it will be defined
|
||||||
|
@ -84,7 +84,7 @@ Specification
|
||||||
=============
|
=============
|
||||||
|
|
||||||
The ``__getattr__`` function at the module level should accept one argument
|
The ``__getattr__`` function at the module level should accept one argument
|
||||||
which is a name of an attribute and return the computed value or raise
|
which is the name of an attribute and return the computed value or raise
|
||||||
an ``AttributeError``::
|
an ``AttributeError``::
|
||||||
|
|
||||||
def __getattr__(name: str) -> Any: ...
|
def __getattr__(name: str) -> Any: ...
|
||||||
|
|
Loading…
Reference in New Issue