Created
November 9, 2018 07:28
-
-
Save davisagli/ee052842c1d6de28d1d935ad7f3efa7b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Change set.__module__ to 'builtins' | |
# so that it will pickle with the right module for Python 3 | |
from ctypes import Structure, c_ssize_t, c_void_p, c_char_p | |
class PyTypeObject(Structure): | |
_fields_ = [ | |
('ob_refcnt', c_ssize_t), | |
('ob_type', c_void_p), | |
('ob_size', c_ssize_t), | |
('tp_name', c_char_p), | |
] | |
set_type = PyTypeObject.from_address(id(set)) | |
set_type.tp_name = 'builtins.set' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment