Ah, I've got this. The problem is that pywikibot.Site isn't a class, it's a factory function that returns cached instances of APISite.