[英]Is it a good idea to use a type alias name in python and then declare that as a variable?
我正在看這樣的代碼:
class DeckManager:
decks: Dict[str, Any]
def __init__(self, col: a) -> None:
self.decks = {}
甲板:Dict[str, Any] 指定類型別名是否正確? 如果是這樣,那么在代碼后面使用:self.decks 是否有意義。 這不令人困惑嗎?
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.