• Kirill Smelkov's avatar
    golang_str: Make bytes(bstr) -> bstr, unicode(ustr) -> ustr · b7cda092
    Kirill Smelkov authored
    In other words casting to bytes/unicode preserves pygolang string to
    remain pygolang string.
    
    Without the changes to bstr/ustr added test fails as e.g.
    
        >       assert bytes  (bs) is bs
        E       AssertionError: assert b'\xd0\xbc\xd0\xb8\xd1\x80' is b'\xd0\xbc\xd0\xb8\xd1\x80'
        E        +  where b'\xd0\xbc\xd0\xb8\xd1\x80' = bytes(b'\xd0\xbc\xd0\xb8\xd1\x80')
    
    in other words bytes(bstr) was creating a copy and changing type to bytes.
    b7cda092
_golang_str.pyx 12.3 KB