[issue16773] int() half-accepts UserString

2014-08-12 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Looks as there is no easy fix of this issue. This issue is particular case of issue232493. -- resolution: -> duplicate stage: needs patch -> resolved status: open -> closed superseder: -> UserString can not be used as string in calls to C routines

[issue16773] int() half-accepts UserString

2012-12-30 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: This is definitely non-trivial. 1-argument int() works with UserString because __int__() method is defined for UserString (as __float__(), as __complex__()). I.e. UserString looks as number-like for it. Unfortunately there is no way to make a class be string

[issue16773] int() half-accepts UserString

2012-12-30 Thread Ezio Melotti
Ezio Melotti added the comment: Not sure this is worth fixing, unless the fix is trivial. -- ___ Python tracker ___ ___ Python-bugs-li

[issue16773] int() half-accepts UserString

2012-12-25 Thread Mark Dickinson
Changes by Mark Dickinson : -- nosy: +mark.dickinson ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mai

[issue16773] int() half-accepts UserString

2012-12-25 Thread Ed Campbell
Changes by Ed Campbell : -- nosy: +esc24 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org

[issue16773] int() half-accepts UserString

2012-12-24 Thread Chris Jerdonek
Changes by Chris Jerdonek : -- nosy: +chris.jerdonek ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mai

[issue16773] int() half-accepts UserString

2012-12-24 Thread Ezio Melotti
Changes by Ezio Melotti : -- nosy: +ezio.melotti ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.py

[issue16773] int() half-accepts UserString

2012-12-24 Thread Serhiy Storchaka
New submission from Serhiy Storchaka: In Python 3 int() accepts UserString argument without explicit base and reject it with explicit base. >>> from collections import UserString >>> int(UserString('100')) 100 >>> int(UserString('100'), 2) Traceback (most recent call last): File "", line 1, i