-
-
Notifications
You must be signed in to change notification settings - Fork 382
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
Make attrs.converters.pipe only return a Converter instance if one is passed #1380
Conversation
@hynek @Tinche please take a look, let me know if you have any questions or would like to see any changes in this PR. Also, I'd appreciate it if this and my previous couple of PRs could make it into an official release soon, is there a chance you'd consider cutting a 24.3.0 after this PR gets merged? Thanks! |
Would you mind sharing the reasoning? It was kinda on purpose to normalize how the converters look like but I'm not married to it.
I will do my best to release a 24.3 before NYE. We need to fix #1347 first, hopefully merge #1358, and ideally implement #1313 (but that's more of a hope than a requirement). |
Sure. In trying to upgrade to 24.2.0, I found some situations where code was calling one of the converter functions and trying to use that directly as a callable (I believe it was with The other issue I've encountered is that
Thank you! |
Updated to add type signatures with overloads, that specify passing callables will return a callable for both |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks!
If you come up with a pithy changelog entry, ideally spinning it as a feature for our users, feel free to drop it here or open a quick PR.
Summary
Make
pipe()
return a regular callable if only passed callables, only return aConverter
instance if one is strictly required (by having aConverter
instance within the pipeline.)Some tests are affected by this change (mostly in how
__annotations__
is accessed), this PR reverts most of them to their state before #1267.Pull Request Check List
main
branch – use a separate branch!Our CI fails if coverage is not 100%.
.pyi
)..rst
and.md
files is written using semantic newlines.changelog.d
.