Advertisement
c32team

python #6

Jun 13th, 2024
310
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.16 KB | None | 0 0
  1. def extender(cls):
  2.    cls.hello = lambda self, name: print(f'Hello, {name}')
  3.    return cls
  4.  
  5. @extender
  6. class Client:
  7.    pass
  8.  
  9.  
  10. c = Client()
  11. c.hello('Tom')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement