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

levkivskyi at gmail.com levkivskyi at gmail.com
Thu Jul 28 18:11:37 EDT 2016

I would add two small comments

File Doc/library/typing.rst (right):

Doc/library/typing.rst:65: The static type checker will treat the new
type almost as if it were a subclass
It is not clear why do you need word "almost" here.
NewType creates something that type checker treats as equivalent of a
subclass with only one constructor that accepts an instance of the base

Doc/library/typing.rst:86: More precisely, the expression ``some_value
== Derived(some_value)`` is always true at runtime.
I would replace here ``some_value == Derived(some_value)`` with
``some_value is Derived(some_value)``


More information about the docs mailing list