docstr: tp_version_tag should be unique assuming no overflow, even after
  clearing type cache.
docstr_tok: ["tp_version_tag","should","be","unique","assuming","no","overflow",",","even","after","clearing","type","cache","."]
code: def test_tp_version_tag_unique(self):
      """tp_version_tag should be unique assuming no overflow, even after
      clearing type cache.
      """
      # Check if global version tag has already overflowed.
      Y = type("Y", (), {})
      Y.x = 1
      Y.x  # Force a _PyType_Lookup, populating version tag
      y_ver = type_get_version(Y)
      # Overflow, or not enough left to conduct the test.
      if y_ver == 0 or y_ver > 0xFFFFF000:
          self.skipTest("Out of type version tags")
      # Note: try to avoid any method lookups within this loop,
      # It will affect global version tag.
      all_version_tags = []
      append_result = all_version_tags.append
      assertNotEqual = self.assertNotEqual
      for _ in range(30):
          _clear_type_cache()
          X = type("Y", (), {})
          X.x = 1
          X.x
          tp_version_tag_after = type_get_version(X)
          assertNotEqual(
              tp_version_tag_after, 0, msg="Version overflowed"
          )
          append_result(tp_version_tag_after)
      self.assertEqual(
          len(set(all_version_tags)),
          30,
          msg=f"{all_version_tags} contains non-unique versions",
      )
  
imports: import unittest
  import dis
  from test import support
  from test.support import import_helper
label_desc: Use image node_id 1 for calling the TypeCacheTests obj's underlying member method code with example usage: obj.test_tp_version_tag_unique() without return types