INNER CODE UNIT · Python

__init__

psevensas/DjangoChannelsGraphqlWs · channels_graphql_ws/dict_as_object.py:28

    def __init__(self, scope):
        """Remember given `scope`."""
        self._scope = scope

    def _asdict(self):
        """Provide inner Channels scope object."""
        return self._scope

    # ------------------------------------------------ WRAPPER FUNCTIONS
    def __getattr__(self, name):
        """Route attributes to the scope object."""
        if name.startswith("_"):
            raise AttributeError()
        try:
            return self._scope[name]
        except KeyError as ex:
            raise AttributeError() from ex

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…