Repository navigation
Fixed #30498 -- Fixed proxy class caching in lazy(). - #11399
Conversation
|
@bluetech Thanks for this patch 🚀 Can we add a test? |
|
@felixxm Thanks for taking a look. I didn't add a test because this is a performance bug, not a logic bug (the behavior before is the same, just slower). I can't come up with a test which would not involve peeking into the internal implementation bowls of |
|
I think it might be worth adding a regression test even if it asserts against internals else this is likely to regress. def identity(x): return x
lazy_identity = lazy(identity, int)
self.assertTrue(lazy_identity(1).__class__._proxy____prepared)It might be worth adding a comment explain the reasoning behind this assertion. |
|
OK then, I added a test. It fails before and passes after. |
|
@bluetech Thanks for this patch 🚀 |
lazy() should prepare the proxy class only once (the first time it's used) not on every call. Regression in b4e76f3.
|
@felixxm this patch was merged into django:master on May 22 but has not been released in any of the bug fix releases for 1.11, 2.1, or 2.2 since May. What needs to happen for this fix to be released in a near-term bug fix release? Should PRs be opened applying the same fix to those stable branches? |
|
This patch doesn't qualify for a backport. |
…ctly Pin b711eafd2aabdf22e1d529bfb76dd8d3356d7000 and its regression selectors for reproducible runs. Source: django/django#11399
Ticket: https://code.djangoproject.com/ticket/30498
I split this from PR #11314.