Commit Graph

571 Commits

Author SHA1 Message Date
Yu Wu
38ee8aeed6 Fix reverse method for calling div. 2019-02-03 07:02:36 -08:00
Windel Bouwman
a7d011f9c7 Merge pull request #270 from ZapAnton/str_isdecimal
Added the isdecimal method to the 'str' class
2019-02-03 15:37:20 +01:00
Windel Bouwman
ac0ea87ead Merge pull request #271 from holygits/bitshift
Implement `__rshift__` and `__lshift__` for integer type
2019-02-03 15:35:50 +01:00
Windel Bouwman
cdcddcc6c6 Merge pull request #281 from chaconnewu/198
Use call_or_unsupported for operators.
2019-02-03 11:50:09 +01:00
Windel Bouwman
1d7149e131 Merge pull request #280 from HomerMcMillan/list-pop
Add list.pop
2019-02-03 11:49:01 +01:00
Homer McMillan
7b27fbf369 Add list.pop
Also include IndexError in the __builtin__ module.
2019-02-03 00:49:52 -05:00
Yu Wu
561eb8ed4f Use call_or_unsupported for operators. 2019-02-02 21:47:28 -08:00
ben
8f9b733a77 Add tuple.__mul__ 2019-02-03 13:59:43 +13:00
holygits
e8d1e10226 Implement __rshift__ and __lshift__ for integer 2019-02-03 12:38:38 +13:00
ZapAnton
46b939721f str: Added the isdecimal method 2019-02-03 01:51:47 +03:00
Windel Bouwman
328f81a28e Merge pull request #266 from coolreader18/format-mk-module
Format module building in a more readable way
2019-01-30 18:09:17 +01:00
Windel Bouwman
892493e464 Rename PyObjectKind into PyObjectPayload 2019-01-30 18:06:27 +01:00
coolreader18
37b5669bed Fix syntax error 2019-01-30 10:13:55 -06:00
coolreader18
f193291471 Merge branch 'master' into format-mk-module 2019-01-30 10:09:47 -06:00
Windel Bouwman
31523fe4d7 Merge pull request #265 from rmliddle/implement-io
File-IO: IO Module and Open Builtin
2019-01-29 20:43:28 +01:00
rmliddle
deb0688a99 Changed buffer imp. to use type + removed ByteArray Kind 2019-01-29 18:40:40 +11:00
coolreader18
e9bfea834a Format module building in a more readable way 2019-01-28 23:02:43 -06:00
Windel Bouwman
d627230434 Merge pull request #263 from coolreader18/string-str
Remove unnecessary to_string conversions
2019-01-28 20:38:54 +01:00
rmliddle
507f7bdca9 Fix for os open (optional params not allowed) 2019-01-28 19:38:06 +11:00
rmliddle
c011db2819 fmt w/nightly 2019-01-28 19:21:27 +11:00
rmliddle
7b23d0e917 rust fmt 2019-01-28 18:54:50 +11:00
rmliddle
9a86bbd718 ByteArray Usage 2019-01-28 18:30:19 +11:00
coolreader18
989357fe81 Fix warnings from using trim_left and trim_right 2019-01-27 23:02:27 -06:00
coolreader18
5ecff1b37e Remove unnecessary to_string conversions 2019-01-27 21:45:21 -06:00
rmliddle
9efc68efcb Generalized Mode Handling 2019-01-22 21:59:10 +11:00
rmliddle
dda3d7ffb7 Bug fix for sequential Writes, New File Writes 2019-01-21 20:03:36 +11:00
rmliddle
3845e23881 -Logging length in FileIO write, +Bytes to String in TextIOBase 2019-01-19 14:13:12 +11:00
rmliddle
b54738978a Remaining IO open classes: TextBaseIO, TextWrapperIO 2019-01-17 21:20:31 +11:00
rmliddle
30165f6c8a open builtin 2019-01-16 20:16:56 +11:00
rmliddle
edc720e79f Buffered Objects for Open 2019-01-14 20:32:27 +11:00
rmliddle
2bbd4fd18f BufferedIOBase Read 2019-01-13 10:54:47 +11:00
Shing Lyu
5e8eb8a001 Added list.index() 2019-01-10 22:01:42 +01:00
rmliddle
5e1324fd23 os modes 2019-01-09 20:56:08 +11:00
rmliddle
9041129bb8 read_into on FileIO 2019-01-08 18:10:35 +11:00
rmliddle
6deb71d84f os.open impl 2019-01-08 12:14:43 +11:00
rmliddle
dc6238bb0c __offset__ workaround 2019-01-05 21:38:33 +11:00
rmliddle
b783657477 file_io_readinto implementation for fixed length buffer reads 2019-01-04 19:35:33 +11:00
rmliddle
15d0c39c81 fixes to bytearray len 2019-01-04 19:34:28 +11:00
rmliddle
cbd8d7b171 len attributes on byte types 2019-01-03 08:16:04 +11:00
Windel Bouwman
a28b665396 Merge pull request #246 from rmliddle/bytes-representation
Bytes representation changed from hex to utf-8
2019-01-02 22:07:21 +01:00
rmliddle
3d6742a9e8 change to bytes repr 2019-01-02 21:25:48 +11:00
rmliddle
278e1a8298 method name change for fileio 2019-01-02 13:41:12 +11:00
rmliddle
08a9fd9819 memoryview object, FileIO Methods 2019-01-01 23:39:21 +11:00
Riccardo Magliocchetti
e4ca1655e9 Implement most string module constants
whitespace and thus printable are excluded because i haven't found
a way to make tests pass.
2018-12-27 23:48:11 +01:00
Windel Bouwman
4c5b5845bb Merge pull request #244 from coolreader18/boxed-rustfunc
Change RustPyFunc from a fn pointer to a Fn trait
2018-12-27 20:23:22 +01:00
AgentMacklin
79a3b13252 Implement most of the string methods. (#239)
* implemented more functions

* backup

* Improve demo site

* Formatting; move the `+ '\n'` hack to eval().

* Rename run_code() to run_from_textbox()

* Switch to using json.dumps for py_to_js()

* Clarify names of wasm builtins

* Remove dependency on num_bigint

* Allow injecting JS variables into python with eval_py()

eval_py(`return js_vars["a"]`, { a: 9 }) == 9

* dict() now should work properly

e.g.
``` dict(a=2, b=3) == {"a": 2, "b": 3} ```

* Add documentation for eval_py() and update error message handling

Also, switch from iterating over the values of js_injections and
serializing each of them individually to asserting it's an object and
then just stringifying the whole thing.

* Finish revamping `dict_new()`

* Add 'from x import *' syntax.

This is a separate opcode in CPython so I added it as such here.

* Add test for dicts

* added functions

* ran rustfmt and fixed isidentifier

* fixed zfill and make_title

* python3.6 doesn't contain isascii()
2018-12-27 20:22:04 +01:00
coolreader18
09602a2ec6 Change RustPyFunc from a fn pointer to a Fn trait 2018-12-27 09:18:00 -06:00
Windel Bouwman
f325ef1499 Merge pull request #240 from coolreader18/json-error
Have the json ser/de functions throw an exception instead of panicking
2018-12-27 09:20:52 +01:00
coolreader18
8fee5a8800 Run cargo fmt --all 2018-12-27 00:12:08 -06:00
coolreader18
0ac0432a53 Run cargo fmt 2018-12-26 18:23:40 -06:00