PeanutButter
Loading...
Searching...
No Matches
PeanutButter.Utils.PyLike Class Reference

Provides a Python-like Range method. More...

Static Public Member Functions

static IEnumerable< int > Range (int stop)
 Produces a sequence of consecutive ints from zero to (stop - 1)
static IEnumerable< int > Range (int start, int stop)
 Produces a sequence of consecutive ints from start to (stop - 1)
static IEnumerable< int > Range (int start, int stop, int step)
 produces a sequence of ints from start to stop (not inclusive), stepping by step
static IEnumerable< Tuple< T1, T2 > > Zip< T1, T2 > (IEnumerable< T1 > left, IEnumerable< T2 > right)
 "Zips" two collections together so you can enumerate over them. The length of the enumeration is determined by the shortest collection
static IEnumerable< Tuple< T1, T2, T3 > > Zip< T1, T2, T3 > (IEnumerable< T1 > left, IEnumerable< T2 > middle, IEnumerable< T3 > right)
 "Zips" three collections together so you can enumerate over them. The length of the enumeration is determined by the shortest collection
static IEnumerable< Tuple< T1, T2, T3, T4 > > Zip< T1, T2, T3, T4 > (IEnumerable< T1 > first, IEnumerable< T2 > second, IEnumerable< T3 > third, IEnumerable< T4 > fourth)
 "Zips" four collections together so you can enumerate over them. The length of the enumeration is determined by the shortest collection

Detailed Description

Provides a Python-like Range method.

Member Function Documentation

◆ Range() [1/3]

IEnumerable< int > PeanutButter.Utils.PyLike.Range ( int start,
int stop )
static

Produces a sequence of consecutive ints from start to (stop - 1)

Parameters
start
stop
Returns

◆ Range() [2/3]

IEnumerable< int > PeanutButter.Utils.PyLike.Range ( int start,
int stop,
int step )
static

produces a sequence of ints from start to stop (not inclusive), stepping by step

Parameters
startfirst item to expect in sequence
stopgo no higher, young padawan!
stepstep up by this amount each time
Returns
Sequence of ints

◆ Range() [3/3]

IEnumerable< int > PeanutButter.Utils.PyLike.Range ( int stop)
static

Produces a sequence of consecutive ints from zero to (stop - 1)

Parameters
stopupper bound of sequence, not included in result
Returns
Sequence of ints

◆ Zip< T1, T2 >()

IEnumerable< Tuple< T1, T2 > > PeanutButter.Utils.PyLike.Zip< T1, T2 > ( IEnumerable< T1 > left,
IEnumerable< T2 > right )
static

"Zips" two collections together so you can enumerate over them. The length of the enumeration is determined by the shortest collection

Parameters
leftleft collection
rightright collection
Template Parameters
T1
T2
Returns
Enumeration over the collections (Tuple of T1, T2)

◆ Zip< T1, T2, T3 >()

IEnumerable< Tuple< T1, T2, T3 > > PeanutButter.Utils.PyLike.Zip< T1, T2, T3 > ( IEnumerable< T1 > left,
IEnumerable< T2 > middle,
IEnumerable< T3 > right )
static

"Zips" three collections together so you can enumerate over them. The length of the enumeration is determined by the shortest collection

Parameters
leftleft collection
middleright collection
rightright collection
Template Parameters
T1
T2
T3
Returns
Enumeration over the collections (Tuple of T1, T2, T3)

◆ Zip< T1, T2, T3, T4 >()

IEnumerable< Tuple< T1, T2, T3, T4 > > PeanutButter.Utils.PyLike.Zip< T1, T2, T3, T4 > ( IEnumerable< T1 > first,
IEnumerable< T2 > second,
IEnumerable< T3 > third,
IEnumerable< T4 > fourth )
static

"Zips" four collections together so you can enumerate over them. The length of the enumeration is determined by the shortest collection

Parameters
firstleft collection
secondright collection
thirdright collection
fourthright collection
Template Parameters
T1
T2
T3
T4
Returns
Enumeration over the collections (Tuple of T1, T2, T4)

The documentation for this class was generated from the following file:
  • source/Utils/PeanutButter.Utils/PyLike.cs