Re: default variable in python $_

2006-10-11 Thread rh0dium
(ie. b) > > > > How can I do it the above way or do I still have to go like this.. > > > > def foo() > > return {"a":"b", "b":"c"} > > > > z = foo() > > if z: > >print "Have foo" > >

Re: default variable in python $_

2006-10-11 Thread MaR
ie. b) > > How can I do it the above way or do I still have to go like this.. > > def foo() >return {"a":"b", "b":"c"} > > z = foo() > if z: >print "Have foo" >print z['a'] > > This is where

Re: default variable in python $_

2006-10-10 Thread bearophileHUGS
rh0dium: > This is where $_ in perl is awesome - There must be a default variable > in python right? A default variable may add bugs to your code, and newbies of the language may see it coming from air, so Python avoids such things. The only Python "default variable" I know of is

Re: default variable in python $_

2006-10-10 Thread Georg Brandl
nary item a (ie. b) > > How can I do it the above way or do I still have to go like this.. > > def foo() >return {"a":"b", "b":"c"} > > z = foo() > if z: >print "Have foo" >print z['a'] > > Th

default variable in python $_

2006-10-10 Thread rh0dium
. def foo() return {"a":"b", "b":"c"} z = foo() if z: print "Have foo" print z['a'] This is where $_ in perl is awesome - There must be a default variable in python right? -- http://mail.python.org/mailman/listinfo/python-list