Sourcecode on GitHub Sourcecode License GitHub tag (latest SemVer incl. pre-release) GitHub release (latest SemVer incl. including pre-releases GitHub release date Dependents (via libraries.io) |br| GitHub Workflow - Build and Test Status Codacy - Quality Codacy - Line Coverage Codecov - Branch Coverage Libraries.io SourceRank |br| PyPI - Tag PyPI - Python Version PyPI - Status Libraries.io status for latest release Requires.io |br| Read the Docs Documentation License Documentation - Read Now!

              ____      _ _ ____
 _ __  _   _ / ___|__ _| | | __ ) _   _
| '_ \| | | | |   / _` | | |  _ \| | | |
| |_) | |_| | |__| (_| | | | |_) | |_| |
| .__/ \__, |\____\__,_|_|_|____/ \__, |
|_|    |___/                      |___/

pyCallBy Documentation

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 types value can be passed by-reference. In addition, standard types like int or bool can be handled by derived wrapper-classes.

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)

Contributors

License

This Python package (source code) is licensed under Apache License 2.0. |br| The accompanying documentation is licensed under Creative Commons - Attribution 4.0 (CC-BY 4.0).


This document was generated on Jul 22, 2021 - 23:17.