title: Python type-hint friendly type that constrains possible values
body: <p>I want a python type-hint friendly way to create a Type that has constrained range of values.</p>
  
  <p>For example, a <em>URL</em> Type based on type <code>str</code> that would only accept strings that look like an "http" URL.</p>
  
  <pre><code># this code is made up and will not compile
  class URL(typing.NewType('_URL', str)):
      def __init__(self, value: str, *args, **kwargs):
          if not (value.startswith('http://') or value.startswith('https://')):
              raise ValueError('string is not an acceptable URL')
  </code></pre>