Opened 10 years ago

Closed 10 years ago

#4316 closed (fixed)

remove use of lambda for flatatt function

Reported by: Gary Wilson <gary.wilson@…> Owned by: Adrian Holovaty
Component: Forms Version: master
Severity: Keywords:
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description


Attachments (1)

flatatt.diff (1.4 KB) - added by Gary Wilson <gary.wilson@…> 10 years ago.
more readable, yes? Added a couple tests too.

Download all attachments as: .zip

Change History (5)

Changed 10 years ago by Gary Wilson <gary.wilson@…>

Attachment: flatatt.diff added

more readable, yes? Added a couple tests too.

comment:1 Changed 10 years ago by Gary Wilson <gary.wilson@…>

Has patch: set
Triage Stage: UnreviewedReady for checkin

comment:2 Changed 10 years ago by Malcolm Tredinnick

It's a bit of a personal preference whether this is more readable or not. In some ways it now looks like it's quite complicated by taking up more space, when it's really just a one-line function. They even compile to exactly the same bytecode. So this is a line-ball.

Tests should definitely go in, though.

comment:3 Changed 10 years ago by Gary Wilson <gary.wilson@…>

The lambda version has no docstring though.

comment:4 Changed 10 years ago by Malcolm Tredinnick

Resolution: fixed
Status: newclosed

(In [5291]) Fixed #4316 -- Added docstring and tests for django.newforms.utils.flatatt().
Thanks, Gary Wilson.

Note: See TracTickets for help on using tickets.
Back to Top