Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #53405

Re: Encapsulation unpythonic?

Path csiph.com!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!newsfeed.xs4all.nl!newsfeed1.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <rosuav@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.057
X-Spam-Evidence '*H*': 0.89; '*S*': 0.00; 'steve': 0.09; 'python': 0.11; 'language,': 0.12; 'ecosystem': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'public,': 0.16; 'language': 0.16; 'wrote:': 0.18; 'either.': 0.24; 'java': 0.24; 'header:In-Reply-To:1': 0.27; 'external': 0.29; 'said,': 0.30; 'message-id:@mail.gmail.com': 0.30; 'code': 0.31; 'usually': 0.31; "d'aprano": 0.31; 'object.': 0.31; 'sep': 0.31; 'steven': 0.31; 'definition': 0.35; 'received:google.com': 0.35; 'there': 0.35; 'c++': 0.36; 'done': 0.36; 'subject:?': 0.36; 'members.': 0.37; 'to:addr:python-list': 0.38; 'pm,': 0.38; 'rather': 0.38; 'though,': 0.39; 'to:addr:python.org': 0.39; 'above,': 0.60; 'more': 0.64; 'whereas': 0.91; 'subject:skip:E 10': 0.95; '2013': 0.98
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=Jf61QXLGw+4YPoo4FWLEBcDEh1OFYKUeE4odUj6eAA4=; b=YARdfI3MAdKFRDiNxo3iLnrbbbGT3CgbezLLPUs8mlYRzHTsV/dHwMF6E+oyzu1oOz Ldn51JeEOOeIMCAHnnKzpNttLkAc7LqxMmSeOOCLt7r9njWvELWekcH9SvV+rBbjylr5 pTd/M/8o88yTmdq+8OiPdyXX389twk//oo5L2mCNQQZfEpkqycDrlv2Gn3KG4fAUu1zk MPdVLZfocG/05cJO7F18UatNGYrlG6zpcFyQahqvnz8Gikl2v0d9Dd65MGV0XP2HIfnx n6yox/bI24/lxIKVIqCclAawXS1eYgHQL9NiWR9YqQpNTb33zodAm5j5G/wXZTMw4khj AwFA==
MIME-Version 1.0
X-Received by 10.58.136.4 with SMTP id pw4mr17264206veb.10.1378023701708; Sun, 01 Sep 2013 01:21:41 -0700 (PDT)
In-Reply-To <5222f675$0$6599$c3e8da3$5496439d@news.astraweb.com>
References <8255dfbd-a2a1-4ab7-b900-ee19faa459f2@googlegroups.com> <8c7c4854-70e1-46e7-a3ff-a3206c4c5c27@googlegroups.com> <5221567b$0$6599$c3e8da3$5496439d@news.astraweb.com> <ecd32f98-6ba8-4b1e-91d3-e0fd6a8034c3@googlegroups.com> <5221d7ab$0$6599$c3e8da3$5496439d@news.astraweb.com> <ea5a462e-b3da-44cf-8697-fa07d381d3c5@googlegroups.com> <5222f675$0$6599$c3e8da3$5496439d@news.astraweb.com>
Date Sun, 1 Sep 2013 18:21:41 +1000
Subject Re: Encapsulation unpythonic?
From Chris Angelico <rosuav@gmail.com>
To python-list@python.org
Content-Type text/plain; charset=ISO-8859-1
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.441.1378023704.19984.python-list@python.org> (permalink)
Lines 16
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1378023704 news.xs4all.nl 15999 [2001:888:2000:d::a6]:52847
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:53405

Show key headers only | View raw


On Sun, Sep 1, 2013 at 6:10 PM, Steven D'Aprano
<steve+comp.lang.python@pearwood.info> wrote:
> Java and C++ allow you to declare members as public, so it is *not true*
> that calling methods is the only way to change members. If you accept
> Steve Holden's (wrong) definition above, Java and C++ don't have
> encapsulation either.

That said, though, when you consider the language ecosystem rather
than just the language, there is a strong tendency for Java and C++
code to wrap everything up with functions (no public data members),
whereas Python code is far more likely to have external code directly
access data inside an object. You usually will find Java code calling
methods to change members, whereas that's done in Python only when
there's a need for it.

