[Tutor] question about *args and functions
wesbrooks at gmail.com
Fri Jan 26 16:44:37 CET 2007
You could default it to None and check in your script to see if it has changed.
def some_function(req_var, req_var2, un_req_var=None):
if un_req_var != None:
On 26/01/07, shawn bright <nephish at gmail.com> wrote:
> lo there all,
> if i have a function that sometimes needs a value passed to it and sometimes
> not, is this where i use *args ?
> like this
> def some_function(req_var, req_var2, un_req_var):
> do some stuff
> return value
> how would i use this if sometimes i need to process un_req_var and sometimes
> not ?
> Tutor maillist - Tutor at python.org
More information about the Tutor