What's the best way to write this base class?

Chris Angelico rosuav at gmail.com
Sat Jun 18 00:53:50 EDT 2011


On Sat, Jun 18, 2011 at 2:17 PM, John Salerno <johnjsal at gmail.com> wrote:
> 1)
> class Character:
>
>    def __init__(self, name, base_health=50, base_resource=10):
>        self.name = name
>        self.health = base_health
>        self.resource = base_resource

If you expect to override the health/resource, I'd use this model.

ChrisA



More information about the Python-list mailing list