tree: 888aaa0053662bcfa6fc4325ebd59f718bfdef2a [path history] [tgz]
  1. dataclasses/
  2. BUILD
  3. LICENSE
  4. README.md
third_party/py/dataclasses/README.md

dataclasses

This is the dataclasses.py module from the Python 3.7 standard library, backported to Python 3.6.

Example usage:

import dataclasses

@dataclasses.dataclass
class Foo:
  foo: str  # The Foo() constructor will require a value for this field.
  bar: int = 42  # Default value if one is not passed to the constructor.

  def sum_one(self) -> int:
    return self.bar + 1

More details: https://www.python.org/dev/peps/pep-0557/