Skip to content

delete description for mypy specific behavior - #2381

Open
sssxks wants to merge 1 commit into
python:mainfrom
sssxks:remove-init-annotation-aside
Open

sssxks wants to merge 1 commit into
python:mainfrom
sssxks:remove-init-annotation-aside

Conversation

@sssxks

@sssxks sssxks commented Nov 1, 2026 •

Copy link
Copy Markdown

The deleted explanation hints an specific design ("no annotation, no check") that by
test only exists in mypy. I tested a few checkers on the following example, and
doesn't match the document at all. therefore, it should be deleted.

from typing import Any


class Unannotated:
    def __init__(self):
        self.value = 1 + "a"


class UnannotatedParameter:
    def __init__(self, x):
        self.value = 1 + "a"


class ReturnAnnotated:
    def __init__(self) -> None:
        self.value = 1 + "a"


class AnyParameter:
    def __init__(self, x: Any):
        self.value = 1 + "a"


class TypedParameter:
    def __init__(self, x: int):
        self.value = 1 + "a"
ctor sig mypy default mypy --check-untyped-defs Pyright default ty default Pyrefly --preset default
__init__(self) Misses Catches Catches Catches Catches
__init__(self, x) Misses Catches Catches Catches Catches
__init__(self) -> None Catches Catches Catches Catches Catches
__init__(self, x: Any) Catches Catches Catches Catches Catches
__init__(self, x: int) Catches Catches Catches Catches Catches

@python-cla-bot

python-cla-bot Bot commented Nov 1, 2026 •

Copy link
Copy Markdown

All commit authors signed the Contributor License Agreement.

CLA signed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants