parameters: (self, pyname)
return_statement: return full_cpp_type
docstring: Get the last registered C++ type for a Python type.
  
      Some Python types have multiple C++ types registered. Most (e.g.,
      a class defined in a .clif file) only have a single type registered.
      For reasons unknown, the last registered type is what gets used
      as the preferred C++ type.
  
      Args:
        pyname: str, the name of the type. It can be a dotted name, e.g. 'A.B'.
  
      Returns:
        str, the fully qualified C++ type name that was last mapped to the Python
        type.
  
      Raises:
        NameError: on unknown Python type.
docstring_summary: Get the last registered C++ type for a Python type.
docstring_tokens: Get the last registered C ++ type for a Python type .
function: def get_last_cpp_type(self, pyname):
      """Get the last registered C++ type for a Python type.
  
      Some Python types have multiple C++ types registered. Most (e.g.,
      a class defined in a .clif file) only have a single type registered.
      For reasons unknown, the last registered type is what gets used
      as the preferred C++ type.
  
      Args:
        pyname: str, the name of the type. It can be a dotted name, e.g. 'A.B'.
  
      Returns:
        str, the fully qualified C++ type name that was last mapped to the Python
        type.
  
      Raises:
        NameError: on unknown Python type.
      """
      parts = pyname.split('.')
      fq_cpp_name_parts = []
  
      current = self._find_entry(parts[0])
      if not current:
        raise NameError('Unknown Python type: {!r}'.format(pyname))
  
      for name in parts:
        entry = current.get_nested_type(name)
        cpp_type = entry.get_last_cpp_type()
        if cpp_type:
          # TODO: add a test where an absolute type is registered
          # under a dotted name. Some stubby Response.Code tests failed due to
          # something like that going on. Need a test with a line like
          #   // CLIF use `::Response::Code` as Response.Code
          # An inner type can be mapped to an absolute C++ type, in which case,
          # we don't want to prefix it with the parent. So just reset the parts.
          # Keep iterating, though, since we need to continue down to the
          # final name part.
          if cpp_type.startswith('::'):
            fq_cpp_name_parts = [cpp_type]
          else:
            fq_cpp_name_parts.append(cpp_type)
        current = entry
  
      full_cpp_type = '::'.join(fq_cpp_name_parts)
  
      # If types get registered and/or re-joined incorrectly, it can generate
      # names that are malformed, usually by joining two empty names or
      # a relative and absolute name. This helps catch that simple case.
      assert ':::' not in full_cpp_type, 'Malformed C++ typename: {}'.format(
          full_cpp_type)
      return full_cpp_type
function_tokens: def get_last_cpp_type ( self , pyname ) : parts = pyname . split ( '.' ) fq_cpp_name_parts = [ ] current = self . _find_entry ( parts [ 0 ] ) if not current : raise NameError ( 'Unknown Python type: {!r}' . format ( pyname ) ) for name in parts : entry = current . get_nested_type ( name ) cpp_type = entry . get_last_cpp_type ( ) if cpp_type : # TODO: add a test where an absolute type is registered # under a dotted name. Some stubby Response.Code tests failed due to # something like that going on. Need a test with a line like #   // CLIF use `::Response::Code` as Response.Code # An inner type can be mapped to an absolute C++ type, in which case, # we don't want to prefix it with the parent. So just reset the parts. # Keep iterating, though, since we need to continue down to the # final name part. if cpp_type . startswith ( '::' ) : fq_cpp_name_parts = [ cpp_type ] else : fq_cpp_name_parts . append ( cpp_type ) current = entry full_cpp_type = '::' . join ( fq_cpp_name_parts ) # If types get registered and/or re-joined incorrectly, it can generate # names that are malformed, usually by joining two empty names or # a relative and absolute name. This helps catch that simple case. assert ':::' not in full_cpp_type , 'Malformed C++ typename: {}' . format ( full_cpp_type ) return full_cpp_type