Coverage for /pythoncovmergedfiles/medio/medio/src/underscore/underscore/declaration.py: 93%

Shortcuts on this page

r m x   toggle line displays

j k   next/prev highlighted chunk

0   (zero) top of page

1   (one) first highlighted chunk

15 statements  

1# Copyright (c) 2013 Huan Do, http://huan.do 

2 

3class Declaration(object): 

4 def __init__(self, name): 

5 self.name = name 

6 self.delete = False 

7 self._conditional = None 

8 

9 @property 

10 def conditional(self): 

11 assert self._conditional is not None 

12 return self.delete or self._conditional 

13 

14def generator(): 

15 _ = '_' 

16 while True: 

17 # yield Declaration('_' + str(len(_))) 

18 yield Declaration(_) 

19 _ += '_'