Is the Car class an abstract or concrete class? You could name it something like:
base.Car car.AbstractCar car.CarBase I wouldn't be too concerned with seeing something like car.Car because it is possible you might put other things into that module and it just ends up being a car namespace for a few things. You also could do "from car import Car" in your __init__.py and then you can access that base class from your entire package like "from myPackage import Car" On Mon, May 12, 2014 at 11:57 AM, Jeremy YeoKhoo <[email protected]> wrote: > Thanks again for the responses. I dont usually put anything in the > __init__.py files, but I noticed that in some instances for some python > packages elsewhere that this has been done. My issue is having repetitive > names when calling a module. > > Say for instance my package is: > > vehicle/ > __init__.py > car.py > sportscar.py > Where inside car.py, I will have > > Class CAR(): > def __init__(self, drive): > if drive: > self.engine(True) > def engine(self, turnOn= False): > print "Im a lawnmower. :(" > if turnOn: > print "putt putt" > def chassis(self): > print "basic" > > > > And inside sportscar.py > > from vehicle import car as car > > class sportscar(car.CAR): > def __init__(self, drive): > car.CAR.__init__(drive) > def engine(self, turnOn): > print "I am now a V12" > if turnOn: > print "Hell yes" > > > SO my issue is having to parse in car.CAR, seems repetitive. But I guess > the fact that not many people go through this.... I must be approaching > structure of my code incorrectly. > > How would you guys approach this? > > -Jeremy > > > On Sunday, 11 May 2014 19:51:36 UTC+10, Jeremy YeoKhoo wrote: >> >> Hey gu >> I'm starting to cleanup my code, and since I've self taught programming >> from the get go and arent aware of some basic things. I have a question,. >> In regards to an __init__.py file. Can I use a folder that contains a >> __init__.py as an inherited object? And if I can, how do i structure the >> code? >> >> >> So if Car folder has __init__ how do I the call: >> >> class sportscar(car): >> def __init__(self, car.__init__): >> print "go vroom" >> >> >> -- > You received this message because you are subscribed to the Google Groups > "Python Programming for Autodesk Maya" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/python_inside_maya/648d8e7c-e7cf-478e-acb8-f19539a6903a%40googlegroups.com<https://groups.google.com/d/msgid/python_inside_maya/648d8e7c-e7cf-478e-acb8-f19539a6903a%40googlegroups.com?utm_medium=email&utm_source=footer> > . > > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CAPGFgA2P_74OHE7atMMUkb-aCr8NKXu5AsYWeXtrU%3DP4ZUCfdg%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
