635 Commits

Author SHA1 Message Date
blueloveTH
0da7f8d294 rename invert to inverse 2024-04-26 16:54:23 +08:00
blueloveTH
6189aaca94 use cpython style next() 2024-04-24 22:06:02 +08:00
blueloveTH
508cbfdb75 some refactor 2024-04-24 17:54:55 +08:00
blueloveTH
d634ec9829 fix names 2024-04-21 21:04:42 +08:00
blueloveTH
e940ac3068 some fix 2024-04-17 20:29:11 +08:00
blueloveTH
0ec01abdeb refactor __doc__ and rm __signature__ 2024-04-16 23:06:43 +08:00
blueloveTH
9de8fee0a0 Update 95_pdb.py 2024-04-15 19:38:19 +08:00
blueloveTH
49045f2c48 add l and ll 2024-04-15 19:38:11 +08:00
blueloveTH
d38fd25459 Update 95_pdb.py 2024-04-14 20:33:22 +08:00
blueloveTH
b6d62c9d89 add breakpoint 2024-04-14 20:14:51 +08:00
blueloveTH
aaa0d55361 add breakpoint 2024-04-14 18:31:14 +08:00
blueloveTH
8ca0e0168c add reduce and partial 2024-04-14 16:18:04 +08:00
blueloveTH
348b071c1e fix test logic 2024-04-14 13:35:49 +08:00
blueloveTH
5d4294b457 add pkpy_set_main_argv 2024-04-14 13:29:20 +08:00
blueloveTH
14a9120d9b fix test logic 2024-04-14 13:11:12 +08:00
blueloveTH
2b74fc847e Update precompile.md 2024-04-14 02:09:12 +08:00
blueloveTH
57574bd8be some fix 2024-04-14 01:49:50 +08:00
blueloveTH
c07bf67714 some fix 2024-04-14 01:17:17 +08:00
BLUELOVETH
4d2af4b83d
allow next to be compatible with cpython (#241)
* add `itertools`

* Update _generated.h

* allow `next` to be compatible with cpython
2024-04-14 00:08:41 +08:00
BLUELOVETH
6bf645d738
add itertools (#239) 2024-04-13 23:44:07 +08:00
blueloveTH
790e87f688 add vec.__getitem__ 2024-04-13 14:25:18 +08:00
blueloveTH
49ee693d40 optimize for empty function 2024-04-11 01:31:45 +08:00
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
ykiko
cb15db1f0e
adoping a more efficient division algorithm for bigint. (#232)
* adoping a more efficient division algorithm for bigint.

* add test case.

* modify the implementation to binary search.

* fix type error.

* fix some error.

* remove extra zero.

* add some test cases.

* add some cases

* Update 09_long.py

* Update 09_long.py

---------

Co-authored-by: BLUELOVETH <blueloveTH@foxmail.com>
2024-03-29 03:00:39 +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
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
fd082c20e6 add some cases 2024-03-17 18:36:08 +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
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
d4cf8b8c03 Update 01_int.py 2024-03-04 17:07:32 +08:00
blueloveTH
f95bdd45ac fix https://github.com/pocketpy/pocketpy/issues/223 2024-03-04 17:03:58 +08:00
blueloveTH
7f7e1a14ee raise error on literal ints overflow 2024-03-04 16:48:47 +08:00
Anurag Bhat
883f4d9532
Add Division operation for complex number in Cmath (#220)
* Add __truediv__() for cmath

* Some changes

* Remove separate zero division case checks

* Test all binary operators

* Use is_close
2024-03-02 14:34:05 +08:00
Anurag Bhat
5100f4e454
Floating inputs for round() should return a Floating output when ndigit is 0 (#217)
* Fix round for floating inputs

* Refactor integer inputs

* some fix

---------

Co-authored-by: blueloveTH <blueloveth@foxmail.com>
2024-02-27 11:18:21 +08:00
blueloveTH
214395fab6 fix https://github.com/pocketpy/pocketpy/issues/214 2024-02-26 10:40:37 +08:00
blueloveTH
4af7d5c873 fix https://github.com/pocketpy/pocketpy/issues/212 2024-02-23 15:48:24 +08:00
blueloveTH
0599130c0d fix https://github.com/pocketpy/pocketpy/issues/211 2024-02-23 01:27:48 +08:00
blueloveTH
3534492bb6 improve array2d.__setitem__ 2024-02-20 01:56:10 +08:00
blueloveTH
15a11d0c02 Update 80_linalg.py 2024-02-18 23:49:41 +08:00
blueloveTH
7d38f83008 fix a bug 2024-02-18 00:57:56 +08:00