Decide the fate of `enum.bin`
@ethanfurman がすでに取り組んでいます。
2025年7月18日 から。
- 主要言語
- Python
- スター
- 77.2k
- フォーク
- 36k
- PR マージ指標
- PR 指標を取得中
説明
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.
The commit that introcuced this function is #https://github.com/python/cpython/commit/7aaeb2a3d682ecba125c33511e4b4796021d2f82
This function only appears to have be used by the commit for Flag.missing, where it's present two or three times
Thus, i guess this function was created for internal code refactorisation.
This 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.
I suggest renaming the function _bin and replacing existing occurences of call to this function by a call to its new name.
Broadlier 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.
This 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.
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
評価
この issue はまだ評価されていません。