pyTooling.CallByRef

Auxiliary classes to implement call-by-reference.

Hint

See high-level help for explanations and usage examples.

Classes


Classes

class pyTooling.CallByRef.CallByRefParam(value=None)[source]

Implements a call-by-reference parameter.

See also

  • CallByRefBoolParam
    → A special call-by-reference implementation for boolean reference types.

  • CallByRefIntParam
    → A special call-by-reference implementation for integer reference types.

Inheritance

Inheritance diagram of CallByRefParam

Parameters:

value (T | None)

__init__(value=None)[source]

Constructs a call-by-reference object for any type.

Parameters:

value (Optional[TypeVar(T)]) – The value to be set as an initial value.

Return type:

None

Value: TypeVar(T)

internal value

__ilshift__(other)[source]

Assigns a value to the call-by-reference object.

Parameters:

other (TypeVar(T)) – The value to be assigned to this call-by-reference object.

Return type:

CallByRefParam[TypeVar(T)]

Returns:

Itself.

__eq__(other)[source]

Compare a CallByRefParam wrapped value with another instances (CallbyRefParam) or non-wrapped value for equality.

Parameters:

other (Any) – Parameter to compare against.

Return type:

bool

Returns:

True, if both values are equal.

__ne__(other)[source]

Compare a CallByRefParam wrapped value with another instances (CallbyRefParam) or non-wrapped value for inequality.

Parameters:

other – Parameter to compare against.

Return type:

bool

Returns:

True, if both values are unequal.

__repr__()[source]

Returns the wrapped object’s string representation.

Return type:

str

Returns:

The string representation of the wrapped value.

__str__()[source]

Returns the wrapped object’s string equivalent.

Return type:

str

Returns:

The string equivalent of the wrapped value.

class property HasClassAttributes: bool

Check if class has Attributes.

Returns:

True, if the class has Attributes.

class property HasMethodAttributes: bool

Check if class has any method with Attributes.

Returns:

True, if the class has any method with Attributes.

__class_getitem__()

Parameterizes a generic class.

At least, parameterizing a generic class is the main thing this method does. For example, for some generic class Foo, this is called when we do Foo[int] - there, with cls=Foo and params=int.

However, note that this method is also called when defining generic classes in the first place with class Foo[T]: ….

__hash__ = None
__init_subclass__()

Function to initialize subclasses.

class pyTooling.CallByRef.CallByRefBoolParam(value=None)[source]

A special call-by-reference implementation for boolean reference types.

Inheritance

Inheritance diagram of CallByRefBoolParam

Parameters:

value (T | None)

__eq__(other)[source]

Compare a CallByRefBoolParam wrapped boolean value with another instances (CallByRefBoolParam) or non-wrapped boolean value for equality.

Parameters:

other (Any) – Parameter to compare against.

Return type:

bool

Returns:

True, if both values are equal.

Raises:

TypeError – If parameter other is not of type bool or CallByRefBoolParam.

__ne__(other)[source]

Compare a CallByRefBoolParam wrapped boolean value with another instances (CallByRefBoolParam) or non-wrapped boolean value for inequality.

Parameters:

other – Parameter to compare against.

Return type:

bool

Returns:

True, if both values are unequal.

Raises:

TypeError – If parameter other is not of type bool or CallByRefBoolParam.

__bool__()[source]

Type conversion to bool.

Return type:

bool

Returns:

The wrapped value.

__int__()[source]

Type conversion to int.

Return type:

int

Returns:

The integer representation of the wrapped boolean value.

class property HasClassAttributes: bool

Check if class has Attributes.

Returns:

True, if the class has Attributes.

class property HasMethodAttributes: bool

Check if class has any method with Attributes.

Returns:

True, if the class has any method with Attributes.

Value: TypeVar(T)

internal value

__class_getitem__()

Parameterizes a generic class.

At least, parameterizing a generic class is the main thing this method does. For example, for some generic class Foo, this is called when we do Foo[int] - there, with cls=Foo and params=int.

However, note that this method is also called when defining generic classes in the first place with class Foo[T]: ….

__hash__ = None
__ilshift__(other)

Assigns a value to the call-by-reference object.

Parameters:

other (TypeVar(T)) – The value to be assigned to this call-by-reference object.

Return type:

CallByRefParam[TypeVar(T)]

Returns:

Itself.

__init__(value=None)

Constructs a call-by-reference object for any type.

Parameters:

value (Optional[TypeVar(T)]) – The value to be set as an initial value.

Return type:

None

__init_subclass__()

Function to initialize subclasses.

__repr__()

Returns the wrapped object’s string representation.

Return type:

str

Returns:

The string representation of the wrapped value.

__str__()

Returns the wrapped object’s string equivalent.

Return type:

str

Returns:

The string equivalent of the wrapped value.

class pyTooling.CallByRef.CallByRefIntParam(value=None)[source]

A special call-by-reference implementation for integer reference types.

Inheritance

Inheritance diagram of CallByRefIntParam

Parameters:

value (T | None)

__neg__()[source]

Negate: -self.

Return type:

int

__pos__()[source]

Positive: +self.

Return type:

int

__invert__()[source]

Invert: ~self.

Return type:

int

__and__(other)[source]

And: self & other.

Return type:

int

Parameters:

other (Any)

__or__(other)[source]

Or: self | other.

Return type:

int

Parameters:

other (Any)

__xor__(other)[source]

Xor: self ^ other.

Return type:

int

Parameters:

other (Any)

__iand__(other)[source]

Inplace and: self &= other.

Return type:

CallByRefIntParam

Parameters:

other (Any)

__ior__(other)[source]

Inplace or: self |= other.

Return type:

