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


Groups > comp.lang.python > #52710

Re: Importing variables non-deterministic?

Path csiph.com!usenet.pasdenom.info!goblin2!goblin.stu.neva.ru!newsfeed.xs4all.nl!newsfeed1.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail
Return-Path <python-python-list@m.gmane.org>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.014
X-Spam-Evidence '*H*': 0.97; '*S*': 0.00; 'variables': 0.07; 'attributes': 0.09; 'bindings': 0.09; 'immutable': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'variable,': 0.09; 'variables.': 0.09; 'python': 0.11; 'mostly': 0.14; 'bindings.': 0.16; 'constants.': 0.16; 'fine.': 0.16; 'finney': 0.16; 'reasonable.': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'subject:non': 0.16; 'variable.': 0.16; ':-)': 0.16; 'wrote:': 0.18; 'meant': 0.20; 'seems': 0.21; 'header:User-Agent:1': 0.23; 'case.': 0.24; 'right.': 0.26; 'defined': 0.27; 'header:X-Complaints-To:1': 0.27; 'point': 0.28; 'function': 0.29; 'generally': 0.29; 'thus': 0.29; 'adams': 0.31; 'douglas': 0.31; 'writes:': 0.31; 'class': 0.32; 'themselves': 0.32; 'another': 0.32; 'problem': 0.35; 'agree': 0.35; 'classes': 0.35; 'objects': 0.35; 'but': 0.35; 'doubt': 0.36; 'leads': 0.36; 'subject:skip:d 10': 0.36; 'subject:?': 0.36; 'so,': 0.37; 'too': 0.37; 'being': 0.38; 'ben': 0.38; 'to:addr :python-list': 0.38; 'to:addr:python.org': 0.39; 'changed': 0.39; 'received:org': 0.40; 'even': 0.60; 'skip:u 10': 0.60; 'dave': 0.60; 'areas': 0.61; "you're": 0.61; 'more': 0.64; 'skip:\xe2 10': 0.65; '8bit%:40': 0.68; 'nobody': 0.68; '8bit%:21': 0.69; 'other.': 0.75; 'forth': 0.81; 'confusion.': 0.84; 'pardon': 0.84; '\xe2\x80\x9cwe': 0.84; 'angel': 0.91; 'avoided.': 0.91; 'demand': 0.91; 'hand,': 0.93
X-Injected-Via-Gmane http://gmane.org/
To python-list@python.org
From Ben Finney <ben+python@benfinney.id.au>
Subject Re: Importing variables non-deterministic?
Date Tue, 20 Aug 2013 11:14:49 +1000
References <a75383ec-b363-4ad4-9703-ca5d8ea614df@googlegroups.com> <520f9054$0$30000$c3e8da3$5496439d@news.astraweb.com> <5211C5BD.5040209@rece.vub.ac.be> <kusidq$kaa$1@ger.gmane.org> <5211D464.5090303@rece.vub.ac.be>
Mime-Version 1.0
Content-Type text/plain; charset=utf-8
Content-Transfer-Encoding 8bit
X-Gmane-NNTP-Posting-Host rasputin.madmonks.org
X-Public-Key-ID 0xBD41714B
X-Public-Key-Fingerprint 9CFE 12B0 791A 4267 887F 520C B7AC 2E51 BD41 714B
X-Public-Key-URL http://www.benfinney.id.au/contact/bfinney-gpg.asc
X-Post-From Ben Finney <bignose+hates-spam@benfinney.id.au>
User-Agent Gnus/5.13 (Gnus v5.13) Emacs/23.4 (gnu/linux)
Cancel-Lock sha1:ok18IVOx+peu/e7sdMExMiiu/9U=
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.45.1376961306.19984.python-list@python.org> (permalink)
Lines 36
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1376961306 news.xs4all.nl 15964 [2001:888:2000:d::a6]:58047
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:52710

Show key headers only | View raw


Antoon Pardon <antoon.pardon@rece.vub.ac.be> writes:

> Op 19-08-13 09:45, Dave Angel schreef:
> > Antoon Pardon wrote:
> >> I think you are overstating your case. Classes and functions are
> >> variables too and in general nobody seems to have a problem with
> >> them being global.
> > 
> > It's global *variables* that are to be avoided. constants like
> > clsases and functions are fine. On the other hand, class attributes
> > can be variable, and thus are to be avoided when reasonable.
>
> Python has no constants. Classes and functions can be changed just like
> any other variable. I agree that classes and function are generally
> meant to be constant, but often enought so are global int variables.

