diff options
| author | sobolevn <mail@sobolevn.me> | 2026-02-24 11:15:17 +0300 |
|---|---|---|
| committer | Jacob Walls <jacobtylerwalls@gmail.com> | 2026-02-24 07:37:25 -0500 |
| commit | 2de474dffca008038a7f9fe10289f390c5f4f15b (patch) | |
| tree | 5543836df687921fe4377e802633d188c0fd7ab9 /django/template | |
| parent | 9a8461f92250b49994aa133b564ec68617f6d78c (diff) | |
Delete leaking loop iter vars in `smartif.py`
While working on https://github.com/typeddjango/django-stubs/pull/3114/changes#diff-c408a224a641ee1ad26789d61b19c64c44667c1feb8fce0d58aea0338844ca66R276-R278 we have noticed that loop variables leak into the module namespace.
It has two negative effects:
1. Users can access `smartif.op` and `smartif.key` public attrs, which is clearly not intenteded
2. We in `django-stubs` have to ignore these two objects from annotations
Let's remove them :)
Diffstat (limited to 'django/template')
| -rw-r--r-- | django/template/smartif.py | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/django/template/smartif.py b/django/template/smartif.py index f6e8323bed..c0682f3b1e 100644 --- a/django/template/smartif.py +++ b/django/template/smartif.py @@ -114,6 +114,7 @@ OPERATORS = { # Assign 'id' to each: for key, op in OPERATORS.items(): op.id = key +del key, op class Literal(TokenBase): |
