From 1c58417ce63ee3505016f12e6866c473f4526296 Mon Sep 17 00:00:00 2001 From: Cutipus Date: Thu, 26 Apr 2018 21:05:45 +0300 Subject: [PATCH] Use types module for class inheritence instead --- yes.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/yes.py b/yes.py index 3021d80..0f3e7af 100644 --- a/yes.py +++ b/yes.py @@ -1,4 +1,5 @@ import inspect +import types from io import StringIO import sys import re @@ -6,7 +7,7 @@ import re did_you_mean = re.compile(r'Did you mean (.*)\?', re.IGNORECASE) what = 'what?' -class Yes(sys.__class__): +class Yes(types.ModuleType): def __init__(self, other): for attr in dir(other): setattr(self, attr, getattr(other, attr))