¡@

Home 

python Programming Glossary: myfun

Expanding tuples into arguments

http://stackoverflow.com/questions/1993727/expanding-tuples-into-arguments

For example here expand does the magic tuple 1 foo bar def myfun number str1 str2 return number 2 str1 str2 str2 str1 myfun expand.. myfun number str1 str2 return number 2 str1 str2 str2 str1 myfun expand tuple # 2 foobar barfoo I know one could define myfun.. expand tuple # 2 foobar barfoo I know one could define myfun as myfun a b c but of course there may be legacy code. Thanks..

Functional append/extend

http://stackoverflow.com/questions/5314820/functional-append-extend

a new list as a returned value Consider this example def myfun first args for elem in first .extend args print elem Obviously.. place instead of being forced to write the following def myfun first args all_args list first all_args.extend args for elem..