Re: constructor question

2008-01-21 Thread azrael
5 days ago I looked at it and didn't take a notice. thnx, this helped On Jan 22, 12:10 am, TeroV <[EMAIL PROTECTED]> wrote: > azrael wrote: > > lets supose i have a object > > class a: >   __init__(self,b): >        self.b=b > > object=a(2) > > > how can I bind the object wit

Re: constructor question

2008-01-21 Thread TeroV
azrael wrote: > lets supose i have a object > class a: __init__(self,b): self.b=b > object=a(2) > > > how can I bind the object with "print". I supose that this should be > possible with a constructor. but I don't know how. > print a > 2 > > Something like th

constructor question

2008-01-21 Thread azrael
lets supose i have a object >>>class a: >>> __init__(self,b): >>>self.b=b >>>object=a(2) how can I bind the object with "print". I supose that this should be possible with a constructor. but I don't know how. >>>print a 2 >>> Something like this Thnx -- http://mail.python.org/mai

Re: calling subclass constructor question

2005-06-19 Thread Steven Bethard
In Han Kang wrote: > So each of the sub classes plots a different type of graph. The > superclass defines methods that are the same for all the plots. I want > to be able to pick some points and be able to generate a more plots. > What I was wondering if I could define in a method in the supe

Re: calling subclass constructor question

2005-06-19 Thread D H
In Han Kang wrote: > So each of the sub classes plots a different type of graph. The > superclass defines methods that are the same for all the plots. I want > to be able to pick some points and be able to generate a more plots. > What I was wondering if I could define in a method in the supe

calling subclass constructor question

2005-06-19 Thread In Han Kang
So each of the sub classes plots a different type of graph. The superclass defines methods that are the same for all the plots. I want to be able to pick some points and be able to generate a more plots. What I was wondering if I could define in a method in the superclass of an object the ab

Re: calling subclass constructor question

2005-06-19 Thread Steven Bethard
In Han Kang wrote: > Anyway, I was wondering...I have an super class which is the superclass > for 5 other classes. However, I want to be able to call the subclass > constructors from the super class. Is this possible? Are you trying to use your superclass as a factory? If so, one option is s

Re: calling subclass constructor question

2005-06-19 Thread [EMAIL PROTECTED]
No. You will go into an infinite loop - at least I get there when I try someting like this: class Base: def __init__(self): Derived.__init__(self) print 'Base' class Derived(Base): def __init__(self): Base.__init__(self)

Re: calling subclass constructor question

2005-06-19 Thread Diez B. Roggisch
In Han Kang wrote: > Hello everyone and thank you for being such a good community. > > Anyway, I was wondering...I have an super class which is the superclass > for 5 other classes. However, I want to be able to call the subclass > constructors from the super class. Is this possible? If you h

calling subclass constructor question

2005-06-19 Thread In Han Kang
Hello everyone and thank you for being such a good community. Anyway, I was wondering...I have an super class which is the superclass for 5 other classes. However, I want to be able to call the subclass constructors from the super class. Is this possible? Thank you in advance -- http://mail.