Commit Graph

8818 Commits

Author SHA1 Message Date
Padraic Fanning
79779f87a5 Add '_py_abc' to the frame stack
This restores an alteration made by @coolreader18 a while back.
2021-08-18 20:08:18 -04:00
Padraic Fanning
48de03506c Implement "__class_getitem__" (barely working) 2021-08-18 20:08:18 -04:00
Padraic Fanning
3921ea405c Make __class_getitem__ always a class method
c.f. lines 2695-2725 of typeobject.c in CPython source
2021-08-18 20:08:18 -04:00
Padraic Fanning
fab274a9e0 Update typing to CPython 3.8 2021-08-18 20:08:17 -04:00
Jim Fasarakis-Hilliard
5ad023535f Merge pull request #2909 from youknowone/dict-pop
remove double-get from DictDataType::pop_back
2021-08-18 22:00:40 +03:00
Snowapril
4632972de4 Implement missing Iterator & ReverseIterator and its methods (#2906)
Implement missing methods of string iterators.
2021-08-18 21:23:03 +03:00
Jim Fasarakis-Hilliard
0a6edab958 Merge pull request #2905 from DimitrisJim/skip_deadlocks
Skip tests that cause RustPython to occasionally hang.
2021-08-18 21:09:13 +03:00
Jeong YunWon
b58e11f1f4 remove double-get from DictDataType::pop_back 2021-08-19 01:41:22 +09:00
jfh
d64cf86cac Skip tests that cause RustPython to hang. 2021-08-19 00:43:51 +09:00
Padraic Fanning
5d4faf0ccf Skip tests that sometimes hang the CI
Tested with `act`.
2021-08-19 00:42:35 +09:00
Noa
e277acc747 Merge pull request #2902 from eldpswp99/dict-remain-order-after-delete
make dict remain order after delete
2021-08-17 15:53:55 -05:00
eldpswp99
564eb2991e resolving deadlock and redundant lookup, grammatic mistakes 2021-08-18 02:28:58 +09:00
Jeong YunWon
0834ae3039 Merge pull request #2212 from pmp-p/patch-1
WASI: add a note for rust wasm target setup
2021-08-18 02:00:48 +09:00
Jeong YunWon
1d89e633dc Merge pull request #2903 from Snowapril/fix-syntax-test
Add syntax error detection routine for global symbol
2021-08-18 01:27:44 +09:00
Jeong YunWon
f20bb6cac7 Merge pull request #2900 from DimitrisJim/reversed_iter_type
Add reversed iterator type.
2021-08-18 01:01:45 +09:00
snowapril
38237c30d3 compiler: add is_global() check at top of errors
add `!symbol.is_global()` condition check before entrying global symbol
errors

This change will decrease hot path cost.

Signed-off-by: snowapril <sinjihng@gmail.com>
2021-08-18 00:35:14 +09:00
Jeong YunWon
77ab21ce8d Merge pull request #2463 from fanninpm/test-base64
Add test_base64 from CPython 3.8.7
2021-08-17 23:30:38 +09:00
Jim Fasarakis-Hilliard
fe4c3a5460 Merge branch 'master' into reversed_iter_type 2021-08-17 17:12:34 +03:00
eldpswp99
b49a1e9f5e remove test_ordered_dict delitem expected failure to passed test 2021-08-17 22:50:32 +09:00
eldpswp99
fca7b41744 optimize popitem using nentries which implies next insertion index 2021-08-17 21:24:06 +09:00
snowapril
13bbefdd4e compiler: impl syntax error detect for global kind
This commit fixes `test_global_parap_err_first` test in
[test_syntax.py](https://github.com/RustPython/RustPython/blob/master/Lib/test/test_syntax.py#L678) and implement the other syntax errors detection as cpython 3.8 provided for global symbol.

Below syntax error conditions are added.
* name {} is parameter and global
```python
>>>>> def test(a):
.....   global a
.....
SyntaxError: name 'a' is parameter and global at line 2 column 2
        global a
```
* annotated name {} can't be global
```python
>>>>> def test():
.....   a: int
.....   global a
.....
SyntaxError: annotated name 'a' can't be global at line 3 column 2
        global a
```
* name {} is assigned to before global description
```python
>>>>> a = 100
>>>>> def test():
.....   a = 10
.....   global a
.....
SyntaxError: name 'a' is assigned to before global declaration at line 3 column 2
        global a
```
* name {} is used prior to global declaration
```python
>>>>> a = 10
>>>>> def test():
.....   print(a)
.....   global a
.....
SyntaxError: name 'a' is used prior to global declaration at line 3 column 2
        global a
```

Signed-off-by: snowapril <sinjihng@gmail.com>
2021-08-17 21:14:13 +09:00
eldpswp99
ce99057c81 make dict delete remains order 2021-08-17 20:41:37 +09:00
Jeong YunWon
6b6a667890 Merge pull request #2901 from Tetramad/pprint
Update pprint module to Python3.8
2021-08-17 17:13:45 +09: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
Tetramad
f6fbea3019 Update pprint module to Python3.8
Add `sort_dicts` parameter to several functions and new `pp` function.
2021-08-17 13:59:07 +09:00
jfh
ca6ab792f0 Add reversed iterator type. 2021-08-17 05:29:49 +03:00
Jim Fasarakis-Hilliard
25eeba86b8 Merge pull request #2899 from sobolevn/fixes-ci
Fix the failing CI
2021-08-17 02:04:31 +03:00
sobolevn
10fe2d4763 Attempt to fix the failing CI 2021-08-17 01:32:25 +03:00
Jeong YunWon
2da818c0de Merge pull request #2894 from owljoa/fix-math-pow-test
Fix failed test pow in test_math
2021-08-16 20:55:56 +09:00
eldpswp99
4e9f9ff129 change Dict Entries type Vec<DictEntry> to Vec<Option<DictEntry>> 2021-08-16 18:46:49 +09: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
Jeong YunWon
95c5e98de5 Merge pull request #2892 from DimitrisJim/test_enumerate
Add test_enumerate from CPython 3.8
2021-08-16 15:30:43 +09:00
jfh
f7b6730c5d Mark failing tests. 2021-08-16 08:42:56 +03:00
Jeong YunWon
6988e82d0d Merge pull request #2890 from DimitrisJim/enum_baseclass
Allow enumerate as base class.
2021-08-16 14:10:16 +09:00
jfh
8723952cce Add test_enumerate from CPython 3.8. 2021-08-16 07:30:38 +03: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
fermian
b1207ab39e Update test_collections.py 2021-08-14 17:27:43 +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