Open Indivicivet opened 4 years ago
Hi @Indivicivet, that's a thoughtful point. Probably if boltons started today it'd do things in line with the emerging conventions.
But as for the mature boltons we have today, no, no such plan at the moment. For instance, for the OMD, it probably wouldn't be too hard to have branched definitions, depending on which version of Python is importing, similar to how funcutils already has to work. But it's not something I'm rushing to do because then the tests need branches, too, and the docs as well. funcutils again demonstrating the heavy toll. But I guess if it was done right, I'd consider a PR.
I'm not saying never, but I would want to have a decent discussion about, because I'm fairly sure even many Python core devs would try to avoid breaking backwards compat again if they could choose. :)
@mahmoud, Do you have any metrics on how many python2 installations versus python3 installations are using boltons?
I found the download metrics for the last 30 days. The vast majority are python 3.6 and above.
3.6 | 464325 | Â 3.7 | 245761 | Â 3.8 | 64091 | Â 2.7 | 41436 | Â 3.5 | 12107 | Â 3.9 | 2442 | Â 3.4 | 124 | Â 3.10 | 65
Is there any plan for an interface switch in boltons for a function "X" e.g.
iterutils.pairwise()
to return an iterable (as currently "X_iter" e.g.iterutils.pairwise_iter()
does)? I think this would be more consistent with standard python 3 behaviour.Similarly current
frange()
andxfrange()
are python 2-style matching range and xrange, but this seems weird whenxrange
doesn't exist in python 3. Tangentially,range
is a bit fancier than just being an iterator, such as with5 in range(1, 99999999999, 2)
working without eating all of your memory, and it would be ideal if anfrange
also had this behaviour.An instance of this outside of iterutils is with
.items()
and.iteritems()
indictutils.OrderedMultiDict
-- it could possibly be good for.items()
to behave the same as the built indict.items()
.