Commit Graph

284 Commits

Author SHA1 Message Date
Jeong YunWon
c18615b6e5 Fix __builtins__.pow to perform modpow for 3rd argument 2019-05-02 22:59:08 +09:00
Jeong YunWon
8d4562b0bb Fix __builtins__.pow to reflect __rpow__ 2019-05-02 22:59:06 +09:00
Jeong YunWon
14dd85a596 Fix __builtins__.divmod to reflect __rdivmod__ 2019-05-01 05:14:52 +09:00
ben
4a4631a622 Use match_class instead of Either in isinstance/issubclass 2019-04-29 19:41:42 +12:00
ben
81dd5faa81 Accept a tuple for the second argument of isinstance and issubclass 2019-04-29 19:41:42 +12:00
coolreader18
2a74e48d98 Add vm.is_callable 2019-04-19 10:10:56 -05:00
Windel Bouwman
eb16f16566 Improve syntax error with line information. 2019-04-17 20:02:24 +02:00
coolreader18
08babef619 Remove the __inside_vm hack for procedural macros 2019-04-15 20:24:16 -05:00
coolreader18
1612c954a1 Add weakproxy test 2019-04-14 20:14:54 -05:00
ben
d24dd170e9 Changes to RustPython to support importing and running unittest 2019-04-14 12:09:54 +12:00
ben
2164cb5e65 Produce correct value for __qualname__ and add attributes to class. 2019-04-11 20:13:23 +12:00
ben
02a21cd072 Add builtin warning classes 2019-04-07 17:42:10 +12:00
Adam Kelly
7b2d92f495 Delete DictProtocol. impl ItemProtocol for PyDictRef. 2019-04-06 10:15:29 +01:00
Adam Kelly
9ed051e3b7 Module Initialisation takes VirtualMachine rather than PyContext. 2019-04-05 09:50:31 +01:00
Adam Kelly
c8eda3733d Eliminate ctx.set_attr. 2019-04-05 09:50:31 +01:00
coolreader18
4222d87e31 Merge branch 'master' into coolreader18/py_class-proc-macro 2019-03-29 13:55:08 -05:00
ben
ce9a909b9d Change kind identifier to fully use python terminology 2019-03-29 19:03:13 +13:00
ben
b5dc5a28e7 Merge branch 'master' into int_new_args
# Conflicts:
#	vm/src/function.rs
2019-03-29 18:51:19 +13:00
coolreader18
ff85838556 Add #[py_class] attribute proc macro 2019-03-29 00:16:34 -05:00
ben
657d025592 Change syntax of attributes in FromArgs proc macro 2019-03-28 21:34:11 +13:00
Joey Hain
62842e6d19 convert some builtins 2019-03-27 19:01:13 -07:00
ben
3ca387b509 Enhance FromArgs derive proc macro to allow positional, and positional
or keyword arguments.
2019-03-28 05:55:15 +13:00
Adam Kelly
4a5592d461 Change types inside Scope to PyDictRef. 2019-03-26 15:16:49 +00:00
Joey Hain
8bdc766bed Use name field directly 2019-03-25 19:32:58 -07:00
Joey Hain
6474a4a6ef Remove objtype::get_type_name() 2019-03-25 19:18:07 -07:00
Joey Hain
cc4f3fdb40 Clean up TypeProtocol 2019-03-25 19:18:01 -07:00
Adam Kelly
bbb7162472 Various dictionary changes.
* vm.ctx.new_dict returns a PyDictRef
* Special case for module goes away.
* Instances get a real dictionary.
2019-03-25 16:37:20 +00:00
Adam Kelly
17c3f9f024 builtin_locals can just return a reference to the locals dict. 2019-03-25 16:34:07 +00:00
coolreader18
946103bca8 Merge branch 'master' into coolreader18/wasm-browser-dom 2019-03-23 20:12:26 -05:00
ben
6fa059fd6c Make PyObject.typ a PyClassRef 2019-03-24 10:51:52 +13:00
coolreader18
9050799cc4 Merge branch 'master' into coolreader18/wasm-browser-dom 2019-03-23 13:22:07 -05:00
coolreader18
430bc4bac2 Fix vm.import when there are no frames on stack 2019-03-23 09:35:53 -05:00
ben
ad584df120 Allow context.set_attr to accept PyRef values in addition to PyObjectRef 2019-03-23 19:32:31 +13:00
ben
c1d5ce715f Change isinstance/issubclass to accept PyClassRef instead of PyCObject.
Also changed PyValue::class to return a PyClassRef.
2019-03-23 19:32:31 +13:00
ben
5c7812734d Use more specific ref type than PyObjectRef in PyContext 2019-03-23 13:00:12 +13:00
Adam Kelly
50437f8a75 Use class_get_attr in various places where we need the internal interface 2019-03-22 19:51:02 +00:00
coolreader18
a9051ab462 Convert all &mut VirtualMachine to &VirtualMachine 2019-03-22 01:48:14 -05:00
Adam Kelly
e66b5078a8 Introduce TryIntoRef<T> to make vm.get_attribute more usable. 2019-03-21 10:58:32 +00:00
coolreader18
3731148237 Merge branch 'master' into coolreader18/fix-clippy1 2019-03-20 09:03:07 -05:00
Adam Kelly
1958e47022 Add __class__ cell to method scopes. 2019-03-20 09:20:28 +00:00
ben
63d40edbc6 Added bunch af attribute has/get/set/delete tests and fixed getattr and
hasattr handling of exceptions.
2019-03-20 19:56:23 +13:00
ben
4e42bd077c Implement __setattr__ based on @nhynes(#540) PR 2019-03-20 19:53:50 +13:00
coolreader18
f78f558404 Fix clippy lints 2019-03-19 10:52:39 -05:00
Adam Kelly
6b3f61f3ca Merge branch 'master' into objdict_refactor 2019-03-19 10:19:03 +00:00
Joey
18b57188ba Add a custom derive for FromArgs 2019-03-16 17:13:23 -07:00
Joey
7cb889d42c Rebase against #693 and simplify 2019-03-16 16:38:28 -07:00
Joey
6550c52fa9 None doesn't mean no sep/end 2019-03-16 16:29:09 -07:00
Joey
55e7982835 Don't need while let 2019-03-16 16:29:09 -07:00
Joey
d3b9714754 Convert print() builtin to new args style 2019-03-16 16:29:09 -07:00
Joey
9de7285d23 Merge remote-tracking branch 'origin/master' into joey/pyobject-function-split
Conflicts:
      vm/src/frame.rs
      vm/src/obj/objbytearray.rs
      vm/src/obj/objbytes.rs
      vm/src/obj/objcomplex.rs
2019-03-16 08:37:18 -07:00