summaryrefslogtreecommitdiffstats
path: root/Lib/typing.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/typing.py')
-rw-r--r--Lib/typing.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/Lib/typing.py b/Lib/typing.py
index 1de48cc..4a8bdf8 100644
--- a/Lib/typing.py
+++ b/Lib/typing.py
@@ -779,7 +779,11 @@ class ForwardRef(_Final, _root=True):
return Union[other, self]
def __repr__(self):
- return f'ForwardRef({self.__forward_arg__!r})'
+ if self.__forward_module__ is None:
+ module_repr = ''
+ else:
+ module_repr = f', module={self.__forward_module__!r}'
+ return f'ForwardRef({self.__forward_arg__!r}{module_repr})'
class _TypeVarLike:
"""Mixin for TypeVar-like types (TypeVar and ParamSpec)."""