Changes between Initial Version and Version 1 of Ticket #24382, comment 10


Ignore:
Timestamp:
Mar 8, 2015, 2:30:39 PM (9 years ago)
Author:
Markus Holtermann

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.py
     1My 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
    22
    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.
     3This 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.
    44
    55You can also see it from another perspective.
    66Most Python files in Django contain this line:
    7 ```
     7
     8{{{
    89from __future__ import unicode_literals
    9 ```
     10}}}
     11
    1012without that line, unicode literals only work with Python-3. By not adding this, Django intentionally behaves differently  in Py-2 and Py-3.
Back to Top