Moreal
caf045a62c
Merge remote-tracking branch 'upstream/main' into bugfix/genericalias-getitem-method
2022-01-22 10:26:43 +09:00
Padraic Fanning
510a52b59d
Fix case where length = 0
2022-01-16 20:24:56 -05:00
Padraic Fanning
f01463fc12
Add proper error message for negative length
2022-01-16 20:24:18 -05:00
Noa
1188369956
Fix clippy warnings with 1.58 & convert some format strings to capture-args
2022-01-13 23:53:25 -06:00
Noa
730fda0f9e
Fix doc comment for Interpreter
2022-01-13 23:26:01 -06:00
Moreal
964304e8bd
Expose types.GenericAlias.__getitem__
2021-12-12 13:10:33 +09:00
Jeong YunWon
38513cb468
Merge pull request #3462 from qingshi163/mapping-protocol2
...
Refactor Mapping Protocol and Item Protocol
2021-12-03 21:18:25 +09:00
Kangzhi Shi
ae538943c0
fix ass_subscript check
2021-12-01 20:40:04 +02:00
Kangzhi Shi
6a996b04c8
move obj downcast to AsMapping
2021-12-01 20:16:18 +02:00
Jeong YunWon
3c5e13f7f1
Merge pull request #3461 from Byeongjee/dict-iterator-reduce
...
Implement reduce() for dict iterators
2021-11-30 14:34:32 +09:00
snowapril
fdd329ed0a
Register True, False, None to builtins
...
Signed-off-by: snowapril <sinjihng@gmail.com >
2021-11-29 23:35:01 +09:00
Jeong YunWon
32a9b958e5
Merge pull request #3465 from 24seconds/fix_test_base64
...
Support tuple type also for memoryview shape arg
2021-11-29 16:10:20 +09:00
Jeong YunWon
65d9e2fa86
skip to create list object
2021-11-29 15:05:19 +09:00
Jeong YunWon
4f2d70f915
Merge pull request #3475 from hrchu/pep604
...
Allow writing union types as X | Y
2021-11-29 03:10:01 +09:00
hrchu
b0dabd6087
Allow writing union types as X | Y
2021-11-28 19:42:33 +08:00
Kangzhi Shi
06fbba6589
clearup
2021-11-28 12:48:19 +02:00
Young
fe26754ad1
Refactor code using Either type
2021-11-28 18:37:36 +09:00
24seconds
290f91cd5e
Use Either type for OptionalArg in CastArgs
...
Co-authored-by: Jeong YunWon <69878+youknowone@users.noreply.github.com >
2021-11-28 18:25:44 +09:00
Kangzhi Shi
e06afd2cc0
fix windows fail, hope so
2021-11-28 11:22:14 +02:00
Kangzhi Shi
296afbc315
fix #3468 SaturatedSliceIter overflow
2021-11-28 11:15:49 +02:00
Byeongjee Kang
91489352c5
Implement reduce() for dict iterators
...
This fixes test_iter_dict, test_iterator_pickling, test_itemiterator_pickling,
and test_valuesiterator_pickling.
2021-11-27 23:57:39 +09:00
Young
dd773b3413
Support tuple type also for memoryview shape arg
2021-11-27 23:39:01 +09:00
Kangzhi Shi
e93f98c52e
fix windows compile
2021-11-27 15:02:41 +02:00
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
Narawit Rakket
cf7c8154bf
Fix maketrans not thrown ValueError when length of the arguments are not the same
2021-11-27 12:12:18 +07:00
Kangzhi Shi
0f3569a1b1
refactor mapping protocol
2021-11-23 20:22:01 +02: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
waroad
51e1d7607c
add reduce in enumerate
2021-11-20 20:56:26 +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
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
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