dry-python / dry-python/returns
doc: example not using cls or self.__class__
- Lingua principale
- Python
- Stelle
- 4.4k
- Fork
- 155
- Merge medio
- 2h 27m
- PR unite (30g)
- 22
Descrizione
(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?
Guida per i contributori
Apri la guida per i contributori
Valutazione
Questa issue non è ancora stata valutata.