-
Type: Bug
-
Resolution: Done
-
Priority: Minor - P4
-
Affects Version/s: None
-
Component/s: None
-
None
Python 3 has an Abstract Base Class that declares abstract methods. An ABC subclass must implement all abstract methods, or it cannot be constructed.
ABC somehow thinks that Motor objects are unimplemented abstract base class methods:
from abc import ABC from motor.motor_asyncio import AsyncIOMotorClient db = AsyncIOMotorClient().test class C(ABC): db = db # TypeError: Can't instantiate abstract class C with abstract methods db c = C()
This would be an odd pattern, and easy to avoid, like so:
class C(ABC): @property def db(self): return db
Nevertheless, I'll investigate what it is about Motor's metaprogramming that confuses ABC.
First reported here:
- is related to
-
PYTHON-480 Sub-collection issue when using ABCMeta
- Closed