Simulating Lisp's :keywords in Python
<p>I want to do something like that:</p>

<pre><code>action = :default

if some_condition1:
    action = :do_something

if some_condition2:
    action = :do_other_thing

...

if action == :default:
   one_reaction()
elif action == :do_something:
   other_reaction()
...
</code></pre>

<p>What should I use to represent actions choice?</p>

<p>Variants that come to mind:</p>

<ul>
<li><p>Create enumeration</p>

<pre><code>class MyActions:
    DEFAULT=1
    SO_SOMETHING=2
    SO_OTHER_THING=3
</code></pre>

<p>inconvenient, need to scroll to and fro and "register" new action choices.</p></li>
<li><p>Use magic numbers. Not good.</p></li>
<li>Use strings.</li>
</ul>
