Looks like you misunderstand what's going on. sys._getframe()
*intentionally* smells like a hack, becase we don't *want* you to feel
comfortable using it. Its mere existence may constrain other Python
implementations from optimizing the code they generate; it is a
compromise to enable those project
Martin v. Löwis wrote:
> Michael Foord schrieb:
>> Hello all,
>>
>> I realise that this may be more relevant to Python ideas, in which
>> case feel free to ignore this (and my apologies).
>>
>> I occasionally see code looking (something) like :
>>
>>
>> calling_scope = sys._getframe(1).f_globals['
Michael Foord schrieb:
> Hello all,
>
> I realise that this may be more relevant to Python ideas, in which case
> feel free to ignore this (and my apologies).
>
> I occasionally see code looking (something) like :
>
>
> calling_scope = sys._getframe(1).f_globals['__name__']
>
> This looks and
Hello all,
I realise that this may be more relevant to Python ideas, in which case
feel free to ignore this (and my apologies).
I occasionally see code looking (something) like :
calling_scope = sys._getframe(1).f_globals['__name__']
This looks and smells like a hack (not least because of the