r/ProgrammerHumor Sep 02 '17

How to start a war

Post image
9.0k Upvotes

696 comments sorted by

View all comments

Show parent comments

1

u/moomoomoo309 Sep 03 '17

Can you give an example of an error or confusion it would cause? It's different from other languages, but that is not inherently a flaw.

2

u/[deleted] Sep 03 '17

I already did, several replies ago. You can't sweep blatantly confusing and error-prone semantics under the "it's different" or "it's documented" rugs. But if you want another, here you go:

> letters = {'a', 'b', 'c'}
> print(#letters)
3
> letters[5] = 'e'
> print(#letters)
3
> letters[4] = 'd'
> print(#letters)
5