We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 52a481b commit a49f32aCopy full SHA for a49f32a
pymdownx/blocks/block.py
@@ -89,12 +89,12 @@ def type_number(value: Any) -> int | float:
89
def type_integer(value: Any) -> int:
90
"""Ensure type integer or fail."""
91
92
- if not isinstance(value, int):
93
- if not isinstance(value, float) or not value.is_integer():
94
- raise ValueError(f"Could not convert type {type(value)} to an integer")
95
- value = int(value)
+ if isinstance(value, int):
+ return value
96
97
- return value
+ if not isinstance(value, float) or not value.is_integer():
+ raise ValueError(f"Could not convert type {type(value)} to an integer")
+ return int(value)
98
99
100
def type_ranged_number(minimum: int | None = None, maximum: int | None = None) -> Callable[[Any], int | float]:
0 commit comments