Message400747
> 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. |
|
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 | |
|