Do I always have to write "self." ?

Remco Gerlich scarblac-spamtrap at pino.selwerd.nl
Tue May 2 19:38:54 EDT 2000


Samuel A. Falvo II wrote in comp.lang.python:
> 	def PrintName( name ):
> 		print "The name is %s" % name
> 
> Now, IN THE CONTEXT OF PrintName, 'name' is *obviously* a string.  So it
> doesn't make sense to use Hungarian notation here.

Well, it's actually any object that can produce a string representation.
Of course that's an irritating nitpick, but I think it's mostly that way in
Python. You don't care what type of object is passed, as long as it
implements stuff like __str__. I don't think Hungarian notation in Python is
very useful (as in, a notation that uses abbreviated prefixes to document
exactly what type of data is passed in).

If you think Hungarian is useful in Python, could you give a list of useful
prefixes to use?

-- 
Remco Gerlich,  scarblac at pino.selwerd.nl
"This gubblick contains many nonsklarkish English flutzpahs, but the
 overall pluggandisp can be glorked from context"  (David Moser)



More information about the Python-list mailing list