Re: python function defs/declarations

2006-07-05 Thread bearophileHUGS
bruce: > is there a way for me to do this.. > > print "hello" > foo() > > def foo(): > i = 2 > print "i = "i > > ie, to use 'foo' prior to the declaration of 'foo' Generally no you can't, you have to define a name before using it. Why do you want to do that? Bye, bearophile -- http://mail.pyt

Re: python function defs/declarations

2006-07-05 Thread John Salerno
bruce wrote: > the docs state that the following is valid... > print "i = "i Is this a typo or is that really in the docs? -- http://mail.python.org/mailman/listinfo/python-list

Re: python function defs/declarations

2006-07-02 Thread Alex Martelli
bruce <[EMAIL PROTECTED]> wrote: > hi.. > > the docs state that the following is valid... > > def foo(): > i = 2 > print "i = "i > > print "hello" > foo() > > > is there a way for me to do this.. > > print "hello" > foo() > > def foo(): > i = 2 > print "i = "i > > ie, to use 'foo' prio