Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- For object in objects:
- # object.id is the Pyrel-generated ID, safe to serialize.
- idToPyrelId[id(object)] = object.id
- ...
- # Later will want to examine e.g.
- # <bound method Foo.foo of <__main__.Foo instance at 0x1004a74d0>>
- # and look up 0x1004a74d0 to get the object's Pyrel-generated ID
- for key, value in thingSerialization.iteritems():
- if key looks like a function pointer:
- get the Python ID of the object
- get the name of the function
- replace key with (idToPyrelId[object ID], function name)
- ditto for value
- recurse as needed
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement