list() coercion

Ian Bicking ianb at colorstudy.com
Thu Jul 17 23:18:30 EDT 2003


On Thu, 2003-07-17 at 10:08, Raymond Hettinger wrote:
> Instead of:
> 
>     list(yourobj)
> 
> use:
> 
>     list(iter(yourobj))

Sigh... that's too bad.  I'll probably just get rid of the __len__
method instead, as list(yourobj) (list(myobj)?) is a more appealing
idiom than len(somebodysobj).

  Ian







More information about the Python-list mailing list