title: How to limit the permitted values that can be passed to a method parameter (Using Type Hinting to allow Static Code Analysis)
body: <p>In Python 3, I want to limit the permitted values that are passed to this method:</p>
  
  <pre><code>my_request(protocol_type, url)
  </code></pre>
  
  <p>Using type hinting I can write:</p>
  
  <pre><code>my_request(protocol_type: str, url: str)
  </code></pre>
  
  <p>so the protocol and url are limited to strings, but how can I validate that <code>protocol_type</code> accepts only limited set of values, e.g. <code>'http'</code> and <code>'https'</code>?</p>