try_importing
Try importing a test label, and return (is_importable, is_package).
Relative labels like "." and ".." are seen as directories.
def try_importing(
label: string
) - > tuple
Try importing a test label, and return (is_importable, is_package). Relative labels like "." and ".." are seen as directories.
Parameters
| Name | Type | Description |
|---|---|---|
| label | string | The module or package name to attempt to import, including relative path indicators like "." or ".." |
Returns
| Type | Description |
|---|---|
tuple | A tuple containing two booleans: the first indicates if the module was successfully imported, and the second indicates if the imported module is a package. |