Commit Graph

6130 Commits

Author SHA1 Message Date
Jeong YunWon
f737028799 dedent blocks 2022-01-29 11:45:40 +09:00
Moreal
d531e90319 Do not split name if the type is heap type 2022-01-28 23:04:16 +09:00
Moreal
758d52909f Add type.__name__ setter 2022-01-28 23:03:36 +09:00
Jeong YunWon
3328184712 Merge pull request #3508 from youknowone/non-exhaustive
add #[non_exhaustive]
2022-01-22 21:01:14 +09:00
Jeong YunWon
9377134161 add #[non_exhaustive] 2022-01-22 20:22:58 +09:00
Hackerwins
c36c90beab Apply staticmethod to maketrans
https://docs.python.org/3.10/library/stdtypes.html?highlight=maketrans#str.maketrans
2022-01-22 17:32:31 +09:00
Hackerwins
494fc43711 Use staticmethod in macros 2022-01-22 17:32:26 +09:00
Jeong YunWon
e3fb3f1367 Merge pull request #3479 from chrismoradi/fix-abstractmethods
Fix __isabstractmethod__ for class/static methods and properties
2022-01-22 16:50:35 +09:00
Moreal
caf045a62c Merge remote-tracking branch 'upstream/main' into bugfix/genericalias-getitem-method 2022-01-22 10:26:43 +09:00
Padraic Fanning
510a52b59d Fix case where length = 0 2022-01-16 20:24:56 -05:00
Padraic Fanning
f01463fc12 Add proper error message for negative length 2022-01-16 20:24:18 -05:00
Noa
1188369956 Fix clippy warnings with 1.58 & convert some format strings to capture-args 2022-01-13 23:53:25 -06:00
Noa
730fda0f9e Fix doc comment for Interpreter 2022-01-13 23:26:01 -06:00
Moreal
964304e8bd Expose types.GenericAlias.__getitem__ 2021-12-12 13:10:33 +09:00
Jeong YunWon
38513cb468 Merge pull request #3462 from qingshi163/mapping-protocol2
Refactor Mapping Protocol and Item Protocol
2021-12-03 21:18:25 +09:00
Kangzhi Shi
ae538943c0 fix ass_subscript check 2021-12-01 20:40:04 +02:00
Kangzhi Shi
6a996b04c8 move obj downcast to AsMapping 2021-12-01 20:16:18 +02:00
Jeong YunWon
3c5e13f7f1 Merge pull request #3461 from Byeongjee/dict-iterator-reduce
Implement reduce() for dict iterators
2021-11-30 14:34:32 +09:00
snowapril
fdd329ed0a Register True, False, None to builtins
Signed-off-by: snowapril <sinjihng@gmail.com>
2021-11-29 23:35:01 +09:00
Jeong YunWon
32a9b958e5 Merge pull request #3465 from 24seconds/fix_test_base64
Support tuple type also for memoryview shape arg
2021-11-29 16:10:20 +09:00
Jeong YunWon
65d9e2fa86 skip to create list object 2021-11-29 15:05:19 +09:00
Chris Moradi
5fef0267af Fix clippy issue 2021-11-28 15:43:50 -08:00
Chris Moradi
4409460cb3 Fix __isabstractmethod__ for class/static methods and properties
Includes a minor departure from CPython implementation of inspect.isabstract
because TPFLAGS_IS_ABSTRACT is not set in obj.__flags__.
2021-11-28 15:02:44 -08:00
Jeong YunWon
4f2d70f915 Merge pull request #3475 from hrchu/pep604
Allow writing union types as X | Y
2021-11-29 03:10:01 +09:00
hrchu
b0dabd6087 Allow writing union types as X | Y 2021-11-28 19:42:33 +08:00
Kangzhi Shi
06fbba6589 clearup 2021-11-28 12:48:19 +02:00
Young
fe26754ad1 Refactor code using Either type 2021-11-28 18:37:36 +09:00
24seconds
290f91cd5e Use Either type for OptionalArg in CastArgs
Co-authored-by: Jeong YunWon <69878+youknowone@users.noreply.github.com>
2021-11-28 18:25:44 +09:00
Kangzhi Shi
e06afd2cc0 fix windows fail, hope so 2021-11-28 11:22:14 +02:00
Kangzhi Shi
296afbc315 fix #3468 SaturatedSliceIter overflow 2021-11-28 11:15:49 +02:00
Byeongjee Kang
91489352c5 Implement reduce() for dict iterators
This fixes test_iter_dict, test_iterator_pickling, test_itemiterator_pickling,
and test_valuesiterator_pickling.
2021-11-27 23:57:39 +09:00
Young
dd773b3413 Support tuple type also for memoryview shape arg 2021-11-27 23:39:01 +09:00
Kangzhi Shi
e93f98c52e fix windows compile 2021-11-27 15:02:41 +02:00
Kangzhi Shi
fdd82fac78 fixup 2021-11-27 14:09:43 +02:00
Kangzhi Shi
9a2eef6fab fix compile 2021-11-27 13:49:05 +02:00
Kangzhi Shi
ca4e8f50e8 refactor ItemProtocol -> Object Protocol 2021-11-27 13:00:37 +02:00
Narawit Rakket
cf7c8154bf Fix maketrans not thrown ValueError when length of the arguments are not the same 2021-11-27 12:12:18 +07:00
Kangzhi Shi
0f3569a1b1 refactor mapping protocol 2021-11-23 20:22:01 +02:00
Chris Moradi
a685b236f9 Merge branch 'main' of github.com:chrismoradi/RustPython into unimplemented-abstract-methods-raise-error 2021-11-22 14:58:17 -08:00
Steve Shi
908b239572 Refactor and new sequence traits, generic sequence operation (#3445)
* refactor sequence generic mutable sequence item equal op

* sequence generic for pydeque

* replace usize::MAX with Optioned

* sequence op for array

* fix overflow error instead memory error for  index overflow

* fixup

* optimize reserve vec for imul
2021-11-22 09:21:23 +02:00
Noa
a53451bd10 Merge pull request #3386 from coolreader18/no-arc
Big overhaul part 1 - replace PyRc with manual RefCount + WeakRefList
2021-11-21 17:43:50 -06:00
Jeong YunWon
b8624c617b Merge pull request #3454 from YYun-D/doc_modify
Fix `bytearray` and `bytes` docs
2021-11-21 13:58:34 +09:00
YYun-D
7de142fcd1 remove bytearray and byte docs
Signed-off-by: YYun-D <yeo1998@naver.com>
2021-11-21 12:37:01 +09:00
Jeong YunWon
7305be893a Merge pull request #3451 from waroad/enumerate_add_reduce
add reduce in enumerate
2021-11-21 09:42:34 +09:00
waroad
51e1d7607c add reduce in enumerate 2021-11-20 20:56:26 +09:00
yyun-d
fd3a0f6d86 implement reduce method to PySlice
Signed-off-by: yyun-d <yeo1998@naver.com>
2021-11-20 18:59:18 +09:00
BongYang
7b79c09c3c pystr.rs isdecimal() checks not only ASCII but also Unicode decimals 2021-11-20 16:08:27 +09:00
rvsampson94
0fe8a06d65 Dict keys isdisjoint 2021-11-20 12:30:22 +09:00
Noa
790090df62 Apply review comments 2021-11-18 12:33:44 -06:00
Noa
af7ec416f9 Prevent edge case race condition, hopefully 2021-11-15 16:08:47 -06:00