crypt0lith
crypt0lith
Step 1 rejects the guarded form. Under `"All"`, pyright doesn't evaluate `sys.platform == "win32"` statically, so the guard doesn't narrow the platform. With intersection semantics, `os.startfile` would also be unavailable...
The typing spec doesn't say how an inherited `__init__` with an annotated `self` specializes a generic subclass. The constructors chapter (which you linked) and its conformance tests only cover the...
> Should I open an issue in https://github.com/python/typing/issues or a discussion in https://discuss.python.org/c/typing/32 ? A discussion. The [Typing Council's process](https://github.com/python/typing-council#decisions) has substantive spec changes discussed on discuss.python.org first, then proposed...
> Thanks! will do when I find some time No need to worry about it, I'll open the discussion and link it here. It'll cover how pyright, mypy, ty and...
Ok that discussion is up [here](https://discuss.python.org/t/proposal-specialize-generic-subclass-from-inherited-init-s-self-annotation/109979/1). Your typeddjango/django-stubs#3763 is cited as the motivation for it.
#claim The fix would be adding a new arm for `SelfType` after the existing one: https://github.com/meta/pyrefly/blob/7431fb02e1d2e9295d1489894d0e8fdbd30aba7c/pyrefly/lib/solver/subset.rs#L2594-L2596
This also affects `typing.TYPE_CHECKING` and `typing_extensions.TYPE_CHECKING`: ```python import typing import typing_extensions class FakeTyping: TYPE_CHECKING = False def func1(typing: FakeTyping) -> None: if typing.TYPE_CHECKING: pass else: reveal_type(typing) def func2(typing_extensions: FakeTyping) ->...
This also affects tuples with a micro version, which `pythonVersion` 3.13 doesn't specify: ```python import sys if sys.version_info > (3, 13, 1): reveal_type(">") if sys.version_info
Overriding `__getattribute__` like that is unsafe, IMO. The method is for instance attribute lookup, and `vars(obj)` is supposed to return the instance attribute dict `obj.__dict__`. In your example, `vars(FloatContainer())` calls...
`FloatContainer().__class__` would raise similarly. - `isinstance` uses `__class__` as a fallback when `type(...)` fails (`type(...)` is C implementation lookup on the object's `ob_type` pointer). So `isinstance(FloatContainer(), int)` raises too. -...