I'm trying to check for outdated type hints syntax in a Python codebase.
I would like to catch cases such as
List["str"]
which could just be
List[str]
I've written the following regular expression:
List[.*".+".*]
however, it also catches the following string:
List[str] = ["a"]
which I don't want to catch.
Examples of strings I want to catch:
- List["str"]
- Union[int, "np.ndarray"]
How could I modify my regular expression accordingly?
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…