[Python-Dev] Removing surplus fields from the frame object and not adding any new ones. (original) (raw)
Guido van Rossum guido at python.org
Mon Apr 9 18:20:02 CEST 2012
- Previous message: [Python-Dev] Removing surplus fields from the frame object and not adding any new ones.
- Next message: [Python-Dev] Change to yield-from implementation
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On Mon, Apr 9, 2012 at 8:17 AM, Mark Shannon <mark at hotpy.org> wrote:
Guido van Rossum wrote:
On Mon, Apr 9, 2012 at 3:51 AM, Mark Shannon <mark at hotpy.org> wrote:
fnamespaces would be part of the frame, replacing fbuiltins, fglobals and flocals. The indirection of an external object hurts performance, so it would have to be a struct within the frame. The aim is clarity; locals, globals and builtins form a trio, so should be implemented as such. How does replacing three fields with a struct containing three fields reduce the size of the frame or the overhead in creating it? It doesn't. I think it would improve clarity, but I doubt it is worth the effort. The point I really wanted to make is that many of the fields in the frame object belong elsewhere and adding new fields to the frame object is generally a bad idea.
But is it? Consider the 'finally' proposal (not that I endorse it!) -- where would they put this info?
And what is the cost really? Have you measured it? Or are you just optimizing prematurely?
-- --Guido van Rossum (python.org/~guido)
- Previous message: [Python-Dev] Removing surplus fields from the frame object and not adding any new ones.
- Next message: [Python-Dev] Change to yield-from implementation
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]