Last active
April 29, 2020 12:37
-
-
Save FeryET/ce0e0b023af3e479c53299524b5d9d4b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def foo(func, *args, **kwargs): | |
res = func(*args, **kwargs) | |
return res["a key"]["in json"]["response"] | |
class A: | |
def __init__(self, api): | |
super().__init__() | |
self.api = api | |
def get_x(self): | |
res = self.api.get_x() | |
return res["a key"]["in json"]["response"] | |
def get_y(self): | |
res = self.api.get_y() | |
return res["a key"]["in json"]["response"] | |
@foo(self.api.get_x) | |
def my_desired_get(self): | |
pass |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment