Callables.with_name_prefixes()

with_name_prefixes(prefixes: List[str], sensitivity: bool = True) → Callables

Adds a filter to get callables whose names have prefixes from the given list of prefixes. Returns a filtered Callables child object. This method can be called on all Callables child classes: Functions and Modifiers.

To filter given a single prefix, refer to Callables.with_name_prefix().

Functions Example

from glider import *

def query():
  # Retrieve the functions that have `min` or `max` as prefix
  functions = Functions().with_name_prefixes(["min", "max"]).exec(100)

  # Return the first five functions
  return functions[:4]

Modifiers Example

from glider import *

def query():
  # Retrieve the modifiers that have `before` or `after` as prefix
  modifiers = Modifiers().with_name_prefixes(["before", "after"]).exec(100)

  # Return the first five modifiers
  return modifiers[:4]

Output:

Last updated