Panda3D
Classes | Functions
direct.showbase.LazySort Namespace Reference

Classes

class  LazySortTest
 

Functions

def itersorted (iterable, cmp=cmp, key=lambda x:x, reverse=False)
 
def P (i)
 
def test ()
 

Function Documentation

◆ itersorted()

def direct.showbase.LazySort.itersorted (   iterable,
  cmp = cmp,
  key = lambda x: x,
  reverse = False 
)
This function returns a generator object that yields sorted items from
'iterable'.

It implements a form of lazy sorting that's most useful in two cases:
1) When you only need the first few values in the sorted data.
2) When you want to amortize the cost of the sort over the time
   you use the data.

It is to be considered a 'stable sort', where values with equivalent
sorting criteria maintain their relative order as it is in the input
data set.

'cmp' MUST return values in [-1,0,1]. Otherwise, behavior is
undefined, and will most likely be very incorrect.

◆ P()

def direct.showbase.LazySort.P (   i)

◆ test()

def direct.showbase.LazySort.test ( )