Thanks all for all the responses! That's quite a bit to think about.
A couple of thoughts:
1. First, I do support a transition to UTF-8, so I understand we don't want
to add more methods that deal with character offsets. (I'm familiar with
how strings work in Rust.) However, does that mean we
s implementation.)
>
> What benchmark shows the regex to be significantly slower?
>
> That said, str.indexes(char) sounds like a reasonable addition.
>
> Best wishes,
> Lucas Wiman
>
> On Fri, Jun 17, 2022 at 1:12 PM Jonathan Slenders
> wrote:
>
>> Hi everyone,
Hi everyone,
Today was the 3rd time I came across a situation where it was needed to
retrieve all the positions of the line endings (or beginnings) in a very
long python string as efficiently as possible. First time, it was needed in
prompt_toolkit, where I spent a crazy amount of time looking
For what it's worth, the "regex" library on PyPI (not "re") supports
timeouts:
https://pypi.org/project/regex/
On Mon, Feb 14, 2022, 6:54 PM J.B. Langston wrote:
> Hello,
>
> I had opened this bug because I had a bad regex in my code that was
> causing python to hang in the regex evaluation:
>
Personally, I very much like this approach, although I'd definitely prefer
<> brackets instead, like in other languages.
We could possibly think of it as being syntactic sugar for the current
TypeVar approach, and have it translated into TypeVars at runtime.
However, if we'd define it that way,
2021, at 08:31, Jonathan Slenders wrote:
>
> Barry,
>
> What you describe sounds like `asyncio.gather(...)` if I understand
> correctly.
>
> The thing with a Barier is that it's usable in situations where we don't
> know the other tasks. Maybe there is no reference to them from t
guess we can probably go to bugs.python.org with this proposal.)
Jonathan
Le jeu. 25 févr. 2021 à 23:38, Barry Scott a
écrit :
>
>
> On 25 Feb 2021, at 17:15, Jonathan Slenders wrote:
>
> It does make sense to have a barrier synchronization primitive for asyncio.
> T
It does make sense to have a barrier synchronization primitive for asyncio.
The idea is to make a coroutine block until at least X coroutines are
waiting to enter the barrier.
This is very useful, if certain actions need to be synchronized.
Recently, I had to implement a barier myself for our use
For what it's worth, as part of prompt_toolkit 2.0, I implemented something
very similar to Nathaniel's idea some time ago.
It works pretty well, but I don't have a strong opinion against an
alternative implementation.
- The active context is stored as a monotonically increasing integer.
- For
Le 20 sept. 2016 18:42, "Ryan Gonzalez" a écrit :
> Doing something like:
>
> lambda x, y: myfunc(partial_arg, x, y)
>
> is more error-prone to changes in myfunc's signature.
No, if the signature of the function changes, then the signature of the
partial would also change. The
10 matches
Mail list logo