fork download
  1. #!/usr/bin/python
  2. from __future__ import print_function
  3.  
  4.  
  5. class A(object):
  6. x = 4
  7. gen = (x for _ in range(3))
  8.  
  9.  
  10. x = 6
  11.  
  12.  
  13. def func():
  14. x = 5
  15. a = A()
  16. print(list(a.gen))
  17.  
  18.  
  19.  
  20. func()
  21.  
Success #stdin #stdout 0s 9024KB
stdin
Standard input is empty
stdout
[6, 6, 6]