We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
23.2.0 is OK.
Python 3.10.13 (main, Dec 6 2023, 12:01:00) [GCC 13.2.1 20230801] on linux >>> import attr >>> attr.__version__ '23.2.0' >>> @attr.define ... class A: ... abc: int | None = attr.field(converter=attr.converters.optional(attr.converters.pipe(str, int)), default=None) ... >>> A() A(abc=None) >>> A('1') A(abc=1)
after 24.1.0, error occurs:
Python 3.10.13 (main, Dec 6 2023, 12:01:00) [GCC 13.2.1 20230801] on linux >>> import attr >>> attr.__version__ '24.2.0' >>> @attr.define ... class A: ... abc: int | None = attr.field(converter=attr.converters.optional(attr.converters.pipe(str, int)), default=None) ... >>> A() A(abc=None) >>> A('1') Traceback (most recent call last): File "/opt/pycharm-professional/plugins/python-ce/helpers/pydev/pydevconsole.py", line 364, in runcode coro = func() File "<input>", line 1, in <module> File "<attrs generated init __main__.A>", line 3, in __init__ File "/home/mio/Work/venv/calliper310N/lib/python3.10/site-packages/attr/converters.py", line 40, in optional_converter return converter(val) TypeError: Converter.__init__.<locals>.<lambda>() missing 2 required positional arguments: 'instance' and 'field'
The text was updated successfully, but these errors were encountered:
No branches or pull requests
23.2.0 is OK.
after 24.1.0, error occurs:
The text was updated successfully, but these errors were encountered: