[Python-Dev] PEP 362: 4th edition (original) (raw)
Steven D'Aprano steve at pearwood.info
Tue Jun 19 04:02:03 CEST 2012
- Previous message: [Python-Dev] PEP 362: 4th edition
- Next message: [Python-Dev] PEP 362: 4th edition
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On Mon, Jun 18, 2012 at 02:09:17PM -0400, Yury Selivanov wrote:
That's an excerpt from Signature.deepcopy:
cls = type(self) sig = cls.new(cls) _sig.parameters = OrderedDict((name, param.copy()) _ for name, param in self.parameters.items()) And Parameter.copy: cls = type(self) copy = cls.new(cls) copy.dict.update(self.dict) return copy So we don't recursively deepcopy parameters in Signature.deepcopy (I hope that we don't violate the deepcopy meaning here)
I think you are. I would describe the above as a shallow copy, not a deep copy. I expect a deep copy to go all the way down, as deep as possible.
Even if it makes no practical difference, I think it will be less confusing to just describe it as a "copy" rather than a deep copy, unless you recursively copy everything all the way down.
-- Steven
- Previous message: [Python-Dev] PEP 362: 4th edition
- Next message: [Python-Dev] PEP 362: 4th edition
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]