Tools to help students write code.
Project description
CISC108 Support Library
A collection of tools to help students write code.
For now, mostly improved assertions.
Installation
Install from PyPi:
pip install cisc108
Or install from the https://github.com/UD-CIS-Teaching/cisc108-python-support-library
Examples
from cisc108 import assert_equal
def halve(number):
return number / 2
# Correctly handles floating points
assert_equal(halve(10), 5.0)
Output
This library will print a message to STDOUT if an assertion fails, and returns True/False. It does not raise an exception or print to STDERR.
Supported Types
Numbers: strictly compares numeric types, but allows floats to have imprecision, defaults to 4 places
Strings: can strictly compare types with exact_strings=True, but defaults to ignore whitespace on newlines and capitalization
Lists, Tuples: applies same rules to inner types as container types
Sets, Frozensets, Dictionary: checks that all elements are contained in both, in any order
Generators: functions like enumerate and .items() that produce generators are converted to lists and sets (as appropriate), then checked that their values match.
Other types should work as well, but require that the result of type match, and that x == y
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file CISC108-0.4.tar.gz
.
File metadata
- Download URL: CISC108-0.4.tar.gz
- Upload date:
- Size: 6.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/44.0.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f449ece972795417da94d33560d0ed9183c7fa23d9319e3ea1726283cd565a0f |
|
MD5 | 0050fcbcfca7df6af82195558ca522dd |
|
BLAKE2b-256 | 3faa5be83cee1a059e5d311e892e69f83878328a80c9f9bf17d152aa08904e4d |
File details
Details for the file CISC108-0.4-py3-none-any.whl
.
File metadata
- Download URL: CISC108-0.4-py3-none-any.whl
- Upload date:
- Size: 8.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/44.0.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3014eca3050e78cda837e50b60ed37f7b090feb96028989b6a6d665a963f1ee7 |
|
MD5 | 243b17c199c8ac005ebef2e7577a139f |
|
BLAKE2b-256 | fc7388e145b49ced6bd91a45cf7ab1120326bfb166c5cf860b5fde4a84c6b0da |