Malcolm Tredinnick wrote: > On Thu, 2008-10-02 at 10:32 -0400, Marty Alchin wrote: > >> Looking over the new things in Python 2.6, I wonder if there are plans >> to inherit from any of the new abstract base classes in Django. It >> looks (to me) like it could be backwards-compatible, using an import >> like so: >> >> try: >> from collections import Sequence >> except ImportError: >> # Fallback for Python 2.5 >> Sequence = type('Sequence', (object,), {}) >> >> Django obviously works just fine without these at the moment, so >> there's no pressing need to do so, but if they catch on and 2.6+ >> libraries start checking for them, it might be beneficial if some of >> our custom types, like QuerySets, inherited the appropriate classes. >> > > How about we wait until that looks like maybe happening, then? Python > 2.6 is approximately 43 seconds old and there isn't a lot of real-world > experience with the traps and benefits of using this approach yet. > Hopefully people writing 2.6 code won't be deliberately making it > difficult for code that is portable across more than the "latest > hotness" version to function and we can avoid having to add four lines > of relatively confusing line-noise to our import statements. > > Python code should be readable. The above code fragment fails that test > and whilst we have some similar code for other backwards compatibility > reasons, the existing cases are requirements. This one is optional, so > I'd much rather avoid it for now. > +1
Trendy might be superficially appealing, but I personally felt 2.6 would have been just as useful without the ABC backport. regards Steve --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django developers" group. To post to this group, send email to django-developers@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-developers?hl=en -~----------~----~----~----~------~----~------~--~---