-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
[New Concept Documents] : comparisons concept #2456 #2733
Conversation
Hi & Welcome! 👋🏽 👋 Thank you for contributing to This is an automated [🤖 🤖 ] comment for the
|
|
✅️ Have You Checked:
.
|
🛠️ Maintainers
Please take note 📒 of the following sections/review items 👀 ✨
🌈 Acknowledgements and Reputation
|
💫 General Code Quality
- The branch was updated & rebased with any (recent) upstream changes.
- All prose was checked for spelling and grammar.
- Files are formatted via yapf (yapf config) & conform to our coding standards
- Files pass flake8 with flake8 config & pylint with pylint config.
- Changed
example.py
/exemplar.py
files still pass their associated test files. - Changed test files still work with associated
example.py
/exemplar.py
files.- Check that tests fail properly, as well as succeed.
(e.g., make some tests fail on purpose to "test the tests" & failure messages).
- Check that tests fail properly, as well as succeed.
- All files have proper EOL.
- If a
JinJa2
template was modified/created, was the test file regenerated?- Does the regenerated test file successfully test the exercises
example.py
file?
- Does the regenerated test file successfully test the exercises
- The branch passes all CI checks &
configlet-lint
.
Verify: |
🌿 Changes to Concept Exercises
- ❓ Are all required files still up-to-date & configured correctly for this change?_
- ❓ Does
<exercise>/.meta/design.md
need to be updated with new implementation/design decisions - ❓ Do these changes require follow-on/supporting changes to related concept documents?
- Exercise
introduction.md
- Do all code examples compile, run, and return the shown output?
- Are all the code examples formatted per the Python docs?
- Exercise
instructions.md
- Exercise
hints.md
- Check that exercise
design.md
was fulfilled or edited appropriately - Exercise
exemplar.py
- Only uses syntax previously introduced or explained.
- Is correct and appropriate for the exercise and story.
- Exercise
<exercise_name>.py
(stub)- Includes appropriate docstrings and function names.
- Includes
pass
for each function - Includes an EOL at the end
- Exercise
<exercise_name>_test.py
- Tests cover all (reasonable) inputs and scenarios
- At least one test for each task in the exercise
- If using subtests or fixtures they're formatted correctly for the runner
- Classnames are
<ExerciseName>Test
- Test functions are
test_<test_name>
- Exercise
config.json
--> valid UUID4 - Corresponding concept
introduction.md
- Corresponding concept
about.md
- Concept
config.json
- All Markdown Files : Prettier linting (for all markdown docs)
- All Code files: PyLint linting (except for test files)
- All files with text: Spell check & grammar review.
✨ Where applicable, check the following ✨
(as a reminder: Concept Exercise Anatomy) |
🚀 Changes to Practice Exercises
-
.docs/instructions.md
(required)- Was this file updated and regenerated properly?
-
.docs/introduction.md
(optional) -
.docs/introduction.append.md
(optional) -
.docs/instructions.append.md
(optional)- Are any additional instructions needed/provided?
(e.g. error handling or information on classes)
- Are any additional instructions needed/provided?
-
.docs/hints.md
(optional)- Was this file regenerated properly?
-
.meta/config.json
(required) -
.meta/example.py
(required)- Does this pass all the current tests as written/generated?
-
.meta/design.md
(optional) -
.meta/template.j2
(template for generating tests from canonical data)- Was a test file properly regenerated from this template?
-
.meta/tests.toml
- Are there additional test cases to include or exclude?
- Are there any Python-specific test cases needed for this exercise?
-
<exercise-slug>_test.py
- Does this file need to be regenerated?
- Does this file correctly test the
example.py
file? - Does this file correctly report test failures and messages?
-
<exercise-slug>.py
(required)- Does this stub have enough information to get
the student started coding a valid solution?
- Does this stub have enough information to get
Is the exercise is in line with Practice Exercise Anatomy? |
🐣 Brand-New Concept Exercises
- Exercise
introduction.md
- Do all code examples compile, run, and return the shown output?
- Are all the code examples formatted per the Python docs?
- Exercise
instructions.md
- Exercise
hints.md
- Check that exercise
design.md
was fulfilled or edited appropriately - Exercise
exemplar.py
- Only uses syntax previously introduced or explained.
- Is correct and appropriate for the exercise and story.
- Exercise
<exercise_name>.py
(stub)- Includes appropriate docstrings and function names.
- Includes
pass
for each function - Includes an EOL at the end
- Exercise
<exercise_name>_test.py
- Tests cover all (reasonable) inputs and scenarios
- At least one test for each task in the exercise
- If using subtests or fixtures they're formatted correctly for the runner
- Classnames are
<ExerciseName>Test
- Test functions are
test_<test_name>
- Exercise
config.json
--> valid UUID4 - Corresponding concept
introduction.md
- Corresponding concept
about.md
- Concept
config.json
- All Markdown Files : Prettier linting (for all markdown docs)
- All Code files: Flake8 & PyLint linting
- All Code Examples: proper formatting and fencing. Verify they run in the REPL
- All files with text: Spell check & grammar review.
Is the exercise is in line with Concept Exercise Anatomy? |
Our 💖 for all your review efforts! 🌟 🦄
concepts/comparisons/about.md
Outdated
True | ||
>>> 5 == 5 | ||
True | ||
>>> 6 != 6 # not equal to |
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.
Line-end comments should have two spaces before the #
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.
Okay. Done
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'm not seeing the change. Did you forget to push it?
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.
Just pushed it. Check now
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.
@gurupratap-matharu - This is awesome work! Thank you so much for submitting this PR. 🌟 I do have some requested and suggested changes. Please feel free to disagree, or to discuss or ask any questions. 😄 Apologies for taking so long with the review.
concepts/comparisons/about.md
Outdated
|
||
The operators `in` and `not in` test for membership. `a` in `s` evaluates to `True` if `a` is a member of s, and `False` otherwise. `a not in s` returns the negation of `a in s`. | ||
|
||
For the string and bytes types, `a` in `s` is `True` if and only if `a` is a substring of `b`. |
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.
Again, we want to avoid single-letter variable names.
|
||
## Comparison Chaining | ||
|
||
Comparisons can be chained arbitrarily, e.g., `x < y <= z` is equivalent to `x < y` `and` `y <= z`, except that `y` is evaluated only once (but in both cases `z` is _not_ evaluated at all when `x < y` is found to be `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.
Besides omitting the code examples, I think I would make the same edits to the prose here as I did in the about.md
.
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.
Okay sounds good.
Now
- code blocks from
introduction.md
have been removed - prose is matched as per
about.md
Co-authored-by: BethanyG <[email protected]>
Co-authored-by: BethanyG <[email protected]>
Co-authored-by: BethanyG <[email protected]>
concepts/comparisons/about.md
Outdated
True | ||
>>> 5 == 5 | ||
True | ||
>>> 6 != 6 # not equal to |
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'm not seeing the change. Did you forget to push it?
Co-authored-by: BethanyG <[email protected]>
Co-authored-by: Isaac Good <[email protected]>
Co-authored-by: Isaac Good <[email protected]>
Co-authored-by: BethanyG <[email protected]>
Co-authored-by: Isaac Good <[email protected]>
Co-authored-by: BethanyG <[email protected]>
Co-authored-by: Isaac Good <[email protected]>
Co-authored-by: BethanyG <[email protected]>
There have been updates on this PR, mostly minor ones. I think overall we have collaboratively polished this a lot. Perhaps something might have escaped from my side as I'm switching a lot between the Github UI and the code editor. Would you be kind enough to review everything in totality? Let me know if anything is missing. |
concepts/comparisons/about.md
Outdated
83 | ||
>>> ord('c') | ||
99 | ||
>>> '龙波' < '王想' # chinese words |
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.
@gurupratap-matharu -- Please put the translation of the words in the comment. These don't actually appear to be valid words, but I might have the language wrong. Please also capitalize the language -- is this Mandarin or Cantonese or another Sinitic language?
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.
@BethanyG -- Sure! Earlier these words were abstract names.
- Now I've changed them to be common words
- Their English translations has been added
- You can verify these words on google translate. Just put language detection to be automatic.
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.
@gurupratap-matharu - I am not seeing a change to the text here? Did you push a change?
Apologies. The GitHub web interface is acting strange. I see the changes now.
concepts/comparisons/about.md
Outdated
>>> # let's try korean words | ||
>>> '이서윤' < '김은정' |
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.
Same comments as above. These don't appear to be Korean words, at leas none I can translate using Google. Could you add the translation to the comment please? Also -- Korean with a capital K. Thanks!
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.
Okay. I have changed the Korean words as well.
Try them as well on google translate.
>>> # let's try Korean words
>>> '예쁜' < '아름다운' # pretty < beautiful
False
>>> ord('예'), ord('아')
(50696, 50500)
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.
@gurupratap-matharu Did this change get made to the text? I'm not seeing it.
Apologies. The GitHub web interface is acting strange. I see the changes now.
Markdown style standards: one-sentence-per-line changes. Co-authored-by: Victor Goff <[email protected]>
@gurupratap-matharu -- I've made some additional comments, but will have to come back to this PR later today my time (PST). Thank you for all of your work on this! |
The GUI said "Approve changes" in a context that seemed to be limited only to the requested change, not the overall PR. (There are other changes pending).
Co-authored-by: BethanyG <[email protected]>
Co-authored-by: BethanyG <[email protected]>
This PR adds documentation for the Comparisons concept on the python track.
The following files are updated