diff --git a/.nojekyll b/.nojekyll new file mode 100644 index 0000000..e69de29 diff --git a/404.html b/404.html new file mode 100644 index 0000000..0663239 --- /dev/null +++ b/404.html @@ -0,0 +1,530 @@ + + + +
+ + + + + + + + + + + + + + + + +SLOTHY_ENABLED: bool = not getenv('SLOTHY_DISABLE')
+
+¶Whether slothy is enabled.
+lazy_importing(*, prevent_eager=True, stack_offset=1, _fallback=FALLBACK_MISSING)
+
+¶Use slothy imports in a with
statement.
Parameters:
+prevent_eager
+¶bool
, default:
+ True
+)
+ –
+ If True, will raise a RuntimeError
if slothy cannot guarantee
+to not fall back to eager imports on unsupported Python implementation.
+On supported Python implementations this parameter doesn't change the behavior.
+A general recommendation is to set this to True
in applications
+and False
in libraries.
stack_offset
+¶int
, default:
+ 1
+)
+ –
+ The stack offset to use.
+Returns:
+Iterator[None]
+ –
+ Context manager's underlying generator.
+slothy/_importing.py
43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 |
|
lazy_importing_if(condition, *, prevent_eager=True, stack_offset=1)
+
+¶Use slothy imports only if condition evaluates to truth.
+ + +Parameters:
+condition
+¶object
)
+ –
+ The condition to evaluate.
+prevent_eager
+¶bool
, default:
+ True
+)
+ –
+ If True, will raise a RuntimeError
if slothy cannot guarantee
+to not fall back to eager imports on unsupported Python implementation.
+On supported Python implementations this parameter doesn't change the behavior.
+A general recommendation is to set this to True
in applications
+and False
in libraries.
stack_offset
+¶int
, default:
+ 1
+)
+ –
+ The stack offset to use.
+Returns:
+AbstractContextManager[None]
+ –
+ The context manager.
+slothy/_importing.py
119 +120 +121 +122 +123 +124 +125 +126 +127 +128 +129 +130 +131 +132 +133 +134 +135 +136 +137 +138 +139 +140 +141 +142 +143 +144 +145 +146 +147 +148 +149 +150 +151 |
|
type_importing(*, default_type=Any, stack_offset=1)
+
+¶Use this to import symbols recognized by type checkers that do not exist at runtime.
+This function should generally be considered a runtime-friendly alternative to
+using if typing.TYPE_CHECKING
.
Parameters:
+default_type
+¶object
, default:
+ Any
+)
+ –
+ The item to import in case of a failure. Defaults to typing.Any
stack_offset
+¶int
, default:
+ 1
+)
+ –
+ The stack offset to use.
+Returns:
+AbstractContextManager[None]
+ –
+ The context manager.
+slothy/_importing.py
88 + 89 + 90 + 91 + 92 + 93 + 94 + 95 + 96 + 97 + 98 + 99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 |
|