Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

The PEP mentions these explicit values allow the creation of aliases in a very natural way.

  class Keys(Enum):
      space = 1
      esc = 2
      enter = 3
      return = 3 # Alias to "enter".
Also, less magic.


return = 3 shouldn't work.


you know what they meant...




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: