-
-
Notifications
You must be signed in to change notification settings - Fork 687
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tag updates #2817
Tag updates #2817
Conversation
…here on a new line' Some users mistakenly put the `py` on a different line than the backticks, or put the code on the same line as the `py`. This is intended to subtly prompt readers not to do this.
The previous version began with "Iterating over range-len is a common approach ...", which sounds like an endorsement. Also removed "is guaranteed to produce elements in the same order", as I don't think anyone is actually confused about that. (I wrote the previous version--this is a criticism of my own writing.)
title: "Comparisons to `True` and `False`" | ||
--- | ||
It's tempting to think that if statements always need a comparison operator like `==` or `!=`, but this isn't true. | ||
If you're just checking if a value is truthy or falsey, you don't need `== True` or `== False`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
truthy or falsey
Should we expand on what these mean?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I lean towards no. It would make the scope of the tag a lot bigger and is not necessarily relevant to the reader. As is, newbies can make an assumption about what they mean and still understand the rest or they can ask what they mean. Either are good outcomes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
title: "Comparisons to `True` and `False`" | ||
--- | ||
It's tempting to think that if statements always need a comparison operator like `==` or `!=`, but this isn't true. | ||
If you're just checking if a value is truthy or falsey, you don't need `== True` or `== False`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I lean towards no. It would make the scope of the tag a lot bigger and is not necessarily relevant to the reader. As is, newbies can make an assumption about what they mean and still understand the rest or they can ask what they mean. Either are good outcomes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me, thanks
This PR updates two tags and introduces a new one about comparisons to True and False.
Regarding the new tag, I'm open to suggestions (and destructive criticism) about using vertical space more sparingly in the code section. I don't like having
my_func(user_input)
four times, but I'm worried that having...
on the same line as the if statements will be confusing for beginners.