pre-PEP: The create statement
Michael Ekstrand
michael at elehack.net
Thu Apr 6 10:29:41 EDT 2006
Steven Bethard wrote:
> Michael Ekstrand wrote:
>> Something it could be useful to try to add, if possible: So far, it
>> seems that this create block can only create class-like things (objects
>> with a name, potentially bases, and a namespace). Is there a natural way
>> to extend this to other things, so that function creation can be
>> modified? For example:
>>
>> create tracer fib(x):
>> # Return appropriate data here
>> pass
>>
>> tracer could create a function that logs its entry and exit; behavior
>> could be modifiable at run time so that tracer can go away into oblivion.
>>
>> Given the current semantics of create, this wouldn't work. What would be
>> reasonable syntax and semantics to make something like this possible?
>>
>> Maybe this would need to be a separate PEP. But it seems at least
>> somewhat related.
>
> I think this probably needs a separate PEP. Function definitions are
> really very different from class definitions. But feel free to write
> that PEP. ;)
If I have extra time this summer, maybe. It'd be fun to write a PEP and
figure out how to add it in to Python. But that will definitely have to
wait until *after* semester tests, if I can even get to it at all...
- Michael
--
mouse, n: a device for pointing at the xterm in which you want to type.
-- Fortune
Visit me on the Web: http://www.elehack.net
More information about the Python-list
mailing list