Operators

+ — Unary positive

Applies the unary positive operation. For ordinary int, float and complex values it preserves the numeric value, though +True produces an int. It is not a general conversion or copying operation. Custom __pos__ implementations can return a different object; Decimal unary plus, for example, is affected by its arithmetic context. Unary operators bind more tightly than multiplication but less tightly than a power on their right.

Formal Syntax & Structure

python syntaxpython
+operand

Parameters & Attributes

NameTypeDescription
operandnumber or supporting objectValue to transform.

Return Value

number or custom result

Numeric result for supported built-in numbers; custom methods can return other objects.

Working Example

Example Snippetpython
print(+7)print(+-3)print(type(+True).__name__)
Python Reference