diff --git a/datamodel_code_generator/format.py b/datamodel_code_generator/format.py index 9e19edc6b..6fbe885cc 100644 --- a/datamodel_code_generator/format.py +++ b/datamodel_code_generator/format.py @@ -17,7 +17,7 @@ class PythonVersion(Enum): @property def has_literal_type(self) -> bool: - return self.value >= self.PY_38.value # type: ignore + return self.value not in {self.PY_36.value, self.PY_37.value} # type: ignore if TYPE_CHECKING: