def item_deletion(options):
if not options.mutable:<EOL><INDENT>mapping = options.constructor({'<STR_LIT:foo>': '<STR_LIT:bar>'})<EOL>try:<EOL><INDENT>del mapping.foo<EOL><DEDENT>except TypeError:<EOL><INDENT>pass<EOL><DEDENT>except AttributeError:<EOL><INDENT>pass<EOL><DEDENT>else:<EOL><INDENT>raise AssertionError('<STR_LIT>')<EOL><DEDENT>def item(mapping):<EOL><INDENT>"""<STR_LIT>"""<EOL>del mapping['<STR_LIT:foo>']<EOL><DEDENT>assert_raises(TypeError, item, mapping)<EOL>assert_equals(mapping, {'<STR_LIT:foo>': '<STR_LIT:bar>'})<EOL>assert_equals(mapping.foo, '<STR_LIT:bar>')<EOL>assert_equals(mapping['<STR_LIT:foo>'], '<STR_LIT:bar>')<EOL><DEDENT>else:<EOL><INDENT>mapping = options.constructor(<EOL>{'<STR_LIT:foo>': '<STR_LIT:bar>', '<STR_LIT>': '<STR_LIT>', '<STR_LIT>': True, '<STR_LIT>': '<STR_LIT:value>'}<EOL>)<EOL>del mapping.foo<EOL>assert_false('<STR_LIT:foo>' in mapping)<EOL>del mapping['<STR_LIT>']<EOL>assert_false('<STR_LIT>' in mapping)<EOL>def del_hidden():<EOL><INDENT>"<STR_LIT>"<EOL>del mapping._hidden<EOL><DEDENT>try:<EOL><INDENT>del_hidden()<EOL><DEDENT>except KeyError:<EOL><INDENT>pass<EOL><DEDENT>except TypeError:<EOL><INDENT>pass<EOL><DEDENT>else:<EOL><INDENT>assert_false("<STR_LIT>")<EOL><DEDENT>assert_true('<STR_LIT>' in mapping)<EOL>del mapping['<STR_LIT>']<EOL>assert_false('<STR_LIT>' in mapping)<EOL>def del_get():<EOL><INDENT>"<STR_LIT>"<EOL>del mapping.get<EOL><DEDENT>assert_raises(TypeError, del_get)<EOL>assert_true('<STR_LIT>' in mapping)<EOL>assert_true(mapping.get('<STR_LIT>'), '<STR_LIT:value>')<EOL>del mapping['<STR_LIT>']<EOL>assert_false('<STR_LIT>' in mapping)<EOL>assert_true(mapping.get('<STR_LIT>', '<STR_LIT>'), '<STR_LIT>')<EOL><DEDENT>
Remove a key-value from to an {cls}