poggingfish / pogcpu

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

use enums

UserUNP opened this issue · comments

commented

python can use enums..

https://stackoverflow.com/questions/23951641/how-to-convert-int-to-enum-in-python

>>> from enum import Enum
>>> class Fruit(Enum):
...     Apple = 4
...     Orange = 5
...     Pear = 6
... 
>>> Fruit(5)
<Fruit.Orange: 5>
commented

i meant for the cpu.py file

**
image
**

commented

can also do Fruit["BRUH"] to give you it's value "moner"

can also do Fruit["BRUH"] to give you it's value "moner"

Ill work on this later!!