mirror of
https://github.com/mtshiba/pylyzer.git
synced 2025-07-12 03:24:59 +00:00
19 lines
372 B
Python
19 lines
372 B
Python
from collections.abc import Sequence
|
|
|
|
class Vec(Sequence):
|
|
x: list[int]
|
|
|
|
def __init__(self):
|
|
self.x = []
|
|
|
|
def __getitem__(self, i: int) -> int:
|
|
return self.x[i]
|
|
|
|
def __iter__(self):
|
|
return iter(self.x)
|
|
|
|
def __len__(self) -> int:
|
|
return len(self.x)
|
|
|
|
def __contains__(self, i: int) -> bool:
|
|
return i in self.x
|