title: What is the correct type hint for an empty list?
body: <p>What is the correct type hint for <code>x = []</code>?</p>
  
  <p>The type checker in my PyCharm editor flagged this as an error: </p>
  
  <pre><code>labelframes: List[ttk.LabelFrame] = []
  </code></pre>
  
  <p>'Optional' is not an option as in:</p>
  
  <pre><code>labelframes: List[Optional[ttk.LabelFrame]] = []
  </code></pre>
  
  <p>because the documentation for <code>typing.Optional</code> states that this is equivalent to:</p>
  
  <pre><code>labelframes: List[Union[ttk.LabelFrame, None]] = []
  </code></pre>
  
  <p>and <code>[None]</code> is not <code>[]</code>.</p>
  
  <p>I ought to mention that PyCharm doesn't like this either:</p>
  
  <pre><code>labelframes: List[Union[ttk.LabelFrame, None]] = [None]
  </code></pre>
  
  <p>Whatever type hint I try. PyCharm flags it as an error with, 
  "Expected to return <strong>my type hint here</strong>, got no return," so I tried:</p>
  
  <pre><code>labelframes: Optional[List[ttk.LabelFrame, None]] = []
  </code></pre>
  
  <p>That didn't work. </p>
  
  <p>I am aware that PEP 526 has numerous examples which follow the pattern:</p>
  
  <pre><code>x: List[str] = []
  </code></pre>