'What does calling a static methods inside the method itself mean in python
I am watching a video on youtube about OOP. I encountered a type of syntax that I could not understand by my past information. The author calls the static method inside the method writing the argument at the beginning of the method's name. The method's function is to detect whether the passed number is an integer or not. The code is below:
class Dog:
@staticmethod
def is_integer(num):
if isinstance(num,float):
return num.is_integer()
elif isinstance(num,int):
return True
else:
return False
My problem is this:
What is the syntax behind num.is_integer()?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
