Title: Stubs for `filecmp` are missing `Pathlike` for `common` argument · Issue #7034 · python/typeshed · GitHub
Open Graph Title: Stubs for `filecmp` are missing `Pathlike` for `common` argument · Issue #7034 · python/typeshed
X Title: Stubs for `filecmp` are missing `Pathlike` for `common` argument · Issue #7034 · python/typeshed
Description: bug.py: """Demo mypy bug.""" import filecmp from pathlib import Path d = Path.home() filecmp.cmpfiles(d, d, d.glob("*")) mypy bug.py: bug.py:6: error: Value of type variable "AnyStr" of "cmpfiles" cannot be "Path" Found 1 error in 1 file...
Open Graph Description: bug.py: """Demo mypy bug.""" import filecmp from pathlib import Path d = Path.home() filecmp.cmpfiles(d, d, d.glob("*")) mypy bug.py: bug.py:6: error: Value of type variable "AnyStr" of "cmpfiles" ...
X Description: bug.py: """Demo mypy bug.""" import filecmp from pathlib import Path d = Path.home() filecmp.cmpfiles(d, d, d.glob("*")) mypy bug.py: bug.py:6: error: Value ...
Opengraph URL: https://github.com/python/typeshed/issues/7034
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Stubs for `filecmp` are missing `Pathlike` for `common` argument","articleBody":"`bug.py`:\r\n```python\r\n\"\"\"Demo mypy bug.\"\"\"\r\nimport filecmp\r\nfrom pathlib import Path\r\n\r\nd = Path.home()\r\nfilecmp.cmpfiles(d, d, d.glob(\"*\"))\r\n```\r\n\r\n`mypy bug.py`:\r\n```\r\nbug.py:6: error: Value of type variable \"AnyStr\" of \"cmpfiles\" cannot be \"Path\"\r\nFound 1 error in 1 file (checked 1 source file)\r\n```\r\n\r\nI guess `common` should be `Iterable[AnyStr | PathLike[AnyStr]]`:\r\nhttps://github.com/python/typeshed/blob/7bc9c1625eb0df0500e70de96f3e1a698bb8c05a/stdlib/filecmp.pyi#L16-L18\r\n\r\nRelated: https://github.com/python/typeshed/issues/3858, https://github.com/python/typeshed/pull/3864\r\n","author":{"url":"https://github.com/bersbersbers","@type":"Person","name":"bersbersbers"},"datePublished":"2022-01-25T08:47:03.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":8},"url":"https://github.com/7034/typeshed/issues/7034"}
| 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:bc83da70-c226-368d-2b99-993092d84225 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | CEA0:C07BE:33D5A1:451A61:6969C313 |
| html-safe-nonce | 5fb4c16596aa14509b487394e4be81b27157082b314952d2eb588af4bb5b8b0e |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDRUEwOkMwN0JFOjMzRDVBMTo0NTFBNjE6Njk2OUMzMTMiLCJ2aXNpdG9yX2lkIjoiNzkwNzI5NjUyOTAxMTU1NzEzOSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 54ff7589b4a2f59347dbf3af3279d4b0cd3d2ca07acf03b626266de91d92c23e |
| hovercard-subject-tag | issue:1113593164 |
| 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/7034/issue_layout |
| twitter:image | https://opengraph.githubassets.com/369958198af906b4ad1876ceea768307df417d358d2214194fe7e8f19778dc5c/python/typeshed/issues/7034 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/369958198af906b4ad1876ceea768307df417d358d2214194fe7e8f19778dc5c/python/typeshed/issues/7034 |
| og:image:alt | bug.py: """Demo mypy bug.""" import filecmp from pathlib import Path d = Path.home() filecmp.cmpfiles(d, d, d.glob("*")) mypy bug.py: bug.py:6: error: Value of type variable "AnyStr" of "cmpfiles" ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | bersbersbers |
| hostname | github.com |
| expected-hostname | github.com |
| None | acedec8b5f975d9e3d494ddd8f949b0b8a0de59d393901e26f73df9dcba80056 |
| 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 | 83c08c21cdda978090dc44364b71aa5bc6dcea79 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width