Am 24.01.2018 um 17:59 schrieb Steven D'Aprano:
On Wed, Jan 24, 2018 at 05:46:29PM +0100, Thomas Güttler wrote:
I found a question and answer at Stackoverflow[1] which says
that asyncio/await is like cooperative multitasking.
My whish is to have preemptive multitasking: The interpreter
does t
It may be possible but it makes for pretty leaky abstractions and it's
unclear what that custom __init__ should look like. How am I supposed to
know what the replacement for default_factory is?
Moreover, suppose I want one base class with an optional argument and a
half dozen subclasses each with
On 24/01/2018 23:25, Larry Yaeger wrote:
> Everyone uses logging during code development to help in debugging. Whether
> using a logging module or plain old print statements, this usually requires
> introducing one or (many) more lines of code into the model being worked on,
> making the exis
Everyone uses logging during code development to help in debugging. Whether
using a logging module or plain old print statements, this usually requires
introducing one or (many) more lines of code into the model being worked on,
making the existing, functional code more difficult to read. It i
It is possible to pass init=False to the decorator on the subclass (and
supply your own custom __init__, if necessary):
@dataclass
class Foo:
some_default: dict = field(default_factory=dict)
@dataclass(init=False) # This works
class Bar(Foo):
other_field: int
--
Ivan
On 23 January 201
If I'm understanding correctly, the interpreter already does this with
threads. About every 15 milliseconds the interpreter will stop a thread and
see if there are any others to work on, see "Grok the GIL," blog:
https://emptysqua.re/blog/grok-the-gil-fast-thread-safe-python/ or the
PyCon talk: htt
On Wed, Jan 24, 2018 at 05:46:29PM +0100, Thomas Güttler wrote:
> I found a question and answer at Stackoverflow[1] which says
> that asyncio/await is like cooperative multitasking.
>
> My whish is to have preemptive multitasking: The interpreter
> does the yielding.
Isn't that what threading and
On Thu, Jan 25, 2018 at 3:46 AM, Thomas Güttler
wrote:
> I found a question and answer at Stackoverflow[1] which says
> that asyncio/await is like cooperative multitasking.
"Like"? It *is* a form of co-operative multitasking.
> My whish is to have preemptive multitasking: The interpreter
> does
I found a question and answer at Stackoverflow[1] which says
that asyncio/await is like cooperative multitasking.
My whish is to have preemptive multitasking: The interpreter
does the yielding. The software developer does not need to
insert async/await keywords into its source code any more.
AFA