News for hackers. Stuff that matters.
Re:It's React, but in Python by lelanthran on Wednesday June 07, 2023 @12:50AM (#36222971)
> Fairly simple things like [1,2] < [10,2] return false (unlike every other language I’ve ever used)

What other languages, besides Python, does this builtin list comparison work in? What's the result when the comparison is `[1, 2] < ["10", "2"]`?

Re:It's React, but in Python by CJefferson on Wednesday June 07, 2023 @01:42AM (#36223284)
List comparison works lexicographically in Haskell, C++ (using std::vector or std::array), Rust, GAP, every language I personally use.

Comparing strings and bits is always going to be weird, so I’ve not tested it.

Re:It's React, but in Python by s-lambert on Wednesday June 07, 2023 @01:12AM (#36223104)
I've never seen this usage of list comparison before but apparently it works in Rust (both of these print true):

println!("{}", vec![1, 2] < vec![10, 2]); println!("{}", (1, 2) < (10, 2));