ptypes module

This module provides several pseudo-type definitions which can be enforced and/or validated with custom contracts defined using the pexdoc.pcontracts module

Pseudo-types

FileName

String with a valid file name

FileNameExists

String with a file name that exists in the file system

Function

Callable pointer or None

NonNegativeInteger

Integer greater or equal to zero

NonNullString

String of length 1 or higher

OffsetRange

Number in the [0, 1] range

PositiveRealNum

Integer or float greater than zero or None

RealNum

Integer, float or None

Contracts