From dfc335d8c14b01820f6eae20eadc72bca136c586 Mon Sep 17 00:00:00 2001 From: Khaleel Al-Adhami Date: Fri, 4 Oct 2024 17:47:56 -0700 Subject: [PATCH] misc var improvements --- reflex/vars/object.py | 2 ++ reflex/vars/sequence.py | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/reflex/vars/object.py b/reflex/vars/object.py index 1158bba9a..a9175a703 100644 --- a/reflex/vars/object.py +++ b/reflex/vars/object.py @@ -119,6 +119,8 @@ class ObjectVar(Var[OBJECT_TYPE]): """ return object_entries_operation(self) + items = entries + def merge(self, other: ObjectVar): """Merge two objects. diff --git a/reflex/vars/sequence.py b/reflex/vars/sequence.py index 15c7411a6..3374ee10f 100644 --- a/reflex/vars/sequence.py +++ b/reflex/vars/sequence.py @@ -884,6 +884,12 @@ class ArrayVar(Var[ARRAY_VAR_TYPE]): i: int | NumberVar, ) -> ArrayVar[Set[INNER_ARRAY_VAR]]: ... + @overload + def __getitem__( + self: ARRAY_VAR_OF_LIST_ELEMENT[Tuple[KEY_TYPE, VALUE_TYPE]], + i: int | NumberVar, + ) -> ArrayVar[Tuple[KEY_TYPE, VALUE_TYPE]]: ... + @overload def __getitem__( self: ARRAY_VAR_OF_LIST_ELEMENT[Tuple[INNER_ARRAY_VAR, ...]],