Commit Graph

5722 Commits

Author SHA1 Message Date
Jeong YunWon
2ca3dc4468 _therad.LockType.__new__ 2021-10-05 19:37:07 +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
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
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
snowapril
e83b68b810 apply mapping protocol in itemprotocol 2021-10-02 14:43:20 +09:00
snowapril
fc761b4e5b add mapping protocol to proper types 2021-10-02 14:43:20 +09:00
snowapril
1b6cdf507e rename length to compute_length
As cpython use `range_compute_length` naming
and `length` can be conflict with mapping protocol's method
2021-10-02 14:41:49 +09:00
snowapril
77351b3da8 add PyMapping struct for mapping protocol 2021-10-02 14:41:49 +09:00
snowapril
14ce6aa49a add slot_as_mapping slots with atomic cell 2021-10-02 14:41:49 +09:00
jfh
fbd3641f5d Arithmatic into Arithmetic. 2021-10-02 03:42:59 +03:00
Kangzhi Shi
e1f689c565 introduce PyIterReturn::from_getitem_result 2021-10-01 21:16:43 +02:00
Kangzhi Shi
350c4de4e5 rebase to use PyIterReturn 2021-10-01 20:46:17 +02:00