Maxim Kurnikov
347d48198e
fix remaining clippy warnings
2019-07-07 06:27:07 +03:00
Yonatan Goldschmidt
d4a3d7eb01
Raise an error on range() with step=0
2019-05-06 23:23:48 +03:00
coolreader18
3051702a2d
Merge branch 'master' into pyrange-extend
2019-05-01 20:15:50 -05:00
Adrian Wielgosik
c7fd54e809
Convert iterators to pyclass macros
2019-05-01 21:26:37 +02:00
Jeong YunWon
22a35c9b90
extend_class for PyRangeIterator
2019-05-01 05:13:05 +09:00
Jeong YunWon
599f1f678f
extend_class for PyRange
2019-05-01 00:51:47 +09:00
Jeong YunWon
a7091ca88d
Add range.__eq__
2019-04-27 00:54:21 +09:00
Jeong YunWon
16353f4f54
range negative side bound error
2019-04-27 00:13:54 +09:00
Jeong YunWon
16152a1d32
Fix range() to support negative index
2019-04-27 00:06:29 +09:00
ben
f2873a519d
Merge branch 'master' into slice_new
...
# Conflicts:
# tests/snippets/builtin_slice.py
# vm/src/frame.rs
# vm/src/obj/objrange.rs
# vm/src/obj/objslice.rs
2019-04-17 19:44:46 +12:00
ben
6650ad895a
Fix a bunch of clippy warnings
2019-04-14 10:07:50 +12:00
Joey Hain
ea61599da4
range: take self by ref
2019-04-07 10:07:36 -07:00
Joey
05ede30c51
range index
2019-04-04 07:52:53 -07:00
Adrian Wielgosik
c918e9d5d3
Split iterators into separate types
2019-04-01 19:45:14 +02:00
Adrian Wielgosik
bbfca26b27
Move PyIteratorValue to objiter.rs
2019-04-01 19:45:10 +02:00
ben
5625f7e15e
Allow arbitrary in slice, and convert slice.__new__ to new style
2019-03-31 09:58:02 +13:00
Joey
f2d562a4cc
pyint: use as_bigint() everywhere
2019-03-24 10:05:25 -07:00
Joey
9a0113deed
range: represent w/ int refs
2019-03-24 09:59:06 -07:00
Joey
c2e1e9b0dc
Convert range to new args style
2019-03-24 09:59:06 -07:00
Joey
84d47d21cf
Rename to just Either
2019-03-23 17:51:12 -07:00
Joey
a5558e0e32
Introduce Either extractor and convert range.__getitem__
2019-03-23 15:05:12 -07:00
Joey
18ed00a653
Range cleanups
2019-03-23 12:48:37 -07:00
ben
c1d5ce715f
Change isinstance/issubclass to accept PyClassRef instead of PyCObject.
...
Also changed PyValue::class to return a PyClassRef.
2019-03-23 19:32:31 +13:00
Windel Bouwman
68ba050030
Use the extend class macro more.
2019-03-22 20:45:34 +01:00
coolreader18
a9051ab462
Convert all &mut VirtualMachine to &VirtualMachine
2019-03-22 01:48:14 -05:00
Joey
7bfd2e6e84
Move function items out of pyobject module
2019-03-15 21:27:11 -07:00
Joey
fa9e48a5b3
Take &mut VirtualMachine insteadof &PyContext
2019-03-14 21:43:19 -07:00
Joey
737ec12fa5
Rename PyValue::{required_type => class}
2019-03-14 20:08:41 -07:00
Adrian Wielgosik
e3a5ac1378
Make objint::get_value return a reference
2019-03-11 23:07:56 +01:00
Joey Hain
053ceb1a30
Move payload boxing into PyObject::new
2019-03-10 20:19:28 -07:00
Joey Hain
5971fc3bd4
rename PyObjectPayload2 to PyValue
2019-03-10 13:48:51 -07:00
Joey Hain
e2e13af7ea
Remove PyObjectPayload
2019-03-10 13:45:38 -07:00
Joey Hain
f6765cf16e
less explicit returns
2019-03-10 00:34:21 -08:00
Joey Hain
e1d728e81f
slice
2019-03-09 15:10:44 -08:00
Joey
157d18d7a1
Convert iterator
2019-03-09 14:45:55 -08:00
Joey
ecc92ffe33
Convert int to Any payload
2019-03-06 19:25:54 -08:00
Joey Hain
e7fb116210
Convert more objects to Any payload
2019-03-02 13:27:00 -08:00
Joey Hain
7f75e3ee8a
Significant improvements to new function definition style
...
- PyRef<T> type for accepting references to payloads.
- Args<T> type for consuming remaining positional args
(mirrors python `*args`).
- KwArgs<T> type for consuming remaining keyword args
(mirrors python `*kwargs`).
- OptArg<T> type for consuming remaining keyword args
(no python code equivalent, only possible in native functions like in cpython).
- PyIterable<T> for accepting an iterator over a sequence of Ts.
- Arity checking (but TypeError messages need work)
2019-02-27 19:53:20 -08:00
Joey Hain
e959908a49
Fix iterator
2019-02-25 21:26:15 -08:00
Joey Hain
f10fa6db44
Remove outer RefCell from PyObjectRef
2019-02-25 21:01:37 -08:00
Joey Hain
2919d7f520
Initial arg type checking
2019-02-23 19:27:22 -08:00
Joey Hain
fb0384d24d
Some prerequisite data types for arg checking
2019-02-23 18:16:24 -08:00
Joey Hain
c14a8302e8
Initial prototype of "extractor pattern" for native funcs
2019-02-23 18:16:02 -08:00
Joey
df76ffe116
Replace most relative imports with 2018-style crate
2019-02-20 08:50:53 -08:00
ZapAnton
38930984ec
Fixed the redundant_pattern_matching clippy warning
2019-02-12 16:45:44 +03:00
ZapAnton
291dba6bb6
Fixed the toplevel_ref_arg clippy warning
2019-02-12 16:44:47 +03:00
ZapAnton
5fe373555f
Fixed the match_bool clippy warning
2019-02-12 16:43:59 +03:00
ZapAnton
45b9ef9719
Fixed the op_ref clippy warnings
2019-02-12 16:42:53 +03:00
Homer McMillan
389fc3acd9
cargo fmt
2019-02-10 12:04:42 -05:00
Homer McMillan
9de733be19
Add range start/stop/step
2019-02-10 12:03:22 -05:00