atom.scalars module

class atom.scalars.Bool(default=False, *, factory=None)[source]

Bases: atom.scalars.Value

A value of type bool.

class atom.scalars.Bytes(default=b'', *, factory=None, strict=True)[source]

Bases: atom.scalars.Value

A value of type bytes.

By default, strings will NOT be promoted to bytes. Pass strict=False to the constructor to enable loose byte checking.

class atom.scalars.Callable(default=None, *, factory=None)[source]

Bases: atom.scalars.Value

A value which is callable.

class atom.scalars.Constant(default=None, *, factory=None, kind=None)[source]

Bases: atom.scalars.Value

A value which cannot be changed from its default.

class atom.scalars.Float(default=0.0, *, factory=None, strict=False)[source]

Bases: atom.scalars.Value

A value of type float.

By default, ints and longs will be promoted to floats. Pass strict=True to the constructor to enable strict float checking.

class atom.scalars.FloatRange(low=None, high=None, value=None, *, strict=False)[source]

Bases: atom.scalars.Value

A float value clipped to a range.

By default, ints and longs will be promoted to floats. Pass strict=True to the constructor to enable strict float checking.

class atom.scalars.Int(default=0, *, factory=None, strict=True)[source]

Bases: atom.scalars.Value

A value of type int.

By default, ints are strictly typed. Pass strict=False to the constructor to enable int casting for longs and floats.

class atom.scalars.Range(low=None, high=None, value=None)[source]

Bases: atom.scalars.Value

An integer value clipped to a range.

class atom.scalars.ReadOnly(kind=None, *, default=None, factory=None)[source]

Bases: atom.scalars.Value

A value which can be assigned once and is then read-only.

class atom.scalars.Str(default='', *, factory=None, strict=True)[source]

Bases: atom.scalars.Value

A value of type str.

By default, bytes will NOT be promoted to strings. Pass strict=False to the constructor to enable loose string checking.

class atom.scalars.Value(default=None, *, factory=None)[source]

Bases: atom.catom.Member

A member class which supports value initialization.

A plain Value provides support for default values and factories, but does not perform any type checking or validation. It serves as a useful base class for scalar members and can be used for cases where type checking is not needed (like private attributes).