FYI - I refactored the code so that it now enforces "return_from_same_city". enjoy.
4 karma · joined December 15, 2022
However, if Y is a country, region, or continent, the return flight could be from any airport within that area, prioritizing the cheapest option. For example, if you search for a round trip: "Berlin to Asia for a week in Aug" the arrival could be Bangkok, but the departure for your return flight could be from Singapore.
Now that you mention it, I wonder if it would be better to enforce return_from_same_city or allow the user to toggle this option. What do you think?