liveBook · Manning

Positional argument

A positional argument is a function argument associated with a parameter according to its ordinal position in the call rather than its name.

How 3 Manning books explain it

Python How-To

A positional argument is a function argument whose value is associated with a parameter according to its position in the call.

How it is used
Uses positional arguments to make Python function and constructor calls concise while deciding when calls need more flexibility.
How deep it goes
Defines position-based matching and works through `*args` tuple packing and parameter order, without descending into interpreter internals.
Examples
Demonstrates tuple packing with `stringify` and three positional values in a `Task` constructor.
What you can do after
Apply it via Python calls and `*args` to match values by position and accept variable numbers of inputs when needed.

Read how Python How-To explains positional argument →

Django in Action

A Python positional argument is an argument assigned to a parameter according to its position in the argument list.

How it is used
Explains how command-line scripts receive ordered data and distinguishes positional values from optional behavior flags.
How deep it goes
Defines positional placement, contrasts flags, and stops short of implementing a positional Django command.
Examples
Uses Unix zip positions, Django musician filters, and ORM creation that requires named field values.
What you can do after
Apply positional arguments in command-line interfaces and choose keyword arguments when calling Django’s generic ORM create method.

Read how Django in Action explains positional argument →

The Quick Python Book, Fourth Edition

A positional parameter is a function argument identified by its ordinal position in the argument list.

How it is used
Uses argument order to call functions, format strings, and parse required command-line inputs.
How deep it goes
Explains order matching, defaults, mixed syntax, variadic capture, formatting indexes, and argparse requirements without implementation internals.
Examples
Demonstrates power calculations, numbered format fields, mixed function calls, and an argparse script.
What you can do after
Apply positional arguments to define and call functions, format strings, and configure required argparse inputs.

Read how The Quick Python Book, Fourth Edition explains positional argument →

Related concepts

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.