[Python-Dev] interning (original) (raw)
Antoine Pitrou solipsis at pitrou.net
Sat Oct 24 20:13:44 CEST 2009
- Previous message: [Python-Dev] Retrieve an arbitrary element from a set without removing it
- Next message: [Python-Dev] Retrieve an arbitrary element from a set without removing it
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Alexander Belopolsky <alexander.belopolsky gmail.com> writes:
AB> I disagree with Martin. I think interning is a set AB> operation and it is unfortunate that set API does not AB> support it directly. ML> I disagree with Alexander's last remark in several respects: [...] ML> The operation "give me the member equal but not identical ML> to E" is conceptually a lookup operation; the mathematical set ML> construct has no such operation, and the Python set models ML> it closely. IOW, set is not a dict with key==value.
This looks like a debate of purity vs. practicality.
I don't have any opinion on a Python-facing API, but the interpreter's dict of interned strings could probably converted to a set as a simple optimization.
Regards
Antoine.
- Previous message: [Python-Dev] Retrieve an arbitrary element from a set without removing it
- Next message: [Python-Dev] Retrieve an arbitrary element from a set without removing it
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]