I take this as yet another data point that speaking about “variables”
leads mostly to confusion.

What Python has are bindings. Those bindings can change (what Antoon
calls “changed just like any other variable”).

Many objects are immutable (what Dave calls “constants like classes and
functions”), even if the bindings can vary and even if they contain
attributes which are themselves bindings that can change.

So, you're both right. The terminology is leading you both astray and
having you talk past each other. Now go forth and speak of variables no
more :-)

-- 
 \         “We demand rigidly defined areas of doubt and uncertainty!” |
  `\    —Vroomfondel, _The Hitch-Hiker's Guide To The Galaxy_, Douglas |
_o__)                                                            Adams |
Ben Finney

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


Thread

Importing variables non-deterministic? tmellman@googlemail.com - 2013-08-17 07:25 -0700
  Re: Importing variables non-deterministic? Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-08-17 15:01 +0000
    Re: Importing variables non-deterministic? Antoon Pardon <antoon.pardon@rece.vub.ac.be> - 2013-08-19 09:14 +0200
    Re: Importing variables non-deterministic? Dave Angel <davea@davea.name> - 2013-08-19 07:45 +0000
    Re: Importing variables non-deterministic? Antoon Pardon <antoon.pardon@rece.vub.ac.be> - 2013-08-19 10:16 +0200
      Re: Importing variables non-deterministic? Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-08-19 16:57 +0000
        Re: Importing variables non-deterministic? Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-08-19 17:16 +0000
          Re: Importing variables non-deterministic? Chris Angelico <rosuav@gmail.com> - 2013-08-19 18:25 +0100
        Re: Importing variables non-deterministic? Antoon Pardon <antoon.pardon@rece.vub.ac.be> - 2013-08-19 19:40 +0200
    Re: Importing variables non-deterministic? Chris Angelico <rosuav@gmail.com> - 2013-08-19 09:32 +0100
      Re: Importing variables non-deterministic? Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-08-19 17:05 +0000
        Re: Importing variables non-deterministic? Antoon Pardon <antoon.pardon@rece.vub.ac.be> - 2013-08-19 22:34 +0200
          Re: Importing variables non-deterministic? Steven D'Aprano <steve@pearwood.info> - 2013-08-20 05:48 +0000
            Re: Importing variables non-deterministic? wxjmfauth@gmail.com - 2013-08-19 23:40 -0700
            Re: Importing variables non-deterministic? Antoon Pardon <antoon.pardon@rece.vub.ac.be> - 2013-08-20 08:55 +0200
              Re: Importing variables non-deterministic? wxjmfauth@gmail.com - 2013-08-20 00:31 -0700
                Re: Importing variables non-deterministic? Antoon Pardon <antoon.pardon@rece.vub.ac.be> - 2013-08-20 09:55 +0200
                Re: Importing variables non-deterministic? wxjmfauth@gmail.com - 2013-08-20 02:15 -0700
    Re: Importing variables non-deterministic? Antoon Pardon <antoon.pardon@rece.vub.ac.be> - 2013-08-19 11:03 +0200
    Re: Importing variables non-deterministic? Chris Angelico <rosuav@gmail.com> - 2013-08-19 10:18 +0100
    Re: Importing variables non-deterministic? Peter Otten <__peter__@web.de> - 2013-08-19 11:49 +0200
    Re: Importing variables non-deterministic? Antoon Pardon <antoon.pardon@rece.vub.ac.be> - 2013-08-19 13:54 +0200
    Re: Importing variables non-deterministic? Dave Angel <davea@davea.name> - 2013-08-19 12:33 +0000
    Re: Importing variables non-deterministic? Antoon Pardon <antoon.pardon@rece.vub.ac.be> - 2013-08-19 16:55 +0200
    Re: Importing variables non-deterministic? Chris Angelico <rosuav@gmail.com> - 2013-08-19 16:04 +0100
    Re: Importing variables non-deterministic? Antoon Pardon <antoon.pardon@rece.vub.ac.be> - 2013-08-19 19:25 +0200
    Re: Importing variables non-deterministic? Ben Finney <ben+python@benfinney.id.au> - 2013-08-20 11:14 +1000

csiph-web