[IPython-dev] [Ipython-svndiff] 2717 - improve callable alias inspection
Ville M. Vainio
Thu Sep 6 01:34:56 CDT 2007
On 9/6/07, Fernando Perez <firstname.lastname@example.org> wrote:
> On 9/5/07, email@example.com <firstname.lastname@example.org> wrote:
> > + try:
> > + ds = "Alias to the system command:\n %s" % obj
> > + except:
> > + ds = "Alias: " + str(obj)
> What is this bare 'except' clause trying to stop? Is it the
> IndexError from obj or a possible error on str()? Catch-all naked
We really have no certainty what "obj" will be anymore (even though
it's typically a 2-tuple), so we can fall back to just rendering str
representation of the object if we get an unknown exception. I.e.
except does not signal an error situation. If this masked some
exception raised in str, it would be raised again on next line.
In short, this particular except was for necessity (duck typing),
rather than laziness :-).
Ville M. Vainio - vivainio.googlepages.com
blog=360.yahoo.com/villevainio - g[mail | talk]='vivainio'
More information about the IPython-dev