Implicit lists

Donnal Walter donnalcwalter at yahoo.com
Fri Jan 31 19:43:18 CET 2003


"Alex Martelli" <aleax at aleax.it> wrote:
> Donnal Walter wrote:
>
> > functionality. The iteron definition using generators doesn't really
work
> > for me for some reason. (I confess I don't fully understand generators.)
I
>
> Maybe you don't have a:
>    from __future__ import generators
> at the start of your module?

No, I did put the import statement in. The part about generators that I
don't understand is how does one determine if they are empty or not?

    def __init__(self, ref=[]):
        self.__ref = iteron(ref)
        if len(self.__ref) > 0:
            # do something

produces TypeError: len() of unsized object

Donnal Walter
Arkansas Children's Hospital








More information about the Python-list mailing list