Padraic Fanning and Tetramad
95b514b85d
Implement __floor__ for float type
...
Co-authored-by: Tetramad <cbwjd777@gmail.com >
2021-08-11 14:30:10 +09:00
Padraic Fanning and Tetramad
fae7b0e8ed
Implement __ceil__ for float type
...
Co-authored-by: Tetramad <cbwjd777@gmail.com >
2021-08-11 14:30:10 +09:00
Padraic Fanning and Tetramad
9f497fb65a
Add test_float from CPython 3.9.1
...
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
leesungbin and Jeong 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
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 and Jeong YunWon
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
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
Jim Fasarakis-Hilliard
430947a75e
Merge pull request #2815 from jamestwebber/fix-typo
...
typo in slots.rs: SlotDesctuctor -> SlotDestructor
2021-08-09 04:46:07 +03:00
James Webber
596dfe1f5a
un-annotate now-passing test
2021-08-08 21:45:12 -04: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
Jim Fasarakis-Hilliard
9652c79f1d
Merge pull request #2787 from fanninpm/test-yield-from
...
Add test_yield_from from CPython 3.8
2021-08-08 21:15:28 +03:00
Padraic Fanning
373aff3d69
Mark failing tests due to GitHub Actions
2021-08-08 13:23:37 -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
Jim Fasarakis-Hilliard
530dec5426
Merge pull request #2806 from sobolevn/issue-2762
...
Makes args of `type.__prepare__` optional
2021-08-08 13:33:45 +03: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
Jim Fasarakis-Hilliard
53b8067acd
Merge pull request #2798 from deantvv/impl-socket-herror
...
socket: impl herror
2021-08-07 12:50:44 +03: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
2d78812745
Merge pull request #2797 from fanninpm/test-zipfile
...
Add test_zipfile from CPython 3.8
2021-08-06 23:21:48 +09:00
Padraic Fanning
d99d255ee1
Mark erroring/failing/hanging tests
2021-08-05 23:32:02 -04:00
Padraic Fanning
12e8f59862
Add test_zipfile from CPython 3.8
...
Also adds the following supporting files:
- the entire ziptestdata/ directory
- zip_cp437_header.zip
- zipdir.zip
2021-08-05 18:08:38 -04: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