Skip to content

Commit

Permalink
[pyupgrade] Document more fix unsafety for UP007 (#9306)
Browse files Browse the repository at this point in the history
```
from typing import Optional
x = "asdf"
def foo(a: Optional[x]):
    pass
```
  • Loading branch information
hauntsaninja authored Dec 29, 2023
1 parent d86d3bd commit ec88acc
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Expand Down

0 comments on commit ec88acc

Please sign in to comment.