pak.util.misc¶
Miscellaneous utilities.
- class UniqueSentinel(name=None)[source]¶
Bases:
objectAn object with a unique identity.
This is useful for e.g. default parameters that may have
Noneas a valid value.- Parameters:
name (
strorNone) –The name of the
UniqueSentinel.If
None, then a default name is chosen.Returned when
repr()is used on the object, mainly for the purpose of better docs.
Examples
>>> import pak >>> sentinel = pak.util.UniqueSentinel("SENTINEL") >>> sentinel SENTINEL >>> unnamed = pak.util.UniqueSentinel() >>> unnamed UniqueSentinel