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): = “lorenzo” self._surname = “bartolini”
def publicmethod(self):
return ‘Public’
def _privatemethod(self):
return ‘private’

x = Test()

print( 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

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page