IPython Documentation

Table Of Contents

Previous topic

Module: utils.warn

Next topic

Module: utils.zmqrelated

This Page

Module: utils.wildcard

Support for wildcard pattern matching in object inspection.


6 Functions


Return dictionaries mapping lower case typename (e.g. ‘tuple’) to type objects from the types package, and vice versa.

IPython.utils.wildcard.is_type(obj, typestr_or_type)

is_type(obj, typestr_or_type) verifies if obj is of a certain type. It can take strings or actual python types for the second argument, i.e. ‘tuple’<->TupleType. ‘all’ matches all types.

TODO: Should be extended for choosing more than one type.

IPython.utils.wildcard.show_hidden(str, show_all=False)

Return true for strings starting with single _ if show_all is true.


Produce a dictionary of an object’s attributes. Builds on dir2 by checking that a getattr() call actually succeeds.

IPython.utils.wildcard.filter_ns(ns, name_pattern='*', type_pattern='all', ignore_case=True, show_all=True)

Filter a namespace dictionary by name pattern and item type.

IPython.utils.wildcard.list_namespace(namespace, type_pattern, filter, ignore_case=False, show_all=False)

Return dictionary of all objects in a namespace dictionary that match type_pattern and filter.