Neil Girdhar

Results 329 comments of Neil Girdhar

> Isn't this redundant with defaults from PEP-696? It's really similar, yeah. But even if I were to specify defaults, one would still have to follow the recursive definitions of...

> Your example would make more sense if the three type parameters for DistributionInfo (and all of the other generic classes in your example) were covariant. Thanks for explaining, but...

@parched Yes, related! I wish that hadn't been closed. It would be nice to contribute to that thread.

What's the benefit of treating the first parameter of a non-static method as implicitly positional-only? Is it just to save some work in updating the typeshed? I feel like these...

> I think main benefit is it's footgun for most stubs and most implementations. Right, but it's a footgun that's caught by type checkers. That's exactly how this was discovered...

> the core of the idea here that you want to write Python code in the `ResultType` function that is evaluated by static type checkers? Yes, exactly. > Could you...

> Implementing such a proposal would also be very labor-intensive. You're right. And there are many other way more important things that should be done first. We can close this...

> First, the proposal needs an extension to Python built-in type (or also grammar extension)because functions are not subscriptable. Good point. I was trying to emulate the `TypeGuard`, but maybe...

> From my understanding, this point makes no problem because it doesn't actually run the codes with type diagnostics, only analysing ASTs. But with this proposal, analysing abstract syntax trees...

> Because type-checkers like pyright or mypy do not run Python codes, but they only statically analyse abstract syntax trees to check types. Well, MyPy has Python plugins (so it...