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


Groups > comp.lang.python > #58380

Re: zero argument member functions versus properties

Path csiph.com!usenet.pasdenom.info!gegeweb.org!usenet-fr.net!nerim.net!novso.com!newsfeed.xs4all.nl!newsfeed1.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <ian.g.kelly@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.005
X-Spam-Evidence '*H*': 0.99; '*S*': 0.00; 'python,': 0.02; 'attribute': 0.07; 'binary': 0.07; 'method,': 0.09; 'python': 0.11; 'abi,': 0.16; 'api,': 0.16; 'backwards': 0.16; 'distinct': 0.16; 'refactoring': 0.16; 'run-time.': 0.16; 'subject:member': 0.16; 'subject:versus': 0.16; 'underlying': 0.16; 'wrote:': 0.18; 'code,': 0.22; 'byte': 0.24; 'looks': 0.24; 'environment': 0.24; 'compiled': 0.26; 'header:In-Reply-To:1': 0.27; 'am,': 0.29; 'thus': 0.29; "doesn't": 0.30; 'message-id:@mail.gmail.com': 0.30; 'code': 0.31; 'breaking': 0.31; 'ordinary': 0.31; 'class': 0.32; 'form.': 0.35; 'received:google.com': 0.35; 'being': 0.38; 'nov': 0.38; 'to:addr:python-list': 0.38; 'does': 0.39; 'to:addr:python.org': 0.39; 'enough': 0.39; 'break': 0.61; 'matter': 0.61; 'direct': 0.67; 'mature': 0.84; 'whereas': 0.91; '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:from:date:message-id:subject:to :content-type; bh=K6yjQLTmy9C+7Vjrv0mEv8NHgpjW7TmsmYlaKHtTHE0=; b=rChmBYhMjkDntcKCntl+2vHkaaZNSx9w4TTBlTSTuoQqIwFXgZzIOmEfksEjLgVDur XKD2bVm17EH0RyzL+3Z81Uf/yzFIapbPejFTe9epZTxflc1Gb87MxWkX/ZAAx0oTVBgS HNA3cO3DQQWHkYICbqFUoR89xX+qNuM5/vK5TYiLUnHmR9gw95hswXT4svwgMkmTOnJO Ut33pAB8YRqhrf5bVvLWVegsgPmwSyH5gznEFLAOe0HWzmIvjcG3Pt7Rx+As37VS0feO 3/3xWU3CsPUrLRIZerFoE6kRnfLdPzYMBL5ZlFmHb1BKAX9SaDjzOEnF7UfSivP4MWyu 279g==
X-Received by 10.68.217.33 with SMTP id ov1mr6166268pbc.6.1383468863577; Sun, 03 Nov 2013 01:54:23 -0700 (PDT)
MIME-Version 1.0
In-Reply-To <7266a77b-3404-4974-8364-b0cb50ed45a5@googlegroups.com>
References <46d5788e-f081-48d8-b839-f31a0c95bd21@googlegroups.com> <7266a77b-3404-4974-8364-b0cb50ed45a5@googlegroups.com>
From Ian Kelly <ian.g.kelly@gmail.com>
Date Sun, 3 Nov 2013 01:53:43 -0700
Subject Re: zero argument member functions versus properties
To Python <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 <https://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 <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.1970.1383468872.18130.python-list@python.org> (permalink)
Lines 12
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1383468872 news.xs4all.nl 15886 [2001:888:2000:d::a6]:46222
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:58380

Show key headers only | View raw


On Sun, Nov 3, 2013 at 1:06 AM, Peter Cacioppi <peter.cacioppi@gmail.com> wrote:
> Actually C# is mature enough for this idiom. C# and Python both support getter/setter methods that present as direct attribute access to client code, and thus allow you to refactor the class without breaking backwards compatibility.

It's not as clear-cut as it looks in C#.  Although refactoring the
class in this way doesn't change the API, it does break ABI, which is
significant in an environment where virtually everything is
distributed in binary form.  This happens because a property access
compiled to CIL byte code is transformed into a call to a getter or
setter method, which is a distinct operation from an ordinary
attribute access.  Whereas in Python, an attribute access is just
compiled as an attribute access no matter what the underlying
implementation of that access may end up being at run-time.

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


Thread

zero argument member functions versus properties Peter Cacioppi <peter.cacioppi@gmail.com> - 2013-11-02 23:09 -0700
  Re: zero argument member functions versus properties Peter Cacioppi <peter.cacioppi@gmail.com> - 2013-11-02 23:11 -0700
  Re: zero argument member functions versus properties Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-11-03 06:52 +0000
  Re: zero argument member functions versus properties Peter Cacioppi <peter.cacioppi@gmail.com> - 2013-11-03 00:19 -0700
  Re: zero argument member functions versus properties Peter Cacioppi <peter.cacioppi@gmail.com> - 2013-11-03 01:06 -0700
    Re: zero argument member functions versus properties Ian Kelly <ian.g.kelly@gmail.com> - 2013-11-03 01:53 -0700
  Re: zero argument member functions versus properties Peter Cacioppi <peter.cacioppi@gmail.com> - 2013-11-03 13:23 -0800
    Re: zero argument member functions versus properties Ian Kelly <ian.g.kelly@gmail.com> - 2013-11-03 19:27 -0700
  Re: zero argument member functions versus properties Peter Cacioppi <peter.cacioppi@gmail.com> - 2013-11-04 15:14 -0800

csiph-web