On Sat, Sep 5, 2020 at 8:45 AM Greg Ewing <greg.ew...@canterbury.ac.nz> wrote:
>
> On 5/09/20 10:15 am, Chris Angelico wrote:
> > Remember that if this matters to you, you can "from math import inf".
>
> But you still need to use full eval on your repr, which could
> be a serious security problem in some contexts. If it were a
> built-in constant, ast.literal_eval could be used instead.
>

Perhaps the real solution is for literal_eval to be given a specific
set of names that it's allowed to reference. Most things don't have to
be keywords - it's normally fine for them to be builtins. (Or, in many
cases, importables.) If you make "inf" a keyword, then even the Python
standard library is broken.

ChrisA
_______________________________________________
Python-ideas mailing list -- python-ideas@python.org
To unsubscribe send an email to python-ideas-le...@python.org
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at 
https://mail.python.org/archives/list/python-ideas@python.org/message/ZKCQV452ICTQNMG7TLTRHDYRWL2UHA4C/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to