4 ms·
I'd be angry at python there. It's python that uses lists like arrays in the standard language, making beginners search for arrays when python would use a list.
by onli 8y ago
I'd be angry at python there. It's python that uses lists like arrays in the standard language, making beginners search for arrays when python would use a list.
That's a pattern of the language and why I don't like it: It's very often almost like the other C-like languages, only to be that much different that it gets confusing. To just ignore that and call a list an array is not correct, but it makes the beginner searching how to do array-like stuff in python succeed in his task.
I'd be more annoyed at that page if they didn't explain the situation, but they do.
- umanwizard 8y ago> I'd be more annoyed at that page if they didn't explain the situation, but they do. Actually, they don't. The article claims that arrays don't exist, but you can use lists instead. Apparently the polar opposite is true: lists don't exist, but you can use arrays instead! (And they're called "lists" for whatever reason).
- Scarblac 8y agoThis is silly. Both "list" and "array" are so broadly defined that they largely overlap.
- umanwizard 8y agoThen why doesn’t the article point out what definitions it’s using, rather than claiming arrays don’t exist and then talking about arrays?
- onli 8y agoPython has something it calls lists. Those lists are basically like what other languages would call arrays. But python also has an array module you can use after an import, it's not loaded by default. That data structure behaves even more like the thing C calls an array. I don't see why a python list is not a list per se. Don't be confused by the others explaining it is not a linked list - something does not have to be a linked list to be a list. It's still a numbered collection of stuff that can be sorted, thus a list. Though it is true that as a programmer you probably are first confronted with a data structure called list when you learn a LISP, and that data structure will be a linked list. Confronting beginners with all this is not useful for them, w3schools just adding a note and calling the python default collection thing an array is thus not that unreasonable. Though I'd prefer it if they just called it a list in the explanation below the note, after explaining that this list structure is what you are probably searching, with a link "look there for what python calls an array". So in that way I agree with you, this is not optimal.