Hi I have been writing python code for a while now and I never return
anything within any of my functions, I just (eg.) print stuff or make
directories or update a log or what have you. When I look at other people's
code they are always returning in their functions and I was wondering if
someone could give me an example of when I would absolutely have to return
something. The thing I don't like about returning is that when I unindent a
function and try to run the code to inspect parts of it for debugging I
always have to alter the code so as not to get the "return not inside a
function error",  so I will change the word "return" to "print" and in many
cases that's the way I leave it. Anyone have any thoughts on this?

Thanks
Pete
_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor

Reply via email to