On 07/17/2017 02:31 PM, Brett Cannon wrote:

I vaguely remember some years ago someone proposing a patch that used 
metaclasses to avoid using exec() (I think it was
to benefit PyPy or one of the JIT-backed interpreters). Would that work to 
remove the need for exec() while keeping the
code in pure Python?

The aenum library [1] uses the same techniques as Enum for a metaclass-based namedtuple. I don't expect it to be faster, but somebody could do the benchmarks and then we'd know for sure. ;)

--
~Ethan~

[1] https://pypi.python.org/pypi/aenum

_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to