Public Member Functions | |
| def | __eq__ |
| def | __ne__ |
| def | __new__ |
| def | __repr__ |
| def | scope |
Private Attributes | |
| __scope | |
BSON's JavaScript code type.
Raises :class:`TypeError` if `code` is not an instance of
:class:`basestring` or `scope` is not ``None`` or an instance of
:class:`dict`.
Scope variables can be set by passing a dictionary as the `scope`
argument or by using keyword arguments. If a variable is set as a
keyword argument it will override any setting for that variable in
the `scope` dictionary.
:Parameters:
- `code`: string containing JavaScript code to be evaluated
- `scope` (optional): dictionary representing the scope in which
`code` should be evaluated - a mapping from identifiers (as
strings) to values
- `**kwargs` (optional): scope variables can also be passed as
keyword arguments
.. versionadded:: 1.9
Ability to pass scope values using keyword arguments.
Definition at line 19 of file bson/code.py.
| def bson::code::Code::__eq__ | ( | self, | ||
| other | ||||
| ) |
Definition at line 72 of file bson/code.py.
| def bson::code::Code::__ne__ | ( | self, | ||
| other | ||||
| ) |
Definition at line 77 of file bson/code.py.
| def bson::code::Code::__new__ | ( | cls, | ||
| code, | ||||
scope = None, |
||||
| kwargs | ||||
| ) |
Definition at line 43 of file bson/code.py.
| def bson::code::Code::__repr__ | ( | self | ) |
Definition at line 69 of file bson/code.py.
| def bson::code::Code::scope | ( | self | ) |
Scope dictionary for this instance.
Definition at line 64 of file bson/code.py.
bson::code::Code::__scope [private] |
Definition at line 50 of file bson/code.py.