• Kirill Smelkov's avatar
    golang_str: Infrastructure to patch builtin types · 34667355
    Kirill Smelkov authored
    _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.
    34667355
_golang_str.pyx 13.8 KB