Hacker News new | ask | show | jobs
by Joeboy 4406 days ago
default_reasons seems like an odd choice of name, when there is no other kind of reasons. I'd suggest something like reason_choices or reason_options.

Edit: also I'd make it a tuple rather than either a dict or a list.

1 comments

Don't make it a tuple. A tuple indicates heterogenous data (a record), while a list indicates a sequence of data.

If nothing else, use lists because the syntax means it stays as a list even if you someday remove all but one option and forget to leave a comma, eg.

  REASONS = [
    'leaves on the line'
  ]
vs

  REASONS = (
    'leaves on the line'
  )
After DDGing a bit it seems like you have a point. I did not know about that semantic difference between tuples and lists in python. It seems like this difference is entirely about the meaning conveyed to a human reader, rather than any technical difference. My guess would be that tuples are generally more efficient, but I have no actual data to back that up with.