Permalink
Browse files

At bitwise OR and AND operators to _LazyProxy

  • Loading branch information...
1 parent 3916a82 commit 77c49fe2043f37b96cecea40078a878e33f59612 @jtackaberry jtackaberry committed Jan 22, 2012
Showing with 9 additions and 0 deletions.
  1. +9 −0 src/__init__.py
View
@@ -158,6 +158,9 @@ class _LazyProxy(type):
# imports core (setattr hook)
>>> import kaa
>>> kaa.Signal.MAX_CONNECTIONS = 10000
+
+ # imports io (bitwise operator hook)
+ >>> kaa.IO_READ | kaa.IO_WRITE
"""
def __new__(cls, name, bases, dict):
if bases == (_object,):
@@ -274,6 +277,12 @@ def __dir__(cls):
def __eq__(cls, other):
return cls.__get() == other
+ def __or__(cls, other):
+ return cls.__get() | other
+
+ def __and__(cls, other):
+ return cls.__get() & other
+
def __cmp__(cls, other):
# Python 2
return cmp(cls.__get(), other)

0 comments on commit 77c49fe

Please sign in to comment.