Steve Shi
742ea0c4fa
Reimpl Buffer Protocol and memoryview support ndarray with shape, stride and suboffset ( #3340 )
...
* Fix buffer protocol and memoryview
* Fix io and array the right way to use buffer protocol
* fix rebase
* fix memoryview and introduce VecBuffer
* fix deadlock
* fix memoryview avoid double release buffer
* impl ndim buffer support
* first implement nd array for buffer and memoryview
* fix slice adjust_indices
* fix adjust_indices introduct SaturatedSliceIterator
* fix memoryview cmp
* fix adjust_indices positive_order
* fix bug mark passed test
* fix clippy
* fix set_item_slice deadlock, optimize buffer
* Delete @test_113974_tmp
* Remove vec_buffer_type
* rusty names
* impl memoryview multi index
* add comments
Co-authored-by: Jeong YunWon <jeong@youknowone.org >
2021-11-13 07:17:11 +02:00
joohongpark
5ceb2be86e
fixed set.{__ror__, __sub__} operator to behave according to type
2021-11-11 16:11:48 +09:00
Dean Li
bfe10aa448
test: update test_posix.py
2021-11-06 21:04:14 +08:00
Dean Li
de4c0363bd
test: update support.wait_process from py3.10
2021-11-06 21:04:13 +08:00
Jim Fasarakis-Hilliard
625886f339
Merge pull request #3420 from zetwhite/pos_only_arg
...
fix error message for checking number of positional arguments
2021-11-06 12:10:57 +02:00
zetwhite
0523a57195
fix error message for checking number of positional arguments
2021-11-06 17:00:20 +09:00
Dean Li
04821ce730
os: fix posix_spawn exception
2021-11-06 14:40:54 +08:00
Jeong YunWon
976ed1d5eb
Merge pull request #3412 from DimitrisJim/random_seed
...
Allow any object as an argument for random.seed
2021-11-06 14:24:22 +09:00
Jim Fasarakis-Hilliard
2c2656dc7a
Raise value error on large precision values for float, int __format__ ( #3415 )
2021-11-05 21:15:49 +02:00
Daniel Watkins
14b4f0092f
cformat.rs: fix remaining test_format.test_common_format failures ( #3405 )
...
* cformat.rs: refactor fill_string to take fill_with_precision
This allows it to be used with both self.min_field_width and
self.precision, which is necessary for padding out %ds with precision.
* cformat.rs: zero-pad %d entries using precision
This matches CPython's behaviour.
* cformat.rs: don't left-adjust when filling with precision
That will always be prepending 0s to %d arguments, the LEFT_ADJUST flag
will be used by a later call to `fill_string` with the 0-filled string
as the `string` param.
* floats: handle alternate form of general formatting
* cformat.rs: convert width/precision to i32
In CPython, width can be isize but precision can only be i32. Our
implementation currently assumes the same type for both: as CPython's
tests assert on overflows for precision, but not for width, we use that
size for both.
* test_format: run test_common_format
Except for the line which raises an OverflowError in CPython, because
overflows in Rust (and therefore RustPython) abort the process
immediately.
* test_types: don't expect test_float_to_string to fail
Its string formatting usage now works as expected.
2021-11-05 12:06:58 +02:00
jfh
05c4fcf934
Allow any object as an argument for random.seed
2021-11-04 18:34:20 +02:00
jfh
aa00fe9c64
Mark failing tests in test_random.
2021-11-04 15:12:32 +02:00
jfh
950a2cfad3
Add test_random from CPython 3.8.
2021-11-04 14:56:09 +02:00
Jim Fasarakis-Hilliard
b69cfafad8
Merge pull request #3398 from deantvv/os-error-str-2
...
os: implement os-error-str according to CPython
2021-11-03 16:53:49 +02:00
Dean Li
db212d80ff
os: implement os-error-str according to CPython
...
As was: "FileNotFoundError: [Errno 2] No such file or directory (os
error 2)"
To be: "FileNotFoundError: [Errno 2] No such file or directory (os
error 2): 'filename' -> 'filename2'"
Reference CPython implementation
```
if (self->filename) {
if (self->filename2) {
return PyUnicode_FromFormat("[Errno %S] %S: %R -> %R",
OR_NONE(self->myerrno),
OR_NONE(self->strerror),
self->filename,
self->filename2);
} else {
return PyUnicode_FromFormat("[Errno %S] %S: %R",
OR_NONE(self->myerrno),
OR_NONE(self->strerror),
self->filename);
}
}
if (self->myerrno && self->strerror)
return PyUnicode_FromFormat("[Errno %S] %S",
self->myerrno, self->strerror);
```
2021-11-03 17:30:28 +08:00
Jim Fasarakis-Hilliard
612e943c6c
Merge pull request #3394 from Snowapril/fix-ga-param-chaining
...
Fix `GenericAlias` parameter chaining
2021-11-02 23:37:38 +02:00
Jeong YunWon
d78347e7ea
Merge pull request #3390 from OddBloke/oddbloke/format
...
cformat.rs: fixes to get two test_format.py tests passing
2021-11-02 18:10:08 +09:00
Jeong YunWon
1092f94a75
Merge pull request #3377 from fanninpm/fix-test-posixpath
...
Fix error and unexpected success in test_posixpath
2021-11-02 18:05:52 +09:00
Jeong YunWon
7b99d13f60
Merge pull request #3050 from RustPython/upd-deps
...
Run cargo update + upgrade
2021-11-02 17:58:02 +09:00
Noa
5b780e70e6
Skip panicking test
2021-11-01 20:43:46 -05:00
Daniel Watkins
c5eba15370
test_format: run test_bytes_and_bytearray_format
...
All the errors have now been addressed.
2021-11-01 21:34:51 -04:00
Daniel Watkins
380653b6cb
cformat.rs: implement %a correctly, using builtins::ascii
...
The repr() of Unicode strings is the Unicode string, so the previous
code was incorrect for that case (at least).
2021-11-01 21:34:51 -04:00
Padraic Fanning
1c6851a631
Skip entire test case
2021-11-01 19:40:19 -04:00
snowapril
e2142e1d07
Remove skip decorator on window test
...
Signed-off-by: snowapril <sinjihng@gmail.com >
2021-11-01 15:20:55 +09:00
Daniel Watkins
156cf6bc86
stdlib/posix.rs: implement mknod
2021-10-31 09:04:56 -04:00
snowapril
73ccb565d0
remove decorators on success tests
...
Signed-off-by: snowapril <sinjihng@gmail.com >
2021-10-31 20:02:10 +09:00
Noa
588247c4a0
Unskip tests
2021-10-30 19:42:35 -05:00
Jeong YunWon
859744236e
Merge pull request #3391 from deantvv/os-error-refactor
...
Refactor OSError
2021-10-30 22:40:10 +09:00
Dean Li
a59556ad25
Refactor OSError
...
Implement `raw_os_error_to_exc_type` to reduce duplication of errno to
exception type.
2021-10-30 17:05:54 +08:00
Jeong YunWon
2ac05aba66
Merge pull request #3381 from DimitrisJim/time_mod
...
Time mod additions
2021-10-30 15:42:10 +09:00
Daniel Watkins
1ea93a59d5
stdlib/io.rs: align negative-fd-from-opener exception with CPython
2021-10-28 15:05:55 -04:00
jfh
c6ac24c2f2
Clean up cfgs, handle 32bit timespec creation, skip tests for windows.
2021-10-28 21:42:40 +03:00
Jeong YunWon
35e56efa65
Merge pull request #3366 from zetwhite/dict_richcmp
...
Implements Comparable for PyDictKeys, PyDictItems
2021-10-28 00:41:14 +09:00
jfh
ee77f3c332
Add monotonic_ns, perf_counter, perf_counter_ns.
2021-10-27 11:54:58 +03:00
jfh
1817fd6565
Add get_clock_info.
2021-10-27 10:36:10 +03:00
Jeong YunWon
281e2ee4db
Merge pull request #3378 from chrismoradi/update-collections-and-tests-from-cpython
...
Update collections from CPython, fix tests for UserDict/List/String
2021-10-27 02:35:06 +09:00
jfh
cab44a2ac3
Add clock_gettime, clock_settime, clock_getres.
2021-10-26 20:06:09 +03:00
Chris Moradi
6abfc3a00c
Revert UserDict.__init__ changes, new passing test of UserList
2021-10-25 22:41:59 -07:00
Chris Moradi
ec247e0d4f
Update collections from CPython, fix tests for UserDict/List/String
...
Clean implementation of changes in PR #3371 based on feedback.
Copies from [CPython tag `v3.9.7` and adds back custom RustPython changes where needed for:
- `Lib/collections/__init__.py`
- `Lib/test/test_collections.py`
Closes : #3371
2021-10-25 21:19:44 -07:00
Dean Li
6ec380369a
os: fix test_putenv for all os
2021-10-25 19:40:32 +08:00
Tetramad
c88c69a993
Fix math.log1p to pass some failed tests
...
Now math.log1p with less than or equal to negative one should raise
ValueError with "math domain error" message
2021-10-25 14:44:13 +09:00
Tetramad
3d8f6cf08d
Fix math.log to pass some failed tests
...
Now math.log with less than or equal to zero should raise ValueError
with "math domain error" message if `x` fit in f64
2021-10-25 14:44:08 +09:00
Tetramad
ba3cafc932
Fix math.atanh to pass failed tests
...
Now math.atanh with out of domain value should raise ValueError with
"math domain error" message
2021-10-25 10:45:11 +09:00
Jeong YunWon
b0795e89f7
Merge pull request #3370 from deantvv/test-posix-reason
...
test: posix update failure reason
2021-10-24 19:53:38 +09:00
Dean Li
46c38c09d2
test: posix update failure reason
2021-10-24 18:05:19 +08:00
Dean Li
91256a4ec6
posix: add rtld constants
2021-10-24 17:53:49 +08:00
zetwhite
a401d8c190
make work dictview compare test
2021-10-24 16:54:33 +09:00
Padraic Fanning
9fdd76c1dd
Delete partial causing custom runner failure
2021-10-22 18:16:47 -04:00
Jim Fasarakis-Hilliard
7d1f75dd2f
Merge pull request #3351 from Snowapril/fix-generic-alias
...
Add missing methods on `GenericAlias`
2021-10-22 16:32:18 +03:00
snowapril
92b81e5dd8
update some test in test_typing from cpython 3.10
...
Signed-off-by: snowapril <sinjihng@gmail.com >
2021-10-22 18:43:15 +09:00