I missed an important line of code. Here it is:

    >>> aaa = 'telltale'

Once you have that, these will work:

      >>> eval('aaa', fn.__globals__)
      'telltale'

      >>> __name__
      '__main__'
      >>> import sys
      >>> getattr(sys.modules[__name__], 'aaa')
     'telltale'

-- 
Jonathan
_______________________________________________
Python-ideas mailing list
Python-ideas@python.org
https://mail.python.org/mailman/listinfo/python-ideas
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to