Skip to content

no attribute "__dict__" #1405

@jukebox

Description

@jukebox
⌁40% [juke:~/minidict] % cat minidict.py  
class MyClassMiniDict(object):
    def __init__(self):
        self.foo = object()

    def __eq__(self, otheri: object):
        return self.__dict__ == other.__dict__


⌁40% [juke:~/minidict] % mypy  minidict.py
minidict.py: note: In function "__eq__":
minidict.py:6: error: Name 'other' is not defined
minidict.py: note: In member "__eq__" of class "MyClassMiniDict":
minidict.py:6: error: "MyClassMiniDict" has no attribute "__dict__"


Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions