time-to-botec

Benchmark sampling in different programming languages
Log | Files | Refs | README

repl.txt (747B)


      1 
      2 {{alias}}( value )
      3     Tests if a value is iterator-like.
      4 
      5     An iterator protocol-compliant object is an object having a `next` method
      6     which adheres to the iterator protocol.
      7 
      8     As full iterator compliance is impossible to achieve without evaluating an
      9     iterator, this function checks *only* for interface compliance.
     10 
     11     Parameters
     12     ----------
     13     value: any
     14         Value to test.
     15 
     16     Returns
     17     -------
     18     bool: boolean
     19         Boolean indicating whether value is iterator-like.
     20 
     21     Examples
     22     --------
     23     > var obj = {
     24     ...     'next': function noop() {}
     25     ... };
     26     > var bool = {{alias}}( obj )
     27     true
     28     > bool = {{alias}}( {} )
     29     false
     30     > bool = {{alias}}( null )
     31     false
     32 
     33     See Also
     34     --------
     35