The code below works, but I'm getting the following warning by PyCharm: Cannot find reference __annotations__ in '(...) -> Any'. I guess it's because I'm using Callable. I didn't find something like Dataclass. Which type should I use instead? from __future__ import annotations from dataclasses import dataclass from typing import Callable @dataclass class Fruit: color: str taste: str def get_cls() -> Callable: return Fruit attrs = get_cls().__annotations__ # <- IDE warning print(attrs) Continue reading...