marylinh / pyv8

Automatically exported from code.google.com/p/pyv8
0 stars 0 forks source link

Fix for issue #18 (commit 185) caused regression #19

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Seems like the fix that was committed for issue #18 broke some other
things. I'm not able to come up with a test case for it, but seems the
problem is that __[gs]et__ is only called on the attributes of the object's
type, so that [gs]etattr(obj, name, property) won't do the right thing.
I've added to the testcase to show the problem, along with a fix (which
reverts #185 and instead fixes it from the Python side).

Original issue reported on code.google.com by sciyoshi on 31 Dec 2009 at 7:29

Attachments:

GoogleCodeExporter commented 9 years ago
Note: this makes my original example print t2.attr three times instead of two. 
This
is because hasattr (PyObject_HasAttr in Wrapper.cpp) actually calls getattr to 
check,
so it gets called an extra time. Not sure if this is really bad or if it can be
avoided... I may just be really tired :-)

Anyways, happy new year!

Original comment by sciyoshi on 31 Dec 2009 at 7:55

GoogleCodeExporter commented 9 years ago
Ok, I have disabled the build-in python property supports by default, and use 
python 
side implementation. In fact, I prefer to do as more as possible on python side 
:P

Thanks for your patches :)

Original comment by flier...@gmail.com on 31 Dec 2009 at 8:05