def _detach_child(self, child):
if child.parent is not self:<EOL><INDENT>raise UsageError('<STR_LIT>'.format(child, child.parent, self))<EOL><DEDENT>for widget in child.__yield_self_and_all_children():<EOL><INDENT>widget.do_detach()<EOL>widget.dispatch_event('<STR_LIT>', widget)<EOL>widget._ungrab_mouse()<EOL>widget._undraw()<EOL>widget.__root = None<EOL><DEDENT>self.__children.discard(child)<EOL>child.__parent = None<EOL>child.__group = None<EOL>child.__rect = None<EOL>self.dispatch_event('<STR_LIT>', self, child)<EOL>return child<EOL>
Detach a child from this widget.

This method checks to make sure the child is currently attached to this 
widget, undraws the child, resets several of the child's attributes 
that might have been set by this widget, and removes the child from an 
internal list of children widgets.

This method is only meant to be called in subclasses of Widget, which 
is why it's prefixed with an underscore.