CallByRefIntParam

Parameters:

other (Any)

__ixor__(other)[source]

Inplace or: self |= other.

Return type:

CallByRefIntParam

Parameters:

other (Any)

__add__(other)[source]

Addition: self + other.

Return type:

int

Parameters:

other (Any)

__sub__(other)[source]

Subtraction: self - other.

Return type:

int

Parameters:

other (Any)

__truediv__(other)[source]

Division: self / other.

Return type:

int

Parameters:

other (Any)

__floordiv__(other)[source]

Floor division: self // other.

Return type:

int

Parameters:

other (Any)

__mul__(other)[source]

Multiplication: self * other.

Return type:

int

Parameters:

other (Any)

__mod__(other)[source]

Modulo: self % other.

Return type:

int

Parameters:

other (Any)

__pow__(other)[source]

Power: self ** other.

Return type:

int

Parameters:

other (Any)

__iadd__(other)[source]

Addition: self += other.

Return type:

CallByRefIntParam

Parameters:

other (Any)

__isub__(other)[source]

Subtraction: self -= other.

Return type:

CallByRefIntParam

Parameters:

other (Any)

__idiv__(other)[source]

Division: self /= other.

Return type:

CallByRefIntParam

Parameters:

other (Any)

__ifloordiv__(other)[source]

Floor division: self // other.

Return type:

CallByRefIntParam

Parameters:

other (Any)

__imul__(other)[source]

Multiplication: self *= other.

Return type:

CallByRefIntParam

Parameters:

other (Any)

__imod__(other)[source]

Modulo: self %= other.

Return type:

CallByRefIntParam

Parameters:

other (Any)

__ipow__(other)[source]

Power: self **= other.

Return type:

CallByRefIntParam

Parameters:

other (Any)

__eq__(other)[source]

Compare a CallByRefIntParam wrapped integer value with another instances (CallByRefIntParam) or non-wrapped integer value for equality.

Parameters:

other (Any) – Parameter to compare against.

Return type:

bool

Returns:

True, if both values are equal.

Raises:

TypeError – If parameter other is not of type int, float, complex, Decimal or CallByRefParam.

__ne__(other)[source]

Compare a CallByRefIntParam wrapped integer value with another instances (CallByRefIntParam) or non-wrapped integer value for inequality.

Parameters:

other – Parameter to compare against.

Return type:

bool

Returns:

True, if both values are unequal.

Raises:

TypeError – If parameter other is not of type int, float, complex, Decimal or CallByRefParam.

__lt__(other)[source]

Compare a CallByRefIntParam wrapped integer value with another instances (CallByRefIntParam) or non-wrapped integer value for less-than.

Parameters:

other (Any) – Parameter to compare against.

Return type:

bool

Returns:

True, if the wrapped value is less than the other value.

Raises:

TypeError – If parameter other is not of type int, float, complex, Decimal or CallByRefParam.

__le__(other)[source]

Compare a CallByRefIntParam wrapped integer value with another instances (CallByRefIntParam) or non-wrapped integer value for less-than-or-equal.

Parameters:

other (Any) – Parameter to compare against.

Return type:

bool

Returns:

True, if the wrapped value is less than or equal the other value.

Raises:

TypeError – If parameter other is not of type int, float, complex, Decimal or CallByRefParam.

__gt__(other)[source]

Compare a CallByRefIntParam wrapped integer value with another instances (CallByRefIntParam) or non-wrapped integer value for geater-than.

Parameters:

other (Any) – Parameter to compare against.

Return type:

bool

Returns:

True, if the wrapped value is greater than the other value.

Raises:

TypeError – If parameter other is not of type int, float, complex, Decimal or CallByRefParam.

__ge__(other)[source]

Compare a CallByRefIntParam wrapped integer value with another instances (CallByRefIntParam) or non-wrapped integer value for greater-than-or-equal.

Parameters:

other (Any) – Parameter to compare against.

Return type:

bool

Returns:

True, if the wrapped value is greater than or equal the other value.

Raises:

TypeError – If parameter other is not of type int, float, complex, Decimal or CallByRefParam.

__bool__()[source]

Type conversion to bool.

Return type:

bool

Returns:

The boolean representation of the wrapped integer value.

__int__()[source]

Type conversion to int.

Return type:

int

Returns:

The wrapped value.

class property HasClassAttributes: bool

Check if class has Attributes.

Returns:

True, if the class has Attributes.

class property HasMethodAttributes: bool

Check if class has any method with Attributes.

Returns:

True, if the class has any method with Attributes.

Value: TypeVar(T)

internal value

__class_getitem__()

Parameterizes a generic class.

At least, parameterizing a generic class is the main thing this method does. For example, for some generic class Foo, this is called when we do Foo[int] - there, with cls=Foo and params=int.

However, note that this method is also called when defining generic classes in the first place with class Foo[T]: ….

__float__()[source]

Type conversion to float.

Returns:

The float representation of the wrapped integer value.

__hash__ = None
__ilshift__(other)

Assigns a value to the call-by-reference object.

Parameters:

other (TypeVar(T)) – The value to be assigned to this call-by-reference object.

Return type:

CallByRefParam[TypeVar(T)]

Returns:

Itself.

__init__(value=None)

Constructs a call-by-reference object for any type.

Parameters:

value (Optional[TypeVar(T)]) – The value to be set as an initial value.

Return type:

None

__init_subclass__()

Function to initialize subclasses.

__repr__()

Returns the wrapped object’s string representation.

Return type:

str

Returns:

The string representation of the wrapped value.

__str__()

Returns the wrapped object’s string equivalent.

Return type:

str

Returns:

The string equivalent of the wrapped value.