On this page
  1. numbers.Real
  2. Import
  3. Signature & Overview
  4. Methods & Attributes
  5. Usage
  6. Gotchas
  7. REPL Inspect

numbers.Real

Prev: numbers.Rational | Up: numbers
Rel: numbers.Complex, numbers.Integral, numbers.Number, numbers.Rational
Ref: docs.python.org — numbers.Real
Tags: #public #python3 #stdlib #numbers


Import

import numbers
from numbers import Real

Signature & Overview

numbers.Real()

To Complex, Real adds the operations that work on real numbers.

Methods & Attributes

Usage

import numbers

assert isinstance(3.14, numbers.Real) and isinstance(7, numbers.Real)
assert not isinstance(1 + 2j, numbers.Real)

Gotchas

REPL Inspect

from numbers import Real
help(Real)

Linked from

Related notes