Re:Brython – A Python 3 implementation for client-side web p...
by _ZeD_ on Monday July 06, 2020 @08:26AM
(#23747140)
have you ever used namedtuple? then you have: https://bugs.python.org/issue3974
[ Parent
| on HN ]
Re:Brython – A Python 3 implementation for client-side web p...
by duckerude on Monday July 06, 2020 @10:30AM
(#23748261)
namedtuple could be implemented without exec/eval, and nowadays, it almost is.
This is the only part left that uses it, to create the constructor: https://github.com/python/cpython/blob/master/Lib/collection...
Even there it's not strictly necessary. You could accomplish the same thing with a variadic function that does its own argument parsing, it'd just be slower and not play as well with reflection. So you could port it to a Python implementation without eval().