🔧 Group logic concerning the cache in one single method #96
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.
Function.resolve_method
is called. This was done in various places in the code, making it hard to understand and easy to get wrong. Now one single method is in charge of reading and updating the cache:_resolve_method_with_cache
.self._resolve_pending_registrations()
every time before resolving the method.resolved_method
has been made shorter by extracting the logic concerning the__mro__
in another method. This allows the methodresolved_method
to have less local variables overall and less variables that are only used in specific situations.Later on, it will be possible to move the cache into the resolver, but we need to start somewhere, the aim of this PR is just to make the code clearer, not to have the perfect structure
Related to #92 the goal overall is to have a good structure to add support for keyword arguments, as mentionned in #40