Changes between Initial Version and Version 2 of Ticket #32568


Ignore:
Timestamp:
Mar 18, 2021, 6:58:40 AM (3 years ago)
Author:
Tim McCurrach
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #32568

    • Property Owner changed from nobody to Tim McCurrach
  • Ticket #32568 – Description

    initial v2  
    66
    77
    8 There are many places in the django codebase where we know the thing we are marking as safe to be a normal string. In such cases it makes sense to use `SafeString` instead of `mark_safe`.
     8There are many places in the django codebase where we know the thing we are marking as safe to be a normal (not marked as safe) string. In such cases it makes sense to use `SafeString` instead of `mark_safe`.
    99
    1010To play devils advocate, you could definitely argue that this is an unnecessary micro-optimisation. Following a brief search for `mark_safe`, there are some situations where we have something like `mark_safe(X)` and where evaluating `X` will take sufficiently long that any savings made marking the string as safe would be rendered insignificant.
Back to Top