Commit Graph

265 Commits

Author SHA1 Message Date
Aviv Palivoda
1f19951ece Add os.{remove,unlink} 2019-04-05 19:51:38 +03:00
Aviv Palivoda
28c3ef1ae3 Add os.write 2019-04-05 19:50:24 +03:00
Aviv Palivoda
37e7972dcd Add os.read 2019-04-05 19:49:13 +03: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
Adam Kelly
25c17b4829 Change all the ctx.set_attr in ast. 2019-04-05 09:50:31 +01:00
Adam Kelly
bce4f1e483 Simplify/shrink the dict interface. 2019-04-05 09:39:59 +01:00
Windel Bouwman
23f57f757c Improve trailing comma situation 2019-04-03 14:08:12 +02:00
Adrian Wielgosik
2fb3fc92ec Support chained comparisons 2019-04-02 23:22:54 +02:00
Adrian Wielgosik
792c6a103e Convert re to new style args 2019-03-28 21:32:18 +01:00
Adam Kelly
c644176547 Modules have attributes, not items. 2019-03-27 10:53:08 +00:00
Joey Hain
cc4f3fdb40 Clean up TypeProtocol 2019-03-25 19:18:01 -07:00
Adam Kelly
55e0fb1f19 AST class for nodes instead of just using object everywhere. 2019-03-25 16:39:25 +00: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
ben
db8e648646 Make PyFunction.code a PyCodeRef, PyGenerator.frame a FrameRef, and
other improvements to increase use of specific ref types.
2019-03-24 13:41:37 +13:00
ben
dc68101577 Refactor type_new_class to use more specific ref types 2019-03-24 12:08:15 +13:00
ben
6fa059fd6c Make PyObject.typ a PyClassRef 2019-03-24 10:51:52 +13:00
Joey
3177824474 Fix test- 2019-03-23 12:57:17 -07:00
Joey
e4e7da3d54 Some socket cleanups 2019-03-23 12:21:55 -07:00
Joey
2aee2981e3 Remove FromPyObjectRef, replace with downcast 2019-03-23 09:38:03 -07:00
Adam Kelly
386f90fa25 Remove PyContext.get_attr. 2019-03-23 11:29:22 +00: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
coolreader18
b0d8935731 Merge branch 'master' into coolreader18/immutable-vm-ref 2019-03-22 07:21:45 -05:00
Adam Kelly
23ee751880 Use vm.get_attribute to access attributes of modules. 2019-03-22 10:54:28 +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
d024e7ed8d Switch from an stdlib function to a vm method 2019-03-21 00:08:36 -05:00
coolreader18
7a980b3b47 Merge branch 'master' into coolreader18/fix-wasm-import-json 2019-03-20 23:58:19 -05:00
coolreader18
de1bc937e7 Use json straight from json.rs 2019-03-19 22:20:10 -05:00
coolreader18
4c9527be47 Merge branch 'master' into coolreader18/fix-clippy1 2019-03-19 19:19:36 -05:00
coolreader18
f78f558404 Fix clippy lints 2019-03-19 10:52:39 -05:00
Windel Bouwman
76dbd8c6e8 Apply cargo formatting. 2019-03-18 20:21:35 +01:00
Windel Bouwman
18fc8c150b Merge master 2019-03-18 20:00:00 +01:00
Windel Bouwman
3191725022 Refactor into new-style PyObject 2019-03-18 17:48:46 +01: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
Joey
7bfd2e6e84 Move function items out of pyobject module 2019-03-15 21:27:11 -07:00
Joey
976afeda31 Add helper for obtaining class from module 2019-03-14 23:08:07 -07:00
Joey
fa9e48a5b3 Take &mut VirtualMachine insteadof &PyContext 2019-03-14 21:43:19 -07:00
Joey
737ec12fa5 Rename PyValue::{required_type => class} 2019-03-14 20:08:41 -07:00
Windel Bouwman
c0b7ddfd2c Add write method to io.StringIO 2019-03-13 13:32:57 +01:00
coolreader18
070f5aa322 Merge master into pyvaluepayload 2019-03-12 18:36:10 -05:00
coolreader18
e49d7146a0 Add PyValuePayload trait and use it for PyObject.payload 2019-03-12 18:31:59 -05:00
Adrian Wielgosik
b334689e55 Remove Option from PyObject.typ; Refactor type hierarchy initialization. 2019-03-12 21:58:03 +01:00
Adam Kelly
9f96b16624 Turn PyClass.mro into a Vec<PyClassRef> 2019-03-12 15:09:03 +00:00
Windel Bouwman
b8aa38db1a Merge pull request #653 from RustPython/joey/pyobject-2.0-prep
Remove PyObjectPayload enum
2019-03-11 17:33:51 +01:00
Joey Hain
2449c12bf9 Merge remote-tracking branch 'origin/master' into make_module_not_mk_module
Conflicts:
      vm/src/stdlib/weakref.rs
2019-03-10 20:43:11 -07:00
Joey Hain
053ceb1a30 Move payload boxing into PyObject::new 2019-03-10 20:19:28 -07:00
Joey Hain
e2e13af7ea Remove PyObjectPayload 2019-03-10 13:45:38 -07:00