Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #75443

Re: Dict when defining not returning multi value key error

References <CAFBK5a-hjukHaHOim4tL_RerXiHsFP03eaQoN42yGfeCJ9NZPg@mail.gmail.com>
From Ian Kelly <ian.g.kelly@gmail.com>
Date 2014-07-31 15:15 -0600
Subject Re: Dict when defining not returning multi value key error
Newsgroups comp.lang.python
Message-ID <mailman.12491.1406841382.18130.python-list@python.org> (permalink)

Show all headers | View raw


On Thu, Jul 31, 2014 at 5:24 AM, Dilu Sasidharan <dilu.seven@gmail.com> wrote:
> Hi,
>
> I am wondering why the dictionary in python not returning multi value key
> error when i define something like
>
> p = {'k':"value0",'k':"value1"}
>
> key is string immutable and sometimes shares same id.
>
> also if the key is immutable and have different ids.
>
> like
>
> p = {'1':"value0",'1.0':"value1"}

In this latter case note that '1' and '1.0' are not equal, so this
will simply result in two separate entries in the dict anyway.

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Re: Dict when defining not returning multi value key error Ian Kelly <ian.g.kelly@gmail.com> - 2014-07-31 15:15 -0600

csiph-web