[Python-Dev] Mini-Pep: Simplifying the Integral ABC (original) (raw)
Guido van Rossum guido at python.org
Sat Jun 7 19:30:16 CEST 2008
- Previous message: [Python-Dev] Mini-Pep: Simplifying the Integral ABC
- Next message: [Python-Dev] Mini-Pep: Simplifying the Integral ABC
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
I recommend switching back to int and int; even in 2.5, these are expected to return either an int or a long as required. There's no need to mess with long at all.
On Fri, Jun 6, 2008 at 8:25 PM, Jeffrey Yasskin <jyasskin at gmail.com> wrote:
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/
-- --Guido van Rossum (home page: http://www.python.org/~guido/)
- Previous message: [Python-Dev] Mini-Pep: Simplifying the Integral ABC
- Next message: [Python-Dev] Mini-Pep: Simplifying the Integral ABC
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]