mirror of
https://github.com/python/cpython.git
synced 2025-08-02 08:02:56 +00:00
Add a type.__init__() method that enforces the same signature as
type.__new__(), and then calls object.__init__(cls), just to be anal. This allows us to restore the code in string.py's _TemplateMetaclass that called super(...).__init__(name, bases, dct), which I commented out yesterday since it broke due to the stricter argument checking added to object.__init__().
This commit is contained in:
parent
0af338859b
commit
f102e24bd3
2 changed files with 35 additions and 4 deletions
|
@ -108,9 +108,7 @@ class _TemplateMetaclass(type):
|
|||
"""
|
||||
|
||||
def __init__(cls, name, bases, dct):
|
||||
# A super call makes no sense since type() doesn't define __init__().
|
||||
# (Or does it? And should type.__init__() accept three args?)
|
||||
# super(_TemplateMetaclass, cls).__init__(name, bases, dct)
|
||||
super(_TemplateMetaclass, cls).__init__(name, bases, dct)
|
||||
if 'pattern' in dct:
|
||||
pattern = cls.pattern
|
||||
else:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue