Releases: pocketpy/pocketpy
Releases · pocketpy/pocketpy
v1.4.5
Improvements
- add
bytes
addition and slice support - improve
FileIO
and add more methods such asseek()
andtell()
. See https://pocketpy.dev/modules/io/ - add
__missing__
fordict
and refactordefaultdict
- add
bit_length
method to int #233 - improve performance of for loop
- adoping a more efficient division algorithm for bigint #232
- make
float
always 64-bit; optimize for empty function - add
vec.__getitem__
; addpkpy_set_main_argv
to setsys.argv
- add
reduce
andpartial
forfunctools
module - refactor
random
module to use builtin mt19937 implementation
New Features
- add
enum
module. See https://pocketpy.dev/modules/enum/ - support precompiling. See https://pocketpy.dev/features/precompile/
- add
itertools
module. See https://pocketpy.dev/modules/itertools/ - support PDB debugging. See https://pocketpy.dev/features/debugging/
Bug fixes
- check the size of fillchar passed to str methods (ljust, rjust) #236
- perform boundary check before searching to prevent security vulnerabilities #237
Full Changelog: v1.4.3...v1.4.5
v1.4.3
Fix some bugs and improve performance.
What's Changed
- Modify string constructor to allow no arguments by @faze-geek in #226
- Fix #197 by @blueloveTH in #227
- Sort names returned by the built-in dir method by @albertexye in #231
New Contributors
- @albertexye made their first contribution in #231
Full Changelog: v1.4.2...v1.4.3
v1.4.2
Changes
- add
random.choices
- remove python3 deps (now you can compile pkpy without python3 installed)
list.index
supports__start
;str.index
andstr.find
supports__start
- fix a bug of
line_profiler
- fix #217 #220 #223 #214 #212 #211
- raise an error if a literal int overflows
- support scientific notation #213
Break changes
pkpy now uses a RTTI-based py_cast<>
implementation. You may need to add -frtti
flags to compile it.
New Contributors
- @16bit-ykiko made their first contribution in #208
- @miyanyan made their first contribution in #207
- @faze-geek made their first contribution in #210
Full Changelog: v1.4.1...v1.4.2
v1.4.1
Changes
- move
strip
methods into cpp - fix a bug of
hex
related methods - add
PK_NO_EXPORT_C_API
macro - add
array2d
module - add
line_profiler
module - make
vm->_ceval_on_step
always available - mark
stdout_write
andstderr_write
as virtual - add some new methods for
linalg
module - allows
tuple
as function default parameter
Break changes
str
was changed to be null-terminated;Str::c_str_dup
was removed
v1.4.0
Changes
- remove
#include <emscripten.h>
for compatibility reason - remove
os.system
- rename some
linalg
methods - reduce output binary size
- set
PK_ENABLE_OS
to 0 by default - fix #194
New Features
- full slice support
- recursive
repr
detection, i.e.[1, [...]]
- add typed error message, e.g.
TypeError: unsupported operand type(s) for +: 'NoneType' and 'int'
- add
m__setattr__
,m__getattr__
andm__delattr__
hooks in cpp
Internal Changes
obj_type_name
was rename to_type_name
- remove
OBJ_NAME
macro Tuple
's constructor was changed- remove
timeit
module
v1.3.9
Changes
- add inplace methods
set_trs
,__imatmul__
andinvert_
intolinalg.mat3x3
(were renamed in v1.4.0, don't use them) - add inplace method
.assign()
tovec2
,vec3
,vec4
andmat3x3
(were renamed in v1.4.0, don't use them) - remove
bind_builtin_func
and all string-based bind overloads - add bind type parameter to
vm->bind_func<>
- some cleanup to improve code quality
- add
.hex()
and.fromhex()
toc.struct
- make all
PY_STRUCT_LIKE
objects picklable - fix #187 the behavior of
with <expr> [as <@id>]
Full Changelog: v1.3.8...v1.3.9
v1.3.8
Changes
- add full support about
@staticmethod
and@classmethod
- add a parameter to
vm->bind
, i.e.BindType
to support bind@staticmethod
or@classmethod
- dot access class variables can retrive from base classes now
getattr
now supports a default return value if not found- add
vec2.smooth_damp
- some adjustment about gc
Break changes
linalg.mat3x3.__init__
now takes a list of 9 floats, instead of 3 list of 3 floats
Full Changelog: v1.3.7...v1.3.8
v1.3.7
Changes
- warn return with arg inside generator function
- add
typing.Protocol
- improve performance of builtin
json.loads
(not cJSON) - add support for
try..finally
Break changes
re
module was removed to reduce binary size.
android/arm64-v8a/libpocketpy.so:
1867 KB -> 1732 KB (-7%)
android/armeabi-v7a/libpocketpy.so:
1487 KB -> 1381 KB (-7%)
android/x86_64/libpocketpy.so:
1878 KB -> 1742 KB (-7%)
ios/libpocketpy.a:
2932 KB -> 2674 KB (-9%)
linux/x86_64/libpocketpy.so:
1941 KB -> 1697 KB (-13%)
macos/pocketpy.bundle/Contents/MacOS/pocketpy:
2543 KB -> 2319 KB (-9%)
windows/x86_64/pocketpy.dll:
1052 KB -> 1003 KB (-5%)
v1.3.6
- add complex number support and
cmath
module. For example,1+2j
- support real exception objects. Now you can define a class derived from
Exception
Break changes
UNREACHABLE()
has been renamed toPK_UNREACHABLE()
FATAL_ERROR()
has been renamed toPK_FATAL_ERROR()
You can do a global replacement (in user_config.h
and your project sources) if there is any error about them.
v1.3.5
New features
- improve f-string performance
- add support for
\b
- add
issubclass()
builtin - support class decorator
- add a new module
dataclasses
Bug fixes
- fix a bug when users are trying to create
module
instance - fix a bug about
**kwargs
in function call - fix a parser bug of f-string such as
f"{stack[2:]}"
class
can be used in normal blocks now
dataclasses
module
from dataclasses import dataclass, asdict
@dataclass
class A:
x: int
y: str = '123'
a = A(x=2)
b = A(3, y='AAA')
print(a) # A(x=2, y='123')
print(asdict(b)) # {'x': 3, 'y': 'AAA'}
Break changes
vm->new_type_object
will not save the created type to the module anymore
Full Changelog: v1.3.2...v1.3.5