from typing import Self
class Foo:
def __init__(self, value: str) -> None: # no error
pass
def __new__(cls, value: str) -> Self: # no error
return cls(value)
def __init_subclass__(cls, value: str) -> None: # no error
pass
this is because i special-cased dunders to not report it because in many cases they should be treated the same way as an override, but these three dunders should still report it
also need to account for the fact that the __init__ arguments need to match the __new__ arguments, so for those i guess it should only report the error if it's unused in both?
Code sample in basedpyright playground
this is because i special-cased dunders to not report it because in many cases they should be treated the same way as an override, but these three dunders should still report it
also need to account for the fact that the
__init__
arguments need to match the__new__
arguments, so for those i guess it should only report the error if it's unused in both?