Defect prediction approaches have been greatly contributing to software quality assurance activities such as code review or unit testing. Just-in-time defect prediction approaches are developed to predict whether a commit is a defect-inducing commit or not. Prior research has shown that commit-level prediction is not enough in terms of effort, and a defective commit may contain both defective and non-defective files. As the defect prediction community is promoting fine-grained granularity prediction approaches, we proposed our novel class-level prediction, which is more fine-grained than the file-level prediction, based on the files of the commits in this research. We designed our model for python projects and tested it with nine open-source python projects. We performed our experiment with two settings: setting with product metrics only and setting with product metrics plus commit information. We proved that applying commit information to the class-level prediction model can improve 30% of the performance in terms of AUC-ROC. Finally, we developed a commit-based file-level defect prediction model and compared it with the commit-based class-level defect prediction. Our findings reveal that the latter approach not only contributes to the fine-grained granularity but is also better in performance than the former one.