Which of the following is TRUE about `dataclasses.dataclass` in Python 3.7+?

Python Professional Hard

Python Professional — Hard

Which of the following is TRUE about `dataclasses.dataclass` in Python 3.7+?

Key points

  • `dataclasses.dataclass` automates method generation
  • Annotations play a key role in auto-generating methods
  • Enhances code readability and maintainability
  • Does not make fields immutable by default

Ready to go further?

Related questions