def define_constrained_subtype(prefix, base, blockednames, clsdict=None):
name = prefix + base.__name__<EOL>clsdict = clsdict or {}<EOL>doc = clsdict.get('<STR_LIT>', '<STR_LIT>')<EOL>doc = '<STR_LIT>'.format(prefix, base.__name__, doc)<EOL>clsdict['<STR_LIT>'] = doc<EOL>setitem_without_overwrite(<EOL>clsdict,<EOL>'<STR_LIT>',<EOL>lambda self: iter(blockednames),<EOL>)<EOL>for bname in blockednames:<EOL><INDENT>setitem_without_overwrite(<EOL>clsdict,<EOL>bname,<EOL>ConstraintError.block(getattr(base, bname)),<EOL>)<EOL><DEDENT>return type(name, (base,), clsdict)<EOL>
Define a subtype which blocks a list of methods.

@param prefix: The subtype name prefix.  This is prepended to the
               base type name.  This convention is baked in for
               API consistency.

@param base: The base type to derive from.

@param blockednames: A list of method name strings.  All of these
                     will be blocked.

@param clsdict: None or a dict which will be modified to become the
                subtype class dict.

@return: The new subtype.

@raise: OverwriteError - If clsdict contains an entry in blockednames.