List boundaries - what is the most Pythonic way?
<p>I have a Python list and I want to check if a given index is out of bounds. Since I'm accepting user input I want to restrict the index to integers greater than or equal to 0. What is the most Pythonic way to do this? Currently, this is my solution:</p>

<pre><code>def get_current_setting(self, slot):
    if slot &lt; 0 or slot &gt; len(self.current_settings) - 1:
        raise Exception("Error message...")
    return self.current_settings[slot]
</code></pre>
