Re: [Python-Dev] Hooking into super() attribute resolution

2013-07-06 Thread Ronald Oussoren
I've updated the implementation in issue 18181 while adding some tests, and have updated the proposal as well. The proposal has some open issues at the moment, most important of which is the actual signature for the new special method; in particular I haven'

Re: [Python-Dev] PEP 446: Add new parameters to configure the inherance of files and for non-blocking sockets

2013-07-06 Thread Charles-François Natali
> I've read your "Rejected Alternatives" more closely and Ulrich > Drepper's article, though I think the article also supports adding > a blocking (default True) parameter to open() and os.open(). If you > try to change that default on a platform where it doesn't work, an > exception should be rais

Re: [Python-Dev] [Python-checkins] cpython (3.3): Issue #17860: explicitly mention that std* streams are opened in binary mode by

2013-07-06 Thread R. David Murray
On Sat, 06 Jul 2013 10:25:19 +0200, ronald.oussoren wrote: > http://hg.python.org/cpython/rev/a2c2ffa1a41c > changeset: 84453:a2c2ffa1a41c > branch: 3.3 > parent: 84449:df79735b21c1 > user:Ronald Oussoren > date:Sat Jul 06 10:23:59 2013 +0200 > summary: > Issue #178

Re: [Python-Dev] PEP 446: Add new parameters to configure the inherance of files and for non-blocking sockets

2013-07-06 Thread Victor Stinner
2013/7/6 Charles-François Natali : >> I've read your "Rejected Alternatives" more closely and Ulrich >> Drepper's article, though I think the article also supports adding >> a blocking (default True) parameter to open() and os.open(). If you >> try to change that default on a platform where it does

Re: [Python-Dev] [Python-checkins] cpython (3.3): Issue #17860: explicitly mention that std* streams are opened in binary mode by

2013-07-06 Thread Ronald Oussoren
On 6 Jul, 2013, at 13:59, R. David Murray wrote: > On Sat, 06 Jul 2013 10:25:19 +0200, ronald.oussoren > wrote: >> http://hg.python.org/cpython/rev/a2c2ffa1a41c >> changeset: 84453:a2c2ffa1a41c >> branch: 3.3 >> parent: 84449:df79735b21c1 >> user:Ronald Oussoren >> date:

Re: [Python-Dev] PEP 446: Add new parameters to configure the inherance of files and for non-blocking sockets

2013-07-06 Thread Ronald Oussoren
On 6 Jul, 2013, at 14:04, Victor Stinner wrote: > 2013/7/6 Charles-François Natali : >>> I've read your "Rejected Alternatives" more closely and Ulrich >>> Drepper's article, though I think the article also supports adding >>> a blocking (default True) parameter to open() and os.open(). If you >

Re: [Python-Dev] PEP 446: Add new parameters to configure the inherance of files and for non-blocking sockets

2013-07-06 Thread Victor Stinner
2013/7/6 Cameron Simpson : > Yes. Please forget I mentioned fork(); it is only relevant if you > were offering some facility to undo the addition of cloexec to a > Popen passed file descriptor. Which you are not. Oh... gotcha. I now understood your concern. There is a little "trick" here: at fork

Re: [Python-Dev] lament for the demise of unbound methods

2013-07-06 Thread Michael Foord
On 5 Jul 2013, at 12:07, "Martin v. Löwis" wrote: > Am 05.07.13 11:23, schrieb Michael Foord: >> I've also lamented the death of bound methods in Python 3 for mock >> "autospeccing". Autospec introspects objects and provides mock >> objects with the same attributes - and with the same method >>

Re: [Python-Dev] lament for the demise of unbound methods

2013-07-06 Thread Michael Foord
On 5 Jul 2013, at 12:26, Łukasz Langa wrote: > On 5 lip 2013, at 12:07, Martin v. Löwis wrote: > >> I wonder why you need to figure out the signatures in advance. >> Can you just wait until the function is actually used, and then >> process the parameters as you get them? >> > > My guess is

Re: [Python-Dev] [Python-checkins] cpython (3.3): Issue #17860: explicitly mention that std* streams are opened in binary mode by

2013-07-06 Thread Ronald Oussoren
On 6 Jul, 2013, at 14:09, Ronald Oussoren wrote: > > On 6 Jul, 2013, at 13:59, R. David Murray wrote: >> >> IMO, either the default should be mentioned first, or the default >> should be mentioned in a parenthetical. Otherwise it sounds like >> newline translation is being done in both modes

