On Tue, Oct 30, 2012 at 6:23 AM, Ian Kelly <[email protected]> wrote:
> _MyImmutableClass = namedtuple('MyImmutableClass', 'field1 field2
> field3 field4')
>
> class MyImmutableClass(_MyImmutableClass):
Question: Is it clearer to take advantage of the fact that the base
class can be an arbitrary expression?
class MyImmutableClass(namedtuple('MyImmutableClass', 'field1 field2
field3 field4')):
You lose the unnecessary temporary and triplication of name, but gain
instead a rather long line.
ChrisA
--
http://mail.python.org/mailman/listinfo/python-list