mirror of
https://github.com/pocketpy/pocketpy
synced 2025-10-20 11:30:18 +00:00
This commit is contained in:
parent
a33360e664
commit
fb06b563a4
@ -395,7 +395,7 @@ private:
|
||||
}
|
||||
func.code = make_sp<CodeObject>(parser->src, func.name.str());
|
||||
this->codes.push(func.code);
|
||||
co()->_rvalue += 1; EXPR_TUPLE(); co()->_rvalue -= 1;
|
||||
co()->_rvalue += 1; EXPR(); co()->_rvalue -= 1;
|
||||
emit(OP_RETURN_VALUE);
|
||||
func.code->optimize(vm);
|
||||
this->codes.pop();
|
||||
|
2
src/vm.h
2
src/vm.h
@ -450,7 +450,7 @@ template<> bool _py_cast<bool>(VM* vm, const PyVar& obj){
|
||||
return obj == vm->True;
|
||||
}
|
||||
|
||||
PyVar py_var(VM* vm, const char* val){
|
||||
PyVar py_var(VM* vm, const char val[]){
|
||||
return VAR(Str(val));
|
||||
}
|
||||
|
||||
|
4
tests/_bugs.py
Normal file
4
tests/_bugs.py
Normal file
@ -0,0 +1,4 @@
|
||||
# https://github.com/blueloveTH/pocketpy/issues/37
|
||||
|
||||
mp = map(lambda x: x**2, [1, 2, 3, 4, 5] )
|
||||
assert list(mp) == [1, 4, 9, 16, 25]
|
Loading…
x
Reference in New Issue
Block a user