mirror of
https://github.com/pybricks/pybricks-api.git
synced 2026-09-12 09:37:25 +00:00
This adds a _PybricksEnum base class for all enums. In Pybricks MicroPython, we don't have an Enum class, but rather just simple lookup tables. The __repr__() method prints the enum values like the Pybricks MicroPython implementation and also causes sphinx doc to correctly print the value when used as a default value for aguments. The __dir__() method is overloaded for both the instance and the class to match what is seen in Pybricks MicroPython. This should help hide things from code Python completion that are not present in MicroPython.