Changes between Initial Version and Version 1 of Ticket #24382, comment 10
- Timestamp:
- Mar 8, 2015, 2:30:39 PM (10 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #24382, comment 10
initial v1 1 My concrete problem is an implementation of a class derived from ` `Decimal``: https://github.com/jrief/django-shop/blob/0.3.0.dev/shop/money/money_maker.py1 My concrete problem is an implementation of a class derived from `Decimal`: https://github.com/jrief/django-shop/blob/0.3.0.dev/shop/money/money_maker.py 2 2 3 This class overrides the ` `__format__`` method, so that Django's ``numberformat`` can render instances of that type in the current locale. But my class also uses unicode symbols, for instance the € symbol. Therefore strings in ``numberformat`` shall be mixable with unicode strings from other modules.3 This class overrides the `__format__` method, so that Django's `numberformat` can render instances of that type in the current locale. But my class also uses unicode symbols, for instance the € symbol. Therefore strings in `numberformat` shall be mixable with unicode strings from other modules. 4 4 5 5 You can also see it from another perspective. 6 6 Most Python files in Django contain this line: 7 ``` 7 8 {{{ 8 9 from __future__ import unicode_literals 9 ``` 10 }}} 11 10 12 without that line, unicode literals only work with Python-3. By not adding this, Django intentionally behaves differently in Py-2 and Py-3.