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'),
('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.
Posts: 4
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.
Due to the reasons discussed here we will be moving to python-forum.io on October 1, 2016.

This forum will be locked down and no one will be able to post/edit/create threads, etc. here from thereafter. Please create an account at the new site to continue discussion.
User avatar
Posts: 3000
Joined: Tue Feb 12, 2013 2:18 am
Location: Mountain View, CA

Return to General Coding Help

Who is online

Users browsing this forum: Bing [Bot] and 5 guests