Implemented __deepcopy__ to avoid infinite recursion in __getattr__ while deepcopying a Choices instance

This commit is contained in:
Den Lesnov 2013-08-15 15:01:09 +04:00
parent 15910e04e7
commit 5f291a6a4a

View file

@ -1,5 +1,7 @@
from __future__ import unicode_literals
import copy
class Choices(object):
"""
@ -80,3 +82,6 @@ class Choices(object):
def __contains__(self, item):
if item in self._choice_dict.values():
return True
def __deepcopy__(self, memo):
return self.__class__(*copy.deepcopy(self._full, memo))