Coding standard: Prefixing variables to indicate datatype
simonb at webone.com.au
Thu Jan 16 10:42:42 CET 2003
On Thu, 16 Jan 2003 10:28:42 +0100, Thomas Weholt wrote:
> Hm ... I see your point. I began thinking about this when I read some old
> code where a variable changed datatype during its lifespan inside a function
> several times. I think it was passed as a string, turned into a int and
> could be returned from the function as None depending on its content. It was
So use a different variable for each incarnation.
Just wrote this:
l = s.split("_") # could re-use s here
l = [ s.capitalize() for s in l ]
capit("some_name") returns "SomeName"
More information about the Python-list