These are chat archives for dropbox/pyston

25th
May 2015
Marius Wachtler
@undingen
May 25 2015 20:04
Should PyDict_Contains support operating on a attrwrapper?
Kevin Modzelewski
@kmod
May 25 2015 20:07
I think extension modules do things like m = PyModule_GetDict(); PyDict_AddItem(m, k, v);
ie assume that the PyDict methods apply to module dicts
I didn't think about it too much but the best solution I could come up with to that is to just make the pydict methods work on attrwrappers
Marius Wachtler
@undingen
May 25 2015 20:10
I agree looks sensible and may save us some trouble
Marius Wachtler
@undingen
May 25 2015 20:24
CPythons dictproxy lives in descrobject.c. Should I put in a new file (like I currently have done from_cpython/Objects/dictproxy.c) or should I put it into some of our cpp files?
It's about 200 lines long and probably doesn't need any modifications.
Travis Hance
@tjhance
May 25 2015 20:52
I think ultimately we will need to make attrwrappers real dicts
Like someone somewhere is probably accessing __dict__ and then checking that it's type is dict
Marius Wachtler
@undingen
May 25 2015 21:35
Yeah maybe we should support at some point different dict implementation hiding behind the same python type. One for __dict__, one for when all keys are strings, one generic one, etc.. I think pypy does something like this.
mmh would be interesting to add some debug output to print which are the most frequent dict key value types.
Kevin Modzelewski
@kmod
May 25 2015 23:48
oh, yeah having different dict strategies could be a really good way of addressing it