A
andrea_gavana
Hello Kent,
thank you a lot for your answer. I was starting to think that my question
was a little bit strange to obtain an answer...
You are right. The problem is that this is not my code. Someone else has
written it and, since it is a useful widget to have in a wxPython GUI, I
was trying to port it to Python. I don't want to mess with things like SWIG,
because this widget (compiled in C++) is not portable through all platforms,
while pure Python code should be.
I could split the class in two, but I would like to keep the class/functions
definitions as closer as possible to the original one.
do.
I am trying to figure it out using something like:
def __init__(self, parent, **kw):
and processing the keyword args, but it does not satisfy me very much...
I am sorry to be so tedious, but I am still quite a newbie in Python...
could you please provide a very small example of your last sentence? Looks
quite interesting...
Thank you a lot.
Andrea.
thank you a lot for your answer. I was starting to think that my question
was a little bit strange to obtain an answer...
Maybe you >should split the class in two?This is a strange design. My first reaction is, why do you want to do that?
You are right. The problem is that this is not my code. Someone else has
written it and, since it is a useful widget to have in a wxPython GUI, I
was trying to port it to Python. I don't want to mess with things like SWIG,
because this widget (compiled in C++) is not portable through all platforms,
while pure Python code should be.
I could split the class in two, but I would like to keep the class/functions
definitions as closer as possible to the original one.
Next, there
at the type / >number of arguments to figure out what it is supposed toOne way to do this in Python is to have a single constructor that looks
do.
I am trying to figure it out using something like:
def __init__(self, parent, **kw):
and processing the keyword args, but it does not satisfy me very much...
Another way is to make two factory methods that
create instances of the class and do the correct initialization.
I am sorry to be so tedious, but I am still quite a newbie in Python...
could you please provide a very small example of your last sentence? Looks
quite interesting...
Thank you a lot.
Andrea.