projects
/
nmutil.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
speed up ==, hash, <, >, <=, and >= for plain_data
[nmutil.git]
/
src
/
nmutil
/
test
/
__init__.py
1
class
StepLimiter
:
2
def
__init__
(
self
,
limit
=
100000
):
3
self
.
limit
=
limit
4
self
.
step_count
=
0
5
assert
self
.
step_count
<
self
.
limit
,
"step count limit reached"
6
7
def
step
(
self
):
8
self
.
step_count
+=
1
9
assert
self
.
step_count
<
self
.
limit
,
"step count limit reached"
10
11
def
__iter__
(
self
):
12
return
self
13
14
def
__next__
(
self
):
15
self
.
step
()
16
return None