Title: [jsonschema] RefResolver(store) argument misannotated · Issue #8662 · python/typeshed · GitHub
Open Graph Title: [jsonschema] RefResolver(store) argument misannotated · Issue #8662 · python/typeshed
X Title: [jsonschema] RefResolver(store) argument misannotated · Issue #8662 · python/typeshed
Description: ref: python-jsonschema/jsonschema#997 I expected the following code to work when it comes to typing from typing import Any, Mapping import jsonschema store: dict[str, Mapping[str, Any]] = {} jsonschema.RefResolver( base_uri=f"file://mypa...
Open Graph Description: ref: python-jsonschema/jsonschema#997 I expected the following code to work when it comes to typing from typing import Any, Mapping import jsonschema store: dict[str, Mapping[str, Any]] = {} jsonsc...
X Description: ref: python-jsonschema/jsonschema#997 I expected the following code to work when it comes to typing from typing import Any, Mapping import jsonschema store: dict[str, Mapping[str, Any]] = {} jsonsc...
Opengraph URL: https://github.com/python/typeshed/issues/8662
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"[jsonschema] RefResolver(store) argument misannotated","articleBody":"ref: python-jsonschema/jsonschema#997\r\n\r\nI expected the following code to work when it comes to typing\r\n\r\n```python\r\nfrom typing import Any, Mapping\r\nimport jsonschema\r\n\r\nstore: dict[str, Mapping[str, Any]] = {}\r\n\r\njsonschema.RefResolver(\r\n base_uri=f\"file://mypath.json\",\r\n referrer={},\r\n store=store\r\n)\r\n```\r\n\r\nHowever, this gives an error:\r\n\r\n```\r\ntest.py:9: error: Argument \"store\" to \"RefResolver\" has incompatible type \"Dict[str, Mapping[str, Any]]\"; expected \"Union[SupportsKeysAndGetItem[str, str], Iterable[Tuple[str, str]]]\" [arg-type]\r\nFound 1 error in 1 file (checked 1 source file)\r\n```\r\n\r\ndefined at https://github.com/python/typeshed/blob/c1d307fc3bf51488b708e1c71334faccba5fd294/stubs/jsonschema/jsonschema/validators.pyi#L66-L80 . It seems incorrect that `store` is a `dict[str, str]` type.\r\n\r\nSimilarly, `referrer` is defined as a `dict` (`MutableMapping`) but I suspect that could be changed to `Mapping` (generically).","author":{"url":"https://github.com/kratsg","@type":"Person","name":"kratsg"},"datePublished":"2022-09-01T20:39:55Z","url":"https://github.com/python/typeshed/issues/8662"}
| 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:c2a78cad-afd2-db5f-fc11-7f86f5615b8c |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | E34E:9D520:6CF935:923F87:6B00AEC6 |
| html-safe-nonce | 7090cce8d6ad4432ef36975150ddf1392197e4939dfdca64bf004f221975226e |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFMzRFOjlENTIwOjZDRjkzNTo5MjNGODc6NkIwMEFFQzYiLCJ2aXNpdG9yX2lkIjoiNTg4NjMzMTc4Mzc4NjE4MiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 7f8d98d2ae02036a251cd0b6fcf5f778ac267f6d60a69dc0aac7e590a8f0c435 |
| hovercard-subject-tag | issue:1359382868 |
| 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/8662/issue_layout |
| twitter:image | https://opengraph.githubassets.com/46049a13d5275768fe414e1df69f224a037461a87af885bc81314ef61217618f/python/typeshed/issues/8662 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/46049a13d5275768fe414e1df69f224a037461a87af885bc81314ef61217618f/python/typeshed/issues/8662 |
| og:image:alt | ref: python-jsonschema/jsonschema#997 I expected the following code to work when it comes to typing from typing import Any, Mapping import jsonschema store: dict[str, Mapping[str, Any]] = {} jsonsc... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | kratsg |
| hostname | github.com |
| expected-hostname | github.com |
| None | c0dd5f5d6f515a591019ecd66df2c4eab3379c2d3b0777568a90d8c7ae10b79e |
| 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 | 729d8cda69b3d267995675dfbf89ff27ccf61bf6 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width