Coverage for /pythoncovmergedfiles/medio/medio/usr/local/lib/python3.11/site-packages/psqlparse-1.0rc7-py3.11-linux-x86_64.egg/psqlparse/nodes/nodes.py: 25%

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

12 statements  

1import six 

2 

3 

4class Node(object): 

5 

6 def tables(self): 

7 """ 

8 Generic method that does a depth-first search on the node attributes. 

9 

10 Child classes should override this method for better performance. 

11 """ 

12 _tables = set() 

13 

14 for attr in six.itervalues(self.__dict__): 

15 if isinstance(attr, list): 

16 for item in attr: 

17 if isinstance(item, Node): 

18 _tables |= item.tables() 

19 elif isinstance(attr, Node): 

20 _tables |= attr.tables() 

21 

22 return _tables