This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author serhiy.storchaka
Recipients corona10, eric.smith, serhiy.storchaka
Date 2020-05-31.19:03:35
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1590951815.5.0.697884218574.issue40825@roundup.psfhosted.org>
In-reply-to
Content
Yes, converting Decimal to float can lose precision, so we cannot require this. PyNumber_Check() is already used for QUOTE_NONNUMERIC, so it would be logical to use it in determining that the object is a number in the cvs module.

But now the problem is with determining what is a "string". There is no way to check whether the object is "string-like", because virtually all objects can be converted to string. The only standard exception is bytes and bytearray for which str() may emit BytesWarning, so this conversion is not reliable. If restrict it only to an instance of str or its subclasses, it may break other user cases, for example writing Path in CVS.
History
Date User Action Args
2020-05-31 19:03:35serhiy.storchakasetrecipients: + serhiy.storchaka, eric.smith, corona10
2020-05-31 19:03:35serhiy.storchakasetmessageid: <1590951815.5.0.697884218574.issue40825@roundup.psfhosted.org>
2020-05-31 19:03:35serhiy.storchakalinkissue40825 messages
2020-05-31 19:03:35serhiy.storchakacreate