summaryrefslogtreecommitdiffstats
path: root/Misc
diff options
context:
space:
mode:
authoraha79 <34090357+aha79@users.noreply.github.com>2022-02-17 03:28:18 (GMT)
committerGitHub <noreply@github.com>2022-02-17 03:28:18 (GMT)
commit6e7b813195f9bd6a2a15c1f00ef2c0180f6c751a (patch)
treeee86170817ab4a7f892d38001ee95fed9f300692 /Misc
parentde6043e596492201cc1a1eb28038970bb69f3107 (diff)
downloadcpython-6e7b813195f9bd6a2a15c1f00ef2c0180f6c751a.zip
cpython-6e7b813195f9bd6a2a15c1f00ef2c0180f6c751a.tar.gz
cpython-6e7b813195f9bd6a2a15c1f00ef2c0180f6c751a.tar.bz2
bpo-46333: Honor `module` parameter in ForwardRef (GH-30536)
The `module` parameter carries semantic information about the forward ref. Forward refs are different if they refer to different module even if they have the same name. This affects the `__eq__`, `__repr__` and `__hash__` methods. Co-authored-by: Andreas Hangauer <andreas.hangauer@siemens.com> Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com> Co-authored-by: Ken Jin <28750310+Fidget-Spinner@users.noreply.github.com>
Diffstat (limited to 'Misc')
-rw-r--r--Misc/ACKS1
-rw-r--r--Misc/NEWS.d/next/Library/2022-01-11-15-54-15.bpo-46333.B1faiF.rst4
2 files changed, 5 insertions, 0 deletions
diff --git a/Misc/ACKS b/Misc/ACKS
index 244d757..dceb2b6 100644
--- a/Misc/ACKS
+++ b/Misc/ACKS
@@ -680,6 +680,7 @@ Anders Hammarquist
Mark Hammond
Harald Hanche-Olsen
Manus Hand
+Andreas Hangauer
Milton L. Hankins
Carl Bordum Hansen
Stephen Hansen
diff --git a/Misc/NEWS.d/next/Library/2022-01-11-15-54-15.bpo-46333.B1faiF.rst b/Misc/NEWS.d/next/Library/2022-01-11-15-54-15.bpo-46333.B1faiF.rst
new file mode 100644
index 0000000..ec3c6d5
--- /dev/null
+++ b/Misc/NEWS.d/next/Library/2022-01-11-15-54-15.bpo-46333.B1faiF.rst
@@ -0,0 +1,4 @@
+The :meth:`__eq__` and :meth:`__hash__` methods of
+:class:`typing.ForwardRef` now honor the ``module`` parameter of
+:class:`typing.ForwardRef`. Forward references from different
+modules are now differentiated.