Here's another issue where Neal thought it would be useful if I weighed in. I'm not quite sure of the current status, but perhaps the following would work?
- Called from Python, (10**10).__index__() should return 10000000000L, not raise an exception or return sys.maxint. - The nb_index slot is changed to return an object; it should return a Python int or long without clipping (same as __index__() called from Python). - There should be three C APIs (perhaps fewer if some of them are never needed): - One to call the nb_index slot, or raise an exception if it's not set, returning the object - One to return the clipped value without an exception (can still return an exception if something else went wrong) - One to return the value if it fits, raise OverflowError if it doesn't I know this is quite the deviation from the current code but it seems the most rational and future-proof approach. -- --Guido van Rossum (home page: http://www.python.org/~guido/) _______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com