A collection of MetaClasses for Python.
Project description
pyTooling
A collection of MetaClasses for Python.
Classes
CallBy
Auxilary classes to implement call by reference.
Python does not allow a user to distinguish between call-by-value and call-by-reference parameter passing. Python's standard types are passed by-value to a function or method. Instances of a class are passed by-reference (pointer) to a function or method.
By implementing a wrapper-class CallByRefParam
, any type's value can be
passed by-reference. In addition, derived classes can offer additional methods
and operators for standard types like int
or bool
.
Example
# define a call-by-reference parameter for integer values
myInt = CallByRefIntParam()
# a function using a call-by-reference parameter
def func(param : CallByRefIntParam):
param <<= 3
# call the function and pass the wrapper object
func(myInt)
print(myInt.value)
Decorators
export
Add a class defined in a module to the__all__
array of a module.
Example
@export
class MyClass:
pass
Exceptions
An exception base-class to derive more powerful exceptions.
Metaclasses
Singleton
Allow only a single instance of a class.
⇒ See documentation of pyMetaClasses.SingletonOverloading
Allow method overloading in Python classes. Dispatch method calls based on method signatures (type annotations).
⇒ See documentation of pyMetaClasses.Overloading
Versioning
Version
Representation of a version number.
Contributors
- Patrick Lehmann (Maintainer)
- and more...
License
This Python package (source code) licensed under Apache License 2.0.
The accompanying documentation is licensed under Creative Commons - Attribution 4.0 (CC-BY 4.0).
SPDX-License-Identifier: Apache-2.0
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
Hashes for pyTooling-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5ec970530bc4f1e89bf121e46fbe38309c2ec9b0e60eb79dd3018fe095e3603a |
|
MD5 | eb09319cb63b5a241e274644a1f39c26 |
|
BLAKE2b-256 | 438dffc65049c0db6ff5be8ade2e5ae40278eecca8987e4bb97a0e500921d3d9 |