Return statement question

Gregoire Welraeds helpdesk at perceval.be
Tue Mar 14 18:26:18 CET 2000


Hi Pi(th)oneers,

I though that every function had a return statement...
But I found something that looks strange to me.
In the following piece of code:

def func1():
	...
#	there is no return here
def func2():
	...
#	there is no return here
def func3():
	...
#	there is no return here

if __name__ == '__main__':
	func1()
	func2()
	func3()

I do not have an explicit call to the return statement. and the process
goes from func1() to func3().
Now imagine that func3 has one arg which is a returned value from func2 
like this :
def func1():
	...
#	there is no return here
def func2():
	...
	return some_value
def func3(sv):
	...
#	there is no return here

if __name__ == '__main__':
	func1()
	val= func2()
	func3(val)

In this cas func3 is never executed...

why ?

--
Life is not fair
But the root password helps
--

Gregoire Welraeds
greg at perceval.be
Perceval Development team
-------------------------------------------------------------------------------
Perceval Technologies sa/nv	Tel: +32-2-6409194		
Rue Tenbosch, 9			Fax: +32-2-6403154		
B-1000 Brussels			general information:   info at perceval.net
BELGIUM				technical information: helpdesk at perceval.net
URL: http://www.perceval.be/
-------------------------------------------------------------------------------





More information about the Python-list mailing list