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
new Bunch(opts?: object): Bunch;
Name | Type |
---|---|
opts? |
object |
Defined in: generated/utils/Bunch.ts:25
clear(opts: object): Promise<any>;
Name | Type |
---|---|
opts |
object |
Promise
<any
>
Defined in: generated/utils/Bunch.ts:94
copy(opts: object): Promise<any>;
Name | Type |
---|---|
opts |
object |
Promise
<any
>
Defined in: generated/utils/Bunch.ts:117
Disposes of the underlying Python resources.
Once dispose()
is called, the instance is no longer usable.
dispose(): Promise<void>;
Promise
<void
>
Defined in: generated/utils/Bunch.ts:80
Create a new dictionary with keys from iterable and values set to value.
fromkeys(opts: object): Promise<any>;
Name | Type |
---|---|
opts |
object |
Promise
<any
>
Defined in: generated/utils/Bunch.ts:143
Return the value for key if key is in the dictionary, else default.
get(opts: object): Promise<any>;
Name | Type |
---|---|
opts |
object |
Promise
<any
>
Defined in: generated/utils/Bunch.ts:169
Initializes the underlying Python resources.
This instance is not usable until the Promise
returned by init()
resolves.
init(py: PythonBridge): Promise<void>;
Name | Type |
---|---|
py |
PythonBridge |
Promise
<void
>
Defined in: generated/utils/Bunch.ts:43
items(opts: object): Promise<any>;
Name | Type |
---|---|
opts |
object |
Promise
<any
>
Defined in: generated/utils/Bunch.ts:192
keys(opts: object): Promise<any>;
Name | Type |
---|---|
opts |
object |
Promise
<any
>
Defined in: generated/utils/Bunch.ts:215
If key is not found, default is returned if given, otherwise KeyError is raised
pop(opts: object): Promise<any>;
Name | Type |
---|---|
opts |
object |
Promise
<any
>
Defined in: generated/utils/Bunch.ts:241
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.
popitem(opts: object): Promise<any>;
Name | Type |
---|---|
opts |
object |
Promise
<any
>
Defined in: generated/utils/Bunch.ts:269
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.
setdefault(opts: object): Promise<any>;
Name | Type |
---|---|
opts |
object |
Promise
<any
>
Defined in: generated/utils/Bunch.ts:297
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]
update(opts: object): Promise<any>;
Name | Type |
---|---|
opts |
object |
Promise
<any
>
Defined in: generated/utils/Bunch.ts:323
values(opts: object): Promise<any>;
Name | Type |
---|---|
opts |
object |
Promise
<any
>
Defined in: generated/utils/Bunch.ts:346
boolean
=false
Defined in: generated/utils/Bunch.ts:23
boolean
=false
Defined in: generated/utils/Bunch.ts:22
PythonBridge
Defined in: generated/utils/Bunch.ts:21
string
Defined in: generated/utils/Bunch.ts:18
any
Defined in: generated/utils/Bunch.ts:19
py(): PythonBridge;
PythonBridge
Defined in: generated/utils/Bunch.ts:30
py(pythonBridge: PythonBridge): void;
Name | Type |
---|---|
pythonBridge |
PythonBridge |
void
Defined in: generated/utils/Bunch.ts:34