The Volatility Framework
volatility.validity.ValidityRoutines Class Reference

Created on 4 May 2013. More...

Inheritance diagram for volatility.validity.ValidityRoutines:

Public Member Functions

def type_check (self, value, valid_type)
 Checks that value is an instance of valid_type, and returns value if it is, or throws a TypeError otherwise. More...
 
def class_check (self, klass, valid_class)
 Checks that class is an instance of valid_class, and returns klass if it is, or throws a TypeError otherwise. More...
 
def confirm (self, assertion, error)
 Acts like an assertion, but will not be disabled when debug is disabled.
 

Detailed Description

Created on 4 May 2013.

Author
: mike Class to hold all validation routines, such as type checking

Member Function Documentation

def volatility.validity.ValidityRoutines.class_check (   self,
  klass,
  valid_class 
)

Checks that class is an instance of valid_class, and returns klass if it is, or throws a TypeError otherwise.

:param klass: Class to validate :type klass: class :param valid_class: Valid class against which to check class validity :type valid_class: class

def volatility.validity.ValidityRoutines.type_check (   self,
  value,
  valid_type 
)

Checks that value is an instance of valid_type, and returns value if it is, or throws a TypeError otherwise.

:param value: The value of which to validate the type :type value: object :param valid_type: The type against which to validate :type valid_type: type


The documentation for this class was generated from the following file: