testing for GType == 0
- From: jcupitt gmail com
- To: "python-hackers-list gnome org" <python-hackers-list gnome org>
- Subject: testing for GType == 0
- Date: Sat, 18 Jun 2016 13:06:42 +0100
Hi all, I have a stupid question.
I'm calling a function that does a type lookup, and it can return 0
for type not found. What's the best way to test for this in my
overrides?
At the moment I'm doing:
gtype = Some.function(thing)
if gtype.name == 'invalid':
# we had a zero return
But there must be a better way.
John
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]