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.0.tar.gz
(2.8 kB
view details)
Built Distribution
File details
Details for the file final-class-0.1.0.tar.gz
.
File metadata
- Download URL: final-class-0.1.0.tar.gz
- Upload date:
- Size: 2.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 14d500364cf8eab8e59f50be48eff0a9ffb5bc11dfe632626de8e93dded778df |
|
MD5 | 93dd236681bed1dda5138ca280fbc2df |
|
BLAKE2b-256 | f1d277eaced776f10802595f58459439b7a44fb882a878c97d9b06bd7b1b4d9a |
File details
Details for the file final_class-0.1.0-py3-none-any.whl
.
File metadata
- Download URL: final_class-0.1.0-py3-none-any.whl
- Upload date:
- Size: 3.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | fc94c2b314cabe528d7cb02684eccd2eb9b238535140f1cacd25ed61468eadcd |
|
MD5 | 292aa63f39234842aa167e6fee58775c |
|
BLAKE2b-256 | c7ce25444296e5c8537946986eee8594ce166eddf9e19d1a59d592625c13fa6a |