fork download
  1. import operator
  2.  
  3.  
  4. def yoba(cls):
  5.  
  6. cls.C = [a + b for a in cls.A for b in cls.B]
  7. return cls
  8.  
  9.  
  10. @yoba
  11. class Yoba:
  12.  
  13. A = [1, 2, 3]
  14. B = [4, 5, 6]
  15.  
  16.  
  17. y = Yoba()
  18. print(Yoba.C)
Success #stdin #stdout 0.03s 8696KB
stdin
Standard input is empty
stdout
[5, 6, 7, 6, 7, 8, 7, 8, 9]