Skip to content

Commit

Permalink
Import new version of awklite.
Browse files Browse the repository at this point in the history
  • Loading branch information
bje- committed Nov 20, 2024
1 parent d4136cf commit c4ccd87
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions awklite/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,10 @@ def __getitem__(self, key):
>>> flds = Fields([1,2,3])
>>> flds[1]
1
>>> flds[0]
Traceback (most recent call last):
...
IndexError: 0
"""
if not 0 < key <= len(self):
raise IndexError(key)
Expand All @@ -71,6 +75,10 @@ def __setitem__(self, key, value):
>>> flds[1] = 10
>>> flds == [10,2,3]
True
>>> flds[0] = 2
Traceback (most recent call last):
...
IndexError: 0
"""
if not 0 < key <= len(self):
raise IndexError(key)
Expand Down

0 comments on commit c4ccd87

Please sign in to comment.