Commit Graph

59 Commits

Author SHA1 Message Date
Windel Bouwman
e705ec292b Add mktime function. 2019-07-13 11:26:44 +02:00
coolreader18
5b32dfbed9 Fix clippy and azure pipelines 2019-07-08 13:24:06 -05:00
coolreader18
fbeedb72bd Fix seq_mul with negative numbers 2019-07-07 15:38:54 -05:00
coolreader18
9d3fa18ec8 Add __mul__ to deque 2019-07-07 15:38:47 -05:00
coolreader18
5153ad52ca Add cmp methods to deque 2019-07-07 15:38:44 -05:00
Yonatan Goldschmidt
84684e5f7d Don't use RefCell in tuple object 2019-05-19 23:57:32 +03:00
Yonatan Goldschmidt
802f07980e Remove tuple handling from get_elements_cell
Like my HEAD, this shouldn't be allowed for a tuple (and the
only call-site of this function doesn't run on tuples anyway).
2019-05-19 23:01:10 +03:00
Yonatan Goldschmidt
9ad527c800 Remove tuple handling from get_mut_elements
This function is unused anyway; But even was it used, it makes no sense
to return mutable references to tuple items, when the tuple holding them
is immutable.
2019-05-19 23:01:05 +03:00
Jimmy Girardet
8a7c46da7b add endswith startswith 2019-04-18 14:15:13 +02: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
Jimmy Girardet
86928114fa resolve conflict 2019-04-08 10:33:56 +02:00
jgirardet
c487f12222 Merge branch 'master' into seq 2019-04-08 09:36:37 +02:00
Rachel Powers
909d94ec23 impl and use SequenceIndex for list.__delitem__
- removal of del_item
- all del function impl on PyListRef
- stepped deletion now loops only over the range
  insted of the whole list
2019-04-05 20:25:53 -06:00
Rachel Powers
d0e6c3bd92 convert to PySliceRef as it is the only option 2019-04-04 04:52:33 -06:00
Rachel Powers
c97f342ef7 cleanup and rustfmt 2019-04-04 03:18:58 -06:00
Rachel Powers
aba059b81a impl PySliceableSequenceMut & objseqence::del_item
used to impl list.__delitem__
2019-04-04 02:52:51 -06:00
ben
5625f7e15e Allow arbitrary in slice, and convert slice.__new__ to new style 2019-03-31 09:58:02 +13:00
jgirardet
7d18a1ce60 Fix #746: invalid slice with start or stop =-1 when step<0 2019-03-30 21:47:20 +01:00
Joey Hain
cc4f3fdb40 Clean up TypeProtocol 2019-03-25 19:18:01 -07:00
Adam Kelly
bbb7162472 Various dictionary changes.
* vm.ctx.new_dict returns a PyDictRef
* Special case for module goes away.
* Instances get a real dictionary.
2019-03-25 16:37:20 +00:00
Joey
f2d562a4cc pyint: use as_bigint() everywhere 2019-03-24 10:05:25 -07:00
ben
6fa059fd6c Make PyObject.typ a PyClassRef 2019-03-24 10:51:52 +13:00
coolreader18
a9051ab462 Convert all &mut VirtualMachine to &VirtualMachine 2019-03-22 01:48:14 -05:00
coolreader18
b30d56df29 Fix some more clippy warnings 2019-03-19 20:02:06 -05:00
Adam Kelly
336aa53b13 Allow IdProtocol to compare PyRef and non-PyRef. 2019-03-12 18:44:35 +00:00
Joey Hain
053ceb1a30 Move payload boxing into PyObject::new 2019-03-10 20:19:28 -07:00
Joey Hain
e2e13af7ea Remove PyObjectPayload 2019-03-10 13:45:38 -07:00
Joey Hain
e1d728e81f slice 2019-03-09 15:10:44 -08:00
Adrian Wielgosik
10531191bb Convert most tuple/list methods to new args style 2019-03-08 20:43:20 +01:00
Joey
1bcbb28715 Convert list and tuple to Any payload 2019-03-07 21:10:43 -08:00
Joey
ecc92ffe33 Convert int to Any payload 2019-03-06 19:25:54 -08:00
Adrian Wielgosik
45da6b8af1 Add list.sort, sorted() 2019-02-26 22:03:45 +01:00
Joey Hain
f10fa6db44 Remove outer RefCell from PyObjectRef 2019-02-25 21:01:37 -08:00
Joey
df76ffe116 Replace most relative imports with 2018-style crate 2019-02-20 08:50:53 -08:00
Calixte Denizet
5a154f9745 Fix list & tuple equality 2019-02-16 14:23:20 +01:00
janczer
4959defff8 Call wrap functions insted of magic 2019-02-13 06:34:44 +01:00
ZapAnton
ef65612008 Fixed the clone_double_ref clippy warning 2019-02-12 16:59:15 +03:00
ZapAnton
206ccc55fb Fixed the len_without_is_empty clippy warning 2019-02-12 16:49:34 +03:00
ZapAnton
e51c75e1df Fixed or_fun_call clippy warnings 2019-02-11 15:29:19 +03:00
ben
7abf02180a implement slice negative step handling 2019-02-09 15:48:07 +13:00
ben
907dfb6770 Add slice type and use BigInts in slice payload. 2019-02-09 12:07:04 +13:00
ZapAnton
3464828499 Fixed various small clippy warnings 2019-02-06 13:24:24 +03:00
Windel Bouwman
3fb0f32a87 Merge pull request #335 from ZapAnton/fix_ptr_arg
Fixed the 'ptr_arg' clippy warnings
2019-02-05 22:36:29 +01:00
ZapAnton
d445e3082a Fixed the 'unneeded_field_pattern' clippy warnings
This replaces all the occurrences of the Struct {field: _} with
the Struct { .. }.

Relevant clippy warning: https://rust-lang.github.io/rust-clippy/master/index.html#unneeded_field_pattern
2019-02-05 21:37:41 +03:00
ZapAnton
1a6840280b Fixed the 'ptr_arg' clippy warnings
This replaces all the occurrences of &<dynamic collection><T>
with the &[T].

Relevant clippy warning: https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg
2019-02-05 21:22:16 +03:00
Vladimir Karamyshev
ebbd3d9f22 Add error handling for objsequence and objstr index overflow 2019-02-05 10:17:43 +03:00
holygits
33a3ec8832 Handle unicode string slicing with graphemes 2019-02-04 15:40:30 +13:00
HomerMcMillan
168e0e5471 Merge branch 'master' into list-orderable-ops 2019-02-03 11:17:09 -05:00
Homer McMillan
ea1a7bb395 Add list.{__lt__, __gt__, __le__, __ge__} 2019-02-02 22:04:26 -05:00
ben
8f9b733a77 Add tuple.__mul__ 2019-02-03 13:59:43 +13:00