what's the diffirence between __dict__ and getattr? : I'm trying to iterate all the variables of the class `A` which contains some coroutine methods in the module `a.py`. I use two ways to achieve my purpose, but the results are different:

Method 1: use `getattr()`

    a = __import__('a')
    print('===========getattr()=============')
    func_sync = getattr(a, 'func_sync')
    func_async = getattr(a, 'func_async')
    print(func_sync)  # <function func_sync at 0x7f827b98f510>
    print(func_async)  # <function func_async at 0x7f8279cd01e0>
    print(asyncio.iscoroutinefunction(func_async))  # True
    # getattr class
    A = getattr(a, 'A')
    print(A)  # <class 'a.A'>
    method_aa = getattr(A, 'aa')
    method_bb = getattr(A, 'bb')
    method_cc = getattr(A, 'cc')
    print(method_aa)  # <bound method A.aa of <class 'a.A'>>  <----notice this
    print(method_bb)  # <function A.bb at 0x7f8279cd00d0>
    print(method_cc)  # <function A.cc at 0x7f8279cd0158>
    print(asyncio.iscoroutinefunction(method_aa))  # True  <---- meet my expectations
    print(asyncio.iscoroutinefunction(method_bb))  # True
    print(asyncio.iscoroutinefunction(method_cc))  # False

It seems that all the results meet my expectations. But when I use `__dict__`, problem occurs

    print('=========== __dict__ =============')
    A = a.__dict__['A']
    func_sync = a.__dict__['func_sync']
    func_async = a.__dict__['func_async']
    print(asyncio.iscoroutinefunction(func_async))  # True
    print(A)  # <class 'a.A'>
    method_aa = A.__dict__['aa']
    method_bb = A.__dict__['bb']
    method_cc = A.__dict__['cc']
    print(method_aa)  # <classmethod object at 0x7f827a21c908>  <---- different from before
    print(method_bb)  # <function A.bb at 0x7f8279cd00d0>
    print(method_cc)  # <function A.cc at 0x7f8279cd0158>
    print(asyncio.iscoroutinefunction(method_aa))  # False <----- I think it should be True
    print(asyncio.iscoroutinefunction(method_bb))  # True
    print(asyncio.iscoroutinefunction(method_cc))  # False

Can someone explain for me?

This is `a.py`
    
    class A:
    
        @classmethod
        async def aa(cls):
            return 123
    
        async def bb(self):
            return 456
    
        def cc(self):
            return 789
    
    
    def func_sync():
        return 'sync'
    
    
    async def func_async():
        return 'async'