Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

doc: example not using cls or self.__class__ #1216

Open
majidaldo opened this issue Jan 6, 2022 · 1 comment
Open

doc: example not using cls or self.__class__ #1216

majidaldo opened this issue Jan 6, 2022 · 1 comment
Labels
bug Something isn't working

Comments

@majidaldo
Copy link

(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,

...
..     @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?

@majidaldo majidaldo added the bug Something isn't working label Jan 6, 2022
@sobolevn
Copy link
Member

sobolevn commented Jan 6, 2022

@majidaldo you can try! I had problems with mypy, it was not understanding some parts of this definition.

PR is welcome 🙂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Development

No branches or pull requests

2 participants