Skip to content

Commit b957edd

Browse files
committed
Use __name__ in format_helper.
1 parent bb0d5e3 commit b957edd

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

tests/format_helper.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ def format_meth(name, meth):
1111

1212
ts = ""
1313
if params := root.__type_params__:
14-
ts = "[" + ", ".join(str(p) for p in params) + "]"
14+
ts = "[" + ", ".join(p.__name__ for p in params) + "]"
1515

1616
return f"{name}{ts}{sig}"
1717

tests/test_type_dir.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -206,11 +206,11 @@ class Final:
206206
x: tests.test_type_dir.Wrapper[int | None]
207207
ordinary: str
208208
def foo(self: Self, a: int | None, *, b: int = ...) -> dict[str, int]: ...
209-
def base[Z, ~K](self: Self, a: int | Z | None, b: ~K) -> dict[str, int | Z]: ...
209+
def base[Z, K](self: Self, a: int | Z | None, b: ~K) -> dict[str, int | Z]: ...
210210
@classmethod
211-
def cbase[~K](cls: type[typing.Self], a: int | None, b: ~K) -> dict[str, int]: ...
211+
def cbase[K](cls: type[typing.Self], a: int | None, b: ~K) -> dict[str, int]: ...
212212
@staticmethod
213-
def sbase[Z, ~K](a: OrGotcha[int] | Z | None, b: ~K) -> dict[str, int | Z]: ...
213+
def sbase[Z, K](a: OrGotcha[int] | Z | None, b: ~K) -> dict[str, int | Z]: ...
214214
""")
215215

216216

0 commit comments

Comments
 (0)