Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!nntp.club.cc.cmu.edu!micro-heart-of-gold.mit.edu!bloom-beacon.mit.edu!bloom-beacon.mit.edu!panix!not-for-mail From: Grant Edwards Newsgroups: comp.lang.python Subject: Re: Classes Date: Fri, 31 Oct 2014 15:49:43 +0000 (UTC) Organization: PANIX Public Access Internet and UNIX, NYC Lines: 21 Message-ID: References: <51755at03r0bidjqh3qf0hhpvjr8756ill@4ax.com> <545350c3$0$23449$426a74cc@news.free.fr> NNTP-Posting-Host: 67-130-15-94.dia.static.qwest.net X-Trace: reader2.panix.com 1414770583 17214 67.130.15.94 (31 Oct 2014 15:49:43 GMT) X-Complaints-To: abuse@panix.com NNTP-Posting-Date: Fri, 31 Oct 2014 15:49:43 +0000 (UTC) User-Agent: slrn/1.0.1 (Linux) Xref: csiph.com comp.lang.python:80021 On 2014-10-31, Ian Kelly wrote: > On Fri, Oct 31, 2014 at 8:05 AM, Seymore4Head > wrote: >> Because the topic of that lesson was getter setter. >> I can construct an __init___ but I was practicing get/set. > > Doesn't sound like a very good lesson to me. It's not. It's teaching java or C++ or some other language while using a Python compiler. > Getters and setters are the Java way of doing things. The Pythonic > way is to just use an attribute, and then replace it with a property > in the unlikely event that getter/setter logic needs to be added. Exactly. -- Grant Edwards grant.b.edwards Yow! I have the power to at HALT PRODUCTION on all gmail.com TEENAGE SEX COMEDIES!!