categorise status code and use enum/classes #2685
-
As of now status code are written as simple constant object like HTTP_100_CONTINUE = 100 https://github.com/encode/starlette/blob/8e1fc9b3d1578ae7d4b03c9cb2338019106f8544/starlette/status.py , and there are so many of them exists which are not easy to remember and one need to see them in codebase. why cannot we categories them like mentioned in https://www.iana.org/assignments/http-status-codes/http-status-codes.xhtml, so making enum of them according to level there are in , by i mean,for 1xx status code make a class called so example one of change it will bring in fastapi code https://github.com/fastapi/fastapi/blob/b203d7a15fb5b49635bd81811e09ad94700f68a6/fastapi/security/http.py#L199 as
this will more simply the loading status code and categorise them |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Doesn't sound a valid reason. The current way is fine. |
Beta Was this translation helpful? Give feedback.
Doesn't sound a valid reason. The current way is fine.