网站建设大作业论文,国际企业网站建设,国内大型电子网站建设,搜索引擎网址有哪些我有一个具有很多属性的类#xff0c;这些属性在instanciating(init)时提供。看起来像这样#xff0c;但还有大约30个attr#xff1a;class SomeObject:def __init__(self,first,second):self.first firstself.second second工作正常#xff0c;但很长很重复#xff0c;…我有一个具有很多属性的类这些属性在instanciating(init)时提供。看起来像这样但还有大约30个attrclass SomeObject:def __init__(self,first,second):self.first firstself.second second工作正常但很长很重复很难更新。在我使用更小的课程之前class SomeObject:def __init__(self, **attr):self.__dict__.update(attr)工作得很好更容易但很难跟踪。当使用IDE(我使用PyCharm)时我在编写对象时没有提示自动完成提示通常不起作用。我会寻找两个类的混合如class SomeObject:def __init__(self,first,second):self.__dict__.update(???) # I would like to do it in a single line, so I dont have to write a new attr two (three...) times.有谁知道这是否可行非常感谢Python 3.4 PyCharm 2016.1 CommunityEdition...编辑/补充......问题似乎主要是“保留”IDE中的代码检查以便对象上仍然可以使用自动完成等。