Re: Why doesn't this method have access to its "self" argument?

2015-11-19 Thread dieter
Robert Latest via Python-list writes: > I'm still trying to find a simple way to implement a method (but not the > full class) in C. Suggestions I have recived so far are good, but seem to be > over the top for such a (seemingly) simple problem. The C interface of Python is far from simple - and

Re: Why doesn't this method have access to its "self" argument?

2015-11-19 Thread Peter Otten
Robert Latest via Python-list wrote: > I found a workaround using a wrapper method which calls a C function, > passing the instance as a separate argument. It works, and I cannot see > any disadvantage. It's just not as elegant as I'd like it to be, and I > don't understand WHY the C "method" does

Re: Why doesn't this method have access to its "self" argument?

2015-11-19 Thread Chris Angelico
On Fri, Nov 20, 2015 at 3:13 AM, Robert Latest via Python-list wrote: > rl@dc:~/c/cwsf/python_module$ python test.py > > Minimal example files: > > == test.py === > > import cmethod > > class Test(): > > # add methods to the class "after the

Why doesn't this method have access to its "self" argument?

2015-11-19 Thread Robert Latest via Python-list
Hi all, I'm still trying to find a simple way to implement a method (but not the full class) in C. Suggestions I have recived so far are good, but seem to be over the top for such a (seemingly) simple problem. I came up with the idea of implementing the class in Python, and just setting the method