__qualname__ exposed as a local variable: standard?

2016-07-09 Thread carlosjosepita
Hi all, I noticed __qualname__ is exposed by locals() while defining a class. This is handy but I'm not sure about its status: is it standard or just an artifact of the current implementation? (btw, the pycodestyle linter -former pep8- rejects its usage). I was unable to find any reference to

Re: Namespaces are one honking great idea

2016-07-09 Thread carlosjosepita
Hi all, although it doesn't fit the bill 100%, I sometimes use this extremely simple function as a decorator: def new(call): return call() For example: @new class MySingleton: x = 2 y = 2 def sum(self, x, y): return x + y @new def my_obj(): x = 2 y = 2