mirror of
https://github.com/erg-lang/erg.git
synced 2025-08-04 18:58:30 +00:00
Update _erg_bytes.py
This commit is contained in:
parent
3869dd022e
commit
9b9be7fb2c
1 changed files with 3 additions and 1 deletions
|
@ -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):
|
||||
|
@ -6,7 +9,6 @@ class Bytes(bytes):
|
|||
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):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue