[Python-Dev] Meta-reflections (original) (raw)
David Ascher DavidA@ActiveState.com
Mon, 18 Feb 2002 11:01:51 -0800
- Previous message: [Python-Dev] Meta-reflections
- Next message: [Python-Dev] Meta-reflections
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
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
- Previous message: [Python-Dev] Meta-reflections
- Next message: [Python-Dev] Meta-reflections
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]