Commit Graph

89 Commits

Author SHA1 Message Date
Adam Kelly
ec5fd550de Implement IntoIterator for PyDictRef. 2019-04-09 11:30:52 +01:00
Adam Kelly
d9216c87f1 Remove done todo. 2019-04-09 10:17:17 +01:00
Adam Kelly
29e9753e51 Even newer style class definitions. 2019-04-08 15:02:04 +01:00
Adam Kelly
2d127b9834 Use macro to generate full set of views and iterators. 2019-04-08 12:11:59 +01:00
Adam Kelly
5c4755ffd7 Separate iterators for items/keys/values. 2019-04-08 11:08:45 +01:00
Adam Kelly
9c32de954b Add iterator for dictionary keys. 2019-04-08 10:35:09 +01:00
ben
32051c9d96 Implement copy and update dict methods 2019-04-07 19:19:39 +12:00
Adam Kelly
584b707356 Add dict.__missing__ support. 2019-04-06 10:15:34 +01:00
Adam Kelly
b1dd5836af Simpler implementation of ItemProtocol for PyDictRef. 2019-04-06 10:15:34 +01:00
Adam Kelly
e2a4f22be8 Avoid name similarity between ItemProtocol and inner methods. 2019-04-06 10:15:33 +01:00
Adam Kelly
0fe3f7748c Simplify PyDictRef.__repr__. 2019-04-06 10:15:31 +01:00
Adam Kelly
7b2d92f495 Delete DictProtocol. impl ItemProtocol for PyDictRef. 2019-04-06 10:15:29 +01:00
Adam Kelly
ee9066a713 dict.get shouldn't call into __getitem__ 2019-04-06 10:12:16 +01:00
Adam Kelly
3e42edd261 dict.__new__ - support for dict subtypes. 2019-04-06 10:12:16 +01:00
Adam Kelly
f354f4ce02 Move contains_key to PyDictRef. 2019-04-05 16:18:10 +01:00
Adam Kelly
4212594c5b Prefer key to needle. 2019-04-05 16:16:55 +01:00
Adam Kelly
ec94168a15 Remove objdict::get_key_value_pairs. 2019-04-05 16:16:55 +01:00
Windel Bouwman
59d8612cfa Merge pull request #782 from skinny121/abc_module
Add abc module from CPython
2019-04-05 17:05:45 +02:00
Adam Kelly
b943f4a4bb Historic real proper dictionary support. 2019-04-05 09:50:31 +01:00
Adam Kelly
9ed051e3b7 Module Initialisation takes VirtualMachine rather than PyContext. 2019-04-05 09:50:31 +01:00
Adam Kelly
7438b0685c Changes suggested by code review. 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
bce4f1e483 Simplify/shrink the dict interface. 2019-04-05 09:39:59 +01:00
ben
ea872521d6 Make object by default hashable 2019-04-04 20:11:53 +13:00
Adrian Wielgosik
c918e9d5d3 Split iterators into separate types 2019-04-01 19:45:14 +02:00
Adrian Wielgosik
bbfca26b27 Move PyIteratorValue to objiter.rs 2019-04-01 19:45:10 +02: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
9ebbde8126 Replace special cases in boolval with __bool__ method on types. 2019-03-23 09:31:42 +00: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
coolreader18
a9051ab462 Convert all &mut VirtualMachine to &VirtualMachine 2019-03-22 01:48:14 -05:00
Adam Kelly
6b3f61f3ca Merge branch 'master' into objdict_refactor 2019-03-19 10:19:03 +00:00
Adam Kelly
9eeeeeae48 Change return type of vm.to_repr and vm.to_str to PyStringRef. 2019-03-16 09:42:54 +00:00
Adam Kelly
2f5c3ef1df Use PyStringRef to check type of dictionary keys. 2019-03-16 09:42:54 +00:00
Adam Kelly
a718a5a723 Refactor dict methods to new style declarations. 2019-03-16 09:42:54 +00:00
Adam Kelly
da6c56a001 Use extend_class in declaration of dictionary. 2019-03-16 09:22:02 +00:00
Joey
7bfd2e6e84 Move function items out of pyobject module 2019-03-15 21:27:11 -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
coolreader18
2af998ea86 Prevent recursion for Debug impls 2019-03-14 17:54:38 -05:00
Adrian Wielgosik
b334689e55 Remove Option from PyObject.typ; Refactor type hierarchy initialization. 2019-03-12 21:58:03 +01:00
Windel Bouwman
3cfee902ab Merge pull request #630 from lili668668/dict_get
Implement dict.get
2019-03-12 19:59:25 +01:00
Adam Kelly
9f96b16624 Turn PyClass.mro into a Vec<PyClassRef> 2019-03-12 15:09:03 +00:00
Tzu-Yin Hong
de2b928676 Format the code 2019-03-12 11:46:47 +08:00
Joey Hain
053ceb1a30 Move payload boxing into PyObject::new 2019-03-10 20:19:28 -07:00
Joey Hain
5971fc3bd4 rename PyObjectPayload2 to PyValue 2019-03-10 13:48:51 -07:00
Joey Hain
e2e13af7ea Remove PyObjectPayload 2019-03-10 13:45:38 -07:00
Joey Hain
45bc8c8f7a Move PyRef to pyobject module 2019-03-10 13:01:46 -07:00
Adam Kelly
3fbf627582 Merge branch 'master' into scope_globals_locals 2019-03-10 13:00:03 +00:00
Adam Kelly
0e23e706c9 Restructure scope to distinguish between locals and globals. 2019-03-10 12:38:43 +00:00
Joey
157d18d7a1 Convert iterator 2019-03-09 14:45:55 -08:00