This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author robieta
Recipients robieta
Date 2020-05-11.17:19:58
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1589217598.74.0.170713443577.issue40595@roundup.psfhosted.org>
In-reply-to
Content
Consider the following:
```
import re

class MyClass(object):
    def re(self):
        pass

    def foo(self, m: re.Match):
        pass
```

Even though `re` and `MyClass.re` are distinct namespaces, the type annotation misses that fact (presumably there is an issue with how it is parsing the AST) and attempts to access MyClass.re.Match, resulting in:

`AttributeError: 'function' object has no attribute 'Match'`

Commenting out the definition of `MyClass.re` or reversing the definition order resolves the issue.
History
Date User Action Args
2020-05-11 17:19:58robietasetrecipients: + robieta
2020-05-11 17:19:58robietasetmessageid: <1589217598.74.0.170713443577.issue40595@roundup.psfhosted.org>
2020-05-11 17:19:58robietalinkissue40595 messages
2020-05-11 17:19:58robietacreate