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
blueloveTH
1558e5b40f
fix a bug
2024-02-18 00:44:57 +08:00
blueloveTH
c3b050c77a
fix a bug of line_profiler
2024-02-17 22:32:30 +08:00
blueloveTH
0df619b66f
str.index
and str.find
supports __start
2024-02-17 20:45:08 +08:00
blueloveTH
96d9e12cd6
list.index
supports __start
2024-02-17 20:36:20 +08:00
blueloveTH
020af4aa38
Update 83_array2d.py
2024-02-17 13:42:36 +08:00
blueloveTH
504d9cf79b
add some algorithm into array2d
2024-02-16 19:52:52 +08:00
blueloveTH
e5097f734f
Update 70_random.py
2024-02-15 00:21:51 +08:00
blueloveTH
7095db428c
add random.choices
2024-02-15 00:13:34 +08:00
blueloveTH
b9d29dd4da
add copy_*_
2024-02-13 13:42:44 +08:00
blueloveTH
a0a5753283
allows vec
* vec
2024-02-13 13:13:22 +08:00
blueloveTH
0bbf6af3ff
update array2d.copy_
2024-02-07 14:57:09 +08:00
blueloveTH
f2ce3c97d7
add line_profiler
impl
2024-02-07 13:56:29 +08:00
blueloveTH
209b7f6831
add boilerplate for line_profiler
2024-02-07 10:50:53 +08:00
blueloveTH
a1797869db
some update
2024-02-07 00:18:09 +08:00
blueloveTH
dcb784a7a8
add array2d
module
2024-02-06 23:25:40 +08:00
blueloveTH
2c8a8732f0
fix docs with pocketpy
2024-02-05 16:15:00 +08:00
blueloveTH
cc076bbc00
fix cases
2024-02-05 15:57:36 +08:00