Final classes for Python 3
Project description
final_class
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.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
final-class-0.1.1.tar.gz
(2.8 kB
view details)
Built Distribution
File details
Details for the file final-class-0.1.1.tar.gz
.
File metadata
- Download URL: final-class-0.1.1.tar.gz
- Upload date:
- Size: 2.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5b00528e42eb8ea20e44e0fbf3e4b708ea1bf31e1c6987f5868a9fba3684d42c |
|
MD5 | cd195981ad4dab85534d14a9b1e7c011 |
|
BLAKE2b-256 | b64b669de17c50f1f5f984c5e38c7b8acf2d8e2978c9b09cff092b8c4806a8a9 |
File details
Details for the file final_class-0.1.1-py3-none-any.whl
.
File metadata
- Download URL: final_class-0.1.1-py3-none-any.whl
- Upload date:
- Size: 3.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | bb408336423c34c280500f207ea6ae430b0b5e4f76213dc6e0a4a0d43a1498b5 |
|
MD5 | f0b81f24e668a8bd370d66669a1ff58d |
|
BLAKE2b-256 | 1c163de69ef55fd16757200634bc0f98b24bf53f36fb3969a2510600ad4e5229 |