execfile() and locals()

2010-08-15 Thread fons
Hello all, The documentation on execfile() and locals() makes it clear that code executed from execfile() can not modify local variables in the function from wich execfile() was called. Two questions about this: 1. Is there some way to circumvent this limitation (apart from explicitly copying var

Re: execfile() and locals()

2010-08-16 Thread fons
On Sun, Aug 15, 2010 at 11:24:25PM +, Steven D'Aprano wrote: > On Sun, 15 Aug 2010 23:21:51 +0200, fons wrote: > > > The documentation on execfile() and locals() makes it clear that code > > executed from execfile() can not modify local variables in the function >

PyCObject_FromVoidPtr etc.

2011-03-22 Thread Fons Adriaensen
Hello all, Upgrading to 3.2 has provided some sort of cold shower. I have hundreds of extensions that fail to install due to PyCObject_FromVoidPtr() and PyCObject_AsVoidPtr() not longer being available, and I'm looking for a (hopefully) simple solution. In all cases, these are extensions that cr

Callback mysteries

2011-03-24 Thread Fons Adriaensen
Hello all, I wonder if someone could explain some of the following. (Python 3.2) I have a class which has a method called 'callback()'. An instance of this class calls a C extension which then calls back into Python. In all cases below, two arguments are passed to the C code and end up in PyO

Re: why memoizing is faster

2011-03-24 Thread Fons Adriaensen
On Thu, Mar 24, 2011 at 08:12:22PM -0400, Terry Reedy wrote: > The irony of this is that memoizing 'recursive' functions with a > decorator depends on the fact the Python does not have truly recursive > functions. A function cannot call itself directly. I wonder what exactly is meant by that

Re: Guido rethinking removal of cmp from sort method

2011-03-28 Thread Fons Adriaensen
On Mon, Mar 28, 2011 at 11:06:20AM +0200, Antoon Pardon wrote: > Asking for *real-world* uses is just how the python community smothers > requests. It's quite a common strategy, I've seen it used in many contexts. Which doesn't make it any more acceptable of course. > Should someone come with

Re: FBI wants public help solving encrypted notes from murder mystery

2011-03-30 Thread Fons Adriaensen
On Wed, Mar 30, 2011 at 01:25:54PM -0700, Joe Snodgrass wrote: > For larger images of the notes go here. [LINK] [LINK] ??? -- FA -- http://mail.python.org/mailman/listinfo/python-list