Commit Graph

8712 Commits

Author SHA1 Message Date
eldpswp99
ce99057c81 make dict delete remains order 2021-08-17 20:41:37 +09:00
eldpswp99
4e9f9ff129 change Dict Entries type Vec<DictEntry> to Vec<Option<DictEntry>> 2021-08-16 18:46:49 +09:00
fermian
b1207ab39e Update test_collections.py 2021-08-14 17:27:43 +09:00
Jeong YunWon
06581db9c9 Merge pull request #2865 from eldpswp99/support-deque-insert-at-the-end
support deque.insert when idx is gte to len
2021-08-12 20:48:05 +09:00
eldpswp99
ab8c6bf97a support deque.insert when idx is gte to len
before: when idx >= len it doesn't insert the element to the end
	it inserted to index len-1
after:  when idx >= len it inserts the element to the end of the deque
2021-08-12 20:03:24 +09:00
Jim Fasarakis-Hilliard
08b758c8eb Merge pull request #2861 from youknowone/pymethod-magic
clean up #[pymethod(magic)]
2021-08-12 01:22:26 +03:00
Jeong YunWon
4e60bcd741 clean up #[pymethod(magic)] 2021-08-12 06:44:52 +09:00
Jim Fasarakis-Hilliard
5982e8c11c Merge pull request #2859 from DimitrisJim/fix_faulty_length_hint
Fix length hint for dictionary iterators.
2021-08-12 00:20:06 +03:00
jfh
0c4d579adc Fix length hint for dictionary iterators. 2021-08-11 23:46:00 +03:00
Jeong YunWon
01c106b76c Merge pull request #2857 from youknowone/richcompare
tp_cmp -> tp_richcompare
2021-08-12 04:41:12 +09:00
Jeong YunWon
94d046b7ca Merge pull request #2858 from sobolevn/bytes-mul-1
`id()` for `bytes` stays the same after `* 1`
2021-08-12 04:32:24 +09:00
Jeong YunWon
1a57ef03aa tp_cmp -> tp_richcompare
this was the last typeslot with mismatching name
2021-08-12 04:01:51 +09:00
sobolevn
37f66dd998 id() for bytes stays the same after * 1, refs #2840 2021-08-11 21:53:52 +03:00
Jeong YunWon
03a9d6058b Refactor Buffer Protocol (mostly namings) (#2849)
* Refactor Buffer protocol into RustPython convention
2021-08-11 20:11:31 +03:00
Nikita Sobolev
090672800a Adds __rmul__ to collections.deque (#2844)
* Adds `__rmul__` to `collections.deque`, refs #2834
2021-08-11 17:58:46 +03:00
Jeong YunWon
cae41136f9 Merge pull request #2850 from tony-jinwoo-ahn/_PathLike
Fixed to use PathLike in imghdr.py
2021-08-11 22:24:25 +09:00
Jeong YunWon
6bd69af8f6 Merge pull request #2848 from voidsatisfaction/fix-dict-or-ror-ior-return-notimplemented
Fix make dict.{__or__,__ror__,__ior__} with other types return NotImplemented
2021-08-11 21:36:44 +09:00
Tony Jinwoo Ahn
20cb4aca69 Fixed to use PathLike in imghdr.py 2021-08-11 21:29:22 +09:00
Jim Fasarakis-Hilliard
101fd80949 Merge pull request #2846 from Arnab1181412/master
Fixed unwrapping in frame.rs
2021-08-11 15:01:03 +03:00
voidsatisfaction
3500a58138 fix: make dict.{__or__,__ror__,__ior__} with other types should return NotImplemented 2021-08-11 20:23:51 +09:00
Arnab1181412
49a30b9dab Fixed unwrapping in frame.rs 2021-08-11 16:52:12 +05:30
Jeong YunWon
56469ae204 Merge pull request #2843 from eldpswp99/add_deque_iadd
add deque __iadd__ method
2021-08-11 19:48:38 +09:00
eldpswp99
571d9c4994 add deque __iadd__ method 2021-08-11 18:43:31 +09:00
Jeong YunWon
9ba674a2a9 Merge pull request #2841 from sobolevn/issue-2840
Fixes that `id()` of `tuple` was changing on `* 1`
2021-08-11 17:30:16 +09:00
Nikita Sobolev
2705fb2320 Update vm/src/builtins/tuple.rs
Co-authored-by: Jim Fasarakis-Hilliard <d.f.hilliard@gmail.com>
2021-08-11 10:38:36 +03:00
Jeong YunWon
b4810f166c Merge pull request #2828 from Tetramad/float
Add __floor__ and __ceil__ to float w/ tests
2021-08-11 16:08:37 +09:00
Tetramad
d45161939d Enable __floor__, __ceil__ test snippet for float
The test of __floor__ and __ceil__ for float will be activated
when python version is greater then or equal to 3.9
2021-08-11 14:30:10 +09:00
Padraic Fanning
95b514b85d Implement __floor__ for float type
Co-authored-by: Tetramad <cbwjd777@gmail.com>
2021-08-11 14:30:10 +09:00
Padraic Fanning
fae7b0e8ed Implement __ceil__ for float type
Co-authored-by: Tetramad <cbwjd777@gmail.com>
2021-08-11 14:30:10 +09:00
Padraic Fanning
9f497fb65a Add test_float from CPython 3.9.1
Co-authored-by: Tetramad <cbwjd777@gmail.com>
2021-08-11 14:30:10 +09:00
sobolevn
7e2efb4de5 Fixes that id() of tuple was changing on * 1, refs #2840 2021-08-11 01:47:16 +03:00
Jeong YunWon
08614bfc95 Merge pull request #2830 from DimitrisJim/bytearray_init_alloc
Add __alloc__ to bytearray and fix its __init__ issues.
2021-08-11 04:10:08 +09:00
jfh
04c9ae0c83 Fix bytearray.__init__. 2021-08-10 21:03:07 +03:00
Nikita Sobolev
a4fd0144ad Fixes repr of functions defined in classes 2021-08-11 02:55:05 +09:00
leesungbin
2c6208a5f8 Add math_perm method
Co-authored-by: Jeong YunWon <youknowone@users.noreply.github.com>
2021-08-11 02:29:44 +09:00
jfh
a136db2917 Add __alloc__ for bytearray, add note to tests. 2021-08-10 19:09:22 +03:00
Jeong YunWon
4812686f38 Merge pull request #2826 from deantvv/socket-hstrerror
socket: use libc::hstrerror
2021-08-11 00:21:08 +09:00
Dean Li
e01995d07f socket: use libc::hstrerror 2021-08-10 20:31:39 +08:00
Jeong YunWon
ac0ae8bb6c Merge pull request #2823 from moreal/bugfix/missing-annotations
Add missing `__annotations__`  variable into main module
2021-08-10 20:07:01 +09:00
Lee Dogeon
eea1945469 Refactor Option<T> handling
Co-authored-by: Jeong YunWon <youknowone@users.noreply.github.com>
2021-08-10 19:14:25 +09:00
Nikita Sobolev
b33f72eb4d Adds __qualname__ to PyBoundMethod 2021-08-10 05:32:02 +09:00
Jeong YunWon
8d14cf53c5 Merge pull request #2824 from DimitrisJim/use_vm_common
Use rustpython_common via public name.
2021-08-10 04:58:29 +09:00
Jeong YunWon
49ff438278 Merge pull request #2820 from sobolevn/issue-2779
Fixes infinite recursion on `raise e from e`
2021-08-10 04:54:52 +09:00
Jeong YunWon
be0e7ce539 Merge pull request #2818 from Snowapril/fix-seq-indexing
Add __index__ operator overriding class support for SequenceIndex
2021-08-10 04:24:34 +09:00
Jeong YunWon
a611ba2e45 handle cause and context with same code block 2021-08-10 04:20:51 +09:00
jfh
91022f5808 Use rustpython_common via exported name. 2021-08-09 22:02:00 +03:00
Jeong YunWon
794d2ce2e4 Refactor SequenceIndex::try_from_object_for 2021-08-10 03:33:48 +09:00
sobolevn
83914a9f54 Fixes infinite recursion on raise e from e, refs #2779 2021-08-09 20:58:36 +03:00
Moreal
5b5da3c45d Add missing __annotations__ variable into module 2021-08-10 02:43:33 +09:00
Jim Fasarakis-Hilliard
e4be5abf4d Merge pull request #2821 from sobolevn/issue-2794
Adds `__subclasshook__` to `type`
2021-08-09 17:54:56 +03:00