Skip to content

error for using collections.namedtuple #11304

Closed

Description

@Akuli

Feature

error for using collections.namedtuple

Pitch

if you use collections.namedtuple, you get implicitly Any types everywhere

Activity

  1. sobolevn commented on Oct 9, 2021

    @sobolevn
    Member

    Why? It is valid python. And it very widely used for older versions / cross-version compat. For example, in psutil.

    Related #11206

  2. Akuli commented on Oct 9, 2021

    @Akuli
    ContributorAuthor

    It is not suitable for all projects, and shouldn't be enabled by default, maybe not even with --strict. But I would use it in new code.

  3. emmatyping commented on Oct 9, 2021

    @emmatyping
    Member

    I think this is something you could make a flake8 lint for, or if you prefer a mypy plugin, but we won't be adding this, as it isn't really part of the goals of mypy.

  4. Akuli commented on Oct 9, 2021

    @Akuli
    ContributorAuthor

    Yeah, I was about to comment that I realized it is more of a linter thing.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions