ruff/crates/ruff_linter/resources/test/fixtures/pyupgrade/UP046_1.py

13 lines
339 B
Python

"""Replacing AnyStr requires specifying the constraints `bytes` and `str`, so
it can't be replaced if these have been shadowed. This test is in a separate
fixture because it doesn't seem possible to restore `str` to its builtin state
"""
from typing import AnyStr, Generic
str = "string"
class BadStr(Generic[AnyStr]):
var: AnyStr