Commit Graph

8 Commits

Author SHA1 Message Date
snowapril
d0afc4c3bc set range iter type not creatable by calling type
This commit fix `RangeTest.test_range_iterators_invocation` in
[`test_range.py`](https://github.com/RustPython/RustPython/blob/main/Lib/test/test_range.py#L507).

This is last `TODO` in `test_range.py`.

By add slot tp_new to both types and return new_type_error, prevent
creation of range_iterator and longrange_iterator by calling its type.

Signed-off-by: snowapril <sinjihng@gmail.com>
2021-08-26 16:15:28 +09:00
jfh
f3a074ba90 Adds reduce, length_hint and set_state to range iterators. 2021-08-05 23:56:01 +03:00
jfh
1115511e3d Add fast range iterator. 2021-07-30 19:19:30 +03:00
jfh
c1f1f1ef02 Fix a number of range issues. 2021-06-15 19:20:54 +03:00
jfh
7be043fa5a Fix small miscalculation when reversing a range. 2021-06-14 22:31:50 +03:00
Robert Booth
af6b230dad Change int type checking, amend tests
- add a special_retrieve fudge function to the PyValue trait
- define the special_retrieve function for PyInt
- remove blocks on successful tests to reflect effect of changes
2021-04-25 01:18:57 +09:00
Robert Booth
55f2fa0a73 add test_range 2021-04-23 10:17:32 +09:00
Robert Booth
fa20c260d7 test_range from cpython [v3.8.7|✔] 2021-04-23 10:02:36 +09:00