Hi Brice
Good comment. I liked it. Not badly off-topic I think, because it
looks to be an interesting work-around for the original problem. You
wrote
> But for dataclasses, I'd find it quite useful to have
> {**my_data_class}
> be a shortcut to
> {**dataclasses.asdict(my_data_class)}
How about w
Le 13/09/2018 à 10:07, Jonathan Fine a écrit :
Now for my opinions. (Yours might be different.)
First, it is my opinion that it is not reasonable to insist that the
argument after ** must be a mapping. All that is required to construct
a dictionary is a sequence of (key, value) pairs. The dict(i
Someone wrote:
Granted, my only strong argument is that the ** unpacking operator
depends on this method to do its job, and it's currently alone amongst
Python's operators in depending on a non-dunder to do so
I like this argument. And I think it's important. Here's some background fa
The dict keys method has other benefits beyond iteration. For example, it
provides a set-like interface.
On Wed, Sep 12, 2018, 10:50 PM Elias Tarhini wrote:
> On Wed, Sep 12, 2018 at 4:42 PM Michael Selik wrote:
>
>> You want to have a Mapping that does not supply a keys method? What use
>> cas
On Wed, Sep 12, 2018 at 4:42 PM Michael Selik wrote:
> You want to have a Mapping that does not supply a keys method? What use
> case motivated your proposal?
>
Yes, my proposal was to consider allowing __iter__() to subsume keys()
entirely, for the reasons outlined in my second email -- which
Elias,
I'm a little confused about what you're suggesting. You want to have a
Mapping that does not supply a keys method? What use case motivated your
proposal?
On Mon, Sep 10, 2018, 7:04 PM Elias Tarhini wrote:
> This has been bouncing around in my head for a while regarding the
> requisite ke
> -Original Message-
> From: Python-ideas list=sdamon@python.org> On Behalf Of Serhiy Storchaka
> Sent: Tuesday, September 11, 2018 2:54 AM
> To: python-ideas@python.org
> Subject: Re: [Python-ideas] __iter__(), keys(), and the mapping protocol
>
> 11.09
11.09.18 05:04, Elias Tarhini пише:
This has been bouncing around in my head for a while regarding the
requisite keys() method on mappings:
How come the ** unpacking operator, a built-in language feature, relies
on a non-dunder to operate?
To me, I mean to say, requiring that classes impleme
-
> From: Python-ideas list=sdamon@python.org> On Behalf Of Elias Tarhini
> Sent: Monday, September 10, 2018 10:04 PM
> To: Python-Ideas
> Subject: [Python-ideas] __iter__(), keys(), and the mapping protocol
>
> This has been bouncing around in my head for a while re
This has been bouncing around in my head for a while regarding the
requisite keys() method on mappings:
How come the ** unpacking operator, a built-in language feature, relies on
a non-dunder to operate?
To me, I mean to say, requiring that classes implement keys() – a method
whose name is totall
10 matches
Mail list logo