You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have searched the opened issues and there are no duplicates
Describe the bug
Pyhton 3.9
Flet 0.23.1
Executing the snackbar control example now return the error:
File "/home/[omissis]/venv/lib64/python3.9/site-packages/flet_core/snack_bar.py", line 132, in before_update
if isinstance(self.__margin, Union[int, float, Padding]) and not self.width:
File "/usr/lib64/python3.9/typing.py", line 720, in instancecheck
return self.subclasscheck(type(obj))
File "/usr/lib64/python3.9/typing.py", line 723, in subclasscheck
raise TypeError("Subscripted generics cannot be used with"
TypeError: Subscripted generics cannot be used with class and instance checks
Setting margin (as int or float or Padding) or witdh doesn't change the result
Code
import flet as ft
class Data:
def init(self) -> None:
self.counter = 0
…_update method
- Corrected isinstance check in SnackBar.before_update to use a tuple of types instead of Union, resolving TypeError: "Subscripted generics cannot be used with class and instance checks".
* Fixflet-dev#3503: `Slider.value` defaults to `min`
* Fixflet-dev#3505: add "hide" and "show" to WindowEventType enum
* Fixflet-dev#3499: TypeError raised for isinstance check with Union in before_update method
- Corrected isinstance check in SnackBar.before_update to use a tuple of types instead of Union, resolving TypeError: "Subscripted generics cannot be used with class and instance checks".
* Fix `Page.open()` breaking after multiple calls
* Fixflet-dev#3516: delete Page.window.on_resize | deprecate Page.on_resize in favor of Page.on_resized
* Page: Typo in on_resized setter decorator
Duplicate Check
Describe the bug
Pyhton 3.9
Flet 0.23.1
Executing the snackbar control example now return the error:
File "/home/[omissis]/venv/lib64/python3.9/site-packages/flet_core/snack_bar.py", line 132, in before_update
if isinstance(self.__margin, Union[int, float, Padding]) and not self.width:
File "/usr/lib64/python3.9/typing.py", line 720, in instancecheck
return self.subclasscheck(type(obj))
File "/usr/lib64/python3.9/typing.py", line 723, in subclasscheck
raise TypeError("Subscripted generics cannot be used with"
TypeError: Subscripted generics cannot be used with class and instance checks
Setting margin (as int or float or Padding) or witdh doesn't change the result
Code
import flet as ft
class Data:
def init(self) -> None:
self.counter = 0
d = Data()
def main(page):
ft.app(target=main)
To reproduce
run https://flet.dev/docs/controls/snackbar
Expected behavior
No response
Screenshots
No response
Operating System
Linux
Operating system details
RHEL8
Flet version
0.23.1
Regression
Yes, it used to work in a previous Flet version (please specify the version in additional details)
Suggestions
No response
Additional details
No response
The text was updated successfully, but these errors were encountered: