Beginning programming with Python

Gerrit Holl gerrit.holl at pobox.com
Fri Nov 19 13:45:43 CET 1999


Aahz Maruch wrote:
> >Well, not quite - you can forget the "self" in method
> >declarations fairly easily...
> 
> I don't seem to have that problem; my fingers have learned to
> automatically type "(self" whenever "def" is indented.  ;-)

Hmm, don't you ever define a function within an IF?

if __name__ == '__main__':
	def main():
		return 'main'
	main()

But that's ugly indeed...

And what about defs in defs?

regards,
Gerrit.

-- 
"We all know Linux is great...it does infinite loops in 5 seconds."
(Linus Torvalds about the superiority of Linux on the Amterdam
Linux Symposium)




More information about the Python-list mailing list