Method overload

This commit is contained in:
Mert Gör 🇹🇷 2023-07-02 18:16:18 +03:00
parent 95d70e10b7
commit 51db092163
No known key found for this signature in database
GPG key ID: 2100A876D55B39B9
2 changed files with 27 additions and 0 deletions

View file

@ -0,0 +1,15 @@
class Sample:
def foo(self):
print('foo')
def tar(self):
print('bar')
Sample.bar = tar
s = Sample()
s.foo()
s.bar()
Sample.x = 100
print(Sample.x)

View file

@ -0,0 +1,12 @@
class Sample:
def foo(self):
print('foo')
def tar(self):
print('bar')
Sample.bar = tar
s = Sample()
s.foo()
s.bar()