On this page
  1. typing.SupportsFloat
  2. Import
  3. Signature & Overview
  4. Usage
  5. Gotchas
  6. REPL Inspect

typing.SupportsFloat

Prev: typing.SupportsComplex | Up: typing | Next: typing.SupportsIndex
Rel: typing.AbstractSet, typing.Annotated, typing.Any, typing.assert_never
Ref: docs.python.org — typing.SupportsFloat
Tags: #public #python3 #stdlib #typing


Import

import typing
from typing import SupportsFloat

Signature & Overview

typing.SupportsFloat(*args, **kwargs)

A protocol with one abstract method float.

Usage

from decimal import Decimal
from typing import SupportsFloat

assert isinstance(Decimal("1.5"), SupportsFloat)

Gotchas

REPL Inspect

from typing import SupportsFloat
help(SupportsFloat)

Linked from

Related notes