David Salvisberg
David Salvisberg
I'd support this given that type checkers already happily accept this union syntax in type annotations if `from __future__ import annotations` is used. Same goes for subscriptability of builtin types...
> While mypy, pyright and others may support many Python versions at the same time, the same cannot be always said about the project being type-checked. This is not actually...
I like the heuristic of `None` (and maybe `Literal[False]` for subtyping completeness?) meaning it can't suppress and `bool`, `bool | None` (and `Literal[True]`) meaning it may, it's easy to understand...
My understanding of PEP612 always was that the "pos-args-only" and "kwargs-only" case (and any other arbitrary restriction) would be supported in the future through upper bounds, the main limiting factor...
```python from typing import Literal, Protocol class Truthy(Protocol): def __bool__(self) -> Literal[True]: ... class Falsy(Protocol): def __bool__(self) -> Literal[False]: ... ``` This doesn't really appear to work in pyright or...
On that note: I think it would be nice to publish a `sha256_sum` for every binary in the release notes, so we can verify the integrity of the download. Currently...
> That's not strictly so. Current annotation can be described as positional-or-keyword. Cf. keyword-only using `*,`. Positional-only (using `/`) is a _maybe_ feature. Thank you for the idea. Yes, they...
WTForms assumes that passed in data is already valid. So you should only expect to be able to validate `formdata`. After all it's a forms library, not a general purpose...
I can try creating a Union using the Members of PhoneNumberFormat, to see if mypy would accept that as a type. If it does it would be a reasonable workaround....
I tried constructing an annotation that uses the existing constants, but that does not appear to be possible, at least from my end. https://pypi.org/project/enum34/ Could be an option.