On Sun, 2 May 2021 at 00:57, Matt del Valle <matthewgdv@gmail.com> wrote:
Hi all!

So this is a proposal for a new soft language keyword:

namespace

- any name bound within the namespace block is bound in exactly the same way it would be bound if the namespace block were not there, except that the namespace's name and a dot are prepended to the key when being inserted into the module/class/locals dict.

Sometimes it’s useful to write classes that are similar to:

class proxy:
    ….
    def __getattr__(self, name):
         return wrap(getattr(self.object, name))

How would this pattern interact with objects that use namespaces? I’m guessing the interpreter wouldn’t know to call getattr with ‘ns.attr’ rather than just ‘ns’?

Steve