At 11:46 PM 2/10/2008 +0000, Paul Moore wrote: >If I want a copy of an arbitrary mapping (or any object) and I want to >preserve type, I would use copy.copy(). This is just as polymorphic as >a copy method (interesting that it is Phillip arguing for methods >being the polymorphic choice, when copy.copy is a generic function, >which he has previously argued as being better...)
Actually, the issue here is the import, not methods vs. functions. Otherwise, I'd be arguing for ob.len(). :) And if we were starting from square one with no existing code, I'd probably be okay with needing to import copy, as long as that was the publicized One Obvious Way to copy all things. However, since existing code has to be migrated, and lots of things have copy() methods, and 2to3 isn't going to be able to tell, practicality (IMO) seems to favor keeping the existing method. _______________________________________________ Python-3000 mailing list Python-3000@python.org http://mail.python.org/mailman/listinfo/python-3000 Unsubscribe: http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com