Commit Graph

6244 Commits

Author SHA1 Message Date
Jeong Yunwon
15b4205d1a use unsigned_abs() 2022-04-15 20:24:55 +09:00
Jeong YunWon
10a2b0c6c2 Merge pull request #3605 from youknowone/pycontext-new
PyContext::new don't create a new context
2022-04-14 04:45:00 +09:00
Jeong YunWon
6c908698a3 Merge pull request #3604 from youknowone/arg-sequence
rename non-protocol PySequence to ArgSequence to avoid confusion
2022-04-14 03:59:28 +09:00
Jeong Yunwon
df1aa5add7 PyContext::new don't create a new context 2022-04-14 03:58:45 +09:00
Jeong Yunwon
3629ce5cd7 rename non-protocol PySequence to ArgSequence to avoid confusion 2022-04-14 03:26:38 +09:00
Jeong YunWon
8484a91ed3 Fix reflection operator priority for subtypes 2022-04-14 02:38:54 +09:00
Jeong YunWon
e1ac70a217 Merge pull request #3601 from simbajisu/super_thisclass
add thisclass to the original typ
2022-04-10 15:12:09 +09:00
Jeong YunWon
cf6a83e9d5 Merge pull request #3600 from hwi-ya/llliiisssttt
modify empty tuple (genericalias repr)
2022-04-10 15:11:41 +09:00
Jeong YunWon
15b3548d48 Update vm/src/builtins/genericalias.rs 2022-04-10 14:23:17 +09:00
hwi-ya
a88171ccba resolve duplicated code 2022-04-10 14:15:41 +09:00
simbajisu
bd265c0bd7 apply suggested change
Co-authored-by: Jeong YunWon <69878+youknowone@users.noreply.github.com>
2022-04-10 14:04:16 +09:00
jeon-yongjun
669d1ca38a Add Reduce method in reverse_iter (#3597) 2022-04-10 13:32:34 +09:00
simbajisu
75ffbe32bd print super_thisclass 2022-04-10 13:27:14 +09:00
hwi-ya
263aec1532 When I run list[()], I modify it so that list[()] comes out 2022-04-10 12:43:38 +09:00
Jeong Yunwon
1584cefff3 Fix clippy warnings 2022-04-08 17:57:08 +09:00
d1t2
3037508b0a Fix test_dict.test_fromkeys()
Based on CPython implementation, dictobject.c, construct the new
object with type and call corresponding setitem method.
2022-03-30 09:22:24 +08:00
Narawit Rakket
0f4d6cd66c fix: correct deque repr result and fix hanging problem 2022-03-21 00:53:12 +07:00
Narawit Rakket
9851643ec2 refactor: add repr helper function for the collections 2022-03-20 23:11:06 +07:00
Jake Armendariz
0dba8701e8 Merged marshaling module 2022-03-16 18:54:47 -07:00
Jake Armendariz
aadaf18219 Marshaling sets, frozen sets, bytearr, and changes to testing 2022-03-16 18:09:33 -07:00
d1t2
e02a312f7e Fix bool un/marshaling
Test: import marshal; assert marshal.loads(marshal.dumps(True)) == True
Test: import marshal; assert marshal.loads(marshal.dumps(False))== False
2022-03-13 21:13:33 +08:00
d1t2
63b91a42c3 Fix wrong complex repr() for -0.0
Test: assert repr(complex('-0.0')) == '(-0+0j)'
2022-03-13 13:50:03 +08:00
d1t2
b7b05b3bcd Fix wrong complex repr() for nan as img part
If the image part of a complex number is nan, the repr string won't prefix "+" to it.

Test: assert repr(complex(1, -float('nan'))) == '(1+nanj)'
2022-03-13 12:35:54 +08:00
Jeong YunWon
21c4ea5544 Fix trunc error message format 2022-03-13 03:56:48 +09:00
Jeong YunWon
def4a2b91a Merge pull request #3316 from qingshi163/sequence-protocol
Impl PySequence Protocol
2022-03-12 17:19:59 +09:00
Kangzhi Shi
a3655d3e28 fix bytearray delitem not raise buffer error 2022-03-12 16:12:35 +09:00
Kangzhi Shi
9d443bbbdc fix range raise overflow error for isize 2022-03-12 16:12:35 +09:00
Kangzhi Shi
8cdbd182b2 fix sliceable return index error instead overflow error 2022-03-12 16:12:35 +09:00
Kangzhi Shi
a2d71e7d82 fix bytes getitem return type 2022-03-12 16:12:35 +09:00
Kangzhi Shi
7b8c4091b5 fix hang on __index__ 2022-03-12 16:12:34 +09:00
Kangzhi Shi
c6ee563088 fix item protocol use sequence protocol 2022-03-12 16:12:12 +09:00
Kangzhi Shi
0abe90dd0a move obj_as to sequence_downcast 2022-03-12 16:12:12 +09:00
Kangzhi Shi
994c0be479 fix fmt 2022-03-12 16:12:12 +09:00
Kangzhi Shi
10020a910c mark fail tests 2022-03-12 16:12:12 +09:00
Kangzhi Shi
b91ec2690f fix rebase 2022-03-12 16:12:12 +09:00
Kangzhi Shi
0c9235ce0a impl sequence protocol for PyDeque 2022-03-12 16:12:12 +09:00
Kangzhi Shi
066ba2fec1 impl sequence protocol for PyStr 2022-03-12 16:12:12 +09:00
Kangzhi Shi
1536dd9417 impl sequence protocol for PyTuple 2022-03-12 16:12:12 +09:00
Kangzhi Shi
0545e6a2dc impl sequence protocol for PyFrozenSet 2022-03-12 16:12:12 +09:00
Kangzhi Shi
f18b8f1a28 impl sequence protocol for PySet 2022-03-12 16:12:12 +09:00
Kangzhi Shi
29e08314a4 impl sequence protocol for PyRange 2022-03-12 16:12:12 +09:00
Kangzhi Shi
6b17fa1d3d fix rebase 2022-03-12 16:12:12 +09:00
Kangzhi Shi
e3247dae7a refactor use SliceableSequence for array 2022-03-12 16:12:12 +09:00
Kangzhi Shi
01a8e01ec8 refactor BufferResizeGuard 2022-03-12 16:12:12 +09:00
Kangzhi Shi
4be3c4f598 refactor PySliceableSequence -> SlicableSequenceOp 2022-03-12 16:12:12 +09:00
Kangzhi Shi
b4907f0703 refactor sliceable incomplete sequence protocol for list 2022-03-12 16:12:12 +09:00
Kangzhi Shi
83ae4b1142 impl sequence protocol for dict_items dict_values dict_keys 2022-03-12 16:12:12 +09:00
Kangzhi Shi
6aed81516a impl sequence protocol for dict 2022-03-12 16:12:12 +09:00
Kangzhi Shi
5f0a58fbc6 impl sequence protocol for mappingproxy 2022-03-12 16:12:12 +09:00
Kangzhi Shi
52b458d524 refactor length now use sequence and mapping protocol 2022-03-12 16:12:12 +09:00