dataclass ã¯ãPythonã§ä¸»ã«ãã¼ã¿ãæ ¼ç´ããããã®ã¯ã©ã¹ã§ãCè¨èªãªã©ã§ã¯æ§é ä½ã«ç¸å½ãããããªãã¼ã¿æ§é ããããããã«å®ç¾©ã§ããããã«ãªã£ã¦ãã¾ãã ãã¨ãã°ã次㮠Person ã¯ãååã¨å¹´é½¢ãæ ¼ç´ããdataclassã§ãã from dataclasses import dataclass @dataclass class Person: name: str age: int person1 = Person(name="ãã¼ã½ã³å¤ªé", age=20) person2 = Person(name="ãã¼ã½ã³æ¬¡é", age=30) Python 3.10ã§ã¯ãdataclass ã« slots å¼æ°ã追å ãããã¹ããã ã使ã£ãã¯ã©ã¹ãå®ç¾©ã§ããããã«ãªãã¾ãã(bpo-42269)ã ã¹ãããã¨ã¯ï¼Â¶é常ãã¯ã©ã¹ã®ã¤ã³ã¹ã¿ã³ã¹ã¯ãã¡ã³ãã¼å¤æ°ã®ååã¨å¤ã __di
{{#tags}}- {{label}}
{{/tags}}