Issue #25472: In B[<type>], insert B in front of __bases__, to make the __dict__ descriptor work.

This commit is contained in:
Guido van Rossum 2015-11-18 21:12:58 -08:00
parent 6efc7e726f
commit bb7c57c6cd
2 changed files with 31 additions and 1 deletions

View file

@ -981,7 +981,7 @@ class GenericMeta(TypingMeta, abc.ABCMeta):
"Cannot substitute %s for %s in %s" %
(_type_repr(new), _type_repr(old), self))
return self.__class__(self.__name__, self.__bases__,
return self.__class__(self.__name__, (self,) + self.__bases__,
dict(self.__dict__),
parameters=params,
origin=self,