pyTooling.CallByRef
Auxiliary classes to implement call-by-reference.
Hint
See high-level help for explanations and usage examples.
Classes
CallByRefParam
: Implements a call-by-reference parameter.CallByRefBoolParam
: A special call-by-reference implementation for boolean reference types.CallByRefIntParam
: A special call-by-reference implementation for integer reference types.
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
- Parameters:
value (T | None)
- __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:
- Returns:
Itself.
- __eq__(other)[source]
Compare a CallByRefParam wrapped value with another instances (CallbyRefParam) or non-wrapped value for equality.
- __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:
- Returns:
True
, if both values are unequal.
- __repr__()[source]
Returns the wrapped object’s string representation.
- Return type:
- Returns:
The string representation of the wrapped value.
- __str__()[source]
Returns the wrapped object’s string equivalent.
- Return type:
- 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
- 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:
- Returns:
True
, if both values are equal.- Raises:
TypeError – If parameter
other
is not of typebool
orCallByRefBoolParam
.
- __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:
- Returns:
True
, if both values are unequal.- Raises:
TypeError – If parameter
other
is not of typebool
orCallByRefBoolParam
.
- __int__()[source]
Type conversion to
int
.- Return type:
- 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.
- __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:
- Returns:
Itself.
- __init__(value=None)
Constructs a call-by-reference object for any type.
- __init_subclass__()
Function to initialize subclasses.
- __repr__()
Returns the wrapped object’s string representation.
- Return type:
- Returns:
The string representation of the wrapped value.
- class pyTooling.CallByRef.CallByRefIntParam(value=None)[source]
A special call-by-reference implementation for integer reference types.
Inheritance
- Parameters:
value (T | None)
- __eq__(other)[source]
Compare a CallByRefIntParam wrapped integer value with another instances (CallByRefIntParam) or non-wrapped integer value for equality.
- __ne__(other)[source]
Compare a CallByRefIntParam wrapped integer value with another instances (CallByRefIntParam) or non-wrapped integer value for inequality.
- __lt__(other)[source]
Compare a CallByRefIntParam wrapped integer value with another instances (CallByRefIntParam) or non-wrapped integer value for less-than.
- __le__(other)[source]
Compare a CallByRefIntParam wrapped integer value with another instances (CallByRefIntParam) or non-wrapped integer value for less-than-or-equal.
- __gt__(other)[source]
Compare a CallByRefIntParam wrapped integer value with another instances (CallByRefIntParam) or non-wrapped integer value for geater-than.
- __ge__(other)[source]
Compare a CallByRefIntParam wrapped integer value with another instances (CallByRefIntParam) or non-wrapped integer value for greater-than-or-equal.
- __bool__()[source]
Type conversion to
bool
.- Return type:
- Returns:
The boolean representation of the wrapped integer 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]: ….
- __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:
- Returns:
Itself.
- __init__(value=None)
Constructs a call-by-reference object for any type.
- __init_subclass__()
Function to initialize subclasses.
- __repr__()
Returns the wrapped object’s string representation.
- Return type:
- Returns:
The string representation of the wrapped value.