input record seperator (equivalent of "$|" of perl)

Fredrik Lundh fredrik at pythonware.com
Mon Dec 20 15:20:16 EST 2004


Scott David Daniels wrote:

> True. The 2.4 document says that itertools.groupby() is equivalent to:
>
>     class groupby(object):

> So you could always just use that code.

the right way to do that is to use the Python version as a fallback:

    try:
        from itertools import groupby
    except ImportError:
        class groupby(object):
            ...

</F> 






More information about the Python-list mailing list