class documentation

class _AppCtxGlobals:

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 g proxy.

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

Get an attribute by name, or a default value. Like dict.get.

New in version 0.10.
Parameters
name:strName of attribute to get.
default:t.Optional[t.Any]Value to return if the attribute is not present.
Returns
t.AnyUndocumented
def pop(self, name, default=_sentinel):

Get and remove an attribute by name. Like dict.pop.

New in version 0.11.
Parameters
name:strName of attribute to pop.
default:t.AnyValue to return if the attribute is not present, instead of raising a KeyError.
Returns
t.AnyUndocumented
def setdefault(self, name, default=None):

Get the value of an attribute if it is present, otherwise set and return a default value. Like dict.setdefault.

New in version 0.11.
Parameters
name:strName of attribute to get.
default:t.AnyValue to set and return if the attribute is not present.
Returns
t.AnyUndocumented
def __contains__(self, item):

Undocumented

Parameters
item:strUndocumented
Returns
boolUndocumented
def __delattr__(self, name):

Undocumented

Parameters
name:strUndocumented
def __getattr__(self, name):

Undocumented

Parameters
name:strUndocumented
Returns
t.AnyUndocumented
def __iter__(self):

Undocumented

Returns
t.Iterator[str]Undocumented
def __repr__(self):

Undocumented

Returns
strUndocumented
def __setattr__(self, name, value):

Undocumented

Parameters
name:strUndocumented
value:t.AnyUndocumented