Skip to content Skip to sidebar Skip to footer
Showing posts with the label Mypy

Typing Function When Decorator Change Return Type

how to correctly write types for the function whose return type is modified by decorator ? Simple … Read more Typing Function When Decorator Change Return Type

Class Decorator Compatible For Mypy

Say I have the following simple example without any typehints: def wrapper(cls): class Subclass… Read more Class Decorator Compatible For Mypy

Incompatible Types In Assignment (expression Has Type "list[]", Variable Has Type (...)

Consider the following self-contained example: from typing import List, Union T_BENCODED_LIST = Un… Read more Incompatible Types In Assignment (expression Has Type "list[]", Variable Has Type (...)

Remove Error From Mypy For Attributes Set Dynamically In A Python Class

I am using mypy to check my Python code. I have a class where I set dynamically some attributes and… Read more Remove Error From Mypy For Attributes Set Dynamically In A Python Class

Type Hinting Sqlalchemy Query Result

I can't figure out what kind of object a sqlalchemy query returns. entries = session.query(Foo.… Read more Type Hinting Sqlalchemy Query Result