On 2018-07-31 20:53, Jonathan Fine wrote:
Stephan Houben wrote:
Nope, the introduction of the tmp variable changed the semantics. It isn't a
"chain" anymore so it breaks shortcutting.
I'm confused. Assume 'a' is not defined.
With Python's dot (attribute access) we have
a.b.c
NameError: nam
Stephan Houben wrote:
> Nope, the introduction of the tmp variable changed the semantics. It isn't a
> "chain" anymore so it breaks shortcutting.
I'm confused. Assume 'a' is not defined.
With Python's dot (attribute access) we have
>>> a.b.c
NameError: name 'a' is not defined
>>> a.(b.c)
SyntaxE
On Tue, Jul 31, 2018 at 02:14:19PM -0400, David Mertz wrote:
> On Tue, Jul 31, 2018, 1:47 PM Steven D'Aprano wrote:
>
> > Yes it is. Rhodri is correct, although I admit that I hadn't realised
> > this point myself until he pointed it out. (That is why until now I've
> > been writing examples like
Op di 31 jul. 2018 20:49 schreef Jonathan Fine :
> David Mertz wrote:
>
> > `spam?.eggs?.cheese?.aardvark` is NOT redundant for
> > `spam?.eggs.cheese.aardvark`. The two expressions simply do different
> > things [...]
>
> I agree, assuming ?. is a binary operator.
It isn't.
Given this, in Py
David Mertz wrote:
> `spam?.eggs?.cheese?.aardvark` is NOT redundant for
> `spam?.eggs.cheese.aardvark`. The two expressions simply do different
> things [...]
I agree, assuming ?. is a binary operator. Given this, in Python (+
PEP 505) one can write
tmp = spam ?. eggs
val1 = tmp ?. ch
On 31/07/18 18:46, Steven D'Aprano wrote:
n Mon, Jul 30, 2018 at 12:41:20PM -0500, Abe Dillon wrote:
[Rhodri James]
On 29/07/18 16:12, Abe Dillon wrote:
> spam?.eggs.cheese.aardvark # why would you ever do this?
If you knew that if you really have something in "spam", your program
guarantee
On Tue, Jul 31, 2018, 1:47 PM Steven D'Aprano wrote:
> Yes it is. Rhodri is correct, although I admit that I hadn't realised
> this point myself until he pointed it out. (That is why until now I've
> been writing examples like "spam?.eggs?.cheese?.aardvark" which is
> redundant.)
>
Again, one of
On Mon, Jul 30, 2018 at 12:41:20PM -0500, Abe Dillon wrote:
[Rhodri James]
> > On 29/07/18 16:12, Abe Dillon wrote:
> > > spam?.eggs.cheese.aardvark # why would you ever do this?
> >
> > If you knew that if you really have something in "spam", your program
> > guarantees it will have an "eggs"
31.07.18 00:26, Oscar Benjamin пише:
On 30 July 2018 at 20:15, Rudy Matela wrote:
Yielding from a with block should be discouraged rather than given
special syntax. There is essentially a contradiction between the
meaning/purpose of yield (suspend indefinitely) and with (definitely
call __exit__
On 30/07/18 20:15, Rudy Matela wrote:
Hello,
Do you think it would be nice to allow with statements inside genexps or
list comprehensions? The functions __enter__ and __exit__ would be
automatically called as iterables are traversed. I am thinking of
drafting a PEP about this. Examples:
I w
I like type() a lot, and the attributes dict it takes as argument works
with lambda.
My use case is just a python module for a framework provides a default
instance for some model, and I thought it would be cool to just change a
method without going through
I'm really bad at defending ideas, spec
11 matches
Mail list logo