Opened 17 years ago

Last modified 17 years ago

#5761 closed

Use random.sample, don't reimplement it — at Version 1

Reported by: Nir Soffer <nirs@…> Owned by: nobody
Component: Contrib apps Version: dev
Severity: 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 (last modified by Matt Boersma)

Python's standard library since 2.3 has had random.sample for choosing random elements of a sequence. In contrib/auth/models.py, the implementor was unaware of this and wrote a bit more code than needed.

Change History (3)

by Nir Soffer <nirs@…>, 17 years ago

Attachment: password.diff added

patch

comment:1 by Matt Boersma, 17 years ago

Component: UncategorizedContrib apps
Description: modified (diff)
Has patch: set
Summary: Minor refactoringUse random.sample, don't reimplement it
Triage Stage: UnreviewedAccepted
Version: 0.96SVN

I changed the title and description to be clearer, and updated it to Django-SVN, since 0.96 won't get patched for this, and it's still there in trunk.

by Matt Boersma, 17 years ago

Attachment: 5761.diff added

Similar patch against django trunk as of [6534].

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