Title: Issue with annotation six.byte2int starting 1.16.21.2 · Issue #9145 · python/typeshed · GitHub
Open Graph Title: Issue with annotation six.byte2int starting 1.16.21.2 · Issue #9145 · python/typeshed
X Title: Issue with annotation six.byte2int starting 1.16.21.2 · Issue #9145 · python/typeshed
Description: Hi, Starting 1.16.21.2 we have an issue with mypy failing for annotations of six.byte2int. We had this method: def byte2int(c: Union[bytes, int]) -> int: if isinstance(c, bytes): return six.byte2int(c) return c which was called the follo...
Open Graph Description: Hi, Starting 1.16.21.2 we have an issue with mypy failing for annotations of six.byte2int. We had this method: def byte2int(c: Union[bytes, int]) -> int: if isinstance(c, bytes): return six.byte2in...
X Description: Hi, Starting 1.16.21.2 we have an issue with mypy failing for annotations of six.byte2int. We had this method: def byte2int(c: Union[bytes, int]) -> int: if isinstance(c, bytes): return six.byte...
Opengraph URL: https://github.com/python/typeshed/issues/9145
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Issue with annotation six.byte2int starting 1.16.21.2","articleBody":"Hi,\r\nStarting 1.16.21.2 we have an issue with mypy failing for annotations of `six.byte2int`.\r\nWe had this method:\r\n\r\n```python \r\ndef byte2int(c: Union[bytes, int]) -\u003e int:\r\n if isinstance(c, bytes):\r\n return six.byte2int(c)\r\n return c\r\n```\r\n\r\nwhich was called the following way:\r\n`pp_fingerprint = \":\".join(\"{:02x}\".format(byte2int(c)) for c in fingerprint).upper()`\r\n\r\nThis used to work until now, but now we get this failure:\r\n`Argument 1 to \"byte2int\" has incompatible type \"bytes\"; expected \"SupportsGetItem[int, \u003cnothing\u003e]\"\r\n`\r\nIs this an issue with this release? Or are we supposed to fix our annotations in some way?\r\n\r\nThanks in advance!","author":{"url":"https://github.com/levincarmel","@type":"Person","name":"levincarmel"},"datePublished":"2022-11-10T08:31:45.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":3},"url":"https://github.com/9145/typeshed/issues/9145"}
| 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:a56d5971-84b3-a896-c26e-292f37ba5113 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | D3B4:1A7CC3:223B79:30EEB0:6A61E144 |
| html-safe-nonce | dbe8a689d40ffa192b5ac392f0166eb95aa341595734de74e48c617c2a104c23 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEM0I0OjFBN0NDMzoyMjNCNzk6MzBFRUIwOjZBNjFFMTQ0IiwidmlzaXRvcl9pZCI6IjQwNjcyNTc1Mzc3MjkyNTc3OTYiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 73f75b58223c2297260a8a5092899a3d61651e01b70d8c3d8ea093757fc00b2f |
| hovercard-subject-tag | issue:1443470342 |
| 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/9145/issue_layout |
| twitter:image | https://opengraph.githubassets.com/4ada8d8156401a72d008e816ad4c77f56661f57c6cc22692c4d9d99083b88d6f/python/typeshed/issues/9145 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/4ada8d8156401a72d008e816ad4c77f56661f57c6cc22692c4d9d99083b88d6f/python/typeshed/issues/9145 |
| og:image:alt | Hi, Starting 1.16.21.2 we have an issue with mypy failing for annotations of six.byte2int. We had this method: def byte2int(c: Union[bytes, int]) -> int: if isinstance(c, bytes): return six.byte2in... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | levincarmel |
| hostname | github.com |
| expected-hostname | github.com |
| None | b2de8c74e5e61e893155ba46ee41bc66170c1644cb795adefa8386d490f7781c |
| 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 | d1866027ded575df8a15c731dd8b9986c9483ceb |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width