Module hdict.content.argument
Expand source code
from random import Random
from hdict.abs import AbsAny
class AbsArgument(AbsAny):
"""
Argument provided by the user alongside the applied function
For classes where sampling makes no sense, return the object itself.
"""
sampleable = False
def sample(self, rnd: int | Random = None):
return self
class AbsBaseArgument(AbsArgument):
"""
Normal function argument provided by the user: `value`*, `field`, `apply`; or from advanced use: `entry`
Exceptionally, 'field' is a subclass that can also be piped through '>>'
*value also inherits AbsBaseArgument
"""
class AbsMetaArgument(AbsArgument):
"""
Special temporary argument-like directive provided by the user: `default`, `sample`
"""
Sub-modules
hdict.content.argument.apply
hdict.content.argument.aux_apply
hdict.content.argument.default
hdict.content.argument.entry
hdict.content.argument.field
hdict.content.argument.sample
Classes
class AbsArgument
-
Argument provided by the user alongside the applied function
For classes where sampling makes no sense, return the object itself.
Expand source code
class AbsArgument(AbsAny): """ Argument provided by the user alongside the applied function For classes where sampling makes no sense, return the object itself. """ sampleable = False def sample(self, rnd: int | Random = None): return self
Ancestors
Subclasses
Class variables
var sampleable
Methods
def sample(self, rnd: int | random.Random = None)
-
Expand source code
def sample(self, rnd: int | Random = None): return self
class AbsBaseArgument
-
Normal function argument provided by the user:
value
*,hdict.content.argument.field
,hdict.content.argument.apply
; or from advanced use:hdict.content.argument.entry
Exceptionally, 'field' is a subclass that can also be piped through '>>' *value also inherits AbsBaseArgument
Expand source code
class AbsBaseArgument(AbsArgument): """ Normal function argument provided by the user: `value`*, `field`, `apply`; or from advanced use: `entry` Exceptionally, 'field' is a subclass that can also be piped through '>>' *value also inherits AbsBaseArgument """
Ancestors
Subclasses
class AbsMetaArgument
-
Special temporary argument-like directive provided by the user:
hdict.content.argument.default
,hdict.content.argument.sample
Expand source code
class AbsMetaArgument(AbsArgument): """ Special temporary argument-like directive provided by the user: `default`, `sample` """
Ancestors
Subclasses