How to use the multidict._multidict_py.MultiDict function in multidict

To help you get started, we’ve selected a few multidict examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github aio-libs / multidict / tests / test_abc.py View on Github external
    + [PyMultiDict, PyCIMultiDict],
    ids=(["MultiDict", "CIMultiDict"] if USE_CYTHON else [])
    + ["PyMultiDict", "PyCIMultiDict"],
)
def cls(request):
    return request.param
github aio-libs / multidict / multidict / _multidict_py.py View on Github external
def copy(self):
        """Return a copy of itself."""
        return MultiDict(self.items())
github aio-libs / multidict / multidict / _multidict_py.py View on Github external
else:
            self._impl._items.append((identity, key, value))
            self._impl.incr_version()
            return

        # remove all tail items
        i = rgt + 1
        while i < len(items):
            item = items[i]
            if item[0] == identity:
                del items[i]
            else:
                i += 1


class CIMultiDict(MultiDict):
    """Dictionary with the support for duplicate case-insensitive keys."""

    def _title(self, key):
        return key.title()


class _Iter:
    __slots__ = ("_size", "_iter")

    def __init__(self, size, iterator):
        self._size = size
        self._iter = iterator

    def __iter__(self):
        return self