Is it possible in python to restrict parameter type in python. I tried using List module from typing, but it still allows user to pass class object or an int parameter without giving error.
from typing import List
class Job:
def __init__(self):
self.profit = 0
self.deadlines = 0
class JobsWithDeadlines:
def get_Job_Sequencing_with_deadlines(self, jobs: List[Job]):
print(type(jobs))
j = Job()
j.profit = 20
j.deadline = 2
obj = JobsWithDeadlines()
obj.get_Job_Sequencing_with_deadlines(1)