optional argument to a subclass of a class

alex23 wuwei23 at gmail.com
Thu May 20 23:50:54 EDT 2010


Patrick Maupin <pmau... at gmail.com> wrote:
> One thing you can do is in battleship, you can accept additional
> keyword arguments:
>
>     def __init__(self, name, ..., **kw):
>
> Then you could invoke the superclass's init:
>
>     Craft.__init__(self, name, **kw)

_All_ of which is covered in the tutorial. At what point do we expect
people to actually put some effort into learning the language
themselves? Is this why we're constantly spammed with "write my code
for me" requests?

If you're asking _basic_ "how do I" questions, and you don't even have
the common sense to read through the support docs before doing so,
then you really should be directing questions here:
http://mail.python.org/mailman/listinfo/tutor



More information about the Python-list mailing list