Skip to content

stubtest: problem with redefined attributes #10545

@srittau

Description

@srittau

Bug Report

See python/typeshed#5545 and this example CI run for reference. It seems that mypy internally renames redefined attributes. For example:

# a.pyi

def foo() -> str: ...
# b.pyi

from a import *

def foo() -> int: ...  # type: ignore

It seems that internally b.foo gets renamed to b.foo-redefined and a.foo keeps the name b.foo while checking b.pyi. This leads to stubtest issuing two errors:

  • b.foo-redefinition is not present at runtime
  • b.foo is inconsistent

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions