Style question: 'return None' vs 'pass' in do-nothing methods?

Cliff Wells logiplexsoftware at earthlink.net
Tue Jan 8 14:31:43 EST 2002


On Tue, 8 Jan 2002 11:04:54 -0800
"Elf M. Sternberg" <elf at drizzle.com> wrote:
> def stylesheet(self):
> 	return None
> 
> Whereas Webware used:
> 
> def writeStyleSheet(self):
> 	pass
> 
> 	Is there a reason for favoring one over the other?

They both return None, so I would think it's a matter of taste, although
"return None" is more explicit.
Also, Webware's naming convention is a bit clearer also, since "stylesheet"
seems to imply an object rather than an action.

-- 
Cliff Wells
Software Engineer
Logiplex Corporation (www.logiplex.net)
(503) 978-6726 x308
(800) 735-0555 x308




More information about the Python-list mailing list