pre-PEP: The create statement

Steven Bethard steven.bethard at gmail.com
Thu Apr 6 12:18:00 EDT 2006


Michele Simionato wrote:
> Carl Banks wrote:
>>>      create module mod:
>>>          "This creates a sub-module named mod with an f1 function"
>>>
>>>          def f1():
>>>              ...
>> Let's not do this, really.  A module should be one-to-one with a file,
>> and you should be able to import any module.  Having in-line modules
>> complicates everything.  And it becomes a misnomer.  So, please, let's
>> get a better example.  If you must, call it a scope or namespace.
> 
> You are right, I think I am responsible for the wrong choice of the
> name.
> What I had in mind was a namespace or, if you wish, a named dictionary.
> An simple-minded implementation could be
> 
> class Namespace(object):
>     def __init__(self, name, args, dic):
>         self.__name__ = name
>         self.__dict__.update(dic)
> 
> create Namespace keymap:
>      A = 1
>      B = 2

I changed the PEP to use "namespace" instead of "module":

     http://ucsu.colorado.edu/~bethard/py/pep_create_statement.txt
     http://ucsu.colorado.edu/~bethard/py/pep_create_statement.html


STeVe



More information about the Python-list mailing list