[docs] Expand documentation about type aliases and NewType in the typing module (issue 27644)

guido at python.org guido at python.org
Fri Jul 29 18:33:29 EDT 2016


LGTM. I will merge this.


http://bugs.python.org/review/27644/diff/18014/Doc/library/typing.rst
File Doc/library/typing.rst (right):

http://bugs.python.org/review/27644/diff/18014/Doc/library/typing.rst#newcode103
Doc/library/typing.rst:103: is not possible to create another
``NewType`` based on a ``Derived`` type::
On 2016/07/29 23:23:20, levkivskyi wrote:
> I don't think we need to mention this limitation. It might be useful
to further
> derive the type returned by NewType. The PEP says that Base must be a
proper
> class, but I could imagine that this limitation will be relaxed
slightly to
> allow also unique types returned by NewType.
> 
> However, if it is OK with Guido, then it is also OK with me.

The limitation is very real. I really don't want people to start
creating NewTypes with another NewType as base. I probably didn't think
about this when reviewing the PEP text, so perhaps the PEP should also
be updated.

http://bugs.python.org/review/27644/


More information about the docs mailing list