Bluenix added the comment:
Yes I agree, that would be the best.
--
___
Python tracker
<https://bugs.python.org/issue47054>
___
___
Python-bugs-list mailin
New submission from Bluenix :
Running the code below will produce a SyntaxError with the message:
"non-default argument follows default argument".
def test(a=None, b):
return b if a is None else a
The issue is that `a` and `b` aren't *arguments*, rather, they a
Bluenix added the comment:
My exact use-case is that I am subclassing asyncio.Semaphore to change some
functionality (override `release()` to do nothing and set up tasks to schedule
calls to reset the counter). I am expecting *a lot* of these instances so (like
Serhiy Storchaka nicely put
Bluenix added the comment:
>>> (1).__dict__
Traceback (most recent call last):
File "", line 1, in
AttributeError: 'int' object has no attribute '__dict__'
>>> 4.5.__dict__
Traceback (most recent call last):
File "", line 1, in
Bluenix added the comment:
> What is the problem with this?
The problem is that asyncio *is not* defining __slots__.
> Setting __slots__ in base class is required if you want to get a benefit of
> setting __slots__ in any of subclasses.
That is my use-case
New submission from Bluenix :
Most of asyncio's classes are missing a __slots__ attribute - for example Lock,
Event, Condition, Semaphore, BoundedSemaphore all from locks.py; or Future,
FlowControlMixin, Queue, BaseSubprocessTransport from various other parts of
as