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

typing.SupportsInt

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


Import

import typing
from typing import SupportsInt

Signature & Overview

typing.SupportsInt(*args, **kwargs)

A protocol with one abstract method int.

Usage

from typing import SupportsInt

assert isinstance(3.9, SupportsInt) and int(3.9) == 3

Gotchas

REPL Inspect

from typing import SupportsInt
help(SupportsInt)

Linked from

Related notes