Skip to main content

Final classes for Python 3

Project description

final_class Build Status Coverage Status wemake-python-styleguide

Final classes for python3.6+.


  • No metaclass conflicts
  • No runtime overhead
  • No dependencies
  • Type hints included, PEP-561 and PEP-591 compatible
  • Designed to be as simple as possible


In languages like java we have a nice way to restrict subclassing any class by making it final:

public final class SomeClass {
  // ...

In python we don't have such feature out of the box. That's where final_class library comes in!

This package works perfectly with @final from typing. So, with final_class you will have both type-checking and runtime checks.


pip install final_class


from final_class import final

class Example(object):  # You won't be able to subclass it!

class Error(Example):  # Raises `TypeError`


Do you want more? Check out:



Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for final-class, version 0.2.0
Filename, size File type Python version Upload date Hashes
Filename, size final_class-0.2.0-py3-none-any.whl (4.5 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size final-class-0.2.0.tar.gz (3.5 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page