On Fri, Jul 1, 2016, at 10:13, Steven D'Aprano wrote: > The biggest limitation is that I have to abuse the class statement to do > this. In an ideal world, there would be syntactic support and a keyword: > > namespace Example: > x = 0 > y = [] > def test(n): ... > > although others might argue that *not* needing a dedicated keyword is, in > fact, better.
What might be nice would be a single syntax that isn't specific to classes or your "namespaces". namespace(type) Name: "equivalent to class Name:" namespace(whatever) Name: "equivalent to class Name(metaclass=whatever)" -- https://mail.python.org/mailman/listinfo/python-list