Skip to content

why do boolean comparisons with Py object return Py object? #294

Closed
@schlichtanders

Description

@schlichtanders

First time I am trying to use pythoncall support for defining python classes. Apparently all input arguments as well as self attributes get wrapped in Py.

This is also truth for boolean comparisons like == or != Which return Py objects.

This is difficult as we cannot simply use standard comparisons in if else && or ||, but instead need to wrap everything in Bool(...) In order to get a Julia boolean

What is the purpose of this extra complication? Wouldn't it be much easier if such boolean operators return Julia Bool values?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions