From: CTO <debat...@gmail.com>
Date: Thu, 14 May 2009 02:32:14 -0700 (PDT)
Local: Thurs, May 14 2009 5:32 am
Subject: Re: [Python-ideas] Default arguments in Python - the return - running out of ideas but...
> I should have said "it's impossible short of looking at the source Any which way you slice this it will require that literal code *not* > code or doing some very sophisticated introspection of the bytecode of > the module the function is defined in". be interpreted until execution time. There are other ways to do that- storing it in strings, as George Sakkis does, modifying the language itself, as is the proposal here, or reading and parsing the original source. But you're right- more info is needed than what the bytecode contains. > Even so, your recipe doesn't quite work in several cases, aside from Obviously, you are quite correct. Scoping in particular is difficult > when the source code is not accessible. both to understand and to properly handle- had me chasing my tail for about twenty minutes earlier, actually- and I'm sure this is a security nightmare, but it does (generally) what is being asked for here. And it does so without recourse to changing the syntax. Here's another possible mechanism: def runtime(f): @runtime @runtime Pretty simple, although it messes with the call syntax pretty The point is, I don't really see the point in adding a new Also, do you mind posting any problems you find in that Geremy Condra You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
| ||||||||||||||