[Python-Dev] Mini-Pep: Simplifying the Integral ABC (original) (raw)

Jeffrey Yasskin jyasskin at gmail.com
Sat Jun 7 05:25:03 CEST 2008


Well, it seems like Integral instances should be able to be passed to either int() or long(), so long should probably stay. I have no idea why I didn't include int, but its absence was probably the only reason index calls long() instead of int().

On Fri, Jun 6, 2008 at 3:23 PM, Guido van Rossum <guido at python.org> wrote:

Both of these seem 2.6-specific quirks. Those lines wereJeffrey's; maybe he remembers? I'm guessing that adding long was done since 2.6 supports it, and the removal of int was an oversight. I also think that there's no reason to change index to call long(); int() will automatically return a long as needed. Maybe changing long back to int is also harmless.

On Fri, Jun 6, 2008 at 2:13 PM, Raymond Hettinger <python at rcn.com> wrote: From: "Guido van Rossum" <guido at python.org>

Make that int() instead of long() and I'm okay with it. Does anyone know why Integral says that long is a required abstract method, but not int? Likewise, why is index() defined as long(self) instead of int(self)? There may be some design nuance that I'm not seeing. Raymond


Python-Dev mailing list Python-Dev at python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/guido%40python.org

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

-- Namasté, Jeffrey Yasskin http://jeffrey.yasskin.info/



More information about the Python-Dev mailing list