Changes between Initial Version and Version 2 of Ticket #32568
- Timestamp:
- Mar 18, 2021, 6:58:40 AM (4 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #32568
- Property Owner changed from to
-
Ticket #32568 – Description
initial v2 6 6 7 7 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`.8 There 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`. 9 9 10 10 To 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.