py-linkedin-jobs-scraper
py-linkedin-jobs-scraper copied to clipboard
Refactored callback validation to use callable() for broader compatibility.
At the moment, LinkedinScraper.on
method doesn't allow class methods to be passed as a callback.
Example:
class A:
def __init__(self):
self.scraper = LinkedinScraper(...)
self.scraper.on(..., self.callback)
def callback(self):
...
This code fails with ValueError: Callback must be a function
.
This PR proposes utilising Python's callable
method instead of checking whether callback is an instance of FunctionType
.