In any dynamic language (e.g. Python), everyone agrees that the following is a Bad Thing (tm).total = [42, 13, 57] # it's a bird, er uh list
total = sum # it's a plane, er uh int
total = f'{sum'} # it's a supervar!, er uh strAnd when I talk to functionary zealots, they like to point out that assigning a variable to different values (even of the same type) violates everything we learned in school about math.x = 57 - 42
x = 13 # but wait, I thought x was 14. I'm so confused nowGiven these sentiments, why do the cadre of mainstream popular languages embrace Variable shadowing ( would have thought that as computer languages became more interested in "correctness", that this loophole for cognitive confusion (and even unexpected behavior/bugs) would be discouraged or even disallowed.