INNER CODE UNIT · Python

_asdict

psevensas/DjangoChannelsGraphqlWs · channels_graphql_ws/dict_as_object.py:32

    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

    def __setattr__(self, name, value):
        """Route attributes to the scope object."""
        if name.startswith("_"):
            super().__setattr__(name, value)

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…