updated from Atlas

This commit is contained in:
Luciano Ramalho
2015-04-15 04:48:25 -03:00
parent f4cdee2447
commit f86aee2785
78 changed files with 587 additions and 333 deletions

View File

@@ -1,14 +0,0 @@
# BEGIN ARITPROG_ITERTOOLS
import itertools
def aritprog_gen(begin, step, end=None):
if end is not None and begin >= end:
return
yield type(begin + step)(begin)
tail_gen = itertools.count(begin+step, step)
if end is not None:
tail_gen = itertools.takewhile(lambda n: n < end, tail_gen)
for x in tail_gen:
yield x
# END ARITPROG_ITERTOOLS

View File

@@ -1,13 +0,0 @@
# BEGIN ARITPROG_ITERTOOLS
import itertools
def aritprog_gen(begin, step, end=None):
if end is not None and begin >= end:
return
yield type(begin + step)(begin)
tail_gen = itertools.count(begin+step, step)
if end is not None:
tail_gen = itertools.takewhile(lambda n: n < end, tail_gen)
yield from tail_gen
# END ARITPROG_ITERTOOLS