[Python-Dev] trunc() (original) (raw)

Guido van Rossum guido at python.org
Sun Jan 27 19:54:56 CET 2008


On Jan 27, 2008 10:54 AM, Raymond Hettinger <python at rcn.com> wrote:

> Then int() can be defined by deferring to trunc() > -- as opposed to round().

That part is new and represents some progress. If I understand it correctly, it means that we won't have both int and trunc magic methods. That's a good thing.

A single type wouln't need both. But int() should still try both, because it doesn't make sense for e.g. a date type to have to define trunc for conversion to an int.

-- --Guido van Rossum (home page: http://www.python.org/~guido/)



More information about the Python-Dev mailing list