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


Groups > comp.lang.python > #96355

Re: Python handles globals badly.

X-Received by 10.50.43.233 with SMTP id z9mr2770257igl.9.1441987704986; Fri, 11 Sep 2015 09:08:24 -0700 (PDT)
X-Received by 10.140.84.35 with SMTP id k32mr304499qgd.30.1441987704953; Fri, 11 Sep 2015 09:08:24 -0700 (PDT)
Path csiph.com!au2pb.net!usenet.blueworldhosting.com!feeder01.blueworldhosting.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!kq10no999020igb.0!news-out.google.com!l36ni228qgd.1!nntp.google.com!z77no381315qge.1!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail
Newsgroups comp.lang.python
Date Fri, 11 Sep 2015 09:08:24 -0700 (PDT)
In-Reply-To <mailman.376.1441987055.8327.python-list@python.org>
Complaints-To groups-abuse@google.com
Injection-Info glegroupsg2000goo.googlegroups.com; posting-host=117.195.34.84; posting-account=mBpa7woAAAAGLEWUUKpmbxm-Quu5D8ui
NNTP-Posting-Host 117.195.34.84
References <c3363$547e74fe$5419aafe$24179@news.ziggo.nl> <cd7b7ffa-a217-4b62-bad2-9095b33a2bb6@googlegroups.com> <mailman.344.1441931751.8327.python-list@python.org> <55f293da$0$1640$c3e8da3$5496439d@news.astraweb.com> <CALwzidnG6kQFd5nqpN87b9AdsAan81=_FR=sfC+o3N93K28DNA@mail.gmail.com> <CAPTjJmqV0A9tw_bbDC8Z2NyTJfXGZszbkQdKwb4dXRkd89+bJw@mail.gmail.com> <CALwzid=6B9HzF-PwcEsaYLBKAWeA8QtPLhN4EQrWw17pNoJyKw@mail.gmail.com> <CAPTjJmoCuVMCXpTKeX+PvDw6rA9oyGPpQTxJ2VptbvvVu3x5yw@mail.gmail.com> <CALwzidmV93KnjEqq7avaf=R8WbhTuKuQDKF1SkjkoxZXFOsxxg@mail.gmail.com> <CAPTjJmpRno8rZYowGFHimaGfL+3nJnFrbjjhusxT8S4+fy4axw@mail.gmail.com> <mailman.376.1441987055.8327.python-list@python.org>
User-Agent G2/1.0
MIME-Version 1.0
Message-ID <81f15401-eefd-487b-a695-60fbf2a98a29@googlegroups.com> (permalink)
Subject Re: Python handles globals badly.
From Rustom Mody <rustompmody@gmail.com>
Injection-Date Fri, 11 Sep 2015 16:08:24 +0000
Content-Type text/plain; charset=ISO-8859-1
Content-Transfer-Encoding quoted-printable
Lines 27
Xref csiph.com comp.lang.python:96355

Show key headers only | View raw


On Friday, September 11, 2015 at 9:27:46 PM UTC+5:30, rand...@fastmail.us wrote:
> On Fri, Sep 11, 2015, at 11:55, Chris Angelico wrote:
> > On Sat, Sep 12, 2015 at 1:49 AM, Ian Kelly  wrote:
> > > Ah, that makes sense. It's writing into the dict that is created and
> > > returned by locals(), but not actually updating the frame locals which
> > > are the source of truth.
> > 
> > Yeah... but it only makes sense to people who understand the
> > implementation. It's certainly not a logical and sane behaviour that
> > would be worth documenting and using.
> 
> What else would you document? Reading from them is a reasonable thing to
> do, and works. Writing to them is a reasonable thing to want to do, but
> won't work, so you need to document that it doesn't work.

This is actually an old elusive holy grail -- first class environments.
In denotational semantics the two tools used to model variables and control-flow
respectively are environments and continuations.
The Scheme inventors were brave enough to mandate first-class continuations
but could not make the courage for first-class environments.
So every Scheme dialect introduces 1½ class envs in a ½-assed inconsistent way

Likewise python's locals-dicts and (I am guessing) most languages with some
commitment to first-classness

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


Thread

Re: Python handles globals badly. tdev@freenet.de - 2015-09-10 15:25 -0700
  Re: Python handles globals badly. Emile van Sebille <emile@fenx.com> - 2015-09-10 15:40 -0700
  Re: Python handles globals badly. Ian Kelly <ian.g.kelly@gmail.com> - 2015-09-10 18:35 -0600
    Re: Python handles globals badly. Marko Rauhamaa <marko@pacujo.net> - 2015-09-11 07:34 +0300
      Re: Python handles globals badly. Chris Angelico <rosuav@gmail.com> - 2015-09-11 14:59 +1000
        Re: Python handles globals badly. Marko Rauhamaa <marko@pacujo.net> - 2015-09-11 08:15 +0300
          Re: Python handles globals badly. Chris Angelico <rosuav@gmail.com> - 2015-09-11 15:25 +1000
          Re: Python handles globals badly. Mark Lawrence <breamoreboy@yahoo.co.uk> - 2015-09-12 03:43 +0100
      Re: Python handles globals badly. Ian Kelly <ian.g.kelly@gmail.com> - 2015-09-10 23:07 -0600
        Re: Python handles globals badly. Marko Rauhamaa <marko@pacujo.net> - 2015-09-11 08:27 +0300
      Re: Python handles globals badly. Rustom Mody <rustompmody@gmail.com> - 2015-09-11 00:39 -0700
    Re: Python handles globals badly. Steven D'Aprano <steve@pearwood.info> - 2015-09-11 18:42 +1000
      Re: Python handles globals badly. Chris Angelico <rosuav@gmail.com> - 2015-09-11 19:16 +1000
      Re: Python handles globals badly. Ian Kelly <ian.g.kelly@gmail.com> - 2015-09-11 09:03 -0600
        Re: Python handles globals badly. Steven D'Aprano <steve@pearwood.info> - 2015-09-12 17:00 +1000
      Re: Python handles globals badly. Chris Angelico <rosuav@gmail.com> - 2015-09-12 01:15 +1000
      Re: Python handles globals badly. Ian Kelly <ian.g.kelly@gmail.com> - 2015-09-11 09:27 -0600
      Re: Python handles globals badly. Chris Angelico <rosuav@gmail.com> - 2015-09-12 01:44 +1000
      Re: Python handles globals badly. Ian Kelly <ian.g.kelly@gmail.com> - 2015-09-11 09:49 -0600
      Re: Python handles globals badly. Chris Angelico <rosuav@gmail.com> - 2015-09-12 01:55 +1000
      Re: Python handles globals badly. random832@fastmail.us - 2015-09-11 11:57 -0400
        Re: Python handles globals badly. Rustom Mody <rustompmody@gmail.com> - 2015-09-11 09:08 -0700
      Re: Python handles globals badly. Chris Angelico <rosuav@gmail.com> - 2015-09-12 02:04 +1000
      Re: Python handles globals badly. Ian Kelly <ian.g.kelly@gmail.com> - 2015-09-11 10:27 -0600
      Re: Python handles globals badly. Mark Lawrence <breamoreboy@yahoo.co.uk> - 2015-09-12 03:51 +0100
  Re: Python handles globals badly. MRAB <python@mrabarnett.plus.com> - 2015-09-11 02:17 +0100
  Re: Python handles globals badly. Mark Lawrence <breamoreboy@yahoo.co.uk> - 2015-09-12 03:27 +0100

csiph-web