From: Kent Gibson <warthog618@gmail.com>
To: brgl@bgdev.pl
Cc: linux-gpio@vger.kernel.org
Subject: Re: [libgpiod][PATCH 0/2] support casting line.Value to bool
Date: Thu, 23 May 2024 08:32:37 +0800 [thread overview]
Message-ID: <20240523003237.GA15863@rigel> (raw)
In-Reply-To: <20240522235712.GA5330@rigel>
On Thu, May 23, 2024 at 07:57:12AM +0800, Kent Gibson wrote:
> On Wed, May 22, 2024 at 09:22:50AM -0700, brgl@bgdev.pl wrote:
> > On Wed, 22 May 2024 02:46:41 +0200, Kent Gibson <warthog618@gmail.com> said:
> > > While writing a gpiod plugin for gpiozero (Python), I had to map line.Value
> > > to its bool equivalent. Casting seemed the obvious way to go, as it is
> > > essentially a boolean, but that didn't work as I expected - it always
> > > returned True. This is the case for any Python type that does not provide
> > > a suitable conversion operator.
> > >
> > > This series adds support for casting line.Value to bool.
> > >
> >
> > Ha! Interesting. Do you think we may need it anywhere else too?
> >
>
> I guess the same applies to the C++ and Rust bindings - I'll have to
> check.
>
Or do you mean other fields? There wasn't anything in line.py - all the
other enums are non-binary. And nothing else springs to mind.
Cheers,
Kent.
next prev parent reply other threads:[~2024-05-23 0:32 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-05-22 0:46 [libgpiod][PATCH 0/2] support casting line.Value to bool Kent Gibson
2024-05-22 0:46 ` [libgpiod][PATCH 1/2] bindings: python: tests: add test for " Kent Gibson
2024-05-22 0:46 ` [libgpiod][PATCH 2/2] bindings: python: support " Kent Gibson
2024-05-22 16:22 ` [libgpiod][PATCH 0/2] " brgl
2024-05-22 23:57 ` Kent Gibson
2024-05-23 0:32 ` Kent Gibson [this message]
2024-05-23 7:50 ` Bartosz Golaszewski
2024-05-23 7:55 ` Bartosz Golaszewski
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240523003237.GA15863@rigel \
--to=warthog618@gmail.com \
--cc=brgl@bgdev.pl \
--cc=linux-gpio@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).