I'm working with some code that I didn't write (so don't blame me for the crazyness). This is Python 3.9. I've got:
try:
del self.userinfo # force reload
if self.userinfo['name'] == self.user():
self._loginstatus = login.LoginStatus.AS_USER
return
My first thought was WTF? It deletes self.userinfo and then immediately references it? How can be? Then I realized what must be going on is that self.userinfo is also defined in some superclass, of which there are a bunch:
class APISite(
BaseSite,
EchoMixin,
FlowMixin,
GeneratorsMixin,
GeoDataMixin,
GlobalUsageMixin,
LinterMixin,
PageImagesMixin,
ProofreadPageMixin,
TextExtractsMixin,
ThanksFlowMixin,
ThanksMixin,
UrlShortenerMixin,
WikibaseClientMixin,
):
Is there some way to get Python to tell me in which of those superclasses it's finding self.userinfo?
Ugh. Nevermind. There's:
and
somebody was trying to be clever and fancy.