ChrisA

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Encapsulation unpythonic? fsaldan1@gmail.com - 2013-08-17 05:26 -0700
  Re: Encapsulation unpythonic? Skip Montanaro <skip@pobox.com> - 2013-08-17 07:54 -0500
  Re: Encapsulation unpythonic? David <bouncingcats@gmail.com> - 2013-08-17 23:05 +1000
  Re: Encapsulation unpythonic? Chris Angelico <rosuav@gmail.com> - 2013-08-17 16:50 +0100
  Re: Encapsulation unpythonic? Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-08-17 16:17 +0000
    Re: Encapsulation unpythonic? Joshua Landau <joshua@landau.ws> - 2013-08-18 18:15 +0100
      Re: Encapsulation unpythonic? Steven D'Aprano <steve@pearwood.info> - 2013-08-19 07:05 +0000
        Re: Encapsulation unpythonic? Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2013-08-19 18:57 -0400
        Re: Encapsulation unpythonic? random832@fastmail.us - 2013-08-21 12:52 -0400
          Re: Encapsulation unpythonic? Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-08-22 02:06 +0000
        Re: Encapsulation unpythonic? Ian Kelly <ian.g.kelly@gmail.com> - 2013-08-21 16:02 -0600
  Re: Encapsulation unpythonic? Gary Herron <gary.herron@islandtraining.com> - 2013-08-17 13:16 -0700
  Re: Encapsulation unpythonic? Terry Reedy <tjreedy@udel.edu> - 2013-08-17 17:22 -0400
  Re: Encapsulation unpythonic? Chris Angelico <rosuav@gmail.com> - 2013-08-18 01:59 +0100
  Re: Encapsulation unpythonic? chaz2cry@gmail.com - 2013-08-22 19:12 -0700
  Re: Encapsulation unpythonic? Fabrice Pombet <fp2161@gmail.com> - 2013-08-30 10:43 -0700
    Re: Encapsulation unpythonic? Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-08-31 02:35 +0000
      Re: Encapsulation unpythonic? Fabrice Pombet <fp2161@gmail.com> - 2013-08-30 23:07 -0700
        Re: Encapsulation unpythonic? Marco Buttu <marco.buttu@gmail.com> - 2013-08-31 08:49 +0200
        Re: Encapsulation unpythonic? Gary Herron <gherron@digipen.edu> - 2013-08-31 00:03 -0700
          Re: Encapsulation unpythonic? Fabrice Pombet <fp2161@gmail.com> - 2013-08-31 00:42 -0700
            Re: Encapsulation unpythonic? Fabrice Pombet <fp2161@gmail.com> - 2013-08-31 01:00 -0700
        Re: Encapsulation unpythonic? Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-08-31 11:46 +0000
          Re: Encapsulation unpythonic? Ned Batchelder <ned@nedbatchelder.com> - 2013-08-31 08:41 -0400
            Re: Encapsulation unpythonic? Fabrice Pombet <fp2161@gmail.com> - 2013-08-31 05:49 -0700
          Re: Encapsulation unpythonic? Fabrice Pombet <fp2161@gmail.com> - 2013-08-31 05:57 -0700
            Re: Encapsulation unpythonic? Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-09-01 08:10 +0000
              Re: Encapsulation unpythonic? Chris Angelico <rosuav@gmail.com> - 2013-09-01 18:21 +1000
                Re: Encapsulation unpythonic? Fabrice Pombet <fp2161@gmail.com> - 2013-09-01 03:09 -0700
                Re: Encapsulation unpythonic? Ethan Furman <ethan@stoneleaf.us> - 2013-09-01 11:42 -0700
                Re: Encapsulation unpythonic? Roy Smith <roy@panix.com> - 2013-09-01 15:13 -0400
                Re: Encapsulation unpythonic? Ethan Furman <ethan@stoneleaf.us> - 2013-09-01 13:33 -0700
                Re: Encapsulation unpythonic? Tim Delaney <timothy.c.delaney@gmail.com> - 2013-09-02 07:54 +1000
                Re: Encapsulation unpythonic? Roy Smith <roy@panix.com> - 2013-09-01 18:02 -0400
                Re: Encapsulation unpythonic? Ethan Furman <ethan@stoneleaf.us> - 2013-09-01 17:24 -0700
                Re: Encapsulation unpythonic? Roy Smith <roy@panix.com> - 2013-09-01 20:59 -0400
                Re: Encapsulation unpythonic? Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-09-02 02:57 +0000
                Re: Encapsulation unpythonic? Ethan Furman <ethan@stoneleaf.us> - 2013-09-01 21:15 -0700
                Re: Encapsulation unpythonic? Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-09-02 01:57 +0000
              Re: Encapsulation unpythonic? Ben Finney <ben+python@benfinney.id.au> - 2013-09-02 09:32 +1000
                Re: Encapsulation unpythonic? Roy Smith <roy@panix.com> - 2013-09-01 20:52 -0400
          Re: Encapsulation unpythonic? "Rhodri James" <rhodri@wildebst.demon.co.uk> - 2013-09-03 00:29 +0100
            Re: Encapsulation unpythonic? Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2013-09-03 22:41 -0400
        Re: Encapsulation unpythonic? Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2013-08-31 13:31 -0400
        Re: Encapsulation unpythonic? Tim Delaney <timothy.c.delaney@gmail.com> - 2013-09-01 03:47 +1000
    Re: Encapsulation unpythonic? 88888 Dihedral <dihedral88888@gmail.com> - 2013-09-02 14:43 -0700

csiph-web