got distracted and made a repl framework.......
This commit is contained in:
parent
0a2d9a5694
commit
c18aa29c58
5 changed files with 227 additions and 17 deletions
8
bcrypter/lib/other.py
Normal file
8
bcrypter/lib/other.py
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
'''
|
||||
Implements a safe way of indexing a list.
|
||||
'''
|
||||
def tryget(L: list[Any], i: int, default: Any | None = None) -> Any:
|
||||
try:
|
||||
return L[i]
|
||||
except IndexError:
|
||||
return default
|
||||
Loading…
Add table
Add a link
Reference in a new issue