1

Is there any difference except the writing __init__ method between data class and class (Python)?

Barmar
  • 741,623
  • 53
  • 500
  • 612
  • `class` is a general mechanism for defining your own classes. `@dataclass` is a decorator that you use with your classes to automatically define some standard methods. – Barmar Jun 06 '22 at 22:44
  • See https://docs.python.org/3/library/dataclasses.html for the full list of what `@dataclass` does. – Barmar Jun 06 '22 at 22:45

0 Answers0