Sebastian Rittau

Results 518 comments of Sebastian Rittau

I mentioned this again [on typing-sig](https://mail.python.org/archives/list/[email protected]/thread/P6FCGRJUJHEVKHHJI737PHIKVNHFIJKR/). It could reuse PEP 655's `NotRequired` class: ```python class MyProto: x: NotRequired[int] @not_required def foo(self) -> None: ... ``` It would also make sense...

I believe that it would make sense to make `Enum` generic, at least in the stubs. But currently it would most likely disrupt too much. We would need something like...

While we usually don't add private elements to stubs, I think we should make an exception for base and metaclasses. Having a correct mro seems more important to me than...

I think @JukkaL gave his approval in #12021.

The problem is that `T` is not constrained in any way. According to the type hints, the function provided as argument could accept `str`: ```python def mk_str(s: str) -> list[str]:...

Posting my reply here and restoring the original comment. > I don't follow your `mk_str` example. Is that valid syntax? Sorry, fixed the example. >> `T` is not constrained in...

@erictraut I don't understand how this can be solved with an unconstrained `T`, assuming `T` is used as the context for `foo()` here: ```python T = TypeVar("T") MkFoo: TypeAlias =...

While I agree that this doesn't seem like a good fit for stubtest, I am not a fan of yet another linter. Would a check like this be hard to...

One open question is: What does `foo: Dynamic[X, Y]` mean? Does is mean that `foo` is guaranteed to already have the attributes defined by `Y` or only that it allows...

~~It makes sense to me to allow `inf`, `-inf`, and `nan` as literal values. After all, we allow all other float values as literal values as well.~~