-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Support attr converters with new semantic analyzer #6438
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Labels
priority-0-high
semantic-analyzer
Problems that happen during semantic analysis
topic-attrs
topic-plugins
The plugin API and ideas for new plugins
Comments
I've just ran with an issue with from distutils.version import LooseVersion
import attr
@attr.s
class Manifest:
version: LooseVersion = attr.ib(converter=LooseVersion, default='1.0') And the output from mypy:
|
@danie1k your problem is unrelated to this issue and is a duplicate of python-attrs/attrs#518 |
@ilevkivskyi Thanks! 👍 |
JukkaL
added a commit
that referenced
this issue
Jun 28, 2019
This is a hacky fix to better handle overloaded function during semantic analysis. The original approach is not very clean so this doesn't make this worse. Fixes #6438.
JukkaL
added a commit
that referenced
this issue
Jun 28, 2019
This is a hacky fix to better handle overloaded functions during semantic analysis. The original approach is not very clean so this doesn't make this worse, arguably. Fixes #6438.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
priority-0-high
semantic-analyzer
Problems that happen during semantic analysis
topic-attrs
topic-plugins
The plugin API and ideas for new plugins
This is a follow up for #6435
The
attrs
plugin does some tricky things to support converters, in particular although the plugin is called during semantic analysis, it look like some parts belong to type checking. In particular, we need to know analyzed types of overloaded functions while still semantically analyzing top levels, which is especially tricky with the new semantic analyzer.See also
testAttrsUsingBadConverter
.The text was updated successfully, but these errors were encountered: