Commit Graph

5311 Commits

Author SHA1 Message Date
Jeong YunWon
ee09ef2bd2 TryFromBorrowedObject 2021-08-14 13:39:06 +09:00
Jeong YunWon
289ddeaa3c Merge pull request #2878 from DimitrisJim/sets_reduce
Add reduce for set, frozenset.
2021-08-14 12:50:07 +09:00
Noa
cc40ae025e Merge pull request #2851 from deantvv/fix-os-sendfile
Fix os sendfile
2021-08-13 20:34:21 -05:00
Dean Li
3bb4e5d808 os: fix sendfile for macos
In python, `count` in `sendfile` doesn't include nbytes in headers or trailers.
But in `nix::sys::sendfile::sendfile` does.

From nix doc,
```
If any headers are specified and `count` is non-zero,
the length of the headers will be counted in the limit of total bytes sent.
```
2021-08-14 07:57:05 +08:00
jfh
ac0d5ff8b0 Add reduce for set, frozenset. 2021-08-14 01:11:13 +03:00
Jeong YunWon
634a6c2435 Merge pull request #2875 from DimitrisJim/retry_set_ops
Retrying contains, remove, discard with a frozenset.
2021-08-14 00:27:20 +09:00
jfh
4a460248b9 Retrying contains, remove, discard with a frozenset. 2021-08-13 17:33:13 +03:00
Nikita Sobolev
2bfafbbaaa Removes unused imports 2021-08-13 21:50:50 +09:00
Jeong YunWon
805abb78e8 Merge pull request #2871 from DimitrisJim/deque_init
Deque.__init__ handles initialization.
2021-08-13 14:43:58 +09:00
Jeong YunWon
2e7c3bd721 Merge pull request #2873 from DimitrisJim/cleaning
Clean up remaining pymethod usages.
2021-08-13 14:41:08 +09:00
jfh
c1b8eaaf57 Clean up remaining pymethod usages. 2021-08-13 01:14:28 +03:00
Noa
f813a54622 Merge pull request #2862 from RustPython/exotic-targets-ci
Check compilation for Android and Redox in CI
2021-08-12 16:48:11 -05:00
Noa
ca5c07b9f3 Fix warnings on redox/android 2021-08-12 15:27:53 -05:00
Jeong YunWon
51c9aa8a0b manual safety for deque.maxlen 2021-08-13 05:04:02 +09:00
jfh
64818913b8 Deque.__init__ handles initialization. 2021-08-12 21:04:41 +03:00
Jim Fasarakis-Hilliard
987516bc1f Merge pull request #2868 from DimitrisJim/reverse_list_it
Fix pickling, length hint, iteration for reverse list iterators.
2021-08-12 21:02:55 +03:00
jfh
0c6375c031 Fix pickling, length hint, iteration for reverse list iterators. Refactor common functionality. 2021-08-12 20:26:59 +03:00
sobolevn
e00fd52954 Cleans up pyclassmethod definition 2021-08-12 20:04:32 +03:00
sobolevn
cf6195934a Cleans up pyproperty definitions 2021-08-12 19:03:25 +03:00
Jim Fasarakis-Hilliard
97d388e3db Merge pull request #2863 from youknowone/funcnames
clean up pymethod with names
2021-08-12 18:19:34 +03:00
Dean Li
8f4719222c os: fix sendfile arguments 2021-08-12 22:23:37 +08:00
eldpswp99
0e36ff83ec remove unnecessary Option<usize> clone 2021-08-12 23:08:00 +09:00
eldpswp99
8e6a2660fc change deque.maxlen type from atomicCell<Option> to Option 2021-08-12 22:59:19 +09:00
eldpswp99
c29a1d2632 remove improper setter of deque.maxlen
before: maxlen was writable
        d = deque()
        d.maxlen = 10 was allowed
after : make maxlen read-only
	the before code raise attributError
2021-08-12 22:51:00 +09:00
Jeong YunWon
d2a9316344 Merge pull request #2853 from eldpswp99/support-deque.extend-recursive-call
support deque.extend recursive call
2021-08-12 22:20:56 +09:00
Jeong YunWon
3d66693612 Merge pull request #2864 from sobolevn/str-mul-1
`id()` for `str` stays the same after `* 1`
2021-08-12 21:40:12 +09:00
Jeong YunWon
0e604b55ac Update vm/src/stdlib/collections.rs
Co-authored-by: Jim Fasarakis-Hilliard <d.f.hilliard@gmail.com>
2021-08-12 21:39:52 +09:00
Jeong YunWon
201664ed4f avoid vm.new_stringref in pystr.rs 2021-08-12 20:58:38 +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
sobolevn
06d33f8f2c id() for str stays the same after * 1, refs #2840 2021-08-12 13:49:00 +03:00
Jeong YunWon
739ca964aa PyDeque with extract_elements & extend 2021-08-12 16:34:38 +09:00
Jeong YunWon
32adc327b6 clean up pymethod with names 2021-08-12 15:12:17 +09:00
Noa
811111ba59 Merge branch 'fix-redox-repl' into exotic-targets-ci 2021-08-11 18:46:09 -05:00
Noah
94eb264c92 Fix rustyline on redox 2021-08-11 18:45:57 -05: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
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
Jeong YunWon
cd548b8fc3 PyDeque::extend to use _extend always 2021-08-12 00:01:22 +09: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
eldpswp99
9c5dace49b use _extend std:Iterator 2021-08-11 23:42:16 +09:00
eldpswp99
2528d25fbe support deque.extend recursive call
before: RustPython hangs when
	d = deque('a')
	d.extend(d)
after: it extends to the copy of it
2021-08-11 22:33:21 +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
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
eldpswp99
571d9c4994 add deque __iadd__ method 2021-08-11 18:43:31 +09:00