#NEWLINE# def frange( limit1 , limit2 = None , increment = 1.0 ) : #NEWLINE# #INDENT# '\n  Range function that accepts floats (and integers).\n\n  >>> frange(-2, 2, 0.1)\n  >>> frange(10)\n  >>> frange(10, increment=0.5)\n\n  The returned value is an iterator.  Use list(frange(...)) for a list.\n  ' #NEWLINE# if ( limit2 is None ) : #NEWLINE# #INDENT# ( limit2 , limit1 ) = ( count , 0.0 ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# limit1 = float ( limit1 ) #NEWLINE# #UNINDENT# count = int ( ceil ( ( ( limit2 - limit1 ) / increment ) ) ) #NEWLINE# return ( ( limit1 + ( n * increment ) ) for n in xrange ( 0 , count ) )