I am using a GUI framework called ‘FLET’ in python, but I was wondering why I keep getting the following error message:
numba.core.errors.TypingError: Failed in nopython mode pipeline (step: nopython frontend)
non-precise type pyobject
During: typing of argument at C:\Users\Aaron\Documents\Python\Project1\Table2.py (43)
File "Table2.py", line 43:
def add_rows(self, e):
self.lv.auto_scroll = True
^
This error may have been caused by the following argument(s):
- argument 0: Cannot determine Numba type of <class '__main__.Table'>
- argument 1: Cannot determine Numba type of <class 'flet_core.control_event.ControlEvent'>
Is there some other function that I’m supposed to be using inside of Numba other than ‘@njit’ on top of a function when using GUI frameworks?
I just have a simple for loop inside of a function that updates a GUI and tried sticking the ‘@njit’ on top of the function, then that’s when this error keeps popping up (as shown above). Thanks.
Oh, and here’s what the function looks like:
@njit
def add_rows(self, e):
self.lv.auto_scroll = True
self.lv.update()
for i in range(1, 10001):
self.count += 1
self.dt.rows.append(
ft.DataRow(
cells=[
ft.DataCell(ft.Text(f'# {self.count}')),
ft.DataCell(ft.Text(f'Keyword # 1')),
ft.DataCell(ft.Text(f'Keyword # 2')),
ft.DataCell(ft.Text(f'Keyword # 3')),
ft.DataCell(ft.Text(f'Keyword # 4')),
]
)
)
if i % 500 == 0:
self.dt.update()
self.lv.update()
time.sleep(1.0)
self.lv.auto_scroll = True
self.lv.update()
self.lv.auto_scroll = False
self.lv.update()