ChatCrawlersearch across public Telegram Open the app
P

Python

сообщение · 2025-08-29 09:40 UTC
I
Replymessage unavailable
Instead of letting Apple handle both cases, you could make a factory function that “remembers” the shared values: def apple_factory(kind, color): def create(variety, place): return Apple(kind, color, variety, place) return create make_red_apple = apple_factory("Apple", "red") x = make_red_apple("Fuji", "X_place") y = make_red_apple("Fuji", "Y_place") z = make_red_apple("Fuji", "Z_place") That keeps Apple’s constructor simple, but you still avoid rewriting the first two args.

Вся лента · оригинал в 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