![](https://secure.gravatar.com/avatar/337fb6df3cf57f5b7f47e573f1558cfa.jpg?s=120&d=mm&r=g)
May 17, 2017
5:43 p.m.
On 17 May 2017 at 19:40, Juancarlo Añez <apalala@gmail.com> wrote:
On Wed, May 17, 2017 at 12:48 PM, Ivan Levkivskyi <levkivskyi@gmail.com> wrote:
class Foo(NamedTuple): """Foo is a very important class and you should totally use it. """ bar: int baz: int = 0
def grand_total(self): return self.bar + self.baz
Really?!
I didn't know that idiom existed.
It is enough for many use cases, and I was just about to require typing and pathlib on my 2.7-compatible projects.
Unfortunately, this works _only_ in Python 3.6+. -- Ivan