On Fri, Apr 17, 2020 at 08:12:26PM -0300, Joao S. O. Bueno wrote:
For what matters, when I stopped to think about this, I came out with this exactly design!
Maybe this is a 'one obvious way' to deal with it, without changing any syntax?
There's nothing "obvious" about using a private implementation detail of CPython that probably won't work in other Pythons.
... caller = sys._getframe(1)
Outsider: "Python needs proper private variables."
The Python community: "We don't need that, everyone knows not to use names starting with a single leading underscore because they're private."
Also the Python community: "Let's use `_getframe`!"