Open
Description
Bug Report
Stubgenc's strip_or_import no longer fixes types that contain a [
.
This seems to be caused by #14564
Specifically, [
is not included in the match for the regex replacement. This causes the subtype before the [
to not be replaced as it should be.
To Reproduce
Create a py extension with a function which has a return type referencing a class in the local module with [
in the type.
Expected Behavior
The fully-qualified module should be excluded.
class KeysView[str]:
...
class MyMap:
def keys(self) -> KeysView[str]: ...
Actual Behavior
The fully-qualified name is left behind and not replaced.
class KeysView[str]:
...
class MyMap:
def keys(self) -> full.module.name.KeysView[str]: ...
Activity