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

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?

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

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

How To Make Mypy Complain About Assigning An Any To An Int

mypy --strict dutifully complains about the following code: from typing import Any, Dict def main(… Read more How To Make Mypy Complain About Assigning An Any To An Int