On Wed, 22 May 2013 03:59:55 +, Joseph L. Casale wrote:
> I was doing some work with the ldap module and required a ci dict that
> was case insensitive but case preserving. It turned out the cidict class
> they implemented was broken with respect to pop, it is inherited and not
> re implemente
I was doing some work with the ldap module and required a ci dict that was case
insensitive but case preserving. It turned out the cidict class they
implemented was
broken with respect to pop, it is inherited and not re implemented to work.
Before
I set about re-inventing the wheel, anyone know o
> "Bengt" == Bengt Richter <[EMAIL PROTECTED]> writes:
Bengt> I wonder if a dict with a general override hook for hashing
Bengt> all keys would be useful. E.g., a dict.__keyhash__ that
Bengt> would take key as arg and default as now returning
Bengt> key.__hash__() but that you
"Raymond Hettinger" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> More important than the percentage is the clarity of the resulting code
> and the
> avoidance of continous reinvention of workarounds.
>
> Separating tool features into a basic and an advanced version is common
>
> >Taken together, these six attributes/methods could cover many wished for
> >features for the 10% of the cases where a regular dictionary doesn't provide
the
> >best solution.
> You think as much as 10% ?
Rounded up from 9.6 ;-)
More important than the percentage is the clarity of the resultin
On Fri, 01 Apr 2005 23:04:42 GMT, "Raymond Hettinger" <[EMAIL PROTECTED]> wrote:
>[Bengt Richter]
>> I wonder if a dict with a general override hook for hashing all keys would be
>useful.
>> E.g., a dict.__keyhash__ that would take key as arg and default as now
>returning key.__hash__()
>> but th
[Bengt Richter]
> I wonder if a dict with a general override hook for hashing all keys would be
useful.
> E.g., a dict.__keyhash__ that would take key as arg and default as now
returning key.__hash__()
> but that you could override. Seems like this could potentially be more
efficient than key wrap
On Fri, 01 Apr 2005 18:52:00 GMT, "Raymond Hettinger" <[EMAIL PROTECTED]> wrote:
>[Ville Vainio]
>> I need a dict (well, it would be optimal anyway) class that stores the
>> keys as strings without coercing the case to upper or lower, but still
>> provides fast lookup (i.e. uses hash table).
>
>
>
[Ville Vainio]
> I need a dict (well, it would be optimal anyway) class that stores the
> keys as strings without coercing the case to upper or lower, but still
> provides fast lookup (i.e. uses hash table).
>>> class S(str):
def __hash__(self):
return hash(self.lower())
def __eq_
On 01 Apr 2005 15:55:58 +0300, Ville Vainio <[EMAIL PROTECTED]>
wrote:
>> "Daniel" == Daniel Dittmar <[EMAIL PROTECTED]> writes:
>
>Daniel> Ville Vainio wrote:
>
>>> I need a dict (well, it would be optimal anyway) class that
>>> stores the keys as strings without coercing the case
Ville Vainio wrote:
"Daniel" == Daniel Dittmar <[EMAIL PROTECTED]> writes:
Daniel> Ville Vainio wrote:
>> I need a dict (well, it would be optimal anyway) class that
>> stores the keys as strings without coercing the case to upper
>> or lower, but still provides fast lookup (i.e. u
> "Daniel" == Daniel Dittmar <[EMAIL PROTECTED]> writes:
Daniel> Ville Vainio wrote:
>> I need a dict (well, it would be optimal anyway) class that
>> stores the keys as strings without coercing the case to upper
>> or lower, but still provides fast lookup (i.e. uses hash
Ville Vainio wrote:
I need a dict (well, it would be optimal anyway) class that stores the
keys as strings without coercing the case to upper or lower, but still
provides fast lookup (i.e. uses hash table).
Store the original key together with the value and use a lowercase key
for lookup.
only a
I need a dict (well, it would be optimal anyway) class that stores the
keys as strings without coercing the case to upper or lower, but still
provides fast lookup (i.e. uses hash table).
>> d = CiDict([('Hi', 12),('hoho',13)])
>> d['hi']
12
>> d.keys()
['Hi','hoho']
Note that 'Hi' preserved t
14 matches
Mail list logo