On 2/15/07, Anthony Baxter <[EMAIL PROTECTED]> wrote: > On Friday 16 February 2007 09:08, Ben North wrote: > > The wrapper class idea was left > > open as a possibility for a future PEP. > > A good first step would be to contribute something like this to the > Python Cookbook, if it isn't already there.
I could not find such a class in the cookbook. (That's not to say there's not one there that I missed.) Because I think attrview() should happen, I submitted a recipe to the Python Cookbook. While it awaits editor approval, I have it posted at http://www.verylowsodium.com/attrview.py . One possibly controversial design choice here: since there is no guaranteed way to enumerate attributes in the face of __getattr__ and friends, my version of attrview() does not provide iteration or any other operation that assumes object attributes can be enumerated. Therefore, it technically does not implement a mapping. Once Python grows a __dir__ special method, it's possible I could be convinced this is the wrong choice, but I'm not sure of that. Greg F _______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com