Extending classes __init__behavior for newbies
James Mills
prologic at shortcircuit.net.au
Sun Feb 13 17:27:10 EST 2011
On Mon, Feb 14, 2011 at 8:21 AM, MRAB <python at mrabarnett.plus.com> wrote:
> I would've done it this way:
>
> class FasterShip(Ship):
> def __init__(self, speed=0, **kwargs):
> Ship.__init__(self, **kwargs)
> self.speed = speed
What's the difference between calling the base
class's constructor directly and using the super type ?
cheers
James
--
-- James Mills
--
-- "Problems are solved by method"
More information about the Python-list
mailing list