Код: Выделить всё
def realms(testenv:str, active:bool=True) -> Optional[Dict]:
""" return a dict of active/inactive realms with info from keycloak, on error return None """
dat = api(testenv, endpoint="/admin/realms")
:
all_realms = list(realms(testenv, active=False).keys())
------
< /code>
pylance говорит: < /p>
"Keys" не является известным атрибутом «none» < /p>
< /blockquote>
, если я изменяю прототип def < /code> на: < /p>
def realms(testenv:str, active:bool=True) -> Dict:
Код: Выделить всё
all_realms_dict = realms(testenv, active=False)
all_realms = list(all_realms_dict.keys()) if all_realms_dict else []
Подробнее здесь: https://stackoverflow.com/questions/796 ... ptional-in