Remix.run Logo
motorest 16 hours ago

> Python was used as an example because people know Python and reader can compare it to something known.

I don't think you understood the point I made.

My point is that Python supports conditional expressions for years.

Support for conditional expressions already means that in Python indeed "if is just a function".

Therefore, the whole premise of the article is null and void, and the article is thus pointless.

This is evident to anyone who is familiar with Python. If you have any experience with Python and you are familiar with idiomatic Python and basic features such as list comprehension, you are already widely aware how "if is just a function".

> I wasn't trying to make Python look awkward. I was trying to write equivalent Python (...)

Except you didn't. You failed to even acknowledge that Python already supports "if is just a function" with basic aspects such as list comprehension.

This basic aspect of Python is covered quite prominently in intros to Python, but somehow you failed to even acknowledge it exists, and proceeded to base your argument on a patently false claim.

middayc 16 hours ago | parent [-]

If Python has special syntax for `if` and so makes if an expression, it doesn't mean that `if` is a function.

If `if` is a function why don't you call it like other functions in Python?

    if( .... )
Functions are first class in Python now AFAIK. Can you assign `if` to a variable?

Also, blog-posts is not just about `if`, is `for` a function in Python, `def`, `return`, `class`?