Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

final-class

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

final-class

Final classes for Python 3

  • 0.2.0
  • PyPI
  • Socket score

Maintainers
1

final_class

wemake.services Build Status Coverage Status wemake-python-styleguide

Final classes for python3.6+.

Features

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

Why?

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.

Installation

pip install final_class

Usage

from final_class import final


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


class Error(Example):  # Raises `TypeError`
    ...

More?

Do you want more? Check out:

License

MIT.

Keywords

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc