Turn localized_function decorator into class #170
Draft
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.
When finished, this should speed up function calls by a considerable margin (in computing terms.) Right now, the function checks the validity of its
run_own_code_on
parameter every time you call a localized function. This was a tradeoff, but it's particularly egregious considering that the parameter is almost always[None]
.By turning the decorator into a class, we can run that check once, when the class is instantiated. It may, however, substantially increase the memory footprint - I haven't checked - which would partially obviate the memory gains from the 0.3 refactor (however, it's still whittled down to just the languages the user is... using...)