JJMC89 added a comment.

  I'd go further and have `BasePage.getRedirectTarget()` return an object of 
the same class as the redirect. This would keep the implementation general and 
allow other subclasses that want the returned object to be the same class to 
use the method without overriding it.
  
  It could be implemented in `BasePage.getRedirectTarget()` or 
`Site.getredirtarget()`.
  
    def getRedirectTarget(self):
        target = self.site.getredirtarget(self)
        try:
            target = self.__class__(target)
        except ValueError:
            pass
        return target

TASK DETAIL
  https://phabricator.wikimedia.org/T233392

EMAIL PREFERENCES
  https://phabricator.wikimedia.org/settings/panel/emailpreferences/

To: JJMC89
Cc: JJMC89, Dvorapa, Aklapper, pywikibot-bugs-list, Strainu, Viztor, DannyS712, 
Wenyi, Tbscho, MayS, Mdupont, Altostratus, Avicennasis, mys_721tx, jayvdb, 
Dalba, Masti, Alchimista, Rxy
_______________________________________________
pywikibot-bugs mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/pywikibot-bugs

Reply via email to