Message233695
Note: index returns without the caller having a chance to execute code that would change the sequence length directly. But other threads could change it, as could a custom __eq__ on an object stored in the sequence (or a poorly implemented __getitem__ or __len__ on the sequence itself, but that's getting even more pathological). Thread consistency is the code's responsibility though (we just need to make sure we behave the best we can, and hope they use locks correctly), and the odds of equality of __getitem__ altering the sequence are much lower than the odds of someone iterating the sequence and changing it as they go (which is what __iter__'s implementation allows, responding with potentially incomplete results since items might be skipped due to the mutation), but keeping the sequence in a consistent state. |
|
Date |
User |
Action |
Args |
2015-01-08 22:49:41 | josh.r | set | recipients:
+ josh.r, rhettinger, Devin Jeanpierre |
2015-01-08 22:49:41 | josh.r | set | messageid: <1420757381.63.0.826889174686.issue23086@psf.upfronthosting.co.za> |
2015-01-08 22:49:41 | josh.r | link | issue23086 messages |
2015-01-08 22:49:41 | josh.r | create | |
|