Issue #28959: Added private macro PyDict_GET_SIZE for retrieving the size of dict.
diff --git a/Objects/setobject.c b/Objects/setobject.c
index b7e0617..59ed795 100644
--- a/Objects/setobject.c
+++ b/Objects/setobject.c
@@ -981,7 +981,7 @@
         PyObject *value;
         Py_ssize_t pos = 0;
         Py_hash_t hash;
-        Py_ssize_t dictsize = PyDict_Size(other);
+        Py_ssize_t dictsize = PyDict_GET_SIZE(other);
 
         /* Do one big resize at the start, rather than
         * incrementally resizing as we insert new keys.  Expect