Title: Declare `http.cookies.SimpleCookie` as non generic(?) · Issue #10700 · python/typeshed · GitHub
Open Graph Title: Declare `http.cookies.SimpleCookie` as non generic(?) · Issue #10700 · python/typeshed
X Title: Declare `http.cookies.SimpleCookie` as non generic(?) · Issue #10700 · python/typeshed
Description: I'm a bit confused as to why http.cookies.SimpleCookie is declared as a generic class and not like below? class SimpleCookie(BaseCookie[str]): ... The documentation on SimpleCookie only talks about strings: class http.cookies.SimpleCooki...
Open Graph Description: I'm a bit confused as to why http.cookies.SimpleCookie is declared as a generic class and not like below? class SimpleCookie(BaseCookie[str]): ... The documentation on SimpleCookie only talks about...
X Description: I'm a bit confused as to why http.cookies.SimpleCookie is declared as a generic class and not like below? class SimpleCookie(BaseCookie[str]): ... The documentation on SimpleCookie only talks a...
Opengraph URL: https://github.com/python/typeshed/issues/10700
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Declare `http.cookies.SimpleCookie` as non generic(?)","articleBody":"I'm a bit confused as to why `http.cookies.SimpleCookie` is declared as a generic class and not like below?\r\n\r\n```python\r\nclass SimpleCookie(BaseCookie[str]):\r\n ...\r\n```\r\n\r\nThe [documentation](https://docs.python.org/3/library/http.cookies.html#http.cookies.SimpleCookie) on `SimpleCookie` only talks about strings:\r\n\r\n> class http.cookies.SimpleCookie([input])[¶](https://docs.python.org/3/library/http.cookies.html#http.cookies.SimpleCookie)\r\nThis class derives from [BaseCookie](https://docs.python.org/3/library/http.cookies.html#http.cookies.BaseCookie) and overrides value_decode() and value_encode(). SimpleCookie supports strings as cookie values. When setting the value, SimpleCookie calls the builtin [str()](https://docs.python.org/3/library/stdtypes.html#str) to convert the value to a string. Values received from HTTP are kept as strings.\r\n\r\nAnd from what I'm seeing, implementations `value_decode` and `value_encode` for `SimpleCookie` only produces strings (but perhaps I'm missing something)?\r\n\r\nRef: https://github.com/python/cpython/blob/1ee50e2a78f644d81d341a08562073ad169d8cc7/Lib/http/cookies.py#L607-L612","author":{"url":"https://github.com/flaeppe","@type":"Person","name":"flaeppe"},"datePublished":"2023-09-11T20:46:02Z","url":"https://github.com/python/typeshed/issues/10700"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:a4914eea-d496-517d-2538-eb79ce42dac0 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | CEE2:59847:35F4C7:48EDE4:6B00292E |
| html-safe-nonce | 60ea5cc18d4247c15b00e4d11fc6c08dd57088d977d17ed9d31f62ad53fed5c7 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDRUUyOjU5ODQ3OjM1RjRDNzo0OEVERTQ6NkIwMDI5MkUiLCJ2aXNpdG9yX2lkIjoiNzMyNDA2MzcxNzExNTU3MDQ3OCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 9de04945b08408aef6f3ee082a8f027f05ed7e3bb1b9dc9c941d9b22d8fc8ada |
| hovercard-subject-tag | issue:1891239841 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/python/typeshed/10700/issue_layout |
| twitter:image | https://opengraph.githubassets.com/43c81f19376c1f788c46fb07dd79091a35436886c1afe89038a12d5ccd01ddcf/python/typeshed/issues/10700 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/43c81f19376c1f788c46fb07dd79091a35436886c1afe89038a12d5ccd01ddcf/python/typeshed/issues/10700 |
| og:image:alt | I'm a bit confused as to why http.cookies.SimpleCookie is declared as a generic class and not like below? class SimpleCookie(BaseCookie[str]): ... The documentation on SimpleCookie only talks about... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | flaeppe |
| hostname | github.com |
| expected-hostname | github.com |
| None | 4eb4cba0d69f045374ac15de9666d22b0961e1d555cc3824f36b7734c00c78e0 |
| turbo-cache-control | no-preview |
| go-import | github.com/python/typeshed git https://github.com/python/typeshed.git |
| octolytics-dimension-user_id | 1525981 |
| octolytics-dimension-user_login | python |
| octolytics-dimension-repository_id | 31696383 |
| octolytics-dimension-repository_nwo | python/typeshed |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 31696383 |
| octolytics-dimension-repository_network_root_nwo | python/typeshed |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 44c658b24abf00491fb7ae5f56d42c9f38cbeab2 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width