[issue33002] Making a class formattable as hex/oct integer with printf-style formatting requires both __int__ and __index__ for no good reason

2019-03-14 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Resolved in issue36048. -- nosy: +serhiy.storchaka resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> Deprecate implicit truncating when convert Python numbers to C integers: use __index__, not __int__

[issue33002] Making a class formattable as hex/oct integer with printf-style formatting requires both __int__ and __index__ for no good reason

2018-09-23 Thread Karthikeyan Singaravelan
Change by Karthikeyan Singaravelan : -- nosy: +xtreak ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue33002] Making a class formattable as hex/oct integer with printf-style formatting requires both __int__ and __index__ for no good reason

2018-03-06 Thread Mark Dickinson
Mark Dickinson added the comment: Agreed that this seems wrong. -- nosy: +eric.smith, mark.dickinson ___ Python tracker ___

[issue33002] Making a class formattable as hex/oct integer with printf-style formatting requires both __int__ and __index__ for no good reason

2018-03-05 Thread Josh Rosenberg
Josh Rosenberg added the comment: To be clear, this is a problem with old-style (printf-style) formatting, and applies to both bytes formatting and str formatting. So a class like: class Foo: def __index__(self): return 1 will fail with