Generic dictionary

Chris Angelico rosuav at gmail.com
Sun Nov 20 08:28:48 EST 2016


On Mon, Nov 21, 2016 at 12:12 AM, Thorsten Kampe
<thorsten at thorstenkampe.de> wrote:
> Chris, it's up to the consumer to decide which key/keyfunc to use.
> The lists as keys (that is first element in an tuple) are created on
> the fly and not used for anything. They are mutable but not mutated.
>
> Mutating the list would be like mutating a list you're iterating
> through: just don't do it.

Then use tuples. Job done! :)

ChrisA



More information about the Python-list mailing list