Skip to content

Commit

Permalink
add news entry and comment
Browse files Browse the repository at this point in the history
  • Loading branch information
carljm committed Feb 9, 2024
1 parent 88ca12a commit 0cee0a6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Lib/typing.py
Original file line number Diff line number Diff line change
Expand Up @@ -1136,6 +1136,9 @@ def __mro_entries__(self, bases):
if self.__origin__ not in bases:
res.append(self.__origin__)
i = bases.index(self)
# The goal here is to only add Generic to the MRO if nothing else in the
# MRO is already a subclass of Generic; otherwise we risk failure to
# linearize a consistent MRO.
for b in bases[i+1:]:
if isinstance(b, _BaseGenericAlias):
break
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Fix "issubclass() arg 1 must be a class" errors in certain cases of multiple
inheritance with generic aliases.

0 comments on commit 0cee0a6

Please sign in to comment.