Commit Graph

5929 Commits

Author SHA1 Message Date
snowapril
db0d9df53f Add offer_suggestions on write_exception_inner
Signed-off-by: snowapril <sinjihng@gmail.com>
2021-10-20 10:19:42 +09:00
snowapril
6339390629 Implement keyword suggestion routine
`suggestions.rs` is almost porting of implementation of
[this](https://github.com/python/cpython/pull/16856) and
[this](https://github.com/python/cpython/pull/25397).

Signed-off-by: snowapril <sinjihng@gmail.com>
2021-10-20 10:19:42 +09:00
Jim Fasarakis-Hilliard
850187f246 Merge pull request #3343 from ChJR/feature/relocate_length
Relocate vm.obj_len to obj.length
2021-10-19 22:05:03 +03:00
Jim Fasarakis-Hilliard
fcb6551443 Merge pull request #3342 from ChJR/feature/relocate_hash
Relocate vm._hash to obj.hash
2021-10-19 22:04:23 +03:00
ChJR
32e693f234 Replace vm.obj_len to obj.length 2021-10-20 02:33:46 +09:00
ChJR
83c3644add Replace vm._hash to obj.hash 2021-10-20 02:29:58 +09:00
ChJR
0d32e1ae16 Relocate vm._hash to obj.hash 2021-10-20 02:10:36 +09:00
ChJR
6b14756542 Relocate vm.obj_len to obj.length 2021-10-20 02:08:45 +09:00
Aratrik
72c3a7027c Relocate vm.del_attr to obj.del_attr 2021-10-19 22:01:07 +05:30
Aratrik
d6fc20f64e Relocate vm.set_attr to obj.set_attr 2021-10-19 14:50:53 +05:30
jfh
d01e222d95 Use dictionary length for capacity. 2021-10-18 14:11:37 +03:00
Jeong YunWon
7f6e016526 Merge pull request #3282 from youknowone/remove-ref
Whitelist special-enough types to have PyRef aliases
2021-10-18 14:44:29 +09:00
Noa
27540e1d35 Add unparse feature to ast 2021-10-17 21:55:27 -05:00
Noa
7c68ad8a72 Make ast.AST a basetype 2021-10-17 21:54:52 -05:00
Noa
cde42dba26 Generate ast classes for top-level ast kinds, e.g. stmt 2021-10-17 21:54:52 -05:00
Jeong YunWon
c05e8eb48c Remove PySliceRef 2021-10-18 05:17:09 +09:00
Jeong YunWon
997f85ff54 Less PyListRef 2021-10-18 05:15:56 +09:00
Jeong YunWon
7377664bea Remove PyFloatRef 2021-10-18 05:14:54 +09:00
jfh
7bc10da154 Relocate vm.get_attribute to obj.get_attr. 2021-10-17 10:30:21 +03:00
Jim Fasarakis-Hilliard
7af58dd822 Merge pull request #3328 from youknowone/del-error-cold
__del__ failure is a cold function
2021-10-17 07:48:46 +03:00
Jeong YunWon
e1bd36d8f6 Merge pull request #3323 from DimitrisJim/supply_dict_on_absent_prepare
Ignore AttributeError for missing `__prepare__`.
2021-10-17 06:26:38 +09:00
Jeong YunWon
ecf83ecc3a __del__ failure is a cold function 2021-10-17 06:25:04 +09:00
Jim Fasarakis-Hilliard
61c325371b Update vm/src/stdlib/builtins.rs
Co-authored-by: Jeong YunWon <69878+youknowone@users.noreply.github.com>
2021-10-16 21:10:57 +03:00
Jeong YunWon
273193f361 Merge pull request #3306 from youknowone/object-protocol
Object protocol
2021-10-17 03:09:45 +09:00
jfh
2f3f3f8505 Ignore AttributeError for missing __prepare__. 2021-10-16 20:16:33 +03:00
Jim Fasarakis-Hilliard
69f436378d Merge pull request #3322 from deantvv/io-error-builder-doc
update doc for IOErrorBuilder
2021-10-16 19:08:23 +03:00
Jim Fasarakis-Hilliard
dd747a6920 Merge pull request #3320 from DimitrisJim/allow_objects_meta
Allow non-types as metaclass argument.
2021-10-16 19:07:32 +03:00
Dean Li
98007094f6 update doc for IOErrorBuilder 2021-10-16 22:59:25 +08:00
Dean Li
69771724c6 posix: add os.SCHED_* for macos 2021-10-16 22:30:44 +08:00
jfh
d2f0f94dee Allow non-types as metaclass argument. 2021-10-16 15:02:11 +03:00
Jim Fasarakis-Hilliard
f0280dabb8 Merge pull request #3290 from tony-jinwoo-ahn/_range
Modify range in pytype.rs
2021-10-16 13:30:26 +03:00
Tony Jinwoo Ahn
fcf07fcf9f Modify range in pytype.rs
For readability, replace exclusive range with inclusive range.
2021-10-16 18:56:40 +09:00
Jim Fasarakis-Hilliard
45290b1553 Merge pull request #3314 from DimitrisJim/mapping_locals
Allow any mapping for locals.
2021-10-16 12:34:58 +03:00
jfh
94b9163297 Use PyMapping, fix handling of __prepare__. 2021-10-16 09:57:02 +03:00
Steve Shi
723357962a Refactor list avoid duplicate the vec (#3241)
* list count bench
* Refactor list count avoid duplicate the vec
* optimize list count with HEAPTYPE flag
* introduce generic safe iter functions for list
* Refactor list functions (contains, index, remove)
* Refactor list iter functions with const generics
* optimize list with richcompare
* optimize list iter_equal
2021-10-16 13:16:45 +09:00
Jim Fasarakis-Hilliard
3ab48baf10 Merge pull request #3317 from RustPython/fix-doc-links
Fix intra doc links
2021-10-16 06:47:32 +03:00
Noa
a6e2b10296 Fix intra doc links 2021-10-15 14:25:38 -05:00
jfh
dce45825ae Allow any mapping for locals. 2021-10-15 17:34:52 +03:00
Jeong YunWon
8df1c573e5 Merge pull request #3313 from DimitrisJim/mapping_check
Check if subscript is present for PyMapping::check.
2021-10-15 19:43:01 +09:00
Jeong YunWon
79e951b630 Object protocol 2021-10-15 17:54:30 +09:00
Jeong YunWon
42912a36a1 No downcast for unhashable 2021-10-15 16:32:05 +09:00
Jeong YunWon
97623b4e72 Fix __hash__ not to perform unnecessary downcast 2021-10-15 16:32:00 +09:00
jfh
9b63c50446 Check if subscript is present for PyMapping::check. 2021-10-15 09:46:18 +03:00
Jim Fasarakis-Hilliard
4ede6b1510 Merge pull request #3311 from pheki/recursion-limit
Guarantee recursion_depth is never higher than recursion_limit
2021-10-15 09:16:57 +03:00
Aphek
773305022f Guarantee recursion_depth is never higher than recursion_limit 2021-10-15 02:31:07 -03:00
Jeong YunWon
77e33c5338 slot_as_mapping never fails 2021-10-15 05:59:05 +09:00
Jeong YunWon
22b3679529 as_mapping never fails 2021-10-15 05:45:54 +09:00
Jeong Yunwon
0d2e20363a Fix windows build error 2021-10-15 04:47:10 +09:00
Jeong YunWon
8c42d0469c msvcrt uses #[pymodule] 2021-10-15 04:04:16 +09:00
Jeong YunWon
6c318f2de8 Merge pull request #3305 from youknowone/less-pymodule
replace py_module! from errno and sysconfigdata
2021-10-15 04:03:36 +09:00