Title: set[str].discard(str | None) · Issue #7121 · python/typeshed · GitHub
Open Graph Title: set[str].discard(str | None) · Issue #7121 · python/typeshed
X Title: set[str].discard(str | None) · Issue #7121 · python/typeshed
Description: Consider the following: names: set[str] = {"a", "b"} name: str | None = None names.discard(name) It would be nice if this wasn't a type checker error. Unlike .remove(), the .discard() method does nothing if the item is not in the set, so...
Open Graph Description: Consider the following: names: set[str] = {"a", "b"} name: str | None = None names.discard(name) It would be nice if this wasn't a type checker error. Unlike .remove(), the .discard() method does n...
X Description: Consider the following: names: set[str] = {"a", "b"} name: str | None = None names.discard(name) It would be nice if this wasn't a type checker error. Unlike .remove(), the ...
Opengraph URL: https://github.com/python/typeshed/issues/7121
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"set[str].discard(str | None)","articleBody":"Consider the following:\r\n\r\n```python3\r\nnames: set[str] = {\"a\", \"b\"}\r\nname: str | None = None\r\nnames.discard(name)\r\n```\r\n\r\nIt would be nice if this wasn't a type checker error. Unlike `.remove()`, the `.discard()` method does nothing if the item is not in the set, so I don't see a good reason to ban `None` values.","author":{"url":"https://github.com/Akuli","@type":"Person","name":"Akuli"},"datePublished":"2022-02-03T09:35:16.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":3},"url":"https://github.com/7121/typeshed/issues/7121"}
| 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:01c1095b-aa67-efda-ad72-8510d95a0a0d |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | EC12:103288:DFD928:1348465:6A625875 |
| html-safe-nonce | c81bee4d3ce98891befae3e592af258b60c2747fd64ac43f4ebd5e61c4f027ad |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFQzEyOjEwMzI4ODpERkQ5Mjg6MTM0ODQ2NTo2QTYyNTg3NSIsInZpc2l0b3JfaWQiOiIzNDg3NTIyNjExNTk3MDM5NzMzIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 1f59176636f835123bd6885c5437927537c2518e2614a2a79d6a4cc1369a3e8a |
| hovercard-subject-tag | issue:1122852359 |
| 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/7121/issue_layout |
| twitter:image | https://opengraph.githubassets.com/c8fbf2798b62c9b2ec7697322d61eb04227b5c183a3ee237a971eca1c9c7e29c/python/typeshed/issues/7121 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/c8fbf2798b62c9b2ec7697322d61eb04227b5c183a3ee237a971eca1c9c7e29c/python/typeshed/issues/7121 |
| og:image:alt | Consider the following: names: set[str] = {"a", "b"} name: str | None = None names.discard(name) It would be nice if this wasn't a type checker error. Unlike .remove(), the .discard() method does n... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | Akuli |
| hostname | github.com |
| expected-hostname | github.com |
| None | b928dd27bb9305f313c737471c216297e218430ec505d064cf33d7d74af9bf89 |
| 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 | 6f728c3f39985ee4d171ffdd5591d8d2652392d9 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width