Skip to content

"has no attribute" then suggests another missing attribute #9084

Description

@Dreamsorcerer

Output in a mypy run:

vaults.py:14: error: Module 'datatypes' has no attribute 'VaultDataResponse'; maybe "VaultSummaryResponse"?  [attr-defined]
vaults.py:14: error: Module 'datatypes' has no attribute 'VaultSummaryResponse'; maybe "VaultDataResponse"?  [attr-defined]

Hopefully the error in the above output is self explanatory, it's contradicting itself.

Activity

  1. Dreamsorcerer commented on Jul 1, 2020

    @Dreamsorcerer
    ContributorAuthor

    Note that the attributes do exist, but I'm running with the --no-implicit-reexport option. So, it looks like the suggestions are generated without that option or something.

    In this case, as the variable does exist, the suggestion should probably indicate something about implicit reexport, rather than another variable.

  2. JukkaL commented on Jul 3, 2020

    @JukkaL
    Collaborator

    Yeah, this is a bug. Would you like to contribute a fix -- it should be pretty easy? You can look at the implementation of --no-implicit-reexport for context (#6562).

  3. Dreamsorcerer commented on Jul 3, 2020

    @Dreamsorcerer
    ContributorAuthor

    I can probably look at it in a few weeks.

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

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions