testing for GType == 0



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]