jeudi 30 janvier 2014

Re: Another surprise from the datetime module topic




In article <52eb1e37972$c3e8da3$(E-Mail Removed) om>,
Steven D'Aprano <(E-Mail Removed)> wrote:

> "replace" is a perfectly reasonable name for a method which performs a
> replacement, whether it replaces in place (for mutable objects) or makes
> a copy with replacement (for immutable objects). What else would you call
> it?


I suppose that by (imperfect) analogy to list.sort() and sorted(list),
it might make more sense to call it replaced(). But, it's too late for
any of that now. The other three classes in the module have replace(),
so that's the obvious name to use for the fourth class.





Aucun commentaire:

Enregistrer un commentaire