[New-bugs-announce] [issue25650] Mismatching documentation <=> behaviour for typing.Any

Emanuel Barry report at bugs.python.org
Tue Nov 17 13:36:23 EST 2015

New submission from Emanuel Barry:

The docstring for typing.Any specifically says "- Any object is an instance of Any."; in practice however it's not actually the case, as isinstance(x, Any) raises a TypeError.

AnyMeta makes this behaviour seem intentional, however the official documentation seems to be a bit vague on that one too -- https://docs.python.org/3/library/typing.html#the-any-type makes no mention of 'isinstance', but just the next paragraph mirrors the docstring, in 'Any object is an instance of Any'.

I personally believe this is a behaviour error and the docs are correct, as that seems the most logical conclusion. Should this be fixed for 3.5.1?

components: Library (Lib)
messages: 254811
nosy: ebarry
priority: normal
severity: normal
status: open
title: Mismatching documentation <=> behaviour for typing.Any
versions: Python 3.5

Python tracker <report at bugs.python.org>

More information about the New-bugs-announce mailing list