Title: Using the slash "/" operator between a PurePath and a str should have an inferred type of PurePath · Issue #1242 · microsoft/python-language-server · GitHub
Open Graph Title: Using the slash "/" operator between a PurePath and a str should have an inferred type of PurePath · Issue #1242 · microsoft/python-language-server
X Title: Using the slash "/" operator between a PurePath and a str should have an inferred type of PurePath · Issue #1242 · microsoft/python-language-server
Description: Microsoft Language Server for Python. Contribute to microsoft/python-language-server development by creating an account on GitHub.
Open Graph Description: Microsoft Language Server for Python. Contribute to microsoft/python-language-server development by creating an account on GitHub.
X Description: Microsoft Language Server for Python. Contribute to microsoft/python-language-server development by creating an account on GitHub.
Opengraph URL: https://github.com/microsoft/python-language-server
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Using the slash \"/\" operator between a PurePath and a str should have an inferred type of PurePath","articleBody":"\u003c!-- Please search existing issues to avoid creating duplicates. -->\r\n\r\n## Environment data\r\n\r\n- VS Code version: 1.35.1\r\n- Extension version (available under the Extensions sidebar): 2019.5.18875\r\n- OS and version: Ubuntu 18.04\r\n- Python version (& distribution if applicable, e.g. Anaconda): Anaconda Python 3.6\r\n- Type of virtual environment used (N/A | venv | virtualenv | conda | ...): conda\r\n- Relevant/affected Python packages and their versions: standard library `pathlib`\r\n\r\n## Expected behaviour\r\n\r\nUsing the `/` operator on a `pathlib.PurePath` and a `str` should infer a type of `pathlib.PurePath`.\r\n\r\nGiven the following Python fragment:\r\n\r\n```Python\r\nimport pathlib\r\n\r\nroot = pathlib.Path(\"/some/directory\")\r\nsubdir = root / \"subdir\"\r\nchild = subdir / \"file.txt\"\r\n```\r\n\r\n`root` should have an infered type of `Path` :heavy_check_mark: \r\n`subdir` should have an an infered type of `PurePath` :heavy_check_mark: \r\n`child` should have an an infered type of `PurePath` :x: \r\n\r\n## Actual behaviour\r\n\r\n`root` has an infered type of `Path` :heavy_check_mark: \r\n`subdir` has an infered type of `PurePath` :heavy_check_mark: \r\nchild has an infered type of `str` :x: \r\n\r\n## Steps to reproduce:\r\n\r\n1. Copy the code above into a new Python file in VS code.\r\n2. Hover over `child`, or trigger autocomplete with its methods (the completion is for `str`).\r\n\r\n\r\n\r\n\u003c!--\r\nNote: If you think a GIF of what is happening would be helpful, consider tools like https://www.cockos.com/licecap/, https://github.com/phw/peek or https://www.screentogif.com/ .\r\n-->\r\n\r\n## Logs\r\nOutput for `Python` in the `Output` panel (`View`→`Output`, change the drop-down the upper-right of the `Output` panel to `Python`)\r\n\r\n```\r\nStarting Microsoft Python language server.\r\n##########Linting Output - mypy##########\r\n##########Linting Output - flake8##########\r\n[Info - 9:15:03 AM] Analysis cache path: /home/user/.cache/Microsoft/Python Language Server\r\n[Info - 9:15:03 AM] GetCurrentSearchPaths /home/user/anaconda3/bin/python \r\n[Info - 9:15:03 AM] Interpreter search paths:\r\n[Info - 9:15:03 AM] /home/user/anaconda3/lib/python3.6\r\n[Info - 9:15:03 AM] /home/user/anaconda3/lib/python3.6/lib-dynload\r\n[Info - 9:15:03 AM] /home/user/anaconda3/lib/python3.6/site-packages\r\n[Info - 9:15:03 AM] User search paths:\r\n[Info - 9:15:04 AM] Microsoft Python Language Server version 0.3.16.0\r\n[Info - 9:15:04 AM] Initializing for /home/user/anaconda3/bin/python\r\n```","author":{"url":"https://github.com/tiangolo","@type":"Person","name":"tiangolo"},"datePublished":"2019-06-21T07:18:29Z","url":"https://github.com/microsoft/python-language-server/issues/1242"}
| 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 | /:user_id/:repository/issues/:id(.:format) |
| route-controller | issues |
| route-action | show |
| fetch-nonce | v2:f309b837-b963-7738-6496-e603a330b04c |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | EC98:38CE1B:4B9C61:66A79E:6AFE5B5B |
| html-safe-nonce | 29b60f4a7912417f0f5ba01ec3d1e0b9cacb673751b37375155e68c7cf4a76d5 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFQzk4OjM4Q0UxQjo0QjlDNjE6NjZBNzlFOjZBRkU1QjVCIiwidmlzaXRvcl9pZCI6IjM2ODI3ODYyNTE2Nzg1NzEzNTUiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | af5774b1e6bb6ba286662affb264103c8cd321bab3bc737e32fa04ec9ac83c7c |
| hovercard-subject-tag | repository:145901977 |
| 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/microsoft/python-language-server/issues/1242 |
| twitter:image | https://opengraph.githubassets.com/4737705627da93bba8e9ca958d1dc08a669b39c04b42f442d1b4290bd814fb86/microsoft/python-language-server |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/4737705627da93bba8e9ca958d1dc08a669b39c04b42f442d1b4290bd814fb86/microsoft/python-language-server |
| og:image:alt | Microsoft Language Server for Python. Contribute to microsoft/python-language-server development by creating an account on GitHub. |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | b3c0f155eafc27e60db6e254d1ffff0e072e9ab3b4018a5ee518797c19d89f86 |
| turbo-cache-control | no-cache |
| go-import | github.com/microsoft/python-language-server git https://github.com/microsoft/python-language-server.git |
| octolytics-dimension-user_id | 6154722 |
| octolytics-dimension-user_login | microsoft |
| octolytics-dimension-repository_id | 145901977 |
| octolytics-dimension-repository_nwo | microsoft/python-language-server |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 145901977 |
| octolytics-dimension-repository_network_root_nwo | microsoft/python-language-server |
| 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 | 4a10310af51a1bfffbedc4fd81cb582acf0cb0ff |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width