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

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

Type Hint For Return Value In Subclass

I am writing a CustomEnum class in which I want to add some helper methods, that would then be avai… Read more Type Hint For Return Value In Subclass

Python Type Hinting: Function Return Type, Given As Argument, But Type Is Generic Alias Like Union

We can specify easily return type of function, even if type we expect is provided as one of it'… Read more Python Type Hinting: Function Return Type, Given As Argument, But Type Is Generic Alias Like Union

How Can I Keep Imports Lightweight And Still Properly Type Annotate?

Tensorflow is a super heavy import. I want to import it only when it's needed. However, I have … Read more How Can I Keep Imports Lightweight And Still Properly Type Annotate?

How To Use Typeshed With Mypy?

I cloned typeshed but I can't figure out how to tell mypy to use the type hints it contains, I … Read more How To Use Typeshed With Mypy?

Mypy And Attrs: Errors Typechecking Lists Of Subclasses

I have a message container that can contain different kinds of messages. For now, there are only te… Read more Mypy And Attrs: Errors Typechecking Lists Of Subclasses