It's not removing the sorting, it's removing the line altogether. This line did nothing because kwargs is always empty.