[petsc-users] petsc4py bool type

Jed Brown jed at jedbrown.org
Tue Apr 25 20:27:38 CDT 2017


Barry Smith <bsmith at mcs.anl.gov> writes:

>> On Apr 25, 2017, at 1:36 PM, Zhang, Hong <hongzhang at anl.gov> wrote:
>> 
>> PetscBool is indeed an int. So there is nothing wrong. PETSc does not use bool in order to support C89.
>
>   Yes, but in Python using a bool is more natural. For example in Fortran PETSc uses the Fortran logical as the PetscBool

Right, there is no requirement or even convenience in the Python native
type having the same bit representation.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 832 bytes
Desc: not available
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20170425/4e7f2778/attachment.pgp>


More information about the petsc-users mailing list