mirror of
https://github.com/RustPython/RustPython.git
synced 2026-10-28 10:44:36 +08:00
Mark LRU cache wrappers as method descriptors (#9072)
Match the Python 3.14 wrapper type flag and enable the existing guarded method-call fast path. Keep the partial vectorcall changes separate. Assisted-by: OpenAI Codex:model identifier unavailable
This commit is contained in:
1 parent
44858012f4
commit
eb6cefd765
2 files changed
+5
-1
No files matched your search
@@ -842,7 +842,7 @@ mod _functools {
|
||||
|
||||
#[pyclass(
|
||||
with(Constructor, Callable, GetDescriptor),
|
||||
flags(HAS_DICT, HAS_WEAKREF)
|
||||
flags(HAS_DICT, HAS_WEAKREF, METHOD_DESCRIPTOR)
|
||||
)]
|
||||
impl Py<PyLruCacheWrapper> {
|
||||
#[pymethod]
|
||||
|
||||
@@ -1,9 +1,13 @@
|
||||
import gc
|
||||
import weakref
|
||||
from _functools import _lru_cache_wrapper
|
||||
from functools import cache, cmp_to_key, lru_cache, partial, reduce
|
||||
|
||||
from testutils import assert_raises
|
||||
|
||||
# Cached wrappers support method-descriptor lookup and binding.
|
||||
assert _lru_cache_wrapper.__flags__ & (1 << 17)
|
||||
|
||||
|
||||
class Squares:
|
||||
def __init__(self, max):
|
||||
|
||||
Reference in new issue
Block a user