Re: [Python-Dev] [Python-checkins] cpython (3.3): Issue #17860: explicitly mention that std* streams are opened in binary mode by

2013-07-06 Thread Gregory P. Smith
Please update the docstring in subprocess.py with the wording improvements that you settle on while you're at it. On Sat, Jul 6, 2013 at 6:03 AM, Ronald Oussoren wrote: > > On 6 Jul, 2013, at 14:09, Ronald Oussoren wrote: > > > > > On 6 Jul, 2013, at 13:59, R. David Murray wrote: > >> > >> IMO

Re: [Python-Dev] Rough idea for adding introspection information for builtins

2013-07-06 Thread Larry Hastings
Revisiting a four-month-old discussion: On 03/19/2013 11:00 AM, Larry Hastings wrote: As for handling optional argument groups, my gut feeling is that we're better off not leaking it out of Argument Clinic--don't expose it in this string we're talking about, and don't add support for it in the

[Python-Dev] Accepting PEP 445

2013-07-06 Thread Antoine Pitrou
Hello, I'm accepting PEP 445 (A C API to customize memory allocators) by Victor. There is probably some grammar to correct here and there (neither Victor nor I are native English speakers), but I don't want this to hold back acceptance. The PEP is an obvious improvement in flexibility for every

Re: [Python-Dev] Accepting PEP 445

2013-07-06 Thread Antonio Cavallo
Could that remove the need for the --with-pydebug flag? On 6 Jul 2013, at 21:54, Antoine Pitrou wrote: > > Hello, > > I'm accepting PEP 445 (A C API to customize memory allocators) by > Victor. There is probably some grammar to correct here and there > (neither Victor nor I are native Engl

Re: [Python-Dev] Accepting PEP 445

2013-07-06 Thread Antoine Pitrou
On Sat, 6 Jul 2013 22:07:40 +0100 Antonio Cavallo wrote: > Could that remove the need for the --with-pydebug flag? No, --with-pydebug enables much more than just memory debug checks. Regards Antoine. > > > > > On 6 Jul 2013, at 21:54, Antoine Pitrou wrote: > > > > > Hello, > > > > I'm

Re: [Python-Dev] lament for the demise of unbound methods

2013-07-06 Thread Nick Coghlan
On 6 Jul 2013 22:52, "Michael Foord" wrote: > > > On 5 Jul 2013, at 12:26, Łukasz Langa wrote: > > > On 5 lip 2013, at 12:07, Martin v. Löwis wrote: > > > >> I wonder why you need to figure out the signatures in advance. > >> Can you just wait until the function is actually used, and then > >> p

Re: [Python-Dev] Rough idea for adding introspection information for builtins

2013-07-06 Thread Nick Coghlan
On 7 Jul 2013 05:22, "Larry Hastings" wrote: > > > Revisiting a four-month-old discussion: > > > On 03/19/2013 11:00 AM, Larry Hastings wrote: >> >> As for handling optional argument groups, my gut feeling is that we're better off not leaking it out of Argument Clinic--don't expose it in this stri

Re: [Python-Dev] Accepting PEP 445

2013-07-06 Thread Nick Coghlan
On 7 Jul 2013 07:01, "Antoine Pitrou" wrote: > > > Hello, > > I'm accepting PEP 445 (A C API to customize memory allocators) by > Victor. There is probably some grammar to correct here and there > (neither Victor nor I are native English speakers), but I don't want > this to hold back acceptance.

Re: [Python-Dev] Accepting PEP 445

2013-07-06 Thread Victor Stinner
2013/7/6 Antonio Cavallo : > Could that remove the need for the --with-pydebug flag? With the PEP 445, you still have to recompile Python with --with-debug, but you don't have to recompile Python extensions anymore. Debug checks on memory allocators are now implemented as hooks, instead of using C

Re: [Python-Dev] Rough idea for adding introspection information for builtins

2013-07-06 Thread Larry Hastings
On 07/07/2013 12:32 AM, Nick Coghlan wrote: Rather than perpetuating unwanted complexity, can't we just add a single "incomplete signature" flag to handle the legacy cases, and leave those to the docstrings? As in, if the flag is set, pydoc displays the "..." because it knows the signature

