-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Closed
Description
Sequentially rejecting/selecting properties of list items isn’t powerful enough.
E.g. I’d like to do the following in a Sphinx autosummary template:
{% set shown_meths = [
m for m in methods
if m in abstract_methods or m not in inherited_methods
] %}
{% if shown_meths %}
.. rubric:: Methods
{% for item in shown_meths %}
.. automethod:: {{ item }}
{%- endfor %}
{% endif %}but that seems unnecessarily complex, and impossible if I care about not changing the order:
{% set regular_shown = methods | reject("in", inherited_methods) %}
{% set abstract_shown = abstract_methods | reject("in", abstract_shown) %}
{% set shuffled_shown_methods = regular_shown + abstract_shown %}Metadata
Metadata
Assignees
Labels
No labels