Commit Graph

5027 Commits

Author SHA1 Message Date
Idan Dor
1e985e26da Fixed issue MRO computation in RustPython doesn't seem to implement C3 correctly #1659.
To my surprise the C3 algorithm was implemented, however I have found a few problems which cause it to appear like it isn't:
- Bad mro usage in super: starting from the current class mro instead of the original class at the index of the current class. This leads to skipping classes gotten from multiple inheritance.
- A minor error in mro c3 implementation - not keeping local precedence ordering.
- The mro c3 implementation also allowed duplicate base classes. (Not from the issue but I noticed this anyway).

To allow the fix in new class creation I added an optional vm argument.
This allows the class creation to correctly throw type errors at mro errors.
Due to classes being necessary to vm creation in the first place, this argument is optional (and should only be skipped during initial type creation) and if there is an error here, it will panic instead of returning it.
2020-02-14 15:08:47 +02:00
Jeong YunWon
fdbef417f3 Merge pull request #1735 from youknowone/pybool
PyBool
2020-02-07 12:40:00 +09:00
Jeong YunWon
8d7be94b03 PyBool 2020-02-07 11:56:31 +09:00
Aviv Palivoda
438dcec21b Merge pull request #1752 from palaviv/struct-calcsize
Add struct.calcsize
2020-02-06 21:53:03 +02:00
Aviv Palivoda
2633f9f844 Add struct.calcsize 2020-02-06 21:21:44 +02:00
Noah
f873c0e2c3 Merge pull request #1746 from RustPython/coolreader18/wasm-test-production
Have wasm/demo's "test" npm script build the demo in release mode
2020-02-06 10:45:05 -06:00
Jeong YunWon
67f072dbff Merge pull request #1749 from youknowone/_vm
Remove `_vm` parameter when it is not required
2020-02-06 20:33:43 +09:00
Jeong YunWon
7312e18eeb Merge pull request #1748 from youknowone/syntax-error
Fix SyntaxError initial value
2020-02-06 18:59:27 +09:00
Jeong YunWon
92cb58b163 Remove _vm parameter - remove unused functions 2020-02-06 18:54:37 +09:00
Jeong YunWon
6ddb690e09 Remove _vm parameter when it is not required 2020-02-06 11:07:51 +09:00
Jeong YunWon
844b6395ce Fix SyntaxError initial value 2020-02-06 10:39:52 +09:00
Noah
e7ea486749 Merge pull request #1738 from youknowone/getset
Add getset_descriptor
2020-02-05 19:33:53 -06:00
Jeong YunWon
0f12db1ba1 Merge pull request #1705 from youknowone/azure-38
Bump up to python 3.7 for Azure Pipelines
2020-02-06 04:31:15 +09:00
Jeong YunWon
429a27640d Bump up to python 3.8 for Azure Pipelines 2020-02-06 04:07:45 +09:00
Jeong YunWon
c0b235ed66 cleanup property and get descriptor codes 2020-02-06 03:56:40 +09:00
Jeong YunWon
58744df1d5 Revert 08e66b5002
which is not required anymore
2020-02-06 03:56:40 +09:00
Jeong YunWon
facabfee1a Remove PropertyBuilder and add new_getset 2020-02-06 03:45:19 +09:00
Jeong YunWon
0aee78de18 pyproperty generates PyGetSet instead of PyProperty 2020-02-06 03:42:05 +09:00
Jeong YunWon
23381b9937 compatiibility for CPytthon descr_check 2020-02-06 03:42:01 +09:00
Jeong YunWon
226a2a6cb9 VM polymorphism for getter and setter 2020-02-06 03:36:05 +09:00
Jeong YunWon
d1f9cb4e58 PySetResult and IntoPySetResult 2020-02-06 03:33:34 +09:00
Jeong YunWon
ca557788c8 &self support for getter/setter 2020-02-06 01:47:53 +09:00
Jeong YunWon
c3d5f6c145 IntoPyGetterFunc, IntoPySetterFunc 2020-02-06 01:46:00 +09:00
Jeong YunWon
9f5cd17f2b Add getset_descriptor 2020-02-06 01:23:39 +09:00
Jeong YunWon
78180ff8a4 Merge pull request #1734 from youknowone/to-owned
str::to_string -> str::to_owned
2020-02-05 23:27:39 +09:00
Jeong YunWon
7d0d313aa5 &str::to_string -> &str::to_owned for variables 2020-02-05 22:55:34 +09:00
Jeong YunWon
1bac582921 &str::to_string -> &str::to_owned for literals 2020-02-05 22:55:33 +09:00
Noah
c435ba05ab Merge pull request #1731 from RustPython/feature/implement-random
Implement _random.Random
2020-02-05 07:39:27 -06:00
Jeong YunWon
3960fb8c07 Merge pull request #1745 from arnavb/fix-exit-code
Fallback exit code to 0 in case of overflow
2020-02-05 13:48:44 +09:00
Noah
60037a2fbb Cache WASM dependencies 2020-02-04 21:43:06 -06:00
Noah
4c49185b52 Have wasm/demo's "test" npm script build the demo in release mode 2020-02-04 20:36:11 -06:00
Arnav Borborah
c44f04b57e Fallback exit code to 0 in case of overflow 2020-02-04 18:21:33 -05:00
Noah
3595f4e1a4 Merge pull request #1730 from youknowone/type-error
Fix type() error message and BaseException.__str__
2020-02-03 19:28:25 -06:00
Noah
e46d38e6ea Merge pull request #1733 from youknowone/py-base-object
PyBaseObject
2020-02-03 19:15:35 -06:00
Noah
9abb258849 Fix clippy warnings 2020-02-03 18:38:19 -06:00
Noah
a762bf89d9 Move gen_res53 to mersenne.rs 2020-02-03 18:27:35 -06:00
Noah
b40dcb7748 Use random.Random in tempfile 2020-02-03 18:21:53 -06:00
Noah
2fd9eb9a8a Add random.py from CPython 3.6 2020-02-03 18:21:52 -06:00
Noah
a20b6bfaaa Implement _random using the MT19937 algorithm 2020-02-03 18:21:51 -06:00
malkoG
908abef5da Apply code review for test snippet 2020-02-03 18:21:42 -06:00
malkoG
8a3fb408dc Implement random module 2020-02-03 18:21:37 -06:00
Jeong YunWon
52c5eec4bb Merge pull request #1725 from youknowone/fix-parse-number
parse_number can raise error about length
2020-02-03 11:12:11 +09:00
Noah
8272e470ee Merge pull request #1737 from RustPython/coolreader18/deploy-gh-actions
Deploy the demo using Github Actions
2020-02-02 12:11:10 -06:00
Noah
ddfec3af73 Merge pull request #1739 from youknowone/pytest-v
github actions run pytest with -v option
2020-02-02 10:52:04 -06:00
Jeong YunWon
77e72083a0 github actions run pytest with -v option 2020-02-02 23:44:40 +09:00
Noah
6c3231e60c Deploy the demo using Github Actions 2020-02-01 20:45:37 -06:00
Noah
584b0da8fa Merge pull request #1729 from RustPython/coolreader18/cache-actions
Cache Cargo dependencies in Github Actions
2020-02-01 18:12:27 -06:00
Jeong YunWon
1c2b01f894 parse_number can raise error about length 2020-02-01 21:29:01 +09:00
Aviv Palivoda
17fdc19b79 Merge pull request #1724 from palaviv/subprocess-timeout
Support timeout in Popen.communicate
2020-02-01 10:32:03 +02:00
Jeong YunWon
3e56b3f284 PyBaseObject 2020-02-01 16:56:12 +09:00