Skip to content

new rule - ban super() call in NamedTuples #3763

@DetachHead

Description

@DetachHead

https://docs.astral.sh/ty/reference/rules/#non-callable-init-subclass

from typing import NamedTuple

class F(NamedTuple):
    x: int

    def method(self):
        super()  # should report an error here because this crashes at runtime

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wantedLarger than "good first issue", but still well-defined and ready for someone to pick uptypechecking
    No fields configured for Feature.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions