mirror of https://github.com/astral-sh/ruff
13 lines
339 B
Python
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
|