Jan. 28, 2008
10:28 p.m.
On Jan 28, 2008 4:00 PM, Guido van Rossum <guido@python.org> wrote:
No, using trunc(x) makes it clear that the argument and return value are numbers. Using x.trunc() doesn't.
How often do you expect someone to be looking at code where a trunc() method is being called and the variable could plausibly be both a number or something else? (a Google Code search for "def trunc(self)" lang:python returns 1 hit) How does the that additional value weigh against the cost of adding another builtin and trying to explain trunc() versus int() to new users? -- Daniel Stutzbach, Ph.D. President, Stutzbach Enterprises LLC