Closed alexwlchan closed 7 years ago
No, that's our configuration: The sort order is shortest first then ties broken alphabetically.
It's probably worth changing that given the number of people it has confused. I don't really have any strong opinion in favour of it staying that way, it's just what I happened to pick early in the project and it's stayed that way by inertia.
That being said, I think I have spotted some cases where it's confused about sort order in our code recently.
I guess one slightly tongue in cheek argument for this is that Hypothesis is designed for the combinatorial optimization problem of producing shortlex (that order) minimal examples, so it's thematically appropriate. 😉
But I genuinely don't really care and would happily accept a patch to change the order to a more normal one.
The sort order is shortest first then ties broken alphabetically.
That’s a bizarre convention, but it explains so much.
Multiple times I’ve tried to get the imports right by eye, only for isort to suggest what seems like an utterly random ordering.
That’s a bizarre convention
I find it kinda aesthetically pleasing because it groups similar complexity things together (it's really for across line sorting that I care about it, not within lines), but I admit it's an unusual life choice.
but it explains so much.
Sorry, I thought you knew that, or I'd have explained properly before. The confusing thing for me with isort recently was some of the ways in which it changed, not the fundamental sort order
I'm going too close this as WAI, but feel free to propose a change if it still bugs you.
Two examples:
https://travis-ci.org/HypothesisWorks/hypothesis-python/jobs/224768835
What definition of alphabetical sorts
from hypothesis import given, example
instead ofexample, given
?https://github.com/HypothesisWorks/hypothesis-python/blob/master/src/hypothesis/internal/reflection.py#L24
Wut.