On Fri, May 8, 2009 at 10:50 AM, Christopher Lee <l...@chem.ucla.edu> wrote:

>
>
> On May 8, 2009, at 10:26 AM, Jenny Qing Qian wrote:
>
> >
> >
> > On Fri, May 8, 2009 at 2:20 AM, Christopher Lee <l...@chem.ucla.edu>
> > wrote:
> >
> > Hi Jenny,
> > dir() support is a separate issue.  We could implement __dir__ but
> > only Python 2.6 and later supports that.  I haven't tried that out
> > yet, so I don't even know how well that works...
> >
> > I have Python 2.6 installed.  But would you include changes that are
> > not backward compatible?
>
> Python 2.5 and earlier will just ignore (not use) the __dir__ method.
> Other than that, the presence of a __dir__ method will not cause
> problems in Python 2.5 and earlier.  To me that seems "backwards
> compatible", with the caveat that the feature (use of __dir__) is just
> missing from Python 2.5 and earlier.  We could also supply our own
> pygr.dir() function that would use __dir__() if present on an object,
> otherwise fall back to regular builtin dir().


I like the option of overwriting the builtin dir() for Python 2.6 or later.
Is there a way to implement this without descriptors?  A way that is
universally supported by any Python version.  What's wrong with __getattr__?

Jenny

>
>
> -- Chris
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"pygr-dev" group.
To post to this group, send email to pygr-dev@googlegroups.com
To unsubscribe from this group, send email to 
pygr-dev+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/pygr-dev?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to