:orphan:
.. _s_11PytoRuntime6ObjectC:
``Object``
==========
Represents a Python object.
.. raw:: html
.. rubric:: Declaration
.. raw:: html
@dynamicMemberLookup
class Object
.. rubric:: Discussion
This class implements a dynamic member lookup, which allows you to access attributes of the Python object through this class as if it were a real Swift member. The dynamic member lookup subscript returns an optional :swift:symbol:`PytoRuntime.Object`, which is ``nil`` in case of ``AttributeError``.
This class also conforms to ``Equatable`` and ``Comparable`` which allows comparaison with ``==``, ``<``, ``>`` and other operators. It conforms to ``Sequence`` which makes the object iterable and to ``Hashable`` through the object’s identity. ``CustomStringConvertible`` provides ``description`` and ``CustomDebugStringConvertible`` provides ``debugDescription`` which correspond to ``__str__`` and ``__repr__`` respectively.
.. rubric:: Members
.. raw:: html
.. toctree::
:maxdepth: 1
s_11PytoRuntime6ObjectC3ptrSvvp
.. raw:: html
The ``PyObject *`` pointer
.. raw:: html
.. toctree::
:maxdepth: 1
s_11PytoRuntime6ObjectC7versionAA7VersionVvp
.. raw:: html
The Python version to which this object belongs.
.. raw:: html
.. toctree::
:maxdepth: 1
s_11PytoRuntime6ObjectC7symbolsAA13PythonSymbolsCSgvp
.. raw:: html
A holder for the CPython C symbols.
.. rubric:: Init / Deinit
.. raw:: html
.. toctree::
:maxdepth: 1
s_11PytoRuntime6ObjectCyA2CSgKcfc
.. raw:: html
Initializes from an optional :swift:symbol:`PytoRuntime.Object` and throws :swift:symbol:`PytoRuntime.Interpreter.Error.unhandled` if the object is ``nil``.
.. raw:: html
.. toctree::
:maxdepth: 1
s_11PytoRuntime6ObjectCfd
.. raw:: html
.. rubric:: Dynamic member lookup
.. raw:: html
.. toctree::
:maxdepth: 1
s_11PytoRuntime6ObjectC3getyACSSKF
.. raw:: html
Returns an attribute by name and throws if an error occurs.
.. raw:: html
.. toctree::
:maxdepth: 1
s_11PytoRuntime6ObjectC3set_5valueySS_ACSgtKF
.. raw:: html
Sets an attribute and throws if an error occurs.
.. raw:: html
.. toctree::
:maxdepth: 1
s_11PytoRuntime6ObjectC13dynamicMemberACSgSS_tcip
.. raw:: html
Sets or returns an attribute by name.
.. rubric:: Subscript
.. raw:: html
.. toctree::
:maxdepth: 1
s_11PytoRuntime6ObjectC7getItemyAcA8Parsable_pd_tKF
.. raw:: html
Returns an item corresponding to the given key(s) and throws an error if it fails.
.. raw:: html
.. toctree::
:maxdepth: 1
s_11PytoRuntime6ObjectC7setItem_5valueyAA8Parsable_pd_ACSgtKF
.. raw:: html
Sets an item to a key and throws an error if it fails.
.. raw:: html
.. toctree::
:maxdepth: 1
s_11PytoRuntime6ObjectCyACSgAA8Parsable_pd_tcip
.. raw:: html
Returns an item corresponding to the given key(s).
.. rubric:: Callable
.. raw:: html
.. toctree::
:maxdepth: 1
s_11PytoRuntime6ObjectC14callAsFunction_6kwargsAcA8Parsable_pSgd_SDySSAGGtKF
.. raw:: html
Calls the receiver.
.. raw:: html
.. toctree::
:maxdepth: 1
s_11PytoRuntime6ObjectC14callAsFunction4argsACSayAA8Parsable_pSgG_tKF
.. raw:: html
Calls the receiver.
.. raw:: html
.. toctree::
:maxdepth: 1
s_11PytoRuntime6ObjectC14callAsFunctionyAcA8Parsable_pSgd_tKF
.. raw:: html
Calls the receiver.
.. raw:: html
.. toctree::
:maxdepth: 1
s_11PytoRuntime6ObjectC14callAsFunction4args6kwargsACSayAA8Parsable_pSgG_SDySSAHGtKF
.. raw:: html
Calls the receiver.
.. raw:: html
.. toctree::
:maxdepth: 1
s_11PytoRuntime6ObjectC14callAsFunction_6kwargsAcA8Parsable_pSgd_SaySS_AGtGtKF
.. raw:: html
Calls the receiver.
.. raw:: html
.. toctree::
:maxdepth: 1
s_11PytoRuntime6ObjectC14callAsFunction4args6kwargsACSayAA8Parsable_pSgG_SaySS_AHtGtKF
.. raw:: html
Calls the receiver.
.. rubric:: Parsing
.. raw:: html
.. toctree::
:maxdepth: 1
s_11PytoRuntime6ObjectC5parsexyKAA8ParsableRzlF
.. raw:: html
Parses the receiver into a Swift type conforming to :swift:symbol:`PytoRuntime.Parsable` and throws if the conversion failed.
.. rubric:: Comparable
.. raw:: html
.. toctree::
:maxdepth: 1
s_11PytoRuntime6ObjectC2eeoiySbAC_AA8Parsable_pSgtFZ
.. raw:: html
.. raw:: html
.. toctree::
:maxdepth: 1
s_11PytoRuntime6ObjectC1loiySbAC_AA8Parsable_pSgtFZ
.. raw:: html
.. raw:: html
.. toctree::
:maxdepth: 1
s_11PytoRuntime6ObjectC1goiySbAC_AA8Parsable_pSgtFZ
.. raw:: html
.. raw:: html
.. toctree::
:maxdepth: 1
s_11PytoRuntime6ObjectC2leoiySbAC_AA8Parsable_pSgtFZ
.. raw:: html
.. raw:: html
.. toctree::
:maxdepth: 1
s_11PytoRuntime6ObjectC2geoiySbAC_AA8Parsable_pSgtFZ
.. raw:: html
.. rubric:: Conforms to
- ``Sendable``
- ``Equatable``
- ``Comparable``
- ``Sequence``
- ``Hashable``
- ``CustomStringConvertible``
- ``CustomDebugStringConvertible``