Dynamic function generation

This is the place for queries that don't fit in any of the other categories.

Dynamic function generation

Postby Elbi » Sun Oct 27, 2013 3:26 pm

I have bunches of meta query definition like the one below. INSTTYPE, TRADETYPE etc. are attributes of my class object.

OR[ (INSTType,'==','INTER'),
('TradeType','==','STD'),
('CCPTType','==','SWWR'),
('BookType','==', 'VTN'),
]

**List containing tuples**

I want to dynamically create and return a function based on the meta which is passed to me, the returned function will take in this meta description at runtime and evaluate it against my object returning True or False.

this is a simple or expression of those attributes
Last edited by micseydel on Mon Oct 28, 2013 4:46 am, edited 1 time in total.
Reason: Locked OP.
Elbi
 
Posts: 3
Joined: Sun Oct 27, 2013 3:23 pm

Re: Dynamic function generation

Postby micseydel » Mon Oct 28, 2013 4:47 am

What is your question? You should read this btw.
Join the #python-forum IRC channel on irc.freenode.net!

Please do not PM members regarding questions which are meant to be discussed publicly. The point of the forum is so that others can benefit from it. We don't want to help you over PMs or emails.
User avatar
micseydel
 
Posts: 1204
Joined: Tue Feb 12, 2013 2:18 am
Location: Mountain View, CA


Return to General Coding Help

Who is online

Users browsing this forum: No registered users and 2 guests