Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!aioe.org!feeder.news-service.com!newsfeed.xs4all.nl!newsfeed5.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.027 X-Spam-Evidence: '*H*': 0.95; '*S*': 0.00; 'override': 0.07; 'pm,': 0.10; 'received:209.85.214.174': 0.14; 'received:mail- iw0-f174.google.com': 0.14; 'wrote:': 0.14; '2:17': 0.16; 'character:': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'model.': 0.16; '\xa0def': 0.16; 'header:In- Reply-To:1': 0.21; 'expect': 0.25; 'message-id:@mail.gmail.com': 0.28; 'received:209.85.214': 0.28; 'sat,': 0.29; 'subject:?': 0.29; 'class': 0.29; 'to:addr:python-list': 0.33; 'subject:What': 0.35; 'received:google.com': 0.37; 'received:209.85': 0.37; 'subject:: ': 0.38; "i'd": 0.39; 'received:209': 0.39; 'to:addr:python.org': 0.39; 'john': 0.62; 'subject:this': 0.76; 'subject:class': 0.84; 'subject:write': 0.84; 'subject:best': 0.93 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:content-type:content-transfer-encoding; bh=zofM/zcAGbvbD8FUhx/OLyxXeFhdEIMtPIwfwsX/r1o=; b=T1gp3998VOuyvTjMthkg+3ilEran4dw8N0vMtu/tI36/8/0GeyjmkEbecn7NiK/fZf EHWoqGnye21PP7kpBLfAr7K6wRwGyJ81pIfvrDyT3dEuxUKi5FTgSiDWiREzy7u5YZKz 9nxH9oXMtGbF3/QETpz36V/yajXWrblReha+c= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=q4JDNbKRw7/dKPVmDWrk1eZArs8amo+Yo7Hsg0B+Sj0JXZFymegcWzwM5hP4FhIR6U uYT1Tthogie/VzN+9kB0JGqTy7gVtbDy/BtqRJavOvcV5UKkU4AoNt5SNClvA2ilwzzV gWEdXTLtjAE3FEAERva3TB3nfQGG1xYM6sajI= MIME-Version: 1.0 In-Reply-To: <142e76c3-b304-43ef-af24-919fa6146369@c9g2000yqp.googlegroups.com> References: <142e76c3-b304-43ef-af24-919fa6146369@c9g2000yqp.googlegroups.com> Date: Sat, 18 Jun 2011 14:53:50 +1000 Subject: Re: What's the best way to write this base class? From: Chris Angelico To: python-list@python.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 12 NNTP-Posting-Host: 82.94.164.166 X-Trace: 1308372833 news.xs4all.nl 49045 [::ffff:82.94.164.166]:41844 X-Complaints-To: abuse@xs4all.nl Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:7886 On Sat, Jun 18, 2011 at 2:17 PM, John Salerno wrote: > 1) > class Character: > > =A0 =A0def __init__(self, name, base_health=3D50, base_resource=3D10): > =A0 =A0 =A0 =A0self.name =3D name > =A0 =A0 =A0 =A0self.health =3D base_health > =A0 =A0 =A0 =A0self.resource =3D base_resource If you expect to override the health/resource, I'd use this model. ChrisA