@@ -0,0 +1,1033 @@
+import sys%0Aimport unittest%0Afrom dynd import nd, ndt%0A%0Aclass TestTypePatternMatch(unittest.TestCase):%0A    def test_simple(self):%0A        self.assertTrue(ndt.int32.matches(ndt.int32))%0A        self.assertTrue(ndt.int16.matches('T'))%0A        self.assertTrue(ndt.int16.matches('... * T'))%0A        self.assertTrue(ndt.int16.matches('A... * T'))%0A        self.assertTrue(ndt.type('strided * var * int').matches('M * A... * N * T'))%0A        self.assertFalse(ndt.type('strided * int').matches('M * A... * N * T'))%0A%0A    def test_tuple(self):%0A        pat = ndt.type('(T, ?T, 3 * T, A... * S)')%0A        self.assertTrue(ndt.type('(int, ?int, 3 * int, real)').matches(pat))%0A        self.assertTrue(ndt.type('(string, ?string, 3 * string, 10 * complex)').matches(pat))%0A        self.assertFalse(ndt.type('(string, ?int, 3 * string, 10 * complex)').matches(pat))%0A        self.assertFalse(ndt.type('(string, string, 3 * string, 10 * complex)').matches(pat))%0A        self.assertFalse(ndt.type('(string, ?string, 4 * string, 10 * complex)').matches(pat))%0A

Add some python tests of the type pattern matching