@dabeaz I noticed that one can't create issues related to curio now, so i am wondering if this is a good way of asking some basic questions about curio. (Please redirect me somewhere else if you think that is the case).
In one issue on curio (https://github.com/dabeaz/curio/issues/270#issuecomment-405030942)
you pointed out that there is something called
await schedule(). I couldn't find it in the latest curio (1.4). I am wondering if it was removed, and if yes, is there any specific reason why it was removed?
Please note that my curiosity is not completely academic. C++ is introducing co-routines in its next version, and has this https://en.cppreference.com/w/cpp/coroutine/suspend_always
I was wondering what is the curio equivalent of this?
Thanks for the reply.
Right, that is listed in the issue. Considering you often draw parallels with OS scheduler which has https://linux.die.net/man/2/sched_yield, I was just wondering if there is any reason you removed it.
await sleep(0). The other reason is that forcefully causing a context switch isn't something that seems to be required all that often. Also, if someone wanted to call it
schedule(), they could make their own one-line function with that name.
I have the following code.a = 'hello!'
b = 'hello!'
a is b
Why does python creates two different string objects in the above example. But when you do not have any special character it does not create two new string objects. >>> a = 'hello'
b = 'hello'
a is b
Went to pick up an item I won at auction today. As there are Covid delays everywhere, I always bring along something to read. Today it was O'reilly's Python Cookbook, which I had on my dash as I approached the gate keeper. Seeing the book he asked if it was any good. Me wearing a mask and he deaf and only able to read lips, hard to do when we are all wearing masks, I gave him my OK hand gesture. He then went on with a fairly long story of the different snake dishes he had eaten in Florida. I listened with interest until he had finished with the "Soupa Serpente" (Snake Soup) he had in Mexico and for him to ask if there were any favorite python recipes in my book. I finally pulled down my mask and mouthed "No, Computers" and mimicked me typing on a keyboard. He replied that he'd search the internet when he got home for recipes and waved me through.
Have a Merry Christmas David and stay well.
With all this discussion of annotations on Python dev I came up with this syntactically correct way of initializing variables in Python that dynamically applies the correct type at run time:
foo: type(foo := 1)
1 here could be a function call or any other expression you like. It made me think a lot about what exactly are annotations? And how PEP 563 changes them from the arbitrary expressions they are now to more glorified in-line doc strings. Not sure anyone else is thinking much about this, but this is where my brain has been for the last couple of days.