Skip to content

coverage check reports inherited typed attribute as untyped #3997

Description

@jorenham

I stumbled upon this while working on pydot, where pyrefly coverage check --public-only reports:

 INFO Found `/home/joren/Workspace/pydot/pyproject.toml` marking project root, checking root directory with auto configuration
 WARN `pydot.dot_parser.DefaultStatement.attrs` is untyped [coverage-missing]
  --> src/pydot/dot_parser.py:82:14
   |
82 |         self.attrs = attrs
   |              -----
   |
ERROR type coverage 99.62% (264 of 265 typable) is below the 100.00% threshol

for the following code (src):

class P_AttrList:
    attrs: dict[str, Any]

    # -- snip --

class DefaultStatement(P_AttrList):
    default_type: Final[str]

    def __init__(self, default_type: str, attrs: dict[str, Any]) -> None:
        self.default_type = default_type
        self.attrs = attrs   # ❌ 

But attrs is already typed in P_AttrList, the direct base class of DefaultStatement.

Metadata

Metadata

Assignees

Labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions