Commit Graph

1690 Commits

Author SHA1 Message Date
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
Timur
74b84d4be1 Merge branch 'float-conversion' of github.com:makarchuk/RustPython into float-conversion 2019-02-05 21:56:14 +03:00
Timur
4b2787ea1d Comment out math from tests due to Travis errors 2019-02-05 21:54:13 +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
stratusjerry
7134885775 Spellcheck 2019-02-05 13:39:16 -05: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
0f0ceeaa00 Merge pull request #332 from lausek/imports
raise ImportError in import list
2019-02-05 18:25:41 +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
e481063ca6 Fixed duplicate os error. 2019-02-05 18:13:08 +01:00
Windel Bouwman
815dd0937a Merge pull request #309 from holygits/add-os-error
Add OSError
2019-02-05 17:59:14 +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
Windel Bouwman
8e006274ed Merge pull request #325 from rmliddle/implement-io
Factored OS Module for Windows Support, Unsafe Handling of Raw FileHandles and Descriptors
2019-02-05 17:49:52 +01:00
Windel Bouwman
b710eedb04 Merge pull request #324 from veera83372/refactor-py
Refactored: whats_left_to_implement.py
2019-02-05 17:45:10 +01:00
lausek
f4af599167 added ImportError as builtin 2019-02-05 17:41:05 +01:00
Timur Makarchuk
c7e6935e1c Get rid of exp usages
Assuming `exp` function was missing for platform-dependant reasons, let's try to test it with `sin` instead
2019-02-05 19:21:31 +03: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
d1b034e3b9 Avoid using \xhh for string 2019-02-05 23:54:39 +09:00
lausek
f8db0f1c94 raise ImportError in import list 2019-02-05 15:42:39 +01: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
8c469a6466 int type: Added tests for the __invert__ 2019-02-05 15:25:07 +03:00
ZapAnton
5db2025dec int type: Added __invert__ 2019-02-05 15:20:17 +03:00
rmliddle
aa2dff4bd9 Format os.rs 2019-02-05 23:08:45 +11:00
rmliddle
86e94f587b Comment fix and use of i64 instead of i32 2019-02-05 22:47:33 +11:00
lausek
73ae085ed8 implemented rounding funcs for int (#304) 2019-02-05 12:47:30 +01:00
rmliddle
eca75b3611 Comment and formatted on windows rust_file call 2019-02-05 22:18:24 +11:00
Ryan Liddle
0daa03875c windows fixes for os module 2019-02-05 22:14:14 +11:00
veera venky
ea4059a18f Refactored: whats_left_to_implement.py 2019-02-05 16:04:01 +05:30
rmliddle
ca815baeaf Factored out unix dependency 2019-02-05 20:57:06 +11:00
Vladimir Karamyshev
ebbd3d9f22 Add error handling for objsequence and objstr index overflow 2019-02-05 10:17:43 +03:00
coolreader18
de3762cabf Add .run(); fix .addToScope(); add panic-catcher for debugging 2019-02-05 00:39:16 -06: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
Windel Bouwman
aea929a284 Merge pull request #319 from holygits/fix-fileno
Revert 'file_no' -> 'fileno' attr naming
2019-02-05 06:18:30 +01:00
Homer McMillan
fb58ca3e6c Add comparison tests for tuple 2019-02-04 23:31:39 -05: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
holygits
5cad1b0215 Revert 'file_no' -> 'fileno' attr naming 2019-02-05 16:39:22 +13:00