dry-python / dry-python/returns
doc: example not using cls or self.__class__
Open
bug
- Dominant language
- Python
- Stars
- 4.4k
- Forks
- 155
- Avg merge
- 2h 27m
- Merged PRs (30d)
- 22
Description
(sorry this is just a question...not a bug. didn't know where to go just for a question. maybe open a github discussion?)
in the [example](https://returns.readthedocs.io/en/latest/pages/interfaces.html#applicative),
```
...
.. @classmethod
... def from_value( # This method is required by Applicative
... cls,
... inner_value: _NewNumberType,
... ) -> 'Number[_NewNumberType]':
... return Number(inner_value)
```
why not use cls(inner_value)? also, i understand Applicative is a protocol/interface. but it's so generic. why not make it a mixin?
Contributor guide
Assessment
This issue has not been assessed yet.