[Python-Dev] PEP 455: TransformDict (original) (raw)
Antoine Pitrou solipsis at pitrou.net
Wed Oct 30 20:09:59 CET 2013
- Previous message: [Python-Dev] PEP 455: TransformDict
- Next message: [Python-Dev] PEP 455: TransformDict
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On Wed, 30 Oct 2013 16:34:33 +0000 Nigel Small <nigel at nigelsmall.com> wrote:
It strikes me that there could be an alternative approach to some of the use cases discussed here. Instead of a new type of dictionary, the case-insensitivity problem could be solved with something akin to a * CaseInsensitiveString* class used for keys within a standard dictionary. This would be very similar to a normal string except with comparison and hashing. It would mean that CaseInsensitiveString("Foo") is considered equal to CaseInsensitiveString("foo") and allow code such as the following:
And how does a case-insensitive string compare with a normal (case-sensitive) string? This is a can of worms.
(if you answer, please don't answer in this thread but open a separate one for case-insensitive strings, thanks)
Regards
Antoine.
- Previous message: [Python-Dev] PEP 455: TransformDict
- Next message: [Python-Dev] PEP 455: TransformDict
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]