Re: subclassing extension type and assignment to __class__

2004-12-02 Thread Gregory Lielens
> Unless I'm misunderstanding, couldn't one of __getattr__ or > __getattribute__ make mapping other methods you don't override very > simple and practical, not to mention fully automated with 2-3 lines of > code? In particular, __getattr__ would seem good for your use since > it is only called fo

assigning to __class__ for an extension type: Is it still possible?

2007-05-03 Thread gregory . lielens
Hello, We are currently writing python bindings to an existing C++ library, and we encountered a problem that some of you may have solved (or that has found unsolvable :( ): A C++ class (let's call it CClass) is binded using classical Python extension API to _PClass, which is accesible through py

Re: assigning to __class__ for an extension type: Is it still possible?

2007-05-03 Thread gregory . lielens
> We have then added the Py_TPFLAGS_HEAPTYPE tp_flag, which turn _PClass > into a heap > class and should make this class assignment possible... A precision: it seems that just addind Py_TPFLAGS_HEAPTYPE flag in the PyTypeObject tp_flags is not all you have to do to turn a static type into a heap

Step-by-step exec

2008-11-06 Thread gregory . lielens
Hi, I am using a small python file as an input file (defining constants, parameters, input data, ...) for a python application. The input file is simply read by an exec statement in a specific dictionary, and then the application retrieve all the data it need from the dictionary... Everything is w

Re: Step-by-step exec

2008-11-06 Thread gregory . lielens
On Nov 6, 1:02 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > On Nov 6, 4:27 pm, [EMAIL PROTECTED] wrote: > > > > > Hi, > > > I am using a small python file as an input file (defining constants, > > parameters, input data, ...) for a python application. > > The input file is simply read by an

Re: Step-by-step exec

2008-11-07 Thread gregory . lielens
On Nov 6, 9:53 pm, Aaron Brady <[EMAIL PROTECTED]> wrote: > Check out the InteractiveConsole and InteractiveInterpreter classes. > Derive a subclass and override the 'push' method.  It's not documented > so you'll have to examine the source to find out exactly when and what > to override. Thanks,

Re: Step-by-step exec

2008-11-07 Thread gregory . lielens
On Nov 7, 11:20 am, Steven D'Aprano <[EMAIL PROTECTED] cybersource.com.au> wrote: > > What I am trying to do is to execute it "step-by-step", so that I can > > capture the exception if one line (or multi-line statement) fails, print > > a warning about the failure, and continue the execution fo th