New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make Jsproxy getattr and dir use GenericGetAttr and object.__dir__ #1017
Conversation
Similar changes are included in #972 but I figured this was worth separating off. |
Might be good to add a test for it? Also could you rename this PR to something more specific than "redo"? |
We should add a changelog entry, otherwise LGTM. |
Okay updated changelog. A little hard to describe because this is more of a backend thing, but it does have useful visible effects on the user like |
Before this, the JsProxy
getattr
method explicitly compared the attribute name against a list of strings to decide whether to pull the attribute off of a python object.dir
only returned the keys of the wrapped javascript object, not the extra keys coming from python.Now I use
PyObject_GenericGetAttr
so that ifJsProxy.__dict__
has a key, we return the associated value, and dir returns the merged list of python and javascript keys.This shadows more attributes of the javascript object, but they are all names with
__underscores__
so I think it's okay.