Utils

Module containing many helper object not directly related to NetworkDisk

class networkdisk.utils.BinRel(*E)
add(leftNright)

Add an element.

discard(leftNright)

Remove an element. Do not raise an exception if absent.

keys() a set-like object providing a view on D's keys
class networkdisk.utils.nullcontext(enter_result=None)

Context manager that does no additional processing.

Used as a stand-in for a normal context manager, when a particular block of code is only sometimes used with a normal context manager:

cm = optional_cm if condition else nullcontext() with cm:

# Perform operation, using optional_cm if condition is True