Commit Graph

1395 Commits

Author SHA1 Message Date
Jeong YunWon
16c3c78b69 introduce and adapt vm.identical_or_equal to test is or else __eq__ 2019-10-12 17:53:26 +09:00
coolreader18
6d681a4d59 Implement object.__reduce__ 2019-10-11 15:48:56 -05:00
Windel Bouwman
e5c92d6fa2 Merge pull request #1496 from rls1004/issue1404
Implement delattr for type object
2019-10-11 17:44:46 +02:00
Windel Bouwman
8462e7bc2d Merge pull request #1506 from youknowone/refactoring
Refactor function signatures
2019-10-11 17:35:24 +02:00
Noah
53fe356cd5 Merge pull request #1511 from youknowone/pyresult
Result<T, PyObjectRef> -> PyResult<T>
2019-10-11 08:36:25 -05:00
Jeong YunWon
cb2a994b46 Result<T, PyObjectRef> -> PyResult<T> 2019-10-11 18:09:55 +09:00
HyeockJinKim
43a7245045 locals() return copy of locals dictionary
Return copy of locals so that local variables
does not change even if locals() values is changed

Fixes #1356
2019-10-11 04:35:43 +09:00
Jeong YunWon
6c0f852b62 Refactor pymethod return types to be smaller as possible 2019-10-11 03:27:23 +09:00
Jeong YunWon
1fc5dcb5bf Result<T, PyObjectRef> -> PyResult<T> 2019-10-11 02:59:47 +09:00
MinJeong Kim
37a3b2c8f0 Implement delattr for type object
Fixed: #1404
2019-10-10 04:24:55 +00:00
Jeong YunWon
b769675c74 Merge pull request #1500 from youknowone/refactor-seq-cmp
Refactor sequence item comparison
2019-10-10 11:25:34 +09:00
Jeong YunWon
2fac9bad71 Refactor sequence item comparison 2019-10-10 10:52:19 +09:00
HyeockJinKim
37e85df527 Add __ne__ for float
Issue #1442
2019-10-10 03:49:13 +09:00
HyeockJinKim
100416f4f2 Add __eq__, __ne__ of none
Issue #1442
2019-10-10 03:49:09 +09:00
HyeockJinKim
1e8ade7098 Fixed __eq__ and add __ne__ of range
change return type of __eq__ to PyResult
and add __ne__

Issue #1442
2019-10-10 03:49:05 +09:00
Windel Bouwman
dccc22dbb9 Merge pull request #1493 from HyeockJinKim/issue1490
Fixed to return the mro function
2019-10-08 21:16:33 +02:00
HyeockJinKim
75eff109ba Fixed to return the mro function
Fixed to return the mro function
to include its own class

Fixes #1490
2019-10-09 01:22:12 +09:00
HyeockJinKim
f43ae4424e Change return type of length to BigInt
Change the return type of length to BigInt
since most of the length's values are used as_bigint
2019-10-08 01:48:14 +09:00
HyeockJinKim
6499dbbfc5 Fixed __hash__ of range
Calculate hash value of range through hash of tuple

Fixes #1482
2019-10-07 19:00:52 +09:00
Windel Bouwman
26073152cd Merge pull request #1486 from HyeockJinKim/ref
extend_class for PyTuple
2019-10-07 09:15:34 +02:00
HyeockJinKim
b2c19a964b extend_class for PyTuple 2019-10-07 15:38:02 +09:00
Noah
ae4b68f5ba Merge pull request #1438 from lntuition/fix-byte-like-object
Add logic to check array.array byte like object
2019-10-06 20:33:02 -05:00
Windel Bouwman
09871c03a4 Merge pull request #1467 from youknowone/pow-negative-exp
Fix pow(0, exp) with negative exp to raise ZeroDivisionError
2019-10-06 14:07:54 +02:00
Windel Bouwman
b8582ae7f1 Merge pull request #1484 from lazylife7157/memoryview_construct
Fix #1003 Construct memoryview from bytes-like obejcts
2019-10-06 14:05:27 +02:00
lazylife7157
725d153937 Add type constraints to memoryview constructor 2019-10-07 02:27:12 +09:00
Jeong YunWon
f221a698eb Merge pull request #1480 from HyeockJinKim/slice_hash
Add __hash__ of slice
2019-10-06 17:28:42 +09:00
Jeong YunWon
79e3700477 Merge pull request #1479 from HyeockJinKim/issue1475
Fixed list's __iadd__
2019-10-06 15:46:15 +09:00
HyeockJinKim
96c93c4a21 Add __hash__ of slice
When hashing slice, raise TypeError

