Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #73261
| Date | 2014-06-13 14:28 +0300 |
|---|---|
| From | Paul Sokolovsky <pmiscml@gmail.com> |
| Subject | Re: Asymmetry in globals __getitem__/__setitem__ |
| References | <mailman.11039.1402597117.18130.python-list@python.org> <bvuvg0FpihtU2@mid.individual.net> <878up1wde6.fsf@elektro.pacujo.net> <d485bfa1-ae0c-44e2-b212-3479ca1762d8@googlegroups.com> <lnel84$vv9$1@ger.gmane.org> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.11054.1402658928.18130.python-list@python.org> (permalink) |
Hello,
On Fri, 13 Jun 2014 12:53:54 +0200
Peter Otten <__peter__@web.de> wrote:
[]
> > exec(fun.__code__, {}, Namespace())
> >
> >
> > Neither __getitem__ nor __setitem__ seem to be called on the local
> > variables.
>
> Accessing fun.__code__ is clever, but unfortunately the compiler
> produces different bytecodes for loading/storing variables inside a
> function. Compare:
Compiler produces different bytecodes, and allocates local variables on
stack (just like C) very fortunately, steps like that allowed Python to
drop moniker of "ridiculously slow language". And people should decide
what they really want - fast language which can stand against the
competition, or language with dynamicity and reflection capabilities
beyond any practical need. I make first choice any time. And then it
makes sense to just accept that any function can be JIT (or AOT)
compiled, and there's nothing to fish inside of it (but for the raw
machine code of unknown architecture).
--
Best regards,
Paul mailto:pmiscml@gmail.com
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Asymmetry in globals __getitem__/__setitem__ Robert Lehmann <mail@robertlehmann.de> - 2014-06-12 20:18 +0200
Re: Asymmetry in globals __getitem__/__setitem__ Gregory Ewing <greg.ewing@canterbury.ac.nz> - 2014-06-13 12:38 +1200
Re: Asymmetry in globals __getitem__/__setitem__ Marko Rauhamaa <marko@pacujo.net> - 2014-06-13 09:07 +0300
Re: Asymmetry in globals __getitem__/__setitem__ robert@robertlehmann.de - 2014-06-13 03:13 -0700
Re: Asymmetry in globals __getitem__/__setitem__ Peter Otten <__peter__@web.de> - 2014-06-13 12:53 +0200
Re: Asymmetry in globals __getitem__/__setitem__ Paul Sokolovsky <pmiscml@gmail.com> - 2014-06-13 14:28 +0300
Re: Asymmetry in globals __getitem__/__setitem__ Marko Rauhamaa <marko@pacujo.net> - 2014-06-13 15:32 +0300
csiph-web