{{ fullname | escape | underline}}

.. currentmodule:: {{ module }}

.. autoclass:: {{ objname }}
   :show-inheritance:

   {% block attributes %}
   {% if attributes %}
   .. rubric:: {{ _('Attributes') }}

   .. autosummary::
   {% for item in attributes if item not in inherited_members %}
      ~{{ name }}.{{ item }}
   {%- endfor %}

   {%- for item in attributes if item not in inherited_members %}

   .. autoattribute:: {{ item }}
   {%- endfor %}
   {% endif %}
   {% endblock %}

   {% block methods %}
   {%- set is_protocol = '__protocol_attrs__' in members and '__protocol_attrs__' not in inherited_members %}
   {%- set ns = namespace(protocol_methods=[]) %}
   {%- if is_protocol %}
   {%- for item in all_methods %}
   {%- if item.startswith('_') and not item.startswith('__') and item.endswith('_') and not item.endswith('__') %}
   {%- set ns.protocol_methods = ns.protocol_methods + [item] %}
   {%- endif %}
   {%- endfor %}
   {%- endif %}
   {% if methods or ns.protocol_methods %}
   .. rubric:: {{ _('Methods') }}

   .. autosummary::
   {% for item in methods if item not in inherited_members and item != '__init__' %}
      ~{{ name }}.{{ item }}
   {%- endfor %}
   {%- for item in ns.protocol_methods if item not in inherited_members %}
      ~{{ name }}.{{ item }}
   {%- endfor %}

   {%- for item in methods if item not in inherited_members and item != '__init__' %}

   .. automethod:: {{ item }}
   {%- endfor %}
   {%- for item in ns.protocol_methods %}

   .. automethod:: {{ item }}
   {%- endfor %}
   {% endif %}
   {% endblock %}

