Re: [Python-Dev] The Tulip Has Landed

2013-10-17 Thread Simon Cross
Yay! ___ Python-Dev mailing list Python-Dev@python.org https://mail.python.org/mailman/listinfo/python-dev Unsubscribe: https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Re: [Python-Dev] cpython: Issue #16129: Add `Py_SetStandardStreamEncoding`

2013-10-17 Thread Georg Brandl
Am 17.10.2013 17:36, schrieb Antoine Pitrou: > On Thu, 17 Oct 2013 15:22:03 +0200 (CEST) > nick.coghlan wrote: >> >> +.. c:function:: int Py_SetStandardStreamEncoding(char *encoding, char >> *errors) >> + >> + .. index:: >> + single: Py_Initialize() >> + single: main() >> + tri

Re: [Python-Dev] Checking in Argument Clinic early?

2013-10-17 Thread Larry Hastings
On 10/15/2013 09:22 AM, Larry Hastings wrote: If this love-in continues I'll prep a release tonight and commit it in the morning... just before my flight home across the Atlantic. Okay, so, I slowed it down a little--some last-minute things cropped up. I've uploaded a fresh patch to the issue

Re: [Python-Dev] On suppress()'s trail blazing (was Re: cpython: Rename contextlib.ignored() to contextlib.ignore())

2013-10-17 Thread Terry Reedy
On 10/17/2013 7:35 PM, Nick Coghlan wrote: On 18 Oct 2013 06:59, "Xavier Morel" mailto:catch-...@masklinn.net>> wrote: > > On 2013-10-17, at 22:11 , Ethan Furman wrote: > > > On 10/17/2013 01:03 PM, Terry Reedy wrote: > >> > >> class suppress: > >> def __init__(self, *exceptions): > >>

Re: [Python-Dev] On suppress()'s trail blazing (was Re: cpython: Rename contextlib.ignored() to contextlib.ignore())

2013-10-17 Thread Gregory P. Smith
> Right again. The simplest rule to remember seems to be "don't use yield or > yield-from inside a with-statement". You can relax it by limiting it to > context managers that manage any kind of shared resource, but that is > probably already too subtle: e.g. yielding inside "with open(file) as f" >

Re: [Python-Dev] The Tulip Has Landed

2013-10-17 Thread Nick Coghlan
On 18 Oct 2013 09:07, "Larry Hastings" wrote: > > > For those interested parties: Guido just checked "asyncio", aka "Tulip", aka "PEP 3156", in to trunk. I expect it to be part of Python 3.4.0a4, hopefully to be released this weekend. Huzzah! :) Cheers, Nick. > > Maybe that'll generate some in

Re: [Python-Dev] On suppress()'s trail blazing (was Re: cpython: Rename contextlib.ignored() to contextlib.ignore())

2013-10-17 Thread Greg Ewing
Guido van Rossum wrote: yielding inside "with open(file) as f" seems fine, but yielding inside "with lock" is problematic, since the other side might try to acquire the same lock, and deadlock. So maybe the documentation of a context manager should include whether it's safe to yield inside the

Re: [Python-Dev] On suppress()'s trail blazing (was Re: cpython: Rename contextlib.ignored() to contextlib.ignore())

2013-10-17 Thread Nick Coghlan
On 18 Oct 2013 06:59, "Xavier Morel" wrote: > > On 2013-10-17, at 22:11 , Ethan Furman wrote: > > > On 10/17/2013 01:03 PM, Terry Reedy wrote: > >> > >> class suppress: > >> def __init__(self, *exceptions): > >> self.exceptions = exceptions > >> def __exit__(self, etype, eval, etrace): > >

Re: [Python-Dev] On suppress()'s trail blazing (was Re: cpython: Rename contextlib.ignored() to contextlib.ignore())

2013-10-17 Thread Nick Coghlan
On 18 Oct 2013 09:05, "Guido van Rossum" wrote: > > On Thu, Oct 17, 2013 at 3:51 PM, Oscar Benjamin < oscar.j.benja...@gmail.com> wrote: >> >> On 17 October 2013 20:01, Guido van Rossum wrote: >> > On Thu, Oct 17, 2013 at 11:55 AM, Oscar Benjamin >> > wrote: >> >> >> >> On 17 October 2013 19:40,

[Python-Dev] The Tulip Has Landed

2013-10-17 Thread Larry Hastings
For those interested parties: Guido just checked "asyncio", aka "Tulip", aka "PEP 3156", in to trunk. I expect it to be part of Python 3.4.0a4, hopefully to be released this weekend. Maybe /that'll/ generate some interest in the alpha ;-) //arry/ ___

Re: [Python-Dev] On suppress()'s trail blazing (was Re: cpython: Rename contextlib.ignored() to contextlib.ignore())

2013-10-17 Thread Guido van Rossum
On Thu, Oct 17, 2013 at 3:51 PM, Oscar Benjamin wrote: > On 17 October 2013 20:01, Guido van Rossum wrote: > > On Thu, Oct 17, 2013 at 11:55 AM, Oscar Benjamin > > wrote: > >> > >> On 17 October 2013 19:40, Xavier Morel wrote: > >> > I think there's already a significant split between context m

Re: [Python-Dev] On suppress()'s trail blazing (was Re: cpython: Rename contextlib.ignored() to contextlib.ignore())

2013-10-17 Thread Oscar Benjamin
On 17 October 2013 20:01, Guido van Rossum wrote: > On Thu, Oct 17, 2013 at 11:55 AM, Oscar Benjamin > wrote: >> >> On 17 October 2013 19:40, Xavier Morel wrote: >> > I think there's already a significant split between context managers >> > which handle the lifecycle of a local resource (file, t

Re: [Python-Dev] non-US zip archives support in zipfile.py

2013-10-17 Thread Toshio Kuratomi
On Tue, Oct 15, 2013 at 03:46:15PM +0200, "Martin v. Löwis" wrote: > Am 15.10.13 14:49, schrieb Daniel Holth: > > It is part of the ZIP specification. CP437 or UTF-8 are the two > > official choices, but other encodings happen on Russian, Japanese > > systems. > > Indeed. Formally, the other encod

Re: [Python-Dev] On suppress()'s trail blazing (was Re: cpython: Rename contextlib.ignored() to contextlib.ignore())

2013-10-17 Thread Ethan Furman
On 10/17/2013 01:57 PM, Xavier Morel wrote: On 2013-10-17, at 22:11 , Ethan Furman wrote: On 10/17/2013 01:03 PM, Terry Reedy wrote: class suppress: def __init__(self, *exceptions): self.exceptions = exceptions def __exit__(self, etype, eval, etrace): return etype in self.exce

Re: [Python-Dev] On suppress()'s trail blazing (was Re: cpython: Rename contextlib.ignored() to contextlib.ignore())

2013-10-17 Thread Xavier Morel
On 2013-10-17, at 22:11 , Ethan Furman wrote: > On 10/17/2013 01:03 PM, Terry Reedy wrote: >> >> class suppress: >> def __init__(self, *exceptions): >> self.exceptions = exceptions >> def __exit__(self, etype, eval, etrace): >> return etype in self.exceptions > > This fails when etyp

Re: [Python-Dev] On suppress()'s trail blazing (was Re: cpython: Rename contextlib.ignored() to contextlib.ignore())

2013-10-17 Thread Ethan Furman
On 10/17/2013 01:03 PM, Terry Reedy wrote: class suppress: def __init__(self, *exceptions): self.exceptions = exceptions def __exit__(self, etype, eval, etrace): return etype in self.exceptions This fails when etype is a subclass of the exceptions, as mentioned in the original

Re: [Python-Dev] On suppress()'s trail blazing (was Re: cpython: Rename contextlib.ignored() to contextlib.ignore())

