[Django] #26125: Fix E731 flake warnings (do not assign a lambda expression, use a def)

42 views
Skip to first unread message

Django

unread,
Jan 22, 2016, 1:06:35 PM1/22/16
to django-...@googlegroups.com
#26125: Fix E731 flake warnings (do not assign a lambda expression, use a def)
------------------------------------------------+------------------------
Reporter: timgraham | Owner: nobody
Type: Cleanup/optimization | Status: new
Component: Core (Other) | Version: master
Severity: Normal | Keywords:
Triage Stage: Accepted | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 1
UI/UX: 0 |
------------------------------------------------+------------------------
A patch is attached to get started. Just run flake8 in the root clone
directory to see the errors to fix.

If we wanted to keep the "one-line" aspect, something like
`identity = lambda x: x` becomes `def identity(x): return x` though I
think putting the return statement on a separate line is less awkward to
read. Other opinions welcome.

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

Django

unread,
Jan 22, 2016, 1:06:59 PM1/22/16
to django-...@googlegroups.com
#26125: Fix E731 flake warnings (do not assign a lambda expression, use a def)
--------------------------------------+------------------------------------

Reporter: timgraham | Owner: nobody
Type: Cleanup/optimization | Status: new
Component: Core (Other) | Version: master
Severity: Normal | Resolution:

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

* Attachment "26125.diff" added.

Django

unread,
Jan 23, 2016, 11:48:04 AM1/23/16
to django-...@googlegroups.com
#26125: Fix E731 flake warnings (do not assign a lambda expression, use a def)
-------------------------------------+-------------------------------------
Reporter: timgraham | Owner:
Type: | andersonresende
Cleanup/optimization | Status: assigned

Component: Core (Other) | Version: master
Severity: Normal | Resolution:

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

* owner: nobody => andersonresende
* status: new => assigned


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

Django

unread,
Jan 23, 2016, 12:05:53 PM1/23/16
to django-...@googlegroups.com
#26125: Fix E731 flake warnings (do not assign a lambda expression, use a def)
-------------------------------------+-------------------------------------
Reporter: timgraham | Owner: userimack
Type: | Status: assigned
Cleanup/optimization |

Component: Core (Other) | Version: master
Severity: Normal | Resolution:

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

* owner: andersonresende => userimack


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

Django

unread,
Jan 23, 2016, 12:07:59 PM1/23/16
to django-...@googlegroups.com
#26125: Fix E731 flake warnings (do not assign a lambda expression, use a def)
-------------------------------------+-------------------------------------
Reporter: timgraham | Owner: userimack
Type: | Status: assigned
Cleanup/optimization |
Component: Core (Other) | Version: master
Severity: Normal | Resolution:

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

Comment (by timgraham):

@andersonresende, userimack is a new contributor who started this ticket
but forgot to assign it. Sorry for that.

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

Django

unread,
Jan 23, 2016, 12:51:24 PM1/23/16
to django-...@googlegroups.com
#26125: Fix E731 flake warnings (do not assign a lambda expression, use a def)
-------------------------------------+-------------------------------------
Reporter: timgraham | Owner: userimack
Type: | Status: assigned
Cleanup/optimization |
Component: Core (Other) | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1

Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by timgraham):

* needs_better_patch: 0 => 1
* has_patch: 0 => 1


Comment:

[https://github.com/django/django/pull/6028 PR] (not all errors are fixed
yet). Please uncheck "Patch needs improvement" when all errors are
resolved.

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

Django

unread,
Jan 24, 2016, 3:10:22 AM1/24/16
to django-...@googlegroups.com
#26125: Fix E731 flake warnings (do not assign a lambda expression, use a def)
-------------------------------------+-------------------------------------
Reporter: timgraham | Owner: userimack
Type: | Status: assigned
Cleanup/optimization |
Component: Core (Other) | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

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

* needs_better_patch: 1 => 0


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

Django

unread,
Jan 25, 2016, 2:27:03 PM1/25/16
to django-...@googlegroups.com
#26125: Fix E731 flake warnings (do not assign a lambda expression, use a def)
-------------------------------------+-------------------------------------
Reporter: timgraham | Owner: userimack
Type: | Status: closed
Cleanup/optimization |

Component: Core (Other) | Version: master
Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

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

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


Comment:

In [changeset:"60586dd7379b295b72d8af4e03423c286913b5e8" 60586dd7]:
{{{
#!CommitTicketReference repository=""
revision="60586dd7379b295b72d8af4e03423c286913b5e8"
Fixed #26125 -- Fixed E731 flake warnings.
}}}

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

Reply all
Reply to author
Forward
0 new messages