Commit Graph

10109 Commits

Author SHA1 Message Date
Kangzhi Shi
fdd82fac78 fixup 2021-11-27 14:09:43 +02:00
Kangzhi Shi
9a2eef6fab fix compile 2021-11-27 13:49:05 +02:00
Kangzhi Shi
ca4e8f50e8 refactor ItemProtocol -> Object Protocol 2021-11-27 13:00:37 +02:00
Kangzhi Shi
0f3569a1b1 refactor mapping protocol 2021-11-23 20:22:01 +02:00
Noa
7cc5e0b5cc Merge pull request #3434 from chrismoradi/unimplemented-abstract-methods-raise-error
Check that all abstract methods are implemented prior to instantiation
2021-11-22 18:17:02 -06:00
Chris Moradi
a685b236f9 Merge branch 'main' of github.com:chrismoradi/RustPython into unimplemented-abstract-methods-raise-error 2021-11-22 14:58:17 -08:00
Steve Shi
908b239572 Refactor and new sequence traits, generic sequence operation (#3445)
* refactor sequence generic mutable sequence item equal op

* sequence generic for pydeque

* replace usize::MAX with Optioned

* sequence op for array

* fix overflow error instead memory error for  index overflow

* fixup

* optimize reserve vec for imul
2021-11-22 09:21:23 +02:00
Noa
a53451bd10 Merge pull request #3386 from coolreader18/no-arc
Big overhaul part 1 - replace PyRc with manual RefCount + WeakRefList
2021-11-21 17:43:50 -06:00
Jeong YunWon
b8624c617b Merge pull request #3454 from YYun-D/doc_modify
Fix `bytearray` and `bytes` docs
2021-11-21 13:58:34 +09:00
YYun-D
7de142fcd1 remove bytearray and byte docs
Signed-off-by: YYun-D <yeo1998@naver.com>
2021-11-21 12:37:01 +09:00
Jeong YunWon
7305be893a Merge pull request #3451 from waroad/enumerate_add_reduce
add reduce in enumerate
2021-11-21 09:42:34 +09:00
Jeong YunWon
d42ab184a1 Merge pull request #3450 from YYun-D/slice_reduce
implement `reduce` method to `PySlice`
2021-11-21 04:58:56 +09:00
Jeong YunWon
a96b8fc7fe Merge pull request #3452 from moreal/bugfix/correct-whats-left
Remove staled comments
2021-11-21 04:58:28 +09:00
Moreal
a41d7c5d29 Remove staled comments 2021-11-21 01:19:10 +09:00
waroad
51e1d7607c add reduce in enumerate 2021-11-20 20:56:26 +09:00
yyun-d
e49d7118b8 fix test_pickle in test_slice
Signed-off-by: yyun-d <yeo1998@naver.com>
2021-11-20 18:59:59 +09:00
yyun-d
fd3a0f6d86 implement reduce method to PySlice
Signed-off-by: yyun-d <yeo1998@naver.com>
2021-11-20 18:59:18 +09:00
Jeong YunWon
69491800e1 Merge pull request #3448 from YYun-D/test_math_modify
Update test_math.py to cpython 3.10
2021-11-20 17:33:42 +09:00
yyun-d
3070b19b36 Update test_math.py to cpython 3.10 2021-11-20 16:27:20 +09:00
BongYang
7b79c09c3c pystr.rs isdecimal() checks not only ASCII but also Unicode decimals 2021-11-20 16:08:27 +09:00
rvsampson94
0fe8a06d65 Dict keys isdisjoint 2021-11-20 12:30:22 +09:00
Noa
790090df62 Apply review comments 2021-11-18 12:33:44 -06:00
Jeong YunWon
c7e1742d47 Merge pull request #3444 from youknowone/revert-3433
Revert "Merge pull request #3433 from deantvv/test-update"
2021-11-17 19:46:22 +09:00
Jeong YunWon
913b78ca44 Revert "Merge pull request #3433 from deantvv/test-update"
This reverts commit 9fa5c5ac66, reversing
changes made to e7fa32c687.
2021-11-17 17:06:51 +09:00
Noa
af7ec416f9 Prevent edge case race condition, hopefully 2021-11-15 16:08:47 -06:00
Noa
229a9c8578 Make PyRef<T> wrap a NonNull<PyObjectView<T>>
This makes debuggers (or rust-gdb, at least) more pleasant to use, since
you don't have to manually cast `PyRef<T>.obj.ptr as `*const PyObjectView<T>`
Also get rid of PyGenericObject, since it's vestigial
2021-11-15 16:08:47 -06:00
Noa
8c7def00ec Address review 2021-11-15 16:08:47 -06:00
Noa
1da239ac08 Fix clippy 2021-11-15 16:08:47 -06:00
Noa
2a87b893fb Reuse standard no-cb weakref 2021-11-15 16:08:47 -06:00
Noa
f9d9a1e15e Implement weakref._remove_dead_weakref 2021-11-15 16:08:47 -06:00
Noa
ec0a658d20 Implement weakref.getweakrefs 2021-11-15 16:08:47 -06:00
Noa
c6871166d1 Make WeakListInner a sidetable 2021-11-15 16:08:47 -06:00
Noa
0b7c0fab61 Add miri test for dropping objects 2021-11-15 16:08:47 -06:00
Noa
86edc72c7e Fix miri UB 2021-11-15 16:08:46 -06:00
Noa
65cde9a0d6 Optimize size of WeakRefList
The outer struct is only 1 word now, and inside the box it's a byte for
the mutex (which gets padded to a word) + a word for the linked list (we
don't use the tail) + a word for the pointer to the object.
2021-11-15 16:08:46 -06:00
Noa
e51cb82ff0 Unskip tests 2021-11-15 16:08:46 -06:00
Noa
baf581c11b Update weakref.py and _weakrefset.py to Python 3.9 2021-11-15 16:08:46 -06:00
Noa
e42a3ca48e Big overhaul part 1 - replace PyRc with manual RefCount + WeakRefList 2021-11-15 16:08:45 -06:00
Chris Moradi
b0fd51f5de address PR feedback 2021-11-15 10:09:45 -08:00
Jeong YunWon
9fa5c5ac66 Merge pull request #3433 from deantvv/test-update
Update test for `support/os_helper.py`
2021-11-16 02:47:22 +09:00
Jeong YunWon
e7fa32c687 Merge pull request #3402 from Snowapril/refactor_exceptions
Refactor duplicated codes in exception creations
2021-11-16 02:45:30 +09:00
Jeong YunWon
15d8eec001 Merge pull request #3439 from youknowone/relocate-sys-test
relocate wrongly placed sys test in snippets/stdlib_os.py
2021-11-16 02:43:28 +09:00
Jeong Yunwon
93a7d59bbb relocate wrongly placed sys test in snippets/stdlib_os.py 2021-11-16 01:23:53 +09:00
Chris Moradi
868b680305 more tests passing 2021-11-13 19:26:10 -08:00
Chris Moradi
0500aa1e59 fix formatting 2021-11-13 17:35:28 -08:00
Chris Moradi
ab58885734 Check that all abstract methods are implemented prior to instantiation 2021-11-13 17:09:26 -08:00
Dean Li
a1202f5602 test: update importlib 2021-11-13 14:21:59 +08:00
Steve Shi
742ea0c4fa Reimpl Buffer Protocol and memoryview support ndarray with shape, stride and suboffset (#3340)
* Fix buffer protocol and memoryview

* Fix io and array the right way to use buffer protocol

* fix rebase

* fix memoryview and introduce VecBuffer

* fix deadlock

* fix memoryview avoid double release buffer

* impl ndim buffer support

* first implement nd array for buffer and memoryview

* fix slice adjust_indices

* fix adjust_indices introduct SaturatedSliceIterator

* fix memoryview cmp

* fix adjust_indices positive_order

* fix bug mark passed test

* fix clippy

* fix set_item_slice deadlock, optimize buffer

* Delete @test_113974_tmp

* Remove vec_buffer_type

* rusty names

* impl memoryview multi index

* add comments

Co-authored-by: Jeong YunWon <jeong@youknowone.org>
2021-11-13 07:17:11 +02:00
Dean Li
c15971f18a test: update test_unicode_file 2021-11-13 04:24:06 +00:00
Dean Li
323cf44788 test: update test_urllib 2021-11-13 03:51:06 +00:00