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

Remove unwanted None check for __repr__ in Request class #1451

Closed
harshanarayana opened this issue Jan 2, 2019 · 1 comment
Closed

Remove unwanted None check for __repr__ in Request class #1451

harshanarayana opened this issue Jan 2, 2019 · 1 comment

Comments

@harshanarayana
Copy link
Contributor

Description

The current implementation of the Request class provided by sanic has a __repr__ method that performs an unnecessary None check on method and path and there it is not possible that they can be None. We can remove these condition checks and have a much simpler __repr__ implementation.

Reference

  1. __repr__ implementation
  2. Community Discussion Thread
@chenjr0719
Copy link
Member

Just a reminder, don't forget the test.
https://github.com/huge-success/sanic/blob/cea1547e08230b6ad49eb7777fd8db5335382b7a/tests/test_requests.py#L558-L567

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

No branches or pull requests

5 participants