Post ACpd3VrjVIBg6jlr6W by redoak@social.coop
(DIR) More posts by redoak@social.coop
(DIR) Post #ACpd3VrjVIBg6jlr6W by redoak@social.coop
2021-10-28T15:52:53Z
0 likes, 0 repeats
i'm messing around with type annotations for my own edification, and... am i really supposed to put `self: "ClassName"` in every single method call in every single class? seems completely unfathomable to me
(DIR) Post #ACpd3XdGw1oBaT1KqG by redoak@social.coop
2021-10-28T16:09:56Z
0 likes, 0 repeats
hmm... the sample code in the `typing` module documentation suggests that you should solve this by (for example):```python_M = TypeVar('_M')class MyClass(Generic[_M]): pass```in which case you shouldn't need to annotate every `self` in a method call... but that's not how `flake8-annotations` wants it to work, it seems.
(DIR) Post #ACpd3ZKYca1ir0HPwu by redoak@social.coop
2021-10-28T17:16:53Z
0 likes, 0 repeats
public post for visibility, please see thread ^^#python #foss #code