Commit Graph
7187 Commits
Author SHA1 Message Date
discord9 94bdb6b97a feature: PyTraverse derive macro for traverse object's childrens(like CPython's tp_traverse) (#4872) 2023-04-23 21:43:49 +09:00
Jeong YunWon e18dda3e08 Buffer arguments as PyObject 2023-04-23 10:57:24 +09:00
Ankit Kumar Pandey f0db8329be rename os module's exit function to _exit as thats how it is defined in cpython (#4887) 2023-04-22 05:22:18 +09:00
Jeong, YunWon 968f2ad7c9 Merge pull request #4849 from haxelion/feature/tp_repr_stdlib
Implemented tp_repr slots for more types
2023-04-20 21:02:55 +09:00
Jeong YunWon 89e3587c15 Simplify repr implementation a bit 2023-04-20 16:58:29 +09:00
Jeong, YunWon 446285f348 Merge pull request #4892 from Masorubka1/test_property.py
Update test_property.py from Cpython v3.11.2
2023-04-20 16:12:12 +09:00
Jeong YunWon c3d9a51d15 Update last fallback property error messages 2023-04-20 15:32:50 +09:00
Jeong YunWon a4a6e8dabe Fix trivial suggestions 2023-04-19 22:18:19 +09:00
snowapril 4416b2a467 Refactor PyNumber methods based on review suggestions
Signed-off-by: snowapril <sinjihng@gmail.com>
2023-04-19 22:18:19 +09:00
snowapril c69ff172e5 Replace PyInquiryFunc to PyUnaryFunc<bool>
Signed-off-by: snowapril <sinjihng@gmail.com>
2023-04-19 22:18:19 +09:00
snowapril 9c38e904dd Fix vm.ctx.none.as_obejct not to make clone
Signed-off-by: snowapril <sinjihng@gmail.com>
2023-04-19 22:18:19 +09:00
snowapril 9f28643ac7 Fix inplace_power in number slots
Signed-off-by: snowapril <sinjihng@gmail.com>
2023-04-19 22:18:19 +09:00
snowapril 9135d29346 Replace non-implemented type conversions in each PyNumber_Int, PyNumber_Index, PyNumber_Float
Signed-off-by: snowapril <sinjihng@gmail.com>
2023-04-19 22:18:19 +09:00
snowapril 96af524aad Fix PyInt PyNubmerMethods pow
Signed-off-by: snowapril <sinjihng@gmail.com>
2023-04-19 22:18:19 +09:00
snowapril 3a9a1c93dd Fix cargo formatting
Signed-off-by: snowapril <sinjihng@gmail.com>
2023-04-19 22:18:19 +09:00
snowapril b0618b9c9a Modify inplace binop instruction to use inplace_power_no_mod
Signed-off-by: snowapril <sinjihng@gmail.com>
2023-04-19 22:18:19 +09:00
snowapril c789490294 Fix each type's unary & ternary fields in PyNumberMethods def
Signed-off-by: snowapril <sinjihng@gmail.com>
2023-04-19 22:18:19 +09:00
snowapril bf2fbfc52d Modify boolean field as PyNumberInquiryFunc
Signed-off-by: snowapril <sinjihng@gmail.com>
2023-04-19 22:18:19 +09:00
snowapril 3613edf321 Fix unary function to take PyNumber
Signed-off-by: snowapril <sinjihng@gmail.com>
2023-04-19 22:18:19 +09:00
snowapril b06c0f8ff9 Modify original vm._pow usage
Signed-off-by: snowapril <sinjihng@gmail.com>
2023-04-19 22:18:19 +09:00
snowapril 05900fbabf Fix power, inplace_power as ternary function
Signed-off-by: snowapril <sinjihng@gmail.com>
2023-04-19 22:18:19 +09:00
snowapril 51ae26128b Modify unary functions in number protocol
Signed-off-by: snowapril <sinjihng@gmail.com>
2023-04-19 22:18:19 +09:00
Faisal Alatawi 5f17d281a6 Convert Context::empty_str to &'static PyStrInterned (#4882)
The goal of this commit is to convert Context::empty_str to &'static PyStrInterned and to fix issue #4869
2023-04-17 20:55:24 +09:00
Ankit Kumar Pandey cb6cf107ba handle panic if str is not defined in unraisablehook (#4864) 2023-04-15 23:47:19 +09:00
Jeong YunWon c3491ebdc3 DescrObject::name to PyStrInterned 2023-04-10 09:53:54 +09:00
Jeong YunWon 798b3bc158 expose slot_new_wrapper as its base type 2023-04-06 01:52:01 +09:00
Jeong YunWon 18044abbb6 use interned str for builtin function names 2023-04-06 01:23:36 +09:00
Charles Hubain 96a949189d Implemented tp_repr slots for more types 2023-04-06 00:42:01 +09:00
fanninpm d8879486bd Merge pull request #4782 from youknowone/bytes-as-osstr
relocate FsPath from stdlib::os and rename PyPathLike to OsPath
2023-03-30 15:30:14 +00:00
Jeong YunWon 69280ee64f OsPath internal to OsString 2023-03-28 18:21:53 +09:00
MegasKomnenos 7e6c33152e Add encoding='locale' support for TextIOWrapper 2023-03-28 17:36:48 +09:00
MegasKomnenos e48ca2892b Add utf8_mode field to Settings and make Flags to reference it for init
I also changed the type from u8 to bool. No difference functionality-wise.
2023-03-28 17:35:32 +09:00
Jeong YunWon 5d6ce6c986 OsPathOrFd calls __index__ 2023-03-28 17:01:18 +09:00
Jeong YunWon 7b08953c18 rename PyPathLike -> OsPath becasue it is not a python object 2023-03-28 17:01:18 +09:00
Jeong YunWon 3d1a74dda9 os::ffi_ext -> common::os::ffi 2023-03-28 17:01:18 +09:00
Jeong YunWon 877ba28d85 relocate FsPath -> vm::function::FsPath 2023-03-28 17:01:18 +09:00
Jeong YunWon f68a80879e relocate bytes_as_osstr to common 2023-03-28 12:37:11 +09:00
fanninpm 010640ccc8 Merge pull request #4732 from youknowone/into-exact-or
Fix str.__str__ and PyRef::into_exact_or for int() or str() pattern
2023-03-27 18:42:44 +00:00
Jeong, YunWon bdf5434d7b Merge pull request #4772 from Brain-organizer/testreplacemodify
update string_tests and solve failing test
2023-03-27 20:01:56 +09:00
Jaeyoung Ahn 096a3dc645 Fix builtins (has,get,set)attr type error messages (#4776) 2023-03-27 15:22:11 +09:00
Jeong, YunWon 11aefa3e42 Merge pull request #4735 from youknowone/try_from_borrowed_object
apply TryFromBorrowed more
2023-03-27 15:11:57 +09:00
Yongjin f7eb51204a Returns new string when (str|bytes).replace get empty original string 2023-03-27 15:05:45 +09:00
MegasKomnenos 1795740517 Allow try_update_quantity_from_tuple to set left alignment when needed (#4766) 2023-03-26 21:01:44 +09:00
Jeong, YunWon 4783df5737 Merge pull request #4767 from jyj0816/weakref
Add Hash and Iter of WeakProxy.rs for test\testWeakref.py
2023-03-26 14:34:35 +09:00
jyj afffb13902 Add Hash of WeakProxy for test\test_Weakref.py's "test_proxy_hash "
Fix Hash of WeakProxy : remove "?" ending of the code

Fix weakproxy.rs for test_proxy_hash to solve error
2023-03-26 12:12:38 +09:00
jyj 95f3c0d69d Add Iter of WeakProxy for test\test_weakref.py's "test_proxy_next" 2023-03-26 11:32:36 +09:00
MegasKomnenos 439b44ee93 Add default parameters to to_bytes based on v3.11 standard 2023-03-26 11:29:43 +09:00
MegasKomnenos 887ffd1116 Fix issue with cformat converting bytes to string for bytesinner (#4760) 2023-03-25 19:58:09 +09:00
JaeyoungAhn 057d6aa497 Fix tuple comparison to use eq for leading elements 2023-03-25 19:45:55 +09:00
jyj 286810d25b Fix byteorder parameter of int.from_bytes to optional 2023-03-25 17:05:35 +09:00