Title: `comparison-overlap` not triggered for pathlib.Path · Issue #10661 · python/typeshed · GitHub
Open Graph Title: `comparison-overlap` not triggered for pathlib.Path · Issue #10661 · python/typeshed
X Title: `comparison-overlap` not triggered for pathlib.Path · Issue #10661 · python/typeshed
Description: --strict-comparison seems to assume that pathlib.Path objects can be equal to anything. To Reproduce (playground) # run with --strict-equality from pathlib import Path class A: pass 'x' == 1 # comparison-overlap: this is always false A()...
Open Graph Description: --strict-comparison seems to assume that pathlib.Path objects can be equal to anything. To Reproduce (playground) # run with --strict-equality from pathlib import Path class A: pass 'x' == 1 # comp...
X Description: --strict-comparison seems to assume that pathlib.Path objects can be equal to anything. To Reproduce (playground) # run with --strict-equality from pathlib import Path class A: pass 'x' == ...
Opengraph URL: https://github.com/python/typeshed/issues/10661
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"`comparison-overlap` not triggered for pathlib.Path","articleBody":"`--strict-comparison` seems to assume that `pathlib.Path` objects can be equal to anything.\r\n\r\n**To Reproduce** ([playground](https://mypy-play.net/?mypy=latest&python=3.11&flags=strict-equality&gist=f87d542ff65df4ef507e73244fe1e538))\r\n\r\n```python\r\n# run with --strict-equality\r\nfrom pathlib import Path\r\n\r\nclass A: pass\r\n\r\n'x' == 1 # comparison-overlap: this is always false\r\nA() == 1 # comparison-overlap: this is always false\r\nPath('x') == 1 # fine for mypy\r\n```\r\n\r\n**Expected Behavior**\r\nBoth lines should trigger 'non-overlapping equality check'\r\n\r\n**Actual Behavior**\r\nOnly `'x' == 1` triggers 'non-overlapping equality check'\r\n","author":{"url":"https://github.com/NMertsch","@type":"Person","name":"NMertsch"},"datePublished":"2023-09-04T14:54:00Z","url":"https://github.com/python/typeshed/issues/10661"}
| 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:43600a13-58da-9d18-63b9-7e05407571ca |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | DAE2:1A6297:104A4E1:156E945:6B000922 |
| html-safe-nonce | c8fcf24928dc0bc776ae66b006e53bee98acc8047a494fd4e4fe7f40d7853ac7 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEQUUyOjFBNjI5NzoxMDRBNEUxOjE1NkU5NDU6NkIwMDA5MjIiLCJ2aXNpdG9yX2lkIjoiMzg5ODEzNjk3ODY3OTYzMjMiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 1f929694d4c70121085df1570cfb003f74111e72cb50a4ee274d18854ec0960d |
| hovercard-subject-tag | issue:1880925461 |
| 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/10661/issue_layout |
| twitter:image | https://opengraph.githubassets.com/27655f21f826d5990b8a6d44bec0b3d81323733f3d136512f127c32ac6c72ac6/python/typeshed/issues/10661 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/27655f21f826d5990b8a6d44bec0b3d81323733f3d136512f127c32ac6c72ac6/python/typeshed/issues/10661 |
| og:image:alt | --strict-comparison seems to assume that pathlib.Path objects can be equal to anything. To Reproduce (playground) # run with --strict-equality from pathlib import Path class A: pass 'x' == 1 # comp... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | NMertsch |
| hostname | github.com |
| expected-hostname | github.com |
| None | 0a0d8686a27478df474dd7415776a7a080cde8838b3cd92ea7601187572e5729 |
| 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 | 16a11879678aaf97e2a42c33ee70830aa084fa37 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width