(Replying to PARENT post)

The @dataclass decorator [1] as proposed in PEP 557 [2] has also been available since Python 3.7 was released in 2018.

Using @dataclass the example from OP would look like:

  from dataclasses import dataclass
  
  @dataclass
  class Point3D:
      x: float
      y: float
      z: float
[1]: https://docs.python.org/3/library/dataclasses.html

[2]: https://www.python.org/dev/peps/pep-0557/

👤divbzero🕑4y🔼0🗨️0

(Replying to PARENT post)

As soon as I opened the article I pressed Cmd+F and searched for "dataclasses".

This article was correct and addressed a very real need in Python programming—for year 2016. By now it is obsolete and today's standard library module `dataclasses` does all of that and more.

👤hamstergene🕑4y🔼0🗨️0