Revert "Make zip strict argument optional to support Python 3.9"

This reverts commit 3bdce4fbc3.
This commit is contained in:
Andrej730
2025-12-19 18:15:30 +05:00
parent 5d42ded154
commit b784cb06ae
2 changed files with 3 additions and 7 deletions
+1 -4
View File
@@ -6,14 +6,11 @@ for each day as a key there is a list of working times with the format
""" """
import sys
import re import re
from datetime import time, datetime from datetime import time, datetime
from typing import Any from typing import Any
from ifc4d.common import WorkSlot from ifc4d.common import WorkSlot
ZIP_STRICT = {} if sys.version_info < (3, 10) else {"strict": True}
class AstaCalendarWorkPattern: class AstaCalendarWorkPattern:
def get_keys(self, s: str) -> list[str]: def get_keys(self, s: str) -> list[str]:
@@ -123,7 +120,7 @@ class AstaCalendarWorkPattern:
self.values = self.get_values(string) self.values = self.get_values(string)
self.dict_wp: list[WorkSlot] = [] self.dict_wp: list[WorkSlot] = []
for value, day_name in zip(self.values[1:], self.day_names, **ZIP_STRICT): for value, day_name in zip(self.values[1:], self.day_names, strict=True):
splt_data = value.strip().split(",") splt_data = value.strip().split(",")
workhours: list[dict[str, Any]] = [] workhours: list[dict[str, Any]] = []
if len(splt_data) >= 7: if len(splt_data) >= 7:
@@ -27,7 +27,6 @@ from ifcopenshell.util.shape_builder import ShapeBuilder, V
from typing import Any, Optional, Literal, Union, overload from typing import Any, Optional, Literal, Union, overload
DATACLASS_SLOTS = {} if sys.version_info < (3, 10) else {"slots": True} DATACLASS_SLOTS = {} if sys.version_info < (3, 10) else {"slots": True}
ZIP_STRICT = {} if sys.version_info < (3, 10) else {"strict": True}
# SCHEMAS describe panels setup # SCHEMAS describe panels setup
# where: # where:
@@ -169,7 +168,7 @@ def window_l_shape_check(
"""`lining_thickness` and `lining_to_panel_offset_x` expected to be defined as a list, """`lining_thickness` and `lining_to_panel_offset_x` expected to be defined as a list,
similarly to `create_ifc_window_frame_simple` `thickness` argument""" similarly to `create_ifc_window_frame_simple` `thickness` argument"""
l_shape_check = lining_to_panel_offset_y_full < lining_depth and any( l_shape_check = lining_to_panel_offset_y_full < lining_depth and any(
x_offset < th for th, x_offset in zip(lining_thickness, lining_to_panel_offset_x, **ZIP_STRICT) x_offset < th for th, x_offset in zip(lining_thickness, lining_to_panel_offset_x, strict=True)
) )
return l_shape_check return l_shape_check
@@ -211,7 +210,7 @@ def create_ifc_window(
second_lining_size = lining_size.copy() second_lining_size = lining_size.copy()
second_lining_size[np_Y] = lining_size[np_Y] - lining_to_panel_offset_y_full second_lining_size[np_Y] = lining_size[np_Y] - lining_to_panel_offset_y_full
second_lining_position = V(0, lining_to_panel_offset_y_full, 0) second_lining_position = V(0, lining_to_panel_offset_y_full, 0)
second_lining_thickness = [min(th, x_offset) for th, x_offset in zip(lining_thickness, x_offsets, **ZIP_STRICT)] second_lining_thickness = [min(th, x_offset) for th, x_offset in zip(lining_thickness, x_offsets, strict=True)]
second_lining_items = create_ifc_window_frame_simple( second_lining_items = create_ifc_window_frame_simple(
builder, second_lining_size, second_lining_thickness, second_lining_position builder, second_lining_size, second_lining_thickness, second_lining_position