I think that you're making useful points, but I think that it's worth stepping even further back and deciding what the reflection API should be like from a "what's it for" POV? This relates to much of the discussion about what dir() should do on new-style classes, as well as why some Python objects have 'members', some have 'methods', etc. In my opinon, __dict__ is mostly an implementation detail, and it makes sense to me that the slot names dont' show up in there (after all, it's not a dictionary!). What I'd propose is that the inspect module grow some "abstract" reflection APIs which make it possible for folks who don't need to know about implementation details to get away with it. Looking at it, maybe it already has everything we need. I'm not quite sure why inspect.getmembers is called that, but maybe I'm the only one who's not sure what 'members' mean in Python. --david
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4