Changeset 580 for branches


Ignore:
Timestamp:
10/16/12 14:38:03 (4 years ago)
Author:
mmckerns
Message:

add tests for 'wrapper' decorators

Location:
branches/decorate
Files:
1 added
1 deleted
1 edited

Legend:

Unmodified
Added
Removed
  • branches/decorate/wrapper.py

    r550 r580  
    99    """ 
    1010    def dec(f): 
    11         def func(*args, **kwds): 
     11        def func(*args, **kwds): #FIXME: doesn't preserve function signature 
    1212            return f(inner(*args, **kwds)) 
    1313        return func 
     
    9898The resulting function is: f'(x) = scale * f(x) + shift * mixin(x). 
    9999If normalized, then f' = f' / (scale + shift)""" 
    100   norm = 1.0 
    101100  def dec(f): 
    102101    def func(*args, **kwds): 
     102      norm = 1.0 
    103103      if normalized: norm = scale + shift 
    104104      return (scale * f(*args, **kwds) + shift * mixin(*args, **kwds)) / norm 
Note: See TracChangeset for help on using the changeset viewer.