Alexander Hirner added the comment:
@paul j3
FWIW, popping optionals from a cache that is maintained in addition to
self._actions, makes special conflict handling unnecessary.
i.e.:
for option_string in a.option_strings:
parser._option_string_actions.pop(option_string
Alexander Hirner added the comment:
In that case, what should the getter return? It doesn't know about the
implementation of x.
Maybe I'm not getting the idea behind adding getters/setters.
--
___
Python tracker
<https://bu
Alexander Hirner added the comment:
This results in E(x=None).
I'd need to look into that to understand why.
--
Added file: https://bugs.python.org/file48817/dc2_repro.py
___
Python tracker
<https://bugs.python.org/is
Alexander Hirner added the comment:
Dropping ABCMeta stops at instantiation. This should be in the dataclass code
that's been generated.
File "", line 2, in __init__
AttributeError: can't set attribute
Repro:
```
class QuasiABC:
@property
@abstractmethod
Alexander Hirner added the comment:
We construct a computational graph and need to validate (or search for possible
new) edges at runtime. The data is specific to computer vision. One example is
clipping geometry within 2D boundaries. A minimal implementation of this data
would be
Alexander Hirner added the comment:
Pardon my sloppiness.
1. That should have been PEP 544. The last point referred to the notion of data
protocols [0].
2. I think solving this issue for dataclasses would ensure better composition
with modern libraries and other idioms like Protocol and
Alexander Hirner added the comment:
Here, nothing but less boiler plate.
Wouldn't it pay off to not rewrite dataclass features like frozen, replace,
runtime refelection and the ability to use dataclass aware serialization
libraries (e.g. pydantic)? I think @dataclass+@abstractpro
New submission from Alexander Hirner :
At runtime, we want to check whether objects adhere to a data protocol. This is
not possible due to problematic interactions between ABC and @dataclass.
The attached file tests all relevant yet impossible cases. Those are:
1) A(object): Can't chec