Issue #1431
2019-10-06 15:28:36 +09:00
Jeong YunWon
84f08c85d9 Merge pull request #1470 from makarchuk/string.__repr__
cpython compatible "".__repr__
2019-10-06 14:32:06 +09:00
Jeong YunWon
98abc916ce Merge pull request #1473 from HyeockJinKim/slice_compare
Add comparison of slice
2019-10-06 14:31:27 +09:00
HyeockJinKim
4468c81bc1 Fixed list's __iadd__
When list iadd iterable value,
run iterator and add values to the list

Fixes #1475
2019-10-06 14:11:52 +09:00
Timur Makarchuk
027a25c123 Merge branch 'master' into string.__repr__ 2019-10-05 22:14:34 +03:00
Timur Makarchuk
4b962b89d7 Implement some __ne__ methods (#1446)
* Implement some __ne__ methods

Added test snippets from `__ne__` methods

* Fix incompatability in str.__eq__ befaviour

Previously "".__eq__(1) returned "False", which is not the case in
cpython.
Not it's returning 'NotImplemented', as it should
2019-10-06 00:50:02 +09:00
HyeockJinKim
67bc687b31 Add comparison of slice
Add gt, ge, lt, le for slice

Issue #1431
2019-10-05 17:34:08 +09:00
Jeong YunWon
0ac9cb861c Merge pull request #1468 from dralley/new-style
Adopt new style for several more object impls
2019-10-05 16:33:38 +09:00
Jeong YunWon
9b78e9fa03 Merge pull request #1452 from HyeockJinKim/issue1450
Fix sequence comparison
2019-10-05 16:18:31 +09:00
Timur
70fb3f69ef cpython compatible "".__repr__
Fixes #1390
2019-10-05 01:17:17 +03:00
Noah
311b53d275 Merge pull request #1461 from dralley/cleanup-zip
Use new style for PyZip impl
2019-10-04 14:14:45 -05:00
Daniel Alley
c254c7eec1 Adopt new style for several more object impls 2019-10-04 13:53:06 -04:00
Daniel Alley
a6fcc664bd Use new style for PyZip impl 2019-10-04 13:35:36 -04:00
Jeong YunWon
2153ebbc23 Fix pow(0, exp) with negative exp to raise ZeroDivisionError 2019-10-05 00:04:31 +09:00
lntuition
c1d7723b52 Add logic to check array.array byte like object
Add byte like list check function to objlist
And check byte like object in objbyteinner
After apply this patch, We can handle array.array byte like object

Fixed: #1437
2019-10-04 22:04:25 +09:00
Daniel Alley
fb04771cad Use new style for PyStaticMethod impl 2019-10-04 08:19:55 -04:00
HyeockJinKim
edf44a2b5d Fix sequence comparison
Fixed gt, lt comparison of sequence. Also, the values of
le and ge are calculated using the not operation of gt and lt

Fixes #1450
2019-10-04 20:39:34 +09:00
lazylife7157
c3af2bb858 Make memoryview.__hash__() returns hash value of wrapped object 2019-10-05 01:41:49 +09:00
Noah
9c4c39aef2 Merge pull request #1456 from RustPython/revert-1444-fix-int-arg
Revert "Fix argument keyword error in int/float/bool.__new__"
2019-10-03 15:18:32 -05:00
Windel Bouwman
699450ddd7 Merge pull request #1447 from RustPython/coolreader18/type-attrs
Fix properties on `type`
2019-10-03 20:10:25 +02:00
coolreader18
936119073b Add tests for type.__bases__, fix type.__bases__ 2019-10-03 09:46:57 -05:00
Noah
9ed825742c Revert " Fix argument keyword error in int/float/bool.__new__" 2019-10-02 21:33:43 -05:00
coolreader18
7e7a20a653 Fix PyNamespace constructor 2019-10-02 20:32:41 -05:00