Django

Code

Changeset 6279

Show
Ignore:
Timestamp:
09/15/07 06:13:21 (1 year ago)
Author:
mtredinnick
Message:

Made a small optimization to deepcopy in [6276].

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • django/trunk/django/utils/functional.py

    r6276 r6279  
    1 import copy 
    2  
    31def curry(_curried_func, *args, **kwargs): 
    42    def _curried(*moreargs, **morekwargs): 
     
    105103 
    106104        def __deepcopy__(self, memo): 
    107             result = copy.copy(self) 
    108             memo[id(self)] = result 
    109             return result 
     105            # Instances of this class are effectively immutable. It's just a 
     106            # collection of functions. So we don't need to do anything 
     107            # complicated for copying. 
     108            memo[id(self)] = self 
     109            return self 
    110110 
    111111    def __wrapper__(*args, **kw):