如何从外部类访问内部属性类?

时间:2019-12-01 22:35:44

标签: python

作为标题。该类在内部类中设置属性值。然后,从外部函数访问该内部属性类。在下面,使用内部函数set_error设置属性集。然后,使用外部函数last_error来访问错误。

const pokemonNames = PokemonData.map(p => p.name); // using 'as const' throws a compile-time error
type PokemonName = ArrayType<typeof pokemonNames>;

1 个答案:

答案 0 :(得分:0)

last_error更改为:

  def last_error(self):
    return self.identify.error_info

您想得到identify的错误。您已经在构造函数中初始化了identify,所以现在就可以使用它。

相关问题