News for hackers. Stuff that matters.
Re:Grumpy: Go running Python by justinsaccount on Wednesday January 04, 2017 @02:53PM (#13321472)
Doesn't work for everything, but you can subclass a namedtuple:

  from collections import namedtuple
  
  class Foo(namedtuple("Foo", "a b c")):
      @property
      def sum(self):
          return self.a + self.b + self.c
  
  
  f = Foo(1,2,3)
  print f.sum
Re:Grumpy: Go running Python by brianwawok on Wednesday January 04, 2017 @03:34PM (#13321807)
That doesn't look super awesome to me. I.e. classes or attrs both seem better.