title: what is the python C api function that returns a PyObject using the object name
body: <p>I'm embedding Python into my C++ and creating <code>PyObject</code>s to represent my data/objects (<em>ints, doubles, strings, etcetera</em>).</p>
  <p>I've put in several hours trying to find the answer to the above question, I expected there'd be a &quot;<em>name</em>&quot; property or &quot;<em>name()</em>&quot; method to set, and reference, the canonical object name used in Python script (<em>as global/local objects</em>), that there'd be a function:</p>
  <pre><code>PyObject *PyObject_ByName(PyObject *PyObjs, char* name)
  </code></pre>
  <blockquote>
  <pre><code>Return value: New reference. Part of the Stable ABI.
  Return a new PyObject reference from an array of PyObjs that match the 'name', or NULL on failure.
  </code></pre>
  </blockquote>
  <p>What am I missing?  I see all the other pieces in place.</p>
  <pre><code>MSEXPORT PyObject* PyVariant(VarObj* data, tLvVarErr* error) {
      PyObject* module_name, * module, * dict, * python_class, * object;
  
      PyObject *pValue = NULL; // &lt;- what I want to set name
      switch (data-&gt;data.index())
      {
      case VarIdx::I32:
          pValue = PyLong_FromLong((long) get&lt;int32_t&gt;(data-&gt;data));
          break;
      case VarIdx::DBL:
          pValue = PyFloat_FromDouble ((double) get&lt;double&gt;(data-&gt;data));
          break;
      case VarIdx::Str :
          pValue = PyUnicode_FromString((char*) get&lt;string*&gt;(data-&gt;data)-&gt;c_str());
          break;
      default:
          return NULL;
      }
      return pValue;
  }
  </code></pre>