> On Tuesday 11 March 2003 09:11 pm, Guido van Rossum wrote: > > I bet you can't prove the speed-up. > > Here's the script I used to test it: [Good use of 'timeit' module skipped] > There seems to be a constant 1.3 usec or so difference between > creating a tuple and creating a list. As I mentioned earlier, I > seriously doubt it would have any significant impact on the overall > execution speed of any non-trivial Python program, but it exists > nonetheless. Maybe in the realm of 'low hanging fruit' it's the > fruit that's fallen to the ground and begun to rot :) Of course creating a tuple is faster than creating a list. I meant that you wouldn't be able to show a speed difference in any of the places where you would consider adding it (i.e. in context). > > Tuples are for heterogeneous data, list are for homogeneous data. > > Tuples are *not* read-only lists. > > I understand this in a strictly typed language, but in Python, since > lists can be just as heterogeneous as tuples, it's always seemed to > me that the greatest difference between lists and tuples is the > mutability and extensibility of lists. Sorry, you're wrong. --Guido van Rossum (home page: http://www.python.org/~guido/)
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4