Skip to main content

final_class

wemake.services Build Status

Final classes for python3.6+.

Features

  • No metaclass conflicts
  • No runtime overhead
  • No dependencies
  • Type hints included
  • 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!

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`
    ...

License

MIT.

Metadata

Release files for final-class 0.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for final-class 0.1.2
File Size Uploaded
final-class-0.1.2.tar.gz 2.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for final-class 0.1.2
File Interpreter ABI Platform
final_class-0.1.2-py3-none-any.whl Python 3 none any Details

Total release size: 6.3 kB

Release files / final-class-0.1.2.tar.gz

Download URL final-class-0.1.2.tar.gz
Size 2.8 kB
Tags Source
SHA-256 checksum
How to use checksums
b4f180dadb90cc8c0228d6b6e4b41398bc885cc13c7e99c545fa12478c0d66ce
BLAKE2b-256 checksum
How to use checksums
d750b549e8551aceea41e8be014fc689afe6e6f099adc68e59878433b2b5096b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/0.11.2 CPython/3.6.5 Darwin/15.6.0

Release files / final_class-0.1.2-py3-none-any.whl

Download URL final_class-0.1.2-py3-none-any.whl
Size 3.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ef3d462e5ef0ee104403bea95cb0675dcb84525d6b4e74cf2fefef24f4f8716f
BLAKE2b-256 checksum
How to use checksums
664ae4fdcc82f7eccc558881444b45c5babfd27a7d670cec4d1eb7105f8f637d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/0.11.2 CPython/3.6.5 Darwin/15.6.0

Release history Release notifications | RSS feed

0.2.0

2 release files

0.1.3

2 release files

This release

0.1.2 This release

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page