Title: TypeError on built-ins when using keyword arguments is not found · Issue #5771 · python/typeshed · GitHub
Open Graph Title: TypeError on built-ins when using keyword arguments is not found · Issue #5771 · python/typeshed
X Title: TypeError on built-ins when using keyword arguments is not found · Issue #5771 · python/typeshed
Description: Bug Report Many (most?) built-ins do not take keyword arguments (see Python issue 8706). Nevertheless, mypy does not report about the corresponding TypeError raised at runtime. To Reproduce use a built-in method, e.g. get(), with a keywo...
Open Graph Description: Bug Report Many (most?) built-ins do not take keyword arguments (see Python issue 8706). Nevertheless, mypy does not report about the corresponding TypeError raised at runtime. To Reproduce use a b...
X Description: Bug Report Many (most?) built-ins do not take keyword arguments (see Python issue 8706). Nevertheless, mypy does not report about the corresponding TypeError raised at runtime. To Reproduce use a b...
Opengraph URL: https://github.com/python/typeshed/issues/5771
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"TypeError on built-ins when using keyword arguments is not found","articleBody":"\u003c!--\r\n If you're new to mypy and you're not sure whether what you're experiencing is a mypy bug, please see the \"Question and Help\" form\r\n instead.\r\n-->\r\n\r\n**Bug Report**\r\n\r\n\u003c!--\r\nNote: If the problem you are reporting is about a specific library function, then the typeshed tracker is better suited\r\nfor this report: https://github.com/python/typeshed/issues\r\n-->\r\n\r\nMany (most?) built-ins do not take keyword arguments (see [Python issue 8706](https://bugs.python.org/issue8706)). Nevertheless, mypy does not report about the corresponding `TypeError` raised at runtime.\r\n\r\n**To Reproduce**\r\n\r\n1. use a built-in method, e.g. `get()`, with a keyword argument\r\n2. run mypy, don't get an error\r\n3. run the program, get a `TypeError`\r\n\r\nMWE:\r\n\r\n```python\r\nmy_dict = dict(a=1)\r\na_value = my_dict.get('b', default='nothing to find')\r\nprint(a_value)\r\n```\r\n\r\n```bash\r\n$ mypy tst.py\r\nSuccess: no issues found in 1 source file\r\n$ python tst.py\r\nTraceback (most recent call last):\r\n File \"/opt/data/UserWork/hintze/my_work/tst.py\", line 2, in \u003cmodule>\r\n a_value = my_dict.get('b', default='nothing to find')\r\nTypeError: dict.get() takes no keyword arguments\r\n```\r\n\r\n**Expected Behavior**\r\n\r\n\u003c!--\r\n How did you expect your project to behave?\r\n It’s fine if you’re not sure your understanding is correct.\r\n Write down what you thought would happen. If you just expected no errors, you can delete this section.\r\n-->\r\n\r\nI thought mypy would tell me about the `TypeError`...\r\n\r\n**Actual Behavior**\r\n\r\n\u003c!--\r\n Did something go wrong?\r\n Is something broken, or not behaving as you expected?\r\n-->\r\n\r\n...but it didn't.\r\n\r\n**Your Environment**\r\n\r\n\u003c!-- Include as many relevant details about the environment you experienced the bug in -->\r\n\r\n- Mypy version used: 0.901\r\n- Mypy command-line flags: None\r\n- Mypy configuration options from `mypy.ini` (and other config files): None\r\n- Python version used: Python 3.9.1\r\n- Operating system and version: [GCC 4.8.5 20150623 (Red Hat 4.8.5-44)] on linux\r\n\r\n\u003c!--\r\nYou can freely edit this text, please remove all the lines\r\nyou believe are unnecessary.\r\n-->\r\n","author":{"url":"https://github.com/derhintze","@type":"Person","name":"derhintze"},"datePublished":"2021-07-13T06:50:00Z","url":"https://github.com/python/typeshed/issues/5771"}
| 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:6a36e33e-5af4-fdf3-0553-2b8d2a9e0164 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 819A:2046A4:FCE18A:1532FC7:6B005C0C |
| html-safe-nonce | a2afb4508b7fec94326f0fbcf869ae86b217ce9068a52ccb6c579f0b6f7bd3f5 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4MTlBOjIwNDZBNDpGQ0UxOEE6MTUzMkZDNzo2QjAwNUMwQyIsInZpc2l0b3JfaWQiOiI1MjkwNjIyMzUxNDUxMzgwNzQ4IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | d0a1db4f509c3b0862443c19695f87f93837dd666784af9d7848ea9e3f314ca8 |
| hovercard-subject-tag | issue:943455104 |
| 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/5771/issue_layout |
| twitter:image | https://opengraph.githubassets.com/aa2e8db7cc23bc392418130a296977ccacc65143ae402d504fd95092c7c4ea53/python/typeshed/issues/5771 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/aa2e8db7cc23bc392418130a296977ccacc65143ae402d504fd95092c7c4ea53/python/typeshed/issues/5771 |
| og:image:alt | Bug Report Many (most?) built-ins do not take keyword arguments (see Python issue 8706). Nevertheless, mypy does not report about the corresponding TypeError raised at runtime. To Reproduce use a b... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | derhintze |
| hostname | github.com |
| expected-hostname | github.com |
| None | 29be975efff6507a5d135de9c7d634cf7ff8f0c55222a64386ab3202209aaf73 |
| 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 | eacd927ba6112e3b01ba99c762bd699a4a4f5df7 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width