plotly.py
plotly.py copied to clipboard
feat: add type annotations to generated code
feat: adding type annotations to some constructor parameters
Using get_typing_type from codegen/datatypes.py to add Python datatype to some constructor parameters.
Notes:
-
Does not handle the
compounddatatype yet.get_typing_typeraises aValueErrorbecause it doesn't have a clause for this type;add_constructor_paramscatches this and simply doesn't add a type definition. Something between a third and half of all constructor parameters suffer from this, so we need to figure out whatcompoundmeans and define a type for it. (SeeFIXMEin thecodegendirectory.) -
Almost all parameters are nullable, so the type is defined as (for example)
intbut the default value assigned isNone. -
Depends on #4978.