Django

Code

Changeset 4640

Show
Ignore:
Timestamp:
02/27/07 18:35:50 (2 years ago)
Author:
jacob
Message:

Fixed #2779: added a copy() method to MergeDict?, along with some new tests for django.utils.datastructures. Thanks, Chris McAvoy?.

Files:

Legend:

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

    r4576 r4640  
    1717    def __contains__(self, key): 
    1818        return self.has_key(key) 
     19         
     20    def __copy__(self):  
     21        return self.__class__(*self.dicts)  
    1922 
    2023    def get(self, key, default=None): 
     
    4346                return True 
    4447        return False 
     48         
     49    def copy(self):  
     50        """ returns a copy of this object"""  
     51        return self.__copy__() 
    4552 
    4653class SortedDict(dict):