> By the way can somebody explain me this trick "()": > > session = scoped_session(lambda: sessionmaker > (bind=application.database_engine)(), local_manager.get_ident)
sessionmaker is a factory function, ie a function that returns a function. with sessionmaker(..)() you immediately call the returned function (with no arguments in this case). I do wonder why you need "lambda: sessionmaker(..)()" as an argument though? It seems to me it's the same as if you used just "sessionmaker (..)" as the first argument. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "pocoo-libs" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/pocoo-libs?hl=en -~----------~----~----~----~------~----~------~--~---
