News for hackers. Stuff that matters.
Re:Anti-Patterns in Python Programming by bkeroack on Wednesday July 09, 2014 @12:32PM (#8010548)
If it's so subtle, does it matter? This sounds like you just have a problem with the word "tuple" applied to an object that behaves differently from tuples in a statically-typed language.

Would you feel better if they named it "ImmutableList" instead?

Re:Anti-Patterns in Python Programming by jholman on Wednesday July 09, 2014 @06:38PM (#8012612)
Can't speak for GP, but I would [feel better with that name].

(Although I agree with you that statically-typed-language-tuples don't seem to make sense in Python.)

But hey... Python's weird choice of how to name the ImmutableList could be worse, right?

For example, someone could be malicious enough to call their general-purpose associative array a "hash", just because a hashmap (note: not a hash) is a good implementation for large associative arrays. Wow, that'd be hilariously misleading, wouldn't it? Good times!

Or imagine someone was silly enough to name their auto-resizing arrays "vectors", even though in all previously existing contexts a "vector" is a sort of thing which absolutely cannot be meaningfully resized/extended. Ha. Think of the tiny cognitive burden placed on generations of future programmers-who-study-math, trying to juggle these two very-similar-but-distinct concepts, multiplied by the number of such future programmers. Amazing practical joke, right?

/rant

Re:Anti-Patterns in Python Programming by wtetzner on Wednesday July 09, 2014 @08:47PM (#8013016)
Not really that important, but I think map is a better name than associative array.
Re:Anti-Patterns in Python Programming by dozzie on Thursday July 10, 2014 @04:20AM (#8014143)
No, it's not a problem with word "tuple" behaving differently from statically-typed language. It's a problem with word "tuple" behaving differently from all the rest of the world.

Yes, I would feel better if it was named "ImmutableList" or any other way that is not misleading about the purpose.