# MatPythonSetType
Initialize a `Mat` object implemented in Python. 
## Synopsis
```
#include "petscmat.h" 
PetscErrorCode MatPythonSetType(Mat mat, const char pyname[])
```
Collective on Mat


## Input Parameters

- ***mat -*** the matrix object.
- ***pyname -*** full dotted Python name [package].module[.{class|function}]



## Options Database Key

- ***-mat_python_type <pyname> -*** python class





## See Also
 `Mat`, `MatType`, `MatCreate()`, `MatSetType()`, `MATPYTHON`, `PetscPythonInitialize()`

## Level
intermediate

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/mat/impls/python/pythonmat.c.html#MatPythonSetType">src/mat/impls/python/pythonmat.c</A>

## Examples
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ksp/ksp/tutorials/ex100.c.html">src/ksp/ksp/tutorials/ex100.c.html</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ksp/ksp/tutorials/ex100f.F90.html">src/ksp/ksp/tutorials/ex100f.F90.html</A><BR>


---
[Edit on GitLab](https://gitlab.com/petsc/petsc/-/edit/release/src/mat/impls/python/pythonmat.c)


[Index of all Mat routines](index.md)  
[Table of Contents for all manual pages](/docs/manualpages/index.md)  
[Index of all manual pages](/docs/manualpages/singleindex.md)  
