DetachHead
DetachHead
looks like pylance has this functionality (see https://github.com/DetachHead/basedpyright/issues/1245#issuecomment-2819832218), so we should add it too
This is the result of a bug fix from upstream to the `reportUnknown...` rules that also applied to our `reportAny` rule. See https://github.com/DetachHead/basedpyright/issues/1218#issuecomment-2801779652
i don't think the stub file is even needed anymore since the source code now contains type annotations
adding non-standard syntax like this isn't super high priority for me, i consider fixing false positives/false negatives and language server features to be more important. however if someone wants to...
that behavior is not intentional and is therefore completely broken Code sample in [basedpyright playground](https://basedpyright.com/?typeCheckingMode=all&code=MYGwhgzhAECCDaAVAugLgFDS9AJgUwDNoB9YgSwDsyAXUgCgjxAIBpprVpEBKaAWgB80AHIB7CngzZp0AA6QI6dACFoAXjjwAjNAA%2B0AEzJ0AI06qNsOgd4BiaHgBOj0Y84AiStXfQyMCqLU0ApkAOYUYCYgeOyi7ACesjHuADI0TmAg8ADMyO5AA) ```python class A[T]: def __init__(self, t: T) -> None: pass B = A[1 | 2]...
hmm you do get an error on the usage, so it's not as bad: ```py Bar.asdf # no error Baz.asdf # error ```
here's an example where you don't get an error on the usage ```py from typing import reveal_type class Foo: def __set_name__(self, owner: type[str], value: str): reveal_type(owner()) # str in pyright,...
minified: ```py from abc import ABC class Foo(ABC): a: int asdf = Foo() # no error ``` i dont think abstract attributes are a thing, but they should be
note that when a class does not explicitly extend a protocol, the protocol's properties behave like abstract attributes: Code sample in [basedpyright playground](https://basedpyright.com/?typeCheckingMode=all&code=GYJw9gtgBALgngBwJYDsDmUkQWEMoAK4MYAxmADYCwAULbaRQIYDOLUAYmGABRFglyFAJQAuWlElQAAgnAIApnjgSpAEwXAowbjxYKKwYVAC0APkwoYoqADp79Go1bsAQkxA8uYMask6wG1R8AF4oAEYoAGIoJXAQGxAFHDwASRRybCYYJAAjCgUAWQUYAAswNQB5ADc4pA1HZzYodwAvcRopbW4gqygw8McAm29%2BlqZWnmMYlDBYkHigA) ```python from typing import Protocol class Foo(Protocol):...
very hacky workaround: ```python # we intentionally make pyright infer the return type here because that prevents reportUnknownVariableType # when importing it (seems to be a pyright bug) def implements[T](_protocol:...