Helper functions.
Functions
| is_string | Determines if the given object is a string. |
| is_sequence | Determines if the given object is a sequence. |
| module_directory | Returns the location of a given module. |
| import_module | Import a module. |
| callable_weakref | This function returns a callable weak reference to a callable object. |
Determines if the given object is a string.
| Parameters: | obj (object) – the object to be analysed |
|---|---|
| Returns: | True if the given object is a string or False otherwise |
| Return type: | bool |
Determines if the given object is a sequence.
| Parameters: | |
|---|---|
| Returns: | True if the given object is a sequence or False otherwise |
| Return type: | bool |
Returns the location of a given module.
| Parameters: | module (module) – the module object |
|---|---|
| Returns: | the directory where the module is located |
| Return type: | str |
Import a module.
The ‘package’ argument is required when performing a relative import. It specifies the package to use as the anchor point from which to resolve the relative import to an absolute import.
This function returns a callable weak reference to a callable object. Object can be a callable object, a function or a method.
| Parameters: |
|
|---|---|
| Returns: | a weak reference for the given callable |
| Return type: | BoundMethodWeakref or weakref.ref |