Commit Graph

107 Commits

Author SHA1 Message Date
Jeong YunWon
6ddb690e09 Remove _vm parameter when it is not required 2020-02-06 11:07:51 +09:00
Jeong YunWon
1bac582921 &str::to_string -> &str::to_owned for literals 2020-02-05 22:55:33 +09:00
Jeong YunWon
8c7e01b4f6 pyslot guess slot name from function name 2020-01-15 10:28:39 +09:00
coolreader18
098393d4d6 Add __length_hint__ to a bunch of iterators 2020-01-10 18:24:23 +00:00
Jeong YunWon
c1306726c4 Fix clippy warnings 2019-12-21 18:49:48 +09:00
Oscar Shrimpton
b86e803fec Implement .indices(len) of slice (Fixes #1431)
range.__getitem now also uses slice.indices() internally.
CPython: https://github.com/python/cpython/blob/master/Objects/sliceobject.c#L373
2019-10-20 20:27:08 +01:00
Jack Park
aa27d22a54 Resolved rustfmt error 2019-10-18 07:45:01 +07:00
Jack Park
9a5deb1d5b Removed unused binding 2019-10-18 07:20:01 +07:00
Jack Park
3fdc72de5d Resolved conflict 2019-10-18 07:18:50 +07:00
Jack Park
fcc6635b1f Implemented range.__reduce__ 2019-10-18 07:01:37 +07:00
Jeong YunWon
6c0f852b62 Refactor pymethod return types to be smaller as possible 2019-10-11 03:27:23 +09:00
HyeockJinKim
1e8ade7098 Fixed __eq__ and add __ne__ of range
change return type of __eq__ to PyResult
and add __ne__

Issue #1442
2019-10-10 03:49:05 +09:00
HyeockJinKim
f43ae4424e Change return type of length to BigInt
Change the return type of length to BigInt
since most of the length's values are used as_bigint
2019-10-08 01:48:14 +09:00
HyeockJinKim
6499dbbfc5 Fixed __hash__ of range
Calculate hash value of range through hash of tuple

Fixes #1482
2019-10-07 19:00:52 +09:00
Noah
d22cac2dd8 Rename new slots to tp_new 2019-09-29 23:14:37 -05:00
coolreader18
c46b5b50bd Fix weirdness with type.__new__()/type()/metaclass.__new__() 2019-09-29 23:14:31 -05:00
Daniel Alley
c6bebae462 Clippy 2019-09-24 09:42:58 -04:00
Daniel Alley
6a3e38d4da Cargo Format 2019-09-24 09:42:50 -04:00
Daniel Alley
ecb3cd4df5 Fix implementation of range slicing
closes #1373
2019-09-24 09:31:22 -04:00
Daniel Alley
36efb50563 Refactor for less allocations 2019-09-24 09:31:22 -04:00
Daniel Alley
6ba7655cdb Rewrite if-let as match statement 2019-09-24 09:31:22 -04:00
Daniel Alley
12b961f212 Fix bug where [::0] did not throw ValueError 2019-09-23 15:46:58 -04:00
Noah
c52677afb1 Merge pull request #1388 from RustPython/coolreader18/match_class-match-expr
Match an actual match expression in match_class!
2019-09-21 15:29:57 -05:00
HyeockJinKim
1ff88fb662 Fix __eq__ of range
__eq__ compare length, start, step of range

Fixes #1389
2019-09-21 01:10:02 +09:00
Noah
a429b09a0b Allow match_class match expressions without parens around the target 2019-09-19 20:07:18 +00:00
Noah
dfeeda1c4c Match an actual match expression in match_class! 2019-09-19 18:27:34 +00:00
HyeockJinKim
1e10eed7dc Fixed index calculation of slice for range
Fixed start, stop, and step calculation of slice
for range type

Fixes #1363
2019-09-16 01:23:40 +09:00
HyeockJinKim
fcdb1b4715 Fixed get function for range
Fixed get function to use the length value
rather than the stop value
2019-09-15 23:26:35 +09:00
Windel Bouwman
d06dec77ea Attempt to reduce the size of the pyobject.rs files by splitting out builtin types. 2019-08-14 19:08:47 +02:00
dmitrijoseph
d8c06d7898 cargo fmt 2019-07-14 20:38:58 -04:00
dmitrijoseph
eba282dcbe Implemented lt, gt, le, ge 2019-07-14 18:47:45 -04:00
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