Skip to content

PYI049: false positive for private inner class #9948

@ecryth

Description

@ecryth

The following code results in a PYI049 error even though _B is very much used:

from typing import TypedDict


class A:
    class _B(TypedDict):
        pass

    def f(self) -> None:
        print(A._B())


A().f()
$ ruff check --select=PYI test.py
test.py:5:11: PYI049 Private TypedDict `_B` is never used
Found 1 error.
$ ruff --version
ruff 0.2.1

Metadata

Metadata

Assignees

Labels

ruleImplementing or modifying a lint rule

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions