These are chat archives for dropbox/pyston

23rd
May 2015
Rudi Chen
@rudi-c
May 23 2015 00:07
That could be a fun project :)
Marius Wachtler
@undingen
May 23 2015 20:22
Do we need cpythons dictproxy? While we have the attrwrapper it looks like we may need the dictproxy class to make C.__dict__ readonly. Also I came across code which want's to have a read only dict. (lxml code generated by cython)
While dictproxy expects to wrap around a dict we could let it wrap around our attrwrapper for the C.__dict__ case because we support the same methods.
Marius Wachtler
@undingen
May 23 2015 21:24
with a few workarounds for the 180k line c file generated by cython:
>> from lxml import etree
>> root = etree.Element("root")
>> root.append( etree.Element("child1") )
>> child2 = etree.SubElement(root, "child2")
>> child3 = etree.SubElement(root, "child3")
>> print(etree.tostring(root, pretty_print=True))
<root>
  <child1/>
  <child2/>
  <child3/>
</root>
:-)
--> Looks like there is not to much missing for cython support
Kevin Modzelewski
@kmod
May 23 2015 21:55
nice!
taking a quick look at cpython, it seems like we might be able to use their dictproxy implementation, and have it wrap the attrwrapper like you mentioned
I think we already have to make sure that functions like PyDict_Contains can handle attrwrappers
so maybe it would "just work" :P
Marius Wachtler
@undingen
May 23 2015 21:57
ok I'll try it
Kevin Modzelewski
@kmod
May 23 2015 22:00
for better or worse, I think this is the time that we get to implement all the obscure features that we would have expected no one to want :P
Marius Wachtler
@undingen
May 23 2015 22:02
gg. But it looks like we have now imported a large part of cpython api. numpy also links and the shared lib resolves all symbols after adding a few missing ones. (but then crashes)