Re: case insensitive dictionary

2006-11-27 Thread John Henry
I believe that if you redefine the value, the key should not change. So, yes, I would expect that they value of the key to remain as they were. J. Clifford Dyer wrote: > John Henry wrote: > >print pets.keys() > > > > should print: > > > > "Cat", "Dog" > > If you do: > > Py> pets['Cat'] = 2 >

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
John Henry wrote: >print pets.keys() > > should print: > > "Cat", "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']" or "['cat', 'DOG']"? That is to say, if you use a new case in r

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 ):