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.2.tar.gz
(2.8 kB
view details)
Built Distribution
File details
Details for the file final-class-0.1.2.tar.gz
.
File metadata
- Download URL: final-class-0.1.2.tar.gz
- Upload date:
- Size: 2.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/0.11.2 CPython/3.6.5 Darwin/15.6.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b4f180dadb90cc8c0228d6b6e4b41398bc885cc13c7e99c545fa12478c0d66ce |
|
MD5 | 0d17b42cf4ee11915321c0654bd11698 |
|
BLAKE2b-256 | d750b549e8551aceea41e8be014fc689afe6e6f099adc68e59878433b2b5096b |
File details
Details for the file final_class-0.1.2-py3-none-any.whl
.
File metadata
- Download URL: final_class-0.1.2-py3-none-any.whl
- Upload date:
- Size: 3.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/0.11.2 CPython/3.6.5 Darwin/15.6.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ef3d462e5ef0ee104403bea95cb0675dcb84525d6b4e74cf2fefef24f4f8716f |
|
MD5 | 73ffa85f7a87fe7824c2d5d2e00b14cd |
|
BLAKE2b-256 | 664ae4fdcc82f7eccc558881444b45c5babfd27a7d670cec4d1eb7105f8f637d |