[Django] #27463: ambiguous variable name 'l'

345 views
Skip to first unread message

Django

unread,
Nov 9, 2016, 2:05:51 AM11/9/16
to django-...@googlegroups.com
#27463: ambiguous variable name 'l'
------------------------------------------------+------------------------
Reporter: Ramin Farajpour Cami | Owner: nobody
Type: Cleanup/optimization | Status: new
Component: Utilities | Version: 1.10
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
------------------------------------------------+------------------------
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

--
Ticket URL: <https://code.djangoproject.com/ticket/27463>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Nov 9, 2016, 2:07:08 AM11/9/16
to django-...@googlegroups.com
#27463: ambiguous variable name 'l'
-------------------------------------+-------------------------------------
Reporter: Ramin Farajpour | Owner: Ramin
Cami | Farajpour Cami
Type: | Status: assigned
Cleanup/optimization |
Component: Utilities | Version: 1.10
Severity: Normal | Resolution:

Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Ramin Farajpour Cami):

* owner: nobody => Ramin Farajpour Cami
* status: new => assigned


--
Ticket URL: <https://code.djangoproject.com/ticket/27463#comment:1>

Django

unread,
Nov 9, 2016, 2:15:32 AM11/9/16
to django-...@googlegroups.com
#27463: ambiguous variable name 'l'
-------------------------------------+-------------------------------------
Reporter: Ramin Farajpour | Owner: Ramin
Cami | Farajpour Cami
Type: | Status: assigned
Cleanup/optimization |
Component: Utilities | Version: 1.10
Severity: Normal | Resolution:

Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Ramin Farajpour Cami):

https://pep8.readthedocs.io/en/latest/_modules/pycodestyle.html

{{{
Okay: L = 0
Okay: o = 123
Okay: i = 42
E741: l = 0
E741: O = 123
E741: I = 42
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/27463#comment:2>

Django

unread,
Nov 9, 2016, 4:57:45 AM11/9/16
to django-...@googlegroups.com
#27463: ambiguous variable name 'l'
-------------------------------------+-------------------------------------
Reporter: Ramin Farajpour | Owner: Ramin
Cami | Farajpour Cami
Type: | Status: assigned
Cleanup/optimization |
Component: Core (Other) | Version: 1.10
Severity: Normal | Resolution:

Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Tim Graham):

* component: Utilities => Core (Other)


Comment:

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.

--
Ticket URL: <https://code.djangoproject.com/ticket/27463#comment:3>

Django

unread,
Nov 9, 2016, 5:09:41 AM11/9/16
to django-...@googlegroups.com
#27463: ambiguous variable name 'l'
-------------------------------------+-------------------------------------
Reporter: Ramin Farajpour | Owner: Ramin
Cami | Farajpour Cami
Type: | Status: assigned
Cleanup/optimization |
Component: Core (Other) | Version: 1.10
Severity: Normal | Resolution:
Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Ramin Farajpour Cami):

really!

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

--
Ticket URL: <https://code.djangoproject.com/ticket/27463#comment:4>

Django

unread,
Nov 9, 2016, 7:36:03 AM11/9/16
to django-...@googlegroups.com
#27463: ambiguous variable name 'l'
-------------------------------------+-------------------------------------
Reporter: Ramin Farajpour | Owner: Ramin
Cami | Farajpour Cami
Type: | Status: assigned
Cleanup/optimization |
Component: Core (Other) | Version: 1.10
Severity: Normal | Resolution:
Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Ramin Farajpour Cami):

pycodestyle member tell me :
https://github.com/PyCQA/pycodestyle/issues/598

Allow me for PR ?

--
Ticket URL: <https://code.djangoproject.com/ticket/27463#comment:5>

Django

unread,
Nov 9, 2016, 7:36:28 AM11/9/16
to django-...@googlegroups.com
#27463: ambiguous variable name 'l'
-------------------------------------+-------------------------------------
Reporter: Ramin Farajpour | Owner: Ramin
Cami | Farajpour Cami
Type: | Status: assigned
Cleanup/optimization |
Component: Core (Other) | Version: 1.10
Severity: Normal | Resolution:
Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Aymeric Augustin):

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.

--
Ticket URL: <https://code.djangoproject.com/ticket/27463#comment:6>

Django

unread,
Nov 9, 2016, 12:48:18 PM11/9/16
to django-...@googlegroups.com
#27463: Fix ambiguous variable flake8 warnings

-------------------------------------+-------------------------------------
Reporter: Ramin Farajpour | Owner: Ramin
Cami | Farajpour Cami
Type: | Status: assigned
Cleanup/optimization |
Component: Core (Other) | Version: 1.10
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted

Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Tim Graham):

* stage: Unreviewed => Accepted


--
Ticket URL: <https://code.djangoproject.com/ticket/27463#comment:7>

Django

unread,
Nov 10, 2016, 12:57:06 AM11/10/16
to django-...@googlegroups.com
#27463: Fix ambiguous variable flake8 warnings
-------------------------------------+-------------------------------------
Reporter: Ramin Farajpour | Owner: Ramin
Cami | Farajpour Cami
Type: | Status: assigned
Cleanup/optimization |
Component: Core (Other) | Version: 1.10
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Ramin Farajpour Cami):

