Код: Выделить всё
from types import SimpleNamespace
def func() -> SimpleNamespace(x: int, y: str): # SyntaxError! What should be used instead?
return SimpleNamespace(x=3, y='abc')
Код: Выделить всё
from typing import Tuple
def func() -> Tuple[int, str]: # OK
return 3, 'abc'
Код: Выделить всё
from types import SimpleNamespace
def func() -> SimpleNamespace(x=int, y=str): # Seems to work fine
return SimpleNamespace(x=3, y='abc')
Подробнее здесь: https://stackoverflow.com/questions/655 ... enamespace
Мобильная версия