Why no list as dict key?
Lars Liedtke
lal at solute.de
Mon Apr 25 10:20:09 EDT 2022
Thx, didn't see it that way yet.
--
Lars Liedtke
Software Entwickler
Phone:
Fax: +49 721 98993-
E-mail: lal at solute.de
solute GmbH
Zeppelinstraße 15
76185 Karlsruhe
Germany
Marken der solute GmbH | brands of solute GmbH
billiger.de | Shopping.de
Geschäftsführer | Managing Director: Dr. Thilo Gans, Bernd Vermaaten
Webseite | www.solute.de
Sitz | Registered Office: Karlsruhe
Registergericht | Register Court: Amtsgericht Mannheim
Registernummer | Register No.: HRB 110579
USt-ID | VAT ID: DE234663798
Informationen zum Datenschutz | Information about privacy policy
http://solute.de/ger/datenschutz/grundsaetze-der-datenverarbeitung.php
Am 25.04.22 um 15:54 schrieb Peter J. Holzer:
> On 2022-04-25 15:13:19 +0200, Lars Liedtke wrote:
>> May I stupidly ask, why one would want to use an iterable (even immutable)
>> as dict key?
> A string is also an immutable iterable, so this is probably even the
> most common case.
>
> As for more complex data structures:
>
> * Tuples or immutable dicts are a good fit if want to group records by
> subset of their attributes (think "group by" in SQL)
>
> * Objects in general are often though of as units, even if they have
> composite values and you might want to look up something by that
> value.
>
> hp
>
>
More information about the Python-list
mailing list