Opened 8 years ago
Closed 8 years ago
#27463 closed Cleanup/optimization (fixed)
Fix ambiguous variable flake8 warnings
Reported by: | Ramin Farajpour Cami | Owned by: | Ramin Farajpour Cami |
---|---|---|---|
Component: | Core (Other) | Version: | 1.10 |
Severity: | Normal | Keywords: | |
Cc: | Triage Stage: | Ready for checkin | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
Hi,
In some fonts, character 'l' are indistinguishable from the numeral one. So better use other name instead.
https://github.com/django/django/blob/master/tests/queries/tests.py#L567&L574
Change History (14)
comment:1 by , 8 years ago
Owner: | changed from | to
---|---|
Status: | new → assigned |
comment:2 by , 8 years ago
comment:3 by , 8 years ago
Component: | Utilities → Core (Other) |
---|
I'm not sure about this, particularly if our style tool (flake8
) doesn't provide automated enforcement. A font that doesn't distinguish between one character or another doesn't seem so useful for programmers.
comment:4 by , 8 years ago
really!
Flake8 is a wrapper
PyFlakes
pycodestyle
mccabe
Flake8 uses ranges for mccabe, pyflakes, and pycodestyle because each of those projects tend to add new checks in minor releases.
http://flake8.pycqa.org/en/latest/faq.html#why-does-flake8-use-ranges-for-its-dependencies
comment:5 by , 8 years ago
pycodestyle member They told me : https://github.com/PyCQA/pycodestyle/issues/598
Allow me for PR ?
comment:6 by , 8 years ago
I have yet to come across a monospace font where l
and I
are identical, but it takes less effort to accept a PR making that change than to discuss.
comment:7 by , 8 years ago
Summary: | ambiguous variable name 'l' → Fix ambiguous variable flake8 warnings |
---|---|
Triage Stage: | Unreviewed → Accepted |
comment:9 by , 8 years ago
Ideally you could get flake8 working with the latest version of pycodestyle so you can see and fix all the warnings. If it's difficult, then we'll just wait until flake8 is updated.
comment:10 by , 8 years ago
Ok, let's go , i need just pycodesyle
latest version,
root@raminfp:~# python pycodestyle.py usr/django/django/apps /usr/django/django/apps/registry.py:425:1: E305 expected 2 blank lines after class or function definition, found 1
i going to fix E305 expected 2 blank lines after class or function definition, found 1
, because i see pycodestyle in new version,
Thanks Again,
comment:12 by , 8 years ago
Has patch: | set |
---|
comment:13 by , 8 years ago
Triage Stage: | Accepted → Ready for checkin |
---|
https://pep8.readthedocs.io/en/latest/_modules/pycodestyle.html