Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork33.7k
Closed
Description
Bug report
typing.get_type_hints() works forCallable[[], None] from thetyping module, but notcollections.abc. This is the standard way to annotate a callable which takes no arguments, and the generic types fromtyping should behave identically to those incollections.abc.
importcollections.abcimporttypingdeff1(x:typing.Callable[[],None]):passdeff2(x:collections.abc.Callable[[],None]):passassert"x"intyping.get_type_hints(f1)typing.get_type_hints(f2)# Raises TypeError!
Your environment
CPython 3.11.0a7 (and I believe back to a3), found via CIfor Hypothesis, and reproduced in Ubuntu/WSL2 locally.
I'm skipping that test for now, and will re-enable when this is fixed.