Skip to main content

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

CISC108-0.1.tar.gz (4.7 kB view details)

Uploaded Source

Built Distribution

CISC108-0.1-py3-none-any.whl (6.6 kB view details)

Uploaded Python 3

File details

Details for the file CISC108-0.1.tar.gz.

File metadata

  • Download URL: CISC108-0.1.tar.gz
  • Upload date:
  • Size: 4.7 kB
  • Tags: Source
  • Uploaded using 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

File hashes

Hashes for CISC108-0.1.tar.gz
Algorithm Hash digest
SHA256 f133aa35c9858af04afdf961f6abd7f0daca3c241d3a30c1f40fa331eeaa5f99
MD5 f97a8bf8dd9803661905a9c52c51a634
BLAKE2b-256 8b908e477265bbf72495c84131eb23787722021a864b22a1507f90adb0ea185b

See more details on using hashes here.

File details

Details for the file CISC108-0.1-py3-none-any.whl.

File metadata

  • Download URL: CISC108-0.1-py3-none-any.whl
  • Upload date:
  • Size: 6.6 kB
  • Tags: Python 3
  • Uploaded using 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

File hashes

Hashes for CISC108-0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 8d8ddc94fad311ca5e90e1b9b89c5052e2883807b2031e1875d828b08f45e448
MD5 188301e68865a4e172bad27638e80b43
BLAKE2b-256 ab8d1156b8a72b8a24326b6a8b2f06dd2d63e1262abd485fa27adf13ea6ab89f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page