1566 Commits

Author SHA1 Message Date
blueloveTH
dcb5f38ddf make float always 64-bit 2024-04-06 17:54:53 +08:00
blueloveTH
2219809fb4 support bytes slice 2024-04-06 17:18:35 +08:00
blueloveTH
10ca25f6b0 add enum module 2024-04-06 17:00:50 +08:00
albertexye
936870c1f0
Perform boundary checks before searching to prevent security vulnerabilities (#237)
* perform boundary check before searching to prevent security vulnerabilities

* when a negative start index is passed to str.find, 0 is used instead

* a ValueError is raised when argument 'start' is a negative integer
2024-04-02 13:38:45 +08:00
albertexye
b1115a4c8f
Check the size of fillchar passed to str methods (ljust, rjust) (#236)
* check the size of fillchar passed to str methods (ljust, rjust)

* count characters using u8_length instead of size
2024-04-02 02:41:45 +08:00
blueloveTH
e86baa2e2f add optimized opcodes for FOR_ITERs 2024-03-29 01:29:32 +08:00
blueloveTH
41e9900b37 Update io.cpp 2024-03-29 00:40:54 +08:00
ykiko
8ca7e9f6cf
add bit_length method to int. (#233)
* add bit_length method to int.

* Update pocketpy.cpp

* Update 01_int.py

* Update 01_int.py

---------

Co-authored-by: BLUELOVETH <blueloveTH@foxmail.com>
2024-03-28 19:51:39 +08:00
blueloveTH
c77fef35a2 refactor defaultdict 2024-03-28 19:21:56 +08:00
blueloveTH
d7545071e5 optimize int() and float() 2024-03-28 17:50:23 +08:00
blueloveTH
79cafcf32c improve io 2024-03-28 15:48:59 +08:00
blueloveTH
eaf231fd9d refactor io 2024-03-28 15:20:23 +08:00
blueloveTH
d81a1c5415 add bytes.__add__ 2024-03-28 15:04:10 +08:00
albertexye
142e4fd45f
Sort names returned by the built-in dir method (#231)
* Sort names returned by the built-in dir method

* some fix

---------

Co-authored-by: blueloveTH <blueloveth@foxmail.com>
2024-03-27 16:07:35 +08:00
blueloveTH
636944632d fix a bug 2024-03-24 23:20:23 +08:00
blueloveTH
50cde5ff03 some fix 2024-03-24 20:07:28 +08:00
blueloveTH
dc20c56391 some fix 2024-03-24 18:01:03 +08:00
blueloveTH
b6b914e312 Update memory.cpp 2024-03-22 12:33:15 +08:00
blueloveTH
fbd825951c Update memory.cpp 2024-03-22 12:31:10 +08:00
blueloveTH
fc98c526ea add memory info api 2024-03-22 11:45:43 +08:00
blueloveTH
f9f3827d5d remove a tmp var 2024-03-18 12:55:42 +08:00
blueloveTH
6b57c684e4 some optimize 2024-03-17 19:22:17 +08:00
blueloveTH
f48db51d7c some optimize 2024-03-17 19:10:45 +08:00
blueloveTH
0d0261c069 some fix 2024-03-17 19:02:04 +08:00
blueloveTH
150af1b714 some fix 2024-03-17 18:59:58 +08:00
blueloveTH
f9cc2f2f29 some optimize 2024-03-17 18:50:44 +08:00
blueloveTH
fd082c20e6 add some cases 2024-03-17 18:36:08 +08:00
blueloveTH
f62ec6d316 add noexcept 2024-03-17 18:08:54 +08:00
blueloveTH
3aea1647d0 some fix 2024-03-17 18:06:38 +08:00
blueloveTH
92f9b93245 some fix 2024-03-17 17:58:16 +08:00
blueloveTH
3ebc19bf7f fix warnings 2024-03-17 17:53:55 +08:00
blueloveTH
2b43cbd25c some optimize 2024-03-17 17:48:57 +08:00
blueloveTH
beaf05f6c1 some fix 2024-03-17 16:45:20 +08:00
blueloveTH
4db4274882 some optimize 2024-03-17 16:34:57 +08:00
blueloveTH
44c61a8c3a add PREDICT_INT_DIV_OP 2024-03-17 16:33:08 +08:00
blueloveTH
11544b3f7a Update ceval.cpp 2024-03-16 19:30:53 +08:00
blueloveTH
017655c057 add PREDICT_INT_OP 2024-03-16 19:20:29 +08:00
BLUELOVETH
65440c2034
Fix #197 (#227)
* init

* some optimize

* Update frame.h

* remove `LOAD_INTEGER`

* Update vm.cpp

* some optimize

* some fix

* Revert "remove `LOAD_INTEGER`"

This reverts commit c0b965aee2f64fbfae0b20f41d714688649d20cf.

* some fix

* Update expr.cpp

* some fix

* Update retype.yml
2024-03-16 18:37:09 +08:00
blueloveTH
9bfe8c1bad some fix 2024-03-16 15:55:53 +08:00
blueloveTH
63e869df0c Revert "some optimize"
This reverts commit 31dc34663a0a2ffe45552eec7ceaca58759d228d.
2024-03-16 15:54:56 +08:00
blueloveTH
31dc34663a some optimize 2024-03-16 15:42:04 +08:00
blueloveTH
1456fb5e20 remove _s in Frame 2024-03-16 15:32:17 +08:00
blueloveTH
638ce2699a Revert "some fix about emplace"
This reverts commit 3d5b50a527b5992b53708676aee4738effba7707.
2024-03-16 15:20:41 +08:00
blueloveTH
3d5b50a527 some fix about emplace 2024-03-16 15:16:11 +08:00
blueloveTH
fffcd7425d some optimize 2024-03-16 14:54:55 +08:00
blueloveTH
37453a8502 some fix 2024-03-16 14:40:01 +08:00
Anurag Bhat
2ab819a724
Modify string constructor to allow no arguments (#226)
* Modify String Constructor

* Add check to restrict arguments
2024-03-13 00:55:54 +08:00
blueloveTH
1caa9e71c3 fix https://github.com/pocketpy/pocketpy/issues/213 2024-03-04 17:27:13 +08:00
blueloveTH
6cf2f950cd some fix 2024-03-04 17:11:56 +08:00
blueloveTH
7f7e1a14ee raise error on literal ints overflow 2024-03-04 16:48:47 +08:00