[Python-checkins] r69685 - in python/trunk: Lib/test/test_itertools.py Modules/itertoolsmodule.c

Benjamin Peterson benjamin at python.org
Mon Feb 16 21:52:14 CET 2009


On Mon, Feb 16, 2009 at 2:39 PM, raymond. hettinger
<python-checkins at python.org> wrote:
> Author: raymond.hettinger
> Date: Mon Feb 16 21:39:12 2009
> New Revision: 69685
>
> Log:
> Add GC support to count() objects.  Backport candidate.
> +    def test_count(self):
> +        a = []
> +        Int = type('Int', (int,), dict(x=a))

Is there a reason to use type() directly instead of

class MyInt(int):
    x = a

IMO, that's more readable.



-- 
Regards,
Benjamin


More information about the Python-checkins mailing list