I've been using dictionary keys as membership markers. Is this a good idea?
<p>For instance, I have a document that has a pile of control codes that I need to manually specify replacements for. I basically write a script that prints out the list of codes. Easy. </p>

<p>Now I've been using a dictionary's key to store the membership. If the code exists, then I set the dictionary value to something, and then I just return the keys of that dictionary. This strikes me as a little wasteful. Is there any better way of doing things? </p>
