#! /usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2011 Sebastian Pipping <sebastian@pipping.org>
# Licensed under GPL v3 or later

def _raise_type_error(value, wanted, got):
	raise TypeError('Value <%s> is of type "%s" but type "%s" is required' \
			% (str(value), wanted.__name__, got.__name__))

def require_type(wanted, value):
	got = type(value)
	if not got is wanted:
		_raise_type_error(value, wanted, got)
