Re: [Python-Dev] ctypes is not an acceptable implementation strategy for modules in the standard library?

2012-11-05 Thread Ronald Oussoren
On 5 Nov, 2012, at 8:31, anatoly techtonik wrote: > From http://bugs.python.org/issue16410 > Subj? > > Aren't there any modules in stdlib that access system API through ctypes? uuid uses ctypes to access platform APIs. > > My arguments for ctypes: > 1. doesn't require compilation > 2. easier

Re: [Python-Dev] ctypes is not an acceptable implementation strategy for modules in the standard library?

2012-11-05 Thread Victor Stinner
I'm not sure that ctypes is always available (available on all platforms). Victor ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive

Re: [Python-Dev] ctypes is not an acceptable implementation strategy for modules in the standard library?

2012-11-05 Thread R. David Murray
On Mon, 05 Nov 2012 10:31:26 +0300, anatoly techtonik wrote: > Aren't there any modules in stdlib that access system API through ctypes? No. This is a policy. Changing that policy would require a PEP (*after* a discussion on python-ideas...which has probably already happened in the past, I wou

[Python-Dev] Okay to document the "exec tuple" form of the exec statement in Python 2.7?

2012-11-05 Thread Mark Dickinson
In Python 2, the 'exec' statement supports 'exec'-ing a (statement, globals, locals) tuple: >>> exec("print 2", {}, {}) 2 This isn't currently documented at: http://docs.python.org/reference/simple_stmts.html#the-exec-statement. It's easy to fix the docs, but in doing so we'd effectively be bles

Re: [Python-Dev] Okay to document the "exec tuple" form of the exec statement in Python 2.7?

2012-11-05 Thread Nick Coghlan
On Mon, Nov 5, 2012 at 10:08 PM, Mark Dickinson wrote: > In Python 2, the 'exec' statement supports 'exec'-ing a (statement, > globals, locals) tuple: > exec("print 2", {}, {}) > 2 > > This isn't currently documented at: > http://docs.python.org/reference/simple_stmts.html#the-exec-statement.

Re: [Python-Dev] Okay to document the "exec tuple" form of the exec statement in Python 2.7?

2012-11-05 Thread Mark Dickinson
On Mon, Nov 5, 2012 at 12:22 PM, Nick Coghlan wrote: > If you can find an existing test for it, then definitely (although the > fact it didn't previously work on Jython suggests there may not be > one). I don't see any *direct* tests for this feature, though there are a couple of tests that just

Re: [Python-Dev] ctypes is not an acceptable implementation strategy for modules in the standard library?

2012-11-05 Thread Maciej Fijalkowski
On Mon, Nov 5, 2012 at 9:31 AM, anatoly techtonik wrote: > From http://bugs.python.org/issue16410 > Subj? > > Aren't there any modules in stdlib that access system API through ctypes? > > My arguments for ctypes: > 1. doesn't require compilation > 2. easier to maintain (no C/toolchain knowledge/ow

Re: [Python-Dev] ctypes is not an acceptable implementation strategy for modules in the standard library?

2012-11-05 Thread Xavier Morel
On 2012-11-05, at 10:32 , Ronald Oussoren wrote: >> My arguments for ctypes: >> 1. doesn't require compilation >> 2. easier to maintain (no C/toolchain knowledge/ownership needed) >> 3. pure Python is impossible to exploit (unlike pure C) > > That's not not quite true, python code that uses ctypes

Re: [Python-Dev] ctypes is not an acceptable implementation strategy for modules in the standard library?

2012-11-05 Thread Sturla Molden
On 05.11.2012 15:14, Xavier Morel wrote: > Such as segfaulting the interpreter. I seem to reliably segfault > everything every time I try to use ctypes. You can do that with C extensions too, by the way. Apart from that, dependency on ABI is more annoying to maintain across platforms than dep

Re: [Python-Dev] Okay to document the "exec tuple" form of the exec statement in Python 2.7?

2012-11-05 Thread Guido van Rossum
+1. This probably fell through the cracks because I changed my mind on this. The function form was old, and I wanted to root it out in favor fo the statement. But then I changed my mind for py3k. Good idea to document and add tests in 2.x. --Guido On Monday, November 5, 2012, Nick Coghlan wrote:

Re: [Python-Dev] cpython (3.3): Add examples for opener argument of open (#13424).

2012-11-05 Thread Georg Brandl
Am 03.11.2012 22:10, schrieb eric.araujo: > http://hg.python.org/cpython/rev/17b094c08600 > changeset: 80219:17b094c08600 > branch: 3.3 > parent: 80214:e6d0951f412a > user:Éric Araujo > date:Sat Nov 03 17:06:52 2012 -0400 > summary: > Add examples for opener argument

Re: [Python-Dev] Okay to document the "exec tuple" form of the exec statement in Python 2.7?

2012-11-05 Thread Greg Ewing
Nick Coghlan wrote: On Mon, Nov 5, 2012 at 10:08 PM, Mark Dickinson wrote: In Python 2, the 'exec' statement supports 'exec'-ing a (statement, globals, locals) tuple: If this is a deliberate feature, I'd guess it's because exec is a statement rather than a function in Python 2, so you can't