Re: case insensitive dictionary

2006-11-27 Thread John Henry
quot;Dog" > > If you do: > > Py> pets['Cat'] = 2 > Py> pets['Dog'] = 3 > Py> pets['DOG'] = 4 > Py> pets['cat'] += 5 > Py> pets.keys() > > What should the result be? > > "['Cat', 'Dog&#

Re: case insensitive dictionary

2006-11-27 Thread Fuzzyman
John Henry wrote: > I believe the standard dictionary should be amened to allow the use of > case insensitive keys - as an option. I found some work done by others > to do that at: > > http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/283455 > > but the problem with that approach is that th

Re: case insensitive dictionary

2006-11-27 Thread J. Clifford Dyer
sult be? "['Cat', 'Dog']" or "['cat', 'DOG']"? That is to say, if you use a new case in redefining the values of your case insensitive dictionary, does the key take on the new case, or will it always and forever be the case originally given to it? Cheers, Cliff -- http://mail.python.org/mailman/listinfo/python-list

Re: case insensitive dictionary

2006-11-26 Thread John Henry
I don't think that's sufficient. See how many methods the author of http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/283455 had to redefine. Rob Williscroft wrote: > John Henry wrote in news:1164494606.514366.124810 > @l39g2000cwd.googlegroups.com in comp.lang.python: > > > I believe the s

Re: case insensitive dictionary

2006-11-25 Thread tomasz . kulawik . groups . 1
John Henry napisal(a): > I believe the standard dictionary should be amened to allow the use of > case insensitive keys - as an option. I found some work done by others > to do that at: > > http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/283455 > > but the problem with that approach is tha

Re: case insensitive dictionary

2006-11-25 Thread vbgunz
John Henry wrote: > I believe the standard dictionary should be amened to allow the use of > case insensitive keys - as an option. I found some work done by others > to do that at: > > http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/283455 > > but the problem with that approach is that th

Re: case insensitive dictionary

2006-11-25 Thread Rob Williscroft
John Henry wrote in news:1164494606.514366.124810 @l39g2000cwd.googlegroups.com in comp.lang.python: > I believe the standard dictionary should be amened to allow the use of > case insensitive keys - as an option. class idict( dict ): class __istr( str ): def __eq__( self, other ):

case insensitive dictionary

2006-11-25 Thread John Henry
I believe the standard dictionary should be amened to allow the use of case insensitive keys - as an option. I found some work done by others to do that at: http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/283455 but the problem with that approach is that they lowercase the keys immediate