I've been exploring dataclasses for a few months now and they've proven to be
very useful.
The only downside is that there's not a simple way to use descriptors.
Descriptors only work on class attributes (as per the docs:
https://docs.python.org/3/howto/descriptor.html#closing-thoughts). This m
the attribute will actually hold - mypy should not complain:
> ```
> @dataclass
> class Item:
> price: Decimal = typing.cast(Decimal, MyDescriptor())
>
> ```
>
> On Sun, 3 Jan 2021 at 22:48, Josue Balandrano Coronel
> wrote:
> > I've been exploring dataclasses for a fe
Then this is more of an issue with type hints rather than dataclasses.
Interesting.
On Mon, Jan 4, 2021, at 16:01, Josue Balandrano Coronel wrote:
> Ah, very interesting.
>
> Just tried this and it worked. That's awesome, thanks!
>
> On Mon, Jan 4, 2021, at 15:45, Joao S. O