{
  "__type": "IngestedDoc",
  "__tag": 4010,
  "_content": {
    "Notes": {
      "__type": "Section",
      "__tag": 4015,
      "children": [],
      "title": [],
      "level": 0,
      "target": null
    },
    "Warns": {
      "__type": "Section",
      "__tag": 4015,
      "children": [],
      "title": [],
      "level": 0,
      "target": null
    },
    "Raises": {
      "__type": "Section",
      "__tag": 4015,
      "children": [],
      "title": [],
      "level": 0,
      "target": null
    },
    "Yields": {
      "__type": "Section",
      "__tag": 4015,
      "children": [],
      "title": [],
      "level": 0,
      "target": null
    },
    "Methods": {
      "__type": "Section",
      "__tag": 4015,
      "children": [],
      "title": [],
      "level": 0,
      "target": null
    },
    "Returns": {
      "__type": "Section",
      "__tag": 4015,
      "children": [],
      "title": [],
      "level": 0,
      "target": null
    },
    "Summary": {
      "__type": "Section",
      "__tag": 4015,
      "children": [
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "Mixin class that provides services by which objects can register listeners to changes on that object."
            }
          ]
        }
      ],
      "title": [],
      "level": 0,
      "target": null
    },
    "Receives": {
      "__type": "Section",
      "__tag": 4015,
      "children": [],
      "title": [],
      "level": 0,
      "target": null
    },
    "Warnings": {
      "__type": "Section",
      "__tag": 4015,
      "children": [],
      "title": [],
      "level": 0,
      "target": null
    },
    "Attributes": {
      "__type": "Section",
      "__tag": 4015,
      "children": [],
      "title": [],
      "level": 0,
      "target": null
    },
    "Parameters": {
      "__type": "Section",
      "__tag": 4015,
      "children": [],
      "title": [],
      "level": 0,
      "target": null
    },
    "Extended Summary": {
      "__type": "Section",
      "__tag": 4015,
      "children": [
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "All methods provided by this class are underscored, since this is intended for internal use to communicate between classes in a generic way, and is not machinery that should be exposed to users of the classes involved."
            }
          ]
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "Use the "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "_add_listener"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " method to register a listener on an instance of the notifier.  This registers the listener with a weak reference, so if no other references to the listener exist it is automatically dropped from the list and does not need to be manually removed."
            }
          ]
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "Call the "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "_notify"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " method on the notifier to update all listeners upon changes.  "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "_notify('change_type', *args, **kwargs)"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " results in calling "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "listener._update_change_type(*args, **kwargs)"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " on all listeners subscribed to that notifier."
            }
          ]
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "If a particular listener does not have the appropriate update method it is ignored."
            }
          ]
        }
      ],
      "title": [],
      "level": 0,
      "target": null
    },
    "Other Parameters": {
      "__type": "Section",
      "__tag": 4015,
      "children": [],
      "title": [],
      "level": 0,
      "target": null
    }
  },
  "_ordered_sections": [
    "Summary",
    "Extended Summary",
    "Parameters",
    "Attributes",
    "Methods",
    "Returns",
    "Yields",
    "Receives",
    "Other Parameters",
    "Raises",
    "Warns",
    "Warnings",
    "Notes"
  ],
  "item_file": "/astropy/io/fits/util.py",
  "item_line": 33,
  "item_type": "class",
  "aliases": [
    "astropy.io.fits.column.NotifierMixin"
  ],
  "example_section_data": {
    "__type": "Section",
    "__tag": 4015,
    "children": [
      {
        "__type": "Code",
        "__tag": 4050,
        "value": "class Widget(NotifierMixin):\n    state = 1\n    def __init__(self, name):\n        self.name = name\n    def update_state(self):\n        self.state += 1\n        self._notify('widget_state_changed', self)\nclass WidgetListener:\n    def _update_widget_state_changed(self, widget):\n        print('Widget {0} changed state to {1}'.format(\n            widget.name, widget.state))\nwidget = Widget('fred')\nlistener = WidgetListener()\nwidget._add_listener(listener)\nwidget.update_state()\n",
        "execution_status": "success",
        "out": "Widget fred changed state to 2\n"
      }
    ],
    "title": [],
    "level": 0,
    "target": null
  },
  "see_also": [],
  "signature": {
    "__type": "SignatureNode",
    "__tag": 4029,
    "kind": "function",
    "parameters": [],
    "return_annotation": {
      "__type": "Empty",
      "__tag": 4031
    },
    "target_name": "NotifierMixin"
  },
  "references": null,
  "qa": "astropy.io.fits.util:NotifierMixin",
  "arbitrary": [],
  "local_refs": []
}