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.
Join the #python-forum IRC channel on irc.freenode.net for off-topic chat!

Please prefer not to PM members. The point of the forum is so that anyone can benefit. We don't want to help you over PMs/emails/Skype chats that others can't benefit from :)
User avatar
Posts: 2916
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 5 guests