New submission from Thomas Kluyver:

This came up in IPython & Jedi: several functions in inspect end up calling 
getfile(). If the object is something for which it can't find the source file, 
it throws an error, the message for which contains the object's repr.

This is problematic for us because for some objects the repr may be expensive 
to calculate (e.g. data tables where the repr forms primary output, not just 
debugging information). In some cases, it could also throw another error.

I plan to make a PR for this, but I'm opening an issue so I've got a bpo number.

https://github.com/ipython/ipython/issues/10493
https://github.com/davidhalter/jedi/issues/919

----------
components: Library (Lib)
messages: 295782
nosy: takluyver
priority: normal
severity: normal
status: open
title: inspect.getfile(obj) calls object repr on failure
type: behavior

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue30639>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to