Title: convert shutil._PathReturn to a type parameter? · Issue #13508 · python/typeshed · GitHub
Open Graph Title: convert shutil._PathReturn to a type parameter? · Issue #13508 · python/typeshed
X Title: convert shutil._PathReturn to a type parameter? · Issue #13508 · python/typeshed
Description: Since shutil._PathReturn is defined as Any, it may hide type errors to mypy-like tools. E.g in the following code, mypy will not detect that f function is invoked with an str argument instead of a Path. import shutil from pathlib import ...
Open Graph Description: Since shutil._PathReturn is defined as Any, it may hide type errors to mypy-like tools. E.g in the following code, mypy will not detect that f function is invoked with an str argument instead of a ...
X Description: Since shutil._PathReturn is defined as Any, it may hide type errors to mypy-like tools. E.g in the following code, mypy will not detect that f function is invoked with an str argument instead of a ...
Opengraph URL: https://github.com/python/typeshed/issues/13508
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"convert shutil._PathReturn to a type parameter?","articleBody":"Since shutil._PathReturn is defined as `Any`, it may hide type errors to mypy-like tools. E.g in the following code, mypy will not detect that `f` function is invoked with an `str` argument instead of a Path.\n```python\nimport shutil\nfrom pathlib import Path\n\n\ndef f(p: Path) -> None:\n pass\n\n\ndef cp(target: str | Path) -> None:\n p = shutil.copy(\"/src\", target)\n return f(p)\n```","author":{"url":"https://github.com/dpinol","@type":"Person","name":"dpinol"},"datePublished":"2025-02-16T17:18:35Z","url":"https://github.com/python/typeshed/issues/13508"}
| 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:a4986a78-cc85-aef3-829d-2d4336cc5456 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 986A:1C3DC0:BCB8D6:FCADF3:6B004D60 |
| html-safe-nonce | 8608737c850efc7fa11bc24782f442c8a79a9a4766c1f730e8170feb4f6d9583 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5ODZBOjFDM0RDMDpCQ0I4RDY6RkNBREYzOjZCMDA0RDYwIiwidmlzaXRvcl9pZCI6IjIxMDc4NTI5Mzg1ODI5Njk2OTYiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 53e03e4d59a319db557d1d4ec44ca07e8f1d9359108dc19f5c214c32d1ada39b |
| hovercard-subject-tag | issue:2856223847 |
| 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/13508/issue_layout |
| twitter:image | https://opengraph.githubassets.com/785006c6287259da33bfa05524089ac1ecc3dcab95c7b3e22d29d68ebfde5b1f/python/typeshed/issues/13508 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/785006c6287259da33bfa05524089ac1ecc3dcab95c7b3e22d29d68ebfde5b1f/python/typeshed/issues/13508 |
| og:image:alt | Since shutil._PathReturn is defined as Any, it may hide type errors to mypy-like tools. E.g in the following code, mypy will not detect that f function is invoked with an str argument instead of a ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | dpinol |
| hostname | github.com |
| expected-hostname | github.com |
| None | f9517bf360d46638a1e5e7daee7158842fe5ef43c9000afa0e127564a7c2f39b |
| 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 | b27c5dde30676028abd5c5fc53ce5c9b625f8281 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width