Re: [Python-ideas] Vectorization [was Re: Add list.join() please]

2019-01-31 Thread David Allemang
I accidentally replied only to Steven - sorry! - this is what I said, with a typo corrected: > a_list_of_strings..lower() > > str.lower.(a_list_of_strings) I much prefer this solution to any of the other things discussed so far. I wonder, though, would it be general enough to simply have this new

Re: [Python-ideas] Range and slice syntax

2018-11-13 Thread David Allemang
That is not what slice.indices does. Per help(slice.indices) - "S.indices(len) -> (start, stop, stride) "Assuming a sequence of length len, calculate the start and stop indices, and the stride length of the extended slice described by S. Out of bounds indices are clipped in a manner consistent wi

Re: [Python-ideas] Allow Context Managers to Support Suspended Execution

2018-11-01 Thread David Allemang
568/ (PEP 568 is deferred, but PEP > 567 is implemented in Python 3.7). > > > > Those Contexts aren't context managers, but still there's some thought > put into swapping contexts out at the boundaries of generators. > > > > On Wed, Oct 31, 2018 at 7:54 PM David

[Python-ideas] Allow Context Managers to Support Suspended Execution

2018-10-31 Thread David Allemang
I do not think there is currently a good way for Context Managers to support suspended execution, as in await or yield. Both of these instructions cause the interpreter to leave the with block, yet no indication of this (temporary) exit or subsequent re-entrance is given to the context manager. If