Message400747
| Author |
vstinner |
| Recipients |
Arfrever, alex, barry, brett.cannon, docs@python, eric.snow, ethan.furman, mark.dickinson, mjacob, ncoghlan, python-dev, rhettinger, serhiy.storchaka, vstinner |
| Date |
2021年08月31日.15:42:26 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1630424546.91.0.74394540992.issue17576@roundup.psfhosted.org> |
| In-reply-to |
| Content |
> If we go in this direction we should add a DeprecationWarning for __str__() returning not direct str.
I saw str subclass being used for translation. Example:
class Message(str):
"""A Message object is a unicode object that can be translated.
Translation of Message is done explicitly using the translate() method.
For all non-translation intents and purposes, a Message is simply unicode,
and can be treated as such.
"""
https://github.com/openstack/oslo.i18n/blob/master/oslo_i18n/_message.py
There is likely other funny use cases.
I don't know if str() is used on Message instances. |
|
History
|
|---|
| Date |
User |
Action |
Args |
| 2021年08月31日 15:42:26 | vstinner | set | recipients:
+ vstinner, barry, brett.cannon, rhettinger, mark.dickinson, ncoghlan, Arfrever, alex, docs@python, ethan.furman, python-dev, eric.snow, serhiy.storchaka, mjacob |
| 2021年08月31日 15:42:26 | vstinner | set | messageid: <1630424546.91.0.74394540992.issue17576@roundup.psfhosted.org> |
| 2021年08月31日 15:42:26 | vstinner | link | issue17576 messages |
| 2021年08月31日 15:42:26 | vstinner | create |
|