Hi,

i should check `ALL` files `.py` django for check this warnings?

--
Ticket URL: <https://code.djangoproject.com/ticket/27463#comment:8>

Django

unread,
Nov 10, 2016, 5:43:42 AM11/10/16
to django-...@googlegroups.com
#27463: Fix ambiguous variable flake8 warnings
-------------------------------------+-------------------------------------
Reporter: Ramin Farajpour | Owner: Ramin
Cami | Farajpour Cami
Type: | Status: assigned
Cleanup/optimization |
Component: Core (Other) | Version: 1.10
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Tim Graham):

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.

--
Ticket URL: <https://code.djangoproject.com/ticket/27463#comment:9>

Django

unread,
Nov 10, 2016, 6:31:13 AM11/10/16
to django-...@googlegroups.com
#27463: Fix ambiguous variable flake8 warnings
-------------------------------------+-------------------------------------
Reporter: Ramin Farajpour | Owner: Ramin
Cami | Farajpour Cami
Type: | Status: assigned
Cleanup/optimization |
Component: Core (Other) | Version: 1.10
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Ramin Farajpour Cami):

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,

--
Ticket URL: <https://code.djangoproject.com/ticket/27463#comment:10>

Django

unread,
Nov 12, 2016, 12:51:21 AM11/12/16
to django-...@googlegroups.com
#27463: Fix ambiguous variable flake8 warnings
-------------------------------------+-------------------------------------
Reporter: Ramin Farajpour | Owner: Ramin
Cami | Farajpour Cami
Type: | Status: assigned
Cleanup/optimization |
Component: Core (Other) | Version: 1.10
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Ramin Farajpour Cami):

[https://github.com/django/django/pull/7545 PR]

--
Ticket URL: <https://code.djangoproject.com/ticket/27463#comment:11>

Django

unread,
Nov 12, 2016, 12:58:52 AM11/12/16
to django-...@googlegroups.com
#27463: Fix ambiguous variable flake8 warnings
-------------------------------------+-------------------------------------
Reporter: Ramin Farajpour | Owner: Ramin
Cami | Farajpour Cami
Type: | Status: assigned
Cleanup/optimization |
Component: Core (Other) | Version: 1.10
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Ramin Farajpour Cami):

* has_patch: 0 => 1


--
Ticket URL: <https://code.djangoproject.com/ticket/27463#comment:12>

Django

unread,
Nov 12, 2016, 6:34:26 AM11/12/16
to django-...@googlegroups.com
#27463: Fix ambiguous variable flake8 warnings
-------------------------------------+-------------------------------------
Reporter: Ramin Farajpour | Owner: Ramin
Cami | Farajpour Cami
Type: | Status: assigned
Cleanup/optimization |
Component: Core (Other) | Version: 1.10
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Ramin Farajpour Cami):

* needs_better_patch: 0 => 1


--
Ticket URL: <https://code.djangoproject.com/ticket/27463#comment:13>

Django

unread,
Nov 12, 2016, 7:05:26 PM11/12/16
to django-...@googlegroups.com
#27463: Fix ambiguous variable flake8 warnings
-------------------------------------+-------------------------------------
Reporter: Ramin Farajpour | Owner: Ramin
Cami | Farajpour Cami
Type: | Status: assigned
Cleanup/optimization |
Component: Core (Other) | Version: 1.10
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Ramin Farajpour Cami):

* needs_better_patch: 1 => 0


--
Ticket URL: <https://code.djangoproject.com/ticket/27463#comment:14>

Django

unread,
Nov 14, 2016, 3:48:33 PM11/14/16
to django-...@googlegroups.com
#27463: Fix ambiguous variable flake8 warnings
-------------------------------------+-------------------------------------
Reporter: Ramin Farajpour | Owner: Ramin
Cami | Farajpour Cami
Type: | Status: assigned
Cleanup/optimization |
Component: Core (Other) | Version: 1.10
Severity: Normal | Resolution:
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Tim Graham):

* stage: Accepted => Ready for checkin


--
Ticket URL: <https://code.djangoproject.com/ticket/27463#comment:13>

Django

unread,
Nov 14, 2016, 5:40:48 PM11/14/16
to django-...@googlegroups.com
#27463: Fix ambiguous variable flake8 warnings
-------------------------------------+-------------------------------------
Reporter: Ramin Farajpour | Owner: Ramin
Cami | Farajpour Cami
Type: | Status: closed

Cleanup/optimization |
Component: Core (Other) | Version: 1.10
Severity: Normal | Resolution: fixed

Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Tim Graham <timograham@…>):

* status: assigned => closed
* resolution: => fixed


Comment:

In [changeset:"0a63ef3f61f42c5fd22f2d0b626e386fd426ebed" 0a63ef3f]:
{{{
#!CommitTicketReference repository=""
revision="0a63ef3f61f42c5fd22f2d0b626e386fd426ebed"
Fixed #27463 -- Fixed E741 flake8 warnings.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/27463#comment:14>

Reply all
Reply to author
Forward
0 new messages