On Jan 25, 2017 8:16 AM, "Joe Jevnik" wrote:
List, set, and dict comprehensions compile like:
# input
result = [expression for lhs in iterator_expression]
# output
def comprehension(iterator):
out = []
for lhs in iterator:
out.append(expression)
return out
result = comprehe
On Wed, Jan 25, 2017 at 6:28 AM, Joe Jevnik wrote:
> That was a long way to explain what the problem was. I think that that
> solution is to stop using `yield` in comprehensions because it is
> confusing, or to make `yield` in a comprehension a syntax error.
>
> Thanks for the very clear explanat
On Thu, Jan 26, 2017 at 2:33 AM, Antoine Pitrou wrote:
> On Wed, 25 Jan 2017 20:54:02 +0900
> INADA Naoki wrote:
>>
>> ## Stripped annotation + without pydebug
>
> Does this mean the other measurements were done with pydebug enabled?
> pydebug is not meant to be used on production systems so, wit
On 25.01.2017 07:28, Joe Jevnik wrote:
That was a long way to explain what the problem was. I think that that
solution is to stop using `yield` in comprehensions because it is
confusing, or to make `yield` in a comprehension a syntax error.
Same here; mixing comprehensions and yield (from)
On Wed, 25 Jan 2017 20:54:02 +0900
INADA Naoki wrote:
>
> ## Stripped annotation + without pydebug
Does this mean the other measurements were done with pydebug enabled?
pydebug is not meant to be used on production systems so, without
wanting to disparage the effort this went into these measurem
Hello Dahui,
So I'll wear my downstream maintainer hat and try to elaborate on the situation
that you are facing.
Currently Red Hat does not ship Python 3 with rhel 7, so it is not supported.
However package maintainers have created a SPEC file for python 3 that works
for EPEL7 (aka centos7 or
List, set, and dict comprehensions compile like:
# input
result = [expression for lhs in iterator_expression]
# output
def comprehension(iterator):
out = []
for lhs in iterator:
out.append(expression)
return out
result = comprehension(iter(iterator_expression))
When you make
More detailed information:
## With annotations
=== tracemalloc stat ===
traced: (46969277, 46983753)
18,048,888 / 181112
File "", line 488
File "", line 780
File "", line 675
=== size by types ===
dict 9,083,816 (8,870.91KB) / 21846 = 415.811bytes (21.38%)
tuple
On 25 January 2017 at 07:01, Chris Angelico wrote:
> >>> [(yield 1) for x in range(10)]
> > at 0x10cd210f8>
>
This is an old bug, see e.g. http://bugs.python.org/issue10544
The ``yield`` inside comprehensions is bound to the auxiliary function.
Instead it should be bound to an enclosing functi