1、method collections.namedtuple() can be used to build classesof objects that are just bundles of attributes with no custom methods, like a database record.
Card = collections.namedtuple('Card', ['rank', 'suit'])
2、
本文共 264 字,大约阅读时间需要 1 分钟。
1、method collections.namedtuple() can be used to build classesof objects that are just bundles of attributes with no custom methods, like a database record.
Card = collections.namedtuple('Card', ['rank', 'suit'])
2、
转载于:https://my.oschina.net/u/2440318/blog/903997