Skip to main content

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(add5(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

Release files for CISC108 0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for CISC108 0.1
File Size Uploaded
CISC108-0.1.tar.gz 4.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for CISC108 0.1
File Interpreter ABI Platform
CISC108-0.1-py3-none-any.whl Python 3 none any Details

Total release size: 11.3 kB

Release files / CISC108-0.1.tar.gz

Download URL CISC108-0.1.tar.gz
Size 4.7 kB
Tags Source
SHA-256 checksum
How to use checksums
f133aa35c9858af04afdf961f6abd7f0daca3c241d3a30c1f40fa331eeaa5f99
BLAKE2b-256 checksum
How to use checksums
8b908e477265bbf72495c84131eb23787722021a864b22a1507f90adb0ea185b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.11.0 pkginfo/1.4.2 requests/2.18.4 setuptools/36.5.0.post20170921 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.5.4

Release files / CISC108-0.1-py3-none-any.whl

Download URL CISC108-0.1-py3-none-any.whl
Size 6.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8d8ddc94fad311ca5e90e1b9b89c5052e2883807b2031e1875d828b08f45e448
BLAKE2b-256 checksum
How to use checksums
ab8d1156b8a72b8a24326b6a8b2f06dd2d63e1262abd485fa27adf13ea6ab89f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.11.0 pkginfo/1.4.2 requests/2.18.4 setuptools/36.5.0.post20170921 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.5.4

Release history Release notifications | RSS feed

0.4

2 release files

This release

0.1 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page