> In a weakly typed language a compiler / interpreter will sometimes change the type of a variable
Well,
a = 1
a = "a"
a = [1, a]
executes without any problem, so according to that argument, Python's typing is weak.Even if you take the "dynamic but strong" argument, it only holds for a few specific operations. A function like this cannot be considered strongly typed:
def f(x, y):
return x + y
because I can call f(1, 2) or f("a", "b") without any problem.People have been desperately wanting to claim that Python has strong typing, but it not having weak typing doesn't make it strong. They're not binary opposites.