Noa
e42a3ca48e
Big overhaul part 1 - replace PyRc with manual RefCount + WeakRefList
2021-11-15 16:08:45 -06:00
Jeong YunWon
e7fa32c687
Merge pull request #3402 from Snowapril/refactor_exceptions
...
Refactor duplicated codes in exception creations
2021-11-16 02:45:30 +09:00
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
snowapril
ab1693e131
Replace new_class to new_exception_type
...
Replace `new_class` method call for module-level exceptions to newly
added `new_exception_type`
Signed-off-by: snowapril <sinjihng@gmail.com >
2021-11-12 21:40:26 +09:00
snowapril
fee42a1074
Add docs for each error in ssl module
...
Signed-off-by: snowapril <sinjihng@gmail.com >
2021-11-12 21:40:26 +09:00
snowapril
5e8d3bcacb
Remove duplicated static_cell! stmts in each modules
...
Signed-off-by: snowapril <sinjihng@gmail.com >
2021-11-12 21:40:26 +09:00
David Carlier
d6e89301a5
netbsd/openbsd build fix
2021-11-07 12:48:34 +00:00
David Carlier
cf7b6eeec1
fix freebsd build wrong imports
2021-11-06 11:24:00 +00:00
jfh
05c4fcf934
Allow any object as an argument for random.seed
2021-11-04 18:34:20 +02:00
Daniel Watkins
9dce9bf0b9
correctly set __module__ and __name__ for builtin exceptions
...
In CPython's PyErr_NewException[0], the dotted "module.name" passed in is
split on that dot: the content before the dot is set as __module__ in
the created exception class, and the content after it is set as
__name__.
This commit mirrors that behaviour, by introducing a `module` argument
to `PyContext.new_class`: if Some("module_name") is passed, it will be
set as `__module__`. All exception-creating uses of `new_class` are
updated to pass in their module and class names separately.
[0] https://github.com/python/cpython/blob/main/Python/errors.c#L1082-L1087
2021-11-02 18:28:02 -04:00
Jeong YunWon
93ef12e553
Merge pull request #3401 from coolreader18/stdlib-arrayiter
...
Don't create an intermediate map for rustpython_stdlib::stdlib_inits
2021-11-02 18:12:28 +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
a3723462ce
Don't create an intermediate map for rustpython_stdlib::stdlib_inits
2021-11-01 22:37:32 -05:00
Lee Dogeon
d2a247eeca
Correct typo of types manually created ( #3397 )
...
* Correct typo of types manually created
* Apply `cargo fmt`
2021-11-01 09:32:19 -05:00
David Carlier
f56514d61b
netbsd build fix proposal
2021-10-31 08:41:14 +00:00
Noa
358ce09b5c
Run cargo upgrade
2021-10-30 19:42:35 -05:00
Tetramad
ebd0352cfc
Fix math.log10 to pass some failed tests
...
Now math.log10 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:13 +09:00
Tetramad
2bedba0e12
Fix math.log2 to pass some failed tests
...
Now math.log2 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:13 +09: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
jfh
611e755599
Fix some uncaught clippy warnings.
2021-10-24 12:23:02 +03:00
jfh
a8b00ef2b1
Export RUSAGE_* symbols.
2021-10-22 10:17:28 +03:00
Jeong YunWon
6138cb4476
Merge pull request #3357 from coolreader18/edition2021
...
Migrate to 2021 edition
2021-10-22 08:21:45 +09:00
Noa
53c261a19b
Switch to array.into_iter()
2021-10-21 17:12:37 -05:00
Noa
09e9ea91e7
TryFrom, TryInto, FromIterator are in prelude now
2021-10-21 17:04:19 -05:00
jfh
103195b277
Remove Python gc stub, add rust stub.
2021-10-21 19:56:20 +03:00
Jeong YunWon
f76877347a
Py -> PyObjectView
2021-10-21 18:04:13 +09:00
Jeong YunWon
b759808736
PyObj -> PyObject
2021-10-21 17:55:29 +09:00
Jeong YunWon
d4feb2a6c5
incref -> to_owned
2021-10-21 17:29:34 +09:00
Noa
8dd18d97be
PyObjectRef -> &PyObj, &PyRef<T> -> &Py<T>
2021-10-21 16:49:01 +09:00
Jim Fasarakis-Hilliard
0c07b7cbfc
Merge pull request #3349 from AP2008/relocate-str
...
Relocate `vm.to_str` to `obj.str`
2021-10-20 08:54:24 +03:00
Aratrik
fdd1baec65
Relocate vm.to_str to obj.str
2021-10-20 10:28:24 +05:30
Aratrik
c427462554
Relocate vm.rich_compare to obj.rich_compare
2021-10-20 09:44:41 +05:30
ChJR
6b14756542
Relocate vm.obj_len to obj.length
2021-10-20 02:08:45 +09: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
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
Jeong YunWon
22b3679529
as_mapping never fails
2021-10-15 05:45:54 +09:00
Jeong YunWon
521a50b6a1
clean up Callable
2021-10-14 17:26:04 +09:00
Jeong YunWon
2ac85e55aa
Merge pull request #3292 from youknowone/socket
...
_socket uses `#[pymodule]`
2021-10-14 17:18:24 +09:00
Jeong YunWon
617e524556
clean up windows socket attrs
2021-10-14 16:36:01 +09:00
Jeong YunWon
141ff2bb2f
_socket uses #[pymodule]
2021-10-14 14:11:21 +09:00
Jeong YunWon
8cdde9150e
Rename slot traits to drop Slot prefix
2021-10-14 13:44:22 +09:00
Jeong YunWon
7cae6d24fe
Refactor PyType creation
2021-10-14 13:37:45 +09:00
Jeong YunWon
0820708f0e
_ssl module uses #[pymodule]
2021-10-13 15:31:11 +09:00
Jim Fasarakis-Hilliard
a81f97dd9e
Merge pull request #3280 from DimitrisJim/bad_indexing
...
Fix deadlocks when slicing mutable sequences.
2021-10-13 08:14:41 +03:00
jfh
0539d33ce4
Export saturated index via slicable, use better naming conventions.
2021-10-13 07:05:26 +03:00