mirror of
https://github.com/astral-sh/ruff.git
synced 2025-11-03 05:13:00 +00:00
[pyupgrade] Don't offer fix for Optional[None] in non-pep604-annotation-optional (UP045) or non-pep604-annotation-union (UP007) (#18545)
This commit is contained in:
parent
2213698a5d
commit
0724bee59c
3 changed files with 26 additions and 4 deletions
|
|
@ -42,3 +42,8 @@ class ServiceRefOrValue:
|
|||
# Regression test for: https://github.com/astral-sh/ruff/issues/7201
|
||||
class ServiceRefOrValue:
|
||||
service_specification: Optional[str]is not True = None
|
||||
|
||||
|
||||
# Test for: https://github.com/astral-sh/ruff/issues/18508
|
||||
# Optional[None] should not be offered a fix
|
||||
foo: Optional[None] = None
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue