Changeset 643 for branches


Ignore:
Timestamp:
01/13/13 17:31:32 (3 years ago)
Author:
mmckerns
Message:

enable discrete to take int or tuple for index

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/decorate/wrapper.py

    r629 r643  
    131131[1.0, 2.0, 2.0] 
    132132 
    133 >>> @discrete([1,3,5,7], index=(0,3)]) 
     133>>> @discrete([1,3,5,7], index=(0,3)) 
    134134... def squared(x): 
    135135....    return [i**2 for i in x] 
     
    139139    samples = [asarray(samples)] 
    140140    samples[0].sort() 
     141    if isinstance(index, int): index = (index,) 
    141142    index = [index] 
    142143 
Note: See TracChangeset for help on using the changeset viewer.