I've been using python 3.7 lately and was looking for ways to leverage the new dataclasses. Basically I had a method that iterates over the dataclass fields and checks if they have a default value:
from dataclasses import fields, MISSING
@classmethod
def from_json(cls)
datacls_fields = fields(cls)
for field in datacls_fields:
if (field.default != MISSING):
#...
Run Code Online (Sandbox Code Playgroud)
However in the official documentation, it says:
MISSING value is a sentinel object used to detect if the default and default_factory parameters are provided. This …