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
>>
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
>> Have y’all seen ptpython’s autocomplete and syntax highlighting
>> features?
>
> No. Do you have a link? What specific features have excited you?
IPython autocomplete is now powered by ptpython and Jedi. So if you’ve used it
recently you’re already familiar with it.
In the context of
Not totally convinced about this. It would require PEP writers to fully
implement their proposed feature, people can usually get a pretty good idea of
how a feature is supposed to work through PEPs (most of which are extremely
well written), and these "mods" wouldn't be used in production code
On Sat, Sep 8, 2018 at 4:17 AM Jonathan Fine wrote:
> I thank Steve D'Aprano for pointing me to this real-life (although
> perhaps extreme) code example
>
>
> https://github.com/Tinche/aiofiles/blob/master/aiofiles/threadpool/__init__.py#L17-L37
It's hard to know from just a brief glance how
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
On Wed, Sep 12, 2018 at 05:15:51PM -0400, James Lu wrote:
> Have y’all seen ptpython’s autocomplete and syntax highlighting
> features?
No. Do you have a link? What specific features have excited you?
The standard Python REPL now comes with autocomplete turned on by
default. How does that
Have y’all seen ptpython’s autocomplete and syntax highlighting features?
Ptpython, usually used as a cli application, might be worth integrating into
IDLE.
___
Python-ideas mailing list
Python-ideas@python.org
On 12/09/2018 16:38, Steven D'Aprano wrote:
> On Wed, Sep 12, 2018 at 03:58:25PM +0100, Jonathan Fine wrote:
>
>> My question is about correctly implementing of __params__ as a keyword
>> identifier, with semantics as in Steve B's code snippet above.
>
> The semantics of Steve's code snippet
On Wed, Sep 12, 2018 at 03:58:25PM +0100, Jonathan Fine wrote:
> My question is about correctly implementing of __params__ as a keyword
> identifier, with semantics as in Steve B's code snippet above.
The semantics of Steve's code snippet are ambiguous.
> Here's my question: Do you think
On Wed, Sep 12, 2018 at 06:59:44AM -0700, Ethan Furman wrote:
> On 09/12/2018 05:17 AM, Steven D'Aprano wrote:
[...]
> >We could solve this race condition with locking, or by making the pair
> >of steps:
[...]
> >I'm not an expert on threaded code, so it is possible I've missed some
>
Hi Steve
Thank you for your prompt reply. You wrote:
> I'll confess that I couldn't work out what Steve B's code snippet was
> supposed to mean:
> params = {k:v for k,v in __params__ if k in parent.a_method.keys()}
The Zen of Python (which might not apply here) says:
In the face of
On Wed, Sep 12, 2018 at 02:23:34PM +0100, Jonathan Fine wrote:
> Steve Barnes suggested adding __params__, as in
>
> > def a_method(self, cr, uid, ids, values, context=None):
> >...
> >params = {k:v for k,v in __params__ if k in parent.a_method.keys()}
> ># Possibly
This is off-topic, but you might enjoy reading it.
I got an email today, whose entire body text was
Cannot read property 'get' of null
It reminded me of our discussions of None-aware operators. And also
Errors should never pass silently.
Unless explicitly silenced.
--
Jonathan
On 09/12/2018 05:17 AM, Steven D'Aprano wrote:
> Indeed. Each time you call locals(), it returns a new dict with a
snapshot of the current local namespace. Because it all happens inside
the same function call, no external thread can poke inside your current
call to mess with your local
Steve Barnes suggested adding __params__, as in
> def a_method(self, cr, uid, ids, values, context=None):
>...
>params = {k:v for k,v in __params__ if k in parent.a_method.keys()}
># Possibly add some additional entries here!
>super(self,
> On 8 Sep 2018, at 14:23, Anders Hovmöller wrote:
>
>> To me, the "30% of all arguments" deserves more careful examination.
>> Does the proposal significant improve the reading and writing of this
>> code? And are there other, perhaps better, ways of improving this
>> code?
>
> Maybe my tool
On Tue, Sep 11, 2018 at 04:57:16PM +0100, Jonathan Fine wrote:
> Summary: locals() and suggestion __params__ are similar, and roughly
> speaking each can be implemented from the other.
You cannot get a snapshot of the current locals just from the function
parameters, since the current locals
> -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.18 05:04, Elias Tarhini
19 matches
Mail list logo