From fad4ea82a75d8707cd597071242d28df3142430e Mon Sep 17 00:00:00 2001 From: Blender Defender Date: Thu, 25 Jul 2024 19:19:21 +0200 Subject: [PATCH] refactor: Update the type annotation in `Migrate.py` to be a literal --- src/ifcpatch/ifcpatch/recipes/Migrate.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/ifcpatch/ifcpatch/recipes/Migrate.py b/src/ifcpatch/ifcpatch/recipes/Migrate.py index ff5ed28e5e..4b3a1cf8c9 100644 --- a/src/ifcpatch/ifcpatch/recipes/Migrate.py +++ b/src/ifcpatch/ifcpatch/recipes/Migrate.py @@ -18,11 +18,18 @@ import ifcopenshell import ifcopenshell.util.schema +import typing from logging import Logger class Patcher: - def __init__(self, src: str, file: ifcopenshell.file, logger: Logger, schema: str = "IFC4"): + def __init__( + self, + src: str, + file: ifcopenshell.file, + logger: Logger, + schema: typing.Literal["IFC2X3", "IFC4", "IFC4X3"] = "IFC4", + ): """Migrate from one IFC version to another Note that this is experimental and will try to preserve as much data as