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

2013-07-04 Thread Victor Stinner
2013/7/5 Cameron Simpson : > You might want to make clear that the "blocking" parameter refers > only to the file creation calls (eg socket.socket) and not to the > file descriptor itself, and is not to be confused with the UNIX > O_NONBLOCK file descriptor flag (and whatever equivalent flag may >

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

2013-07-04 Thread Cameron Simpson
On 05Jul2013 10:41, I wrote: | On 04Jul2013 13:03, Victor Stinner wrote: | | Other Changes | | - | | The ``subprocess.Popen`` class must clear the close-on-exec flag of file | | descriptors of the ``pass_fds`` parameter. | | I would expect Popen and friends to need to both clear the f

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

2013-07-04 Thread Cameron Simpson
First up I broadly like this. You might want to make clear that the "blocking" parameter refers only to the file creation calls (eg socket.socket) and not to the file descriptor itself, and is not to be confused with the UNIX O_NONBLOCK file descriptor flag (and whatever equivalent flag may apply

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

2013-07-04 Thread Victor Stinner
2013/7/4 Tres Seaver : > Not commenting on either the form or the substance (pun intended), but > the word you want is "inheritance" -- "inherence" is a valid term[1], but > would a good deal stranger notion to apply to a file descriptor. ;) Oh... I don't know why I wrote "inherance", it was "inhe

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

2013-07-04 Thread Chris Withers
On 04/07/2013 20:50, Benjamin Peterson wrote: 2013/7/4 Eric Snow : You could always monkeypatch builtins.__build_class__ to add an attribute to every "unbound method" pointing to the class. I would not reccomend that. __build_class__ is very internal and it's contract may change between versi

Re: [Python-Dev] Oddity in MISC/News on default

2013-07-04 Thread Antoine Pitrou
On Thu, 4 Jul 2013 12:47:30 -0700 Benjamin Peterson wrote: > Does annotate show it might have been added accidently in a merge? Annotate shows the original changesets on the 3.3 branch, which doesn't help ;-) Regards Antoine. ___ Python-Dev mailing l

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

2013-07-04 Thread Tres Seaver
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 07/04/2013 07:03 AM, Victor Stinner wrote: > Title: Add new parameters to configure the inherance of files and for > non-blocking sockets Not commenting on either the form or the substance (pun intended), but the word you want is "inheritance" --

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

2013-07-04 Thread Benjamin Peterson
2013/7/4 Eric Snow : > > On Thu, Jul 4, 2013 at 5:21 AM, Chris Withers > wrote: >> >> Hi All, >> >> In Python 2, I can figure out whether I have a method or a function, and, >> more importantly, for an unbound method, I can figure out what class the >> method belongs to: >> >> >>> class MyClass(ob

Re: [Python-Dev] Oddity in MISC/News on default

2013-07-04 Thread Benjamin Peterson
Does annotate show it might have been added accidently in a merge? 2013/7/4 Antoine Pitrou : > > Hello, > > In 3.4's Misc/NEWS, there's a huge section entitled "What's New in > Python 3.3.1 release candidate 1". It seems it shouldn't be there, > should it? > > Regards > > Antoine. > > > __

Re: [Python-Dev] Oddity in MISC/News on default

2013-07-04 Thread Guido van Rossum
Maybe the mistake is that the others aren't mentioned? Or perhaps everything before 3.4a1 should be dropped? I forget what kind of policy we have for this -- is it all changes in this branch or only changes unique to this branch? On Thu, Jul 4, 2013 at 12:19 PM, Antoine Pitrou wrote: > Le jeudi

Re: [Python-Dev] Oddity in MISC/News on default

2013-07-04 Thread Antoine Pitrou
Le jeudi 04 juillet 2013 à 12:17 -0700, Guido van Rossum a écrit : > Why not? Presumably those news items were all merged into the default > branch, and Misc/NEWS also has all the news for all 3.3.0 releases. > Why pick on 3.3.1 rc1? 3.3.1rc1 is the only post-3.3.0 release that's mentioned there (

Re: [Python-Dev] Oddity in MISC/News on default

2013-07-04 Thread Guido van Rossum
Why not? Presumably those news items were all merged into the default branch, and Misc/NEWS also has all the news for all 3.3.0 releases. Why pick on 3.3.1 rc1? On Thu, Jul 4, 2013 at 12:09 PM, Antoine Pitrou wrote: > > Hello, > > In 3.4's Misc/NEWS, there's a huge section entitled "What's New i

[Python-Dev] Oddity in MISC/News on default

2013-07-04 Thread Antoine Pitrou
Hello, In 3.4's Misc/NEWS, there's a huge section entitled "What's New in Python 3.3.1 release candidate 1". It seems it shouldn't be there, should it? Regards Antoine. ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman

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

2013-07-04 Thread Eric Snow
On Thu, Jul 4, 2013 at 5:21 AM, Chris Withers wrote: > Hi All, > > In Python 2, I can figure out whether I have a method or a function, and, > more importantly, for an unbound method, I can figure out what class the > method belongs to: > > >>> class MyClass(object): > ... def method(self): pass

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

2013-07-04 Thread Chris Withers
On 04/07/2013 18:00, Guido van Rossum wrote: Thanks for the code pointers. So it's all about monkeypatching. :-) Well, that's the testfixtures use case, but for mush it's about figuring out whether you need to instantiate a class before calling a callable. MyClass.a_method is a bit like a fu

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

2013-07-04 Thread Guido van Rossum
Thanks for the code pointers. So it's all about monkeypatching. :-) I have only a little sympathy, as there still seems to be a way to do this, it's just less convenient. Too bad. --Guido On Thu, Jul 4, 2013 at 9:42 AM, Chris Withers wrote: > Hi Guido, > > I've bumped into this a couple of times

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

2013-07-04 Thread Chris Withers
Hi Guido, I've bumped into this a couple of times. First time was when I wanted to know whether what I had was a classmethod, staticmethod or normal method here: https://github.com/Simplistix/testfixtures/blob/master/testfixtures/replace.py#L59 This resulted in having to trawl through __dict

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

2013-07-04 Thread Guido van Rossum
Chris, what do you want to do with the knowledge you are seeking? --Guido van Rossum (sent from Android phone) On Jul 4, 2013 4:28 AM, "Chris Withers" wrote: > Hi All, > > In Python 2, I can figure out whether I have a method or a function, and, > more importantly, for an unbound method, I can f

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

2013-07-04 Thread Victor Stinner
2013/7/4 Chris Withers : > That doesn't seem helpful as a sensible way to get back to the class object: > >>> globals()[MyClass.method.__qualname__.split('.')[0]] > globals() can only be used if MyClass is in the same module. Otherwise, you a more complex function: --- import types d

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

2013-07-04 Thread Brett Cannon
On Thu, Jul 4, 2013 at 8:13 AM, Chris Withers wrote: > On 04/07/2013 12:59, Christian Heimes wrote: > >> Am 04.07.2013 13:21, schrieb Chris Withers: >> >>> There doesn't appear to be any way in Python 3 to do this, which is a >>> little surprising and frustrating... >>> >>> What am I missing here?

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

2013-07-04 Thread Chris Withers
On 04/07/2013 12:55, Ronald Oussoren wrote: You can find the fully qualified name of the method with the qualname attribute: class A: ...def method(self): pass ... A.method.__qualname__ 'A.method' That doesn't seem helpful as a sensible way to get back to the class object: >> globals

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

2013-07-04 Thread Chris Withers
On 04/07/2013 12:59, Christian Heimes wrote: Am 04.07.2013 13:21, schrieb Chris Withers: There doesn't appear to be any way in Python 3 to do this, which is a little surprising and frustrating... What am I missing here? I removed unbound methods almost six years ago: http://hg.python.org/cpy

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

2013-07-04 Thread Victor Stinner
2013/7/4 Ronald Oussoren : >> The PEP 433 proposes adding an "e" mode to open in alternatives. I >> didn't keep this idea because the fopen() function of the GNU libc >> library has no mode for the O_NONBLOCK flag. IMO it is not interesting >> to mention it in the PEP 466. > > I don't understand yo

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

2013-07-04 Thread Christian Heimes
Am 04.07.2013 13:21, schrieb Chris Withers: > There doesn't appear to be any way in Python 3 to do this, which is a > little surprising and frustrating... > > What am I missing here? I removed unbound methods almost six years ago: http://hg.python.org/cpython/rev/48af6375207e Christian

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

2013-07-04 Thread Ronald Oussoren
On 4 Jul, 2013, at 13:21, Chris Withers wrote: > Hi All, > > In Python 2, I can figure out whether I have a method or a function, and, > more importantly, for an unbound method, I can figure out what class the > method belongs to: > > >>> class MyClass(object): > ... def method(self): pass

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

2013-07-04 Thread Ronald Oussoren
On 4 Jul, 2013, at 13:19, Victor Stinner wrote: > 2013/7/4 Victor Stinner : >> Add a new optional *cloexec* on functions creating file descriptors: >> >> * ``io.FileIO`` >> * ``io.open()`` >> * ``open()`` > > The PEP 433 proposes adding an "e" mode to open in alternatives. I > didn't keep this

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

2013-07-04 Thread Chris Withers
Hi All, In Python 2, I can figure out whether I have a method or a function, and, more importantly, for an unbound method, I can figure out what class the method belongs to: >>> class MyClass(object): ... def method(self): pass ... >>> MyClass.method >>> MyClass.method.im_class There doe

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

2013-07-04 Thread Victor Stinner
> PEP: 446 > Title: Add new parameters to configure the inherance of files and for > non-blocking sockets > (...) > Rejected Alternatives > = > > PEP 433 > --- > > The PEP 433 entitled "Easier suppression of file descriptor inheritance" > is a previous attempt proposing vari

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

2013-07-04 Thread Victor Stinner
2013/7/4 Victor Stinner : > Add a new optional *cloexec* on functions creating file descriptors: > > * ``io.FileIO`` > * ``io.open()`` > * ``open()`` The PEP 433 proposes adding an "e" mode to open in alternatives. I didn't keep this idea because the fopen() function of the GNU libc library has no

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

2013-07-04 Thread Victor Stinner
HTML version: http://www.python.org/dev/peps/pep-0446/ PEP: 446 Title: Add new parameters to configure the inherance of files and for non-blocking sockets Version: $Revision$ Last-Modified: $Date$ Author: Victor Stinner Status: Draft Type: Standards Track Content-Type: text/x-rst Created: 3-July