This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ROType(type): | |
def __new__(mcl, classname, bases, classdict): | |
class UniqueROType (mcl): | |
pass | |
def getAttrFromMetaclass(attr): | |
return lambda cls: getattr(cls.__metaclass__, attr, None) | |
for attr, value in classdict.items(): | |
if not hasattr(value, '__call__') and attr.startswith('_') and not attr.startswith('__'): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import timeit | |
def while_var(): | |
count = 1000 | |
while(count > 0): | |
count -= 1 | |
def while_break(): | |
count = 1000 | |
while(1): |