mirror of
https://github.com/Textualize/textual.git
synced 2025-10-17 02:38:12 +03:00
simplify
This commit is contained in:
@@ -96,10 +96,9 @@ class GenericProperty(Generic[PropertyGetType, PropertySetType]):
|
||||
class IntegerProperty(GenericProperty[int, int]):
|
||||
def validate_value(self, value: object) -> int:
|
||||
if isinstance(value, (int, float)):
|
||||
value = int(value)
|
||||
return int(value)
|
||||
else:
|
||||
raise StyleValueError(f"Expected a number here, got f{value}")
|
||||
return value
|
||||
|
||||
|
||||
class ScalarProperty:
|
||||
|
||||
Reference in New Issue
Block a user