Answers for "check if object is instance of class python"

5

python check if class has function

class A:
  def func():
    pass
hasattr(A(), 'func')
Posted by: Guest on July-03-2020
1

isinstance several variables

'check if variables days, months or years are all integers
if not all(isinstance(i, int) for i in [days, months, years]):
Posted by: Guest on September-05-2020

Code answers related to "check if object is instance of class python"

Python Answers by Framework

Browse Popular Code Answers by Language