uplink
uplink copied to clipboard
Inherited classes won't inherit decorators
Describe the bug If a child class inherits parent class, the decorators of the parent class won't be inherited
To Reproduce For example
import uplink
@uplink.response_handler
def rsp_handler(response):
print(f'request: {response.request.url}')
return response
@rsp_handler
class GitHub(uplink.Consumer):
@uplink.get("/users/{user}")
def get_user(self, user):
pass
class InheritedGitHub(GitHub):
@uplink.get("/users/{user}")
def get_user(self, user):
pass
base_url = "https://api.github.com/"
GitHub(base_url).get_user("user_1")
InheritedGitHub(base_url).get_user("user_2")
will print only:
request: https://api.github.com/users/user_1
Expected behavior I've expected both client classes to inherit the decorator and see this:
request: https://api.github.com/users/user_1
request: https://api.github.com/users/user_2
Additional context uplink==0.9.3