[Python-Dev] d.get_key(key) -> key?
Martin v. Loewis
06 Jun 2002 08:44:30 +0200
"Daniel 'eikeon' Krech" <email@example.com> writes:
> Sorry, seems to me like it was on topic for python-dev seeing as
> python dictionaries do not currently have the functionality I
It sure is possible. You have been essentially asking the question
"How do I get the canonical member of an equivalence class in Python",
for which the canonical answer is "you intern the one member of each
equivalence class". As Barry Scott explains, this is best done with an
You are also asking "how do I efficiently implement sets in
Python". This is almost a FAQ, the answer is "if the elements are
hashable, use a dictionary".