You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
NotRequired[...] built at runtime for introspection reported as invalid-annotation #5429
$ pyrefly check t.py
ERROR `NotRequired` is not allowed in this context [invalid-annotation]
--> t.py:7:18
|
7 | return {key: NotRequired[hint] for key, hint in hints.items()}
| ^^^^^^^^^^^^^^^^^
INFO 1 error
other type checkers are fine with it
In this example, NotRequired is used for runtime checks. An example of where this pattern is used is in huggingface-hub:
Activity
Allow building type qualifiers like `NotRequired[...]` at runtime
Allow building type qualifiers like `NotRequired[...]` at runtime