Use types module for class inheritence instead
This commit is contained in:
parent
68bf4cfd21
commit
1c58417ce6
3
yes.py
3
yes.py
|
@ -1,4 +1,5 @@
|
||||||
import inspect
|
import inspect
|
||||||
|
import types
|
||||||
from io import StringIO
|
from io import StringIO
|
||||||
import sys
|
import sys
|
||||||
import re
|
import re
|
||||||
|
@ -6,7 +7,7 @@ import re
|
||||||
did_you_mean = re.compile(r'Did you mean (.*)\?', re.IGNORECASE)
|
did_you_mean = re.compile(r'Did you mean (.*)\?', re.IGNORECASE)
|
||||||
what = 'what?'
|
what = 'what?'
|
||||||
|
|
||||||
class Yes(sys.__class__):
|
class Yes(types.ModuleType):
|
||||||
def __init__(self, other):
|
def __init__(self, other):
|
||||||
for attr in dir(other):
|
for attr in dir(other):
|
||||||
setattr(self, attr, getattr(other, attr))
|
setattr(self, attr, getattr(other, attr))
|
||||||
|
|
Loading…
Reference in New Issue