Re: [Python-Dev] PEP 446: Add new parameters to configure the inherance of files and for non-blocking sockets

2013-07-06 Thread Cameron Simpson
On 06Jul2013 14:43, Victor Stinner wrote: | 2013/7/6 Cameron Simpson : | > Yes. Please forget I mentioned fork(); it is only relevant if you | > were offering some facility to undo the addition of cloexec to a | > Popen passed file descriptor. Which you are not. | | Oh... gotcha. I now understood

Re: [Python-Dev] PEP 446: Add new parameters to configure the inherance of files and for non-blocking sockets

2013-07-06 Thread Cameron Simpson
On 06Jul2013 11:23, Charles-François Natali wrote: | > I've read your "Rejected Alternatives" more closely and Ulrich | > Drepper's article, though I think the article also supports adding | > a blocking (default True) parameter to open() and os.open(). If you | > try to change that default on a p

Re: [Python-Dev] Rough idea for adding introspection information for builtins

2013-07-06 Thread Nick Coghlan
On 7 Jul 2013 10:25, "Larry Hastings" wrote: > > On 07/07/2013 12:32 AM, Nick Coghlan wrote: >> >> Rather than perpetuating unwanted complexity, can't we just add a single "incomplete signature" flag to handle the legacy cases, and leave those to the docstrings? >> >> As in, if the flag is set, py

Re: [Python-Dev] Rough idea for adding introspection information for builtins

2013-07-06 Thread Larry Hastings
On 07/07/2013 03:04 AM, Nick Coghlan wrote: On 7 Jul 2013 10:25, "Larry Hastings" > wrote: >> >> group >>> >>> If not None, represents which "optional parameter group" this parameter belongs to. Optional parameter groups are contiguous sequences of parameters that

Re: [Python-Dev] lament for the demise of unbound methods

2013-07-06 Thread Raymond Hettinger
On Jul 4, 2013, at 2:34 AM, Brett Cannon wrote: > The loss of the ability to figure out the class from an unbound method seems > quite an annoying step back from an introspection point of view. > > It's only annoying if you take the perspective that methods are somehow > special compared to f

Re: [Python-Dev] [Python-checkins] cpython (3.3): Issue #17860: explicitly mention that std* streams are opened in binary mode by

2013-07-06 Thread R. David Murray
On Sat, 06 Jul 2013 08:14:26 -0700, "Gregory P. Smith" wrote: > Please update the docstring in subprocess.py with the wording improvements > that you settle on while you're at it. > > On Sat, Jul 6, 2013 at 6:03 AM, Ronald Oussoren wrote: > > I didn't like the parenthentical after all. Would this

Re: [Python-Dev] Rough idea for adding introspection information for builtins

2013-07-06 Thread Ronald Oussoren
On 6 Jul, 2013, at 19:33, Larry Hastings wrote: > > Once builtins have introspection information, pydoc can do a better job, and > Argument Clinic can stop generating its redundant prototype line. Not entirely on topic, but close enough: pydoc currently doesn't use the __signature__ informati

Re: [Python-Dev] Rough idea for adding introspection information for builtins

2013-07-06 Thread R. David Murray
On Sun, 07 Jul 2013 04:48:18 +0200, Larry Hastings wrote: > On 07/07/2013 03:04 AM, Nick Coghlan wrote: > > > > On 7 Jul 2013 10:25, "Larry Hastings" > > wrote: > > >> > > >> group > > >>> > > >>> If not None, represents which "optional parameter group" this > > parame

Re: [Python-Dev] Rough idea for adding introspection information for builtins

2013-07-06 Thread Ronald Oussoren
On 7 Jul, 2013, at 4:48, Larry Hastings wrote: > > If we combine that with the admittedly-new "/" indicating "all previous > parameters are positional-only", Signature objects use a name in angled brackets to indicate that a parameter is positional only, for example "input()". That might be

Re: [Python-Dev] lament for the demise of unbound methods

2013-07-06 Thread Chris Withers
On 05/07/2013 11:26, "Martin v. Löwis" wrote: ... A.__getattribute__(A,'s') A.__getattribute__(A,'c') A.__getattribute__(A,'r') Okay, but with this line: found = found.__getattribute__(found, n) I get a tonne of failures like this: File "testfixtures.tests.test_replacer.TestRe