Open daniilpastukhov opened 8 months ago
At the moment, LinkedinScraper.on method doesn't allow class methods to be passed as a callback. Example:
LinkedinScraper.on
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.
ValueError: Callback must be a function
This PR proposes utilising Python's callable method instead of checking whether callback is an instance of FunctionType.
callable
FunctionType
I've made a similar change on my side. Would love to see this merged.
At the moment,
LinkedinScraper.on
method doesn't allow class methods to be passed as a callback. Example: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 ofFunctionType
.