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