Simple Python Sandbox

Roland Koebler r.koebler at yahoo.de
Mon Aug 16 09:38:14 EDT 2010


On Sat, Aug 14, 2010 at 07:54:11PM -0700, Stephen Hansen wrote:
> How are you implementing refusing-names-beginning-with-underscore, out
> of curiosity?
I compile the expressions and look into co_names, e.g.:
  >>> expr = "0 .__class__"
  >>> c=compile(expr,"","eval")
  >>> c.co_names
  ('__class__',)


regards,
Roland




More information about the Python-list mailing list