Why don't you just use `getattr(func, '__annotations__', {})`?