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 5fe79c1 commit 76da1bd
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion crates/erg_compiler/lib/core/_erg_bytes.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
class Bytes(bytes):
def try_new(*b): # -> Result[Nat]
return Bytes(bytes(*b))
if isinstance(arr, bytes):
return Bytes(bytes(*b))
else:
return Error("not a bytes")

def __getitem__(self, index_or_slice):
from _erg_range import Range
Expand Down

0 comments on commit 76da1bd

Please sign in to comment.