erg_compiler 0.6.23

Centimetre: the Erg compiler
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
class Bytes(bytes):
    def try_new(*b):  # -> Result[Nat]
        return Bytes(bytes(*b))

    def __getitem__(self, index_or_slice):
        from _erg_range import Range
        if isinstance(index_or_slice, slice):
            return Bytes(bytes.__getitem__(self, index_or_slice))
        elif isinstance(index_or_slice, Range):
            return Bytes(bytes.__getitem__(self, index_or_slice.into_slice()))
        else:
            return bytes.__getitem__(self, index_or_slice)