static method alternative
This commit is contained in:
parent
50630be6f0
commit
76a020b50c
7
python-temel/staticmethod.alternative.py
Normal file
7
python-temel/staticmethod.alternative.py
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
class Sample:
|
||||||
|
def foo(): # bu nasıl metot?
|
||||||
|
print('foo')
|
||||||
|
|
||||||
|
Sample.foo() # geçerli
|
||||||
|
s = Sample()
|
||||||
|
#s.foo() # error!
|
7
python-temel/staticmethod.alternative.py~
Normal file
7
python-temel/staticmethod.alternative.py~
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
class Sample:
|
||||||
|
def foo(): # bu nasıl metot?
|
||||||
|
print('foo')
|
||||||
|
|
||||||
|
Sample.foo() # geçerli
|
||||||
|
s = Sample()
|
||||||
|
s.foo() # error!
|
Loading…
Reference in New Issue
Block a user