Commit Graph

1560 Commits

Author SHA1 Message Date
Jeong YunWon
0b9bee9973 use Vec::with_capaciity for bytes methods 2020-01-13 11:20:42 +09:00
Jeong YunWon
eb4904b4ae cleanup bytes with Into<Vec<u8>> 2020-01-13 11:20:42 +09:00
Jeong YunWon
a11ccc462a refactor byteinner cmp 2020-01-13 11:20:42 +09:00
Jeong YunWon
1077744ed2 cleanup memoryview 2020-01-13 11:20:42 +09:00
Jeong YunWon
36ebb048ef cleanup bytes 2020-01-13 11:20:42 +09:00
Jeong YunWon
c6e148efcf cleanup bytearray 2020-01-13 11:20:42 +09:00
Jeong YunWon
b74d5e01ee Add PyBuiltinMethod 2020-01-12 18:39:48 +09:00
Jeong YunWon
70b63eb758 new_rustfunc -> new_function & new_method to distinguish bindable functions 2020-01-12 18:39:16 +09:00
Jeong YunWon
78b268ae0b Remove unbound methods from modules 2020-01-12 18:34:44 +09:00
Jeong YunWon
5c87571863 Remove public field from PyBuiltinFunction 2020-01-12 18:34:44 +09:00
Jeong YunWon
24289964d3 Merge pull request #1649 from youknowone/func-vm
Allow to skip VM param for IntoPyNativeFunc functions
2020-01-12 18:24:01 +09:00
coolreader18
8f036b3269 quickfix Lib/test list test_extend 2020-01-12 00:06:51 -06:00
Noah
bb456963e4 Merge pull request #1668 from RustPython/coolreader18/exc-ser
Make PyBaseExceptionRef serializable and use it to improve WASM errors
2020-01-11 17:14:43 -06:00
coolreader18
a26e5f23f8 Add dict iterator __length_hint__ 2020-01-10 18:24:23 +00:00
coolreader18
098393d4d6 Add __length_hint__ to a bunch of iterators 2020-01-10 18:24:23 +00:00
coolreader18
fc3ac169d0 Add length_hint functionality 2020-01-10 18:24:22 +00:00
coolreader18
6b537f15e5 Add objsequence::{opt_,}len 2020-01-10 18:24:22 +00:00
Aviv Palivoda
abedbfdce8 Merge pull request #1660 from palaviv/run-unittests
Run Cpython tests suite in travis CI
2020-01-10 17:19:38 +02:00
Noah
156e6e1555 Merge pull request #1654 from youknowone/clone-value
objstr::get_value -> objstr::clone_value
2020-01-08 18:24:38 -06:00
coolreader18
d3b2fa6e02 Allow serializing PyBaseExceptionRef 2020-01-08 17:42:38 -06:00
Jeong YunWon
5e2035f979 remove unnessessary pub 2020-01-08 11:04:17 +09:00
Jeong YunWon
5a3937fd15 Refactor deque and fix comparison bug 2020-01-08 02:20:41 +09:00
Jeong YunWon
db67018dec PyList::cmp 2020-01-08 01:36:23 +09:00
Jeong YunWon
226ebfa0c6 vm::sequence for SimpleSeq utilities 2020-01-07 22:24:05 +09:00
Jeong YunWon
18fcd99584 SimpleSeq for PyDeque 2020-01-07 22:11:26 +09:00
Jeong YunWon
12725a308e PyList::borrow_sequence to borrow SimpleSeq 2020-01-07 22:00:21 +09:00
Jeong YunWon
0e583b2829 Refactor PyList to have elements as private field 2020-01-07 20:42:25 +09:00
Jeong YunWon
0aca07a8cb rustpython_vm::sequence & PySequenceContainer 2020-01-06 02:34:56 +09:00
Jeong YunWon
50ff5e89f9 sequence comparison uses impl SimpleSeq rather than dyn SimpleSeq 2020-01-06 02:34:56 +09:00
Jeong YunWon
6f313c191e Refactor tuple comparison operators 2020-01-06 02:34:56 +09:00
Jeong YunWon
9f4f8ad0ec PyTuple::elements into private 2020-01-06 02:34:56 +09:00
Jeong YunWon
22b1692f21 Merge pull request #1642 from youknowone/pyreturn
Suggestion: PyReturn to keep result type when it can be a special type like NotImplemented
2020-01-06 01:13:31 +09:00
coolreader18
98211a34de Try to cut down on the # of unicode crates we use 2020-01-05 00:19:56 -06:00
Jeong YunWon
6bba9ff446 PyComparisonValue 2020-01-05 03:01:06 +09:00
Jeong YunWon
b1e582e138 Adapt PyReturn to PyFloat 2020-01-05 03:00:29 +09:00
Jeong YunWon
44bd0b6d63 introduce PyArithmaticValue 2020-01-05 03:00:29 +09:00
Aviv Palivoda
857c5e3ba1 Add stub frame.clear 2020-01-04 16:30:02 +02:00
Abe
765089d560 Add support for the % format code for floats.
Contributes to #1656
2020-01-03 16:14:24 -07:00
Jeong YunWon
92ba35d1b1 Allow to skip VM param for IntoPyNativeFunc functions 2020-01-03 02:18:56 +09:00
Jeong YunWon
13914e0739 objstr::get_value -> objstr::clone_value
because the previous naming gives unclear performance estimation to
users especially comparing to objstr::borrow_value
2020-01-02 20:51:10 +09:00
Abe
30473d3058 Add support for string formatting of floats with ":f" format code
Also adds automatic conversion of int -> float when the ":f"
format code is specified.

Fixes a f-string formatting style regression introduced in #1625.
2019-12-31 18:52:46 -07:00
Noah
deee1f7df7 Merge pull request #1644 from RustPython/coolreader18/exc-cleanup
Use PyBaseExceptionRef in places where we expect exceptions
2019-12-29 17:17:26 -05:00
Noah
bd13671eee Merge pull request #1641 from youknowone/refactor-float
Refactor float, complex cmp/op , str, None
2019-12-28 21:07:33 -05:00
coolreader18
777542f7ec Directly instantiate exceptions in the vm.new_*_error functions 2019-12-28 01:31:24 -06:00
coolreader18
ec3e402970 Move and improve normalize_exception 2019-12-27 22:13:23 -06:00
Noah
420f5c3490 Add vm.normalize_exception() 2019-12-27 11:22:53 -06:00
Noah
97c8d11092 Make PyResult<T> = Result<T, PyBaseExceptionRef> 2019-12-27 11:22:52 -06:00
Noah
cd726a2818 Cleanup exceptions a bit 2019-12-27 11:17:26 -06:00
Jeong YunWon
a54c98de3f property setter return PyResult<()> instead of PyResult 2019-12-27 02:09:58 +09:00
Jeong YunWon
278f0fffca Allow empty return type for property setter 2019-12-27 00:42:43 +09:00