Title: bytes: support keyword arguments in hex() by devyubin · Pull Request #8312 · RustPython/RustPython · GitHub
Open Graph Title: bytes: support keyword arguments in hex() by devyubin · Pull Request #8312 · RustPython/RustPython
X Title: bytes: support keyword arguments in hex() by devyubin · Pull Request #8312 · RustPython/RustPython
Description: This PR follows our AI policy
Summary
bytes/bytearray/memoryview's hex() rejected its sep and bytes_per_sep
arguments when passed by keyword, even though CPython accepts them either
positionally or by keyword.
b'\xb9\x01\xef'.hex(sep=':', bytes_per_sep=2)
# before: TypeError: Unexpected keyword argument sep
# after: 'b9:01ef' # matches CPython
Cause
hex() took its arguments as bare OptionalArg
Open Graph Description: This PR follows our AI policy Summary bytes/bytearray/memoryview's hex() rejected its sep and bytes_per_sep arguments when passed by keyword, even though CPython accepts them either positional...
X Description: This PR follows our AI policy Summary bytes/bytearray/memoryview's hex() rejected its sep and bytes_per_sep arguments when passed by keyword, even though CPython accepts them either positi...
Opengraph URL: https://github.com/RustPython/RustPython/pull/8312
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:5a7a87e7-fc1a-0570-e04c-76f450810fc0 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | C5C8:114B09:955284:CA82BF:6A601011 |
| html-safe-nonce | 9da9309b93d8ec8120caf980ae7b6c958538a14dfaa2153bfc032a13746f2e8f |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDNUM4OjExNEIwOTo5NTUyODQ6Q0E4MkJGOjZBNjAxMDExIiwidmlzaXRvcl9pZCI6IjIwOTIzNjY4MTk4MDY0MTY5MTMiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 139ad662db4137a0959c48948fef36538c731a391ec80fed1a3f020dc3c65649 |
| hovercard-subject-tag | pull_request:4081218705 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,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/RustPython/RustPython/pull/8312/files |
| twitter:image | https://avatars.githubusercontent.com/u/80163835?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/80163835?s=400&v=4 |
| og:image:alt | This PR follows our AI policy Summary bytes/bytearray/memoryview's hex() rejected its sep and bytes_per_sep arguments when passed by keyword, even though CPython accepts them either positional... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 48cb2ed2304f8ae5a4a05d6327faf70466c4c0d9dcbf7b9df76251ca9c669a90 |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/RustPython/RustPython git https://github.com/RustPython/RustPython.git |
| octolytics-dimension-user_id | 39710557 |
| octolytics-dimension-user_login | RustPython |
| octolytics-dimension-repository_id | 135201145 |
| octolytics-dimension-repository_nwo | RustPython/RustPython |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 135201145 |
| octolytics-dimension-repository_network_root_nwo | RustPython/RustPython |
| turbo-body-classes | logged-out env-production page-responsive full-width |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | cb0f10a384099e0765239a7cc220992cae52bdba |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width