Advertisement
Guest User

Untitled

a guest
Jun 24th, 2020
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.20 KB | None | 0 0
  1. a = object()
  2. a.z = 10 # AttributeError: 'object' object has no attribute 'z'
  3.  
  4. class pepega(object):
  5.     def __init__(self):
  6.         super().__init__()
  7.  
  8. p = pepega()
  9. p.z = 10 # No error
  10. print(p.z) # -> 10
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement