[pyupgrade] Document more fix unsafety for UP007 (#9306)
```
from typing import Optional
x = "asdf"
def foo(a: Optional[x]):
pass
```
This commit is contained in:
@@ -40,7 +40,9 @@ use crate::settings::types::PythonVersion;
|
||||
/// ## Fix safety
|
||||
/// This rule's fix is marked as unsafe, as it may lead to runtime errors when
|
||||
/// alongside libraries that rely on runtime type annotations, like Pydantic,
|
||||
/// on Python versions prior to Python 3.10.
|
||||
/// on Python versions prior to Python 3.10. It may also lead to runtime errors
|
||||
/// in unusual and likely incorrect type annotations where the type does not
|
||||
/// support the `|` operator.
|
||||
///
|
||||
/// ## Options
|
||||
/// - `target-version`
|
||||
|
||||
Reference in New Issue
Block a user