[petsc-users] petsc4py bool type
Barry Smith
bsmith at mcs.anl.gov
Tue Apr 25 20:37:46 CDT 2017
> On Apr 25, 2017, at 8:27 PM, Jed Brown <jed at jedbrown.org> wrote:
>
> 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.
Hopefully the petsc4py developers or users could add implementation "feature".
More information about the petsc-users
mailing list