Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
passing an expression
#1
i can code the expression in a string and pass that string to my function with evaluates it with eval() in the context it needs to do (perhaps by raising different exceptions). but i don't really like coding it in a string. is there a better way to do this in Python? the objective is to pass some code (not its value) to a function which may or may not execute it. these would be expressions, not statement, if that matters.
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