Xqt added a comment.
In T423816#11858329 <https://phabricator.wikimedia.org/T423816#11858329>, @HakanIST wrote: > From your suggestions, I think a combination of warning when a property is detected and documenting the contract would be a good start. I'd be happy to work on a patch if you're open to it. Sure. The Idea is to use `inspect.getattr_static` to find out the generator`s type, something like this within Bot's initializer: gentype = getattr_static(self, 'generator', None) if gentype is None: pass elif type(gentype) == property: issue_deprecation_warning(...) elif callable(gentype): # or better inspect.isgeneratorfunction(cls_attr) ??? self.generator = gentype(self) # only if it is not already set by generator keyword parameter else: raise TypeError(...) TASK DETAIL https://phabricator.wikimedia.org/T423816 EMAIL PREFERENCES https://phabricator.wikimedia.org/settings/panel/emailpreferences/
_______________________________________________ pywikibot-bugs mailing list -- [email protected] To unsubscribe send an email to [email protected]
