golang_str: Infrastructure to patch builtin types
_patch_slot(typ, slotname, func) installs func into typ's dict[slotname]. For example in the next patch we will need to adjust unicode.__eq__ on py2 not to reject bstr with always assuming that `unicode == bstr` is False. We will do it via patching unicode.__eq__ to first check rhs or whether it is bstr and handling that with our code, while tailing to original unicode.__eq__ for all other types.
Showing
Please register or sign in to comment