silmeth
d96e0ecf40
make division and modulo by 0 throw ZeroDivisionError
2019-02-05 21:28:48 +01:00
silmeth
0a1eb4b91b
make len(range) throw OverflowError on too big ints + impl __repr__
2019-02-05 21:27:49 +01:00
ZapAnton
fb9fa27555
Fixed the 'redundant_field_names' clippy warnings
...
This replaces all the occurrences of the Struct {field : field}
with the Struct {field}.
Relevant clippy warning: https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names
2019-02-05 21:56:16 +03:00
silmeth
b43c511542
fix range len() for negative and non-divisible steps
2019-02-05 19:49:14 +01:00
ZapAnton
b0cbb23b43
Fixed the 'collapsible_if' clippy warnings
...
Relevant clippy warning: https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if
2019-02-05 21:49:07 +03:00
ZapAnton
0d3b218237
Fixed the 'toplevel_ref_arg' clippy warning
...
This replaces all the occurrences of the
'let ref var = another_var' with the
'let var = &another_var'
Relevant clippy warning: https://rust-lang.github.io/rust-clippy/master/index.html#toplevel_ref_arg
2019-02-05 21:45:56 +03:00
ZapAnton
526ed98d93
Fixed the 'needless_return' clippy warnings
...
This replaces all the occurrences of the 'return var;' at
the end of the functions with the 'var'.
Relevant clippy warning: https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
2019-02-05 21:39:38 +03: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
ZapAnton
6fb91ddfed
Fixed the 'len_zero' clippy warnings
...
This replaces all the occurrences of the <collection>.len() == 0
with the <collection>.is_empty() and the occurrences of the
<collection>.len() > 0 with the !<collection>.is_empty()
Relevant clippy warning: https://rust-lang.github.io/rust-clippy/master/index.html#len_zero
2019-02-05 20:54:49 +03:00
ZapAnton
57e2beef3a
Fixed the 'useless_format' clippy warning
...
This replaces all the occurrences of the format!(<&str>) with the <&str>.to_string()
Relevant clippy warning: https://rust-lang.github.io/rust-clippy/master/index.html#useless_format
2019-02-05 20:48:50 +03:00
Windel Bouwman
7941480fca
Merge pull request #269 from mrecachinas/add-int-doc
...
Add int.__doc__ (addresses #261 )
2019-02-05 18:26:28 +01:00
Windel Bouwman
fa91cc36e8
Merge pull request #329 from ZapAnton/int_invert
...
int type: Added __invert__
2019-02-05 18:14:21 +01:00
Windel Bouwman
676f60296d
Merge pull request #330 from ichyo/string-len
...
Use the number of characters instead of bytes for str.__len__
2019-02-05 17:57:58 +01:00
Adam
6ea784e78e
Merge pull request #323 from vokar97/handle-index-overflow
...
Add error handling for objsequence and objstr index overflow (addresses #276 )
2019-02-05 16:00:07 +00:00
Adam
aee5090bd2
Merge pull request #321 from HomerMcMillan/tuple_comparisons
...
Fix error messages in tuple/list comparisons
2019-02-05 15:54:54 +00:00
ichyo
fc779c2e3a
Use the number of characters instead of bytes for str.__len__
2019-02-05 23:26:13 +09:00
lausek
3d07ecdd1c
int type: trunc and index
2019-02-05 14:08:08 +01:00
ZapAnton
5db2025dec
int type: Added __invert__
2019-02-05 15:20:17 +03:00
lausek
73ae085ed8
implemented rounding funcs for int ( #304 )
2019-02-05 12:47:30 +01:00
Vladimir Karamyshev
ebbd3d9f22
Add error handling for objsequence and objstr index overflow
2019-02-05 10:17:43 +03:00
Homer McMillan
7446a52c18
Fix error messages in tuple/list comparisons
2019-02-05 00:27:36 -05:00
Windel Bouwman
63c83086c7
Merge pull request #320 from HomerMcMillan/tuple_comparisons
...
Tuple comparisons
2019-02-05 06:24:30 +01:00
Windel Bouwman
ed53a353c2
Merge pull request #316 from OddCoincidence/range-use-bigint
...
Represent range with BigInts
2019-02-05 06:21:04 +01:00
Windel Bouwman
2be174050a
Merge pull request #305 from veera83372/master
...
Adding int.__bool__ method
2019-02-05 06:19:26 +01:00
Homer McMillan
696bf8e9a9
rustfmt
2019-02-04 23:27:45 -05:00
Homer McMillan
608a13eabb
Add comparison operations for tuple
2019-02-04 23:26:16 -05:00
Joey Hain
9ac8e55695
Represent range with BigInts
2019-02-04 17:38:23 -08:00
veera venky
d3fedecd61
Adding 'int.__bool__' method
2019-02-05 02:26:44 +05:30
Windel Bouwman
b7b4a8a51b
Merge branch 'master' into add-int-doc
2019-02-04 21:47:09 +01:00
Windel Bouwman
47d43a7fef
Merge pull request #306 from HomerMcMillan/range-builtin
...
Add built in range type (addresses #294 )
2019-02-04 21:46:07 +01:00
Windel Bouwman
1c07a2285d
Merge pull request #268 from mrecachinas/add-bool-doc
...
Add bool.__doc__ (addresses #260 )
2019-02-04 21:34:58 +01:00
HomerMcMillan
41d73c49a1
Merge branch 'master' into range-builtin
2019-02-04 15:14:43 -05:00
Homer McMillan
64bd33e787
Add built in range type (addresses #294 )
2019-02-04 15:08:13 -05:00
Michael Recachinas
9dded0cb7b
Replace context.new_property with context.new_str for int.__doc__
2019-02-04 19:46:58 +00:00
Michael Recachinas
804def1522
Replace context.new_property with context.new_str for bool.__doc__
2019-02-04 19:37:24 +00:00
Windel Bouwman
b7f6db753f
Merge branch 'master' into fix-unicode-handling
2019-02-04 08:39:21 +01:00
Windel Bouwman
caac5a34d5
Merge branch 'master' into tuple_add
2019-02-04 08:05:07 +01:00
Windel Bouwman
44e9658f52
Merge pull request #297 from HomerMcMillan/issue_295
...
Fix panic on out of bounds negative index (addresses #295 )
2019-02-04 07:48:17 +01:00
Windel Bouwman
235aa864f4
Merge pull request #296 from agude/int_conj
...
Add .conjugate() method to int type
2019-02-04 07:43:13 +01:00
holygits
33a3ec8832
Handle unicode string slicing with graphemes
2019-02-04 15:40:30 +13:00
Homer McMillan
055e577424
Fix panic on out of bounds negative index (addresses #295 )
...
Also an out of bounds index now raises an IndexError rather than a ValueError
2019-02-03 16:38:04 -05:00
Alexander Gude
33523d492c
Change int.conjugate() to return a new int
...
This results in the correct behavior (that is, matching CPython) for
both int and bool types.
Also adding a bool conjugate test.
2019-02-03 13:31:09 -08:00
Alexander Gude
a95747f161
Add .conjugate() method to int type
...
Also add tests for for the int type, and a commented out one for the
bool type.
2019-02-03 11:18:23 -08:00
Matthew Constable
190b2a43d9
Fixed formatting
2019-02-03 18:34:35 +00:00
Matthew Constable
da5046100b
Able to create set from iterable.
2019-02-03 17:25:24 +00:00
Matthew Constable
b433b7fcf0
Implemented remove() method on set.
2019-02-03 17:01:32 +00:00
Homer McMillan
353d881bac
Fix missing seq_mul import
2019-02-03 11:33:11 -05:00
HomerMcMillan
168e0e5471
Merge branch 'master' into list-orderable-ops
2019-02-03 11:17:09 -05:00
Matthew Constable
c022ac46e6
Refactored adding to set using hash into helper function.
2019-02-03 16:09:44 +00:00