__init__
PYL-W0201312 return frame
313
314 def open_settings_window(self):
315 self.settings = Settings(self)316
317 def change_appearance_mode_event(self, new_appearance_mode: str):
318 set_appearance_mode(new_appearance_mode)
253 if self.y is None
254 else self.y + self.attach.winfo_rooty()
255 )
256 self.width_new = (257 self.attach.winfo_width() - 45 + self.corner
258 if self.width is None
259 else self.width
248 if self.x is None
249 else self.x + self.attach.winfo_rootx()
250 )
251 self.y_pos = (252 self.attach.winfo_y() + self.attach.winfo_reqheight() + 5
253 if self.y is None
254 else self.y + self.attach.winfo_rooty()
296 if self.x is None
297 else self.x + self.attach.winfo_rootx()
298 )
299 self.y_pos = (300 self.attach.winfo_rooty() + self.attach.winfo_reqheight() + 5
301 if self.y is None
302 else self.y + self.attach.winfo_rooty()
243 self.disable = True
244
245 def place_dropdown(self):
246 self.x_pos = (247 self.attach.winfo_x()
248 if self.x is None
249 else self.x + self.attach.winfo_rootx()
Defining an instance attribute outside __init__
affects the readability of code. It is expected to find all the attributes an instance may have by reading its __init__
method. If there is a need to initialize attribute via sub-initialization methods, it is recommended to assign attributes to None
in the init then call the sub-initialization methods.