﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
27870	Clean up ManagementUtility.autocomplete()	Phil	Phil	"There are few thing in {{{core/management/__init__.py}}}(https://github.com/django/django/blob/master/django/core/management/__init__.py) those look strange. 

1. In line 257(https://github.com/django/django/blob/master/django/core/management/__init__.py#L257) there is the code like `sorted(x)[0]` which is similar to `min(x)`. But the second one looks better, works for O(N) but not O(N log N) and doesn't spend memory for the new object.
Sure, time and memory optimizations are negligible in this case, but readability is more important.

2. In line 261(https://github.com/django/django/blob/master/django/core/management/__init__.py#L261) we declare list of used options but use only to understand if option was already used. So while we don't need order, but only want to check, if option is already used. So set is better than list both semantically and  complexity (~ O(1) instead of O(N)).
"	Cleanup/optimization	closed	Core (Management commands)	dev	Normal	fixed			Ready for checkin	1	0	0	0	1	0
