Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
passing an expression
#7
(Feb-18-2021, 11:23 AM)Larz60+ Wrote: It 'has been stated' that eval is bad news

I refer you to: https://nedbatchelder.com/blog/201206/ev...erous.html

There are others who disagree.

right.

this is one of the reasons i want to avoid passing a string to eval(). fortunately, i am only needing to evaluate expressions in my code. there are no untrusted sources in this.

in a language i once created, it was possible to manipulate compiled code in a way that allowed passing the code to a function which could manipulate it further (pass it to another function) and/or evaluate/execute it perhaps more than once (using local values that can be changed). i'm just looking for a way to do something like this in Python.
Tradition is peer pressure from dead people

What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
Reply


Messages In This Thread
passing an expression - by Skaperen - Feb-16-2021, 10:35 PM
RE: passing an expression - by Larz60+ - Feb-17-2021, 02:29 AM
RE: passing an expression - by Skaperen - Feb-18-2021, 02:39 AM
RE: passing an expression - by Gribouillis - Feb-17-2021, 08:00 AM
RE: passing an expression - by Larz60+ - Feb-18-2021, 11:23 AM
RE: passing an expression - by Skaperen - Feb-21-2021, 12:15 AM
RE: passing an expression - by ndc85430 - Feb-21-2021, 07:36 AM
RE: passing an expression - by Skaperen - Feb-23-2021, 11:41 PM
RE: passing an expression - by ndc85430 - Feb-18-2021, 06:10 PM
RE: passing an expression - by Larz60+ - Feb-21-2021, 09:14 AM
RE: passing an expression - by Skaperen - Feb-23-2021, 11:58 PM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020