Core#
Core utilities functions that are directly exposed by the apfel
package.
These functions are injected to the builtins
namespace and can be used directly
as soon as the apfel
package is imported.
If you are using Pyright, you can follow the builtins extension documentation to enable autocompletion for these functions.
identity(x)
#
Returns the sole argument passed to it doing nothing.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
x
|
T
|
Any object. |
required |
Returns:
Name | Type | Description |
---|---|---|
out |
T
|
The same object passed to it. |
imperative(*exprs)
#
Returns the last expression passed into the function.
If no expression are passed, returns None
, per Python's convention.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
*exprs
|
*tuple[*Ts, R]
|
Any number of expressions. |
()
|
Returns:
Name | Type | Description |
---|---|---|
out |
R
|
The last expression passed into the function. |
todo(message=None)
#
Marks an unimplemented location that might be implemented in the future.
See todo!
for usage.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
message
|
str | None
|
The extra message to be displayed. |
None
|
Raises:
Type | Description |
---|---|
NotImplementedError
|
Always. |
unimplemented(message=None)
#
Marks an unimplemented location that might not be implemented in the future.
See unimplemented!
for usage.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
message
|
str | None
|
The extra message to be displayed. |
None
|
Raises:
Type | Description |
---|---|
NotImplementedError
|
Always. |