{"id":23675,"library":"enumb","title":"enumb","description":"A lightweight, Pythonic enum library that provides concise enum definitions with advanced features like bitwise operations, aliases, and iteration helpers. Current version: 0.1.5. Release cadence: sporadic.","status":"active","version":"0.1.5","language":"python","source_language":"en","source_url":"https://github.com/niccokunzmann/enumb","tags":["enum","enums","pythonic","lightweight","bitwise"],"install":[{"cmd":"pip install enumb","lang":"bash","label":"Install from PyPI"}],"dependencies":[],"imports":[{"note":"Python's standard library has 'enum.Enum', not 'enumb.Enum'. Using the wrong import will import the standard Enum, not enumb's enhanced version.","wrong":"from enum import Enum","symbol":"Enum","correct":"from enumb import Enum"}],"quickstart":{"code":"from enumb import Enum\n\nclass Color(Enum):\n    RED = 1\n    GREEN = 2\n    BLUE = 3\n\nprint(Color.RED)\nprint(Color.RED.name)\nprint(Color.RED.value)\n# Output:\n# Color.RED\n# RED\n# 1","lang":"python","description":"Define and use a simple enum with enumb."},"warnings":[{"fix":"Use 'from enumb import Enum' explicitly.","message":"Do not import Enum from the standard library 'enum' when intending to use enumb. The standard library Enum has different behavior (e.g., no automatic value assignment, different member iteration).","severity":"gotcha","affected_versions":"all"},{"fix":"If you need multiple inheritance, consider using enumb's EnumMeta carefully or use composition.","message":"enumb's Enum does not support inheritance from multiple Enum classes by default. Mixing enumb Enum with other classes may cause metaclass conflicts.","severity":"gotcha","affected_versions":">=0.1.0"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Ensure all base classes use the same metaclass. Either avoid mixing Enum types or define a custom metaclass that inherits from both metaclasses.","cause":"Trying to inherit from both enumb.Enum and another class that has a different metaclass (e.g., standard library enum.Enum).","error":"TypeError: metaclass conflict: the metaclass of a derived class must be a (non-strict) subclass of the metaclasses of all its bases"},{"fix":"Use the public API: .name (without underscores) to get the member name.","cause":"Using enumb's Enum but accessing attributes like _name_ which are internal to the standard library's EnumMeta. enumb uses different internal attributes.","error":"AttributeError: 'Color' object has no attribute '_name_'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}