mininet-n-ryu-routing-algor.../counteriter.py

13 lines
230 B
Python
Raw Normal View History

2019-07-09 01:54:45 +00:00
#!/usr/bin/env python3
# -*- encoding: utf-8 -*-
class CounterIterator:
def __init__(self):
self._c = 0
def __iter__(self):
return self
def __next__(self):
self._c += 1
return self._c