Guido van Rossum <gu...@python.org> added the comment:
It should definitely not return {} for objects without __annotations__ attributes -- get_type_hints(42) should raise TypeError. One could argue that get_type_hints(Bar()) incorrectly returns a dict, but we want to allow for some duck typing here, and, honestly, I don't see this is a big problem. The error message tries to convey the most likely cause of the problem (and it does so nicely for things like get_type_hints(42)). I think we needn't fix this. ---------- resolution: -> wont fix stage: -> resolved status: open -> closed _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue39866> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com