This commit is contained in:
blueloveTH 2024-05-13 21:28:31 +08:00
parent d33755538a
commit 265ab42eb0
2 changed files with 14 additions and 12 deletions

View File

@ -1132,7 +1132,7 @@ PyVar VM::vectorcall(int ARGC, int KWARGC, bool op_call){
p1[-(ARGC + 2)] = call_f;
p1[-(ARGC + 1)] = self;
// [call_f, self, args..., kwargs...]
return vectorcall(ARGC, KWARGC, false);
return vectorcall(ARGC, KWARGC, op_call);
}
TypeError(_type_name(vm, callable_t).escape() + " object is not callable");
PK_UNREACHABLE()

View File

@ -1,15 +1,5 @@
from functools import cache
@cache
@cache
@cache
def fib(n):
if n < 2:
return n
return fib(n-1) + fib(n-2)
assert fib(32) == 2178309
class A:
def __init__(self, x):
self._x = x
@ -36,4 +26,16 @@ B.x = property(
b = B()
assert b.x == 1
b.x = 2
assert b.x == 2
assert b.x == 2
@cache
@cache
@cache
def fib(n):
# print(f'fib({n})')
if n < 2:
return n
return fib(n-1) + fib(n-2)
assert fib(32) == 2178309