Skip to content Skip to sidebar Skip to footer
Showing posts with the label Enums

How To Iterate Over Python Enum Ignoring "deprecated" Ones?

If I have an enum class set up like this class fruits(enum.IntEnum): apples = 0 bananas = … Read more How To Iterate Over Python Enum Ignoring "deprecated" Ones?

Best Way To Extend Httpstatus With Custom Value

I am extending HTTPStatus with a custom value: from http import HTTPStatus HTTPStatus.MY_CUSTOM_SE… Read more Best Way To Extend Httpstatus With Custom Value

Sphinx Not Documenting Complex Enum Classes

In my code I have some classes that are complex Enum types. For example: class ComplexEnum(SomeOthe… Read more Sphinx Not Documenting Complex Enum Classes

'function' Object Has No Attribute 'value' When Class Function Is Used In Enum Values

I just want to achieve some extra which is not there in operator module of python like not_contain.… Read more 'function' Object Has No Attribute 'value' When Class Function Is Used In Enum Values

Difference Between Enum And Intenum In Python

I came across a code that looked like this: class State(IntEnum): READY = 1 IN_PROGRESS = 2… Read more Difference Between Enum And Intenum In Python

How To Iterate Within A Specific Range Of Enum Class With Hex Value In Python

I have the following class enum: class LogLevel(Enum): level_1 = 0x30 level_2 = 0x31 le… Read more How To Iterate Within A Specific Range Of Enum Class With Hex Value In Python