Don't use python's collections.Set (#7875)
authorAlex Ozdemir <aozdemir@hmc.edu>
Wed, 5 Jan 2022 17:19:03 +0000 (09:19 -0800)
committerGitHub <noreply@github.com>
Wed, 5 Jan 2022 17:19:03 +0000 (17:19 +0000)
We used to use collections.Set.

Apparently this was an alias for collections.abc.Set. I can't find it
documented anywhere though, going as far back as Python 3.5. Perhaps it
was an undocumented left-over from when the collections.abc module was
split out from collections in Python 3.3?

At any rate, the alias appears broken in Python version 3.10.1.

Now we just use the builtin set type, which is what we wanted anyway,
I think.

src/api/python/cvc5.pxi

index ce9e98e6fedbea0a3d1fa9f9a95cd7d1502fd046..0ef8dce55498bf354696d989acb966f93394f7c1 100644 (file)
@@ -1,4 +1,4 @@
-from collections import defaultdict, Set
+from collections import defaultdict
 from fractions import Fraction
 from functools import wraps
 import sys
@@ -832,7 +832,7 @@ cdef class Solver:
         if unresolvedSorts == None:
             unresolvedSorts = set([])
         else:
-            assert isinstance(unresolvedSorts, Set)
+            assert isinstance(unresolvedSorts, set)
 
         sorts = []
         cdef vector[c_DatatypeDecl] decls