Basic class used as a SuperClass for other classes
Project description
# sclass
Simple module that allows you to create classes with the concept of Private and Public attributes and methods.
Just create your own class inheriting from sclass. Private methods are recognized by the first character of the attribute being ‘_’
` from sclass import sclass
- class Test(sclass):
- def __init__(self):
self.name = “lorenzo” self._surname = “bartolini”
- def publicmethod(self):
return ‘Public’
- def _privatemethod(self):
return ‘private’
x = Test()
print(x.name) print(x.publicmethod()) print(x._surname) print(x._privatemethod()) `
Last two instructions will raise a custom exception: PrivateException
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file sclass-1.0.0.tar.gz.
File metadata
- Download URL: sclass-1.0.0.tar.gz
- Upload date:
- Size: 6.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/45.2.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.6.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1c60c6bca70bc22e6e5d75c8e09ddfc1e5782379a4336dd1117c1547d606c65e
|
|
| MD5 |
679accea6f2b51fe6f4f6e69cbecc393
|
|
| BLAKE2b-256 |
515a9c4b0c8948a2eed650465602e5b2d21e2751d08c8a5a1fe26e1070484dc5
|
File details
Details for the file sclass-1.0.0-py3-none-any.whl.
File metadata
- Download URL: sclass-1.0.0-py3-none-any.whl
- Upload date:
- Size: 2.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/45.2.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.6.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
47d7047dbef9d8497fd28996522a7e688e669e852742476187363f04d7ab0f98
|
|
| MD5 |
ed6aa87eac7807c7626324de0d99f662
|
|
| BLAKE2b-256 |
b9ba4bd27b7ed115dccbb9c7b18c3fabf6c213a687d8de23f83e4b8e7cbcacdb
|