mirror of https://github.com/astral-sh/ruff
[ty] Use "cannot" consistently over "can not" (#21255)
This commit is contained in:
parent
e8c35b9704
commit
39f105bc4a
|
|
@ -32,8 +32,8 @@ static_assert(not is_singleton(Literal[1]))
|
||||||
static_assert(not is_singleton(Literal[54165]))
|
static_assert(not is_singleton(Literal[54165]))
|
||||||
```
|
```
|
||||||
|
|
||||||
This has implications for type-narrowing. For example, you can not use the `is not` operator to
|
This has implications for type-narrowing. For example, you cannot use the `is not` operator to check
|
||||||
check whether a variable has a specific integer literal type, but this is not a recommended practice
|
whether a variable has a specific integer literal type, but this is not a recommended practice
|
||||||
anyway.
|
anyway.
|
||||||
|
|
||||||
```py
|
```py
|
||||||
|
|
|
||||||
|
|
@ -187,8 +187,8 @@ python-platform = "all"
|
||||||
|
|
||||||
If `python-platform` is set to `all`, we treat the platform as unspecified. This means that we do
|
If `python-platform` is set to `all`, we treat the platform as unspecified. This means that we do
|
||||||
not infer a literal type like `Literal["win32"]` for `sys.platform`, but instead fall back to
|
not infer a literal type like `Literal["win32"]` for `sys.platform`, but instead fall back to
|
||||||
`LiteralString` (the `typeshed` annotation for `sys.platform`). This means that we can not
|
`LiteralString` (the `typeshed` annotation for `sys.platform`). This means that we cannot statically
|
||||||
statically determine the truthiness of a branch like `sys.platform == "win32"`.
|
determine the truthiness of a branch like `sys.platform == "win32"`.
|
||||||
|
|
||||||
See <https://github.com/astral-sh/ruff/issues/16983#issuecomment-2777146188> for a plan on how this
|
See <https://github.com/astral-sh/ruff/issues/16983#issuecomment-2777146188> for a plan on how this
|
||||||
could be improved.
|
could be improved.
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue