Comment 3 for bug 942699

Revision history for this message
Niels Huylebroeck (red15) wrote :

I created a wizard which creates a product by searching for a correct template then copying that and altering certain aspects while copying.

This might not be a use that was thought of when it was coded, but like I showed you this fix would never change the original behavior and is a nice improvement for future developers to use copy() with a proper defaults dictionary instead of having to do a write afterwards.

It also makes the copy() method more predictable whereas now *only* for product.product model you cannot pass a default['name'] = "My desired new name" which is what anyone who is learning the copy() method will expect.

Or as PEP20 states it: Special cases aren't special enough to break the rules.