|
|
|
|
|
by Mikeb85
1622 days ago
|
|
Ok, that's a nicer result (obviously I don't write Python lol) but still seems inconsistent to me (putting the function before the array) considering Python is an OO language and most people are going to be writing methods for classes where you call methods with dot. I just remember list comprehensions from Coffee-script and not going to lie, I hate them. It's like reading backwards. |
|
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'