Skip to content

Commit

Permalink
Update _erg_bytes.py
Browse files Browse the repository at this point in the history
  • Loading branch information
mtshiba committed Feb 18, 2024
1 parent 3869dd0 commit 9b9be7f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion crates/erg_compiler/lib/core/_erg_bytes.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
from _erg_result import Error
from _erg_range import Range

class Bytes(bytes):
def try_new(b): # -> Result[Nat]
if isinstance(b, bytes):
Expand All @@ -6,7 +9,6 @@ def try_new(b): # -> Result[Nat]
return Error("not a bytes")

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):
Expand Down

0 comments on commit 9b9be7f

Please sign in to comment.