Skip to content

stubtest: problem with redefined attributes #10545

Open

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

Activity

  1. srittau commented on May 28, 2021

    @srittau
    ContributorAuthor

    Cc @hauntsaninja as resident stubtest expert.

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