a guest Jun 17th, 2019 61 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. class X:
  2.   field x1
  3.   field x2
  4.   field x3
  5.   func get_x1:
  6.     return x1
  8. f(x1, x2):
  9.   - we know that we only need x1, x2
  10.   - we can use x1 and x2 directly, we don't care about how we get them
  11.   - we don't rely on class X getters
  13. f(X):
  14.   - we don't know which attributes we need, we can use x3 by mistake
  15.   - should get attributes (x1, x2), we will write more code
  16.   - if f needs more x3 we can get it easily without modifying the signature
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand