Commit Graph
69 Commits
Author SHA1 Message Date
Windel Bouwman fdcc4c8992 Merge pull request #95 from RustPython/bools_3
Bools 3
2018-08-27 22:05:58 +02:00
Adam Kelly a59c4536d9 unittests for compilation of if statements. 2018-08-27 14:26:13 +01:00
Adam Kelly 1e6ed66019 Implement compile_test to avoid extra evaluations of bools. 2018-08-27 14:04:53 +01:00
Windel Bouwman b8552a22e5 Merge branch 'master' of https://github.com/RustPython/RustPython into exceptions 2018-08-26 21:51:51 +02:00
Daniel Watkins 7a80c04725 Basic json module implementation in rust 2018-08-26 15:10:39 -04:00
Daniel Watkins 3255a55837 Rename types snippet to avoid shadowing stdlib module 2018-08-26 15:09:07 -04:00
Windel Bouwman 71896fd2aa Merge branch 'master' of https://github.com/RustPython/RustPython into exceptions 2018-08-26 11:40:30 +02:00
Windel Bouwman 6ce1dbce26 Add issiubclass 2018-08-26 10:54:03 +02:00
cthulahoops c295a4514c Merge pull request #82 from RustPython/bools_2
Bools 2
2018-08-26 09:52:28 +01:00
Windel Bouwman 4ca3314d4c Merge pull request #83 from OddBloke/import
Make imports relative to the importing file
2018-08-26 10:49:10 +02:00
Adam Kelly e10dfa4f87 Compile and and or. 2018-08-26 09:36:27 +01:00
Adam Kelly fb2c959cc4 Missing __bool__ is truthy and None is falsey. 2018-08-26 09:36:27 +01:00
Daniel Watkins a457153ce1 Consider imports relative to their source
Currently they are considered relative to the current working directory
of the interpreter, which is incorrect.

Fixes #83.
2018-08-25 19:45:19 -04:00
Windel Bouwman a0edc4203f Check that raise command raises exception type 2018-08-26 00:30:01 +02:00
Windel Bouwman 6aa9c01180 Merge branch 'master' of https://github.com/RustPython/RustPython into exceptions 2018-08-25 10:18:51 +02:00
Windel Bouwman 882606ba1a Move exceptions to own struct 2018-08-25 10:11:21 +02:00
Daniel Watkins da34b86a9c Implement PYTHONPATH
This modifies the import logic to use sys.path, and uses PYTHONPATH to
generate the initial contents of sys.path.
2018-08-24 22:55:30 -04:00
Windel Bouwman f76472c00b Add some base exceptions 2018-08-24 23:36:26 +02:00
Adam Kelly d60dfd2ad8 Test __bool__ and fix it. 2018-08-24 18:48:09 +01:00
Adam Kelly d5668c32ee Add test for bools. 2018-08-24 18:23:20 +01:00
Adam Kelly 91a11e25c2 Replace str built-in with str.__new__ 2018-08-24 15:13:06 +01:00
Windel Bouwman d4e735783e Some formatting 2018-08-23 23:11:57 +02:00
Windel Bouwman 04b786f0f3 Add try except to compiler 2018-08-22 21:42:18 +02:00
Windel Bouwman 823730f023 Fix cast test snippet 2018-08-20 21:37:21 +02:00
Windel Bouwman 15e274210f Add float type 2018-08-20 21:22:14 +02:00
Adam Kelly a9c3349943 Specify bases in normal class definitions. 2018-08-19 20:55:37 +01:00
Adam Kelly 456726977e Comment out broken test snippet. 2018-08-19 20:54:45 +01:00
Adam Kelly 25dc93915a Add method descriptors and __mro__. 2018-08-19 20:54:45 +01:00
Adam Kelly ca7b792497 Get both forms of type to work properly.
Includes basic ability to traverse method resolution order (mro), but
not to derive mro or read parents from class definitions.

New and init called when creating types and instances.
__call__ works on types and instances.
Descriptors have have priority over instance variables.
2018-08-18 11:54:00 +01:00
Adam Kelly aa26d55b5a Add snippet for calling type. 2018-08-16 07:45:02 +01:00
Adam Kelly 8eee2cec74 Add (broken) callable test. 2018-08-15 12:58:18 +01:00
Windel Bouwman c9816c37de Fix append snippet 2018-08-14 22:44:55 +02:00
Adam Kelly c83f548d92 There is only one none. 2018-08-12 20:20:56 +01:00
Adam Kelly 4b52f72316 load_attr to use class based attribute getting. 2018-08-12 18:57:56 +01:00
Daniel Watkins 19c9db2375 Parse trailing commas in lists/dicts 2018-08-11 23:37:01 -04:00
Windel Bouwman 816038c166 Merge pull request #54 from OddBloke/import
Implement complex import handling
2018-08-10 15:40:28 +02:00
Windel Bouwman a7f1830fe7 Merge pull request #50 from OddBloke/triple_quotes
Implement triple-quotes for strings
2018-08-10 15:36:24 +02:00
Daniel Watkins a7428e3808 Implement complex import handling
This expands import parsing and handling to implement a variety of
import cases:

* `import x as y`
* `import x, y`
* `from x import y`
* `from x import y, z`
* `from x import y as z, a as b`

This fixes #51.
2018-08-09 17:14:08 -04:00
Daniel Watkins c9738a0cd1 Ensure snippet tests can import other snippets 2018-08-09 17:14:08 -04:00
Adam Kelly aa1207adcf Snippet to test out class definition. 2018-08-09 07:55:52 +01:00
Daniel Watkins 3861fd898e Implement triple-quotes for strings
This fixes #33.
2018-08-08 23:36:32 -04:00
Daniel Watkins 086dc127f2 Handle slice ends greater than sequence length
This is already handled for the string case, so borrow that logic (and
add an explanatory comment where it was borrowed from).
2018-08-08 09:19:04 -04:00
Windel Bouwman ac44f8b8ed Merge pull request #47 from OddBloke/dict
Implement simple dict literals
2018-08-08 14:28:50 +02:00
Windel Bouwman f338a15d38 Merge pull request #44 from OddBloke/slice
Implement stepped slicing for tuples
2018-08-08 14:25:49 +02:00
Daniel Watkins d1acf5e7db Implement simple dict literals 2018-08-07 23:49:42 -04:00
Daniel Watkins 1b259d5d61 Implement 0-size dict literal 2018-08-07 23:49:42 -04:00
Daniel Watkins 78447bb4f4 Implement no-arg dict builtin 2018-08-07 20:23:58 -04:00
Daniel Watkins dbd65071fe Implement stepped slicing for tuples 2018-08-06 15:02:43 -04:00
Windel Bouwman 45d3d74776 Merge pull request #40 from OddBloke/slice
Implement (positive) stepped slicing for lists
2018-08-06 16:48:04 +02:00
Windel Bouwman 3575b2785c Merge pull request #43 from OddBloke/tuple_comparison
Enable tuple comparison
2018-08-06 16:46:19 +02:00