by trufas · 4y ago · 0 comments
`print([x + 1 for x in [1, 2, 3])`
I agree that the ruby approach is better in terms of consistency, but most developers will be aware of the conventions python uses.
I'm experienced in ruby, and learning python for a project. I don't think I'll ever not wince when using python's ternary;
ruby: size = (waist > 30) ? 'large' : 'small'
python: size = 'large' if (waist > 30) else 'small'
If Ruby gets a good machine learning library on par with something like Pytorch, I am sure many folks will shift to it and we might see new DSL emerge.