GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — gh-98239: Document that `inspect.getsource()` can raise `TypeError` (… · python/cpython@202e16e

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • Doc/library
    • inspect.rst
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎Doc/library/inspect.rst‎

Copy file name to clipboardExpand all lines: Doc/library/inspect.rst
+4Lines changed: 4 additions & 0 deletions
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -553,6 +553,8 @@ Retrieving source code
553553
object and the line number indicates where in the original source file the first
554554
line of code was found. An :exc:`OSError` is raised if the source code cannot
555555
be retrieved.
556+
A :exc:`TypeError` is raised if the object is a built-in module, class, or
557+
function.
556558

557559
.. versionchanged:: 3.3
558560
:exc:`OSError` is raised instead of :exc:`IOError`, now an alias of the
@@ -565,6 +567,8 @@ Retrieving source code
565567
class, method, function, traceback, frame, or code object. The source code is
566568
returned as a single string. An :exc:`OSError` is raised if the source code
567569
cannot be retrieved.
570+
A :exc:`TypeError` is raised if the object is a built-in module, class, or
571+
function.
568572

569573
.. versionchanged:: 3.3
570574
:exc:`OSError` is raised instead of :exc:`IOError`, now an alias of the

0 commit comments

Comments
0 (0)
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.