From: Zac Medico Date: Sat, 12 Sep 2009 13:10:59 +0000 (-0000) Subject: Implement Atom.__copy__ and __deepcopy__ to return self, since instances are X-Git-Tag: v2.2_rc41~45 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=7a9607ad10fff8fcfdfeb67da8bf9b60a36feb13;p=portage.git Implement Atom.__copy__ and __deepcopy__ to return self, since instances are immutable. svn path=/main/trunk/; revision=14223 --- diff --git a/pym/portage/dep.py b/pym/portage/dep.py index df082eb70..cf06eca7f 100644 --- a/pym/portage/dep.py +++ b/pym/portage/dep.py @@ -657,6 +657,15 @@ class Atom(object): def rstrip(self, *pargs, **kargs): return self._str.rstrip(*pargs, **kargs) + def __copy__(self): + """Immutable, so returns self.""" + return self + + def __deepcopy__(self, memo=None): + """Immutable, so returns self.""" + memo[id(self)] = self + return self + def get_operator(mydep): """ Return the operator used in a depstring.