Strong/weak typing

paul paul at subsignal.org
Fri Aug 1 12:48:30 EDT 2008


MartinRinehart at gmail.com schrieb:
> I'm writing Python as if it were strongly typed, never recycling a
> name to hold a type other than the original type.
If it buys you anything? Maybe for shedskin or some future 
"to-native-code" compiler?

> Is this good software engineering practice, or am I missing something
> Pythonic?
I'd say so. In a function/method body I do reuse generic names like 
data,counter,etc. but I never change say an instance variable to another 
type (except from None). Principle of least surprise applies here.

cheers
  Paul




More information about the Python-list mailing list