Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for sclass, version 1.0.0
Filename, size File type Python version Upload date Hashes
Filename, size sclass-1.0.0-py3-none-any.whl (2.8 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size sclass-1.0.0.tar.gz (6.1 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page