Exception Attributes
BaseException.args — exception attribute
Inspect the positional payload carried by an exception. A message is often a single argument, but an exception may store several values or none. Subclasses can interpret or reshape arguments; for example, OSError can keep file paths outside args. Do not parse str(error) to recover structured information.
Formal Syntax & Structure
python syntaxpython
error.argsReturn Value
tuple
Stored positional argument tuple.
Working Example
Example Snippetpython
error = ValueError("quantity", -2)print(error.args)print(ValueError().args)