On Fri, Sep 23, 2016 at 4:40 PM, Peter Otten <__pete...@web.de> wrote:
> By the way, the current help() already loads a module if you pass its name
> as a string:
>

Yes, which is the basis of my alternate exec trick:

exec(tb.tb_frame.f_code, tb.tb_frame.f_globals, {n: n})

Basically it creates a new locals dict that just has (eg) re="re",
which allows help(re) to function as help("re").

ChrisA
-- 
https://mail.python.org/mailman/listinfo/python-list

Reply via email to