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
Windel Bouwman
fc38d55b59
Merge pull request #381 from nficca/implement-range-count
...
Implement range.count
2019-02-10 11:46:10 +01:00
Nic Ficca
0cb661f3a2
Dry up objrange
...
- Use get_value in all appropriate spots
2019-02-09 16:54:14 -05:00
Nic Ficca
2e9892029a
Add objrange::get_value
...
- Refactor range_count to use get_value and isinstance for pulling out the range and argument respectively
2019-02-09 16:49:44 -05:00
Nic Ficca
b7a4248837
Add range.count
2019-02-09 16:27:12 -05:00
Homer McMillan
ba9226219b
cargo fmt
2019-02-09 15:54:17 -05:00
Homer McMillan
a4d13f9f50
Fix typo
2019-02-09 15:53:13 -05:00
Homer McMillan
4e02962289
Fix range reversed #421
2019-02-09 15:49:51 -05:00
Joey Hain
969ddf2ea0
Merge remote-tracking branch 'upstream/master' into reversed
2019-02-09 08:13:03 -08:00
Adam
2ae9d88de4
Merge pull request #398 from ZapAnton/range_doc
...
range type: Added __doc__
2019-02-09 11:11:13 +00:00