diff --git a/.github/workflows/generate.yml b/.github/workflows/generate.yml index 30d1a76..ed22574 100644 --- a/.github/workflows/generate.yml +++ b/.github/workflows/generate.yml @@ -84,7 +84,7 @@ jobs: needs: build strategy: matrix: - python-version: [ '3.6.x', '3.7.x', '3.8.x', '3.9.x', '3.10.0-rc.2' ] + python-version: [ '3.6', '3.7', '3.8', '3.9', '3.10', '3.11' ] name: Python ${{ matrix.python-version }} test steps: - uses: actions/checkout@v2 diff --git a/ariths_gen/wire_components/buses.py b/ariths_gen/wire_components/buses.py index e7589a1..dba69d4 100644 --- a/ariths_gen/wire_components/buses.py +++ b/ariths_gen/wire_components/buses.py @@ -76,6 +76,9 @@ class Bus(): Wire: Returning wire from the bus. """ return self.bus[wire_index] + + def __getitem__(self, i): + return self.bus[i] # Connecting output wire of the inner circuit component to desired position in the described circuit's output bus def connect(self, bus_wire_index: int, inner_component_out_wire: Wire, inserted_wire_desired_index: int = -1): diff --git a/tests/test_all.py b/tests/test_all.py index 4c63e31..1f6d040 100644 --- a/tests/test_all.py +++ b/tests/test_all.py @@ -186,7 +186,7 @@ def test_direct(): self.b = Bus(prefix=b.prefix, wires_list=b.bus) self.out = Bus(self.prefix+"_out", self.N+1) - a_0 = self.a.get_wire(0) + a_0 = self.a[0] b_0 = self.b.get_wire(0) or_1 = OrGate(a_0, b_0, prefix=self.prefix+"_or"+str(self.get_instance_num(cls=OrGate)), parent_component=self)