mirror of
https://github.com/github/codeql.git
synced 2026-02-24 19:03:50 +01:00
8 lines
212 B
Python
8 lines
212 B
Python
class C:
|
|
def __getitem__(self, idx):
|
|
if self.idx < 0:
|
|
# BAD: Should raise a KeyError or IndexError instead.
|
|
raise ValueError("Invalid index")
|
|
return self.lookup(idx)
|
|
|