Title: Decide the fate of `enum.bin` · Issue #136763 · python/cpython · GitHub
Open Graph Title: Decide the fate of `enum.bin` · Issue #136763 · python/cpython
X Title: Decide the fate of `enum.bin` · Issue #136763 · python/cpython
Description: First, this module defines a bin function that is not present in the documentation. Such a method should be documented or made private. Indeed, it would feel weird for a user to use from enum import * and have the standard bin() function...
Open Graph Description: First, this module defines a bin function that is not present in the documentation. Such a method should be documented or made private. Indeed, it would feel weird for a user to use from enum impor...
X Description: First, this module defines a bin function that is not present in the documentation. Such a method should be documented or made private. Indeed, it would feel weird for a user to use from enum impor...
Opengraph URL: https://github.com/python/cpython/issues/136763
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Decide the fate of `enum.bin`","articleBody":"First, this module defines a bin function that is not present in the documentation. Such a method should be documented or made private. Indeed, it would feel weird for a user to use `from enum import *` and have the standard bin() function overriden.\n\nThe commit that introcuced this function is #https://github.com/python/cpython/commit/7aaeb2a3d682ecba125c33511e4b4796021d2f82\nThis function only appears to have be used by the commit for Flag._missing_, where it's present two or three times\n\nThus, i guess this function was created for internal code refactorisation.\nThis is a normal use for a function. However, a function used for this should not be available to an importer of enum. It should especially not be able to cause problems in the code of the importer. \n\nI suggest renaming the function _bin and replacing existing occurences of call to this function by a call to its new name.\n\nBroadlier speaking, I do not see a valid reason for the import of builtins in the enum module, because it is bad practice: the only use case is builtin functions having been redefined inside the code, which is a source of confusions and errors and therefore not good practice.\n\nThis probably means they're other problems like this in the enum module. One I found is the decorator `@property`. I did not investigated this one further. ","author":{"url":"https://github.com/azerty-svg","@type":"Person","name":"azerty-svg"},"datePublished":"2025-07-18T18:18:18.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":16},"url":"https://github.com/136763/cpython/issues/136763"}
| 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:38cb0ac9-c086-b60e-d72a-26b4f8b01dca |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | C5EC:16BCD3:901177F:C9ABE91:6A508E6B |
| html-safe-nonce | 4530996ff9e34c3391ddbbfe59a91a245155a472d6ace326fbfa0fb2dd3b670e |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDNUVDOjE2QkNEMzo5MDExNzdGOkM5QUJFOTE6NkE1MDhFNkIiLCJ2aXNpdG9yX2lkIjoiODcxNTU3MjYxNzgwMzc2MzMwNyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 3b07f7390380eafe6a31d4648f7c86b151f78fb423c442ecc8c2548371a8fd8a |
| hovercard-subject-tag | issue:3244005692 |
| 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/cpython/136763/issue_layout |
| twitter:image | https://opengraph.githubassets.com/05a8cbde0518bf5d0d16450ee70e32d3126ff10cc8fedb34854cecb49ab35232/python/cpython/issues/136763 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/05a8cbde0518bf5d0d16450ee70e32d3126ff10cc8fedb34854cecb49ab35232/python/cpython/issues/136763 |
| og:image:alt | First, this module defines a bin function that is not present in the documentation. Such a method should be documented or made private. Indeed, it would feel weird for a user to use from enum impor... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | azerty-svg |
| hostname | github.com |
| expected-hostname | github.com |
| None | d6dc8294eb500fa36bbc57472d61fe87c522f9c3c1d64f70f4926f66a66a7efb |
| turbo-cache-control | no-preview |
| go-import | github.com/python/cpython git https://github.com/python/cpython.git |
| octolytics-dimension-user_id | 1525981 |
| octolytics-dimension-user_login | python |
| octolytics-dimension-repository_id | 81598961 |
| octolytics-dimension-repository_nwo | python/cpython |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 81598961 |
| octolytics-dimension-repository_network_root_nwo | python/cpython |
| 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 | 7ac0ad2f2c7e4b9056617355fd9e33e22b0c8df9 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width