Some trivia about Python frame objectsSeptember 22, 2009
Since I've been poking around in this area of CPython lately, here's some trivia associated with frame objects. First, one might wonder if code executing at the module level literally
has a CPython frame struct with This surprised me because I had always assumed that (There are various interesting efficiency hacks to make creation and destruction of frame objects faster than you might expect.) Second and probably obviously: there's no way to directly update the
builtins namespace. This is both a language issue (there's no Now, consider the following code:
This peculiar do-nothing code actually does do something: it creates
module-level shadows of the (Previously I said that there were only two cases of such namespace differences; I was wrong then, or at least insufficiently perverse.) |
These are my WanderingThoughts GettingAround This is part of CSpace, and is written by ChrisSiebenmann. * * * Atom feeds are available; see the bottom of most pages. Categories: links, linux, programming, python, snark, solaris, spam, sysadmin, tech, unix, web |