pre-PEP: The create statement

Michael Ekstrand michael at elehack.net
Thu Apr 6 08:39:25 EDT 2006


Steven Bethard wrote:
> The PEP below should be mostly self explanatory. I'll try to keep the 
> most updated versions available at:
> 
>      http://ucsu.colorado.edu/~bethard/py/pep_create_statement.txt
>      http://ucsu.colorado.edu/~bethard/py/pep_create_statement.html
> 
> 
> 
> PEP: XXX
> Title: The create statement
> Version: $Revision: 1.4 $
> Last-Modified: $Date: 2003/09/22 04:51:50 $
> Author: Steven Bethard <steven.bethard at gmail.com>
> Status: Draft
> Type: Standards Track
> Content-Type: text/x-rst
> Created: 05-Apr-2006
> Python-Version: 2.6
> Post-History: 05-Apr-2006
> [large amount of crunchy goodness snipped]

+1 from me on this one.

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.

- 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