Skip to content

Core

zelos_sdk.core

ContextBase(**kwargs)

Bases: ABC

Abstract base class that defines methods a Context must implement.

Contextual objects are ones that should be opened or closed, like a file or connection.

is_closed: bool property

Returns true if closed, else false

is_open: bool property

Returns true if opened, else false

__del__()

Ensure we close properly upon deletion of an object

__enter__()

Contextual open. Called using 'with'

__exit__(exc_type, exc_value, traceback)

Contextual close. Called after 'with'

__repr__()

String representation for debugging and logging

close()

Public interface for closing a connection/file/etc.

open()

Public interface for opening a connection/file/etc.