Skip to content

Latest commit

 

History

History
377 lines (219 loc) · 7.63 KB

Bunch.md

File metadata and controls

377 lines (219 loc) · 7.63 KB

Bunch

Container object exposing keys as attributes.

Bunch objects are sometimes used as an output for functions and methods. They extend dictionaries by enabling values to be accessed by key, bunch\["value\_key"\], or by an attribute, bunch.value\_key.

Examples

Python Reference

Constructors

constructor()

Signature

new Bunch(opts?: object): Bunch;

Parameters

Name Type
opts? object

Returns

Bunch

Defined in: generated/utils/Bunch.ts:25

Methods

clear()

Signature

clear(opts: object): Promise<any>;

Parameters

Name Type
opts object

Returns

Promise<any>

Defined in: generated/utils/Bunch.ts:94

copy()

Signature

copy(opts: object): Promise<any>;

Parameters

Name Type
opts object

Returns

Promise<any>

Defined in: generated/utils/Bunch.ts:117

dispose()

Disposes of the underlying Python resources.

Once dispose() is called, the instance is no longer usable.

Signature

dispose(): Promise<void>;

Returns

Promise<void>

Defined in: generated/utils/Bunch.ts:80

fromkeys()

Create a new dictionary with keys from iterable and values set to value.

Signature

fromkeys(opts: object): Promise<any>;

Parameters

Name Type
opts object

Returns

Promise<any>

Defined in: generated/utils/Bunch.ts:143

get()

Return the value for key if key is in the dictionary, else default.

Signature

get(opts: object): Promise<any>;

Parameters

Name Type
opts object

Returns

Promise<any>

Defined in: generated/utils/Bunch.ts:169

init()

Initializes the underlying Python resources.

This instance is not usable until the Promise returned by init() resolves.

Signature

init(py: PythonBridge): Promise<void>;

Parameters

Name Type
py PythonBridge

Returns

Promise<void>

Defined in: generated/utils/Bunch.ts:43

items()

Signature

items(opts: object): Promise<any>;

Parameters

Name Type
opts object

Returns

Promise<any>

Defined in: generated/utils/Bunch.ts:192

keys()

Signature

keys(opts: object): Promise<any>;

Parameters

Name Type
opts object

Returns

Promise<any>

Defined in: generated/utils/Bunch.ts:215

pop()

If key is not found, default is returned if given, otherwise KeyError is raised

Signature

pop(opts: object): Promise<any>;

Parameters

Name Type
opts object

Returns

Promise<any>

Defined in: generated/utils/Bunch.ts:241

popitem()

Remove and return a (key, value) pair as a 2-tuple.

Pairs are returned in LIFO (last-in, first-out) order. Raises KeyError if the dict is empty.

Signature

popitem(opts: object): Promise<any>;

Parameters

Name Type
opts object

Returns

Promise<any>

Defined in: generated/utils/Bunch.ts:269

setdefault()

Insert key with a value of default if key is not in the dictionary.

Return the value for key if key is in the dictionary, else default.

Signature

setdefault(opts: object): Promise<any>;

Parameters

Name Type
opts object

Returns

Promise<any>

Defined in: generated/utils/Bunch.ts:297

update()

If E is present and has a .keys() method, then does: for k in E: D[k] = E[k] If E is present and lacks a .keys() method, then does: for k, v in E: D[k] = v In either case, this is followed by: for k in F: D[k] = F[k]

Signature

update(opts: object): Promise<any>;

Parameters

Name Type
opts object

Returns

Promise<any>

Defined in: generated/utils/Bunch.ts:323

values()

Signature

values(opts: object): Promise<any>;

Parameters

Name Type
opts object

Returns

Promise<any>

Defined in: generated/utils/Bunch.ts:346

Properties

_isDisposed

boolean = false

Defined in: generated/utils/Bunch.ts:23

_isInitialized

boolean = false

Defined in: generated/utils/Bunch.ts:22

_py

PythonBridge

Defined in: generated/utils/Bunch.ts:21

id

string

Defined in: generated/utils/Bunch.ts:18

opts

any

Defined in: generated/utils/Bunch.ts:19

Accessors

py

Signature

py(): PythonBridge;

Returns

PythonBridge

Defined in: generated/utils/Bunch.ts:30

Signature

py(pythonBridge: PythonBridge): void;

Parameters

Name Type
pythonBridge PythonBridge

Returns

void

Defined in: generated/utils/Bunch.ts:34