Commit Graph

5730 Commits

Author SHA1 Message Date
Jeong YunWon
397daaeea4 Merge pull request #2831 from youknowone/cpython3.9
bump up reference CPython to 3.9
2021-10-06 04:58:30 +09:00
Jeong YunWon
4d19f9a0cf Merge pull request #3224 from youknowone/remove-tryformobject-bigint
Remove TryFromBorrowedObject for BigInt
2021-10-06 04:07:16 +09:00
Jeong YunWon
d2fe6e8ea2 Merge pull request #3223 from pheki/fix-test-chr
Fix test_chr by raising a ValueError on chr(-1) instead of OverflowError
2021-10-06 02:12:29 +09:00
Aphek
1ff85118fc Fix test_chr by raising a ValueError on chr(-1) instead of OverflowError 2021-10-05 12:40:20 -03:00
Jeong YunWon
b38af34e9e Merge pull request #3220 from youknowone/slot-destructor
Use SlotDestructor for _IOBase
2021-10-06 00:18:24 +09:00
Jeong YunWon
2ca3dc4468 _therad.LockType.__new__ 2021-10-05 19:37:07 +09:00
Jeong YunWon
70f1cc8010 Remvoe TryFromBorrowedObject for BigInt
which implicitly cost BigInt clone
2021-10-05 17:33:28 +09:00
Jeong YunWon
5254265e3a Merge pull request #3218 from lijm1358/deque-repr
Fix deque `repr` to print correct format
2021-10-05 06:38:09 +09:00
Jeong YunWon
d3066d75a7 Use SlotDestructor for _IOBase 2021-10-05 06:27:01 +09:00
Jeong YunWon
efce02f19d Merge pull request #3210 from RustPython/coolreader18/fix-windows-ssl
Fix windows ssl
2021-10-05 02:43:19 +09:00
lijm1358
2a044d56d8 fix deque repr to print correct format 2021-10-05 02:07:03 +09:00
Jeong YunWon
bbbdaf32e4 Merge pull request #3202 from youknowone/pyiter-more
Remove not very useful iterator utilty functions
2021-10-04 16:19:49 +09:00
Jeong YunWon
0576b2bf62 clean up vm::iterator::try_map 2021-10-04 04:53:55 +09:00
Jeong YunWon
c039e107a8 iterator from PyIter 2021-10-04 04:53:55 +09:00
Jeong YunWon
0c56761be1 flexible PyIterIter and PyIter::into_iter 2021-10-04 04:53:46 +09:00
Jeong YunWon
d0615a4ea3 PyIter::iter 2021-10-04 04:53:46 +09:00
Jeong YunWon
d1e9ac85d8 move funciton::PyIterator -> protocol::PyIterIter 2021-10-04 04:53:46 +09:00
Jeong YunWon
31549f8059 PyIterator holds PyIter 2021-10-04 04:53:46 +09:00
Jeong YunWon
910d5e7d11 move iterator::length_hint to vm 2021-10-04 04:53:46 +09:00
Jeong YunWon
d90a8cb8f3 remote iterator::stop_iter_value 2021-10-04 04:53:46 +09:00
Jeong YunWon
a8a3fa653b more useful vm.new_stop_iteration 2021-10-04 04:53:46 +09:00
Jeong YunWon
32770249eb remove iterator::stop_iter_with_value 2021-10-04 04:53:46 +09:00
Jeong YunWon
bda1a928c2 use PyIterReturn for coroutine internal 2021-10-04 04:53:46 +09:00
Jeong YunWon
6bda88d9aa couritine hint comments 2021-10-04 04:53:46 +09:00
Jeong YunWon
6795bb48ad bump up reference CPython 3.9 2021-10-03 23:24:59 +09:00
Tony Jinwoo Ahn
2ba1f267d2 Modify range in sre.rs
For readability, replace exclusive range with inclusive range.
2021-10-03 13:17:53 +09:00
Noah
61c3e9b1c9 Fix sys.path on windows 2021-10-02 22:20:31 -05:00
Jeong YunWon
e17d20c920 Merge pull request #3187 from DimitrisJim/use_pyint_try_to_prim
Use PyInt::try_to_primitive.
2021-10-03 03:43:26 +09:00
Jeong YunWon
93c0753da5 Remove impl TryFromObject for SequenceIndex 2021-10-03 02:18:08 +09:00
Jeong YunWon
e27b9ae32b Merge pull request #3169 from youknowone/hide-type-modules
pub(crate) for type modules
2021-10-03 02:03:06 +09:00
jfh
2f6deb8fd0 Use PyInt::try_to_primitive. 2021-10-02 19:19:28 +03:00
Jeong YunWon
001236e0ab pub(crate) for type modules 2021-10-03 00:15:15 +09:00
Jim Fasarakis-Hilliard
12d765fce3 Merge pull request #3196 from Snowapril/fix_pystruct
Fix pystruct incompatibility and add `test_buffer.py` from cpython 3.8
2021-10-02 17:27:21 +03:00
Jim Fasarakis-Hilliard
c991dff54b Merge pull request #3197 from Snowapril/mapping_proxy_repr
Add missing `repr` for `mappingproxy`
2021-10-02 16:02:06 +03:00
Jim Fasarakis-Hilliard
0edb11ac1e Merge pull request #3195 from youknowone/py-names
clean up py* attributes names
2021-10-02 16:00:10 +03:00
ChJR
fad0b6b944 Change posix.*chmod 2021-10-02 20:29:54 +09:00
snowapril
fa71ac9699 add missing repr on mappingproxy
Signed-off-by: snowapril <sinjihng@gmail.com>
2021-10-02 20:01:27 +09:00
snowapril
2b3b5fbab6 fix pystruct to use struct.error
Signed-off-by: snowapril <sinjihng@gmail.com>
2021-10-02 19:38:16 +09:00
Jeong YunWon
6b1af9a45e Merge pull request #3121 from Snowapril/mapping-protocol
Implement Mapping Protocol
2021-10-02 18:00:17 +09:00
Jeong YunWon
7b0965c1d7 turn unreachable function to cold 2021-10-02 18:00:04 +09:00
Jeong YunWon
2c8020a081 clean up py* attributes names 2021-10-02 16:59:33 +09:00
snowapril
a81b3f91b9 fix posix & winapi to use proper PyMapping
Signed-off-by: snowapril <sinjihng@gmail.com>
2021-10-02 16:45:35 +09:00
snowapril
aa2a7f01ee add PyMapping as PyObjectRef wrapper
Modify original `PyMapping` to `PyMappingMethods` and create `PyMapping`
struct as `PyObjectRef` wrapper for implementing `PyMapping_*`
functions. https://docs.python.org/3/c-api/mapping.html

