2
기본 클래스에서 상속받은 namedtuple
을 생성 할 수 있습니까?파이썬의 기본 클래스에서 namedtuple을 상속받습니다
from collections import namedtuple
class Shape:
def addToScene(self, scene):
...
Circle=namedtuple('Circle', 'x y radius')
Rectangle=namedtuple('Rectangle', 'x1 y1 x2 y2')
내가 어떻게 할 것입니다 : 내가 원하는 무엇
는 Circle
및 Rectangle
이 namedtuple
의하고 공통 기본 클래스 ('모양')에서 상속 된 것입니다?