Hotfix typename escape

This commit is contained in:
2025-09-14 01:54:06 +03:00
parent 4b77eb4217
commit b724e3c5dd
2 changed files with 3 additions and 2 deletions

View File

@@ -1,6 +1,6 @@
[project] [project]
name = "megasniff" name = "megasniff"
version = "0.2.5" version = "0.2.5.post1"
description = "Library for in-time codegened type validation" description = "Library for in-time codegened type validation"
authors = [ authors = [
{ name = "nikto_b", email = "niktob560@yandex.ru" } { name = "nikto_b", email = "niktob560@yandex.ru" }

View File

@@ -71,7 +71,8 @@ def typename(tp: type) -> str:
ret = '' ret = ''
if get_origin(tp) is None and hasattr(tp, '__name__'): if get_origin(tp) is None and hasattr(tp, '__name__'):
ret = tp.__name__ ret = tp.__name__
ret = str(tp) else:
ret = str(tp)
ret = (ret ret = (ret
.replace('.', '_') .replace('.', '_')
.replace('[', '_of_') .replace('[', '_of_')