provide a PEP484 stub file (could be generated from the ru.TypedDict tooling)
If continuing to use a custom __init__(), please consider providing a ParameterSpec or typing.TypedDict specification of expected input data structure(s) and dictionary representations.
Description
For TaskDescription and other structures derived from ru.TypedDict, conventional tools that infer valid fields are often unable to provide help because the fields are generated by unconventional metaprogramming.
Adopting one of the above approaches would support static type checkers based on PEP 484 (and others), and IDE features that employ similar introspection.
There are a few different ways that software like IDEs and JupyterLab generate pop-up documentation and/or tab-completion. I don't have a good sense of which, if any, use typeshed or stub files, but all should support annotated fields listed in a class definition.
We don't have the resources to support this. The ru.TypedDict approach was chosen to balance performance with features, and that balance has tradeoffs which we consider out of scope.
Request
Make data structure fields more discoverable to conventional tools in one of the following ways.
ru.TypedDict
to PEP589 TypedDict or PEP557 dataclass,If continuing to use a custom
__init__()
, please consider providing a ParameterSpec or typing.TypedDict specification of expected input data structure(s) and dictionary representations.Description
For TaskDescription and other structures derived from
ru.TypedDict
, conventional tools that infer valid fields are often unable to provide help because the fields are generated by unconventional metaprogramming.Adopting one of the above approaches would support static type checkers based on PEP 484 (and others), and IDE features that employ similar introspection.
There are a few different ways that software like IDEs and JupyterLab generate pop-up documentation and/or tab-completion. I don't have a good sense of which, if any, use typeshed or stub files, but all should support annotated fields listed in a class definition.