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.