Why do I get KeyError: 500?
<pre><code>def my_func(self, limit, list_type, **args):
    type2abbr = {"allcategories": "ac", "categorymembers":"cm"}
    abbr = type2abbr[list_type]
    yield abbr
if __name__ == "__main__":
    abbr = my_func(500, "categorymembers")
    print abbr
</code></pre>

<p>When I try to run this code, it  gives the trceback:</p>

<pre>
    Traceback (most recent call last):
      File "dater.py", line 72, in 
        bot.start()
      File "dater.py", line 56, in start
        for title, text in self.pages:
      File "dater.py", line 25, in page_generator
        for item in self.cats:
      File "/home/ceradon/api.py", line 305, in list
        abbr = type2abbr[list_type]
    KeyError: 500
</pre>

<p>Can anyone help me figure this out please?</p>
