This repository has been archived by the owner on Oct 25, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 112
Using docstrings and doctests #100
Labels
Comments
Closed
DavidScobie
added a commit
to DavidScobie/rse-classwork-2020
that referenced
this issue
Nov 18, 2020
Closed
DavidScobie
added a commit
to DavidScobie/rse-classwork-2020
that referenced
this issue
Nov 18, 2020
umitozmen
added a commit
to umitozmen/rse-classwork-2020
that referenced
this issue
Nov 18, 2020
AndriusVaitkus97
added a commit
to AndriusVaitkus97/rse-classwork-2020
that referenced
this issue
Nov 18, 2020
Open
premal-varsani
added a commit
to premal-varsani/rse-classwork-2020
that referenced
this issue
Nov 18, 2020
This was referenced Nov 19, 2020
liamchalcroft
added a commit
to liamchalcroft/rse-classwork-2020
that referenced
this issue
Nov 19, 2020
Ebony59
added a commit
to Ebony59/rse-classwork-2020
that referenced
this issue
Nov 19, 2020
rmapjs1
added a commit
to rmapjs1/rse-classwork-2020
that referenced
this issue
Jan 6, 2021
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
This exercise will show why it is important to keep documentation accurate, and how to do this automatically using docstrings and doctests.
Setup
git pull upstream
)week06
(git checkout week06
)week06/average-squares-example/average_squares
foldersquares.py
fileUnderstanding
Exercises
As you may have discovered, the code in
squares.py
does contain some mistakes. Thankfully the functions in the file include documentation that explains how they should behave.Run the doctests
doctest
module to see whether the documentation of the code is accurate:python -m doctest squares.py
Update the docstrings
average_of_squares
function.average_of_squares
function that are incorrectCorrect the code and verify
doctest
to confirm that theaverage_of_squares
documentation is now correctRepeat the process for
convert_numbers
doctest
error from theconvert_numbers
documentation.Submit a Pull Request
Once you have completed or made progress on the exercises
Answers UCL-RITS/rse-classwork-2020#100
The text was updated successfully, but these errors were encountered: