Title: Handle relative imports in stubs · Issue #574 · microsoft/python-language-server · GitHub
Open Graph Title: Handle relative imports in stubs · Issue #574 · microsoft/python-language-server
X Title: Handle relative imports in stubs · Issue #574 · microsoft/python-language-server
Description: Since typeshed root is not in the path resolver snapshot, os stub is unable to resolve path submodule since it uses from . import path as path This causes import os os.path. not to show any completions. Works in 3.x. Also, for stubs it m...
Open Graph Description: Since typeshed root is not in the path resolver snapshot, os stub is unable to resolve path submodule since it uses from . import path as path This causes import os os.path. not to show any complet...
X Description: Since typeshed root is not in the path resolver snapshot, os stub is unable to resolve path submodule since it uses from . import path as path This causes import os os.path. not to show any complet...
Opengraph URL: https://github.com/microsoft/python-language-server/issues/574
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Handle relative imports in stubs","articleBody":"Since typeshed root is not in the path resolver snapshot, `os` stub is unable to resolve `path` submodule since it uses\r\n\r\n```python\r\nfrom . import path as path\r\n```\r\nThis causes\r\n```python\r\nimport os\r\nos.path.\r\n```\r\nnot to show any completions. Works in 3.x. \r\n\r\nAlso, for stubs it may be worth resolving stub module first and then real module if the stub is missing. I.e. if A is a stub, import B should resolve to a stub for B and only if stub for B is not found, resolve to real B. This should improve performance of the analysis.\r\n\r\nTest: `OsPathMembers`, Python 2.7","author":{"url":"https://github.com/MikhailArkhipov","@type":"Person","name":"MikhailArkhipov"},"datePublished":"2019-01-31T23:13:13.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/574/python-language-server/issues/574"}
| 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:8cef2c7f-2ead-95ca-3d71-fd4fbedd1e23 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | CF1C:34DA5A:64BB28B:8DB5226:6A504D7C |
| html-safe-nonce | 7bdca2bb5a834563d66cbbe8df1ff5809efe717970b82981647c150e38676424 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDRjFDOjM0REE1QTo2NEJCMjhCOjhEQjUyMjY6NkE1MDREN0MiLCJ2aXNpdG9yX2lkIjoiODI0MTQyOTM3MjQ0OTM0NDg5MiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 76d18f2417d19980e1c9e27183719cee26694a6fe4eabe17d4f0046d523e3c8b |
| hovercard-subject-tag | issue:405482314 |
| 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/microsoft/python-language-server/574/issue_layout |
| twitter:image | https://opengraph.githubassets.com/5a69afce2f88f5a3ea518c095d5ab71ce883eb9bb2306339050cdf18dc790d3e/microsoft/python-language-server/issues/574 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/5a69afce2f88f5a3ea518c095d5ab71ce883eb9bb2306339050cdf18dc790d3e/microsoft/python-language-server/issues/574 |
| og:image:alt | Since typeshed root is not in the path resolver snapshot, os stub is unable to resolve path submodule since it uses from . import path as path This causes import os os.path. not to show any complet... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | MikhailArkhipov |
| hostname | github.com |
| expected-hostname | github.com |
| None | d6dc8294eb500fa36bbc57472d61fe87c522f9c3c1d64f70f4926f66a66a7efb |
| turbo-cache-control | no-preview |
| 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 | 5741a45fe07e5f377d0d4c524a92e3056acc51bb |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width