Fix Python 3.13: classmethod + property unsupported (#448)

* Use own classproperty (don't inherit from property).
 * Config generation: Rename pathlib._local to pathlib
This commit is contained in:
Dominique Lasserre
2025-02-11 21:01:45 +01:00
committed by GitHub
parent d05b161e24
commit 1a2cb4d37d
3 changed files with 16 additions and 10 deletions

View File

@@ -86,7 +86,7 @@ def get_default_value(field_info: Union[FieldInfo, ComputedFieldInfo], regular_f
def get_type_name(field_type: type) -> str:
type_name = str(field_type).replace("typing.", "")
type_name = str(field_type).replace("typing.", "").replace("pathlib._local", "pathlib")
if type_name.startswith("<class"):
type_name = field_type.__name__
return type_name