Title: stubgen with attrs class not producing expected __init__.py output · Issue #9327 · python/mypy · GitHub
Open Graph Title: stubgen with attrs class not producing expected __init__.py output · Issue #9327 · python/mypy
X Title: stubgen with attrs class not producing expected __init__.py output · Issue #9327 · python/mypy
Description: When I generate stubs using mypy's stubgen I find that I am forced to use the attrib = attr.ib(...) to get the stub for init to have the attributes in them. Even then the typing information for the attributes are wrong. When I do @attr.s...
Open Graph Description: When I generate stubs using mypy's stubgen I find that I am forced to use the attrib = attr.ib(...) to get the stub for init to have the attributes in them. Even then the typing information for the...
X Description: When I generate stubs using mypy's stubgen I find that I am forced to use the attrib = attr.ib(...) to get the stub for init to have the attributes in them. Even then the typing information for...
Opengraph URL: https://github.com/python/mypy/issues/9327
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"stubgen with attrs class not producing expected __init__.py output","articleBody":"When I generate stubs using mypy's stubgen I find that I am forced to use the attrib = attr.ib(...) to get the stub for init to have the attributes in them. Even then the typing information for the attributes are wrong.\r\n\r\nWhen I do\r\n\r\n```\r\n@attr.s(auto_attribs = True)\r\nclass Dummy:\r\n var: str\r\n```\r\nand run stubgen against it.\r\nThe stub I get looks like\r\n```\r\ndef __init__(self)->None\r\n```\r\nI expect\r\n\r\n```\r\ndef __init__(self, var: str)->None\r\n```\r\nIf I do\r\n\r\n```\r\n@attr.s()\r\nclass Dummy:\r\n var: str = attr.ib()\r\n var2 = attr.ib(type:str)\r\n```\r\nI get closer to the expected output, but it is missing the type information\r\n```\r\ndef __init__(self, var: Any, var2: Any)->None\r\n```","author":{"url":"https://github.com/cazador481","@type":"Person","name":"cazador481"},"datePublished":"2020-08-19T13:31:42Z","url":"https://github.com/python/mypy/issues/9327"}
| 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:c367f52f-4221-3eda-d22a-38644505d9b9 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | E450:1A6297:1B3C35:233593:6AFFC081 |
| html-safe-nonce | 262c3c79ac2fbc7da6e3f57ecfee20416b4fdd67b366e97f476ea820f677ec3e |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFNDUwOjFBNjI5NzoxQjNDMzU6MjMzNTkzOjZBRkZDMDgxIiwidmlzaXRvcl9pZCI6IjM2OTA3NTkxMTExMzkzNzcyODEiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 2ee128cdeb033f7c27daa8ec378fccaaf5c55a76553cf67581cb6100ea07a4f0 |
| hovercard-subject-tag | issue:681843266 |
| 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/mypy/9327/issue_layout |
| twitter:image | https://opengraph.githubassets.com/15e81b5afe771a59f27c1486147e9ecd619af7c33da3d1dac4a04da6bb652968/python/mypy/issues/9327 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/15e81b5afe771a59f27c1486147e9ecd619af7c33da3d1dac4a04da6bb652968/python/mypy/issues/9327 |
| og:image:alt | When I generate stubs using mypy's stubgen I find that I am forced to use the attrib = attr.ib(...) to get the stub for init to have the attributes in them. Even then the typing information for the... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | cazador481 |
| hostname | github.com |
| expected-hostname | github.com |
| None | 1e805b832df235bb21305db712c3b6432920019dfc12cb25b9cb8d3b0c9403cf |
| turbo-cache-control | no-preview |
| go-import | github.com/python/mypy git https://github.com/python/mypy.git |
| octolytics-dimension-user_id | 1525981 |
| octolytics-dimension-user_login | python |
| octolytics-dimension-repository_id | 7053637 |
| octolytics-dimension-repository_nwo | python/mypy |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 7053637 |
| octolytics-dimension-repository_network_root_nwo | python/mypy |
| 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 | 8fa4a54e6871c7908eda1c246ad5972982c0b59d |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width