---
source: https://iinventedlight.com/library/notes/python-inspect-signature.md
title: "Get a callable's signature with inspect.signature"
license: CC-BY-4.0
license_url: https://creativecommons.org/licenses/by/4.0/
source_license: "Public-Domain (Python PEPs); PSF-2.0 (Python docs); prose restates cited source lines in own words"
license_family: mixed-green
attribution: "Summary by iinventedlight (AI-assisted). Sources: Python PEPs, PEP 362 – Function Signature Object; Python docs, inspect — Inspect live objects. Public-Domain; PSF-2.0."
author: "iinventedlight (synthesis of cited sources); text drafted with AI assistance"
date: 2026-11-19
status: published
approved_by: "Cole Withington, 2026-11-20 13:14 PT: \"Publish the full batch and rewrite the 6 live notes\""
checked_on: 2026-11-19
as_of: 2026-11-19
confidence: medium
untested: "Not reproduced (2026-11-19). Official docs and source files were read; no test suite, server, or API call was run for this note."
category: coding-references
topic_area: "code-python: inspect.signature and PEP 362"
tags: [python, inspect, signature, pep-362]
client: Librarian
sources:
  - id: S1
    title: "PEP 362 – Function Signature Object"
    publisher: Python PEPs
    url: https://peps.python.org/pep-0362/
    accessed: 2026-11-19
    license: "Public-Domain"
  - id: S2
    title: "inspect — Inspect live objects"
    publisher: Python docs
    url: https://docs.python.org/3/library/inspect.html
    accessed: 2026-11-19
    license: "PSF-2.0"
---
# Get a callable's signature with inspect.signature
**Answer:** The `Signature` object represents the call signature of a callable object and its return annotation. Retrieve it with the `signature()` function. PEP 362 proposes this representation because the older introspection data was spread across a half-dozen deeply nested attributes.

## What you get

`inspect.signature(callable)` returns a `Signature` for the given callable. The object also has a return annotation. Parameter objects and `BoundArguments` are part of the same design in the PEP. Some functions may not be introspectable.

## Caching

The PEP discusses implicit caching of `Signature` objects. If the `Signature` object is cached, later changes to the function it describes will not be reflected in it. Caching can be always done manually.

| Signature | inspect |
|---|---|
| Signature | Call signature of a callable object and its return annotation |
| signature() | Function that retrieves a Signature |
| Parameter | Object in the PEP for one parameter |
| BoundArguments | Object for arguments bound to a signature |

## See also

- [python-functools](https://iinventedlight.com/library/notes/python-functools/)
- [python-typing-annotations](https://iinventedlight.com/library/notes/python-typing-annotations/)
- [python-dataclasses](https://iinventedlight.com/library/notes/python-dataclasses/)

## Claims

- id: C1
  claim: PEP 362 proposes a new representation for function signatures.
  source: S1
  evidence: "This PEP proposes a new representation for function signatures"

- id: C2
  claim: The Signature object represents a callable's call signature and return annotation.
  source: S2
  evidence: "The Signature object represents the call signature of a callable object"

- id: C3
  claim: inspect.signature() returns that object for a callable.
  source: S2
  evidence: "To retrieve a Signature object, use the signature() function"

## Sources

- [S1] PEP 362 – Function Signature Object. Python PEPs. https://peps.python.org/pep-0362/ . License: Public-Domain. Accessed 2026-11-19.

- [S2] inspect — Inspect live objects. Python docs. https://docs.python.org/3/library/inspect.html . License: PSF-2.0. Accessed 2026-11-19.

License: this note is CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Summary by iinventedlight (AI-assisted). Sources: Python PEPs, PEP 362 – Function Signature Object; Python docs, inspect — Inspect live objects. Public-Domain; PSF-2.0. Text was condensed and changed from the originals.

---

Agents: [/agents.md](/agents.md) | [/.well-known/agent-library.json](/.well-known/agent-library.json).
