考慮以下代碼:
from collections import namedtuple point = namedtuple("Point", ("x:int", "y:int"))
上面的代碼只是展示我想要實現的目標的一種方式。我想用類型提示製作 namedtuple
。
你知道如何達到預期結果的優雅方式嗎?
考慮以下代碼:
from collections import namedtuple point = namedtuple("Point", ("x:int", "y:int"))
上面的代碼只是展示我想要實現的目標的一種方式。我想用類型提示製作 namedtuple
。
你知道如何達到預期結果的優雅方式嗎?