Albert-Jan Roskam writes:
> The basic problem is that kwds is a regular, unordered dict […]
(Albert, you are probably aware that the above passage is not what you
wrote. But your message shows it indistinguishable from your other text.
Please teach your email client to compose quoted material u
INADA Naoki writes:
> On Sat, Apr 22, 2017 at 10:41 PM, Ben Finney
> wrote:
> > So, I would recommend continuing to code as though ‘dict’ is not
> > ordered, at least until a Python version is released with a clear
> > statement that ordering can be relied upon.
>
> While dict's order is implem
On Sat, Apr 22, 2017 at 10:41 PM, Ben Finney wrote:
> INADA Naoki writes:
>
>> From Python 3.6, keyword arguments are ordered. So the docstring is
>> outdated.
>
> (Thank you, Inada-san, for the implementation!)
>
> The announcement of the change specifies that we should not rely on
> ordered ‘di
From: eryk sun
Sent: Saturday, April 22, 2017 7:59 AM
To: Python Main
Cc: Albert-Jan Roskam
Subject: Re: OrderedDict with kwds
On Fri, Apr 21, 2017 at 6:08 PM, Albert-Jan Roskam
wrote:
> Would the insertion order be preserved if the last line were to be
> replaced with:
>
INADA Naoki writes:
> From Python 3.6, keyword arguments are ordered. So the docstring is
> outdated.
(Thank you, Inada-san, for the implementation!)
The announcement of the change specifies that we should not rely on
ordered ‘dict’:
The order-preserving aspect of this new implementation i
Albert-Jan Roskam wrote:
> For regular dicts I like to use the dict() function because the code is
> easier to write and read. But OrderedDict() is not equivalent to dict():
> In the docstring of collections.OrderedDict it says "keyword arguments are
> not recommended because their insertion order
On Sat, Apr 22, 2017 at 3:08 AM, Albert-Jan Roskam
wrote:
> For regular dicts I like to use the dict() function because the code is
> easier to write and read. But OrderedDict() is not equivalent to dict():
> In the docstring of collections.OrderedDict it says "keyword arguments are
> not recomm
On Fri, Apr 21, 2017 at 6:08 PM, Albert-Jan Roskam
wrote:
> Would the insertion order be preserved if the last line were to be
> replaced with:
>
> if kwds:
> for k, v in kwds.items():
> self[k] = v
> if args:
> self.__update(*args) # no **kwds!
The basic problem is that kwds is
On Friday, May 20, 2016 at 7:15:38 AM UTC+2, silve...@gmail.com wrote:
> On Wednesday, May 18, 2016 at 2:25:16 PM UTC+2, Peter Otten wrote:
> > Chris Angelico wrote:
> >
> > > On Wed, May 18, 2016 at 7:28 PM, Peter Otten <__pete...@web.de> wrote:
> > >> I don't see an official way to pass a custom
On Wednesday, May 18, 2016 at 2:25:16 PM UTC+2, Peter Otten wrote:
> Chris Angelico wrote:
>
> > On Wed, May 18, 2016 at 7:28 PM, Peter Otten <__pete...@web.de> wrote:
> >> I don't see an official way to pass a custom dict type to the library,
> >> but if you are not afraid to change its source co
Chris Angelico wrote:
> On Wed, May 18, 2016 at 7:28 PM, Peter Otten <__pete...@web.de> wrote:
>> I don't see an official way to pass a custom dict type to the library,
>> but if you are not afraid to change its source code the following patch
>> will allow you to access the value of dictionaries
On Wed, May 18, 2016 at 7:28 PM, Peter Otten <__pete...@web.de> wrote:
> I don't see an official way to pass a custom dict type to the library,
> but if you are not afraid to change its source code the following patch
> will allow you to access the value of dictionaries with a single entry as
> d[
silver0...@gmail.com wrote:
> Hi all,
>
> I have a understanding problem with return values from xmltodict.
>
> I have a xml file. Content:
>
>
>
>
>
>
>
>
>
> With code
>
> __f_name = ''
> with open(__f_name) as __fd:
> __doc = xmltodict.parse(__fd.read())
>
> __doc
>
>
On Wed, May 18, 2016 at 6:32 PM, wrote:
> Hi all,
>
> I have a understanding problem with return values from xmltodict.
>
> I have a xml file. Content:
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> No prints __doc['profiles']['profile']['package'][0]['@package-id']:
>
> u'0964-gpg4
Too bad that's not (using python2.7)
'ordered_dict_generator' ((), {}) 1.089588 sec
Anyway thanks for your hint!
> Hi,
>
>
>
> is there a way building an OrderedDict faster?
>
>
>
> Thanks in advance
>
> Christian
>
>
>
> @timeit
>
> def ordered(n=10):
>
> d = OrderedDict()
>
On 10/29/2012 8:36 AM, Christian wrote:
Hi,
is there a way building an OrderedDict faster?
Thanks in advance
Christian
@timeit
def ordered(n=10):
d = OrderedDict()
for i in xrange(n):
d['key'+str(i)] = i
return d
try d = OrderedDict(['key'+str(i),i for i in xrange
16 matches
Mail list logo