Daniel Stutzbach wrote:

> The use came I'm thinking of is this:
> 
> A container type or an iterable where the first few entries contain
> one type of information, and the rest of the entries are something
> that will either be discard or run through for-loop.

If you know you're dealing with an iterator x, then
after a, b, c, *d = x, d would simply be x, so all
you really need is a function to get the first n
items from x.

> I'm suggesting, that:
> 
> - lists return lists
> - tuples return tuples
> - XYZ containers return XYZ containers
> - non-container iterables return iterators.

How do you propose to distinguish between the last
two cases? Attempting to slice it and catching an
exception is not acceptable, IMO, as it can too
easily mask bugs.

--
Greg
_______________________________________________
Python-3000 mailing list
Python-3000@python.org
http://mail.python.org/mailman/listinfo/python-3000
Unsubscribe: 
http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com

Reply via email to