Title: Use PyStrRef for TypeAliasType name by walker84837 · Pull Request #6203 · RustPython/RustPython · GitHub
Open Graph Title: Use PyStrRef for TypeAliasType name by walker84837 · Pull Request #6203 · RustPython/RustPython
X Title: Use PyStrRef for TypeAliasType name by walker84837 · Pull Request #6203 · RustPython/RustPython
Description: This MR changes TypeAliasType so that it uses a PyStrRef object for its name field instead of a PyObjectRef. Previously, the name field was a PyObjectRef. Although PyObjectRef is flexible, using a more specific type, like PyStrRef, improves transparency and type safety. Changes include: As mentioned, updating TypeAliasType.name from PyObjectRef to PyStrRef. Changing TypeAliasType::new() and __name__ getter to handle PyStrRef. Adding small type checks in: vm/src/frame.rs vm/src/stdlib/typing.rs to enforce that the TypeAliasType name is a string. Since the type of name is now a PyStrRef, the repr_str implementation for TypeAliasType was simplified by using PyStrRef::as_str() directly. Summary by CodeRabbit Bug Fixes Strengthened validation for TypeAliasType names so non-string names now produce a clear "TypeAliasType name must be a string" error. Improved consistency of TypeAliasType construction and string representation, reducing confusion when inspecting or creating type aliases.
Open Graph Description: This MR changes TypeAliasType so that it uses a PyStrRef object for its name field instead of a PyObjectRef. Previously, the name field was a PyObjectRef. Although PyObjectRef is flexible, using a ...
X Description: This MR changes TypeAliasType so that it uses a PyStrRef object for its name field instead of a PyObjectRef. Previously, the name field was a PyObjectRef. Although PyObjectRef is flexible, using a ...
Opengraph URL: https://github.com/RustPython/RustPython/pull/6203
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/checks(.:format) |
| route-controller | pull_requests |
| route-action | checks |
| fetch-nonce | v2:5ed9f2e8-5cc7-951a-aa9a-5d82fa730b29 |
| current-catalog-service-hash | 87dc3bc62d9b466312751bfd5f889726f4f1337bdff4e8be7da7c93d6c00a25a |
| request-id | E2DE:37B15B:45CA78:631DAE:696A4FE2 |
| html-safe-nonce | 2476b199151b978884ebbc1db25836b3d147584ed52a08618fd11d9a46be7227 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFMkRFOjM3QjE1Qjo0NUNBNzg6NjMxREFFOjY5NkE0RkUyIiwidmlzaXRvcl9pZCI6IjU3MDE2NTAxMTE3NjY2MTM5ODYiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | f1ce7a2162b5b866d30d4577c7a59e29219acc71fb54b17f35d9d9f51ccaad47 |
| hovercard-subject-tag | pull_request:2931543256 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,checks,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/6203/checks |
| twitter:image | https://avatars.githubusercontent.com/u/68739688?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/68739688?s=400&v=4 |
| og:image:alt | This MR changes TypeAliasType so that it uses a PyStrRef object for its name field instead of a PyObjectRef. Previously, the name field was a PyObjectRef. Although PyObjectRef is flexible, using a ... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 3f871c8e07f0ae1886fa8dac284166d28b09ad5bada6476fc10b674e489788ef |
| turbo-cache-control | no-cache |
| 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 full-width-p-0 |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 63c426b30d262aba269ef14c40e3c817b384cd61 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width