From dbf61f02301233ae1c331b4d7726a26b97b33456 Mon Sep 17 00:00:00 2001 From: Google Colaboratory Team Date: Thu, 26 Feb 2026 10:44:54 -0800 Subject: [PATCH] No public description PiperOrigin-RevId: 875793109 --- google/colab/_inspector.py | 1 + google/colab/_reprs.py | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/google/colab/_inspector.py b/google/colab/_inspector.py index ef59a7cf..15e4358c 100644 --- a/google/colab/_inspector.py +++ b/google/colab/_inspector.py @@ -582,6 +582,7 @@ def info(self, obj, oname='', formatter=None, info=None, detail_level=0): if filename and ( filename.endswith(('.py', '.py3', '.pyc')) or 'ipython-input-' in filename + or 'ipykernel_' in filename ): out['file'] = filename diff --git a/google/colab/_reprs.py b/google/colab/_reprs.py index 982fcb2b..5d0c8bc7 100644 --- a/google/colab/_reprs.py +++ b/google/colab/_reprs.py @@ -286,7 +286,8 @@ def _function_repr(obj): ) result += html.escape(docs) + '' - if filename and 'ipython-input' not in filename: + jupyter_paths = ('ipython-input', 'ipykernel_') + if filename and all(path not in filename for path in jupyter_paths): line = oinspect.find_source_lines(obj) result += f"""