-
-
Notifications
You must be signed in to change notification settings - Fork 374
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
[bug, typing] MyPy doesn't like attrs.converters #930
Comments
Ugh, looks like our import tests in typing_examples are NOPs. Each symbol has to be explicitly "re-exported". We've missed #931 should fix it. |
Fantastic, thanks! I think * imports don't need to be explicitly reexported inside .pyi files, but they do in .py files. |
I mean then your bug wouldn't have happened? :) And yes, the fixed examples triggered the error too. I'm somewhat OK with being explicit, but in this case it's very annoying. :-/ |
I'm seeing the same issue with mypy 0.961 and attrs 21.4.0: import attrs
@attrs.define(kw_only=True)
class Item:
length: int | None = attrs.field(
converter=attrs.converters.optional(
attrs.converters.pipe(float, int),
),
default=None,
) Running in mypy, getting these (possibly related?) errors:
|
Yes, sorry there hasn't been a release since this has been fixed yet. |
In MyPy, using
attrs.converters
gives:Adding an
import attrs.converters
(not needed at runtime) gives:I think part of the problem is the
__init__.pyi
isn't synced with__init__.py
for importing submodules. Not sure why the star import isn't working inside converters.py, though.The text was updated successfully, but these errors were encountered: