{"categories":["python"],"title":"Python3.7 x Data Classes(\u30c7\u30fc\u30bf\u30af\u30e9\u30b9)","html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Fmemory-lovers.blog%2Fentry%2F2018%2F10%2F06%2F005309\" title=\"Python3.7 x Data Classes(\u30c7\u30fc\u30bf\u30af\u30e9\u30b9) - \u304f\u3089\u3052\u306b\u306a\u308a\u305f\u3044\u3002\" class=\"embed-card embed-blogcard\" scrolling=\"no\" frameborder=\"0\" style=\"display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;\"></iframe>","blog_title":"\u304f\u3089\u3052\u306b\u306a\u308a\u305f\u3044\u3002","height":"190","url":"https://memory-lovers.blog/entry/2018/10/06/005309","type":"rich","published":"2018-10-06 00:53:09","image_url":null,"blog_url":"https://memory-lovers.blog/","width":"100%","provider_url":"https://hatena.blog","author_url":"https://blog.hatena.ne.jp/wannabe-jellyfish/","author_name":"wannabe-jellyfish","version":"1.0","provider_name":"Hatena Blog","description":"Python3.7\u306e\u65b0\u6a5f\u80fd\u3067\u3001Data Classes\u304c\u8ffd\u52a0\u3055\u308c\u305f\u3088\u3046\u3002\u7d20\u6575\u3059\u304e\u308b\u3002\u3002 @dataclasses\u30c7\u30b3\u30ec\u30fc\u30bf\u3092\u3064\u3051\u308b\u3068\u3001init\u3084str\u3092\u81ea\u52d5\u751f\u6210\u3057\u3066\u304f\u308c\u308b\u4ed5\u7d44\u307f\u3089\u3057\u3044\u3002 import dataclasses @dataclasses.dataclass class InventoryItem: '''Class for keeping track of an item in inventory.''' name: str unit_price: float quantity_on_hand: int = 0 def total_cost(self) -> float: retu\u2026"}