In a message of Fri, 29 May 2015 14:13:16 +0100, Oscar Benjamin writes:
>Python 2.7.2 (1.8+dfsg-2, Feb 19 2012, 19:18:08)
>[PyPy 1.8.0 with GCC 4.6.2]
>
>$ pypy gencm.py
>Entering
>End of program
>
>The __exit__ method was not called at all under pypy. Even if I don't
>keep a reference to g outsid
On 29/05/2015 15:23, Steven D'Aprano wrote:
On Thu, May 28, 2015 at 10:16:00AM +0200, Peter Otten wrote:
As interesting as this may be does it really belong on the tutor mailing
list?
--
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our language.
On Fri, May 29, 2015 at 03:01:50PM +0100, Oscar Benjamin wrote:
> On 29 May 2015 at 14:29, Steven D'Aprano wrote:
> > On Thu, May 28, 2015 at 10:16:00AM +0200, Peter Otten wrote:
> >
> >> Even if you limit yourself to CPython there is another effect: the order of
> >> execution may not meet one's
On Thu, May 28, 2015 at 10:16:00AM +0200, Peter Otten wrote:
> Even if you limit yourself to CPython there is another effect: the order of
> execution may not meet one's expectations/requirements:
No, wait, forget everything I said in my previous post. This is
*clearly* a case where our expecta
On 29 May 2015 at 14:29, Steven D'Aprano wrote:
> On Thu, May 28, 2015 at 10:16:00AM +0200, Peter Otten wrote:
>
>> Even if you limit yourself to CPython there is another effect: the order of
>> execution may not meet one's expectations/requirements:
>
> [snip example]
>
> That's an interesting ex
I have to think further on most of your post, but for the last point:
On Fri, May 29, 2015 at 02:13:16PM +0100, Oscar Benjamin wrote:
> Now run the same under pypy:
>
> $ pypy --version
> Python 2.7.2 (1.8+dfsg-2, Feb 19 2012, 19:18:08)
> [PyPy 1.8.0 with GCC 4.6.2]
>
> $ pypy gencm.py
> Enteri
On Thu, May 28, 2015 at 10:16:00AM +0200, Peter Otten wrote:
> Even if you limit yourself to CPython there is another effect: the order of
> execution may not meet one's expectations/requirements:
[snip example]
That's an interesting example, and I can't tell if that's a
problem with your (and
On 29 May 2015 at 13:38, Steven D'Aprano wrote:
>
> Otherwise I stand by my earlier position that you are misinterpreting
> what it means to exit a with block. Pausing it to yield is not an exit.
>
> I did an experiment, where I tried to break the finalisation
> guarantee using break, return and r
On Thu, May 28, 2015 at 10:46:26AM +0100, Oscar Benjamin wrote:
> I'm sure you understand the fundamental difference between calling a
> function and yielding inside a with statement: when calling a function
> the new frame is *appended* to the call stack keeping the current
> frame and all of its
On 28 May 2015 at 09:16, Peter Otten <__pete...@web.de> wrote:
> ...but the obvious route is of course
>
>> It's usually fairly trivial to rearrange things so that this doesn't
>> happen:
>>
>> def wrap_header_footer(fin):
>> yield htbegin
>> for linelist in csv.reader(fin):
>> yiel
On 28 May 2015 at 03:12, Steven D'Aprano wrote:
> On Wed, May 27, 2015 at 11:27:46PM +0100, Oscar Benjamin wrote:
>
>> I'm just wondering what other people think about this. Should code
>> like make_lines below be discouraged?
>>
>> > def make_lines():
>> > with open('co2-sample.csv') as co2:
Oscar Benjamin wrote:
> On 23 May 2015 at 10:52, Peter Otten <__pete...@web.de> wrote:
> I'm just wondering what other people think about this. Should code
> like make_lines below be discouraged?
>> def make_lines():
>> with open('co2-sample.csv') as co2:
>> yield htbegin
>>
On Wed, May 27, 2015 at 11:27:46PM +0100, Oscar Benjamin wrote:
> I'm just wondering what other people think about this. Should code
> like make_lines below be discouraged?
>
> > def make_lines():
> > with open('co2-sample.csv') as co2:
> > yield htbegin
> > for linelist in cs
On 27May2015 23:27, Oscar Benjamin wrote:
On 23 May 2015 at 10:52, Peter Otten <__pete...@web.de> wrote:
import csv
I'm just wondering what other people think about this. Should code
like make_lines below be discouraged?
In my opinion, no.
def make_lines():
with open('co2-sample.csv')
On 23 May 2015 at 10:52, Peter Otten <__pete...@web.de> wrote:
> import csv
>
>
I'm just wondering what other people think about this. Should code
like make_lines below be discouraged?
> def make_lines():
> with open('co2-sample.csv') as co2:
> yield htbegin
> for linelist in
15 matches
Mail list logo