mirror of
https://github.com/pocketpy/pocketpy
synced 2025-10-23 04:50:17 +00:00
some fix
This commit is contained in:
parent
d33755538a
commit
265ab42eb0
@ -1132,7 +1132,7 @@ PyVar VM::vectorcall(int ARGC, int KWARGC, bool op_call){
|
|||||||
p1[-(ARGC + 2)] = call_f;
|
p1[-(ARGC + 2)] = call_f;
|
||||||
p1[-(ARGC + 1)] = self;
|
p1[-(ARGC + 1)] = self;
|
||||||
// [call_f, self, args..., kwargs...]
|
// [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");
|
TypeError(_type_name(vm, callable_t).escape() + " object is not callable");
|
||||||
PK_UNREACHABLE()
|
PK_UNREACHABLE()
|
||||||
|
@ -1,15 +1,5 @@
|
|||||||
from functools import cache
|
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:
|
class A:
|
||||||
def __init__(self, x):
|
def __init__(self, x):
|
||||||
self._x = x
|
self._x = x
|
||||||
@ -36,4 +26,16 @@ B.x = property(
|
|||||||
b = B()
|
b = B()
|
||||||
assert b.x == 1
|
assert b.x == 1
|
||||||
b.x = 2
|
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
|
Loading…
x
Reference in New Issue
Block a user