A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2008-October/082954.html below:

[Python-Dev] effect of "exec" on local scope

[Python-Dev] effect of "exec" on local scope [Python-Dev] effect of "exec" on local scopeTerry Reedy tjreedy at udel.edu
Thu Oct 9 05:18:13 CEST 2008
Ondrej Certik wrote:

> Which works in CPython but fails in CLPython. From your answer it
> seems to me that this code is not nice and we should not use it and
> should rather use something like:
> 
> class Basic(AssumeMeths):
>   ...
> 
> for k in AssumeMeths._assume_defined:
>   setattr(Basic, 'is_%s' % k, property(make__get_assumption('Basic', '%s' % k)))
> 
> which should work on all platforms. What do you think?

That is what setattr is for.  Many consider exec a last resort.  I think 
any further discussion should move to the general python list or c.l.p 
since this is not a develop-core-python issue.

More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4