while (a=b()) ...

Marco Mariani m.mariani at imola.nettuno.it
Thu Apr 29 20:01:41 EDT 1999


Hi all language lawyers!

Which one is more ugly?



=====

c = curs.fetchone()
while c:
        print c
        c = curs.fetchone()

=====

while 1:
	c = curs.fetchone()
	if c:
		print c
	else:
		break

=====

Is there an elegant way?


while curs.fetchone()
	print $_


:-)))



-- 
"If you're going to kill someone there isn't much reason to get all worked
 up about it and angry.  Any discussions beforehand are a waste of time.
 We need to smile at Novell while we pull the trigger."

 - Jim Allchin, Microsoft corp. -




More information about the Python-list mailing list