title: Is there a proper way in python to restrict the shape of a numpy array with pattern matching?
body: <p>Let <code>x</code> be a numpy array of shape (400, 2)</p>
  <p>I want the following to be true:</p>
  <pre><code>if x.shape == (*, 2):
      ...
  </code></pre>
  <p>if <code>x</code> would have the shape (300, 1) the condition should evaluate to false.<br/><br/>
  But apparently you neither can use <code>*</code> nor <code>_</code>.<br/>
  Is there any way in python to achieve such a pattern matching?</p>