Re: how to get self in callback function

Adam Morris <[email protected]>
Newsgroups gmane.comp.python.ctypes
Message-ID <[email protected]>
Update:

I was getting this error:
File "_ctypes/callbacks.c", line 291, in 'calling callback function'
TypeError: standard_vote_callback() takes exactly 5 positional
arguments (4 given)

Since this was the first time using ctypes, I thought the error I got
above was actually a feature. But I was getting it because I was
passing class method instead of an instance method.

Looking closely at my code, I realized that if I assumed I got self
for free, it all worked, and there's no need to use the context
argument.

-Adam

------------------------------------------------------------------------------
ThinkGeek and WIRED's GeekDad team up for the Ultimate 
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the 
lucky parental unit.  See the prize list and enter to win: 
http://p.sf.net/sfu/thinkgeek-promo
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.