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.applyhdict.content.argument.aux_applyhdict.content.argument.defaulthdict.content.argument.entryhdict.content.argument.fieldhdict.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 selfAncestors
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.entryExceptionally, '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.sampleExpand source code
class AbsMetaArgument(AbsArgument): """ Special temporary argument-like directive provided by the user: `default`, `sample` """Ancestors
Subclasses