class documentation

class _AppCtxGlobals: (source)

View In Hierarchy

A plain object. Used as a namespace for storing data during an application context. Creating an app context automatically creates this object, which is made available as the :data:`g` proxy. .. describe:: 'key' in g Check whether an attribute is present. .. versionadded:: 0.10 .. describe:: iter(g) Return an iterator over the attribute names. .. versionadded:: 0.10

Method __contains__ Undocumented
Method __delattr__ Undocumented
Method __getattr__ Undocumented
Method __iter__ Undocumented
Method __repr__ Undocumented
Method __setattr__ Undocumented
Method get Get an attribute by name, or a default value. Like :meth:`dict.get`.
Method pop Get and remove an attribute by name. Like :meth:`dict.pop`.
Method setdefault Get the value of an attribute if it is present, otherwise set and return a default value. Like :meth:`dict.setdefault`.
def __contains__(self, item: str) -> bool: (source)

Undocumented

def __delattr__(self, name: str): (source)

Undocumented

def __getattr__(self, name: str) -> t.Any: (source)

Undocumented

def __iter__(self) -> t.Iterator[str]: (source)

Undocumented

def __repr__(self) -> str: (source)

Undocumented

def __setattr__(self, name: str, value: t.Any): (source)

Undocumented

def get(self, name: str, default: t.Optional[t.Any] = None) -> t.Any: (source)

Get an attribute by name, or a default value. Like :meth:`dict.get`. :param name: Name of attribute to get. :param default: Value to return if the attribute is not present. .. versionadded:: 0.10

def pop(self, name: str, default: t.Any = _sentinel) -> t.Any: (source)

Get and remove an attribute by name. Like :meth:`dict.pop`. :param name: Name of attribute to pop. :param default: Value to return if the attribute is not present, instead of raising a ``KeyError``. .. versionadded:: 0.11

def setdefault(self, name: str, default: t.Any = None) -> t.Any: (source)

Get the value of an attribute if it is present, otherwise set and return a default value. Like :meth:`dict.setdefault`. :param name: Name of attribute to get. :param default: Value to set and return if the attribute is not present. .. versionadded:: 0.11