Commit Graph
5258 Commits
Author SHA1 Message Date
Padraic FanningandTetramad 95b514b85d Implement __floor__ for float type
Co-authored-by: Tetramad <cbwjd777@gmail.com>
2021-08-11 14:30:10 +09:00
Padraic FanningandTetramad fae7b0e8ed Implement __ceil__ for float type
Co-authored-by: Tetramad <cbwjd777@gmail.com>
2021-08-11 14:30:10 +09: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
leesungbinandJeong YunWon 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
Dean Li e01995d07f socket: use libc::hstrerror 2021-08-10 20:31:39 +08:00
Nikita Sobolev b33f72eb4d Adds __qualname__ to PyBoundMethod 2021-08-10 05:32:02 +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
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
sobolevn c0f38e2263 Adds __subclasshook__ to type, refs #2794 2021-08-09 16:33:57 +03:00
snowapril 8d507a6fbc seq: add __index__ op overriding class support
This commit fix three test cases in test_index.py
* SeqTestCase.test_index
* SeqTestCase.test_wrappers
* ListTestCase.test_setdelitem

All these three cases' failures were caused by not supporting classes
that override __index__ operator when indexing sequence type.

This commit implement almost same routine with PR(#2807) which also did not
support classes which override __index__ operator in range indexing.

Signed-off-by: snowapril <sinjihng@gmail.com>
2021-08-09 21:33:53 +09:00
Jim Fasarakis-Hilliard 81200b12f4 Merge pull request #2814 from jamestwebber/unhashable-deque
implement Unhashable for collections.deque
2021-08-09 05:24:02 +03:00
James Webber fee5909609 SlotDesctuctor -> SlotDestructor 2021-08-08 21:05:30 -04:00
James Webber e003f255d5 implement hashable and unhashable for collections.deque 2021-08-08 20:59:39 -04:00
Jeong YunWon 9ac81a7781 Merge pull request #2808 from sobolevn/issue-2790
Adds `class` field to `PyGetSet` to fix `__qualname__`
2021-08-09 01:40:49 +09:00
sobolevn e939346850 Adds class field to PyGetSet to fix __qualname__ and (in future) repr, refs #2790 2021-08-08 18:53:57 +03:00
Snowapril 89ca1db86d builtins: add __index__ overriding class support
This commit fix RangeTestCase.test_range test in test_index.py

TryFromObject implementation for RangeIndex enum did not cover classes
that override __index__ operator which cpython implementation is currently providing
(https://docs.python.org/3.8/library/operator.html#operator.__index__)

I add codes that cover upper case using vm.to_index method.

Signed-off-by: snowapril <sinjihng@gmail.com>
2021-08-08 21:27:05 +09:00
voidSatisfaction 3cd1f6b27c Add math.comb function 2021-08-08 20:04:23 +09:00
sobolevn e5e20a53b2 Makes type.__prepare__ a classmethod, also first arg is any (not str), refs #2762 2021-08-08 12:49:41 +03:00
sobolevn af63e83e13 Makes args of type.__prepare__ optional, refs #2762 2021-08-08 12:05:31 +03:00
Jeong YunWon 43a43f76f2 Merge pull request #2803 from moreal/bugfix/rethrow-error-in-build-map
Fix incorrect unwrapping
2021-08-07 23:47:06 +09:00
Jim Fasarakis-Hilliard bf59103d19 Merge pull request #2802 from eldpswp99/iskeyword-none-check
add iskeyword None check
2021-08-07 15:43:02 +03:00
Lee Dogeon 653858e152 Fix unhashable type error message (#2801)
* Fix unhashable type error message
2021-08-07 14:37:01 +03:00
eldpswp99 1c0bd83809 iskeyword: add None check
there was one todo in test_keyword.py

before: s was PyStrRef, it failed to handle None
after: convert s to PyObjectRef and add None check
2021-08-07 20:24:41 +09:00
moreal cc7269c68d Fix incorrect unwrapping
See https://github.com/RustPython/RustPython/issues/2799
2021-08-07 19:24:25 +09:00
Dean Li 06b40b3602 socket: impl herror
There is one todo that is waiting for hstrerror to land in libc crate.
For now it shows the same error as cpython when hstrerror is not
available.
2021-08-07 15:26:09 +08:00
Jeong YunWon 7fc8ddb130 Merge pull request #2795 from DimitrisJim/rangeiter_reduce
Adds reduce, length_hint and set_state to range iterators.
2021-08-06 06:44:32 +09:00
jfh f3a074ba90 Adds reduce, length_hint and set_state to range iterators. 2021-08-05 23:56:01 +03:00
Jeong YunWon 412fffbc5d Merge pull request #2792 from DimitrisJim/init_bltins
Initialize with init for mutable builtins.
2021-08-05 03:59:19 +09:00
jfh 6950ad6ee4 Initialize with init for mutable builtins. 2021-08-04 20:57:47 +03:00
Nikita Sobolev 8f2679a97a Adds __qualname__ to PyBuiltinFunction 2021-08-04 13:59:40 +09:00
Nikita Sobolev 8009697498 Adds correct __repr__ to PyBuiltinMethod 2021-08-02 19:07:16 +09:00
Jeong YunWon dca79874dd Merge pull request #2772 from RustPython/redox-fixes
Fix redox and other stuff
2021-08-02 04:05:14 +09:00
Noah 8f2b9f3195 Fix socket2::Socket niche optimization breaking stuff 2021-08-01 10:53:08 -05:00
sobolevn 9c6dbf2c23 Fixes clippy on macos 2021-08-01 12:08:14 +03:00
Jeong YunWon 7ab81569ea Merge pull request #2708 from DimitrisJim/operator_rs
Add operator.rs
2021-08-01 09:24:41 +09:00
Nikita Sobolev 73ae7a6116 Adds __qualname__ to PyBuiltinMethod 2021-08-01 09:16:27 +09:00
Jeong YunWon b57c36ef64 Merge pull request #2769 from DimitrisJim/fast_range_iter
Fast range iterator
2021-08-01 02:51:47 +09:00
Noah 4de16f6955 Remove derive_more dep 2021-07-31 10:49:39 -05:00
Noah 1ed3277a39 Fix building with openssl 1.1.0 2021-07-31 10:18:56 -05:00
Noah e9d1608f4d Fix no fstatat/times on redox 2021-07-31 10:18:06 -05:00
Noah b05c0e27f6 Upgrade dependencies for redox 2021-07-31 10:18:00 -05:00
jfh eda5a71526 Add operator.rs. 2021-07-30 22:11:27 +03:00
jfh 1115511e3d Add fast range iterator. 2021-07-30 19:19:30 +03:00
Nikita Sobolev 4890f09c57 Fixes type.__module__ issue, refs #2310 (#2763)
* Fixes `type.__module__` issue, refs #2310
2021-07-30 19:09:48 +03:00