Skip to main content

A python module to assist with special object oriented aspects.

Project description

jk_oop

Introduction

A python module to assist with special object oriented aspects.

Information about this module can be found here:

How to use this module

Import

To import this module use the following statement:

import jk_oop

The Classes

Singleton (for inheritance)

This class implements a singleton with a static instantiation method.

Example:

class MySingleton(jk_oop.Singleton):

	__slots__ = (
		"value",
	)

	@jk_typing.checkFunctionSignature()
	def __initialize(self, someValue:int):
		print("Initializing MySingleton")
		self.value = someValue
	#

#

Usage:

# first use with initialization
myInst = MySingleton.getInstance(42)

# same use later
myInst = MySingleton.getInstance()

SingletonMeta (as metaclass)

This class implements a singleton. Initialization is done via constructor.

Example:

class MySingleton(metaclass=jk_oop.SingletonMeta):

	__slots__ = (
		"value",
	)

	@jk_typing.checkFunctionSignature()
	def __init__(self, someValue:int):
		print("Initializing MySingleton")
		self.value = someValue
	#

#

Usage:

# first use with initialization
myInst = MySingleton(42)

# same use later
myInst = MySingleton()

Author(s)

License

This software is provided under the following license:

  • Apache Software License 2.0

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

jk_oop-0.2026.6.25.tar.gz (6.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

jk_oop-0.2026.6.25-py3-none-any.whl (7.1 kB view details)

Uploaded Python 3

File details

Details for the file jk_oop-0.2026.6.25.tar.gz.

File metadata

  • Download URL: jk_oop-0.2026.6.25.tar.gz
  • Upload date:
  • Size: 6.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.32.3

File hashes

Hashes for jk_oop-0.2026.6.25.tar.gz
Algorithm Hash digest
SHA256 6241ff4f0449829d6e94bbf840284d9d586b5b2a5d53d6fe7f4b121760e528d1
MD5 a8d2a77cb609ea59d039e264640b3ad9
BLAKE2b-256 78ae2d3891b0df89dbf27f17f389c13c1363bae33d8957844191ff7b64e74ebd

See more details on using hashes here.

File details

Details for the file jk_oop-0.2026.6.25-py3-none-any.whl.

File metadata

  • Download URL: jk_oop-0.2026.6.25-py3-none-any.whl
  • Upload date:
  • Size: 7.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.32.3

File hashes

Hashes for jk_oop-0.2026.6.25-py3-none-any.whl
Algorithm Hash digest
SHA256 dc8f31c73d56797b89f23c91bcc897eb177c72a105e0aab4b0d21621a04c608c
MD5 f457303535399e680ce6d9686fdf1b27
BLAKE2b-256 086706ff8ba14d7b197b67ade37ebb28f73862724f4fbf1a9490498c55fb17a1

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page