I was previously constructing an object like this:
tb = TemporalBehavior(**kwargs, **parameters)
where various subclasses were doing things like
def __init__(self, some_kwarg, some_other_kwargs, some_parameter,
some_other_parameter):
Then I realized that I want to pass the paramters as a dicti
24.05.18 11:38, Neil Girdhar пише:
I was previously constructing an object like this:
tb = TemporalBehavior(**kwargs, **parameters)
where various subclasses were doing things like
def __init__(self, some_kwarg, some_other_kwargs, some_parameter,
some_other_parameter):
Then I realized that I
To give this old horse a kick: The "given" syntax in the recent thread
could give a nice solution for the problem that started this thread.
Instead of my proposal of:
smooth_signal = [average := (1-decay)*average + decay*x for x in signal
from average=0.]
We could use given for both the in-loo
On Thu, May 24, 2018 at 02:06:03PM +0200, Peter O'Connor wrote:
> To give this old horse a kick: The "given" syntax in the recent thread
> could give a nice solution for the problem that started this thread.
Your use-case is one of the motivating examples for PEP 572. Unless I'm
confused, your us
On Thu, May 24, 2018 at 8:00 AM Serhiy Storchaka
wrote:
> 24.05.18 11:38, Neil Girdhar пише:
> > I was previously constructing an object like this:
> >
> > tb = TemporalBehavior(**kwargs, **parameters)
> >
> > where various subclasses were doing things like
> >
> > def __init__(self, some_kwarg,
I have read most of the PEP 572 related threads, but I don't think I've
seen this idea. As many other people mentioned, Python already allows a
trick to introduce local bindings in generator expressions and list
comprehensions. This can be achieved by adding a "for var in []"
clause. I propose t
This idea was mentioned (by me) at a time yes, but wasn't written in the
document.
I think one of the thing was that it would make the grammar non LL1 because
when seeing the token "for" in a list comprehension it wouldn't know in
advance if it's the loop or the assignment.
And also, it might con
On Thu, May 24, 2018 at 12:04 PM Robert Vanden Eynde
wrote:
> This idea was mentioned (by me) at a time yes, but wasn't written in the
document.
Can you point me to a specific post? There were so may that I must have
missed that one.
> I think one of the thing was that it would make the gramma
It was a long time ago I couldn't easily find the post but that's alright,
you refreshed the idea :)
Let's see what others think of for x =
I also remembered some languages (like lua) use for x = range (5)
interchangeably with for x in range (5) and guido said it will never make
such a thing, for
24.05.18 18:46, Neil Girdhar пише:
p = parameters.pop('some_parameter')
q = parameters.pop('some_other_parameter')
if parameters:
raise ValueError
parameters is a Mapping subclass and I don't want to destroy it
Oh, right. It works if parameters is a var-keyword parameter.
24.05.18 18:54, Alexander Belopolsky пише:
I have read most of the PEP 572 related threads, but I don't think I've
seen this idea. As many other people mentioned, Python already allows a
trick to introduce local bindings in generator expressions and list
comprehensions. This can be achieved b
I worry about the use of "for" because it will come up in contexts where
"for" already has other meanings. In the case of the example list
comprehension, the word "for" is being used to mean two entirely different
things in a single expression, that seems rather precarious to me.
I prefer "with" i
I have had plenty of instances where destructuring a mapping would have be
convenient. Relating to iterable destructuring, I would expect the syntax
to be of the form "variable: key". I also think the curly-braces make it
harder to visually parse what's going on. So I might suggest something a
litt
On 2018-05-24 18:08, George Leslie-Waksman wrote:
I have had plenty of instances where destructuring a mapping would have
be convenient. Relating to iterable destructuring, I would expect the
syntax to be of the form "variable: key". I also think the curly-braces
make it harder to visually pars
On Thu, May 24, 2018 at 11:54:09AM -0400, Alexander Belopolsky wrote:
> I have read most of the PEP 572 related threads, but I don't think I've
> seen this idea. As many other people mentioned, Python already allows a
> trick to introduce local bindings in generator expressions and list
> comprehe
This is another suggestion for new syntax for assigning a name to the value
of the predicate in an if, elif or while statement. It still uses `as` for
its keyword, but with (more flexible) params instead of a direct assignment.
It mashes up the if/while, def/class and for-in grammars, so it still
> But I do have a mathematics background, and I don't remember ever seeing
> "for x = value" used in the sense you mean.
That's so because in mathematics, "for" is spelled ":" as in
{2*a* : *a*∈*Z*}
If you can read the above, you should not have trouble reading
{2*a* + *b* : *a*∈*Z *: *b = *1
On Thu, May 24, 2018, 11:47 Alexander Belopolsky <
alexander.belopol...@gmail.com> wrote:
> > But I do have a mathematics background, and I don't remember ever seeing
> > "for x = value" used in the sense you mean.
>
> That's so because in mathematics, "for" is spelled ":" as in
>
> {2*a* : *a*∈*
On Thu, May 24, 2018 at 4:59 PM Matt Arcidy wrote:
>
>
> On Thu, May 24, 2018, 11:47 Alexander Belopolsky <
> alexander.belopol...@gmail.com> wrote:
>
>> > But I do have a mathematics background, and I don't remember ever
>> seeing
>> > "for x = value" used in the sense you mean.
>>
>> That's so
On Tue May 22 22:08:40 (-0400), Chris Barker wrote:
> while asyncio is in the standard library, it is not intended to be THE
async event loop implementation
I'm surprised this is true - with dedicated syntax like async def/await,
it's still not THE async event loop implementation? As far as I know
On Thu, May 24, 2018, 14:48 Alexander Belopolsky <
alexander.belopol...@gmail.com> wrote:
>
>
> On Thu, May 24, 2018 at 4:59 PM Matt Arcidy wrote:
>
>>
>>
>> On Thu, May 24, 2018, 11:47 Alexander Belopolsky <
>> alexander.belopol...@gmail.com> wrote:
>>
>>> > But I do have a mathematics backgroun
21 matches
Mail list logo