Closed ryankennedy closed 7 years ago
Added a test and then added a fix for the issue you found.
I'm curious about the performance impact of this change as resolve_placeholder is usually a hot function. Are there any benchmarks?
I ran the benchmark scripts a few times and didn't notice any glaring differences.
I see. Does it include methods specifically? Maybe it's not be worth caching self.methods at all - if a getattr() is faster than an isinstance()+weakref().
Uses weakref.proxy() when adding methods to the cache in order to avoid reference cycles.