[pyclutter/wip/introspection] container: Implement __bool__ and __nonzero__
- From: Bastian Winkler <bwinkler src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [pyclutter/wip/introspection] container: Implement __bool__ and __nonzero__
- Date: Tue, 6 Dec 2011 18:24:23 +0000 (UTC)
commit f36ff262bc6d2c9d5c088b94eb45c983acb6cfab
Author: Bastian Winkler <buz netbuz org>
Date: Tue Dec 6 08:55:05 2011 -0600
container: Implement __bool__ and __nonzero__
introspection/Clutter.py | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)
---
diff --git a/introspection/Clutter.py b/introspection/Clutter.py
index e1d1da6..51839df 100644
--- a/introspection/Clutter.py
+++ b/introspection/Clutter.py
@@ -582,6 +582,12 @@ class Container(Clutter.Container):
def __len__(self):
return len(self.get_children())
+ def __bool__(self):
+ return True
+
+ # alias for Python 2.x object protocol
+ __nonzero__ = __bool__
+
def __contains__(self, actor):
return actor in self.get_children()
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]