add obj_ref code & py doctest