正如您所看到的,我显然在类TemplateVars中为属性“name”提供了一个getter。系统中的其他地方也有类似的代码。那么,为什么下面的代码会引发以下异常呢?email;}Exception in thread "main" java.lang.NoSuchMethodException: Property 'name' has no getter
但是,如果我定义完全相同的类而不使用任何getter方法,那么我们得到的是不同的东西:Attribute `self.x` is a property.None
当未定义getter方法时,尝试检索属性将导致调用“property definition method”(我指的是在@property下定义的方法,因为没有更好的名称)。有趣的是,在第一种情况下,在@pro