Draft
Conversation
This is the first step towards a more ergonomic (and esp. extensible) converter hierarchy, sketching how the initialization around the contextmanager-local, non-threadsafe ConverterContext and its Converter(Factory) mapping works. The specific Converters still need to be patched to use the new context to store data.
This was referenced Jul 11, 2022
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR tracks the new Converter System, which is currently the biggest blocker for v0.8 (see #245).
The first commit takes the first big step towards a more ergonomic (and esp. extensible) converter hierarchy, sketching how the initialization around the contextmanager-local, non-threadsafe ConverterContext and its Converter(Factory) mapping works. A few things that are now nicer than before
ImmutableComponentMetaand__attrs_post_init__for immutable classesThe specific Converters still need to be patched to use the new context to store data. So there's still further clean-up to do before this even compiles, and then this needs to be tested, and I also want to include some basic documentation on what I did and how extensions could work. Maybe I even have time to polish some further things like removing the intermediate attrs classes now that we can customize
__init__and theRuntimeAttrValidationthat is now built-in to attrs. I'll update this PR once I got to all (or at least some) of that.This leaves error-handling / variable strictness and recurring events on the ToDo list, but I guess we can just as well defer these features for 0.9 as long as we get these pretty deep-rooted changes here through before anybody strongly relies on how the converters work.
PS: sorry for opening this so shortly before the "blackening", I really wanted to get these changes finally visible. Still, I guess this shouldn't block the mass-reformat, as I can probably "rebase" my changes applying black to every/the single commit here.