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

Is There A Python Class/enum For Flag/bit Mask Operations?

I know of base classes Enum and IntEnum. Both are very helpful but I miss features for flag operati… Read more Is There A Python Class/enum For Flag/bit Mask Operations?

How To Print Combined Flag In The Same Way As Name Property

In Python, you can use the Flag class to represent combinations of values. class Color(Flag): R… Read more How To Print Combined Flag In The Same Way As Name Property

Interpret An Integer As Enum Flags

Suppose I have a Flag enum like this: From enum import Flag class suspicion(Flag): TOT_PCNT_LO… Read more Interpret An Integer As Enum Flags

Iterate Enum In Definition Order In Python 2

I'm using the backported Enum functionality from python 3.4 with python 2.7: > python --vers… Read more Iterate Enum In Definition Order In Python 2

How Do I Correctly Call A Function That Takes A "custom Enum" As Argument Using Ctypes And Ctypes Based Enums?

I really hope some Python/Ctypes/C expert can help me with this one, it is probably my lack of know… Read more How Do I Correctly Call A Function That Takes A "custom Enum" As Argument Using Ctypes And Ctypes Based Enums?

How Do I Properly Document Python Enum Elements?

I understand that I can add a Python docstring to an enum type as I would any other class. But how … Read more How Do I Properly Document Python Enum Elements?

Pyqt5 && Qml Exporting Enum

Is it possible to export enum from Python to QML instance? class UpdateState(): Nothing = 0 … Read more Pyqt5 && Qml Exporting Enum

Returning A List Of Enums With String Values With Graphene

This is using Python and the Graphene library. I want to provide a list of constants to my front-en… Read more Returning A List Of Enums With String Values With Graphene