@model(Example.HTTP.Request)
def request(url):
(res, status_code) = magic()
...
Ouch — I understand this is magic by design, but this is exactly the type of non-explicit code that quickly devolves into unmaintainable mess.A reader who might have 2 decades of Python experience will not be able to follow the logic, and would need to pause and read up to be able to debug and test this.
Where does the magic start and where does it end? What's up with that "url" parameter, how does it relate to the declared model and how is it passed into it?
At the very least, I'd consider passing the "model" argument from the decorator into the decorated function to make it explicit at very low increase in keyword count (token count?).
caotic123•1h ago