Greg Ewing wrote:

>    def my_func():
>      namespace foo
>      foo.x = 42
> 
>      def inc_x():
>        foo.x += 1
> 
> The idea here is that foo wouldn't be an object in
> its own right, but just a collection of names that
> would be implemented as local variables of my_func.

But why is that better than

class namespace(object): pass

def my_func():
    foo = namespace()
    (...)

?

Georg

_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to