K
kasper graversen
hello there.
I've just started learning python. I see methods are declared virtual by
default as in Java. Nice. However, the inner class construct seems to be
even weaker as that of Java. Not nice! :-( Why are inner classes not
virtual? will they be in a near future? What other language can you
recomend, if python cannot provide what I need?
My problem is that in the __init__ below, I cannot instantiate "Foo" but
have to explicate "Test.foo".. secondly, I want to instantiate the "Foo" in
test2 rather than in tester in the current example..
class Test:
def __init__(self):
lala = Test.Foo()
lala.show()
class Foo:
def show(self):
print "Test.foo.show"
class Test2(Test):
class Foo:
def show(self):
print "Test2.foo.show"
if __name__ == "__main__":
start = Test2()
hope to hear from you soon
\kasper
I've just started learning python. I see methods are declared virtual by
default as in Java. Nice. However, the inner class construct seems to be
even weaker as that of Java. Not nice! :-( Why are inner classes not
virtual? will they be in a near future? What other language can you
recomend, if python cannot provide what I need?
My problem is that in the __init__ below, I cannot instantiate "Foo" but
have to explicate "Test.foo".. secondly, I want to instantiate the "Foo" in
test2 rather than in tester in the current example..
class Test:
def __init__(self):
lala = Test.Foo()
lala.show()
class Foo:
def show(self):
print "Test.foo.show"
class Test2(Test):
class Foo:
def show(self):
print "Test2.foo.show"
if __name__ == "__main__":
start = Test2()
hope to hear from you soon
\kasper