2013-10-17 Thread Gregory P. Smith
On Thu, Oct 17, 2013 at 9:06 AM, Barry Warsaw wrote: > On Oct 18, 2013, at 01:26 AM, Nick Coghlan wrote: > > >By contrast, suppress() and redirect_stdout() are the *first* general > >purpose context managers added to contextlib since its incarnation in > >Python 2.5 (although there have been many

Re: [Python-Dev] On suppress()'s trail blazing (was Re: cpython: Rename contextlib.ignored() to contextlib.ignore())

2013-10-17 Thread Stefan Krah
Xavier Morel wrote: > On 2013-10-17, at 20:55 , Oscar Benjamin wrote: > > On 17 October 2013 19:40, Xavier Morel wrote: > >> I think there's already a significant split between context managers > >> which handle the lifecycle of a local resource (file, transaction) and > >> those which purport to

Re: [Python-Dev] On suppress()'s trail blazing (was Re: cpython: Rename contextlib.ignored() to contextlib.ignore())

2013-10-17 Thread Terry Reedy
On 10/17/2013 12:06 PM, Barry Warsaw wrote: On Oct 18, 2013, at 01:26 AM, Nick Coghlan wrote: By contrast, suppress() and redirect_stdout() are the *first* general purpose context managers added to contextlib since its incarnation in Python 2.5 (although there have been many various domain spec

Re: [Python-Dev] On suppress()'s trail blazing (was Re: cpython: Rename contextlib.ignored() to contextlib.ignore())

2013-10-17 Thread Xavier Morel
On 2013-10-17, at 20:55 , Oscar Benjamin wrote: > On 17 October 2013 19:40, Xavier Morel wrote: >> I think there's already a significant split between context managers >> which handle the lifecycle of a local resource (file, transaction) and >> those which purport to locally alter global-ish state

Re: [Python-Dev] On suppress()'s trail blazing (was Re: cpython: Rename contextlib.ignored() to contextlib.ignore())

2013-10-17 Thread Guido van Rossum
On Thu, Oct 17, 2013 at 11:55 AM, Oscar Benjamin wrote: > On 17 October 2013 19:40, Xavier Morel wrote: > > I think there's already a significant split between context managers > > which handle the lifecycle of a local resource (file, transaction) and > > those which purport to locally alter glo

Re: [Python-Dev] On suppress()'s trail blazing (was Re: cpython: Rename contextlib.ignored() to contextlib.ignore())

2013-10-17 Thread Oscar Benjamin
On 17 October 2013 19:40, Xavier Morel wrote: > I think there's already a significant split between context managers > which handle the lifecycle of a local resource (file, transaction) and > those which purport to locally alter global-ish state (cwd, > decimal.localcontext, logging.captureWarning

Re: [Python-Dev] On suppress()'s trail blazing (was Re: cpython: Rename contextlib.ignored() to contextlib.ignore())

2013-10-17 Thread Barry Warsaw
On Oct 17, 2013, at 08:40 PM, Xavier Morel wrote: >I think there's already a significant split between context managers >which handle the lifecycle of a local resource (file, transaction) and >those which purport to locally alter global-ish state (cwd, >decimal.localcontext, logging.captureWarning

Re: [Python-Dev] On suppress()'s trail blazing (was Re: cpython: Rename contextlib.ignored() to contextlib.ignore())

2013-10-17 Thread Xavier Morel
On 2013-10-17, at 18:06 , Barry Warsaw wrote: > On Oct 18, 2013, at 01:26 AM, Nick Coghlan wrote: >> By contrast, suppress() and redirect_stdout() are the *first* general >> purpose context managers added to contextlib since its incarnation in >> Python 2.5 (although there have been many various do

Re: [Python-Dev] On suppress()'s trail blazing (was Re: cpython: Rename contextlib.ignored() to contextlib.ignore())

2013-10-17 Thread Glenn Linderman
On 10/17/2013 9:06 AM, Barry Warsaw wrote: There's a fundamental conceptual shift here that's worth exploring more, and which I think was first identified by RDM. Until now, context managers were at their heart (at least IMHO) about managing "resources". A general resource might be an open file

Re: [Python-Dev] Regarding stdlib socket module, _fileobject.flush() method using ._rbufsize instead of ._wbufsize

2013-10-17 Thread Guido van Rossum
So that's hex rev dca3cb19dbdd. I'm confident that it is a copy/paste bug. It doesn't have any effect AFAICT though, since given the analysis the OP posted, max(self._wbufsize, self.bufsize) and max(self._rbufsize, self.bufsize) always come out to the same. Additionally, the bug is no longer prese

Re: [Python-Dev] Help needed: problems getting the expected default encoding for embedded IO config test

2013-10-17 Thread Victor Stinner
sys.stdout.encoding must never be None, it must be a str. If it is None, it is a regression. I modified Python (maybe in 3.2) to ensure that .encoding is always set. For your failure: what is the locale encoding? What are the values of LC_ALL, LANG, LC_CTYPES and PYTHONIOENCODING env vars? I will

Re: [Python-Dev] cpython: Try doing a raw test of os.fork()/os.kill().

2013-10-17 Thread Richard Oudkerk
On 17/10/2013 5:35pm, Charles-François Natali wrote: For this kind of ad-hoc testing, you can also use a custom builder to avoid disrupting the main source tree: AFAICT, the problem he's trying to debug (issue #19227) only occurs on two specific - stable - buildbots. It looks like there are c

Re: [Python-Dev] Bug tracker and docs@python

2013-10-17 Thread Antoine Pitrou
On Thu, 17 Oct 2013 08:52:42 -0700 Ethan Furman wrote: > On 10/17/2013 08:29 AM, Benjamin Peterson wrote: > > 2013/10/17 Ethan Furman : > >> Good day! > >> > >> What is the effect of assigning a bug tracker issue to docs@python? > > > > The assignee field is set to d...@python.org. > > > > In othe

Re: [Python-Dev] Bug tracker and docs@python

2013-10-17 Thread Ethan Furman
On 10/17/2013 08:29 AM, Benjamin Peterson wrote: 2013/10/17 Ethan Furman : Good day! What is the effect of assigning a bug tracker issue to docs@python? The assignee field is set to d...@python.org. In other words, nothing magical happens. Heh, okay. So commit the doc patch myself, then.

Re: [Python-Dev] cpython: Rename contextlib.ignored() to contextlib.ignore().

2013-10-17 Thread Ethan Furman
On 10/17/2013 08:26 AM, Nick Coghlan wrote: # Arbitrarily nested search loop with exit_label() as found: for i in range(x): for j in range(y): if matches(i, j): found.exit((i, j)) if found: print(found.value) +

Re: [Python-Dev] cpython: Try doing a raw test of os.fork()/os.kill().

2013-10-17 Thread Charles-François Natali
2013/10/17 Antoine Pitrou : > On Thu, 17 Oct 2013 15:33:02 +0200 (CEST) > richard.oudkerk wrote: >> http://hg.python.org/cpython/rev/9558e9360afc >> changeset: 86401:9558e9360afc >> parent: 86399:9cd88b39ef62 >> user:Richard Oudkerk >> date:Thu Oct 17 14:24:06 2013 +0100 >>

[Python-Dev] Help needed: problems getting the expected default encoding for embedded IO config test

2013-10-17 Thread Nick Coghlan
http://bugs.python.org/issue16129 added a Py_SetStandardStreamEncoding API to allow embedding applications like Blender to explicitly configure the encoding and error handler for the standard IO streams. However, the test case didn't get along with the buildbots, and I'm struggling to figure out w

[Python-Dev] On suppress()'s trail blazing (was Re: cpython: Rename contextlib.ignored() to contextlib.ignore())

2013-10-17 Thread Barry Warsaw
On Oct 18, 2013, at 01:26 AM, Nick Coghlan wrote: >By contrast, suppress() and redirect_stdout() are the *first* general >purpose context managers added to contextlib since its incarnation in >Python 2.5 (although there have been many various domain specific >context manager additions elsewhere in

Re: [Python-Dev] Bug tracker and docs@python

2013-10-17 Thread Georg Brandl
Am 17.10.2013 17:29, schrieb Benjamin Peterson: > 2013/10/17 Ethan Furman : >> Good day! >> >> What is the effect of assigning a bug tracker issue to docs@python? > > The assignee field is set to d...@python.org. > > In other words, nothing magical happens. Correct so far, but the point of the e

Re: [Python-Dev] cpython: Try doing a raw test of os.fork()/os.kill().

2013-10-17 Thread Antoine Pitrou
On Thu, 17 Oct 2013 15:33:02 +0200 (CEST) richard.oudkerk wrote: > http://hg.python.org/cpython/rev/9558e9360afc > changeset: 86401:9558e9360afc > parent: 86399:9cd88b39ef62 > user:Richard Oudkerk > date:Thu Oct 17 14:24:06 2013 +0100 > summary: > Try doing a raw test of

Re: [Python-Dev] cpython: Issue #16129: Add `Py_SetStandardStreamEncoding`

2013-10-17 Thread Antoine Pitrou
On Thu, 17 Oct 2013 15:22:03 +0200 (CEST) nick.coghlan wrote: > > +.. c:function:: int Py_SetStandardStreamEncoding(char *encoding, char > *errors) > + > + .. index:: > + single: Py_Initialize() > + single: main() > + triple: stdin; stdout; sdterr > + > + This function should

Re: [Python-Dev] Bug tracker and docs@python

2013-10-17 Thread Benjamin Peterson
2013/10/17 Ethan Furman : > Good day! > > What is the effect of assigning a bug tracker issue to docs@python? The assignee field is set to d...@python.org. In other words, nothing magical happens. -- Regards, Benjamin ___ Python-Dev mailing list Pyt

Re: [Python-Dev] cpython: Rename contextlib.ignored() to contextlib.ignore().

2013-10-17 Thread Nick Coghlan
On 17 October 2013 01:24, Barry Warsaw wrote: > On Oct 16, 2013, at 08:31 AM, Eric Snow wrote: > >>When a module's maintainer makes a decision on a relatively insignificant >>addition to the module, I'd expect little resistance or even comment (the >>original commit was months ago). That's why I'

[Python-Dev] Bug tracker and docs@python

2013-10-17 Thread Ethan Furman
Good day! What is the effect of assigning a bug tracker issue to docs@python? -- ~Ethan~ ___ Python-Dev mailing list Python-Dev@python.org https://mail.python.org/mailman/listinfo/python-dev Unsubscribe: https://mail.python.org/mailman/options/python-

Re: [Python-Dev] Regarding stdlib socket module, _fileobject.flush() method using ._rbufsize instead of ._wbufsize

2013-10-17 Thread Antoine Pitrou
On Wed, 16 Oct 2013 21:30:52 -0400 Terry Reedy wrote: > On 10/16/2013 5:01 PM, Peter Portante wrote: > > Hello, > > > > Is there a reason why the stdlib socket module _fileobject.flush() > > method is using ._rbufsize instead of ._wbufsize at line 297 (Python > > 2.7.3), where it determines the b