Title: Possible issue with PyYAML's load() · Issue #2886 · python/typeshed · GitHub
Open Graph Title: Possible issue with PyYAML's load() · Issue #2886 · python/typeshed
X Title: Possible issue with PyYAML's load() · Issue #2886 · python/typeshed
Description: I'm running into a confusing error when using mypy to check a project using PyYAML. Relevant code: raw = yaml.load(some_str, Loader=yaml.FullLoader) Error message (from mypy --strict): error: Call to untyped function "load" in typed cont...
Open Graph Description: I'm running into a confusing error when using mypy to check a project using PyYAML. Relevant code: raw = yaml.load(some_str, Loader=yaml.FullLoader) Error message (from mypy --strict): error: Call ...
X Description: I'm running into a confusing error when using mypy to check a project using PyYAML. Relevant code: raw = yaml.load(some_str, Loader=yaml.FullLoader) Error message (from mypy --strict): error: C...
Opengraph URL: https://github.com/python/typeshed/issues/2886
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Possible issue with PyYAML's load()","articleBody":"I'm running into a confusing error when using mypy to check a project using PyYAML.\r\n\r\nRelevant code:\r\n\r\n```python\r\nraw = yaml.load(some_str, Loader=yaml.FullLoader)\r\n```\r\n\r\nError message (from `mypy --strict`):\r\n\r\n```\r\nerror: Call to untyped function \"load\" in typed context\r\n```\r\n\r\nYet the [typeshed](https://github.com/python/typeshed/blob/master/third_party/2and3/yaml/__init__.pyi#L18) has:\r\n\r\n```python\r\ndef load(stream: Union[str, IO[str]], Loader=...) -\u003e Any: ...\r\n```\r\n\r\nVersions:\r\n• OS: macOS 10.14.3\r\n• Python: 3.7.2 (installed via Homebrew)\r\n• Pipenv: 2018.11.26\r\n• mypy: 0.670\r\n• PyYAML: 5.1\r\n\r\n(If this belongs in the [mypy repo](https://github.com/python/mypy), I'm happy to move it.)","author":{"url":"https://github.com/nkantar","@type":"Person","name":"nkantar"},"datePublished":"2019-03-26T20:24:21.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":7},"url":"https://github.com/2886/typeshed/issues/2886"}
| 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:1b8672da-acf9-b407-1272-ec69d2347fc9 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | CA76:1C8839:39200C:4EE220:6A6176C5 |
| html-safe-nonce | 9b1efa3302461ed980d37ac5c2e8c08f764e04e8ca645806789ae56ef3791d27 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDQTc2OjFDODgzOTozOTIwMEM6NEVFMjIwOjZBNjE3NkM1IiwidmlzaXRvcl9pZCI6Ijc5NTI4MTQ3NzcxMTQzOTIyNjEiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 9b229fd079160c6f7f2211b2b373d4fd1120d3c26a29bc86c13f0f1a11b9652d |
| hovercard-subject-tag | issue:425631519 |
| 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/2886/issue_layout |
| twitter:image | https://opengraph.githubassets.com/a4d1c8dcb38ae56c9a144e908e8dde4d1ddf78e727631dcdc7911aad6d7c726f/python/typeshed/issues/2886 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/a4d1c8dcb38ae56c9a144e908e8dde4d1ddf78e727631dcdc7911aad6d7c726f/python/typeshed/issues/2886 |
| og:image:alt | I'm running into a confusing error when using mypy to check a project using PyYAML. Relevant code: raw = yaml.load(some_str, Loader=yaml.FullLoader) Error message (from mypy --strict): error: Call ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | nkantar |
| hostname | github.com |
| expected-hostname | github.com |
| None | b05bb6314e7e93021a7b7dab54a85cbe48d821938e762c1dff815efd60699622 |
| 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 | 94389bfdcd393b0a5a274aee94e8a9739d063fe5 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width