Not even just camel case, but I think some form of Hungarian notation with the type of the parameter prefixing the name. That is something I have never seen anyone do in python, and seems pretty at odds with the whole duck typing idea.
Seriously, I know in my code I'll initialize certain things as None and then expect them to become, say, strings later on. Not only would this not work with Hungarian notation, I think it's better because for example I've spotted logic bugs in my code from the "cannot concatenate str and nonetype" errors that popped out, but which would have been harder to track down if it just ran and gave me undesired output at the end.
You are free to assert that something is not None if you want. Relying on the name of a parameter is just not a good approach. If you desire actual types there are plenty of other languages with great type systems you can try out. If you are going to use python I really don't see a point of trying to sidestep its idioms (duck typing).
13
u/tempforfather Nov 20 '15
Not even just camel case, but I think some form of Hungarian notation with the type of the parameter prefixing the name. That is something I have never seen anyone do in python, and seems pretty at odds with the whole duck typing idea.