ChatCrawlersearch across public Telegram Open the app
P

Python

сообщение · 2025-08-29 07:21 UTC
A
class Fruit: def __init__(self, name, color): self.name = name self.color = color class Apple(Fruit): def __init__(self, name, color, variety, region): super().__init__(name, color) self.variety = variety self.region = region def describe(): print(f"{self.name, self.color, self.variety, self.region} are correct.") x = Fruit("Apple", "red") y = Apple("Apple", "red", "Fuji", "X_place") z = Apple(x, "Fuji", "X_place") print(x) print(y) print(z) now if you print, I'll get error that I'm missing one argument in z. I don't want to keep refilling parent's parameters everytime I create a new object.

Вся лента · оригинал в Telegram

Open in Telegram Каталог площадок Искать в ChatCrawler

A snapshot of an open public feed from the search index ChatCrawler — “Google for public Telegram”; refreshed as the venue is crawled. Times are UTC.

Public content only, official Telegram API. About · FAQ · What we do not do · Remove a page · Catalog