3 ms·
Then why does the article incorrectly claim that Python doesn't support arrays? The whole point of my comment is that I went away from the article still not kn
by umanwizard 8y ago
Then why does the article incorrectly claim that Python doesn't support arrays?
The whole point of my comment is that I went away from the article still not knowing whether Python has arrays, or not. I can't understand how anyone would defend an article called "X" that doesn't even properly inform you whether X exists
- deathanatos 8y agoThe article is not even wrong. That first yellow highlight is … ugh. If a programmer from another language asks for an array, I'm going to point them at the `list` class in Python. As some other sub-comments under your original post note, some uses of an array want the actual data to be contiguous. But Python `list`'s values are references to other values, not the direct values themselves. If you're familiar w/ C, it's closer to an array of pointers to objects. That matters for some niche cases. But in basic tutorial? No. And Python has some built-in types to account for some of the niche cases. Sure, that pointer is not free, and the overhead of a Python object is not free, but Python is a high level scripting language, and generally, `list` provides a random-access ordered collection, which is what most people want when they say "array", and the overhead doesn't matter for many things.
- bizmuthrocks 8y agoWhy are you being so insufferably dense? Are you always like this?