logoalt Hacker News

jimbokuntoday at 12:51 AM5 repliesview on HN

> Poetry does the same by default, using a format like >=1.23.4,<2.0.0. I find this less readable than ^1.23.4, but the effect is the same.

What???

I understood the first format instantly, but had no idea what the second meant until the author explained it.


Replies

pie_flavortoday at 1:52 AM

And then you look it up once, and now you know what it means forever. By contrast, the former expression is much wider with more going on, and furthermore you can't skim past it being sure nothing funny is going on because it may or may not be a range compatible with the latter form.

show 3 replies
saghmtoday at 1:02 AM

I don't know if there's a good source for where this convention started but it's not that uncommon; offhand, both npm[1] and Cargo[2] support that format.

[1]: https://docs.npmjs.com/about-semantic-versioning#using-seman... [2]: https://doc.rust-lang.org/cargo/reference/specifying-depende...

kjmrtoday at 1:40 AM

Once you know what the ^ means (I always think of “roof”), I do think that one character is easier to read than >=,<

jim33442today at 12:57 AM

I saw that ^ so many times in npm and never knew what it meant until now

skeledrewtoday at 1:22 AM

Same. I found that wild to take in.