From ee8cdba11d598ac70863877ec4af07eae104617f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B2=88=E7=91=97=E6=9D=B0?= <3695888@qq.com> Date: Tue, 9 Feb 2021 14:04:49 +0800 Subject: [PATCH] =?UTF-8?q?=E8=8D=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bin/configs.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/bin/configs.py b/bin/configs.py index d845ee9..1fdfb27 100644 --- a/bin/configs.py +++ b/bin/configs.py @@ -55,10 +55,27 @@ class BasicNumberClass: else: self.units2 = [] + def sort(self): + self.units1.sort() + self.units2.sort() + + def units(self): + return [].append(self.units1.append(self.units2)) + def __str__(self): return None def __add__(self, other): + if type(other) is type(self): + self.sort() + other.sort() + if self.units() == other.units(): + pass + + def __radd__(self, other): + self.__add__(self) + + def __mul__(self, other): pass