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

typing.final

Prev: typing.Final | Up: typing | Next: typing.ForwardRef
Rel: typing.AbstractSet, typing.Annotated, typing.Any, typing.assert_never
Ref: docs.python.org — typing.final
Tags: #public #python3 #stdlib #typing


Import

import typing
from typing import final

Signature & Overview

typing.final(f)

Decorator to indicate final methods and final classes.

Usage

from typing import final

@final
class Sealed:
    pass

assert Sealed.__final__ is True

Gotchas

REPL Inspect

from typing import final
help(final)

Linked from

Related notes