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 xiang.zhang
Recipients serhiy.storchaka, vstinner, xiang.zhang
Date 2016-10-10.02:44:22
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1476067462.82.0.40507848437.issue28398@psf.upfronthosting.co.za>
In-reply-to
Content
The cost is really small (an integer compare vs memory malloc and copy). The advantages are fast path for empty strings and retaining consistency with other codes in unicodeobject.c. You can see other places use the same optimization, e.g. PyUnicode_FromUnicode, PyUnicode_FromUCS1, and some functions using unicode_result.
History
Date User Action Args
2016-10-10 02:44:22xiang.zhangsetrecipients: + xiang.zhang, vstinner, serhiy.storchaka
2016-10-10 02:44:22xiang.zhangsetmessageid: <1476067462.82.0.40507848437.issue28398@psf.upfronthosting.co.za>
2016-10-10 02:44:22xiang.zhanglinkissue28398 messages
2016-10-10 02:44:22xiang.zhangcreate