Commit Graph

1586 Commits

Author SHA1 Message Date
Noah
e6a431ad22 Merge pull request #1676 from youknowone/fix-cpytest
Fix test_bool::test_sane_len
2020-01-27 18:24:40 -08:00
Jeong YunWon
eea157c2f0 Refactor PyWeak to use PyBuiltinCallable 2020-01-26 14:39:27 +09:00
Jeong YunWon
80f3da92ee vm/src/slots.rs 2020-01-26 14:05:05 +09:00
Jeong YunWon
e2e5c7ab00 Add PyBuiltinCallable and call slot 2020-01-26 14:04:44 +09:00
Jeong YunWon
106c8111c1 Fix test_bool::test_sane_len 2020-01-26 02:50:06 +09:00
Jeong YunWon
d5367d1761 #[pymethod(magic)]: pyname as __{sig.ident}__ form 2020-01-26 02:48:43 +09:00
Aviv Palivoda
d2a3ff8096 Fix clippy warning 2020-01-25 10:32:46 +02:00
Aviv Palivoda
8bf0d93bb2 Refactor string.splitlines 2020-01-24 22:53:44 +02:00
Aviv Palivoda
4a9e87b80d Support keepends in Str.splitlines 2020-01-24 12:58:51 +02:00
Jeong YunWon
9e936eb7c5 Merge pull request #1688 from RustPython/coolreader18/pyimpl-trait
Allow #[pyimpl] on traits
2020-01-23 01:01:40 +09:00
Noah
5b02a96192 Merge pull request #1696 from alvinlindstam/string-performance
String performance
2020-01-20 13:06:39 -06:00
Alvin Lindstam
9203eda6c6 Skip string char traversal on each next in python str iterator
Previosly, each call to `__next__` on a str iterator did a `chars().count()`
to find the length of the full string and traversed the chars of the string
until the expected char position from the start.

This approach ignores the char position and only cares about the byte position,
allowing it to only act on the specific part of the string binary it's interested
in.
2020-01-19 15:49:14 +01:00
Jeong YunWon
655834d578 Merge pull request #1678 from youknowone/object-cmp
__eq__ and __ne__ compatibility
2020-01-18 19:26:45 +09:00
Aviv Palivoda
f6e6ef0fe1 objint __pos__ returns Int object
This fixes test_bool.test_math
2020-01-17 19:17:14 +02:00
coolreader18
538e492dda Add #[pyimpl(with(...))] 2020-01-14 23:56:21 -06:00
Jeong YunWon
bf0b4dcfdd Hide PyFunction members by moving methods to objfunction 2020-01-15 11:51:59 +09:00
Jeong YunWon
30fc460136 PyClassImpl for PyFunction 2020-01-15 11:51:59 +09:00
Jeong YunWon
44a17012d6 PyStaticMethodRef -> PyStaticMethod 2020-01-15 11:51:58 +09:00
Jeong YunWon
0b1050e8c1 cleanup PyFunction a little bit 2020-01-15 11:51:29 +09:00
Jeong YunWon
582e5dfca9 cleanup tuple 2020-01-15 11:51:29 +09:00
Jeong YunWon
1fe526bb66 hide member of classmethod 2020-01-15 11:51:29 +09:00
Jeong YunWon
d31d0c6510 Merge pull request #1685 from youknowone/slot-name
pyslot guess slot name from function name
2020-01-15 11:51:16 +09:00
Jeong YunWon
8c7e01b4f6 pyslot guess slot name from function name 2020-01-15 10:28:39 +09:00
Jeong YunWon
4c2e34a523 Use slot descriptor get if it exists 2020-01-14 15:37:26 +09:00
Jeong YunWon
cdc39701d8 Add PyBuiltinDescriptor for descriptors 2020-01-14 15:37:15 +09:00
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
81d36a1f1d __eq__ and __ne__ compatibility 2020-01-12 18:33:58 +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