Commit Graph

5337 Commits

Author SHA1 Message Date
Jim Fasarakis-Hilliard
fe4c3a5460 Merge branch 'master' into reversed_iter_type 2021-08-17 17:12:34 +03:00
Jeong YunWon
7e3be9163d Merge pull request #2860 from youknowone/try-from-int
TryFromBorrowedObject for int types
2021-08-17 17:12:56 +09:00
jfh
ca6ab792f0 Add reversed iterator type. 2021-08-17 05:29:49 +03:00
Kim Dong In
1e41a0bb56 apply cargo fmt 2021-08-16 17:16:47 +09:00
Dong In Kim
405fc685bd Update vm/src/stdlib/math.rs
Co-authored-by: Jeong YunWon <youknowone@users.noreply.github.com>

Co-authored-by: Jeong YunWon <youknowone@users.noreply.github.com>
2021-08-16 17:11:47 +09:00
Kim Dong In
6fa88ab05a Fix failed test pow in test_math
add two conditions to raise ValueError for input values
case 1: NaN, when both input values are finite, and base is negative and exponent is non-integer
case 2: divde by zero, when base is 0 exponent is negative value
2021-08-16 16:45:45 +09:00
Jeong YunWon
9ce8ec8a0f Merge pull request #2884 from youknowone/slot-wrapper
add_slot_wrappers must be called up to once
2021-08-16 15:35:46 +09:00
jfh
d23c7e9432 Allow enumerate as base class. 2021-08-16 07:27:45 +03:00
voidSatisfaction
67ede59c32 Add math.prod function and enable its tests 2021-08-15 23:20:28 +09:00
Jim Fasarakis-Hilliard
a4dce8068f Merge pull request #2887 from DimitrisJim/reverse_deque_iterator
Add reverse deque iterator.
2021-08-14 23:06:05 +03:00
jfh
8978e8ccda Add reverse deque iterator. 2021-08-14 22:07:41 +03:00
Gyuseok Jung
b8c0c8cc65 add time.time_ns() function 2021-08-15 00:07:05 +09:00
Jeong YunWon
7d53c65bfb Merge pull request #2885 from Snowapril/rename-time-module
Rename time_module.rs to time.rs
2021-08-14 21:59:43 +09:00
Snowapril
7cc2a5431f Fix frozenset copy to return self (#2883)
Fix frozenset copy to return zelf if called on frozenset instance
2021-08-14 15:56:22 +03:00
snowapril
5049611a4e rename time_module.rs to time.rs
This commit resolve issue #2882.
* rename time_module.rs to time.rs

Signed-off-by: snowapril <sinjihng@gmail.com>
2021-08-14 20:46:26 +09:00
Jeong YunWon
4c9fa5a521 add_slot_wrappers must be called up to once 2021-08-14 17:57:02 +09:00
Jeong YunWon
5ff0e4e5de TryFromBorrowedObject for ints 2021-08-14 16:48:56 +09:00
Jeong YunWon
9d99ea9376 Merge pull request #2879 from moreal/bugfix/unnecessary-slot-overwrite
Remove unnecessary slot wrapper addition
2021-08-14 16:14:39 +09:00
Jeong YunWon
62bff17dcb TryFromBorrowedObject for byteslike 2021-08-14 13:39:06 +09:00
Jeong YunWon
4d4e39af20 Rename PyBytesLike, PyRwBytesLike, BufOrStr to Arg-prefixed proper names 2021-08-14 13:39:06 +09:00
Jeong YunWon
3ed817f1c8 impl TryFromBorrowedObject for PyBytes 2021-08-14 13:39:06 +09:00
Jeong YunWon
f6de106e13 PyBytesInner::try_from_borrowed_object 2021-08-14 13:39:06 +09:00
Jeong YunWon
e594090629 BufferProtocol -> AsBuffer 2021-08-14 13:39:06 +09:00
Jeong YunWon
888b3822b7 Give a sole module for buffer protocol 2021-08-14 13:39:06 +09:00
Jeong YunWon
93cf687d15 TryFromBorrowedObjcet for PyBuffer 2021-08-14 13:39:06 +09:00
Jeong YunWon
ee09ef2bd2 TryFromBorrowedObject 2021-08-14 13:39:06 +09:00
Moreal
ecf787713e Remove unnecessary slot wrapper overwriting 2021-08-14 13:17:43 +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