Slicing iterables in sub-generators without loosing elements

Joshua Landau joshua.landau.ws at gmail.com
Mon Oct 1 15:53:59 EDT 2012


On 1 October 2012 09:19, Mark Lawrence <breamoreboy at yahoo.co.uk> wrote:

> On 01/10/2012 01:58, 88888 Dihedral wrote:
>
>>
>> Your question seems vague to me. If you know you are storing
>> only immutable tuples in a list, then the way to iterate is simple.
>>
>>
> Does Python have a magic method that let's me use mutable tuples?  I'd
> also like immutable lists.  Is it worth raising a feature request on the
> bug tracker?


Whilst your question is valid, 88888 Dihedral is a bot.

[Lazy] Answers to your questions: no and no.

Python's tuples are immutable, except from C. They are made this way so
program with that in mind, I guess.

That said, an immutable list *is* a tuple and vice-versa, effectively.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20121001/12e46542/attachment.html>


More information about the Python-list mailing list