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.3.tar.gz
(3.1 kB
view details)
Built Distribution
File details
Details for the file final-class-0.1.3.tar.gz
.
File metadata
- Download URL: final-class-0.1.3.tar.gz
- Upload date:
- Size: 3.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/0.12.11 CPython/3.7.3 Darwin/18.6.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 42ec7fd076902022364c975feeb285c7e3a3821e632c04f6c7116040409ef8e4 |
|
MD5 | a12135527935a47f83ff932b6cf3cd98 |
|
BLAKE2b-256 | 865e415aac0681d1fbe7b933f70e2f8aa8f5dfe9d0f5467f99008e799f5bafd5 |
File details
Details for the file final_class-0.1.3-py3-none-any.whl
.
File metadata
- Download URL: final_class-0.1.3-py3-none-any.whl
- Upload date:
- Size: 4.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/0.12.11 CPython/3.7.3 Darwin/18.6.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1d4712c477f1316454608938f38d8e60724c8c70aa60627bec748987d6c1ff1c |
|
MD5 | 8cb2555e23ec89b17c1ca1598febe578 |
|
BLAKE2b-256 | df44eca224f4df296e564ca365a087cc0688b2ed54694df64602795377ba261c |