
[GvR]
I thought the __trunc__ method only gets called from the C code for the trunc() function which is currently implemented with PyObject_CallMethod(number, "__trunc__", "") instead of a fast call to a slot. Raymond

On Jan 29, 2008 11:34 AM, Raymond Hettinger <python@rcn.com> wrote:
I see. Well, it would bounce around a bit but it would never execute Python byte codes. I don't see trunc() being all that performance critical. The cost of adding a new slot is considerable -- for one, *all* type objects become 4 (or 8) bytes longer. -- --Guido van Rossum (home page: http://www.python.org/~guido/)

On Jan 29, 2008 11:34 AM, Raymond Hettinger <python@rcn.com> wrote:
I see. Well, it would bounce around a bit but it would never execute Python byte codes. I don't see trunc() being all that performance critical. The cost of adding a new slot is considerable -- for one, *all* type objects become 4 (or 8) bytes longer. -- --Guido van Rossum (home page: http://www.python.org/~guido/)
participants (3)
-
Eric Smith
-
Guido van Rossum
-
Raymond Hettinger