def connect(self, obj, trait_name):

        def listener(extension_registry, event):
            """ Listener called when an extension point is changed. """

            # If an index was specified then we fire an '_items' changed event.
            if event.index is not None:
                name = trait_name + '_items'
                old  = Undefined
                new  = event

            # Otherwise, we fire a normal trait changed event.
            else:
                name = trait_name
                old  = event.removed
                new  = event.added

            obj.trait_property_changed(name, old, new)

            return

        extension_registry = self._get_extension_registry(obj)

        # Add the listener to the extension registry.
        extension_registry.add_extension_point_listener(listener, self.id)

        # Save a reference to the listener so that it does not get garbage
        # collected until its associated object does.
        listeners = self._obj_to_listeners_map.setdefault(obj, {})
        listeners[trait_name] = listener

        return
Retrieve a Channel object for the channel ``name``, or None if we're
dataset/ETHPy150Open enthought/envisage/envisage/extension_point.py/ExtensionPoint.connect--crossover with--dataset/ETHPy150Open ecdavis/pants/pants/contrib/irc.py/IRCClient.channel