On Mon, Dec 09, 2002 at 11:06:23AM -0200, Johan Dahlin wrote:
> 
> In some cases, not too many pygtk accepts both lists and tuples.
> But be careful when doing this patch, because a string is also a
> Sequence. And what about user defined sequences? Isn't anything that
> allows a __getitem__ a sequence? Should an iterator be accepted too?
>
Probably, if you want to be consistent with Python. That is sort of the
whole point of __getitem__: an object is a sequence based on the abstract
protocols it supports rather than some concrete implementation.
I would suggest that the behavior be equivalent to the behavior if one
applied the tuple function on the argument.

example(seq)  # would be equivalent to
example(tuple(seq))

This would allow any sequence including iterators and generators, which
is consistent with other Python extensions like Numeric and PIL, and
many more.

        --jkl
_______________________________________________
pygtk mailing list   [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/

Reply via email to