On Wed, May 17, 2017 at 12:48 PM, Ivan Levkivskyi <levkivs...@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.

-- 
Juancarlo *Añez*
_______________________________________________
Python-ideas mailing list
Python-ideas@python.org
https://mail.python.org/mailman/listinfo/python-ideas
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to