param1 = kw.get("param1", "") On 9/19/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > With a function defined as: > > ---------------------------- > def default(self, *arg, **kw): > ---------------------------- > > > Is there a way to grab a parameter using less code than this? > ---------------------------- > try: > param1 = str(kw['param1']) > except KeyError: > param1 ="" > ---------------------------- > > The function would need to be able to cope with being passed a > parameter, and using a default otherwise. > > > > >
-- cheers elvelind grandin --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "TurboGears" group. To post to this group, send email to turbogears@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/turbogears -~----------~----~----~----~------~----~------~--~---