class implementation

Peter Otten __peter__ at web.de
Mon Sep 30 05:27:34 EDT 2013


markotaht at gmail.com wrote:

> esmaspäev, 30. september 2013 11:43.19 UTC+3 kirjutas mark... at gmail.com:
>> Is there a way to give a class extra functions whidout editing the .py
>> file where the class is located?
> 
> But does it have all the variables that the main class have?

Yes. You can invoke all methods of Car on a FlyingCar instance. If you don't 
define an __init__() method in FlyingCar the initializer of the parent class 
will be invoked which typically sets a few attributes (I think this is what 
you mean by variables; if not: please clarify).

So just try it out. If you don't get your code to work you can post it here 
and ask for help on an actual piece of Python.





More information about the Python-list mailing list