FAQ
I'm building a C++ program that encapsulates Python inside and has a
few extension classes with member variables and member functions. So
far almost everything is successful, I'm able to run scripts through
the utility, I can instantiate instances of my extension classes, I can
read/write member variables of the classes through class objects, but I
just cannot make member functions work properly. When I call a
function, I get the following message:
exceptions.TypeError: 'NoneType' object is not callable
The way I extend Python is nothing (as far as I can see) different from
the documented way of doing it. This is my script:

from MyModule import *

def main():
MyInstance = MyClass()

MyInstance.memberVar1 = 1
MyInstance.memberVar2 = 20
MyInstance.memberVar3 = 300

MyInstance.print()

If I comment out the last line, I get no messages, meaning good. I also
tried printing out values after I set them and it works flawlessly.
I would really appreciate if anybody could help me, because I'm at a
loss. It probably is something really stupid, but I just fail to see it
right now.

Please help.
Thanks!
Alex.

Search Discussions

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppython-list @
categoriespython
postedJan 12, '06 at 7:10p
activeJan 12, '06 at 7:10p
posts1
users1
websitepython.org

1 user in discussion

Shlychkov: 1 post

People

Translate

site design / logo © 2022 Grokbase