Kami commented on issue #1306: Add Python type annotation for base Compute API URL: https://github.com/apache/libcloud/pull/1306#issuecomment-557928154 @c-w That's what I came up with - 428c3b63. For some reason, mypy doesn't recognize driver classes (e.g. ``EC2NodeDriver`` to be a subclass of ``NodeDriver``), so the following doesn't work: ```python EC2 = get_driver(Provider.EC2) # type: Type[EC2NodeDriver] Rackspace = get_driver(Provider.RACKSPACE) # type: Type[RackspaceNodeDriver] ``` The approach I used is not ideal, but I confirmed it works. I'm not sure why it doesn't recognize it (I didn't dig in too much yet), I assume it's something to do with scoping. Might even need to open mypy issue / question about it, but I assume they will come back to us with that our code already relies on too much "magic" and meta programming :D
---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: [email protected] With regards, Apache Git Services
