While the first part of the optimizations is great, I can't say the same with the rest -- the optimizations in get_time_of_day() and check_if_all_files_exist().
The modifications in get_time_of_day() just make it harder to read - compare:
return 'evening' if 17 <= current_time.hour < 20 else 'night'
with
elif current_time.hour in range(17, 20):
return 'evening'
else:
return 'night'
While the first one is just one-line, it is hard to read.
And as for check_if_all_files_exist(), I can't see what advantage
required_files = 'rain snow normal cloudy wind thunder'.split()
While the first part of the optimizations is great, I can't say the same with the rest -- the optimizations in
get_time_of_day()
andcheck_if_all_files_exist()
.The modifications in
get_time_of_day()
just make it harder to read - compare:with
While the first one is just one-line, it is hard to read.
And as for
check_if_all_files_exist()
, I can't see what advantagewould have over a simple
I'd like to merge only the first part of this.