Skip to content
New issue

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

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

Already on GitHub? # to your account

Use constants for HTTP codes in documentation example #2362

Closed
wants to merge 1 commit into from

Conversation

yyaremenko
Copy link

For constant values, descriptive constants must be used. Not the values directly.

Q A
Bug fix? no
New feature? no
Issues
License MIT

A goal of documentation, aside from giving information to a developer, is also to encourage a developer to follow good coding practices. One of such practices is to use descriptive constants for constant values instead of using such values directly.

For constant values, descriptive constants must be used. Not the values directly.
@carsonbot carsonbot added the Status: Needs Review Needs to be reviewed label Nov 10, 2024
@yyaremenko
Copy link
Author

yyaremenko commented Nov 10, 2024

also, looks like the tests are corrupt (the tests should not fail after just one line change in a documentation I guess?)

@nicolas-grekas
Copy link
Member

When the numbers come from standards like HTTP, we prefer the actual value.

@yyaremenko
Copy link
Author

why do you have a whole set of constants for HTTP codes in a Response class then?

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Status: Needs Review Needs to be reviewed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants