Title: Docstrings confuse autocompletion · Issue #966 · bpython/bpython · GitHub
Open Graph Title: Docstrings confuse autocompletion · Issue #966 · bpython/bpython
X Title: Docstrings confuse autocompletion · Issue #966 · bpython/bpython
Description: I ran into an issue where the autocompletion starts thinking an example from the docstring of the function is the signature of the function. The original code where I ran into this was a bit more complicated but I managed to create a som...
Open Graph Description: I ran into an issue where the autocompletion starts thinking an example from the docstring of the function is the signature of the function. The original code where I ran into this was a bit more c...
X Description: I ran into an issue where the autocompletion starts thinking an example from the docstring of the function is the signature of the function. The original code where I ran into this was a bit more c...
Opengraph URL: https://github.com/bpython/bpython/issues/966
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Docstrings confuse autocompletion","articleBody":"I ran into an issue where the autocompletion starts thinking an example from the docstring of the function is the signature of the function.\r\n\r\nThe original code where I ran into this was a bit more complicated but I managed to create a somewhat minimal reproduction (the inheritance is significant, without inheriting it works correctly):\r\n```python\r\nfrom collections.abc import Sequence\r\n\r\n\r\nclass C(Sequence):\r\n @classmethod\r\n def cmethod(cls, number: int, lst: list[int] = []):\r\n \"\"\"\r\n Return a list of numbers\r\n\r\n Example:\r\n ========\r\n C.cmethod(1337, [1, 2]) # =\u003e [1, 2, 1337]\r\n \"\"\"\r\n return lst + [number]\r\n\r\n```\r\n\r\n\r\n\r\nThe autocompletion (and the documentation pop-up) seems to not realize that 1337 and [1 and 2 are literals rather than parameter names, and the `cls` parameter for a class method gets turned into `obj` for whatever reason.","author":{"url":"https://github.com/Andriamanitra","@type":"Person","name":"Andriamanitra"},"datePublished":"2022-08-25T09:18:30.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":2},"url":"https://github.com/966/bpython/issues/966"}
| 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:eca701ed-98c0-ae2a-0a22-04439119ab03 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | A496:E2DAE:4F8784:6EC3DA:69690022 |
| html-safe-nonce | 279ceadb162b2526256f95699b8e1030889b1694846d4d6745d909543b066a92 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBNDk2OkUyREFFOjRGODc4NDo2RUMzREE6Njk2OTAwMjIiLCJ2aXNpdG9yX2lkIjoiMTY2OTAzMjYyMDkzNTY3NTkzOCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | df4c74bd1e30dac3c4b404072dac8cd86e4ca3a1a1f3983b0dc02f76159dee42 |
| hovercard-subject-tag | issue:1350595146 |
| 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/bpython/bpython/966/issue_layout |
| twitter:image | https://opengraph.githubassets.com/bfaf2c512912a937057c32cca9aa008d0769a1b012da344991a0609c3dbbde21/bpython/bpython/issues/966 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/bfaf2c512912a937057c32cca9aa008d0769a1b012da344991a0609c3dbbde21/bpython/bpython/issues/966 |
| og:image:alt | I ran into an issue where the autocompletion starts thinking an example from the docstring of the function is the signature of the function. The original code where I ran into this was a bit more c... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | Andriamanitra |
| hostname | github.com |
| expected-hostname | github.com |
| None | e6156bd4ef9f2dc8dadf4c49a8f7ed8532186388cef72eda3ccb9f0ab3b8cfca |
| turbo-cache-control | no-preview |
| go-import | github.com/bpython/bpython git https://github.com/bpython/bpython.git |
| octolytics-dimension-user_id | 8071396 |
| octolytics-dimension-user_login | bpython |
| octolytics-dimension-repository_id | 21508865 |
| octolytics-dimension-repository_nwo | bpython/bpython |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 21508865 |
| octolytics-dimension-repository_network_root_nwo | bpython/bpython |
| 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 | fd1938215b152e2c6a29cf56fec07fd9f91f1203 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width