Closed Vinalti closed 1 year ago
This module should be compatible with python 3.6. list[dict]
is not supported in this version:
...
def get_monitors(self) -> list[dict]:
TypeError: 'type' object is not subscriptable
Oh ok I see then I think that we should :
from __future__ import annotation
or
from Typing import List
#and use
List[dict]
Hmm, I noticed that Python 3.6 is end-of-life. Then I think we can just drop support for this version and add
from __future__ import annotations
With this import list[dict]
is supported in Python 3.7 (PEP 563).
Thank you!
Proposed changes
type(a) == list
replaced withisinstance(a, list)
a_dict['key']
replaced witha_dict.get('key')
annotation
-> list
replaced by more accurate-> list[dict]