(str)
return bytes(base), extended
3.1 Basic code point segregation
3.1 Basic code point segregation
3 . 1 Basic code point segregation
def segregate(str):
    """3.1 Basic code point segregation"""
    base = bytearray()
    extended = set()
    for c in str:
        if ord(c) < 128:
            base.append(ord(c))
        else:
            extended.add(c)
    extended = sorted(extended)
    return bytes(base), extended
def segregate ( str ) : base = bytearray ( ) extended = set ( ) for c in str : if ord ( c ) < 128 : base . append ( ord ( c ) ) else : extended . add ( c ) extended = sorted ( extended ) return bytes ( base ) , extended