Commit Graph

55 Commits

Author SHA1 Message Date
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
Daniel Watkins
cca039b337 Add tuple comparison test to tuple snippet test 2018-08-05 16:55:07 -04:00
Daniel Watkins
36f6fb2733 Support creation of single-element tuples
This fixes #37
2018-08-05 16:41:20 -04:00
Daniel Watkins
8a0b75d591 Implement (positive) stepped slicing for lists 2018-08-05 15:48:08 -04:00
yodalee
8b4549efbe Add fizzbuzz snippet to tests 2018-08-05 10:32:25 -04:00
Windel Bouwman
fcf3518f4a Merge pull request #30 from OddBloke/nums_in_funcs
Include numbers in valid identifier characters
2018-08-04 23:01:01 +02:00
Daniel Watkins
2a52a15fa6 Restore perf_fib to being tested
We now have a range function that is sufficient for its purposes.
2018-08-04 16:26:06 -04:00
Daniel Watkins
3e56bc1d60 Include numbers in valid identifier characters
Fixes #27.
2018-08-04 16:00:15 -04:00
Daniel Watkins
dc633ef818 Comment or move all currently-failing snippet tests
This allows us to make the snippet tests merge-blockers, whilst
improving over time.
2018-08-04 13:55:23 -04:00
Daniel Watkins
a9d6c8db87 Run snippet tests for stable and beta Rusts 2018-08-04 13:43:30 -04:00
Daniel Watkins
c857d75748 Restore running of benchmarks in test_snippets.py
This distinguishes them from regular snippet tests, and runs them
without trace logging (which was causing major slowdowns previously).
2018-08-04 12:51:12 -04:00
Daniel Watkins
402ca31423 Suppress cargo/jobserver log messages in snippet testing
They make the output unmanageably large, and don't provide any useful
information for debugging.
2018-08-04 12:51:12 -04:00
Daniel Watkins
31bdfe2cd7 Move performance snippets to a separate directory 2018-08-04 12:51:12 -04:00
Daniel Watkins
46257724e7 Add tests to snippet for stepped string slicing 2018-08-04 00:41:31 -04:00
Windel Bouwman
03bda855e7 Clean test code 2018-07-31 22:11:40 +02:00