Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Request] Add @wraps in route dectorators #285

Closed
sansyrox opened this issue Sep 22, 2022 · 6 comments · Fixed by #295
Closed

[Feature Request] Add @wraps in route dectorators #285

sansyrox opened this issue Sep 22, 2022 · 6 comments · Fixed by #295

Comments

@sansyrox
Copy link
Member

Current Behavior

Right now, we are not wrapping the route decorators. This leads to them losing the associated metadata.

Desired Behavior

Use functools.wraps to wrap the decorator.

Screenshots / Mockups

Alternatives


@guilefoylegaurav
Copy link
Contributor

guilefoylegaurav commented Oct 8, 2022

Can you kindly elaborate a bit more on this, if possible with an example?

@sansyrox
Copy link
Member Author

@guilefoylegaurav , sure.

So, you can have a look here that functool.wraps helps in preserving metadata(name, magic methods of a function and so on.) here(https://stackoverflow.com/questions/308999/what-does-functools-wraps-do).

Now, robyn also has many decorators like here(https://github.com/sansyrox/robyn/blob/main/robyn/__init__.py#L185) . I wanted to check if we are still preserving the metadata or not

@guilefoylegaurav
Copy link
Contributor

I see. I get the point.
Basically, I was taking "metadata" to mean something else.

@sansyrox
Copy link
Member Author

@guilefoylegaurav , are you working on this or can I take it up?

@guilefoylegaurav
Copy link
Contributor

guilefoylegaurav commented Oct 26, 2022

@sansyrox, you can take this up - I haven't been working on this actually.
I have been exploring some other feature request issues here that I can potentially contribute to.

I have a few in mind and shall settle on one soon and update you shortly.

@sansyrox
Copy link
Member Author

@guilefoylegaurav , alright perfect.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants