From: "Tim Peters" <tim.one@comcast.net> > Note that Python uses PySequence_Fast() internally in such cases. This does > whatever it takes to turn an iterable object into something that can be > indexed at random via PySequence_Fast_GET_ITEM(fastseq, int_index). Under > the covers it leaves lists and tuples alone, and materializes everything > else into a temp tuple. I haven't felt a need for something fancier than > that in practice; the lack of participation in this thread from other > old-timers suggests they haven't either (piling on more protocols would > allow to optimize some cases, but it's not clear such cases are important > enough in Python Life to be worth the bother). Yep, I know about PySequence_Fast(), annd we're currently using that. However I have a bunch of numerics users who will undoubtedly be working with some kind of array from NumPy or something -- they'll be really unimpressed with me when PySequence_Fast() copies their huge multi-pass sequence without individual Python objects for the elements into a tuple with each double expressed as a separate Python float. can-you-say-PySequence_SLOW?-ly y'rs, dave
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