[IPython-dev] New display methods, should we fine-tune our naming decision?

Fernando Perez fperez.net at gmail.com
Tue Feb 1 13:36:07 EST 2011


Hi folks,

I was just thinking, before the new display infrastructure starts
getting used too much, should we adjust our convention to use
__repr_html__, __repr_svg__, __repr_*__ as a naming pattern instead of
__html__, __svg__, etc?  My concern is two-fold:

- the more generic names may be already in use by something else that
doesn't quite match our 'protocol', or python may in the future
(though this is probably needless paranoia) choose to add them.

- a more regular pattern makes it easier to collect all __repr_FOO__
methods from an object as part of our display machinery rather than
matching against a hard-coded list.

Thoughts?

f



More information about the IPython-dev mailing list