On Wed, Sep 14, 2016 at 2:22 AM, nate lust <natel...@linux.com> wrote:
> I have written a functional reference implementation for the proposed
> continue class syntax which can be found at
> https://raw.githubusercontent.com/natelust/continueClassCpythonPatch/master/continueClass.patch
> .

AIUI, the central core to this code is:

+    /* Iterate over the dictionary which was populated in the eval call.
+       Set an attribute in the class corresponding to the key, item pair
+       generated by the eval statement */
+    dict_size = PyDict_Size(newdict);
+    dictkeys = PyDict_Keys(newdict);
+    for (i = 0; i < dict_size; i++ ){
+        key = PyList_GetItem(dictkeys, i);
+        item = PyDict_GetItem(newdict, key);
+        PyObject_SetAttr(aclass, key, item);
+    }

How does this handle special elements such as __module__, __dict__,
and __doc__? Does it overwrite them?

ChrisA
_______________________________________________
Python-ideas mailing list
Python-ideas@python.org
https://mail.python.org/mailman/listinfo/python-ideas
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to