3 ms·
The introspection bit is because js.globals is implemented with a fancy __getattr__ but doesn't have a __dir__. In general, dir() is not reliable in the face o
by bzbarsky 12y ago
The introspection bit is because js.globals is implemented with a fancy __getattr__ but doesn't have a __dir__. In general, dir() is not reliable in the face of custom __getattr__ implementations unless the implementor goes out of the way to make it work.
- e12e 12y agoOh, right. I didn't consider that: Welcome to PyPy.js! >>> import js >>> "console" in js.globals True >>> "console" in dir(js.globals) False