X-Received: by 10.224.13.136 with SMTP id c8mr8392084qaa.0.1376742392402; Sat, 17 Aug 2013 05:26:32 -0700 (PDT) X-Received: by 10.49.119.232 with SMTP id kx8mr2265qeb.12.1376742392381; Sat, 17 Aug 2013 05:26:32 -0700 (PDT) Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!usenet.blueworldhosting.com!feeder02.blueworldhosting.com!border4.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!f7no2660503qan.0!news-out.google.com!he10ni2338qab.0!nntp.google.com!fx3no2798067qab.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.python Date: Sat, 17 Aug 2013 05:26:32 -0700 (PDT) Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=179.218.132.25; posting-account=lfPdVwkAAAD3Ja_yyk5ogDoEbbYBfI7z NNTP-Posting-Host: 179.218.132.25 User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <8255dfbd-a2a1-4ab7-b900-ee19faa459f2@googlegroups.com> Subject: Encapsulation unpythonic? From: fsaldan1@gmail.com Injection-Date: Sat, 17 Aug 2013 12:26:32 +0000 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Lines: 18 Xref: csiph.com comp.lang.python:52622 I am new to Python, with experience in Java, C++ and R.=20 As I understand encapsulation is not a big thing in the Python world. I rea= d that you can put two underscores before the name of a variable within a c= lass declaration but in the many examples of code I looked at this is not w= idely used. I also read that encapsulation is "unpythonic." Questions: 1) Is there a good text where I can read about the language philosophy? Wha= t practices are "pythonic" or "unpythonic"? 2) If it is in fact true that encapsulation is rarely used, how do I deal w= ith the fact that other programmers can easily alter the values of members = of my classes? Thanks for any insights. FS