Skip to content Skip to sidebar Skip to footer
Showing posts with the label Type Hinting

How Do I Type-hint That A Python Function Returns Instance Of Any Class Derived From A Superclass?

I've got a bunch of Django template inclusion tags, which take as an argument either a specific… Read more How Do I Type-hint That A Python Function Returns Instance Of Any Class Derived From A Superclass?

Type-hinting Parameters With A Sentinel Value As The Default

I currently use this strategy when I cannot assign default arguments in a function's signature … Read more Type-hinting Parameters With A Sentinel Value As The Default

Mypy/typeshed Stubs For Pandas

Just checking to see if anybody listening has already generated a sort-of-working set of mypy/types… Read more Mypy/typeshed Stubs For Pandas

Python: Typehints For Argparse.namespace Objects

Is there a way to have Python static analyzers (e.g. in PyCharm, other IDEs) pick up on Typehints o… Read more Python: Typehints For Argparse.namespace Objects

Enum Class Method With Default Enum Value Fails

I am well aware that if you have a class method that uses the enum's class name for type hintin… Read more Enum Class Method With Default Enum Value Fails

Python: All Type Hints Errors In Subclass Constructure Seems Ignored

I have the following code with python type hints It has a bunch of errors. All erros in code are fo… Read more Python: All Type Hints Errors In Subclass Constructure Seems Ignored

Why Is Mypy Complaining About List Comprehension When It Can't Be Annotated?

Why does Mypy complain that it requires a type annotation for a list comprehension variable, when i… Read more Why Is Mypy Complaining About List Comprehension When It Can't Be Annotated?

Mypy Errors For Decorator W/ Arguments

I'm trying to do strict type checking with MyPy and I can't seem to get decorators with arg… Read more Mypy Errors For Decorator W/ Arguments