mirror of
https://github.com/home-assistant/core.git
synced 2025-12-24 12:59:34 +00:00
Improve typing via hassfest serializer (#117382)
This commit is contained in:
@@ -102,6 +102,6 @@ def format_python_namespace(
|
||||
for key, value in sorted(content.items())
|
||||
)
|
||||
if annotations:
|
||||
# If we had any annotations, add the __future__ import.
|
||||
code = f"from __future__ import annotations\n{code}"
|
||||
# If we had any annotations, add __future__ and typing imports.
|
||||
code = f"from __future__ import annotations\n\nfrom typing import Final\n{code}"
|
||||
return format_python(code, generator=generator)
|
||||
|
||||
Reference in New Issue
Block a user