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

Python 3 Type Hints For Performance Optimizations

PEP 484 says 'Using type hints for performance optimizations is left as an exercise for the rea… Read more Python 3 Type Hints For Performance Optimizations

Typing Hints Pycharm For A Class Used Within Itself

How do I properly type a class within itself? In PyCharm I am currently getting this error: This i… Read more Typing Hints Pycharm For A Class Used Within Itself

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?

Exclude Type In Python Typing Annotation

I wrote the following function: def _clean_dict(d): return {k: v for k, v in d.items() if v is … Read more Exclude Type In Python Typing Annotation

Is It Possible To Create A Regex-constrained Type Hint?

I have a helper function that converts a %Y-%m-%d %H:%M:%S-formatted string to a datetime.datetime:… Read more Is It Possible To Create A Regex-constrained Type Hint?

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?

How To Use Reveal_type In Mypy

I have read that I can reveal the type of variables by using a function called reveal_type, but I c… Read more How To Use Reveal_type In Mypy

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