IPython Documentation

Table Of Contents

Previous topic

Module: utils.PyColorize

Next topic

Module: utils.codeutil

This Page

Warning

This documentation is for an old version of IPython. You can find docs for newer versions here.

Module: utils.attic

Older utilities that are not being used.

WARNING: IF YOU NEED TO USE ONE OF THESE FUNCTIONS, PLEASE FIRST MOVE IT TO ANOTHER APPROPRIATE MODULE IN IPython.utils.

2 Classes

class IPython.utils.attic.EvalDict

Emulate a dict which evaluates its contents in the caller’s frame.

Usage: >>> number = 19

>>> text = "python"
>>> print "%(text.capitalize())s %(number/9.0).1f rules!" % EvalDict()
Python 2.1 rules!
class IPython.utils.attic.NotGiven

8 Functions

IPython.utils.attic.mutex_opts(dict, ex_op)

Check for presence of mutually exclusive keys in a dict.

Call: mutex_opts(dict,[[op1a,op1b],[op2a,op2b]...]

IPython.utils.attic.all_belong(candidates, checklist)

Check whether a list of items ALL appear in a given list of options.

Returns a single 1 or 0 value.

IPython.utils.attic.belong(candidates, checklist)

Check whether a list of items appear in a given list of options.

Returns a list of 1 and 0, one for each candidate given.

IPython.utils.attic.with_obj(object, **args)

Set multiple attributes for an object, similar to Pascal’s with.

Example: with_obj(jim,

born = 1960, haircolour = ‘Brown’, eyecolour = ‘Green’)

Credit: Greg Ewing, in http://mail.python.org/pipermail/python-list/2001-May/040703.html.

NOTE: up until IPython 0.7.2, this was called simply ‘with’, but ‘with’ has become a keyword for Python 2.5, so we had to rename it.

IPython.utils.attic.map_method(method, object_list, *args, **kw) → list

Return a list of the results of applying the methods to the items of the argument sequence(s). If more than one sequence is given, the method is called with an argument list consisting of the corresponding item of each sequence. All sequences must be of the same length.

Keyword arguments are passed verbatim to all objects called.

This is Python code, so it’s not nearly as fast as the builtin map().

IPython.utils.attic.import_fail_info(mod_name, fns=None)

Inform load failure for a module.

IPython.utils.attic.popkey(dct, key, default=<class IPython.utils.attic.NotGiven at 0x10f6e5e20>)

Return dct[key] and delete dct[key].

If default is given, return it if dct[key] doesn’t exist, otherwise raise KeyError.

IPython.utils.attic.wrap_deprecated(func, suggest='<nothing>')