[PATCH 1 of 1] util: remove any() and all()

Benoit Boissinot bboissin at gmail.com
Sat Jan 15 05:21:33 CST 2011


On Mon, Jul 5, 2010 at 9:35 AM, Martin Geisler <mg at aragost.com> wrote:
> Nicolas Dumazet <nicdumz at gmail.com> writes:
>
>> 2010/7/5 Dirkjan Ochtman <dirkjan at ochtman.nl>:
>>> On Sun, Jul 4, 2010 at 18:24, Steve Losh <steve at stevelosh.com> wrote:
>>>> Now that Python 2.7 has been released the three latest versions of Python are
>>>> 2.5, 2.6 and 2.7, all of which have these functions built in.
>>>
>>> Bzzzt. We support whatever we chose to support, not just the latest
>>> three versions. We will deprecate 2.4 when the time is there, and I
>>> don't think you'll be able to convince everyone that that time is now.
>>> :)
>>
>> Hehe, too bad, I would have been rushing around the code, adding
>> defaultdicts everywhere =)
>
> What about augmenting the builtins on Python 2.4 with the any/all
> functions and defaultdict class? That way our code would look like
> Python 2.5 code, but still run on Python 2.4.
>
> If our util.any/all are accurate replacements for any/all in Python 2.5
> (which I think they are) then, as far as I can see, the only problem is
> to make sure the compatibility code is loaded before the first access to
> any/all. Perhaps hg.py could simply do the 'import py24compat' if it
> detects we're on Python 2.4.

What do other people thing about that? Is there any other python
sofware having that approach?

Benoit


More information about the Mercurial-devel mailing list