LowercaseDict

Documentation for eth_defi.vault.lower_case_dict.LowercaseDict Python class.

class LowercaseDict

Bases: dict

A dictionary subclass that automatically converts all string keys to lowercase.

  • Because of legacy, Ethrereum services mix loewrcased and checksum-case addresses

  • Ethereum checksum addresse where a f**king bad idea and everyone needs to suffer from this shitty idea for the eternity

Methods summary

__init__(*args, **kwargs)

clear()

Remove all items from the dict.

copy()

Return a shallow copy of the dict.

fromkeys([value])

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

get(key[, default])

Override get method to convert string keys to lowercase.

items()

Return a set-like object providing a view on the dict's items.

keys()

Return a set-like object providing a view on the dict's keys.

pop(k[,d])

If the key is not found, return the default if given; otherwise, raise a KeyError.

popitem()

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

setdefault(key[, default])

Override setdefault to convert string keys to lowercase.

update([other])

Override update to convert string keys to lowercase.

values()

Return an object providing a view on the dict's values.

__init__(*args, **kwargs)
__new__(**kwargs)
clear()

Remove all items from the dict.

copy()

Return a shallow copy of the dict.

fromkeys(value=None, /)

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

get(key, default=None)

Override get method to convert string keys to lowercase.

items()

Return a set-like object providing a view on the dict’s items.

keys()

Return a set-like object providing a view on the dict’s keys.

pop(k[, d]) v, remove specified key and return the corresponding value.

If the key is not found, return the default if given; otherwise, raise a KeyError.

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.

setdefault(key, default=None)

Override setdefault to convert string keys to lowercase.

update(other=None, **kwargs)

Override update to convert string keys to lowercase.

values()

Return an object providing a view on the dict’s values.