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

typing.SupportsRound

Prev: typing.SupportsInt | Up: typing | Next: typing.Text
Rel: typing.AbstractSet, typing.Annotated, typing.Any, typing.assert_never
Ref: docs.python.org — typing.SupportsRound
Tags: #public #python3 #stdlib #typing


Import

import typing
from typing import SupportsRound

Signature & Overview

typing.SupportsRound(*args, **kwargs)

A protocol with one abstract method round that is covariant in its return type.

Usage

from typing import SupportsRound

assert isinstance(3.14159, SupportsRound) and round(3.14159, 2) == 3.14

Gotchas

REPL Inspect

from typing import SupportsRound
help(SupportsRound)

Linked from

Related notes