Signed-off-by: snowapril <sinjihng@gmail.com>
2021-10-02 16:45:34 +09:00
Jeong YunWon
13a052b9ca Merge pull request #3094 from qingshi163/bytes-iter-pickle
General logic for positional iterator
2021-10-02 15:37:50 +09:00
snowapril
4fd0681498 move mapping protocol to rustpython_vm::protocol
Signed-off-by: snowapril <sinjihng@gmail.com>
2021-10-02 14:47:19 +09:00
snowapril
9e5120d546 add mapping type check to mappingproxy
As in cpython implementation there exists argument type checking before
create mapping proxy like below.
```c
if (!PyMapping_Check(mapping)
    || PyList_Check(mapping)
    || PyTuple_Check(mapping))
	// print error
...
```

Signed-off-by: snowapril <sinjihng@gmail.com>
2021-10-02 14:43:20 +09:00
snowapril
6e11b8931c add mapping protocol methods to update_slot
Signed-off-by: snowapril <sinjihng@gmail.com>
2021-10-02 14:43:20 +09:00
snowapril
1fbbdaabe3 support delitem in ass_subscript 2021-10-02 14:43:20 +09:00
snowapril
4f009ef971 switch SequenceIndex to PyObjectRef
As `getitem` and `setitem methods in other types,
get second argument as PyObjectRef.
2021-10-02 14:43:20 +09:00
snowapril
b197a178ea switch RangeIndex to PyObjectRef
As `getitem` method in other types, get second argument as PyObjectRef.
2021-10-02 14:43:20 +09:00