| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
|
I'm not a fan of using private functionality here; I'd rather this enum work the same way as an equivalent user-created way. If we think this is the right way to make an enum, we should make this decorator public. |
Sorry, something went wrong.
|
My understanding is it's an intentionally internal-only decorator (eg used in ast and re). @ethanfurman is probably best placed to comment. A |
Sorry, something went wrong.
Sorry, something went wrong.
|
I don't want to do this. If we think creating enum classes is too slow, we should make a public API for faster enums. |
Sorry, something went wrong.
|
Creating enums with EnumType is definitely slower, and _simple_enum was created for stdlib use for areas where every bit of performance was desired (such as in enum.py itself, re, and a few others). |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
We can use the internal _simple_enum class decorator here, for slight faster enum creation. I don't think there's any good way to entirely avoid/defer the enum import, though.
A