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()