refactor: small changes

This commit is contained in:
rus07tam 2025-11-24 15:01:44 +00:00
parent af4974075c
commit 34b5a1272b
3 changed files with 4 additions and 5 deletions

View file

@ -29,7 +29,6 @@ class BaseBindable(Generic[T]):
def value(self) -> T:
if self.has_value:
return self.__value
else:
return self.default_value
@property

View file

@ -95,7 +95,7 @@ def combine(
)
def subscriber(_: ValueChanged[Any]) -> None:
combined.set(combiner(*[*map(lambda s: s.value, sources)]))
combined.set(combiner(*map(lambda s: s.value, sources)))
for source in sources:
if isinstance(source, Bindable):
@ -185,7 +185,7 @@ def async_combine(
)
async def subscriber(_: ValueChanged[Any]) -> None:
result = await combiner(*[*map(lambda s: s.value, sources)])
result = await combiner(*map(lambda s: s.value, sources))
await combined.set(result)
for source in sources:

View file

@ -12,7 +12,7 @@ MARKERS_ATTR = "__snakia_markers__"
def _get_all_markers(obj: Any) -> dict[type["Marker"], "Marker"]:
return get_or_set_attr(obj, MARKERS_ATTR, dict[type[Marker], Marker]())
return get_or_set_attr(obj, MARKERS_ATTR, dict())
class Marker: