Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #96356
| References | (7 earlier) <CAPTjJmoCuVMCXpTKeX+PvDw6rA9oyGPpQTxJ2VptbvvVu3x5yw@mail.gmail.com> <CALwzidmV93KnjEqq7avaf=R8WbhTuKuQDKF1SkjkoxZXFOsxxg@mail.gmail.com> <CAPTjJmpRno8rZYowGFHimaGfL+3nJnFrbjjhusxT8S4+fy4axw@mail.gmail.com> <1441987052.3506145.381042489.570191F2@webmail.messagingengine.com> <CAPTjJmrzb3gC6YWSdRnBea6iyuF_a6reJx2q+bBxWf-=Fwt2ZQ@mail.gmail.com> |
|---|---|
| From | Ian Kelly <ian.g.kelly@gmail.com> |
| Date | 2015-09-11 10:27 -0600 |
| Subject | Re: Python handles globals badly. |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.378.1441988920.8327.python-list@python.org> (permalink) |
On Fri, Sep 11, 2015 at 10:04 AM, Chris Angelico <rosuav@gmail.com> wrote: > On Sat, Sep 12, 2015 at 1:57 AM, <random832@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 <ian.g.kelly@gmail.com> 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. > > Documenting that "it doesn't work" seems fine. Documenting the > specific behaviour (that it gives you a sort of "shadow" locals, into > which you can write, but which won't persist past the execution of > that block of code) seems pointless. Especially since this behaviour > is implementation-dependent anyway. It's documented in the standard library docs: https://docs.python.org/3.4/library/functions.html#exec I think that's probably sufficient.
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll 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