A ternary would make even more sense than explicit else in the last case:
def check_link(link) -> bool: return if is_internal_link(link) { check_internal_link(link) } else { check_external_link(link) }
def check_link(link) -> bool: return is_internal_link(link) ? check_internal_link(link) : check_external_link(link)
Unfortunately, python ternary looks like this:
def check_link(link) -> bool: return check_internal_link(link) if is_internal_link(link) else check_external_link(link)
how do you even format this?
def check_link(link) -> bool: return check_internal_link(link) if is_internal_link(link) # this is the condition for the above lol else check_external_link(link)
Yeah. As a rule I avoid ternary stuff in Python.
But this is a topic for an other discussion ;)
Don't see you in the comments there, whereas I have already laid my 💩posting.
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
A ternary would make even more sense than explicit else in the last case:
Unfortunately, python ternary looks like this:
how do you even format this?
Yeah. As a rule I avoid ternary stuff in Python.
But this is a topic for an other discussion ;)
Don't see you in the comments there, whereas I have already laid my 💩posting.