[docs] Expand documentation about Any in the typing module (issue 27688)

guido at python.org guido at python.org
Thu Aug 4 23:58:12 EDT 2016


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

http://bugs.python.org/review/27688/diff/18064/Doc/library/typing.rst#newcode187
Doc/library/typing.rst:187: A special kind of type is :class:`Any`. The
static type checker will treat
Maybe "a static type checker"?

http://bugs.python.org/review/27688/diff/18064/Doc/library/typing.rst#newcode188
Doc/library/typing.rst:188: every type as a subclass of :class:`Any` and
:class:`Any` as a subtype of
Could you avoid "subclass" and instead say something like "compatible
with"? (My apologies if PEP 484 isn't always politically correct on this
yet.)

http://bugs.python.org/review/27688/diff/18064/Doc/library/typing.rst#newcode211
Doc/library/typing.rst:211: not throw an error when assigning ``a`` to
``s`` even though ``s`` was
throw -> report

http://bugs.python.org/review/27688/diff/18064/Doc/library/typing.rst#newcode241
Doc/library/typing.rst:241: # Fails; an object does not have a `magic`
method.
Maybe also show that hash(42) *does* type-check?

http://bugs.python.org/review/27688/diff/18064/Doc/library/typing.rst#newcode251
Doc/library/typing.rst:251: manner. Use :class:`Any` to indicate that a
value is dynamically typed.
Maybe add that you have to use isinstance() to be able to use the value
if its type is object?

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


More information about the docs mailing list