[issue2337] Backport oct() and hex() to use __index__

2008-06-06 Thread Benjamin Peterson
Benjamin Peterson <[EMAIL PROTECTED]> added the comment: This was rejected by Guido. -- resolution: -> rejected status: pending -> closed ___ Python tracker <[EMAIL PROTECTED]> __

[issue2337] Backport oct() and hex() to use __index__

2008-05-17 Thread Eric Smith
Changes by Eric Smith <[EMAIL PROTECTED]>: -- nosy: +eric.smith __ Tracker <[EMAIL PROTECTED]> __ ___ Python-bugs-list mailing list Unsubscribe:

[issue2337] Backport oct() and hex() to use __index__

2008-05-17 Thread Benjamin Peterson
Benjamin Peterson <[EMAIL PROTECTED]> added the comment: I have reverted this. See mail.python.org/pipermail/python-checkins/2008-May/069843.html. -- resolution: fixed -> status: closed -> pending __ Tracker <[EMAIL PROTECTED]>

[issue2337] Backport oct() and hex() to use __index__

2008-05-17 Thread Benjamin Peterson
Benjamin Peterson <[EMAIL PROTECTED]> added the comment: Done in r63425. -- resolution: -> fixed status: open -> closed __ Tracker <[EMAIL PROTECTED]> __ _

[issue2337] Backport oct() and hex() to use __index__

2008-05-17 Thread Georg Brandl
Georg Brandl <[EMAIL PROTECTED]> added the comment: The warning message for oct() should include that the output will be different too. Else this is fine with me. __ Tracker <[EMAIL PROTECTED]> __

[issue2337] Backport oct() and hex() to use __index__

2008-04-27 Thread Benjamin Peterson
Benjamin Peterson <[EMAIL PROTECTED]> added the comment: Here's a patch for that. It warns for hex() when __hex__ is used, otherwise it uses __index__. (This doesn't work for old style classes because ob_tp->tp_as_number->tp_hex is filled.) Use of oct() just gets a warning. The __hex__ and __oct_

[issue2337] Backport oct() and hex() to use __index__

2008-04-27 Thread Georg Brandl
Georg Brandl <[EMAIL PROTECTED]> added the comment: I don't assume there are too many people using oct() and hex() with custom types anyway :) Since PyNumber_ToBase and the new oct() format octal numbers with "0o" instead of "0", I still think it's better if you need to import the new oct() from

[issue2337] Backport oct() and hex() to use __index__

2008-04-26 Thread Benjamin Peterson
Benjamin Peterson <[EMAIL PROTECTED]> added the comment: I meant not to. Sorry, that wasn't clear. __ Tracker <[EMAIL PROTECTED]> __ ___ Python-bugs-list

[issue2337] Backport oct() and hex() to use __index__

2008-04-26 Thread Brett Cannon
Brett Cannon <[EMAIL PROTECTED]> added the comment: @Georg: That is a possibility. Would need to add the proper Py3K warning to the current builtins, though. @Benjamin: You don't want to warn if it will work for Py3K, so don't warn if __index__ is used. __ Tr

[issue2337] Backport oct() and hex() to use __index__

2008-04-26 Thread Benjamin Peterson
Benjamin Peterson <[EMAIL PROTECTED]> added the comment: This is what I'd like to do: In builtin oct/hex check if the special method is declared. If it is, Py3k warn and use it. If not, check if we can do it the Py3k way (with PyNumber_ToBase). Sound good? -- nosy: +benjamin.peterson __

[issue2337] Backport oct() and hex() to use __index__

2008-03-21 Thread Georg Brandl
Georg Brandl <[EMAIL PROTECTED]> added the comment: Shouldn't we leave alone oct() and hex() (there is another issue for deprecation warning for __oct__ and __hex__), and let people use the versions from future_builtins? -- nosy: +georg.brandl __ Tracker

[issue2337] Backport oct() and hex() to use __index__

2008-03-17 Thread Brett Cannon
Changes by Brett Cannon <[EMAIL PROTECTED]>: -- priority: immediate -> urgent __ Tracker <[EMAIL PROTECTED]> __ ___ Python-bugs-list mailing lis

[issue2337] Backport oct() and hex() to use __index__

2008-03-17 Thread Brett Cannon
New submission from Brett Cannon <[EMAIL PROTECTED]>: oct() and hex() need to use __index__ when available and then emit a Py3K warning when they fall back on __oct__ and __hex__. -- components: Interpreter Core keywords: 26backport messages: 63695 nosy: brett.cannon priority: immediate