[英]i keep getting this error: what Does it mean? NameError: name 'UniversityPerson' is not defined
import sys
class UniversityPerson:
class Student(UniversityPerson):
def _init_(self, schedule):
為什么要在UniversityPerson
內部定義班級Student
? 使它們處於同一級別:
class UniversityPerson:
pass
class Student(UniversityPerson):
def __init__(self, schedule): #use double-underscores instead of single ones
pass
您不必在調用它之前定義它並對其進行初始化嗎? 也許此鏈接有所幫助: Python類定義-import語句
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.